10 Commits
v0.22 ... main

Author SHA1 Message Date
Matias Fernandez
7607f0a4bd Fix typo in README.md 2024-03-26 20:33:06 +01:00
Krzysiek Egzmont
f2cdf1975f refactor 2024-03-17 15:43:45 +01:00
Bogdan-Ioan BRUDIU
eeee11cf1b spectrum analyzer assignable to Side button, close #478
Signed-off-by: Krzysiek Egzmont <egzumer@gmail.com>
2024-02-23 21:43:38 +01:00
egzumer
1da45d5a77 Update README.md 2024-02-21 00:16:58 +01:00
Krzysiek Egzmont
1098e8c386 Fix DTMF_auto_reset_time sanity check bug 2024-02-04 22:54:31 +01:00
losehu
ce2dd10d45 The dbMax range is more stringent
"If you want the dbMax value to always be greater than dbMin, there should be at least a '+1'."
2024-02-01 20:41:16 +01:00
Krzysiek Egzmont
a22760c0b4 Fix #434: Don't send tail tone when STE is off 2024-01-29 22:48:37 +01:00
Krzysiek Egzmont
aa92e93c56 Refactor 2024-01-29 22:42:38 +01:00
Krzysiek Egzmont
dc1808b1fe FIX #444: build error when ENABLE_DTMF_CALLING disabled 2024-01-29 16:50:58 +01:00
Krzysiek Egzmont
dff4384dbe FIX #397: Duplex off not working when UNLOCK ALL is used 2024-01-29 16:34:55 +01:00
27 changed files with 118 additions and 155 deletions

View File

