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?
brief:
------
* added compile options to makefile:
- CORRECT_NEGATIVE_VALUES
- EXTENDED_EXPO_CURVE
* bugfix for Timer calculation if AUDIO or VOICE was selected for stock and Gruvin
* bugfix for Throttle timer calculation
* small flash savings about 28 bytes if SLOW wasn't moved, now only 20 bytes
* SLOW calculation moved to beginning, but no weight compensation
detailed
--------
Makefile options:
Like all other options this is set either to YES or NO. Both are default NO.
This gives the user the possibility to choose themselves about which precision they want.
Or if they want a greater EXPO range, both increases code of course. The code changes are explained in detail in source code and earlier version of this branch.
Bugfix for Timer calculation if AUDIO or VOICE was selected for stock and Gruvin
Need again some reports. I noticed there was a correction algorithm activated for 10msec call generated. For some unknown reasons, the correction was disabled, if AUDIO or VOICE was selected. This fix should make it working again. The clock was actually too fast. It's about 5 - 6 seconds per hours. Should be correct now, please test and report.
Also the IRQ disabled the timer IRQ while it is on. This is wrong as well and saved code.
Bugfix for Throttle timer calculation
Actually the throttle calculations leads to an overrun if full throttle was given. Due to -1 calculation problem this issue was not seen, because it was 1 digit smaller. With the CORRECT_NEGATIVE_VALUE option actually the full range was used, and boom, throttle timer didn't work. This fix actually corrects this and made the code about 28 bytes smaller and faster.
SLOW calculation moved to beginning, but no weight compensation
As stated by bsongis I moved the SLOW calculation to the beginning. This matches to most other remote controls. However I still left the weight compensation out. This would cost 90 bytes flash and a slow division. Basically if we move the SLOW feature to the beginning it changes the meaning for SLOW. It is not actually defining the output speed in percentage per second. It is defining the input speed in % per second. In this case a mix with high weight will move faster as a mix with small weight. That's the same for other remote controls as well.
Doing this compromise only costs 8 additional bytes of flash.
[ARM] No SD support after a Tx reboot on ARM flavors
[all] Issue 194 fixed (negative GVARS - on all boards!)
[all] Vario small change on center high limit