mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 14:48:03 +03:00
lots of renames
This commit is contained in:
@ -44,7 +44,7 @@ void UI_DisplayAircopy(void)
|
||||
|
||||
if (gInputBoxIndex == 0)
|
||||
{
|
||||
NUMBER_ToDigits(gRxVfo->freq_config_RX.Frequency, String);
|
||||
NUMBER_ToDigits(gRxVfo->freq_config_rx.frequency, String);
|
||||
UI_DisplayFrequency(String, 16, 2, 0, 0);
|
||||
UI_DisplaySmallDigits(2, String + 6, 97, 3, true);
|
||||
}
|
||||
|
12
ui/fmradio.c
12
ui/fmradio.c
@ -53,11 +53,11 @@ void UI_DisplayFM(void)
|
||||
{
|
||||
if (gFM_ScanState == FM_SCAN_OFF)
|
||||
{
|
||||
if (!gEeprom.FM_IsMrMode)
|
||||
if (!g_eeprom.fm_is_channel_mode)
|
||||
{
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
if (gEeprom.FM_FrequencyPlaying == gFM_Channels[i])
|
||||
if (g_eeprom.fm_frequency_playing == gFM_Channels[i])
|
||||
{
|
||||
sprintf(String, "VFO(CH%02u)", i + 1);
|
||||
break;
|
||||
@ -68,7 +68,7 @@ void UI_DisplayFM(void)
|
||||
strcpy(String, "VFO");
|
||||
}
|
||||
else
|
||||
sprintf(String, "MR(CH%02u)", gEeprom.FM_SelectedChannel + 1);
|
||||
sprintf(String, "MR(CH%02u)", g_eeprom.fm_selected_channel + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -81,7 +81,7 @@ void UI_DisplayFM(void)
|
||||
UI_PrintString(String, 0, 127, 2, 10);
|
||||
|
||||
memset(String, 0, sizeof(String));
|
||||
if (gAskToSave || (gEeprom.FM_IsMrMode && gInputBoxIndex > 0))
|
||||
if (gAskToSave || (g_eeprom.fm_is_channel_mode && gInputBoxIndex > 0))
|
||||
{
|
||||
UI_GenerateChannelString(String, gFM_ChannelPosition);
|
||||
}
|
||||
@ -90,7 +90,7 @@ void UI_DisplayFM(void)
|
||||
{
|
||||
if (gInputBoxIndex == 0)
|
||||
{
|
||||
NUMBER_ToDigits(gEeprom.FM_FrequencyPlaying * 10000, String);
|
||||
NUMBER_ToDigits(g_eeprom.fm_frequency_playing * 10000, String);
|
||||
UI_DisplayFrequency(String, 23, 4, false, true);
|
||||
}
|
||||
else
|
||||
@ -101,7 +101,7 @@ void UI_DisplayFM(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(String, "CH-%02u", gEeprom.FM_SelectedChannel + 1);
|
||||
sprintf(String, "CH-%02u", g_eeprom.fm_selected_channel + 1);
|
||||
}
|
||||
UI_PrintString(String, 0, 127, 4, 10);
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
char gInputBox[8];
|
||||
uint8_t gInputBoxIndex;
|
||||
|
||||
void INPUTBOX_Append(const KEY_Code_t Digit)
|
||||
void INPUTBOX_Append(const key_code_t Digit)
|
||||
{
|
||||
if (gInputBoxIndex >= sizeof(gInputBox))
|
||||
return;
|
||||
|
@ -24,7 +24,7 @@
|
||||
extern char gInputBox[8];
|
||||
extern uint8_t gInputBoxIndex;
|
||||
|
||||
void INPUTBOX_Append(const KEY_Code_t Digit);
|
||||
void INPUTBOX_Append(const key_code_t Digit);
|
||||
|
||||
#endif
|
||||
|
||||
|
16
ui/lock.c
16
ui/lock.c
@ -50,7 +50,7 @@ static void Render(void)
|
||||
|
||||
void UI_DisplayLock(void)
|
||||
{
|
||||
KEY_Code_t Key;
|
||||
key_code_t Key;
|
||||
BEEP_Type_t Beep;
|
||||
|
||||
gUpdateDisplay = true;
|
||||
@ -67,17 +67,17 @@ void UI_DisplayLock(void)
|
||||
|
||||
Key = KEYBOARD_Poll();
|
||||
|
||||
if (gKeyReading0 == Key)
|
||||
if (g_key_reading_0 == Key)
|
||||
{
|
||||
if (++gDebounceCounter == key_debounce_10ms)
|
||||
if (++g_debounce_counter == key_debounce_10ms)
|
||||
{
|
||||
if (Key == KEY_INVALID)
|
||||
{
|
||||
gKeyReading1 = KEY_INVALID;
|
||||
g_key_reading_1 = KEY_INVALID;
|
||||
}
|
||||
else
|
||||
{
|
||||
gKeyReading1 = Key;
|
||||
g_key_reading_1 = Key;
|
||||
|
||||
switch (Key)
|
||||
{
|
||||
@ -105,7 +105,7 @@ void UI_DisplayLock(void)
|
||||
|
||||
NUMBER_Get(gInputBox, &Password);
|
||||
|
||||
if ((gEeprom.POWER_ON_PASSWORD * 100) == Password)
|
||||
if ((g_eeprom.power_on_password * 100) == Password)
|
||||
{
|
||||
AUDIO_PlayBeep(BEEP_1KHZ_60MS_OPTIONAL);
|
||||
return;
|
||||
@ -140,8 +140,8 @@ void UI_DisplayLock(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gDebounceCounter = 0;
|
||||
gKeyReading0 = Key;
|
||||
g_debounce_counter = 0;
|
||||
g_key_reading_0 = Key;
|
||||
}
|
||||
|
||||
if (UART_IsCommandAvailable())
|
||||
|
116
ui/main.c
116
ui/main.c
@ -56,11 +56,11 @@ center_line_t center_line = CENTER_LINE_NONE;
|
||||
if (center_line != CENTER_LINE_NONE && center_line != CENTER_LINE_TX_TIMEOUT)
|
||||
return false;
|
||||
|
||||
if (gEeprom.TX_TIMEOUT_TIMER == 0)
|
||||
if (g_eeprom.tx_timeout_timer == 0)
|
||||
timeout_secs = 30; // 30 sec
|
||||
else
|
||||
if (gEeprom.TX_TIMEOUT_TIMER < (ARRAY_SIZE(gSubMenu_TOT) - 1))
|
||||
timeout_secs = 60 * gEeprom.TX_TIMEOUT_TIMER; // minutes
|
||||
if (g_eeprom.tx_timeout_timer < (ARRAY_SIZE(gSubMenu_TOT) - 1))
|
||||
timeout_secs = 60 * g_eeprom.tx_timeout_timer; // minutes
|
||||
else
|
||||
timeout_secs = 60 * 15; // 15 minutes
|
||||
|
||||
@ -240,7 +240,7 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||
char s[16];
|
||||
unsigned int i;
|
||||
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
if (g_eeprom.key_lock && gKeypadLocked > 0)
|
||||
return; // display is in use
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT ||
|
||||
@ -313,10 +313,10 @@ void UI_UpdateRSSI(const int16_t rssi, const int vfo)
|
||||
// 0000C0 6E 00 78 00 82 00 8C 00 B4 00 BE 00 C8 00 D2 00
|
||||
//
|
||||
const unsigned int band = 1;
|
||||
const int16_t level0 = gEEPROM_RSSI_CALIB[band][0];
|
||||
const int16_t level1 = gEEPROM_RSSI_CALIB[band][1];
|
||||
const int16_t level2 = gEEPROM_RSSI_CALIB[band][2];
|
||||
const int16_t level3 = gEEPROM_RSSI_CALIB[band][3];
|
||||
const int16_t level0 = g_eeprom_RSSI_CALIB[band][0];
|
||||
const int16_t level1 = g_eeprom_RSSI_CALIB[band][1];
|
||||
const int16_t level2 = g_eeprom_RSSI_CALIB[band][2];
|
||||
const int16_t level3 = g_eeprom_RSSI_CALIB[band][3];
|
||||
#else
|
||||
const int16_t level0 = (-115 + 160) * 2; // dB
|
||||
const int16_t level1 = ( -89 + 160) * 2; // dB
|
||||
@ -352,7 +352,7 @@ void UI_UpdateRSSI(const int16_t rssi, const int vfo)
|
||||
|
||||
// **********************************************************
|
||||
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
if (g_eeprom.key_lock && gKeypadLocked > 0)
|
||||
return; // display is in use
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT || gScreenToDisplay != DISPLAY_MAIN)
|
||||
@ -385,7 +385,7 @@ void UI_DisplayMain(void)
|
||||
center_line = CENTER_LINE_NONE;
|
||||
|
||||
// #ifdef SINGLE_VFO_CHAN
|
||||
// const bool single_vfo = (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? true : false;
|
||||
// const bool single_vfo = (g_eeprom.dual_watch == DUAL_WATCH_OFF && g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? true : false;
|
||||
// #else
|
||||
const bool single_vfo = false;
|
||||
// #endif
|
||||
@ -393,7 +393,7 @@ void UI_DisplayMain(void)
|
||||
// clear the screen
|
||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
if (g_eeprom.key_lock && gKeypadLocked > 0)
|
||||
{ // tell user how to unlock the keyboard
|
||||
UI_PrintString("Long press #", 0, LCD_WIDTH, 1, 8);
|
||||
UI_PrintString("to unlock", 0, LCD_WIDTH, 3, 8);
|
||||
@ -404,8 +404,8 @@ void UI_DisplayMain(void)
|
||||
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
||||
{
|
||||
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
||||
unsigned int channel = gEeprom.TX_VFO;
|
||||
// unsigned int tx_channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO;
|
||||
unsigned int channel = g_eeprom.tx_vfo;
|
||||
// unsigned int tx_channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
||||
const bool same_vfo = (channel == vfo_num) ? true : false;
|
||||
uint8_t *p_line0 = gFrameBuffer[line + 0];
|
||||
uint8_t *p_line1 = gFrameBuffer[line + 1];
|
||||
@ -421,8 +421,8 @@ void UI_DisplayMain(void)
|
||||
|
||||
}
|
||||
|
||||
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && gRxVfoIsActive)
|
||||
channel = gEeprom.RX_VFO; // we're currently monitoring the other VFO
|
||||
if (g_eeprom.dual_watch != DUAL_WATCH_OFF && gRxVfoIsActive)
|
||||
channel = g_eeprom.rx_vfo; // we're currently monitoring the other VFO
|
||||
|
||||
if (channel != vfo_num)
|
||||
{
|
||||
@ -472,7 +472,7 @@ void UI_DisplayMain(void)
|
||||
if (!single_vfo && same_vfo)
|
||||
memmove(p_line0 + 0, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default));
|
||||
else
|
||||
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
|
||||
if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF)
|
||||
memmove(p_line0 + 0, BITMAP_VFO_NotDefault, sizeof(BITMAP_VFO_NotDefault));
|
||||
}
|
||||
else
|
||||
@ -481,7 +481,7 @@ void UI_DisplayMain(void)
|
||||
if (same_vfo)
|
||||
memmove(p_line0 + 0, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default));
|
||||
else
|
||||
//if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
|
||||
//if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF)
|
||||
memmove(p_line0 + 0, BITMAP_VFO_NotDefault, sizeof(BITMAP_VFO_NotDefault));
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@ void UI_DisplayMain(void)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO;
|
||||
channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
||||
if (channel == vfo_num)
|
||||
{ // show the TX symbol
|
||||
mode = 1;
|
||||
@ -512,7 +512,7 @@ void UI_DisplayMain(void)
|
||||
if ((gCurrentFunction == FUNCTION_RECEIVE ||
|
||||
gCurrentFunction == FUNCTION_MONITOR ||
|
||||
gCurrentFunction == FUNCTION_INCOMING) &&
|
||||
gEeprom.RX_VFO == vfo_num)
|
||||
g_eeprom.rx_vfo == vfo_num)
|
||||
{
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
UI_PrintStringSmallBold("RX", 14, 0, line);
|
||||
@ -522,32 +522,32 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (gEeprom.ScreenChannel[vfo_num] <= MR_CHANNEL_LAST)
|
||||
if (g_eeprom.screen_channel[vfo_num] <= USER_CHANNEL_LAST)
|
||||
{ // channel mode
|
||||
const unsigned int x = 2;
|
||||
const bool inputting = (gInputBoxIndex == 0 || gEeprom.TX_VFO != vfo_num) ? false : true;
|
||||
const bool inputting = (gInputBoxIndex == 0 || g_eeprom.tx_vfo != vfo_num) ? false : true;
|
||||
if (!inputting)
|
||||
NUMBER_ToDigits(gEeprom.ScreenChannel[vfo_num] + 1, String); // show the memory channel number
|
||||
NUMBER_ToDigits(g_eeprom.screen_channel[vfo_num] + 1, String); // show the memory channel number
|
||||
else
|
||||
memmove(String + 5, gInputBox, 3); // show the input text
|
||||
UI_PrintStringSmall("M", x, 0, line + 1);
|
||||
UI_DisplaySmallDigits(3, String + 5, x + 7, line + 1, inputting);
|
||||
}
|
||||
else
|
||||
if (IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]))
|
||||
if (IS_FREQ_CHANNEL(g_eeprom.screen_channel[vfo_num]))
|
||||
{ // frequency mode
|
||||
// show the frequency band number
|
||||
const unsigned int x = 2; // was 14
|
||||
// sprintf(String, "FB%u", 1 + gEeprom.ScreenChannel[vfo_num] - FREQ_CHANNEL_FIRST);
|
||||
sprintf(String, "VFO%u", 1 + gEeprom.ScreenChannel[vfo_num] - FREQ_CHANNEL_FIRST);
|
||||
// sprintf(String, "FB%u", 1 + g_eeprom.screen_channel[vfo_num] - FREQ_CHANNEL_FIRST);
|
||||
sprintf(String, "VFO%u", 1 + g_eeprom.screen_channel[vfo_num] - FREQ_CHANNEL_FIRST);
|
||||
UI_PrintStringSmall(String, x, 0, line + 1);
|
||||
}
|
||||
#ifdef ENABLE_NOAA
|
||||
else
|
||||
{
|
||||
if (gInputBoxIndex == 0 || gEeprom.TX_VFO != vfo_num)
|
||||
if (gInputBoxIndex == 0 || g_eeprom.tx_vfo != vfo_num)
|
||||
{ // channel number
|
||||
sprintf(String, "N%u", 1 + gEeprom.ScreenChannel[vfo_num] - NOAA_CHANNEL_FIRST);
|
||||
sprintf(String, "N%u", 1 + g_eeprom.screen_channel[vfo_num] - NOAA_CHANNEL_FIRST);
|
||||
}
|
||||
else
|
||||
{ // user entering channel number
|
||||
@ -564,7 +564,7 @@ void UI_DisplayMain(void)
|
||||
#ifdef ENABLE_ALARM
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT && gAlarmState == ALARM_STATE_ALARM)
|
||||
{
|
||||
channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO;
|
||||
channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
||||
if (channel == vfo_num)
|
||||
state = VFO_STATE_ALARM;
|
||||
}
|
||||
@ -577,7 +577,7 @@ void UI_DisplayMain(void)
|
||||
UI_PrintString(state_list[state], 31, 0, line, 8);
|
||||
}
|
||||
else
|
||||
if (gInputBoxIndex > 0 && IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]) && gEeprom.TX_VFO == vfo_num)
|
||||
if (gInputBoxIndex > 0 && IS_FREQ_CHANNEL(g_eeprom.screen_channel[vfo_num]) && g_eeprom.tx_vfo == vfo_num)
|
||||
{ // user entering a frequency
|
||||
UI_DisplayFrequency(gInputBox, 32, line, true, false);
|
||||
|
||||
@ -585,25 +585,25 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t frequency = gEeprom.VfoInfo[vfo_num].pRX->Frequency;
|
||||
uint32_t frequency = g_eeprom.VfoInfo[vfo_num].pRX->frequency;
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||
{ // transmitting
|
||||
channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO;
|
||||
channel = (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_OFF) ? g_eeprom.rx_vfo : g_eeprom.tx_vfo;
|
||||
if (channel == vfo_num)
|
||||
frequency = gEeprom.VfoInfo[vfo_num].pTX->Frequency;
|
||||
frequency = g_eeprom.VfoInfo[vfo_num].pTX->frequency;
|
||||
}
|
||||
|
||||
if (gEeprom.ScreenChannel[vfo_num] <= MR_CHANNEL_LAST)
|
||||
if (g_eeprom.screen_channel[vfo_num] <= USER_CHANNEL_LAST)
|
||||
{ // it's a channel
|
||||
|
||||
// show the channel symbols
|
||||
const uint8_t attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]];
|
||||
if (attributes & MR_CH_SCANLIST1)
|
||||
const uint8_t attributes = gUSER_ChannelAttributes[g_eeprom.screen_channel[vfo_num]];
|
||||
if (attributes & USER_CH_SCANLIST1)
|
||||
memmove(p_line0 + 113, BITMAP_ScanList1, sizeof(BITMAP_ScanList1));
|
||||
if (attributes & MR_CH_SCANLIST2)
|
||||
if (attributes & USER_CH_SCANLIST2)
|
||||
memmove(p_line0 + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2));
|
||||
#ifndef ENABLE_BIG_FREQ
|
||||
if ((attributes & MR_CH_COMPAND) > 0)
|
||||
if ((attributes & USER_CH_COMPAND) > 0)
|
||||
memmove(p_line0 + 120 + LCD_WIDTH, BITMAP_compand, sizeof(BITMAP_compand));
|
||||
#else
|
||||
|
||||
@ -614,7 +614,7 @@ void UI_DisplayMain(void)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||
|
||||
switch (gEeprom.CHANNEL_DISPLAY_MODE)
|
||||
switch (g_eeprom.channel_display_mode)
|
||||
{
|
||||
case MDF_FREQUENCY: // show the channel frequency
|
||||
#ifdef ENABLE_BIG_FREQ
|
||||
@ -631,20 +631,20 @@ void UI_DisplayMain(void)
|
||||
break;
|
||||
|
||||
case MDF_CHANNEL: // show the channel number
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
sprintf(String, "CH-%03u", g_eeprom.screen_channel[vfo_num] + 1);
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
break;
|
||||
|
||||
case MDF_NAME: // show the channel name
|
||||
case MDF_NAME_FREQ: // show the channel name and frequency
|
||||
|
||||
BOARD_fetchChannelName(String, gEeprom.ScreenChannel[vfo_num]);
|
||||
BOARD_fetchChannelName(String, g_eeprom.screen_channel[vfo_num]);
|
||||
if (String[0] == 0)
|
||||
{ // no channel name, show the channel number instead
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
sprintf(String, "CH-%03u", g_eeprom.screen_channel[vfo_num] + 1);
|
||||
}
|
||||
|
||||
if (gEeprom.CHANNEL_DISPLAY_MODE == MDF_NAME)
|
||||
if (g_eeprom.channel_display_mode == MDF_NAME)
|
||||
{
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
}
|
||||
@ -681,8 +681,8 @@ void UI_DisplayMain(void)
|
||||
#endif
|
||||
|
||||
// show the channel symbols
|
||||
const uint8_t attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]];
|
||||
if ((attributes & MR_CH_COMPAND) > 0)
|
||||
const uint8_t attributes = gUSER_ChannelAttributes[g_eeprom.screen_channel[vfo_num]];
|
||||
if ((attributes & USER_CH_COMPAND) > 0)
|
||||
#ifdef ENABLE_BIG_FREQ
|
||||
memmove(p_line0 + 120, BITMAP_compand, sizeof(BITMAP_compand));
|
||||
#else
|
||||
@ -698,7 +698,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
if (mode == 1)
|
||||
{ // TX power level
|
||||
switch (gRxVfo->OUTPUT_POWER)
|
||||
switch (gRxVfo->output_power)
|
||||
{
|
||||
case OUTPUT_POWER_LOW: Level = 2; break;
|
||||
case OUTPUT_POWER_MID: Level = 4; break;
|
||||
@ -721,14 +721,14 @@ void UI_DisplayMain(void)
|
||||
// ************
|
||||
|
||||
String[0] = '\0';
|
||||
if (gEeprom.VfoInfo[vfo_num].AM_mode)
|
||||
if (g_eeprom.VfoInfo[vfo_num].am_mode)
|
||||
{ // show the AM symbol
|
||||
strcpy(String, "AM");
|
||||
}
|
||||
else
|
||||
{ // or show the CTCSS/DCS symbol
|
||||
const FREQ_Config_t *pConfig = (mode == 1) ? gEeprom.VfoInfo[vfo_num].pTX : gEeprom.VfoInfo[vfo_num].pRX;
|
||||
const unsigned int code_type = pConfig->CodeType;
|
||||
const FREQ_Config_t *pConfig = (mode == 1) ? g_eeprom.VfoInfo[vfo_num].pTX : g_eeprom.VfoInfo[vfo_num].pRX;
|
||||
const unsigned int code_type = pConfig->code_type;
|
||||
const char *code_list[] = {"", "CT", "DCS", "DCR"};
|
||||
if (code_type < ARRAY_SIZE(code_list))
|
||||
strcpy(String, code_list[code_type]);
|
||||
@ -738,28 +738,28 @@ void UI_DisplayMain(void)
|
||||
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM)
|
||||
{ // show the TX power
|
||||
const char pwr_list[] = "LMH";
|
||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
||||
const unsigned int i = g_eeprom.VfoInfo[vfo_num].output_power;
|
||||
String[0] = (i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1);
|
||||
}
|
||||
|
||||
if (gEeprom.VfoInfo[vfo_num].freq_config_RX.Frequency != gEeprom.VfoInfo[vfo_num].freq_config_TX.Frequency)
|
||||
if (g_eeprom.VfoInfo[vfo_num].freq_config_rx.frequency != g_eeprom.VfoInfo[vfo_num].freq_config_tx.frequency)
|
||||
{ // show the TX offset symbol
|
||||
const char dir_list[] = "\0+-";
|
||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].TX_OFFSET_FREQUENCY_DIRECTION;
|
||||
const unsigned int i = g_eeprom.VfoInfo[vfo_num].tx_offset_freq_dir;
|
||||
String[0] = (i < sizeof(dir_list)) ? dir_list[i] : '?';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);
|
||||
}
|
||||
|
||||
// show the TX/RX reverse symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].FrequencyReverse)
|
||||
if (g_eeprom.VfoInfo[vfo_num].frequency_reverse)
|
||||
UI_PrintStringSmall("R", LCD_WIDTH + 62, 0, line + 1);
|
||||
|
||||
{ // show the narrow band symbol
|
||||
String[0] = '\0';
|
||||
if (gEeprom.VfoInfo[vfo_num].CHANNEL_BANDWIDTH == BANDWIDTH_NARROW)
|
||||
if (g_eeprom.VfoInfo[vfo_num].channel_bandwidth == BANDWIDTH_NARROW)
|
||||
{
|
||||
String[0] = 'N';
|
||||
String[1] = '\0';
|
||||
@ -768,11 +768,11 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
|
||||
// show the DTMF decoding symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
||||
if (g_eeprom.VfoInfo[vfo_num].DTMF_decoding_enable || gSetting_KILLED)
|
||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
||||
|
||||
// show the audio scramble symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
||||
if (g_eeprom.VfoInfo[vfo_num].scrambling_type > 0 && gSetting_ScrambleEnable)
|
||||
UI_PrintStringSmall("SCR", LCD_WIDTH + 106, 0, line + 1);
|
||||
}
|
||||
|
||||
@ -804,13 +804,13 @@ void UI_DisplayMain(void)
|
||||
|
||||
#if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA)
|
||||
// show the AM-FIX debug data
|
||||
if (rx && gEeprom.VfoInfo[gEeprom.RX_VFO].AM_mode && gSetting_AM_fix)
|
||||
if (rx && g_eeprom.VfoInfo[g_eeprom.rx_vfo].am_mode && gSetting_AM_fix)
|
||||
{
|
||||
if (gScreenToDisplay != DISPLAY_MAIN || gDTMF_CallState != DTMF_CALL_STATE_NONE)
|
||||
return;
|
||||
|
||||
center_line = CENTER_LINE_AM_FIX_DATA;
|
||||
AM_fix_print_data(gEeprom.RX_VFO, String);
|
||||
AM_fix_print_data(g_eeprom.rx_vfo, String);
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
}
|
||||
else
|
||||
@ -821,7 +821,7 @@ void UI_DisplayMain(void)
|
||||
if (rx)
|
||||
{
|
||||
center_line = CENTER_LINE_RSSI;
|
||||
UI_DisplayRSSIBar(gCurrentRSSI[gEeprom.RX_VFO], false);
|
||||
UI_DisplayRSSIBar(gCurrentRSSI[g_eeprom.rx_vfo], false);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
48
ui/menu.c
48
ui/menu.c
@ -53,9 +53,9 @@ const t_menu_item MenuList[] =
|
||||
{"RxCTCS", VOICE_ID_CTCSS, MENU_R_CTCS }, // was "R_CTCS"
|
||||
{"Tx DCS", VOICE_ID_DCS, MENU_T_DCS }, // was "T_DCS"
|
||||
{"TxCTCS", VOICE_ID_CTCSS, MENU_T_CTCS }, // was "T_CTCS"
|
||||
{"Tx DIR", VOICE_ID_TX_OFFSET_FREQUENCY_DIRECTION, MENU_SFT_D }, // was "SFT_D"
|
||||
{"TxOFFS", VOICE_ID_TX_OFFSET_FREQUENCY, MENU_OFFSET }, // was "OFFSET"
|
||||
{"Tx TO", VOICE_ID_TRANSMIT_OVER_TIME, MENU_TOT }, // was "TOT"
|
||||
{"Tx DIR", voice_id_tX_OFFSET_FREQ_DIR, MENU_SFT_D }, // was "SFT_D"
|
||||
{"TxOFFS", voice_id_tX_OFFSET_FREQ, MENU_OFFSET }, // was "OFFSET"
|
||||
{"Tx TO", voice_id_tRANSMIT_OVER_TIME, MENU_TOT }, // was "TOT"
|
||||
{"Tx VFO", VOICE_ID_INVALID, MENU_XB }, // was "WX"
|
||||
{"2nd RX", VOICE_ID_DUAL_STANDBY, MENU_TDR }, // was "TDR"
|
||||
{"SCRAM", VOICE_ID_SCRAMBLER_ON, MENU_SCR }, // was "SCR"
|
||||
@ -288,7 +288,7 @@ const char gSubMenu_F_LOCK[6][4] =
|
||||
"438"
|
||||
};
|
||||
|
||||
const char gSubMenu_BACKLIGHT[8][7] =
|
||||
const char gSubMenu_backlight[8][7] =
|
||||
{
|
||||
"OFF",
|
||||
"5 sec",
|
||||
@ -556,16 +556,16 @@ void UI_DisplayMenu(void)
|
||||
{
|
||||
#if 1
|
||||
unsigned int Code;
|
||||
FREQ_Config_t *pConfig = (gMenuCursor == MENU_R_CTCS) ? &gTxVfo->freq_config_RX : &gTxVfo->freq_config_TX;
|
||||
FREQ_Config_t *pConfig = (gMenuCursor == MENU_R_CTCS) ? &gTxVfo->freq_config_rx : &gTxVfo->freq_config_tx;
|
||||
if (gSubMenuSelection == 0)
|
||||
{
|
||||
strcpy(String, "OFF");
|
||||
|
||||
if (pConfig->CodeType != CODE_TYPE_CONTINUOUS_TONE)
|
||||
if (pConfig->code_type != CODE_TYPE_CONTINUOUS_TONE)
|
||||
break;
|
||||
Code = 0;
|
||||
pConfig->CodeType = CODE_TYPE_OFF;
|
||||
pConfig->Code = Code;
|
||||
pConfig->code_type = CODE_TYPE_OFF;
|
||||
pConfig->code = Code;
|
||||
|
||||
BK4819_ExitSubAu();
|
||||
}
|
||||
@ -573,9 +573,9 @@ void UI_DisplayMenu(void)
|
||||
{
|
||||
sprintf(String, "%u.%uHz", CTCSS_Options[gSubMenuSelection - 1] / 10, CTCSS_Options[gSubMenuSelection - 1] % 10);
|
||||
|
||||
pConfig->CodeType = CODE_TYPE_CONTINUOUS_TONE;
|
||||
pConfig->code_type = CODE_TYPE_CONTINUOUS_TONE;
|
||||
Code = gSubMenuSelection - 1;
|
||||
pConfig->Code = Code;
|
||||
pConfig->code = Code;
|
||||
|
||||
BK4819_SetCTCSSFrequency(CTCSS_Options[Code]);
|
||||
}
|
||||
@ -643,7 +643,7 @@ void UI_DisplayMenu(void)
|
||||
#endif
|
||||
|
||||
case MENU_ABR:
|
||||
strcpy(String, gSubMenu_BACKLIGHT[gSubMenuSelection]);
|
||||
strcpy(String, gSubMenu_backlight[gSubMenuSelection]);
|
||||
break;
|
||||
|
||||
case MENU_AM:
|
||||
@ -800,15 +800,15 @@ void UI_DisplayMenu(void)
|
||||
#endif
|
||||
|
||||
case MENU_ANI_ID:
|
||||
strcpy(String, gEeprom.ANI_DTMF_ID);
|
||||
strcpy(String, g_eeprom.ani_DTMF_id);
|
||||
break;
|
||||
|
||||
case MENU_UPCODE:
|
||||
strcpy(String, gEeprom.DTMF_UP_CODE);
|
||||
strcpy(String, g_eeprom.DTMF_up_code);
|
||||
break;
|
||||
|
||||
case MENU_DWCODE:
|
||||
strcpy(String, gEeprom.DTMF_DOWN_CODE);
|
||||
strcpy(String, g_eeprom.DTMF_down_code);
|
||||
break;
|
||||
|
||||
case MENU_D_RSP:
|
||||
@ -980,8 +980,8 @@ void UI_DisplayMenu(void)
|
||||
else
|
||||
UI_GenerateChannelStringEx(String, true, gSubMenuSelection);
|
||||
|
||||
// if (gSubMenuSelection == 0xFF || !gEeprom.SCAN_LIST_ENABLED[i])
|
||||
if (gSubMenuSelection < 0 || !gEeprom.SCAN_LIST_ENABLED[i])
|
||||
// if (gSubMenuSelection == 0xFF || !g_eeprom.scan_list_enabled[i])
|
||||
if (gSubMenuSelection < 0 || !g_eeprom.scan_list_enabled[i])
|
||||
{
|
||||
// channel number
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 0, 8);
|
||||
@ -1003,15 +1003,15 @@ void UI_DisplayMenu(void)
|
||||
strcpy(String, "--");
|
||||
UI_PrintStringSmall(String, menu_item_x1, menu_item_x2, 2);
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH1[i]))
|
||||
if (IS_USER_CHANNEL(g_eeprom.scan_list_priority_ch1[i]))
|
||||
{
|
||||
sprintf(String, "PRI1:%u", gEeprom.SCANLIST_PRIORITY_CH1[i] + 1);
|
||||
sprintf(String, "PRI1:%u", g_eeprom.scan_list_priority_ch1[i] + 1);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 3, 8);
|
||||
}
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH2[i]))
|
||||
if (IS_USER_CHANNEL(g_eeprom.scan_list_priority_ch2[i]))
|
||||
{
|
||||
sprintf(String, "PRI2:%u", gEeprom.SCANLIST_PRIORITY_CH2[i] + 1);
|
||||
sprintf(String, "PRI2:%u", g_eeprom.scan_list_priority_ch2[i] + 1);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 5, 8);
|
||||
}
|
||||
}
|
||||
@ -1032,12 +1032,12 @@ void UI_DisplayMenu(void)
|
||||
UI_PrintString("SCAN", menu_item_x1, menu_item_x2, 4, 8);
|
||||
|
||||
if (gMenuCursor == MENU_UPCODE)
|
||||
if (strlen(gEeprom.DTMF_UP_CODE) > 8)
|
||||
UI_PrintString(gEeprom.DTMF_UP_CODE + 8, menu_item_x1, menu_item_x2, 4, 8);
|
||||
if (strlen(g_eeprom.DTMF_up_code) > 8)
|
||||
UI_PrintString(g_eeprom.DTMF_up_code + 8, menu_item_x1, menu_item_x2, 4, 8);
|
||||
|
||||
if (gMenuCursor == MENU_DWCODE)
|
||||
if (strlen(gEeprom.DTMF_DOWN_CODE) > 8)
|
||||
UI_PrintString(gEeprom.DTMF_DOWN_CODE + 8, menu_item_x1, menu_item_x2, 4, 8);
|
||||
if (strlen(g_eeprom.DTMF_down_code) > 8)
|
||||
UI_PrintString(g_eeprom.DTMF_down_code + 8, menu_item_x1, menu_item_x2, 4, 8);
|
||||
|
||||
if (gMenuCursor == MENU_D_LIST && gIsDtmfContactValid)
|
||||
{
|
||||
|
@ -20,11 +20,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "audio.h" // VOICE_ID_t
|
||||
#include "audio.h" // voice_id_t
|
||||
|
||||
typedef struct {
|
||||
const char name[7]; // menu display area only has room for 6 characters
|
||||
VOICE_ID_t voice_id;
|
||||
voice_id_t voice_id;
|
||||
uint8_t menu_id;
|
||||
} t_menu_item;
|
||||
|
||||
@ -164,7 +164,7 @@ extern const char gSubMenu_PONMSG[4][8];
|
||||
extern const char gSubMenu_ROGER[3][9];
|
||||
extern const char gSubMenu_RESET[2][4];
|
||||
extern const char gSubMenu_F_LOCK[6][4];
|
||||
extern const char gSubMenu_BACKLIGHT[8][7];
|
||||
extern const char gSubMenu_backlight[8][7];
|
||||
extern const char gSubMenu_RX_TX[4][6];
|
||||
#ifdef ENABLE_AM_FIX_TEST1
|
||||
extern const char gSubMenu_AM_fix_test1[4][8];
|
||||
|
20
ui/status.c
20
ui/status.c
@ -96,15 +96,15 @@ void UI_DisplayStatus(const bool test_display)
|
||||
// SCAN indicator
|
||||
if (gScanStateDir != SCAN_OFF || gScreenToDisplay == DISPLAY_SCANNER || test_display)
|
||||
{
|
||||
if (gNextMrChannel <= MR_CHANNEL_LAST)
|
||||
if (gNextChannel <= USER_CHANNEL_LAST)
|
||||
{ // channel mode
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 0)
|
||||
if (g_eeprom.scan_list_default == 0)
|
||||
UI_PrintStringSmallBuffer("1", line + x);
|
||||
else
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 1)
|
||||
if (g_eeprom.scan_list_default == 1)
|
||||
UI_PrintStringSmallBuffer("2", line + x);
|
||||
else
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 2)
|
||||
if (g_eeprom.scan_list_default == 2)
|
||||
UI_PrintStringSmallBuffer("*", line + x);
|
||||
}
|
||||
else
|
||||
@ -117,7 +117,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
// VOICE indicator
|
||||
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF || test_display)
|
||||
if (g_eeprom.voice_prompt != VOICE_PROMPT_OFF || test_display)
|
||||
{
|
||||
memmove(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
|
||||
x1 = x + sizeof(BITMAP_VoicePrompt);
|
||||
@ -128,7 +128,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
#endif
|
||||
|
||||
// DUAL-WATCH indicator
|
||||
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF || test_display)
|
||||
if (g_eeprom.dual_watch != DUAL_WATCH_OFF || test_display)
|
||||
{
|
||||
if (gDualWatchActive || test_display)
|
||||
memmove(line + x, BITMAP_TDR1, sizeof(BITMAP_TDR1));
|
||||
@ -138,7 +138,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
x += sizeof(BITMAP_TDR1);
|
||||
|
||||
// CROSS-VFO indicator
|
||||
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF || test_display)
|
||||
if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF || test_display)
|
||||
{
|
||||
memmove(line + x, BITMAP_XB, sizeof(BITMAP_XB));
|
||||
x1 = x + sizeof(BITMAP_XB);
|
||||
@ -147,7 +147,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
|
||||
#ifdef ENABLE_VOX
|
||||
// VOX indicator
|
||||
if (gEeprom.VOX_SWITCH || test_display)
|
||||
if (g_eeprom.vox_switch || test_display)
|
||||
{
|
||||
memmove(line + x, BITMAP_VOX, sizeof(BITMAP_VOX));
|
||||
x1 = x + sizeof(BITMAP_VOX);
|
||||
@ -156,14 +156,14 @@ void UI_DisplayStatus(const bool test_display)
|
||||
#endif
|
||||
|
||||
// KEY-LOCK indicator
|
||||
if (gEeprom.KEY_LOCK || test_display)
|
||||
if (g_eeprom.key_lock || test_display)
|
||||
{
|
||||
memmove(line + x, BITMAP_KeyLock, sizeof(BITMAP_KeyLock));
|
||||
x += sizeof(BITMAP_KeyLock);
|
||||
x1 = x;
|
||||
}
|
||||
else
|
||||
if (gWasFKeyPressed)
|
||||
if (g_was_f_key_pressed)
|
||||
{
|
||||
memmove(line + x, BITMAP_F_Key, sizeof(BITMAP_F_Key));
|
||||
x += sizeof(BITMAP_F_Key);
|
||||
|
2
ui/ui.c
2
ui/ui.c
@ -94,7 +94,7 @@ void GUI_SelectNextDisplay(GUI_DisplayType_t Display)
|
||||
gAskForConfirmation = 0;
|
||||
gAskToSave = false;
|
||||
gAskToDelete = false;
|
||||
gWasFKeyPressed = false;
|
||||
g_was_f_key_pressed = false;
|
||||
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
|
@ -48,12 +48,12 @@ void UI_DisplayWelcome(void)
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE)
|
||||
if (g_eeprom.pwr_on_display_mode == PWR_ON_DISPLAY_MODE_NONE)
|
||||
{
|
||||
ST7565_FillScreen(0xFF);
|
||||
}
|
||||
else
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN)
|
||||
if (g_eeprom.pwr_on_display_mode == PWR_ON_DISPLAY_MODE_FULL_SCREEN)
|
||||
{
|
||||
ST7565_FillScreen(0xFF);
|
||||
}
|
||||
@ -63,7 +63,7 @@ void UI_DisplayWelcome(void)
|
||||
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
||||
memset(WelcomeString2, 0, sizeof(WelcomeString2));
|
||||
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_VOLTAGE)
|
||||
if (g_eeprom.pwr_on_display_mode == PWR_ON_DISPLAY_MODE_VOLTAGE)
|
||||
{
|
||||
strcpy(WelcomeString0, "VOLTAGE");
|
||||
sprintf(WelcomeString1, "%u.%02uV %u%%",
|
||||
|
Reference in New Issue
Block a user