mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
PWM limit: Avoid writing back into state struct
This commit is contained in:
parent
c9fe205db1
commit
ef4946f81b
@ -105,14 +105,17 @@ void pwm_limit_calc(const bool armed, const bool pre_armed, const unsigned num_c
|
||||
* as the throttle channels need to go through the ramp at
|
||||
* regular arming time.
|
||||
*/
|
||||
|
||||
unsigned local_limit_state = limit->state;
|
||||
|
||||
if (pre_armed) {
|
||||
limit->state = PWM_LIMIT_STATE_ON;
|
||||
local_limit_state = PWM_LIMIT_STATE_ON;
|
||||
}
|
||||
|
||||
unsigned progress;
|
||||
|
||||
/* then set effective_pwm based on state */
|
||||
switch (limit->state) {
|
||||
switch (local_limit_state) {
|
||||
case PWM_LIMIT_STATE_OFF:
|
||||
case PWM_LIMIT_STATE_INIT:
|
||||
for (unsigned i=0; i<num_channels; i++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user