0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 14:21:25 +03:00

single VFO display update

This commit is contained in:
OneOfEleven 2023-12-03 08:12:55 +00:00
parent 4094ae1e93
commit 1bff1b5cb1
6 changed files with 77 additions and 74 deletions

View File

@ -43,7 +43,7 @@ ENABLE_BIG_FREQ := 0
ENABLE_DTMF_LIVE_DECODER := 0 ENABLE_DTMF_LIVE_DECODER := 0
ENABLE_SHOW_FREQS_CHAN := 0 ENABLE_SHOW_FREQS_CHAN := 0
# smaa bolf 580 B # smaa bolf 580 B
ENABLE_SMALL_BOLD := 1 ENABLE_SMALL_BOLD := 0
# smallest font 2 kB # smallest font 2 kB
ENABLE_SMALLEST_FONT := 0 ENABLE_SMALLEST_FONT := 0
# trim trailing 44 B # trim trailing 44 B
@ -66,8 +66,10 @@ ENABLE_REVERSE_BAT_SYMBOL := 0
ENABLE_FREQ_SEARCH_LNA := 0 ENABLE_FREQ_SEARCH_LNA := 0
ENABLE_FREQ_SEARCH_TIMEOUT := 0 ENABLE_FREQ_SEARCH_TIMEOUT := 0
ENABLE_CODE_SEARCH_TIMEOUT := 0 ENABLE_CODE_SEARCH_TIMEOUT := 0
ENABLE_SCAN_IGNORE_LIST := 1 # scan ignore list 740 B
ENABLE_SCAN_RANGES := 1 ENABLE_SCAN_IGNORE_LIST := 0
# scan ranges 400 B
ENABLE_SCAN_RANGES := 0
# Kill and Revive 400 B # Kill and Revive 400 B
ENABLE_KILL_REVIVE := 0 ENABLE_KILL_REVIVE := 0
# AM Fix 800 B # AM Fix 800 B
@ -83,9 +85,10 @@ ENABLE_TX_AUDIO_BAR := 0
ENABLE_SIDE_BUTT_MENU := 0 ENABLE_SIDE_BUTT_MENU := 0
# Key Lock 400 B # Key Lock 400 B
ENABLE_KEYLOCK := 0 ENABLE_KEYLOCK := 0
ENABLE_PANADAPTER := 0 # panadapter 1.5kB
ENABLE_PANADAPTER := 1
ENABLE_PANADAPTER_PEAK_FREQ := 0 ENABLE_PANADAPTER_PEAK_FREQ := 0
# single VFO 1.4 kB # single VFO 1.5kB
ENABLE_SINGLE_VFO_CHAN := 1 ENABLE_SINGLE_VFO_CHAN := 1
############################################################# #############################################################

View File

@ -42,28 +42,13 @@ void EEPROM_WriteBuffer8(const uint16_t address, const void *p_buffer)
if (p_buffer == NULL || (address + 8) > 0x2000) if (p_buffer == NULL || (address + 8) > 0x2000)
return; return;
#if 0 #if 1
// normal way
I2C_Start();
I2C_Write(0xA0);
I2C_Write((address >> 8) & 0xFF);
I2C_Write((address >> 0) & 0xFF);
I2C_WriteBuffer(p_buffer, 8);
I2C_Stop();
// give the EEPROM time to burn the data in (apparently takes 1.5ms ~ 5ms)
SYSTEM_DelayMs(6);
#else
// eeprom wear reduction // eeprom wear reduction
// only write the data if it's different to what's already there // only write the data if it's different to what's already there
uint8_t buffer[8]; uint8_t buffer[8];
EEPROM_ReadBuffer(address, buffer, 8); EEPROM_ReadBuffer(address, buffer, 8);
if (memcmp(p_buffer, buffer, 8) != 0) if (memcmp(p_buffer, buffer, 8) != 0)
#endif
{ {
I2C_Start(); I2C_Start();
I2C_Write(0xA0); I2C_Write(0xA0);
@ -75,6 +60,4 @@ void EEPROM_WriteBuffer8(const uint16_t address, const void *p_buffer)
// give the EEPROM time to burn the data in (apparently takes 1.5ms ~ 5ms) // give the EEPROM time to burn the data in (apparently takes 1.5ms ~ 5ms)
SYSTEM_DelayMs(6); SYSTEM_DelayMs(6);
} }
#endif
} }

Binary file not shown.

Binary file not shown.

View File

