0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-08-03 09:36:32 +03:00

Various DTMF bug fixes and renames

This commit is contained in:
OneOfEleven
2023-09-30 11:22:19 +01:00
parent f4643adb2a
commit 9493f34c23
21 changed files with 360 additions and 203 deletions

View File

@@ -36,6 +36,8 @@
#include "ui/main.h"
#include "ui/ui.h"
bool center_line_is_free = true;
// ***************************************************************************
#ifdef ENABLE_AUDIO_BAR
@@ -180,6 +182,9 @@ void UI_UpdateRSSI(const int16_t rssi, const int vfo)
{
#ifdef ENABLE_RSSI_BAR
if (!center_line_is_free)
return;
const bool rx = (gCurrentFunction == FUNCTION_RECEIVE ||
gCurrentFunction == FUNCTION_MONITOR ||
gCurrentFunction == FUNCTION_INCOMING);
@@ -286,8 +291,9 @@ void UI_DisplayMain(void)
{
char String[16];
unsigned int vfo_num;
bool center_line_is_free = true;
center_line_is_free = true;
// #ifdef SINGLE_VFO_CHAN
// const bool single_vfo = (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? true : false;
// #else
@@ -338,7 +344,7 @@ void UI_DisplayMain(void)
strcpy(String, (gDTMF_State == DTMF_STATE_CALL_OUT_RSP) ? "CALL OUT(RSP)" : "CALL OUT");
else
if (gDTMF_CallState == DTMF_CALL_STATE_RECEIVED)
sprintf(String, "CALL:%s", (DTMF_FindContact(gDTMF_Caller, Contact)) ? Contact : gDTMF_Caller);
sprintf(String, "CALL FRM:%s", (DTMF_FindContact(gDTMF_Caller, Contact)) ? Contact : gDTMF_Caller);
else
if (gDTMF_IsTx)
strcpy(String, (gDTMF_State == DTMF_STATE_TX_SUCC) ? "DTMF TX(SUCC)" : "DTMF TX");
@@ -680,7 +686,7 @@ void UI_DisplayMain(void)
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, Line + 1);
}
// show the DTMF decoding symbol(
// show the DTMF decoding symbol
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, Line + 1);
@@ -722,15 +728,26 @@ void UI_DisplayMain(void)
if (rx || gCurrentFunction == FUNCTION_FOREGROUND)
{
if (gSetting_live_DTMF_decoder && gDTMF_RX_live[0] >= 32)
{ // show live DTMF decode
const unsigned int len = strlen(gDTMF_RX_live);
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
strcpy(String, "DTMF ");
strcat(String, gDTMF_RX_live + idx);
UI_PrintStringSmall(String, 2, 0, 3);
}
#if 1
if (gSetting_live_DTMF_decoder && gDTMF_RX_live[0] != 0)
{ // show live DTMF decode
const unsigned int len = strlen(gDTMF_RX_live);
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
strcpy(String, "DTMF ");
strcat(String, gDTMF_RX_live + idx);
UI_PrintStringSmall(String, 2, 0, 3);
}
#else
if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0)
{ // show live DTMF decode
const unsigned int len = gDTMF_RX_index;
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
strcpy(String, "DTMF ");
strcat(String, gDTMF_RX + idx);
UI_PrintStringSmall(String, 2, 0, 3);
}
#endif
#ifdef ENABLE_SHOW_CHARGE_LEVEL
else
if (gChargingWithTypeC)

View File

@@ -184,8 +184,15 @@ const char gSubMenu_TOT[11][7] =
const char gSubMenu_CHAN[3][7] =
{
"OFF",
"CHAN_A",
"CHAN_B"
"CHAN A",
"CHAN B"
};
const char gSubMenu_XB[3][7] =
{
"SAME",
"CHAN A",
"CHAN B"
};
#ifdef ENABLE_VOICE
@@ -575,10 +582,13 @@ void UI_DisplayMenu(void)
break;
case MENU_TDR:
case MENU_XB:
strcpy(String, gSubMenu_CHAN[gSubMenuSelection]);
break;
case MENU_XB:
strcpy(String, gSubMenu_XB[gSubMenuSelection]);
break;
case MENU_TOT:
strcpy(String, gSubMenu_TOT[gSubMenuSelection]);
break;

View File

@@ -125,6 +125,7 @@ extern const char gSubMenu_OFF_ON[2][4];
extern const char gSubMenu_SAVE[5][4];
extern const char gSubMenu_TOT[11][7];
extern const char gSubMenu_CHAN[3][7];
extern const char gSubMenu_XB[3][7];
#ifdef ENABLE_VOICE
extern const char gSubMenu_VOICE[3][4];
#endif