Enable/disable DTMF calling compile option

This commit is contained in:
Krzysiek Egzmont
2023-11-28 20:11:03 +01:00
parent 7857e8ed7a
commit 050e04bcfd
22 changed files with 276 additions and 103 deletions

View File

@@ -97,16 +97,22 @@ const t_menu_item MenuList[] =
#ifdef ENABLE_ALARM
{"AlarmT", VOICE_ID_INVALID, MENU_AL_MOD },
#endif
#ifdef ENABLE_DTMF_CALLING
{"ANI ID", VOICE_ID_ANI_CODE, MENU_ANI_ID },
#endif
{"UPCode", VOICE_ID_INVALID, MENU_UPCODE },
{"DWCode", VOICE_ID_INVALID, MENU_DWCODE },
{"PTT ID", VOICE_ID_INVALID, MENU_PTT_ID },
{"D ST", VOICE_ID_INVALID, MENU_D_ST },
#ifdef ENABLE_DTMF_CALLING
{"D Resp", VOICE_ID_INVALID, MENU_D_RSP },
{"D Hold", VOICE_ID_INVALID, MENU_D_HOLD },
#endif
{"D Prel", VOICE_ID_INVALID, MENU_D_PRE },
#ifdef ENABLE_DTMF_CALLING
{"D Decd", VOICE_ID_INVALID, MENU_D_DCD },
{"D List", VOICE_ID_INVALID, MENU_D_LIST },
#endif
{"D Live", VOICE_ID_INVALID, MENU_D_LIVE_DEC }, // live DTMF decoder
#ifdef ENABLE_AM_FIX
{"AM Fix", VOICE_ID_INVALID, MENU_AM_FIX },
@@ -231,6 +237,7 @@ const char* gSubMenu_MDF[] =
};
#endif
#ifdef ENABLE_DTMF_CALLING
const char gSubMenu_D_RSP[][11] =
{
"DO\nNOTHING",
@@ -238,6 +245,7 @@ const char gSubMenu_D_RSP[][11] =
"REPLY",
"BOTH"
};
#endif
const char* gSubMenu_PTT_ID[] =
{
@@ -400,7 +408,10 @@ void UI_DisplayMenu(void)
const unsigned int menu_item_x2 = LCD_WIDTH - 1;
unsigned int i;
char String[64]; // bigger cuz we can now do multi-line in one string (use '\n' char)
#ifdef ENABLE_DTMF_CALLING
char Contact[16];
#endif
// clear the screen buffer
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
@@ -625,7 +636,9 @@ void UI_DisplayMenu(void)
case MENU_S_ADD2:
case MENU_STE:
case MENU_D_ST:
#ifdef ENABLE_DTMF_CALLING
case MENU_D_DCD:
#endif
case MENU_D_LIVE_DEC:
#ifdef ENABLE_NOAA
case MENU_NOAA_S:
@@ -743,10 +756,11 @@ void UI_DisplayMenu(void)
break;
#endif
#ifdef ENABLE_DTMF_CALLING
case MENU_ANI_ID:
strcpy(String, gEeprom.ANI_DTMF_ID);
break;
#endif
case MENU_UPCODE:
strcpy(String, gEeprom.DTMF_UP_CODE);
break;
@@ -755,6 +769,7 @@ void UI_DisplayMenu(void)
strcpy(String, gEeprom.DTMF_DOWN_CODE);
break;
#ifdef ENABLE_DTMF_CALLING
case MENU_D_RSP:
strcpy(String, gSubMenu_D_RSP[gSubMenuSelection]);
break;
@@ -762,7 +777,7 @@ void UI_DisplayMenu(void)
case MENU_D_HOLD:
sprintf(String, "%ds", gSubMenuSelection);
break;
#endif
case MENU_D_PRE:
sprintf(String, "%d*10ms", gSubMenuSelection);
break;
@@ -775,6 +790,7 @@ void UI_DisplayMenu(void)
strcpy(String, gSubMenu_BAT_TXT[gSubMenuSelection]);
break;
#ifdef ENABLE_DTMF_CALLING
case MENU_D_LIST:
gIsDtmfContactValid = DTMF_GetContact((int)gSubMenuSelection - 1, Contact);
if (!gIsDtmfContactValid)
@@ -782,6 +798,7 @@ void UI_DisplayMenu(void)
else
memmove(String, Contact, 8);
break;
#endif
case MENU_PONMSG:
strcpy(String, gSubMenu_PONMSG[gSubMenuSelection]);
@@ -968,6 +985,7 @@ void UI_DisplayMenu(void)
if (strlen(gEeprom.DTMF_DOWN_CODE) > 8)
UI_PrintString(gEeprom.DTMF_DOWN_CODE + 8, menu_item_x1, menu_item_x2, 4, 8);
#ifdef ENABLE_DTMF_CALLING
if (UI_MENU_GetCurrentMenuId() == MENU_D_LIST && gIsDtmfContactValid)
{
Contact[11] = 0;
@@ -975,12 +993,17 @@ void UI_DisplayMenu(void)
sprintf(String, "ID:%s", Contact + 8);
UI_PrintString(String, menu_item_x1, menu_item_x2, 4, 8);
}
#endif
if (UI_MENU_GetCurrentMenuId() == MENU_R_CTCS ||
UI_MENU_GetCurrentMenuId() == MENU_T_CTCS ||
UI_MENU_GetCurrentMenuId() == MENU_R_DCS ||
UI_MENU_GetCurrentMenuId() == MENU_T_DCS ||
UI_MENU_GetCurrentMenuId() == MENU_D_LIST)
UI_MENU_GetCurrentMenuId() == MENU_T_DCS
#ifdef ENABLE_DTMF_CALLING
|| UI_MENU_GetCurrentMenuId() == MENU_D_LIST
#endif
)
{
sprintf(String, "%2d", gSubMenuSelection);
UI_PrintStringSmall(String, 105, 0, 0);