@@ -4,10 +4,7 @@ This repository is a merge of [OneOfEleven custom firmware](https://github.com/O
All is a cloned and customized version of DualTachyon's open firmware found [here](https://github.com/DualTachyon/uv-k5-firmware) ... a cool achievement !
> [!TIP]
> There is a work done by others on forks of this repository. I encourage you to take a look at those too.
You can use below links to see comparison between forks.<br>
https://gitpop2.vercel.app/egzumer/uv-k5-firmware-custom<br>
https://useful-forks.github.io/?repo=egzumer/uv-k5-firmware-custom
> There is a work done by others on forks of this repository. I encourage you to take a look at those too. [SEE HERE](https://github.com/egzumer/uv-k5-firmware-custom/discussions/485)
> [!WARNING]
> Use this firmware at your own risk (entirely). There is absolutely no guarantee that it will work in any way shape or form on your radio(s), it may even brick your radio(s), in which case, you'd need to buy another radio.
@@ -86,7 +83,7 @@ You'll find the options at the top of "Makefile" ('0' = disable, '1' = enable) .
|Build option | Description |
| --- | ---- |
|🧰 **STOCK QUANSHENG FERATURES**||
|🧰 **STOCK QUANSHENG FEATURES**||
| ENABLE_UART | without this you can't configure radio via PC ! |
| ENABLE_AIRCOPY | easier to just enter frequency with butts |
| ENABLE_FMRADIO | WBFM VHF broadcast band receiver |

View File

@@ -53,6 +53,10 @@ inline static void ACTION_Alarm() { ACTION_AlarmOr1750(false); }
inline static void ACTION_1750() { ACTION_AlarmOr1750(true); };
#endif
#ifdef ENABLE_SPECTRUM
#include "app/spectrum.h"
#endif
inline static void ACTION_ScanRestart() { ACTION_Scan(true); };
void (*action_opt_table[])(void) = {
@@ -100,6 +104,12 @@ void (*action_opt_table[])(void) = {
#else
[ACTION_OPT_BLMIN_TMP_OFF] = &FUNCTION_NOP,
#endif
#ifdef ENABLE_SPECTRUM
[ACTION_OPT_SPECTRUM] = &APP_RunSpectrum,
#else
[ACTION_OPT_SPECTRUM] = &FUNCTION_NOP,
#endif
};
static_assert(ARRAY_SIZE(action_opt_table) == ACTION_OPT_LEN);
@@ -440,4 +450,4 @@ void ACTION_BlminTmpOff(void)
BACKLIGHT_SetBrightness(0);
}
}
#endif
#endif

View File

@@ -241,14 +241,12 @@ static void HandleReceive(void)
uint8_t Mode = END_OF_RX_MODE_SKIP;
if (gFlagTailNoteEliminationComplete)
{
if (gFlagTailToneEliminationComplete) {
Mode = END_OF_RX_MODE_END;
goto Skip;
}
if (gScanStateDir != SCAN_OFF && IS_FREQ_CHANNEL(gNextMrChannel))
{ // we are scanning in the frequency mode
if (gScanStateDir != SCAN_OFF && IS_FREQ_CHANNEL(gNextMrChannel)) { // we are scanning in the frequency mode
if (g_SquelchLost)
return;
@@ -256,15 +254,13 @@ static void HandleReceive(void)
goto Skip;
}
switch (gCurrentCodeType)
{
switch (gCurrentCodeType) {
default:
case CODE_TYPE_OFF:
break;
case CODE_TYPE_CONTINUOUS_TONE:
if (gFoundCTCSS && gFoundCTCSSCountdown_10ms == 0)
{
if (gFoundCTCSS && gFoundCTCSSCountdown_10ms == 0) {
gFoundCTCSS = false;
gFoundCDCSS = false;
Mode = END_OF_RX_MODE_END;
@@ -274,8 +270,7 @@ static void HandleReceive(void)
case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
if (gFoundCDCSS && gFoundCDCSSCountdown_10ms == 0)
{
if (gFoundCDCSS && gFoundCDCSSCountdown_10ms == 0) {
gFoundCTCSS = false;
gFoundCDCSS = false;
Mode = END_OF_RX_MODE_END;
@@ -284,21 +279,16 @@ static void HandleReceive(void)
break;
}
if (g_SquelchLost)
{
#ifdef ENABLE_NOAA
if (!gEndOfRxDetectedMaybe && !IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE))
#else
if (!gEndOfRxDetectedMaybe)
#endif
{
switch (gCurrentCodeType)
{
if (g_SquelchLost) {
if (!gEndOfRxDetectedMaybe
#ifdef ENABLE_NOAA
&& !IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE)
#endif
) {
switch (gCurrentCodeType) {
case CODE_TYPE_OFF:
if (gEeprom.SQUELCH_LEVEL)
{
if (g_CxCSS_TAIL_Found)
{
if (gEeprom.SQUELCH_LEVEL) {
if (g_CxCSS_TAIL_Found) {
Mode = END_OF_RX_MODE_TTE;
g_CxCSS_TAIL_Found = false;
}
@@ -306,19 +296,15 @@ static void HandleReceive(void)
break;
case CODE_TYPE_CONTINUOUS_TONE:
if (g_CTCSS_Lost)
{
if (g_CTCSS_Lost) {
gFoundCTCSS = false;
}
else
if (!gFoundCTCSS)
{
else if (!gFoundCTCSS) {
gFoundCTCSS = true;
gFoundCTCSSCountdown_10ms = 100; // 1 sec
}
if (g_CxCSS_TAIL_Found)
{
if (g_CxCSS_TAIL_Found) {
Mode = END_OF_RX_MODE_TTE;
g_CxCSS_TAIL_Found = false;
}
@@ -326,19 +312,15 @@ static void HandleReceive(void)
case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
if (g_CDCSS_Lost && gCDCSSCodeType == CDCSS_POSITIVE_CODE)
{
if (g_CDCSS_Lost && gCDCSSCodeType == CDCSS_POSITIVE_CODE) {
gFoundCDCSS = false;
}
else
if (!gFoundCDCSS)
{
else if (!gFoundCDCSS) {
gFoundCDCSS = true;
gFoundCDCSSCountdown_10ms = 100; // 1 sec
}
if (g_CxCSS_TAIL_Found)
{
if (g_CxCSS_TAIL_Found) {
if (BK4819_GetCTCType() == 1)
Mode = END_OF_RX_MODE_TTE;
@@ -356,32 +338,28 @@ static void HandleReceive(void)
Mode == END_OF_RX_MODE_SKIP &&
gNextTimeslice40ms &&
gEeprom.TAIL_TONE_ELIMINATION &&
(gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL) &&
(gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL) &&
BK4819_GetCTCType() == 1)
Mode = END_OF_RX_MODE_TTE;
else
gNextTimeslice40ms = false;
Skip:
switch (Mode)
{
switch (Mode) {
case END_OF_RX_MODE_SKIP:
break;
case END_OF_RX_MODE_END:
RADIO_SetupRegisters(true);
#ifdef ENABLE_NOAA
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE))
gNOAACountdown_10ms = 300; // 3 sec
#endif
#ifdef ENABLE_NOAA
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE))
gNOAACountdown_10ms = 300; // 3 sec
#endif
gUpdateDisplay = true;
if (gScanStateDir != SCAN_OFF)
{
switch (gEeprom.SCAN_RESUME_MODE)
{
if (gScanStateDir != SCAN_OFF) {
switch (gEeprom.SCAN_RESUME_MODE) {
case SCAN_RESUME_TO:
break;
@@ -399,12 +377,11 @@ Skip:
break;
case END_OF_RX_MODE_TTE:
if (gEeprom.TAIL_TONE_ELIMINATION)
{
if (gEeprom.TAIL_TONE_ELIMINATION) {
AUDIO_AudioPathOff();
gTailNoteEliminationCountdown_10ms = 20;
gFlagTailNoteEliminationComplete = false;
gTailToneEliminationCountdown_10ms = 20;
gFlagTailToneEliminationComplete = false;
gEndOfRxDetectedMaybe = true;
gEnableSpeaker = false;
}
@@ -1196,7 +1173,8 @@ void APP_TimeSlice10ms(void)
if (gAlarmState == ALARM_STATE_TXALARM) {
gAlarmState = ALARM_STATE_SITE_ALARM;
RADIO_EnableCxCSS();
if(gEeprom.TAIL_TONE_ELIMINATION)
RADIO_SendCssTail();
BK4819_SetupPowerAmplifier(0, 0);
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
BK4819_Enable_AfDac_DiscMode_TxDsp();

View File

@@ -80,11 +80,9 @@ void DTMF_clear_RX(void)
void DTMF_SendEndOfTransmission(void)
{
if (gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_APOLLO) {
if (gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_APOLLO)
BK4819_PlaySingleTone(2475, 250, 28, gEeprom.DTMF_SIDE_TONE);
}
if ((gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_TX_DOWN || gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_BOTH)
else if ((gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_TX_DOWN || gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_BOTH)
#ifdef ENABLE_DTMF_CALLING
&& gDTMF_CallState == DTMF_CALL_STATE_NONE
#endif

View File

@@ -1139,8 +1139,7 @@ void MENU_ShowCurrentSetting(void)
case MENU_F1LONG:
case MENU_F2SHRT:
case MENU_F2LONG:
case MENU_MLONG:
{
case MENU_MLONG: {
uint8_t * fun[]= {
&gEeprom.KEY_1_SHORT_PRESS_ACTION,
&gEeprom.KEY_1_LONG_PRESS_ACTION,
@@ -1202,17 +1201,14 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gRequestDisplayScreen = DISPLAY_MENU;
if (!gIsInSubMenu)
{
switch (gInputBoxIndex)
{
if (!gIsInSubMenu) {
switch (gInputBoxIndex) {
case 2:
gInputBoxIndex = 0;
Value = (gInputBox[0] * 10) + gInputBox[1];
if (Value > 0 && Value <= gMenuListCount)
{
if (Value > 0 && Value <= gMenuListCount) {
gMenuCursor = Value - 1;
gFlagRefreshSetting = true;
return;
@@ -1226,8 +1222,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
[[fallthrough]];
case 1:
Value = gInputBox[0];
if (Value > 0 && Value <= gMenuListCount)
{
if (Value > 0 && Value <= gMenuListCount) {
gMenuCursor = Value - 1;
gFlagRefreshSetting = true;
return;
@@ -1241,21 +1236,19 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
return;
}
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET)
{
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET) {
uint32_t Frequency;
if (gInputBoxIndex < 6)
{ // invalid frequency
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
if (gInputBoxIndex < 6) { // invalid frequency
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
return;
}
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
Frequency = StrToUL(INPUTBOX_GetAscii())*100;
gSubMenuSelection = FREQUENCY_RoundToStep(Frequency, gTxVfo->StepFrequency);
@@ -1270,11 +1263,10 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME)
{ // enter 3-digit channel number
if (gInputBoxIndex < 3)
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
if (gInputBoxIndex < 3) {
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
gRequestDisplayScreen = DISPLAY_MENU;
return;
}
@@ -1283,11 +1275,10 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Value = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1;
if (IS_MR_CHANNEL(Value))
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
if (IS_MR_CHANNEL(Value)) {
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
gSubMenuSelection = Value;
return;
}
@@ -1296,8 +1287,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
return;
}
if (MENU_GetLimits(UI_MENU_GetCurrentMenuId(), &Min, &Max))
{
if (MENU_GetLimits(UI_MENU_GetCurrentMenuId(), &Min, &Max)) {
gInputBoxIndex = 0;
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
return;
@@ -1305,8 +1295,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Offset = (Max >= 100) ? 3 : (Max >= 10) ? 2 : 1;
switch (gInputBoxIndex)
{
switch (gInputBoxIndex) {
case 1:
Value = gInputBox[0];
break;
@@ -1321,8 +1310,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (Offset == gInputBoxIndex)
gInputBoxIndex = 0;
if (Value <= Max)
{
if (Value <= Max) {
gSubMenuSelection = Value;
return;
}
@@ -1404,7 +1392,12 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
if (UI_MENU_GetCurrentMenuId() != MENU_SCR)
gAnotherVoiceID = MenuList[gMenuCursor].voice_id;
#endif
if (UI_MENU_GetCurrentMenuId() == MENU_ANI_ID || UI_MENU_GetCurrentMenuId() == MENU_UPCODE|| UI_MENU_GetCurrentMenuId() == MENU_DWCODE)
if (UI_MENU_GetCurrentMenuId() == MENU_UPCODE
|| UI_MENU_GetCurrentMenuId() == MENU_DWCODE
#ifdef ENABLE_DTMF_CALLING
|| UI_MENU_GetCurrentMenuId() == MENU_ANI_ID
#endif
)
return;
#if 1
if (UI_MENU_GetCurrentMenuId() == MENU_DEL_CH || UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME)
@@ -1608,16 +1601,13 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
gInputBoxIndex = 0;
}
else
if (!bKeyPressed)
else if (!bKeyPressed)
return;
if (SCANNER_IsScanning()) {
if (SCANNER_IsScanning())
return;
}
if (!gIsInSubMenu)
{
if (!gIsInSubMenu) {
gMenuCursor = NUMBER_AddWithWraparound(gMenuCursor, -Direction, 0, gMenuListCount - 1);
gFlagRefreshSetting = true;
@@ -1635,11 +1625,9 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
return;
}
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET)
{
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET) {
int32_t Offset = (Direction * gTxVfo->StepFrequency) + gSubMenuSelection;
if (Offset < 99999990)
{
if (Offset < 99999990) {
if (Offset < 0)
Offset = 99999990;
}
@@ -1683,18 +1671,8 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
switch (Key)
{
case KEY_0:
case KEY_1:
case KEY_2:
case KEY_3:
case KEY_4:
case KEY_5:
case KEY_6:
case KEY_7:
case KEY_8:
case KEY_9:
switch (Key) {
case KEY_0...KEY_9:
MENU_Key_0_to_9(Key, bKeyPressed, bKeyHeld);
break;
case KEY_MENU:

View File

@@ -475,7 +475,7 @@ static void UpdateRssiTriggerLevel(bool inc) {
static void UpdateDBMax(bool inc) {
if (inc && settings.dbMax < 10) {
settings.dbMax += 1;
} else if (!inc && settings.dbMax > settings.dbMin) {
} else if (!inc && settings.dbMax > 12+settings.dbMin) {
settings.dbMax -= 1;
} else {
return;

View File

@@ -1395,18 +1395,16 @@ void BK4819_GenTail(uint8_t Tail)
}
}
void BK4819_EnableCDCSS(void)
void BK4819_PlayCDCSSTail(void)
{
BK4819_GenTail(0); // CTC134
BK4819_WriteRegister(BK4819_REG_51, 0x804A);
BK4819_WriteRegister(BK4819_REG_51, 0x804A); // 1 0 0 0 0 0 0 0 0 1001010
}
void BK4819_EnableCTCSS(void)
void BK4819_PlayCTCSSTail(void)
{
#ifdef ENABLE_CTCSS_TAIL_PHASE_SHIFT
//BK4819_GenTail(1); // 120° phase shift
BK4819_GenTail(2); // 180° phase shift
//BK4819_GenTail(3); // 240° phase shift
#else
BK4819_GenTail(4); // 55Hz tone freq
#endif
@@ -1448,7 +1446,7 @@ void BK4819_EnableCTCSS(void)
// 0 = min
// 127 = max
BK4819_WriteRegister(BK4819_REG_51, 0x904A); // 1 0 0 1 0 0 0 0 0 1001010
BK4819_WriteRegister(BK4819_REG_51, 0x904A); // 1 0 0 1 0 0 0 0 0 1001010
}
uint16_t BK4819_GetRSSI(void)

View File

@@ -132,8 +132,8 @@ void BK4819_PlayDTMFString(const char *pString, bool bDelayFirst, uint16_t F
void BK4819_TransmitTone(bool bLocalLoopback, uint32_t Frequency);
void BK4819_GenTail(uint8_t Tail);
void BK4819_EnableCDCSS(void);
void BK4819_EnableCTCSS(void);
void BK4819_PlayCDCSSTail(void);
void BK4819_PlayCTCSSTail(void);
uint16_t BK4819_GetRSSI(void);
int8_t BK4819_GetRxGain_dB(void);

View File

@@ -57,8 +57,8 @@ void FUNCTION_Init(void)
g_SquelchLost = false;
gFlagTailNoteEliminationComplete = false;
gTailNoteEliminationCountdown_10ms = 0;
gFlagTailToneEliminationComplete = false;
gTailToneEliminationCountdown_10ms = 0;
gFoundCTCSS = false;
gFoundCDCSS = false;
gFoundCTCSSCountdown_10ms = 0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

4
misc.c
View File

@@ -132,7 +132,7 @@ volatile bool gNextTimeslice_500ms;
volatile uint16_t gTxTimerCountdown_500ms;
volatile bool gTxTimeoutReached;
volatile uint16_t gTailNoteEliminationCountdown_10ms;
volatile uint16_t gTailToneEliminationCountdown_10ms;
volatile uint8_t gVFOStateResumeCountdown_500ms;
@@ -237,7 +237,7 @@ volatile bool gNextTimeslice40ms;
volatile uint16_t gNOAACountdown_10ms = 0;
volatile bool gScheduleNOAA = true;
#endif
volatile bool gFlagTailNoteEliminationComplete;
volatile bool gFlagTailToneEliminationComplete;
#ifdef ENABLE_FMRADIO
volatile bool gScheduleFM;
#endif

4
misc.h
View File

@@ -205,7 +205,7 @@ extern volatile bool gNextTimeslice_500ms;
extern volatile uint16_t gTxTimerCountdown_500ms;
extern volatile bool gTxTimeoutReached;
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
extern volatile uint16_t gTailToneEliminationCountdown_10ms;
#ifdef ENABLE_NOAA
extern volatile uint16_t gNOAA_Countdown_10ms;
@@ -315,7 +315,7 @@ extern volatile bool gNextTimeslice40ms;
extern volatile uint16_t gNOAACountdown_10ms;
extern volatile bool gScheduleNOAA;
#endif
extern volatile bool gFlagTailNoteEliminationComplete;
extern volatile bool gFlagTailToneEliminationComplete;
extern volatile uint8_t gVFOStateResumeCountdown_500ms;
#ifdef ENABLE_FMRADIO
extern volatile bool gScheduleFM;

21
radio.c
View File

@@ -500,11 +500,6 @@ void RADIO_ApplyOffset(VFO_Info_t *pInfo)
break;
}
if (Frequency < frequencyBandTable[0].lower)
Frequency = frequencyBandTable[0].lower;
else if (Frequency > frequencyBandTable[BAND_N_ELEM - 1].upper)
Frequency = frequencyBandTable[BAND_N_ELEM - 1].upper;
pInfo->freq_config_TX.Frequency = Frequency;
}
@@ -988,9 +983,9 @@ void RADIO_PrepareTX(void)
gTxTimerCountdown_500ms = 0; // no timeout
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
if (gAlarmState == ALARM_STATE_OFF)
#endif
#endif
{
if (gEeprom.TX_TIMEOUT_TIMER == 0)
gTxTimerCountdown_500ms = 60; // 30 sec
@@ -1009,15 +1004,15 @@ void RADIO_PrepareTX(void)
#endif
}
void RADIO_EnableCxCSS(void)
void RADIO_SendCssTail(void)
{
switch (gCurrentVfo->pTX->CodeType) {
case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
BK4819_EnableCDCSS();
BK4819_PlayCDCSSTail();
break;
default:
BK4819_EnableCTCSS();
BK4819_PlayCTCSSTail();
break;
}
@@ -1030,7 +1025,8 @@ void RADIO_SendEndOfTransmission(void)
DTMF_SendEndOfTransmission();
// send the CTCSS/DCS tail tone - allows the receivers to mute the usual FM squelch tail/crash
RADIO_EnableCxCSS();
if(gEeprom.TAIL_TONE_ELIMINATION)
RADIO_SendCssTail();
RADIO_SetupRegisters(false);
}
@@ -1040,6 +1036,7 @@ void RADIO_PrepareCssTX(void)
SYSTEM_DelayMs(200);
RADIO_EnableCxCSS();
if(gEeprom.TAIL_TONE_ELIMINATION)
RADIO_SendCssTail();
RADIO_SetupRegisters(true);
}

View File

@@ -164,7 +164,7 @@ void RADIO_SetupAGC(bool listeningAM, bool disable);
void RADIO_SetModulation(ModulationMode_t modulation);
void RADIO_SetVfoState(VfoState_t State);
void RADIO_PrepareTX(void);
void RADIO_EnableCxCSS(void);
void RADIO_SendCssTail(void);
void RADIO_PrepareCssTX(void);
void RADIO_SendEndOfTransmission(void);

View File

@@ -92,7 +92,7 @@ void SystickHandler(void)
if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT)
DECREMENT_AND_TRIGGER(gScanPauseDelayIn_10ms, gScheduleScanListen);
DECREMENT_AND_TRIGGER(gTailNoteEliminationCountdown_10ms, gFlagTailNoteEliminationComplete);
DECREMENT_AND_TRIGGER(gTailToneEliminationCountdown_10ms, gFlagTailToneEliminationComplete);
#ifdef ENABLE_VOICE
DECREMENT_AND_TRIGGER(gCountdownToPlayNextVoice_10ms, gFlagPlayQueuedVoice);

View File

@@ -160,8 +160,8 @@ void SETTINGS_InitEEPROM(void)
#ifdef ENABLE_DTMF_CALLING
gEeprom.DTMF_SEPARATE_CODE = DTMF_ValidateCodes((char *)(Data + 1), 1) ? Data[1] : '*';
gEeprom.DTMF_GROUP_CALL_CODE = DTMF_ValidateCodes((char *)(Data + 2), 1) ? Data[2] : '#';
gEeprom.DTMF_DECODE_RESPONSE = (Data[3] < 4) ? Data[3] : 0;
gEeprom.DTMF_auto_reset_time = (Data[4] < 61) ? Data[4] : (Data[4] >= 5) ? Data[4] : 10;
gEeprom.DTMF_DECODE_RESPONSE = (Data[3] < 4) ? Data[3] : 0;
gEeprom.DTMF_auto_reset_time = (Data[4] < 61 && Data[4] >= 5) ? Data[4] : 10;
#endif
gEeprom.DTMF_PRELOAD_TIME = (Data[5] < 101) ? Data[5] * 10 : 300;
gEeprom.DTMF_FIRST_CODE_PERSIST_TIME = (Data[6] < 101) ? Data[6] * 10 : 100;
@@ -757,6 +757,9 @@ buf[1] = 0
#ifdef ENABLE_AM_FIX
| (1 << 4)
#endif
#ifdef ENABLE_SPECTRUM
| (1 << 5)
#endif
;
EEPROM_WriteBuffer(0x1FF0, buf);
}

View File

@@ -90,6 +90,7 @@ enum ACTION_OPT_t {
ACTION_OPT_VFO_MR,
ACTION_OPT_SWITCH_DEMODUL,
ACTION_OPT_BLMIN_TMP_OFF, //BackLight Minimum Temporay OFF
ACTION_OPT_SPECTRUM,
ACTION_OPT_LEN
};

View File

@@ -362,6 +362,9 @@ const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
#ifdef ENABLE_BLMIN_TMP_OFF
{"BLMIN\nTMP OFF", ACTION_OPT_BLMIN_TMP_OFF}, //BackLight Minimum Temporay OFF
#endif
#ifdef ENABLE_SPECTRUM
{"SPECTRUM", ACTION_OPT_SPECTRUM}
#endif
};
const uint8_t gSubMenu_SIDEFUNCTIONS_size = ARRAY_SIZE(gSubMenu_SIDEFUNCTIONS);