Fix channel save problem

This commit is contained in:
OneOfEleven 2023-09-28 22:22:06 +01:00
parent 618d6962ff
commit f0ad919418
12 changed files with 23 additions and 29 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Binary file not shown.

View File

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

View File

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