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.