Logic for valid flightchannel detection is inverted in order to detect
the first flightchannel failure instead of waiting to check them all.
Clear PWM channel capture on read.
This invalidates the control channels on read. They are validated by
receiving a good value BEFORE the aux channels are received. This is
done because control channels configures to go OFF on failsafe are
detected with a PWM capture time-out. Time-out took so long that all aux
channels where overwritten by their RX configured failsafe values BEFORE
the invalid (=OFF) control channel was detected.
Note: since it didn't actually calibrate anything it has been renamed to
rxrange.
Added ability to reset rxranges using `rxrange reset` - this follows the
same pattern as other cli commands.
I don't think that this will work, as we are manipulating the timer value to trick it into overflowing. Better would be to force an overflow a different way, that would preserve the current timer value. This would then give the proper value to the CC3D PPM routine, provided it was then divided by 8.
This is first part of new softserial code. Main timer code is changed, changes to rest of code are kept to minimum.
macros for BASEPRI based synchronization are added to project (atomic.h)
TIMER_PERIOD fixed in pwm_rx.c
- NVIC priorities are moved to separate file, all values are replaced wit symbolic names. Priorities should be the same.
- tiny change in DMA initialization
Shaved about 150us each strip update.
This commit leaves in some timing trace code for the CC3D target, the
results of which can be seen in the debug variables for the sections
being timed.
A later commit will remove/disable the timing code.
On the CC3D it was observed that jitters were present, this code
validates each frame.
Prior to this, on other boards (Naze32/Flip32+/Olimexino/etc) it was
observed that when using an 8 channel RX AUX5-8 would sometimes be set
due to bad PPM data.
This code fixes both issues.
This required timer overflow events to be used in the calculation of PPM
channel data.
CC3D tested, other targets may be unstable as a result. Needs further
testing.