ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Copter/Blimp: Do not set the same value

Open muramura opened this issue 1 year ago • 1 comments

If 0, there is no need to set 0. If it is less than 0, it would be set to 0.

muramura avatar Apr 17 '24 22:04 muramura

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.

muramura avatar Apr 20 '24 15:04 muramura

No, @IamPete1 is correct. You are changing behaviour here, we will do things other than clamping the value of the counter one loop early.

peterbarker avatar Jul 25 '24 01:07 peterbarker