diff --git a/app/action.c b/app/action.c index b79a524..b573767 100644 --- a/app/action.c +++ b/app/action.c @@ -251,7 +251,7 @@ void ACTION_Scan(bool bRestart) // start scanning #ifdef ENABLE_SCAN_IGNORE_LIST - FI_clear_freq_ignored(); +// FI_clear_freq_ignored(); #endif g_monitor_enabled = false; diff --git a/driver/backlight.c b/driver/backlight.c index d1acedd..5b78ab8 100644 --- a/driver/backlight.c +++ b/driver/backlight.c @@ -24,17 +24,17 @@ uint16_t g_backlight_tick_500ms = 0; uint16_t backlight_ticks(void) { + uint16_t ticks = 0; switch (g_eeprom.config.setting.backlight_time) { - case 1: return 2 * 5; // 5 sec - case 2: return 2 * 10; // 10 sec - case 3: return 2 * 20; // 20 sec - case 4: return 2 * 60; // 1 min - case 5: return 2 * 60 * 2; // 2 min - case 6: return 2 * 60 * 4; // 4 min - default: - case 7: return 0; // always on + case 1: ticks = 5; break; // 5 sec + case 2: ticks = 10; break; // 10 sec + case 3: ticks = 20; break; // 20 sec + case 4: ticks = 60; break; // 1 min + case 5: ticks = 60 * 2; break; // 2 min + case 6: ticks = 60 * 4; break; // 4 min } + return ticks * 2; } void backlight_turn_on(const uint16_t min_ticks) diff --git a/firmware.bin b/firmware.bin new file mode 100644 index 0000000..f23bcc8 Binary files /dev/null and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin new file mode 100644 index 0000000..897be0a Binary files /dev/null and b/firmware.packed.bin differ diff --git a/main.c b/main.c index eb88952..2a60440 100644 --- a/main.c +++ b/main.c @@ -83,6 +83,10 @@ void MAIN_DisplayPowerOn(void) memset(str1, 0, sizeof(str1)); memset(str2, 0, sizeof(str2)); + // fetch backlight time + EEPROM_ReadBuffer(0x0E78, ((uint8_t *)&g_eeprom) + 0x0E78, 16); + + // fetch power-on mode EEPROM_ReadBuffer(0x0E90, ((uint8_t *)&g_eeprom) + 0x0E90, 16); switch (g_eeprom.config.setting.power_on_display_mode) @@ -142,7 +146,7 @@ void MAIN_DisplayPowerOn(void) } if (g_eeprom.config.setting.power_on_display_mode != PWR_ON_DISPLAY_MODE_NONE) - GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // backlight on + backlight_turn_on(0); // turn the back light on } void Main(void) @@ -267,9 +271,9 @@ void Main(void) FUNCTION_Select(FUNCTION_POWER_SAVE); if (g_eeprom.config.setting.backlight_time < (ARRAY_SIZE(g_sub_menu_backlight) - 1)) - GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF + GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF else - GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight ON + backlight_turn_on(0); // turn the backlight ON g_reduced_service = true; } diff --git a/settings.h b/settings.h index 866f9fe..b1af319 100644 --- a/settings.h +++ b/settings.h @@ -286,6 +286,8 @@ typedef struct { uint8_t vox_enabled; // uint8_t vox_level; // uint8_t mic_sensitivity; // + + // 0x0E78 #ifdef ENABLE_CONTRAST uint8_t lcd_contrast; // 1of11 #else diff --git a/ui/main.c b/ui/main.c index 75e55b4..d4c98b0 100644 --- a/ui/main.c +++ b/ui/main.c @@ -26,6 +26,9 @@ #include "external/printf/printf.h" #include "font.h" #include "functions.h" +#ifdef ENABLE_SCAN_IGNORE_LIST + #include "freq_ignore.h" +#endif #include "helper/battery.h" #ifdef ENABLE_MDC1200 #include "mdc1200.h" @@ -765,26 +768,31 @@ void UI_DisplayMain(void) const uint8_t freq_in_channel = g_vfo_info[vfo_num].freq_in_channel; // const uint8_t freq_in_channel = SETTINGS_find_channel(frequency); // currently way to slow - if (g_vfo_info[vfo_num].channel.compand) +// if (g_vfo_info[vfo_num].channel.compand) { - strcpy(str, " "); + strcpy(str, " "); + + #ifdef ENABLE_SCAN_IGNORE_LIST + if (FI_freq_ignored(frequency) >= 0) + str[0] = 'I'; // frequency is in the ignore list + #endif if (is_freq_chan && freq_in_channel <= USER_CHANNEL_LAST) - str[0] = 'F'; // channel number that contains this VFO frequency + str[1] = 'F'; // channel number that contains this VFO frequency if (g_vfo_info[vfo_num].channel.compand) - str[1] = 'C'; // compander is enabled + str[2] = 'C'; // compander is enabled - UI_PrintStringSmall(str, LCD_WIDTH - (7 * 2), 0, line + 1); - } - else - { - if (is_freq_chan && freq_in_channel <= USER_CHANNEL_LAST) - { // channel number that contains this VFO frequency - sprintf(str, "%03u", freq_in_channel); - UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, line + 1); - } + UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, line + 1); } +// else +// { +// if (is_freq_chan && freq_in_channel <= USER_CHANNEL_LAST) +// { // channel number that contains this VFO frequency +// sprintf(str, "%03u", freq_in_channel); +// UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, line + 1); +// } +// } } #endif }