01-19-2017, 02:20 AM
|
#41 (permalink)
|
EcoModding Lurker
Join Date: Jan 2017
Location: finland
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
If you are making deep save mode why would it not still save settings when entering to powesave? Failsafe is important
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
01-19-2017, 03:26 AM
|
#42 (permalink)
|
EcoModding Apprentice
Join Date: Feb 2009
Location: Estonia
Posts: 199
Thanks: 19
Thanked 40 Times in 28 Posts
|
Quote:
Originally Posted by t vago
I do not currently use GIT, so there is no available repo. I post the latest version here on Ecomodder, and keep all of the previous versions on my network storage, and (for November 2016 and later) in a Gmail draft email as attachments. I've got versions dating from 2013 July 06.
|
How do you make versions - is it just file copy with date in filename or smth?
That way you have some kind of history, but it is not version history - you cannot see DIFFs, and and comment you can add when committing changes to GIT or SVN. You could push all your versions to repo (copypaste file over, vommit, copypaste nd commit ...) just commit dates are all in same date.
Quote:
Originally Posted by t vago;
I work on this code from several different locations. One of them does not allow access to GitHub.
|
Then maybe try bitbucket? If you work with laptop, you can actually commit changes to GIT even when offline! (git push uploads them to online repo).
Or you can edit your code in memory stick and local repo is there too - so you can work anywhere, but push commits to online repo when you have online access.
Really...try it, it is worth it to have version history with differences line-by line what you changed when making every new feature (when something breaks you can track it down when and what caused new bug)
|
|
|
01-19-2017, 03:30 AM
|
#43 (permalink)
|
EcoModding Apprentice
Join Date: Feb 2009
Location: Estonia
Posts: 199
Thanks: 19
Thanked 40 Times in 28 Posts
|
Quote:
Originally Posted by Uusitalo
If you are making deep save mode why would it not still save settings when entering to powesave? Failsafe is important
|
I think you can disconnect it after it goes to sleep if you really want. At least my code saves tank data to EEPROM just before going to sleep.
When I measured current consumption, it was 20mA when backlight was off but mpguino was "on", when it went to sleep, it consumed 5mA.
So if you are worried draining your battery when bike sits unused more than 1-2days, you can disconnect it when it is sleeping.
|
|
|
01-19-2017, 09:17 AM
|
#44 (permalink)
|
MPGuino Supporter
Join Date: Oct 2010
Location: Hungary
Posts: 1,807
iNXS - '10 Opel Zafira 111 Anniversary Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
|
Quote:
Originally Posted by Uusitalo
If you are making deep save mode why would it not still save settings when entering to powesave? Failsafe is important
|
My code does save trip data to EEPROM as a step in entering deep sleep. It then retrieves this stored trip data as part of the power-up initialization. If power is lost for some reason while MPGuino is sleeping, it'll recover just fine.
Last edited by t vago; 01-19-2017 at 09:28 AM..
|
|
|
01-19-2017, 09:27 AM
|
#45 (permalink)
|
MPGuino Supporter
Join Date: Oct 2010
Location: Hungary
Posts: 1,807
iNXS - '10 Opel Zafira 111 Anniversary Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
|
Quote:
Originally Posted by meelis11
How do you make versions - is it just file copy with date in filename or smth?
That way you have some kind of history, but it is not version history - you cannot see DIFFs, and and comment you can add when committing changes to GIT or SVN. You could push all your versions to repo (copypaste file over, vommit, copypaste nd commit ...) just commit dates are all in same date.
|
Yes, it is a file copy with date in the filename.
I can make DIFFs, as required, with my text editor. Believe me, it has become very invaluable many times during the past several months.
As to the rest? I suppose they're useful, but my experience these past several years suggests that it's not strictly necessary to post comments on every tiny bit of minutiae, but just the major changes and feature adds. Might be nice to have a searchable history, though...
Quote:
Originally Posted by meelis11
Then maybe try bitbucket? If you work with laptop, you can actually commit changes to GIT even when offline! (git push uploads them to online repo).
Or you can edit your code in memory stick and local repo is there too - so you can work anywhere, but push commits to online repo when you have online access.
Really...try it, it is worth it to have version history with differences line-by line what you changed when making every new feature (when something breaks you can track it down when and what caused new bug)
|
I use the "compare files" feature of my text editor to track line-by-line changes, and it has helped me enormously with tracking down new bugs.
|
|
|
01-19-2017, 10:12 AM
|
#46 (permalink)
|
EcoModding Apprentice
Join Date: Feb 2009
Location: Estonia
Posts: 199
Thanks: 19
Thanked 40 Times in 28 Posts
|
Quote:
Originally Posted by t vago
Yes, it is a file copy with date in the filename.
I can make DIFFs, as required, with my text editor. Believe me, it has become very invaluable many times during the past several months.
As to the rest? I suppose they're useful, but my experience these past several years suggests that it's not strictly necessary to post comments on every tiny bit of minutiae, but just the major changes and feature adds. Might be nice to have a searchable history, though...
|
you can push changes only when new feature is ready - it is not good practice anyway to push changes when new feature is not complete and gives compilation errors. I think for some people DIFF would be nice thing to see when new feature is ready
|
|
|
01-19-2017, 11:03 AM
|
#48 (permalink)
|
MPGuino Supporter
Join Date: Oct 2010
Location: Hungary
Posts: 1,807
iNXS - '10 Opel Zafira 111 Anniversary Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
|
Quote:
Originally Posted by meelis11
you can push changes only when new feature is ready - it is not good practice anyway to push changes when new feature is not complete and gives compilation errors. I think for some people DIFF would be nice thing to see when new feature is ready
|
New features are given their own #define/#ifdef combination, and the #define is commented out until I consider the new feature to be ready. It seems to have worked well these past several years.
All features also undergo testing on three separate test platforms, before I consider them ready. I have a JellyBeanDriver MPGuino that doubles as my Magnum's fuel monitor, I have an Arduino AtMega2560 with a 5-position Parallax analog joystick and a Parallax serial LCD module, and I have a TinkerKit! LCD module with another Parallax 5-position analog joystick (the TinkerKit! LCD module is nothing more than an Arduino Leonardo with an attached HD44780-compatible 16x2 LCD display, and a few handy electrical connectors).
My testing mainly makes sure that the feature in question actually works as intended. Secondary concerns (e.g., the horsepower readout on the accel test feature shows "PSI" instead of "HP") will be worked on as time permits.
Quote:
Originally Posted by meelis11
|
I get these errors when I tried to compile your code just now. Does your code require an obsolete version of Arduino IDE for successful compilation?
Code:
Arduino: 1.6.12 (Windows 7), Board: "Arduino/Genuino Uno"
mpguino:802: error: 'prog_char' was not declared in this scope
char *getStr(prog_char * str) {
^
mpguino:802: error: 'str' was not declared in this scope
char *getStr(prog_char * str) {
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
from sketch\mpguino_code_meelis11.ino.cpp:1:
mpguino:40: error: variable 'chars' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static char chars[] PROGMEM = {
^
mpguino:53: error: variable 'barchars' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static char barchars[] PROGMEM = {
^
mpguino:326: error: 'prog_char' does not name a type
prog_char * displayFuncNames[displayFuncSize];
^
C:\Users\vagota\Downloads\mpguino_code_meelis11\mpguino.ino: In function 'void setup()':
mpguino:346: error: 'displayFuncNames' was not declared in this scope
displayFuncNames[x++]= PSTR("Custom");
^
mpguino:389: error: 'getStr' cannot be used as a function
LCD::print(getStr(PSTR("OpenGauge")));
^
mpguino:391: error: 'getStr' cannot be used as a function
LCD::print(getStr(PSTR(STARTUP_TEXT)));
^
C:\Users\vagota\Downloads\mpguino_code_meelis11\mpguino.ino: In function 'void loop()':
mpguino:625: error: 'getStr' cannot be used as a function
LCD::print(getStr(PSTR("Setup ")));
^
mpguino:631: error: 'getStr' cannot be used as a function
LCD::print(getStr(PSTR("Tank Reset ")));
^
mpguino:636: error: 'getStr' cannot be used as a function
LCD::print(getStr(PSTR("Current Reset ")));
^
mpguino:655: error: 'displayFuncNames' was not declared in this scope
LCD::print(getStr(displayFuncNames[SCREEN]));
^
mpguino:655: error: 'getStr' cannot be used as a function
LCD::print(getStr(displayFuncNames[SCREEN]));
^
mpguino:661: error: 'getStr' cannot be used as a function
LCD::print(getStr(PSTR("DragRace Reset")));
^
mpguino:672: error: 'getStr' cannot be used as a function
LCD::print(getStr(PSTR("Brightness ")));
^
mpguino:680: error: 'displayFuncNames' was not declared in this scope
LCD::print(getStr(displayFuncNames[SCREEN]));
^
mpguino:680: error: 'getStr' cannot be used as a function
LCD::print(getStr(displayFuncNames[SCREEN]));
^
C:\Users\vagota\Downloads\mpguino_code_meelis11\mpguino.ino: At global scope:
mpguino:802: error: redefinition of 'char* getStr'
char *getStr(prog_char * str) {
^
C:\Users\vagota\Downloads\mpguino_code_meelis11\mpguino.ino:802:8: note: 'char* getStr' previously defined here
char *getStr(prog_char * str) {
^
mpguino:802: error: 'prog_char' was not declared in this scope
char *getStr(prog_char * str) {
^
mpguino:802: error: 'str' was not declared in this scope
char *getStr(prog_char * str) {
^
exit status 1
'prog_char' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
|
|
|
01-20-2017, 02:42 AM
|
#49 (permalink)
|
EcoModding Apprentice
Join Date: Feb 2009
Location: Estonia
Posts: 199
Thanks: 19
Thanked 40 Times in 28 Posts
|
Quote:
Originally Posted by t vago
I get these errors when I tried to compile your code just now. Does your code require an obsolete version of Arduino IDE for successful compilation?
|
Seems that new versions does give errors, probably needs some changes - Arduino IDE 1.0.6 compiles that code succesfully.
|
|
|
01-20-2017, 02:06 PM
|
#50 (permalink)
|
EcoModding Apprentice
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
|
Hi t vago
Quote:
Originally Posted by t vago
I think I will keep available both a "latest version" and a "version last known to upload successfully to the AtMega2560," at least until they finally figure out why the AtMega2560 occasionally fails to program.
|
I think it's a combination of several factors that causes the error so it's hard to find.
But when I can, I will update the bootloader to correct some of the known bugs.
Thanks
José Rodrigues
|
|
|
The Following User Says Thank You to josemapiro For This Useful Post:
|
|
|