mirror of
https://github.com/kamilsss655/uv-k5-firmware-custom
synced 2024-11-22 02:08:48 +00:00
Scrambler inversion frequencies shown in menu
This commit is contained in:
parent
cb92f2e098
commit
ee05c4f075
116
app/app.c
116
app/app.c
@ -861,80 +861,79 @@ void APP_EndTransmission(void)
|
||||
}
|
||||
|
||||
RADIO_SetupRegisters(false);
|
||||
|
||||
if (gMonitor)
|
||||
ACTION_Monitor(); // 1of11
|
||||
}
|
||||
|
||||
static void APP_HandleVox(void)
|
||||
{
|
||||
if (!gSetting_KILLED)
|
||||
if (gSetting_KILLED)
|
||||
return;
|
||||
|
||||
if (gVoxResumeCountdown == 0)
|
||||
{
|
||||
if (gVoxResumeCountdown == 0)
|
||||
{
|
||||
if (gVoxPauseCountdown)
|
||||
return;
|
||||
}
|
||||
if (gVoxPauseCountdown)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_VOX_Lost = false;
|
||||
gVoxPauseCountdown = 0;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
if (gFmRadioMode)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR)
|
||||
return;
|
||||
|
||||
if (gScanState != SCAN_OFF || gCssScanMode != CSS_SCAN_MODE_OFF)
|
||||
return;
|
||||
|
||||
if (gVOX_NoiseDetected)
|
||||
{
|
||||
if (g_VOX_Lost)
|
||||
gVoxStopCountdown_10ms = vox_stop_count_down_10ms;
|
||||
else
|
||||
{
|
||||
g_VOX_Lost = false;
|
||||
gVoxPauseCountdown = 0;
|
||||
}
|
||||
if (gVoxStopCountdown_10ms == 0)
|
||||
gVOX_NoiseDetected = false;
|
||||
|
||||
if (gCurrentFunction != FUNCTION_RECEIVE &&
|
||||
gCurrentFunction != FUNCTION_MONITOR &&
|
||||
gScanState == SCAN_OFF &&
|
||||
gCssScanMode == CSS_SCAN_MODE_OFF
|
||||
#ifdef ENABLE_FMRADIO
|
||||
&& !gFmRadioMode
|
||||
#endif
|
||||
)
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected)
|
||||
{
|
||||
if (gVOX_NoiseDetected)
|
||||
if (gFlagEndTransmission)
|
||||
{
|
||||
if (g_VOX_Lost)
|
||||
gVoxStopCountdown_10ms = 100; // 1 sec
|
||||
else
|
||||
if (gVoxStopCountdown_10ms == 0)
|
||||
gVOX_NoiseDetected = false;
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected)
|
||||
{
|
||||
if (gFlagEndTransmission)
|
||||
{
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
}
|
||||
else
|
||||
{
|
||||
APP_EndTransmission();
|
||||
|
||||
if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0)
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
else
|
||||
gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10;
|
||||
}
|
||||
|
||||
gUpdateDisplay = true;
|
||||
gFlagEndTransmission = false;
|
||||
|
||||
return;
|
||||
}
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
}
|
||||
else
|
||||
if (g_VOX_Lost)
|
||||
{
|
||||
gVOX_NoiseDetected = true;
|
||||
APP_EndTransmission();
|
||||
|
||||
if (gCurrentFunction == FUNCTION_POWER_SAVE)
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
|
||||
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
||||
if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0)
|
||||
{
|
||||
gDTMF_ReplyState = DTMF_REPLY_NONE;
|
||||
RADIO_PrepareTX();
|
||||
gUpdateDisplay = true;
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
}
|
||||
else
|
||||
gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10;
|
||||
}
|
||||
|
||||
gUpdateDisplay = true;
|
||||
gFlagEndTransmission = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_VOX_Lost)
|
||||
{
|
||||
gVOX_NoiseDetected = true;
|
||||
|
||||
if (gCurrentFunction == FUNCTION_POWER_SAVE)
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
|
||||
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
||||
{
|
||||
gDTMF_ReplyState = DTMF_REPLY_NONE;
|
||||
RADIO_PrepareTX();
|
||||
gUpdateDisplay = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1452,6 +1451,7 @@ void APP_TimeSlice10ms(void)
|
||||
if (--gRTTECountdown == 0)
|
||||
{
|
||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||
|
||||
gUpdateDisplay = true;
|
||||
}
|
||||
}
|
||||
|
@ -132,6 +132,9 @@ void GENERIC_Key_PTT(bool bKeyPressed)
|
||||
|
||||
RADIO_SetVfoState(VFO_STATE_NORMAL);
|
||||
|
||||
// beep when you release the PTT
|
||||
//gBeepToPlay = BEEP_880HZ_40MS_OPTIONAL; // 1of11
|
||||
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
return;
|
||||
}
|
||||
|
@ -210,6 +210,10 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
break;
|
||||
|
||||
case MENU_SCR:
|
||||
*pMin = 0;
|
||||
*pMax = ARRAY_SIZE(gSubMenu_SCRAMBLER) - 1;
|
||||
break;
|
||||
|
||||
case MENU_VOX:
|
||||
case MENU_TOT:
|
||||
case MENU_RP_STE:
|
||||
|
4
audio.c
4
audio.c
@ -76,9 +76,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
|
||||
uint16_t ToneFrequency;
|
||||
uint16_t Duration;
|
||||
|
||||
if (Beep != BEEP_500HZ_60MS_DOUBLE_BEEP &&
|
||||
Beep != BEEP_440HZ_500MS &&
|
||||
!gEeprom.BEEP_CONTROL)
|
||||
if (Beep != BEEP_500HZ_60MS_DOUBLE_BEEP && Beep != BEEP_440HZ_500MS && !gEeprom.BEEP_CONTROL)
|
||||
return;
|
||||
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
|
@ -814,7 +814,7 @@ void BK4819_EnableScramble(uint8_t Type)
|
||||
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
BK4819_WriteRegister(BK4819_REG_31, Value | (1u << 1));
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_71, 0x68DC + (Type * 1032));
|
||||
BK4819_WriteRegister(BK4819_REG_71, 0x68DC + (Type * 1032)); // 0110 1000 1101 1100
|
||||
}
|
||||
|
||||
bool BK4819_CompanderEnabled(void)
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
33
functions.c
33
functions.c
@ -84,19 +84,16 @@ void FUNCTION_Init(void)
|
||||
|
||||
void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
{
|
||||
FUNCTION_Type_t PreviousFunction = gCurrentFunction;
|
||||
bool bWasPowerSave = (PreviousFunction == FUNCTION_POWER_SAVE);
|
||||
const FUNCTION_Type_t PreviousFunction = gCurrentFunction;
|
||||
const bool bWasPowerSave = (PreviousFunction == FUNCTION_POWER_SAVE);
|
||||
|
||||
gCurrentFunction = Function;
|
||||
|
||||
if (bWasPowerSave)
|
||||
if (bWasPowerSave && Function != FUNCTION_POWER_SAVE)
|
||||
{
|
||||
if (Function != FUNCTION_POWER_SAVE)
|
||||
{
|
||||
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
||||
gRxIdleMode = false;
|
||||
UI_DisplayStatus(false);
|
||||
}
|
||||
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
||||
gRxIdleMode = false;
|
||||
UI_DisplayStatus(false);
|
||||
}
|
||||
|
||||
switch (Function)
|
||||
@ -130,7 +127,6 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
|
||||
case FUNCTION_INCOMING:
|
||||
case FUNCTION_RECEIVE:
|
||||
// gMonitor = false;
|
||||
break;
|
||||
|
||||
case FUNCTION_POWER_SAVE:
|
||||
@ -151,6 +147,10 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
return;
|
||||
|
||||
case FUNCTION_TRANSMIT:
|
||||
|
||||
// if DTMF is enabled when TX'ing, it changes the TX audio filtering !! .. 1of11
|
||||
BK4819_DisableDTMF();
|
||||
|
||||
#if defined(ENABLE_FMRADIO)
|
||||
if (gFmRadioMode)
|
||||
BK1080_Init(0, false);
|
||||
@ -160,22 +160,32 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
if (gAlarmState == ALARM_STATE_TXALARM && gEeprom.ALARM_MODE != ALARM_MODE_TONE)
|
||||
{
|
||||
gAlarmState = ALARM_STATE_ALARM;
|
||||
|
||||
GUI_DisplayScreen();
|
||||
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||
|
||||
SYSTEM_DelayMs(20);
|
||||
BK4819_PlayTone(500, 0);
|
||||
SYSTEM_DelayMs(2);
|
||||
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||
|
||||
gEnableSpeaker = true;
|
||||
|
||||
SYSTEM_DelayMs(60);
|
||||
BK4819_ExitTxMute();
|
||||
|
||||
gAlarmToneCounter = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
GUI_DisplayScreen();
|
||||
|
||||
RADIO_SetTxParameters();
|
||||
|
||||
// turn the LED on RED
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_RED, true);
|
||||
|
||||
DTMF_Reply();
|
||||
@ -192,9 +202,6 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
||||
}
|
||||
#endif
|
||||
|
||||
// if the DTMF decoder is enabled, it destroys the TX audio !! .. 1of11
|
||||
BK4819_DisableDTMF();
|
||||
|
||||
if (gCurrentVfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
||||
BK4819_EnableScramble(gCurrentVfo->SCRAMBLING_TYPE - 1);
|
||||
else
|
||||
|
2
misc.c
2
misc.c
@ -57,6 +57,8 @@ const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds
|
||||
const uint16_t power_save1_10ms = 100 / 10; // 100ms
|
||||
const uint16_t power_save2_10ms = 200 / 10; // 200ms
|
||||
|
||||
const uint16_t vox_stop_count_down_10ms = 1000 / 10; // 1 second
|
||||
|
||||
const uint16_t NOAA_countdown_10ms = 5000 / 10; // 5 seconds
|
||||
const uint16_t NOAA_countdown_2_10ms = 500 / 10; // 500ms
|
||||
const uint16_t NOAA_countdown_3_10ms = 200 / 10; // 200ms
|
||||
|
2
misc.h
2
misc.h
@ -109,6 +109,8 @@ extern const uint16_t battery_save_count_10ms;
|
||||
extern const uint16_t power_save1_10ms;
|
||||
extern const uint16_t power_save2_10ms;
|
||||
|
||||
extern const uint16_t vox_stop_count_down_10ms;
|
||||
|
||||
extern const uint16_t NOAA_countdown_10ms;
|
||||
extern const uint16_t NOAA_countdown_2_10ms;
|
||||
extern const uint16_t NOAA_countdown_3_10ms;
|
||||
|
18
ui/menu.c
18
ui/menu.c
@ -291,6 +291,21 @@ const char gSubMenu_BAT_TXT[3][8] =
|
||||
"PERCENT"
|
||||
};
|
||||
|
||||
const char gSubMenu_SCRAMBLER[11][7] =
|
||||
{
|
||||
"OFF",
|
||||
"2600Hz",
|
||||
"2700Hz",
|
||||
"2800Hz",
|
||||
"2900Hz",
|
||||
"3000Hz",
|
||||
"3100Hz",
|
||||
"3200Hz",
|
||||
"3300Hz",
|
||||
"3400Hz",
|
||||
"3500Hz"
|
||||
};
|
||||
|
||||
bool gIsInSubMenu;
|
||||
uint8_t gMenuCursor;
|
||||
int8_t gMenuScrollDirection;
|
||||
@ -421,6 +436,9 @@ void UI_DisplayMenu(void)
|
||||
break;
|
||||
|
||||
case MENU_SCR:
|
||||
strcpy(String, gSubMenu_SCRAMBLER[gSubMenuSelection]);
|
||||
break;
|
||||
|
||||
case MENU_VOX:
|
||||
if (gSubMenuSelection == 0)
|
||||
strcpy(String, "OFF");
|
||||
|
Loading…
Reference in New Issue
Block a user