Scrambler inversion frequencies shown in menu

This commit is contained in:
OneOfEleven 2023-09-26 16:48:16 +01:00
parent cb92f2e098
commit ee05c4f075
12 changed files with 112 additions and 76 deletions

View File

@ -861,15 +861,13 @@ 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 (gVoxPauseCountdown)
@ -881,19 +879,21 @@ static void APP_HandleVox(void)
gVoxPauseCountdown = 0;
}
if (gCurrentFunction != FUNCTION_RECEIVE &&
gCurrentFunction != FUNCTION_MONITOR &&
gScanState == SCAN_OFF &&
gCssScanMode == CSS_SCAN_MODE_OFF
#ifdef ENABLE_FMRADIO
&& !gFmRadioMode
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 = 100; // 1 sec
gVoxStopCountdown_10ms = vox_stop_count_down_10ms;
else
if (gVoxStopCountdown_10ms == 0)
gVOX_NoiseDetected = false;
@ -909,18 +909,19 @@ static void APP_HandleVox(void)
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;
}
}
else
if (g_VOX_Lost)
{
gVOX_NoiseDetected = true;
@ -935,8 +936,6 @@ static void APP_HandleVox(void)
gUpdateDisplay = true;
}
}
}
}
}
void APP_Update(void)
@ -1452,6 +1451,7 @@ void APP_TimeSlice10ms(void)
if (--gRTTECountdown == 0)
{
FUNCTION_Select(FUNCTION_FOREGROUND);
gUpdateDisplay = true;
}
}

View File

@ -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;
}

View File

@ -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:

View File

@ -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

View File

@ -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)

Binary file not shown.

Binary file not shown.

View File

@ -84,20 +84,17 @@ 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 (Function != FUNCTION_POWER_SAVE)
if (bWasPowerSave && Function != FUNCTION_POWER_SAVE)
{
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
View File

@ -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
View File

@ -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;

View File

@ -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");

View File

@ -147,6 +147,8 @@ extern const char gSubMenu_BACKLIGHT[8][7];
#endif
extern const char gSubMenu_BAT_TXT[3][8];
extern const char gSubMenu_SCRAMBLER[11][7];
extern bool gIsInSubMenu;
extern uint8_t gMenuCursor;