diff --git a/app/app.c b/app/app.c index c890f4d..1a29898 100644 --- a/app/app.c +++ b/app/app.c @@ -2305,7 +2305,8 @@ Skip: { SETTINGS_SaveChannel(gTxVfo->CHANNEL_SAVE, gEeprom.TX_CHANNEL, gTxVfo, gRequestSaveChannel); if (gScreenToDisplay != DISPLAY_SCANNER) - gVfoConfigureMode = VFO_CONFIGURE_1; + if (gVfoConfigureMode == VFO_CONFIGURE_0) + gVfoConfigureMode = VFO_CONFIGURE_1; } else { @@ -2317,7 +2318,6 @@ Skip: gRequestSaveChannel = 0; } - if (gVfoConfigureMode != VFO_CONFIGURE_0) { if (gFlagResetVfos) diff --git a/app/dtmf.c b/app/dtmf.c index 8c9a9c1..7973787 100644 --- a/app/dtmf.c +++ b/app/dtmf.c @@ -140,17 +140,16 @@ bool DTMF_CompareMessage(const char *pMsg, const char *pTemplate, uint8_t Size, } } - return true; + return DTMF_CALL_MODE_NOT_GROUP; } -bool DTMF_CheckGroupCall(const char *pMsg, uint32_t Size) +DTMF_CallMode_t DTMF_CheckGroupCall(const char *pMsg, uint32_t Size) { uint32_t i; for (i = 0; i < Size; i++) if (pMsg[i] == gEeprom.DTMF_GROUP_CALL_CODE) break; - - return (i != Size) ? true : false; + return (i != Size) ? DTMF_CALL_MODE_GROUP : DTMF_CALL_MODE_NOT_GROUP; } void DTMF_Append(char Code) diff --git a/app/dtmf.h b/app/dtmf.h index 1ffd8b3..5b7549a 100644 --- a/app/dtmf.h +++ b/app/dtmf.h @@ -88,7 +88,7 @@ bool DTMF_GetContact(const int Index, char *pContact); bool DTMF_FindContact(const char *pContact, char *pResult); char DTMF_GetCharacter(const uint8_t code); bool DTMF_CompareMessage(const char *pDTMF, const char *pTemplate, uint8_t Size, bool bFlag); -bool DTMF_CheckGroupCall(const char *pDTMF, uint32_t Size); +DTMF_CallMode_t DTMF_CheckGroupCall(const char *pDTMF, uint32_t Size); void DTMF_Append(char Code); void DTMF_HandleRequest(void); void DTMF_Reply(void); diff --git a/app/main.c b/app/main.c index 2b2aa6b..6151060 100644 --- a/app/main.c +++ b/app/main.c @@ -47,15 +47,9 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) #else - - - // TODO: do something useful with the key - - - #endif break; @@ -379,7 +373,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) RADIO_ConfigureChannel(Vfo, 2); } -// Frequency += 75; // is this meant to be rounding to step size? +// Frequency += 75; // is this meant to be rounding ? Frequency += gTxVfo->StepFrequency / 2; // no idea, but this is Frequency = FREQUENCY_FloorToStep(Frequency, gTxVfo->StepFrequency, LowerLimitFrequencyBandTable[gTxVfo->Band]); diff --git a/app/menu.c b/app/menu.c index 5ad4d32..f8e9dee 100644 --- a/app/menu.c +++ b/app/menu.c @@ -418,12 +418,14 @@ void MENU_AcceptSetting(void) case MENU_MEM_CH: gTxVfo->CHANNEL_SAVE = gSubMenuSelection; - gRequestSaveChannel = 2; #if 0 gEeprom.MrChannel[0] = gSubMenuSelection; #else gEeprom.MrChannel[gEeprom.TX_CHANNEL] = gSubMenuSelection; #endif + gRequestSaveChannel = 2; + gVfoConfigureMode = VFO_CONFIGURE_RELOAD; + gFlagResetVfos = true; return; case MENU_MEM_NAME: diff --git a/app/scanner.c b/app/scanner.c index f57bcab..bd27698 100644 --- a/app/scanner.c +++ b/app/scanner.c @@ -40,7 +40,7 @@ volatile uint16_t ScanPauseDelayIn_10ms; uint8_t gScanProgressIndicator; uint8_t gScanHitCount; bool gScanUseCssResult; -uint8_t gScanState; +int8_t gScanState; bool bScanKeepFrequency; static void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) diff --git a/app/scanner.h b/app/scanner.h index 4caa9b3..9a6b17d 100644 --- a/app/scanner.h +++ b/app/scanner.h @@ -50,7 +50,7 @@ extern volatile uint16_t ScanPauseDelayIn_10ms; extern uint8_t gScanProgressIndicator; extern uint8_t gScanHitCount; extern bool gScanUseCssResult; -extern uint8_t gScanState; +extern int8_t gScanState; extern bool bScanKeepFrequency; void SCANNER_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld); diff --git a/audio.c b/audio.c index bd85c0d..79006a4 100644 --- a/audio.c +++ b/audio.c @@ -301,7 +301,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) void AUDIO_SetVoiceID(uint8_t Index, VOICE_ID_t VoiceID) { - if (Index >= 8) + if (Index >= ARRAY_SIZE(gVoiceID)) return; if (Index == 0) diff --git a/firmware.bin b/firmware.bin index cfccc01..cf8dd2c 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index aa30ec3..4f0834a 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/radio.c b/radio.c index 0b7c41a..4155240 100644 --- a/radio.c +++ b/radio.c @@ -246,7 +246,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg) else Base = 0x0C80 + ((Channel - FREQ_CHANNEL_FIRST) * 32) + (VFO * 16); - if (Arg == 2 || Channel >= FREQ_CHANNEL_FIRST) + if (Arg == VFO_CONFIGURE_RELOAD || Channel >= FREQ_CHANNEL_FIRST) { uint8_t Tmp; uint8_t Data[8]; diff --git a/ui/main.c b/ui/main.c index ed3b1c1..b8ddb13 100644 --- a/ui/main.c +++ b/ui/main.c @@ -107,8 +107,15 @@ void UI_DisplayMain(void) { - char String[16]; - unsigned int vfo_num; + char String[16]; + unsigned int vfo_num; + bool center_line_is_free = true; + +// #ifdef SINGLE_VFO_CHAN +// const bool single_vfo = (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? true : false; +// #else + const bool single_vfo = false; +// #endif memset(gFrameBuffer, 0, sizeof(gFrameBuffer)); @@ -120,14 +127,6 @@ void UI_DisplayMain(void) return; } -// #ifdef SINGLE_VFO_CHAN -// const bool single_vfo = (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? true : false; -// #else - const bool single_vfo = false; -// #endif - - bool center_line_is_free = true; - for (vfo_num = 0; vfo_num < 2; vfo_num++) { uint8_t Channel = gEeprom.TX_CHANNEL;