Percentage implementation
Settings fix, formatting
Add support for different number of motors
Optimize and cut superfluous code
Hard-add mixer.h
Formatting adjustment to fit BF standards, linking error in unittest fix attempt
Add stubs and variables for unittests
Character based indicators
Change output to special characters
Fix spacing
Update test code, add variable
Include changes as per peer review
Current logic produces excessive load because it updates the filter cutoffs every PID loop based on the throttle value.
The throttle values only change based on receive RX packets so they change relatively infrequently compared to the PID loop. However with rc smoothing on throttle the value can change every PID loop. But in reality we don't really need to adjust the filter cutoffs for every tiny change to the floating point throttle value.
This change quantizes the throttle in to 100 steps and uses that to compare to the previous value to decide if the filter cutoffs need to be updated. While this reduces the resolution of the filter cutoffs it in turn dramatically reduces the processing overhead. IF needed the quantization steps can be increased for more resolution but at the cost of some performance.
Adds a race start assistance system that allows the pilot to pitch forward and then release the sticks with the quad holding position for the race start.
The MOTOR_STOP logic is designed to stop the motors if:
1. MOTOR_STOP feature is enabled
2. Airmode is disabled
3. Throttle is at minimum
The problem is that this also applied during GPS Rescue and if the pilot had these conditions the motors would stop. Changed to disable MOTOR_STOP while GPS Rescue is active.
Also if stick-arming is used the MOTOR_STOP logic also will auto-disarm after 5 seconds (auto_disarm_delay). Disable this also when GPS Rescue is active.
If the current sensor wasn't configured (or the mahDrawn was still zero) then there would be a division by zero error in the remaining time OSD element calculation. Rearranged the logic to prevent.
Remove unnecessary decidegrees conversions as all temperature providers are in degrees celcius.
Fixed rounding for imperial units.
Fixed data type error in core temp warning element. Temperature is captured as int16 and can be negative but logic was using uint8 leading to an underflow for negative temperatures and a false alarm triggering.
If osd_ah_max_pit was set to zero there would be a divide by zero error in the calculations for the OSD artificial horizon. Using zero for osd_ah_max_pit is a valid use-case to disable the vertical pitch component in the artificial horizon so we can't simply change the parameter range.
Previously the g-force element was being display using integer math and truncating the float value. This lead to the g-force displaying 0.9 much of the time. Changed to use rounding to one decimal place.
Also avoid the g-force calculation unless the element or post-flight statistic are enabled. This saves unnecessary math including a sqrt().