mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Replace global flags with stateFlags, flightModeFlags and armingFlags.
Each flag was previously a whole byte, now all of the flags only take up 4 bytes as they are represented by bit masks. This is cleaner because the different kind of flags are now separated. Additionally this changes the behaviour of arming slightly. When using a switch to arm the aircraft will not arm unless the switch has been in the off state once. This prevents arming if you power the aircraft with a low throttle and the switch in the on position.
This commit is contained in:
parent
1ea014ae25
commit
3f0754d295
18 changed files with 220 additions and 164 deletions
|
@ -105,7 +105,7 @@ bool determineNewTelemetryEnabledState(void)
|
|||
if (telemetryConfig->telemetry_switch)
|
||||
enabled = rcOptions[BOXTELEMETRY];
|
||||
else
|
||||
enabled = f.ARMED;
|
||||
enabled = ARMING_FLAG(ARMED);
|
||||
}
|
||||
|
||||
return enabled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue