feat(color): handle long press enter for pre-flight switch checks (#6282)

This commit is contained in:
philmoz
2025-05-26 10:34:20 +10:00
committed by GitHub
parent 0e933de27e
commit 936a66bcd8
6 changed files with 51 additions and 34 deletions
+15
View File
@@ -1213,3 +1213,18 @@ void logicalSwitchesCopyState(uint8_t src, uint8_t dst)
{
lswFm[dst] = lswFm[src];
}
void setAllPreflightSwitchStates()
{
getMovedSwitch();
// Mask switches enabled for warnings
swarnstate_t sw_mask = 0;
for(uint8_t i = 0; i < switchGetMaxSwitches(); i++) {
if (SWITCH_WARNING_ALLOWED(i))
if (g_model.switchWarning & (0x07 << (3 * i)))
sw_mask |= (0x07 << (3 * i));
}
g_model.switchWarning = switches_states & sw_mask;
AUDIO_WARNING1();
storageDirty(EE_MODEL);
}