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

1750Hz tone side key now a momentary action (press to TX tone, release to stop TX tone)

This commit is contained in:
OneOfEleven 2023-10-04 00:15:01 +01:00
parent 6e2ba5c214
commit eaccdab1d4
6 changed files with 13 additions and 4 deletions

View File

@ -12,7 +12,7 @@ ENABLE_FMRADIO := 0
ENABLE_NOAA := 0 ENABLE_NOAA := 0
ENABLE_VOICE := 0 ENABLE_VOICE := 0
ENABLE_ALARM := 0 ENABLE_ALARM := 0
ENABLE_TX1750 := 0 ENABLE_TX1750 := 1
ENABLE_BIG_FREQ := 0 ENABLE_BIG_FREQ := 0
ENABLE_SMALL_BOLD := 1 ENABLE_SMALL_BOLD := 1
ENABLE_KEEP_MEM_NAME := 1 ENABLE_KEEP_MEM_NAME := 1

View File

@ -236,7 +236,7 @@ void ACTION_Vox(void)
} }
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
static void ACTION_AlarmOr1750(bool b1750) static void ACTION_AlarmOr1750(const bool b1750)
{ {
gInputBoxIndex = 0; gInputBoxIndex = 0;
@ -252,7 +252,7 @@ void ACTION_Vox(void)
gFlagPrepareTX = true; gFlagPrepareTX = true;
// if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN; gRequestDisplayScreen = DISPLAY_MAIN;
} }
#endif #endif

View File

@ -2262,10 +2262,12 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
} }
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
else else
if (!bKeyHeld && bKeyPressed) if ((!bKeyHeld && bKeyPressed) || (gAlarmState == ALARM_STATE_TX1750 && bKeyHeld && !bKeyPressed))
{ {
ALARM_Off(); ALARM_Off();
// TODO: fix side key 1750, you have to press it twice to restart the tone :(
if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0)
{ {
//if (gCurrentFunction != FUNCTION_FOREGROUND) //if (gCurrentFunction != FUNCTION_FOREGROUND)
@ -2278,6 +2280,8 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gPttWasPressed = true; gPttWasPressed = true;
else else
gPttWasReleased = true; gPttWasReleased = true;
bKeyHeld = false;
} }
#endif #endif
} }

Binary file not shown.

Binary file not shown.

View File

@ -89,6 +89,11 @@ center_line_t center_line = CENTER_LINE_NONE;
if (gCurrentFunction != FUNCTION_TRANSMIT) if (gCurrentFunction != FUNCTION_TRANSMIT)
return; return;
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
if (gAlarmState != ALARM_STATE_OFF)
return;
#endif
const unsigned int voice_amp = BK4819_GetVoiceAmplitudeOut(); // 15:0 const unsigned int voice_amp = BK4819_GetVoiceAmplitudeOut(); // 15:0
// const unsigned int max = 65535; // const unsigned int max = 65535;