diff --git a/README.md b/README.md index 13629c03..d14c8d50 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ To enable the custom option just uncomment the line by removing the starting '#' * Slightly less intense menu style * AM RX now allowed everywhere, although the radio really doesn't do AM, the adverts are a con ! * Finer RSSI bar steps -* Nicer big font than original big font +* Nicer/cleaner big numeric font than original QS big numeric font * * "MEM-CH" and "DEL-CH" menus now include channel name * "STEP" menu, added 1.25kHz option, removed 5kHz option diff --git a/app/app.c b/app/app.c index 1372a842..3b262115 100644 --- a/app/app.c +++ b/app/app.c @@ -1280,6 +1280,11 @@ void APP_TimeSlice500ms(void) { // Skipped authentic device check + if (gBacklightCountdown > 0) + if (--gBacklightCountdown == 0) + if (gEeprom.BACKLIGHT < 5) + GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off + if (gKeypadLocked) if (--gKeypadLocked == 0) gUpdateDisplay = true; @@ -1325,11 +1330,6 @@ void APP_TimeSlice500ms(void) { if ((gFM_ScanState == FM_SCAN_OFF || gAskToSave) && gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF) { - if (gBacklightCountdown) - if (--gBacklightCountdown == 0) - if (gEeprom.BACKLIGHT < 5) - GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off - #ifndef DISABLE_AIRCOPY if (gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND)) #else diff --git a/driver/backlight.c b/driver/backlight.c index a5d97c38..93b34951 100644 --- a/driver/backlight.c +++ b/driver/backlight.c @@ -23,29 +23,30 @@ uint8_t gBacklightCountdown = 0; void BACKLIGHT_TurnOn(void) { - if (gEeprom.BACKLIGHT > 0) + if (gEeprom.BACKLIGHT == 0) + return; + + // turn the backlight ON + GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); + + switch (gEeprom.BACKLIGHT) { - GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight ON - switch (gEeprom.BACKLIGHT) - { - case 1: // 10 sec - gBacklightCountdown = 1; - break; - case 2: // 20 sec - gBacklightCountdown = 21; - break; - case 3: // 40 sec - gBacklightCountdown = 61; - break; - case 4: // 80 sec - gBacklightCountdown = 141; - break; - case 5: // always on - default: - gBacklightCountdown = 0; - break; - } -// gBacklightCountdown = (gEeprom.BACKLIGHT < 5) ? (gEeprom.BACKLIGHT * 20) - 19 : 0; + default: + case 1: // 10 sec + gBacklightCountdown = 2 * 10; // 1 + break; + case 2: // 20 sec + gBacklightCountdown = 2 * 20; // 21 + break; + case 3: // 40 sec + gBacklightCountdown = 2 * 40; // 61 + break; + case 4: // 80 sec + gBacklightCountdown = 2 * 80; // 141 + break; + case 5: // always on + gBacklightCountdown = 0; + break; } } diff --git a/firmware b/firmware index 8440b2d8..eb319db9 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index d27a08df..4c966d24 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index d0542cf0..76a835e3 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