feat: option to automatically power off radio after inactivity (#3414)

This commit is contained in:
Paul Tapper
2024-08-28 15:31:25 +10:00
committed by GitHub
parent 1852c8c673
commit af9ba9cef7
41 changed files with 1042 additions and 927 deletions
+9
View File
@@ -93,6 +93,7 @@ enum {
ITEM_RADIO_SETUP_START_SOUND,
CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_ON_SPEED)
CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_OFF_SPEED)
CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_AUTO_OFF)
CASE_HAPTIC(ITEM_RADIO_SETUP_PWR_ON_OFF_HAPTIC)
CASE_PXX2(ITEM_RADIO_SETUP_OWNER_ID)
CASE_GPS(ITEM_RADIO_SETUP_LABEL_GPS)
@@ -191,6 +192,7 @@ void menuRadioSetup(event_t event)
0,
CASE_PWR_BUTTON_PRESS(0)
CASE_PWR_BUTTON_PRESS(0)
CASE_PWR_BUTTON_PRESS(0)
CASE_HAPTIC(0) // power on/off haptic
CASE_PXX2(0) /* owner registration ID */
@@ -590,6 +592,13 @@ void menuRadioSetup(event_t event)
case ITEM_RADIO_SETUP_PWR_OFF_SPEED:
g_eeGeneral.pwrOffSpeed = pwrDelayToYaml(editChoice(LCD_W-2, y, STR_PWR_OFF_DELAY, STR_PWR_OFF_DELAYS, pwrDelayFromYaml(g_eeGeneral.pwrOffSpeed), 0, 4, attr|RIGHT, event));
break;
case ITEM_RADIO_SETUP_PWR_AUTO_OFF:
lcdDrawTextAlignedLeft(y, STR_PWR_AUTO_OFF);
lcdDrawNumber(LCD_W-7, y, g_eeGeneral.pwrOffIfInactive, attr|RIGHT);
lcdDrawChar(lcdLastRightPos, y, 'm');
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.pwrOffIfInactive, 0, 255);
break;
#endif
#if defined(HAPTIC)