0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-05-19 08:21:18 +03:00

Fixed menu step bug - never worked !

This commit is contained in:
OneOfEleven 2023-09-28 13:26:27 +01:00
parent 86525941bc
commit 1f1a10b6b8
5 changed files with 46 additions and 37 deletions

View File

@ -611,11 +611,11 @@ static void FREQ_NextChannel(void)
static void MR_NextChannel(void) static void MR_NextChannel(void)
{ {
uint8_t Ch; const uint8_t PreviousCh = gNextMrChannel;
uint8_t Ch1 = gEeprom.SCANLIST_PRIORITY_CH1[gEeprom.SCAN_LIST_DEFAULT]; const uint8_t Ch1 = gEeprom.SCANLIST_PRIORITY_CH1[gEeprom.SCAN_LIST_DEFAULT];
uint8_t Ch2 = gEeprom.SCANLIST_PRIORITY_CH2[gEeprom.SCAN_LIST_DEFAULT]; const uint8_t Ch2 = gEeprom.SCANLIST_PRIORITY_CH2[gEeprom.SCAN_LIST_DEFAULT];
uint8_t PreviousCh = gNextMrChannel; const bool bEnabled = gEeprom.SCAN_LIST_ENABLED[gEeprom.SCAN_LIST_DEFAULT];
bool bEnabled = gEeprom.SCAN_LIST_ENABLED[gEeprom.SCAN_LIST_DEFAULT]; uint8_t Ch;
if (bEnabled) if (bEnabled)
{ {
@ -623,7 +623,10 @@ static void MR_NextChannel(void)
{ {
gPreviousMrChannel = gNextMrChannel; gPreviousMrChannel = gNextMrChannel;
if (RADIO_CheckValidChannel(Ch1, false, 0)) if (RADIO_CheckValidChannel(Ch1, false, 0))
gNextMrChannel = Ch1; {
gNextMrChannel = Ch1;
// goto Skip;
}
else else
gCurrentScanList = 1; gCurrentScanList = 1;
} }
@ -631,7 +634,10 @@ static void MR_NextChannel(void)
if (gCurrentScanList == 1) if (gCurrentScanList == 1)
{ {
if (RADIO_CheckValidChannel(Ch2, false, 0)) if (RADIO_CheckValidChannel(Ch2, false, 0))
gNextMrChannel = Ch2; {
gNextMrChannel = Ch2;
// goto Skip;
}
else else
gCurrentScanList = 2; gCurrentScanList = 2;
} }

View File

@ -323,7 +323,7 @@ void MENU_AcceptSetting(void)
gRequestSaveChannel = 1; gRequestSaveChannel = 1;
return; return;
} }
gSubMenuSelection = gTxVfo->STEP_SETTING; gTxVfo->STEP_SETTING = gSubMenuSelection;
return; return;
case MENU_TXP: case MENU_TXP:

Binary file not shown.

Binary file not shown.

View File

@ -199,26 +199,25 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO,
if (Mode >= 2 || !IS_MR_CHANNEL(Channel)) if (Mode >= 2 || !IS_MR_CHANNEL(Channel))
{ // copy VFO to a channel { // copy VFO to a channel
uint32_t State32[2]; uint8_t State[8];
uint8_t State8[8];
State32[0] = pVFO->freq_config_RX.Frequency; ((uint32_t *)State)[0] = pVFO->freq_config_RX.Frequency;
State32[1] = pVFO->TX_OFFSET_FREQUENCY; ((uint32_t *)State)[1] = pVFO->TX_OFFSET_FREQUENCY;
EEPROM_WriteBuffer(OffsetVFO + 0, State32); EEPROM_WriteBuffer(OffsetVFO + 0, State);
State8[0] = pVFO->freq_config_RX.Code; State[0] = pVFO->freq_config_RX.Code;
State8[1] = pVFO->freq_config_TX.Code; State[1] = pVFO->freq_config_TX.Code;
State8[2] = (pVFO->freq_config_TX.CodeType << 4) | pVFO->freq_config_RX.CodeType; State[2] = (pVFO->freq_config_TX.CodeType << 4) | pVFO->freq_config_RX.CodeType;
State8[3] = (pVFO->AM_CHANNEL_MODE << 4) | pVFO->TX_OFFSET_FREQUENCY_DIRECTION; State[3] = (pVFO->AM_CHANNEL_MODE << 4) | pVFO->TX_OFFSET_FREQUENCY_DIRECTION;
State8[4] = 0 State[4] = 0
| (pVFO->BUSY_CHANNEL_LOCK << 4) | (pVFO->BUSY_CHANNEL_LOCK << 4)
| (pVFO->OUTPUT_POWER << 2) | (pVFO->OUTPUT_POWER << 2)
| (pVFO->CHANNEL_BANDWIDTH << 1) | (pVFO->CHANNEL_BANDWIDTH << 1)
| (pVFO->FrequencyReverse << 0); | (pVFO->FrequencyReverse << 0);
State8[5] = (pVFO->DTMF_PTT_ID_TX_MODE << 1) | pVFO->DTMF_DECODING_ENABLE; State[5] = (pVFO->DTMF_PTT_ID_TX_MODE << 1) | (pVFO->DTMF_DECODING_ENABLE < 0);
State8[6] = pVFO->STEP_SETTING; State[6] = pVFO->STEP_SETTING;
State8[7] = pVFO->SCRAMBLING_TYPE; State[7] = pVFO->SCRAMBLING_TYPE;
EEPROM_WriteBuffer(OffsetVFO + 8, State8); EEPROM_WriteBuffer(OffsetVFO + 8, State);
SETTINGS_UpdateChannel(Channel, pVFO, true); SETTINGS_UpdateChannel(Channel, pVFO, true);
@ -226,17 +225,19 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO,
{ {
#ifndef KEEP_MEM_NAME #ifndef KEEP_MEM_NAME
// clear/reset the channel name // clear/reset the channel name
memset(&State8, 0xFF, sizeof(State8)); //memset(&State, 0xFF, sizeof(State));
EEPROM_WriteBuffer(0x0F50 + OffsetMR, State8); memset(&State, 0x00, sizeof(State)); // follow the QS way
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State8); EEPROM_WriteBuffer(0x0F50 + OffsetMR, State);
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State);
#else #else
if (Mode >= 3) if (Mode >= 3)
{ // save the channel name { // save the channel name
memmove(State8, pVFO->Name + 0, 8); memmove(State, pVFO->Name + 0, 8);
EEPROM_WriteBuffer(0x0F50 + OffsetMR, State8); EEPROM_WriteBuffer(0x0F50 + OffsetMR, State);
memset(State8, 0xFF, sizeof(State8)); //memset(State, 0xFF, sizeof(State));
memmove(State8, pVFO->Name + 8, 2); memset(State, 0x00, sizeof(State)); // follow the QS way
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State8); memmove(State, pVFO->Name + 8, 2);
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State);
} }
#endif #endif
} }
@ -282,7 +283,8 @@ void SETTINGS_UpdateChannel(uint8_t Channel, const VFO_Info_t *pVFO, bool keep)
const uint16_t OffsetMR = Channel * 16; const uint16_t OffsetMR = Channel * 16;
if (!keep) if (!keep)
{ // clear/reset the channel name { // clear/reset the channel name
memset(&State, 0xFF, sizeof(State)); //memset(&State, 0xFF, sizeof(State));
memset(&State, 0x00, sizeof(State)); // follow the QS way
EEPROM_WriteBuffer(0x0F50 + OffsetMR, State); EEPROM_WriteBuffer(0x0F50 + OffsetMR, State);
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State); EEPROM_WriteBuffer(0x0F58 + OffsetMR, State);
} }
@ -290,7 +292,8 @@ void SETTINGS_UpdateChannel(uint8_t Channel, const VFO_Info_t *pVFO, bool keep)
// { // update the channel name // { // update the channel name
// memmove(State, pVFO->Name + 0, 8); // memmove(State, pVFO->Name + 0, 8);
// EEPROM_WriteBuffer(0x0F50 + OffsetMR, State); // EEPROM_WriteBuffer(0x0F50 + OffsetMR, State);
// memset(State, 0xFF, sizeof(State)); // //memset(State, 0xFF, sizeof(State));
// memset(State, 0x00, sizeof(State)); // follow the QS way
// memmove(State, pVFO->Name + 8, 2); // memmove(State, pVFO->Name + 8, 2);
// EEPROM_WriteBuffer(0x0F58 + OffsetMR, State); // EEPROM_WriteBuffer(0x0F58 + OffsetMR, State);
// } // }