ardupilot
ardupilot copied to clipboard
Copter/Blimp: Do not set the same value
If 0, there is no need to set 0. If it is less than 0, it would be set to 0.
If the result of decrementing failsafe.radio_counter is 0, set failsafe.radio_counter to 0. I think NG is to set 0 again even though it is 0.
failsafe.radio_counter--; if( failsafe.radio_counter <= 0 ) { failsafe.radio_counter = 0;
If changed, set 0 to failsafe.radio_counter only when the result of decrementing failsafe.radio_counter is -1.
No, @IamPete1 is correct. You are changing behaviour here, we will do things other than clamping the value of the counter one loop early.