From 3792e8c9624ce8e3ff50b0410be900cacf0d04ca Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 10:04:48 -0700 Subject: [PATCH 01/12] just a bit of reformatting... --- settings.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/settings.c b/settings.c index 3f36029e7..2c4c1118e 100644 --- a/settings.c +++ b/settings.c @@ -618,12 +618,9 @@ void SETTINGS_SaveSettings(void) State[0] = gEeprom.SCAN_LIST_DEFAULT; //State[1] = gEeprom.SCAN_LIST_ENABLED[0]; - if (gEeprom.SCAN_LIST_ENABLED[0] == 1) - tmp = tmp | (1 << 0); - if (gEeprom.SCAN_LIST_ENABLED[1] == 1) - tmp = tmp | (1 << 1); - if (gEeprom.SCAN_LIST_ENABLED[2] == 1) - tmp = tmp | (1 << 2); + if (gEeprom.SCAN_LIST_ENABLED[0] == 1) tmp |= 1 << 0; + if (gEeprom.SCAN_LIST_ENABLED[1] == 1) tmp |= 1 << 1; + if (gEeprom.SCAN_LIST_ENABLED[2] == 1) tmp |= 1 << 2; State[2] = gEeprom.SCANLIST_PRIORITY_CH1[0]; State[3] = gEeprom.SCANLIST_PRIORITY_CH2[0]; State[4] = gEeprom.SCANLIST_PRIORITY_CH1[1]; @@ -665,16 +662,10 @@ void SETTINGS_SaveSettings(void) memset(State, 0xFF, sizeof(State)); tmp = 0; - - if(gSetting_set_inv == 1) - tmp = tmp | (1 << 0); - if (gSetting_set_lck == 1) - tmp = tmp | (1 << 1); - if (gSetting_set_met == 1) - tmp = tmp | (1 << 2); - if (gSetting_set_gui == 1) - tmp = tmp | (1 << 3); - + if (gSetting_set_inv) tmp |= 1 << 0; + if (gSetting_set_lck) tmp |= 1 << 1; + if (gSetting_set_met) tmp |= 1 << 2; + if (gSetting_set_gui) tmp |= 1 << 3; State[5] = ((tmp << 4) | (gSetting_set_ctr & 0x0F)); State[6] = ((gSetting_set_tot << 4) | (gSetting_set_eot & 0x0F)); State[7] = ((gSetting_set_low << 4) | (gSetting_set_ptt & 0x0F)); From 046a2b1f3d5a4643d401ede30630182606790057 Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 10:25:13 -0700 Subject: [PATCH 02/12] remove creation of dummy channels upon factory reset --- settings.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/settings.c b/settings.c index 2c4c1118e..d5fd1d51a 100644 --- a/settings.c +++ b/settings.c @@ -27,6 +27,7 @@ #include "settings.h" #include "ui/menu.h" +/* static const uint32_t gDefaultFrequencyTable[] = { 14500000, // @@ -35,6 +36,7 @@ static const uint32_t gDefaultFrequencyTable[] = 43320000, // 43350000 // }; +*/ EEPROM_Config_t gEeprom = { 0 }; @@ -441,6 +443,7 @@ void SETTINGS_FactoryReset(bool bIsAll) RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + BAND6_400MHz, 43350000); // set the first few memory channels + /* don't need this for (i = 0; i < ARRAY_SIZE(gDefaultFrequencyTable); i++) { const uint32_t Frequency = gDefaultFrequencyTable[i]; @@ -449,6 +452,7 @@ void SETTINGS_FactoryReset(bool bIsAll) gRxVfo->Band = FREQUENCY_GetBand(Frequency); SETTINGS_SaveChannel(MR_CHANNEL_FIRST + i, 0, gRxVfo, 2); } + */ } } From 8dd94f89987d41a19c77412cfd7efcc0e695f4fe Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 11:12:45 -0700 Subject: [PATCH 03/12] remove aes stuff if no ENABLE_PWRON_PASSWORD --- app/uart.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/app/uart.c b/app/uart.c index f7fce7f9c..b8417530b 100644 --- a/app/uart.c +++ b/app/uart.c @@ -26,7 +26,9 @@ #include "board.h" #include "bsp/dp32g030/dma.h" #include "bsp/dp32g030/gpio.h" -#include "driver/aes.h" +#ifdef ENABLE_PWRON_PASSWORD + #include "driver/aes.h" +#endif #include "driver/backlight.h" #include "driver/bk4819.h" #include "driver/crc.h" @@ -208,7 +210,7 @@ static void SendVersion(void) SendReply(&Reply, sizeof(Reply)); } - +#ifdef ENABLE_PWRON_PASSWORD static bool IsBadChallenge(const uint32_t *pKey, const uint32_t *pIn, const uint32_t *pResponse) { unsigned int i; @@ -227,7 +229,7 @@ static bool IsBadChallenge(const uint32_t *pKey, const uint32_t *pIn, const uint return false; } - +#endif // session init, sends back version info and state // timestamp is a session id really static void CMD_0514(const uint8_t *pBuffer) @@ -269,10 +271,10 @@ static void CMD_051B(const uint8_t *pBuffer) Reply.Header.Size = pCmd->Size + 4; Reply.Data.Offset = pCmd->Offset; Reply.Data.Size = pCmd->Size; - +#ifdef ENABLE_PWRON_PASSWORD if (bHasCustomAesKey) bLocked = gIsLocked; - +#endif if (!bLocked) EEPROM_ReadBuffer(pCmd->Offset, Reply.Data.Data, pCmd->Size); @@ -301,9 +303,9 @@ static void CMD_051D(const uint8_t *pBuffer) Reply.Header.ID = 0x051E; Reply.Header.Size = sizeof(Reply.Data); Reply.Data.Offset = pCmd->Offset; - +#ifdef ENABLE_PWRON_PASSWORD bIsLocked = bHasCustomAesKey ? gIsLocked : bHasCustomAesKey; - +#endif if (!bIsLocked) { unsigned int i; @@ -357,6 +359,7 @@ static void CMD_0529(void) static void CMD_052D(const uint8_t *pBuffer) { const CMD_052D_t *pCmd = (const CMD_052D_t *)pBuffer; + REPLY_052D_t Reply; bool bIsLocked; @@ -366,6 +369,7 @@ static void CMD_052D(const uint8_t *pBuffer) Reply.Header.ID = 0x052E; Reply.Header.Size = sizeof(Reply.Data); +#ifdef ENABLE_PWRON_PASSWORD bIsLocked = bHasCustomAesKey; if (!bIsLocked) @@ -388,7 +392,9 @@ static void CMD_052D(const uint8_t *pBuffer) gTryCount = 3; bIsLocked = true; } - +#else + bIsLocked = pCmd->Response[0]; +#endif gIsLocked = bIsLocked; Reply.Data.bIsLocked = bIsLocked; From 3f47b6304a876db98140493d822368b65c1e669e Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 12:19:48 -0700 Subject: [PATCH 04/12] scheduler.c: simplify, save bytes?!? --- scheduler.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scheduler.c b/scheduler.c index 47d07ecd4..3b04360c8 100644 --- a/scheduler.c +++ b/scheduler.c @@ -82,16 +82,16 @@ void SystickHandler(void) if (gCurrentFunction == FUNCTION_POWER_SAVE) DECREMENT_AND_TRIGGER(gPowerSave_10ms, gPowerSaveCountdownExpired); - if (gScanStateDir == SCAN_OFF && !gCssBackgroundScan && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) - if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_RECEIVE) + if (gScanStateDir == SCAN_OFF && !gCssBackgroundScan && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_RECEIVE){ + if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) DECREMENT_AND_TRIGGER(gDualWatchCountdown_10ms, gScheduleDualWatch); #ifdef ENABLE_NOAA - if (gScanStateDir == SCAN_OFF && !gCssBackgroundScan && gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) - if (gIsNoaaMode && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT) - if (gCurrentFunction != FUNCTION_RECEIVE) - DECREMENT_AND_TRIGGER(gNOAA_Countdown_10ms, gScheduleNOAA); + + if (gIsNoaaMode && gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) + DECREMENT_AND_TRIGGER(gNOAA_Countdown_10ms, gScheduleNOAA); #endif + } if (gScanStateDir != SCAN_OFF) if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT) From 1b83f486c305553f5016d29b6e65d6d6d610a0bc Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 12:49:18 -0700 Subject: [PATCH 05/12] remove vox disable stuff, more simplify in schedule.c --- app/app.c | 2 +- driver/bk4819.c | 4 ++-- driver/bk4819.h | 2 +- functions.c | 2 +- radio.c | 2 +- scheduler.c | 17 +++++++++-------- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/app.c b/app/app.c index 7a97d816d..6cd961667 100644 --- a/app/app.c +++ b/app/app.c @@ -1075,7 +1075,7 @@ void APP_Update(void) gRxIdleMode = true; goToSleep = false; - BK4819_DisableVox(); + //BK4819_DisableVox(); BK4819_Sleep(); BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, false); diff --git a/driver/bk4819.c b/driver/bk4819.c index d6390a15b..1f640748c 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -924,11 +924,11 @@ void BK4819_SetCompander(const unsigned int mode) BK4819_WriteRegister(BK4819_REG_31, r31 | (1u << 3)); } -void BK4819_DisableVox(void) +/* void BK4819_DisableVox(void) { const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31); BK4819_WriteRegister(BK4819_REG_31, Value & 0xFFFB); -} +} */ void BK4819_DisableDTMF(void) { diff --git a/driver/bk4819.h b/driver/bk4819.h index 1a6d06efd..64af90a7b 100644 --- a/driver/bk4819.h +++ b/driver/bk4819.h @@ -101,7 +101,7 @@ void BK4819_EnableScramble(uint8_t Type); bool BK4819_CompanderEnabled(void); void BK4819_SetCompander(const unsigned int mode); -void BK4819_DisableVox(void); +//void BK4819_DisableVox(void); void BK4819_DisableDTMF(void); void BK4819_EnableDTMF(void); void BK4819_PlayTone(uint16_t Frequency, bool bTuningGainSwitch); diff --git a/functions.c b/functions.c index 3a98566b6..8514528c6 100644 --- a/functions.c +++ b/functions.c @@ -125,7 +125,7 @@ void FUNCTION_PowerSave() { gMonitor = false; - BK4819_DisableVox(); +// BK4819_DisableVox(); BK4819_Sleep(); BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, false); diff --git a/radio.c b/radio.c index bd15ebb65..1ef8d9266 100644 --- a/radio.c +++ b/radio.c @@ -843,7 +843,7 @@ void RADIO_SetupRegisters(bool switchToForeground) else #endif { - BK4819_DisableVox(); + //BK4819_DisableVox(); } // RX expander diff --git a/scheduler.c b/scheduler.c index 3b04360c8..4dbbd993f 100644 --- a/scheduler.c +++ b/scheduler.c @@ -82,20 +82,21 @@ void SystickHandler(void) if (gCurrentFunction == FUNCTION_POWER_SAVE) DECREMENT_AND_TRIGGER(gPowerSave_10ms, gPowerSaveCountdownExpired); - if (gScanStateDir == SCAN_OFF && !gCssBackgroundScan && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_RECEIVE){ - if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) - DECREMENT_AND_TRIGGER(gDualWatchCountdown_10ms, gScheduleDualWatch); + if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT){ + if (gScanStateDir == SCAN_OFF && !gCssBackgroundScan && gCurrentFunction != FUNCTION_RECEIVE){ + if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + DECREMENT_AND_TRIGGER(gDualWatchCountdown_10ms, gScheduleDualWatch); #ifdef ENABLE_NOAA - if (gIsNoaaMode && gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) - DECREMENT_AND_TRIGGER(gNOAA_Countdown_10ms, gScheduleNOAA); + if (gIsNoaaMode && gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) + DECREMENT_AND_TRIGGER(gNOAA_Countdown_10ms, gScheduleNOAA); #endif - } + } - if (gScanStateDir != SCAN_OFF) - if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT) + if (gScanStateDir != SCAN_OFF) DECREMENT_AND_TRIGGER(gScanPauseDelayIn_10ms, gScheduleScanListen); + } DECREMENT_AND_TRIGGER(gTailNoteEliminationCountdown_10ms, gFlagTailNoteEliminationComplete); From 40242b60b7a8d3fa8aa32d2f783da4f8b98baf69 Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 14:41:07 -0700 Subject: [PATCH 06/12] ui/main.c: use __builtin_popcount(), save bytes --- ui/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/main.c b/ui/main.c index 6b6fee089..6449f162b 100644 --- a/ui/main.c +++ b/ui/main.c @@ -892,19 +892,20 @@ void UI_DisplayMain(void) if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num])) { // it's a channel - uint8_t countList = 0; //uint8_t shiftList = 0; // show the scan list assigment symbols const ChannelAttributes_t att = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]]; + uint8_t countList = __builtin_popcount(att.scanlists & 0b111); +/* if (att.scanlists & 0b001) countList++; if (att.scanlists & 0b010) countList++; if (att.scanlists & 0b100) countList++; - +*/ /* shiftList = countList; From da78405c7dc07b9e9c6f662e3fa9903d6f977b3e Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 15:13:25 -0700 Subject: [PATCH 07/12] 24 fm broadcast channels --- app/fm.c | 8 ++++---- app/fm.h | 2 +- settings.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/fm.c b/app/fm.c index 0d3db1d4b..5f0bc63a9 100644 --- a/app/fm.c +++ b/app/fm.c @@ -36,7 +36,7 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #endif -uint16_t gFM_Channels[20]; +uint16_t gFM_Channels[24]; bool gFmRadioMode; uint8_t gFmRadioCountdown_500ms; volatile uint16_t gFmPlayCountdown_10ms; @@ -297,7 +297,7 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state) return; } } - else if (Channel < 20) { + else if (Channel < ARRAY_SIZE(gFM_Channels)) { #ifdef ENABLE_VOICE gAnotherVoiceID = (VOICE_ID_t)Key; #endif @@ -569,10 +569,10 @@ void FM_Play(void) return; } - if (gFM_ChannelPosition < 20) + if (gFM_ChannelPosition < ARRAY_SIZE(gFM_Channels)) gFM_Channels[gFM_ChannelPosition++] = gEeprom.FM_FrequencyPlaying; - if (gFM_ChannelPosition >= 20) { + if (gFM_ChannelPosition >= ARRAY_SIZE(gFM_Channels)) { FM_PlayAndUpdate(); GUI_SelectNextDisplay(DISPLAY_FM); return; diff --git a/app/fm.h b/app/fm.h index 51bac66a6..daa0517db 100644 --- a/app/fm.h +++ b/app/fm.h @@ -28,7 +28,7 @@ enum { FM_SCAN_OFF = 0U, }; -extern uint16_t gFM_Channels[20]; +extern uint16_t gFM_Channels[24]; extern bool gFmRadioMode; extern uint8_t gFmRadioCountdown_500ms; extern volatile uint16_t gFmPlayCountdown_10ms; diff --git a/settings.c b/settings.c index d5fd1d51a..1b5f5d9a4 100644 --- a/settings.c +++ b/settings.c @@ -108,7 +108,7 @@ void SETTINGS_InitEEPROM(void) gEeprom.FM_IsMrMode = fmCfg.isMrMode; } - // 0E40..0E67 + // 0E40..0E67 -> 0E40..0E6F EEPROM_ReadBuffer(0x0E40, gFM_Channels, sizeof(gFM_Channels)); FM_ConfigureChannelState(); #endif From 1be21debc1690773931cb18e9917ef36e13237c4 Mon Sep 17 00:00:00 2001 From: prokrypt Date: Wed, 24 Jul 2024 16:49:33 -0700 Subject: [PATCH 08/12] Update Makefile: no need for aes if no pwron password --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index b68ee3c67..f05d823c0 100644 --- a/Makefile +++ b/Makefile @@ -89,9 +89,11 @@ OBJS += external/printf/printf.o # Drivers OBJS += driver/adc.o +ifeq ($(ENABLE_PWRON_PASSWORD),1) ifeq ($(ENABLE_UART),1) OBJS += driver/aes.o endif +endif OBJS += driver/backlight.o ifeq ($(ENABLE_FMRADIO),1) OBJS += driver/bk1080.o From 116d062f1fd1d6d478dc46e9b569cc0ce1049abd Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 20:58:35 -0700 Subject: [PATCH 09/12] global channel skip for scanning mostly stolen from https://github.com/armel/uv-k5-firmware-custom/commit/a271d847c38c9900e7c6b58bcfcf35cdb00979f9 --- app/main.c | 18 +++++++++--------- misc.c | 1 + misc.h | 1 + radio.c | 3 +++ ui/main.c | 49 ++++++++++++++----------------------------------- 5 files changed, 28 insertions(+), 44 deletions(-) diff --git a/app/main.c b/app/main.c index 97cc9a119..eb9150342 100644 --- a/app/main.c +++ b/app/main.c @@ -362,13 +362,9 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) if (gScanStateDir != SCAN_OFF){ switch(Key){ case KEY_1: - gEeprom.SCAN_LIST_DEFAULT=0; - break; case KEY_2: - gEeprom.SCAN_LIST_DEFAULT=1; - break; case KEY_3: - gEeprom.SCAN_LIST_DEFAULT=2; + gEeprom.SCAN_LIST_DEFAULT=Key-1; break; case KEY_0: gEeprom.SCAN_LIST_DEFAULT=3; @@ -579,6 +575,11 @@ static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld) gInputBoxIndex = 0; gRequestDisplayScreen = DISPLAY_MAIN; gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; + } else { + if (gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE]) { + gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] = false; + gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; + } } } } @@ -594,14 +595,13 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld) if (bKeyPressed) { // long press MENU key #ifdef ENABLE_FEAT_F4HWN - if(gScanStateDir != SCAN_OFF && gEeprom.SCAN_LIST_DEFAULT < 5) + if(gScanStateDir != SCAN_OFF) { if(FUNCTION_IsRx()) { - gTxVfo->SCANLIST_PARTICIPATION = 0; - - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, false); + gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] = true; + gVfoConfigureMode = VFO_CONFIGURE; gFlagResetVfos = true; diff --git a/misc.c b/misc.c index fd863758f..8cf8f068e 100644 --- a/misc.c +++ b/misc.c @@ -140,6 +140,7 @@ uint16_t gEEPROM_1F8A; uint16_t gEEPROM_1F8C; ChannelAttributes_t gMR_ChannelAttributes[FREQ_CHANNEL_LAST + 1]; +bool gMR_ChannelExclude[FREQ_CHANNEL_LAST + 1]; volatile uint16_t gBatterySaveCountdown_10ms = battery_save_count_10ms; diff --git a/misc.h b/misc.h index cd0b8cffc..7029abb81 100644 --- a/misc.h +++ b/misc.h @@ -203,6 +203,7 @@ typedef union { } ChannelAttributes_t; extern ChannelAttributes_t gMR_ChannelAttributes[207]; +extern bool gMR_ChannelExclude[207]; extern volatile uint16_t gBatterySaveCountdown_10ms; diff --git a/radio.c b/radio.c index 1ef8d9266..9ca82bb0e 100644 --- a/radio.c +++ b/radio.c @@ -64,6 +64,9 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL const ChannelAttributes_t att = gMR_ChannelAttributes[channel]; + if (checkScanList && gMR_ChannelExclude[channel] == true) + return false; + if (att.band > BAND7_470MHz) return false; diff --git a/ui/main.c b/ui/main.c index 6449f162b..aac9ae056 100644 --- a/ui/main.c +++ b/ui/main.c @@ -893,44 +893,23 @@ void UI_DisplayMain(void) { // it's a channel //uint8_t shiftList = 0; - + uint8_t countList = 0; + // show the scan list assigment symbols const ChannelAttributes_t att = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]]; - - uint8_t countList = __builtin_popcount(att.scanlists & 0b111); -/* - if (att.scanlists & 0b001) - countList++; - if (att.scanlists & 0b010) - countList++; - if (att.scanlists & 0b100) - countList++; -*/ -/* - shiftList = countList; - - if (att.scanlists & 0b100) - { - memcpy(p_line0 + 128 - ((shiftList>2?2:shiftList) * 8), BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); - shiftList--; + if (gMR_ChannelExclude[gEeprom.ScreenChannel[vfo_num]]){ + memcpy(p_line0 + 129 - (1 * 8), BITMAP_ScanList4, sizeof(BITMAP_ScanList4)); + memcpy(p_line0 + 129 - (2 * 8), BITMAP_ScanList4, sizeof(BITMAP_ScanList4)); + memcpy(p_line1 + 129 - (2 * 8), BITMAP_ScanList4, sizeof(BITMAP_ScanList4)); + } else { + countList = __builtin_popcount(att.scanlists & 0b111); + if (att.scanlists & 0b001) + memcpy(p_line0 + 129 - (2 * 8), BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); + if (att.scanlists & 0b010) + memcpy(p_line0 + 129 - (1 * 8), BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); + if (att.scanlists & 0b100) + memcpy(p_line1 + 129 - (2 * 8), BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); } - if (att.scanlists & 0b010) - { - memcpy(((shiftList%2==1)?p_line0:p_line1) + 128 - ((shiftList>2?2:shiftList) * 8), BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); - shiftList--; - } - if (att.scanlists & 0b001) - { - memcpy(((shiftList%2==1)?p_line0:p_line1) + 128 - ((shiftList>2?2:shiftList) * 8), BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); - } -*/ - if (att.scanlists & 0b001) - memcpy(p_line0 + 129 - (2 * 8), BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); - if (att.scanlists & 0b010) - memcpy(p_line0 + 129 - (1 * 8), BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); - if (att.scanlists & 0b100) - memcpy(p_line1 + 129 - (2 * 8), BITMAP_ScanList3, sizeof(BITMAP_ScanList3)); - if(countList == 0) { From 4a4ca91575d4fb83acf926b22fff4ded816e485d Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 21:11:33 -0700 Subject: [PATCH 10/12] dual watch during scan fix: didn't work for channel 1 --- app/chFrScanner.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/chFrScanner.c b/app/chFrScanner.c index 90034fa61..e4ca3314c 100644 --- a/app/chFrScanner.c +++ b/app/chFrScanner.c @@ -56,10 +56,9 @@ void CHFRSCANNER_Start(const bool storeBackupSettings, const int8_t scan_directi if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) { dwchan = (gEeprom.RX_VFO + 1) & 1u; - dwchan = gEeprom.ScreenChannel[dwchan]; + dwchan = gEeprom.ScreenChannel[dwchan]+1; if (!IS_MR_CHANNEL(dwchan)) dwchan = 0; - } if (IS_MR_CHANNEL(gNextMrChannel)) @@ -265,7 +264,7 @@ static void NextMemChannel(void) if (++dualscan%4==0) { dualscan=0; currentScanList = SCAN_NEXT_CHAN_DUAL_WATCH; - gNextMrChannel = dwchan; + gNextMrChannel = dwchan-1; break; } } From 3730c2207ea96454a06778aa5efa215efac33d69 Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 21:17:37 -0700 Subject: [PATCH 11/12] allow skipping dual watch channel --- app/chFrScanner.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/chFrScanner.c b/app/chFrScanner.c index e4ca3314c..f9885c09f 100644 --- a/app/chFrScanner.c +++ b/app/chFrScanner.c @@ -264,7 +264,8 @@ static void NextMemChannel(void) if (++dualscan%4==0) { dualscan=0; currentScanList = SCAN_NEXT_CHAN_DUAL_WATCH; - gNextMrChannel = dwchan-1; + if (!gMR_ChannelExclude[dwchan-1]) + gNextMrChannel = dwchan-1; break; } } From 429f650acfd89f1ce18d11b9980a493ae6bf7321 Mon Sep 17 00:00:00 2001 From: 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 Date: Wed, 24 Jul 2024 21:24:32 -0700 Subject: [PATCH 12/12] 1.0.3! --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f05d823c0..4f31d2bf7 100644 --- a/Makefile +++ b/Makefile @@ -215,7 +215,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1) VERSION_STRING_1 ?= v2.8.1 AUTHOR_STRING_2 ?= Voxless - VERSION_STRING_2 ?= v1.0.2 + VERSION_STRING_2 ?= v1.0.3 AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2) VERSION_STRING ?= $(VERSION_STRING_2)