This commit is contained in:
wu58430 2023-12-17 13:31:14 +08:00
parent b4cc624b0f
commit eac2f6c4e5
2 changed files with 63 additions and 0 deletions

View file

@ -1375,8 +1375,68 @@ void APP_TimeSlice500ms(void)
} }
} }
#endif #endif
#ifdef ENABLE_FMRADIO
if (gFmRadioCountdown_500ms > 0)
{
gFmRadioCountdown_500ms--;
if (gFmRadioMode) // 1of11
return;
}
#endif
if (gBacklightCountdown_500ms > 0 && !gAskToSave && !gCssBackgroundScan &&
// don't turn off backlight if user is in backlight menu option
!(gScreenToDisplay == DISPLAY_MENU && (UI_MENU_GetCurrentMenuId() == MENU_ABR || UI_MENU_GetCurrentMenuId() == MENU_ABR_MAX)))
{
if (--gBacklightCountdown_500ms == 0) {
if (gEeprom.BACKLIGHT_TIME < (ARRAY_SIZE(gSubMenu_BACKLIGHT) - 1)) {
// backlight is not set to be always on
BACKLIGHT_TurnOff();
}
}
}
if (gReducedService)
{
BOARD_ADC_GetBatteryInfo(&gBatteryCurrentVoltage, &gBatteryCurrent);
if (gBatteryCurrent > 500 || gBatteryCalibration[3] < gBatteryCurrentVoltage)
{
#ifdef ENABLE_OVERLAY
overlay_FLASH_RebootToBootloader();
#else
NVIC_SystemReset();
#endif
}
return;
}
gBatteryCheckCounter++;
// Skipped authentic device check // Skipped authentic device check
if (gCurrentFunction != FUNCTION_TRANSMIT)
{
if ((gBatteryCheckCounter & 1) == 0)
{
BOARD_ADC_GetBatteryInfo(&gBatteryVoltages[gBatteryVoltageIndex++], &gBatteryCurrent);
if (gBatteryVoltageIndex > 3)
gBatteryVoltageIndex = 0;
BATTERY_GetReadings(true);
}
}
// regular display updates (once every 2 sec) - if need be
if ((gBatteryCheckCounter & 3) == 0)
{
if (gChargingWithTypeC )
gUpdateStatus = true;
#ifdef ENABLE_SHOW_CHARGE_LEVEL
if (gChargingWithTypeC)
gUpdateDisplay = true;
#endif
}
if (!gCssBackgroundScan if (!gCssBackgroundScan
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
&& (gFM_ScanState == FM_SCAN_OFF || gAskToSave) && (gFM_ScanState == FM_SCAN_OFF || gAskToSave)

View file

@ -772,6 +772,9 @@ void SETTINGS_WriteBuildOptions(void)
#endif #endif
#ifdef ENABLE_BLMIN_TMP_OFF #ifdef ENABLE_BLMIN_TMP_OFF
| (1 << 3) | (1 << 3)
#endif
#ifdef ENABLE_AM_FIX
| (1 << 4)
#endif #endif
; ;
EEPROM_WriteBuffer(0x1FF0, buf); EEPROM_WriteBuffer(0x1FF0, buf);