mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-29 14:51:26 +03:00
fix contrast bug
This commit is contained in:
parent
2c007d7e50
commit
935e552b02
2
Makefile
2
Makefile
@ -54,7 +54,7 @@ ENABLE_TX_WHEN_AM := 0
|
|||||||
ENABLE_F_CAL_MENU := 0
|
ENABLE_F_CAL_MENU := 0
|
||||||
ENABLE_TX_UNLOCK := 0
|
ENABLE_TX_UNLOCK := 0
|
||||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
|
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
|
||||||
ENABLE_CONTRAST := 0
|
ENABLE_CONTRAST := 1
|
||||||
ENABLE_BOOT_BEEPS := 0
|
ENABLE_BOOT_BEEPS := 0
|
||||||
ENABLE_DTMF_CALL_FLASH_LIGHT := 1
|
ENABLE_DTMF_CALL_FLASH_LIGHT := 1
|
||||||
ENABLE_FLASH_LIGHT_SOS_TONE := 1
|
ENABLE_FLASH_LIGHT_SOS_TONE := 1
|
||||||
|
@ -564,8 +564,8 @@ void MENU_AcceptSetting(void)
|
|||||||
|
|
||||||
#ifdef ENABLE_CONTRAST
|
#ifdef ENABLE_CONTRAST
|
||||||
case MENU_CONTRAST:
|
case MENU_CONTRAST:
|
||||||
g_setting_contrast = g_sub_menu_selection;
|
g_eeprom.config.setting.lcd_contrast = g_sub_menu_selection;
|
||||||
ST7565_SetContrast(g_setting_contrast);
|
ST7565_SetContrast(g_eeprom.config.setting.lcd_contrast);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1062,7 +1062,7 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
|
|
||||||
#ifdef ENABLE_CONTRAST
|
#ifdef ENABLE_CONTRAST
|
||||||
case MENU_CONTRAST:
|
case MENU_CONTRAST:
|
||||||
g_sub_menu_selection = g_setting_contrast;
|
g_sub_menu_selection = g_eeprom.config.setting.lcd_contrast;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ void ST7565_WriteByte(const uint8_t Value)
|
|||||||
#ifdef ENABLE_CONTRAST
|
#ifdef ENABLE_CONTRAST
|
||||||
void ST7565_SetContrast(const uint8_t value)
|
void ST7565_SetContrast(const uint8_t value)
|
||||||
{
|
{
|
||||||
contrast = (value <= 63) ? value : 63;
|
contrast = (value > 45) ? 45 : (value < 26) ? 26 : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t ST7565_GetContrast(void)
|
uint8_t ST7565_GetContrast(void)
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
2
main.c
2
main.c
@ -187,7 +187,7 @@ void Main(void)
|
|||||||
BOARD_ADC_GetBatteryInfo(&g_usb_current_voltage, &g_usb_current);
|
BOARD_ADC_GetBatteryInfo(&g_usb_current_voltage, &g_usb_current);
|
||||||
|
|
||||||
#ifdef ENABLE_CONTRAST
|
#ifdef ENABLE_CONTRAST
|
||||||
ST7565_SetContrast(g_setting_contrast);
|
ST7565_SetContrast(g_eeprom.config.setting.lcd_contrast);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_UART)
|
#if defined(ENABLE_UART)
|
||||||
|
9
misc.c
9
misc.c
@ -85,15 +85,6 @@ const uint32_t g_default_aes_key[4] = {0x4AA5CC60, 0x0312CC5F
|
|||||||
|
|
||||||
const uint8_t g_mic_gain_dB_2[5] = {3, 8, 16, 24, 31};
|
const uint8_t g_mic_gain_dB_2[5] = {3, 8, 16, 24, 31};
|
||||||
|
|
||||||
#ifdef ENABLE_CONTRAST
|
|
||||||
uint8_t g_setting_contrast;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t g_setting_side1_short;
|
|
||||||
uint8_t g_setting_side1_long;
|
|
||||||
uint8_t g_setting_side2_short;
|
|
||||||
uint8_t g_setting_side2_long;
|
|
||||||
|
|
||||||
bool g_monitor_enabled;
|
bool g_monitor_enabled;
|
||||||
|
|
||||||
bool g_has_aes_key;
|
bool g_has_aes_key;
|
||||||
|
9
misc.h
9
misc.h
@ -177,15 +177,6 @@ extern const uint16_t scan_pause_chan_10ms;
|
|||||||
|
|
||||||
extern const uint8_t g_mic_gain_dB_2[5];
|
extern const uint8_t g_mic_gain_dB_2[5];
|
||||||
|
|
||||||
#ifdef ENABLE_CONTRAST
|
|
||||||
extern uint8_t g_setting_contrast;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern uint8_t g_setting_side1_short;
|
|
||||||
extern uint8_t g_setting_side1_long;
|
|
||||||
extern uint8_t g_setting_side2_short;
|
|
||||||
extern uint8_t g_setting_side2_long;
|
|
||||||
|
|
||||||
extern bool g_monitor_enabled;
|
extern bool g_monitor_enabled;
|
||||||
|
|
||||||
extern const uint32_t g_default_aes_key[4];
|
extern const uint32_t g_default_aes_key[4];
|
||||||
|
@ -122,10 +122,6 @@ void SETTINGS_read_eeprom(void)
|
|||||||
#endif
|
#endif
|
||||||
g_eeprom.config.setting.mic_sensitivity = (g_eeprom.config.setting.mic_sensitivity < 5) ? g_eeprom.config.setting.mic_sensitivity : 4;
|
g_eeprom.config.setting.mic_sensitivity = (g_eeprom.config.setting.mic_sensitivity < 5) ? g_eeprom.config.setting.mic_sensitivity : 4;
|
||||||
|
|
||||||
#ifdef ENABLE_CONTRAST
|
|
||||||
g_eeprom.config.setting.lcd_contrast = (g_eeprom.config.setting.lcd_contrast > 45) ? 31 : (g_eeprom.config.setting.lcd_contrast < 26) ? 31 : g_eeprom.config.setting.lcd_contrast;
|
|
||||||
g_setting_contrast = g_eeprom.config.setting.lcd_contrast;
|
|
||||||
#endif
|
|
||||||
g_eeprom.config.setting.channel_display_mode = (g_eeprom.config.setting.channel_display_mode < 4) ? g_eeprom.config.setting.channel_display_mode : MDF_FREQUENCY; // 4 instead of 3 - extra display mode
|
g_eeprom.config.setting.channel_display_mode = (g_eeprom.config.setting.channel_display_mode < 4) ? g_eeprom.config.setting.channel_display_mode : MDF_FREQUENCY; // 4 instead of 3 - extra display mode
|
||||||
g_eeprom.config.setting.cross_vfo = (g_eeprom.config.setting.cross_vfo < 3) ? g_eeprom.config.setting.cross_vfo : CROSS_BAND_OFF;
|
g_eeprom.config.setting.cross_vfo = (g_eeprom.config.setting.cross_vfo < 3) ? g_eeprom.config.setting.cross_vfo : CROSS_BAND_OFF;
|
||||||
g_eeprom.config.setting.battery_save_ratio = (g_eeprom.config.setting.battery_save_ratio < 5) ? g_eeprom.config.setting.battery_save_ratio : 4;
|
g_eeprom.config.setting.battery_save_ratio = (g_eeprom.config.setting.battery_save_ratio < 5) ? g_eeprom.config.setting.battery_save_ratio : 4;
|
||||||
@ -322,6 +318,10 @@ void SETTINGS_read_eeprom(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_CONTRAST
|
||||||
|
g_eeprom.config.setting.lcd_contrast = (g_eeprom.config.setting.lcd_contrast > 45) ? 31 : (g_eeprom.config.setting.lcd_contrast < 26) ? 31 : g_eeprom.config.setting.lcd_contrast;
|
||||||
|
#endif
|
||||||
|
|
||||||
// 0F48..0F4F
|
// 0F48..0F4F
|
||||||
g_eeprom.config.setting.scan_hold_time = (g_eeprom.config.setting.scan_hold_time > 40) ? 6 : (g_eeprom.config.setting.scan_hold_time < 2) ? 6 : g_eeprom.config.setting.scan_hold_time;
|
g_eeprom.config.setting.scan_hold_time = (g_eeprom.config.setting.scan_hold_time > 40) ? 6 : (g_eeprom.config.setting.scan_hold_time < 2) ? 6 : g_eeprom.config.setting.scan_hold_time;
|
||||||
|
|
||||||
|
@ -763,7 +763,6 @@ void UI_DisplayMenu(void)
|
|||||||
case MENU_CONTRAST:
|
case MENU_CONTRAST:
|
||||||
strcpy(str, "CONTRAST\n");
|
strcpy(str, "CONTRAST\n");
|
||||||
sprintf(str + strlen(str), "%d", g_sub_menu_selection);
|
sprintf(str + strlen(str), "%d", g_sub_menu_selection);
|
||||||
//g_setting_contrast = g_sub_menu_selection
|
|
||||||
ST7565_SetContrast(g_sub_menu_selection);
|
ST7565_SetContrast(g_sub_menu_selection);
|
||||||
g_update_display = true;
|
g_update_display = true;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user