except: English ;-) and German
As requested by Helle, the translation for the battery range for the BATTGRAPH was missing.
Now the language.h in translations needs adaption.
hopefully this do not break anything, but I noticed mix is actually set to 0 therefore only negative weight values needs the helper function. That's good.
Additionally I noticed a weight of 100 do not need to be set because it's done in setDest anyway. Reduced flash cost about 36bytes.
Prevent a little bit code increase necessary because of new offset, weight handling.
Saved me 12 bytes flash.
However not sure if md_SetWeight(md, XXXX) is not necessary for all weight settings from template. Currently only for negative values done.
Will try how much code cost this is. Can we rely the memory is 0 for all mix elements?
This combines now the changes from branch PerformanceOptimizations to trunk
Mainly this change should do following:
- Flash savings should be around 224 bytes for stock
- Added option ARITHMETIC_OVERFLOW_CHECK to prevent overflows.
Still not bulletproof, but codecost is about 50 bytes
- Increases mix speed about 25 - 30% depending on task for stock
Also increased for other boards, but they may not notice...
- Increased ranges for weight and offset from +-125% to +-245%
- Easier now to increase number of GVARS if needed; Just increase GVAR_MAX in myeeprom.h.
But!!!! EEPROM layout changes and may not be compatible. Do this for own proposes.
Till now we do not know how we handle this in future.
- Corrected Timer for stock if used together with AUDIO or VOICE option
- See comments below, what I potentially forgotten...
Be aware this version is currently not compatible to companion9x. But the version before wasn't either. Work is current in progress to tie this up.
I would like Bertrand to check this version. It's currently my proposal for the merge. It holds following changes:
- Introduced constant RESERVE_RANGE_FOR_GVARS to make number of MAX_GVARS independent.
- NEGATIVE_SHIFT_CORRECTION is now set by makefile by default instead inside the code
The would at least give the option to save code and have less precise calculation.
- ex_chans is included like in trunk. No change here, because it would break output as input.
Actually this version would reduce the effort to merge:
- We stay with the GVARS defines we had till now
- We reserve for ranges space for 10 GVARS, which do not hurt, because we doubled ranges anyway.
- We stay with 5 GVARS in the moment. According my poll not many people currently use GVARS.
Therefore there is plenty of time finding here a better solution. I expect the number of
people will increase soon, but up to this moment 5 GVARS are more than enough.
- The layout of EEPROM for the values is already the new format. That means when we allow more GVARS in future, at least the parameters like weight, offset, etc. needs no additional conversion.
What do you think. Should we go this way?
This version reverts r2029.
It also activates CORRECT_NEGATIVE_SHIFTS by default and activates ARITHMETIC_OVERFLOW halfway.
Unfortunately this removes a lot of flash optimization but is necessary to work properly.
Maybe we find later a better solution.
Of interest: That different way of displaying the custom screen items I introduced in r2033 for conveniency happens to save a whopping 92 bytes on stock!! I forgot about stock when doing it, and when I remembered I expected it would be the opposite and I'd get a slap...
Might be worth looking if this could be replicated in other places!
Warning!!!
==========
Be aware this version is in branch and is not supported currently by Companion9x. Whatever you configure will be lost in final version!
Because EEPROM interpretation changes anyway because of higher offset and weight values possible in this branch, I tried to align the bits a little bit different to allow a higher number of GVARS. The code change is nearly flash neutral. It costs only 18 bytes flash, but would us allow to either increase range for weight and offset further, or allow more GVARS.
I set it to 9 for this branch now. Please try and report.
It's very easy now to adjust the GVARS number by changing the constant in myeeprom.h. Just change the MAX_GVARS constant for your build in myeeprom.h in the beginning of the file.
The lower MAX_GVARS the higher is the possible number for weight and offset and vice versa.
That is quite likely too complicated for conversion so we need to agree maximum for GVARS.
Not sure in the moment, but this is a branch only and is just to play with it.
Not sure how Bertrand would like this anyway, so may be removed at all.