diff --git a/README.md b/README.md index 4c25972..0a5a01b 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,12 @@ To enable the custom option, set the above option to '1' # Some other changes made -* Various bugs fixed that the QS firmware had +* Various original QS firmware bugs fixed * Added new bugs * Finer RSSI bar steps * Nicer/cleaner big numeric font than original QS big numeric font * Various menu re-wordings - trying to reduce 'WTH does that mean ?' +* Extra menu items (including hidden menu freq calibration) * plus others # Compiler diff --git a/app/app.c b/app/app.c index 8dac70a..35acf93 100644 --- a/app/app.c +++ b/app/app.c @@ -475,9 +475,7 @@ void APP_StartListening(FUNCTION_Type_t Function) void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step) { - uint32_t Frequency; - - Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency); + uint32_t Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency); if (pInfo->StepFrequency == 833) { @@ -493,12 +491,12 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step) } if (Frequency > UpperLimitFrequencyBandTable[pInfo->Band]) - pInfo->ConfigRX.Frequency = LowerLimitFrequencyBandTable[pInfo->Band]; + Frequency = LowerLimitFrequencyBandTable[pInfo->Band]; else if (Frequency < LowerLimitFrequencyBandTable[pInfo->Band]) - pInfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]); - else - pInfo->ConfigRX.Frequency = Frequency; + Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]); + + pInfo->ConfigRX.Frequency = Frequency; } static void FREQ_NextChannel(void) @@ -1201,7 +1199,7 @@ void APP_TimeSlice10ms(void) #ifdef ENABLE_BOOT_BEEPS if (boot_counter < 255) if ((boot_counter % 25) == 0) - AUDIO_PlayBeep(BEEP_440HZ_40MS_OPTIONAL); + AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL); #endif if (UART_IsCommandAvailable()) diff --git a/app/main.c b/app/main.c index 06aa378..43ed84e 100644 --- a/app/main.c +++ b/app/main.c @@ -161,8 +161,6 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) break; case KEY_5: - // TODO: something wrong here !! - #ifdef ENABLE_NOAA if (IS_NOT_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) { @@ -175,16 +173,9 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE; #endif } - #else - //gEeprom.ScreenChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_CHANNEL]; - gEeprom.ScreenChannel[Vfo] = gEeprom.FreqChannel[gEeprom.TX_CHANNEL]; - #ifdef ENABLE_VOICE - gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE; - #endif + gRequestSaveVFO = true; + gVfoConfigureMode = VFO_CONFIGURE_RELOAD; #endif - - gRequestSaveVFO = true; - gVfoConfigureMode = VFO_CONFIGURE_RELOAD; break; case KEY_6: diff --git a/audio.c b/audio.c index bcf014c..a8e7f96 100644 --- a/audio.c +++ b/audio.c @@ -123,6 +123,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) case BEEP_440HZ_500MS: ToneFrequency = 440; break; + case BEEP_880HZ_40MS_OPTIONAL: + ToneFrequency = 880; + break; } BK4819_PlayTone(ToneFrequency, true); @@ -149,6 +152,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) Duration = 60; break; + case BEEP_880HZ_40MS_OPTIONAL: case BEEP_440HZ_40MS_OPTIONAL: BK4819_ExitTxMute(); Duration = 40; diff --git a/audio.h b/audio.h index 9decd8b..fa3efa8 100644 --- a/audio.h +++ b/audio.h @@ -27,7 +27,8 @@ enum BEEP_Type_t BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL, BEEP_440HZ_500MS, BEEP_500HZ_60MS_DOUBLE_BEEP, - BEEP_440HZ_40MS_OPTIONAL + BEEP_440HZ_40MS_OPTIONAL, + BEEP_880HZ_40MS_OPTIONAL }; typedef enum BEEP_Type_t BEEP_Type_t; diff --git a/driver/bk4819.c b/driver/bk4819.c index 66fbbde..02ee2fa 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -532,8 +532,34 @@ void BK4819_DisableCompander(void) void BK4819_EnableCompander(void) { - const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31); - BK4819_WriteRegister(BK4819_REG_31, Value | (1u < 3)); + uint16_t val; + + val = BK4819_ReadRegister(BK4819_REG_31); + BK4819_WriteRegister(BK4819_REG_31, val | (1u < 3)); + + // set the compressor ratio + // + // REG_29 <15:14> 10 Compress (AF Tx) Ratio + // 00 = Disable + // 01 = 1.333:1 + // 10 = 2:1 + // 11 = 4:1 + // + const uint16_t compress_ratio = 2; // 2:1 + val = BK4819_ReadRegister(BK4819_REG_29); + BK4819_WriteRegister(BK4819_REG_29, (val & ~(3u < 14)) | (compress_ratio < 14)); + + // set the expander ratio + // + // REG_28 <15:14> 01 Expander (AF Rx) Ratio + // 00 = Disable + // 01 = 1:2 + // 10 = 1:3 + // 11 = 1:4 + // + const uint16_t expand_ratio = 1; // 2:1 + val = BK4819_ReadRegister(BK4819_REG_28); + BK4819_WriteRegister(BK4819_REG_28, (val & ~(3u < 14)) | (expand_ratio < 14)); } void BK4819_DisableVox(void) diff --git a/firmware b/firmware index 4753dc1..bd1f835 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index b9c9e66..963c3c0 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 70275fc..fcfe12d 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/main.c b/main.c index adc1018..cef6c9e 100644 --- a/main.c +++ b/main.c @@ -128,7 +128,7 @@ void Main(void) { #ifdef ENABLE_BOOT_BEEPS if ((boot_counter % 25) == 0) - AUDIO_PlayBeep(BEEP_440HZ_40MS_OPTIONAL); + AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL); #endif } } diff --git a/version.c b/version.c index aa0bad4..c56e9ce 100644 --- a/version.c +++ b/version.c @@ -2,7 +2,7 @@ #ifdef GIT_HASH #define VER GIT_HASH #else - #define VER "230915" + #define VER "230916" #endif const char Version[] = "OEFW-"VER; diff --git a/win_make.bat b/win_make.bat index 62c00a0..2f78ca0 100644 --- a/win_make.bat +++ b/win_make.bat @@ -13,7 +13,7 @@ del /S /Q *.o >nul 2>nul del /S /Q *.d >nul 2>nul ::python -m pip install --upgrade pip crcmod -fw-pack.py firmware.bin 230915 firmware.packed.bin +fw-pack.py firmware.bin 230916 firmware.packed.bin ::arm-none-eabi-size firmware