The mixer was creating a new class in interrupt context, which is not valid use in NuttX. This change copies the mixer into the buffer and runs the mixer management section of the code outside of interrupt context in the normal task.
IO needs atomic updates of a few critical status flags, but doing these always atomic (with interrupts disabled) might cause a too high interrupts disabled interval. In order to avoid this only operations that change the state of the target variable are done with interrupts disabled, while operations without an effect on the target variable are not executed.
change fmu to task
increase fmu_servo task priority to max and enable true oneshot
use lowest FMU priority which minimizes jitter
constrain oneshot updates to control group 0 events
this fixes a race condition between the DMA completion handler
updating registers in px4io and the mixer used for handling the
override state. The register set code could set r_page_servos[]
between the time when pwm_limit_calc() is called and the servos are
actually output.
This change makes the mixer load and reset operation closer to thread-safe. It was guarded one-way before and in only one location. This change ensures that its being locked out from both directions. The accesses to the locking variables still need work because they are non-atomic.
clamp mixer output offset to [-.2,.2] ([-2000, 2000] in mixer file)
add 8 main PWM trim parameters
add long desc to parameters and bump minor parameter version
- avoid dividing by zero when calculating max delta output
- better comments when calculating max delta output
- better naming of functions and variables
Signed-off-by: Roman <bapstroman@gmail.com>
The override checking was scattered across two places and is now unified
in controls_tick(). The part in mixer_tick only decides which mixer (or
none) to use give the override flag.
since pure manual control for fixed wings in handled on the io side
the scale parameters for roll, pitch and yaw had to be introduced there
as well.
Signed-off-by: Roman <bapstr@ethz.ch>