@ -645,6 +645,7 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
const int vfo_num = g_eeprom.config.setting.tx_vfo_num; const int vfo_num = g_eeprom.config.setting.tx_vfo_num;
const unsigned int scrn_chan = g_eeprom.config.setting.indices.vfo[vfo_num].screen; const unsigned int scrn_chan = g_eeprom.config.setting.indices.vfo[vfo_num].screen;
const unsigned int state = g_vfo_state[vfo_num]; const unsigned int state = g_vfo_state[vfo_num];
bool tx_allowed = false;
uint8_t *p_line1 = g_frame_buffer[1]; uint8_t *p_line1 = g_frame_buffer[1];
char str[22]; char str[22];
@ -653,6 +654,16 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
state = VFO_STATE_ALARM; state = VFO_STATE_ALARM;
#endif #endif
#ifdef ENABLE_TX_WHEN_AM
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM)
if (FREQUENCY_tx_freq_check(g_vfo_info[vfo_num].p_tx->frequency) == 0)
tx_allowed = true;
#else
if ((state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM) && g_vfo_info[vfo_num].channel.mod_mode == MOD_MODE_FM) // TX allowed only when FM
if (FREQUENCY_tx_freq_check(g_vfo_info[vfo_num].p_tx->frequency) == 0)
tx_allowed = true;
#endif
// ******************** // ********************
{ // top line { // top line
@ -942,16 +953,10 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
// *************************************** // ***************************************
x = 2; x = 0;
y++; y++;
#ifdef ENABLE_TX_WHEN_AM if (tx_allowed)
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM)
#else
if ((state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM) && g_vfo_info[vfo_num].channel.mod_mode == MOD_MODE_FM) // TX allowed only when FM
#endif
{
if (FREQUENCY_tx_freq_check(g_vfo_info[vfo_num].p_tx->frequency) == 0)
{ // TX power { // TX power
const char *pwr_list[] = {"LOW", "MID", "HIGH", "U"}; const char *pwr_list[] = {"LOW", "MID", "HIGH", "U"};
const unsigned int i = g_vfo_info[vfo_num].channel.tx_power; const unsigned int i = g_vfo_info[vfo_num].channel.tx_power;
@ -959,24 +964,37 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
if (i == OUTPUT_POWER_USER) if (i == OUTPUT_POWER_USER)
sprintf(str + strlen(str), "%03u", g_tx_vfo->channel.tx_power_user); sprintf(str + strlen(str), "%03u", g_tx_vfo->channel.tx_power_user);
UI_PrintStringSmall(str, x, 0, y); UI_PrintStringSmall(str, x, 0, y);
}
x += 7 * 5;
if (g_vfo_info[vfo_num].freq_config_rx.frequency != g_vfo_info[vfo_num].freq_config_tx.frequency) // reverse offset symbol
if (g_vfo_info[vfo_num].channel.frequency_reverse)
UI_PrintStringSmall("R", x, 0, y);
x += 7 * 1;
if (tx_allowed && g_vfo_info[vfo_num].freq_config_rx.frequency != g_vfo_info[vfo_num].freq_config_tx.frequency)
{ // TX offset symbol { // TX offset symbol
const char *dir_list[] = {"", "+", "-"}; const char *dir_list[] = {"", "+", "-"};
const unsigned int i = g_vfo_info[vfo_num].channel.tx_offset_dir; const unsigned int i = g_vfo_info[vfo_num].channel.tx_offset_dir;
UI_PrintStringSmall(dir_list[i], x + (7 * 5), 0, y); UI_PrintStringSmall(dir_list[i], x, 0, y);
}
}
} }
x += 7 * 1;
{ // TX/RX reverse symbol if (g_vfo_info[vfo_num].channel.tx_offset_dir != TX_OFFSET_FREQ_DIR_OFF)
x += 7 * 7; { // TX/RX offset
if (g_vfo_info[vfo_num].channel.frequency_reverse) const uint32_t ofs = g_vfo_info[vfo_num].channel.tx_offset / 1000;
UI_PrintStringSmall("R", x, 0, y); if (ofs < 10 || (ofs % 100))
{
sprintf(str, "%u.%02u", ofs / 100, ofs % 100);
NUMBER_trim_trailing_zeros(str);
} }
else
sprintf(str, "%3u", ofs / 100);
UI_PrintStringSmall(str, x, 0, y);
}
x += 7 * 5;
{ // wide/narrow band symbol // wide/narrow band symbol
x += 7 * 2;
strcpy(str, " "); strcpy(str, " ");
if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_WIDE) if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_WIDE)
str[0] = 'W'; str[0] = 'W';
@ -984,15 +1002,14 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_NARROW) if (g_vfo_info[vfo_num].channel.channel_bandwidth == BANDWIDTH_NARROW)
str[0] = 'N'; str[0] = 'N';
UI_PrintStringSmall(str, x, 0, y); UI_PrintStringSmall(str, x, 0, y);
} x += 7 * 2;
{ // DTMF decoding symbol // DTMF decoding symbol
str[0] = 0; str[0] = 0;
if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable) if (g_vfo_info[vfo_num].channel.dtmf_decoding_enable)
strcpy(str, "DTMF"); strcpy(str, "DTMF");
x += 7 * 2;
UI_PrintStringSmall(str, x, 0, y); UI_PrintStringSmall(str, x, 0, y);
} //x += 7 * 5;
} }
UI_DisplayCenterLine(); UI_DisplayCenterLine();