diff --git a/Makefile b/Makefile index 0806d90..386464b 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ENABLE_REVERSE_BAT_SYMBOL := 1 ENABLE_CODE_SCAN_TIMEOUT := 0 ENABLE_AM_FIX := 1 ENABLE_AM_FIX_SHOW_DATA := 1 -ENABLE_SQUELCH_LOWER := 0 +ENABLE_SQUELCH_LOWER := 1 ENABLE_RSSI_BAR := 1 ENABLE_AUDIO_BAR := 1 #ENABLE_COPY_CHAN_TO_VFO := 1 @@ -39,7 +39,8 @@ ENABLE_AUDIO_BAR := 1 TARGET = firmware -ifeq ($(ENABLE_LTO),1) +ifeq ($(ENABLE_LTO), 1) + # can't have LTO and OVERLAY enabled at same time ENABLE_OVERLAY := 0 endif @@ -101,7 +102,9 @@ OBJS += app/scanner.o ifeq ($(ENABLE_UART),1) OBJS += app/uart.o endif -OBJS += am_fix.o +ifeq ($(ENABLE_AM_FIX), 1) + OBJS += am_fix.o +endif OBJS += audio.o OBJS += bitmaps.o OBJS += board.o @@ -134,7 +137,7 @@ OBJS += ui/welcome.o OBJS += version.o OBJS += main.o -ifeq ($(OS),Windows_NT) +ifeq ($(OS), Windows_NT) TOP := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) else TOP := $(shell pwd) @@ -163,7 +166,7 @@ CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delet #CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=gnu99 -MMD #CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=gnu11 -MMD -ifeq ($(ENABLE_LTO),1) +ifeq ($(ENABLE_LTO), 1) # CFLAGS += -flto CFLAGS += -flto=2 endif diff --git a/am_fix.c b/am_fix.c index 54a4bce..61ddbea 100644 --- a/am_fix.c +++ b/am_fix.c @@ -30,12 +30,6 @@ #include "functions.h" #include "misc.h" -// original QS front end register settings -const uint8_t orig_lna_short = 3; // 0dB -const uint8_t orig_lna = 2; // -14dB -const uint8_t orig_mixer = 3; // 0dB -const uint8_t orig_pga = 6; // -3dB - #ifdef ENABLE_AM_FIX typedef struct diff --git a/app/app.c b/app/app.c index 2b2925d..90f1355 100644 --- a/app/app.c +++ b/app/app.c @@ -62,6 +62,12 @@ #include "ui/status.h" #include "ui/ui.h" +// original QS front end register settings +const uint8_t orig_lna_short = 3; // 0dB +const uint8_t orig_lna = 2; // -14dB +const uint8_t orig_mixer = 3; // 0dB +const uint8_t orig_pga = 6; // -3dB + static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld); static void updateRSSI(const int vfo) @@ -538,10 +544,10 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix) // ****************************************** // original setting - uint8_t lna_short = orig_lna_short; - uint8_t lna = orig_lna; - uint8_t mixer = orig_mixer; - uint8_t pga = orig_pga; + uint16_t lna_short = orig_lna_short; + uint16_t lna = orig_lna; + uint16_t mixer = orig_mixer; + uint16_t pga = orig_pga; if (gRxVfo->AM_mode) { // AM @@ -577,7 +583,7 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix) } // apply the front end gain settings - BK4819_WriteRegister(BK4819_REG_13, ((uint16_t)lna_short << 8) | ((uint16_t)lna << 5) | ((uint16_t)mixer << 3) | ((uint16_t)pga << 0)); + BK4819_WriteRegister(BK4819_REG_13, (lna_short << 8) | (lna << 5) | (mixer << 3) | (pga << 0)); // ****************************************** @@ -1728,12 +1734,7 @@ void APP_TimeSlice500ms(void) if (gSerialConfigCountDown_500ms > 0) { - gReducedService = true; // a serial config upload/download is in progress - -// if (gCurrentFunction == FUNCTION_TRANSMIT) -// { // stop transmitting -// -// } +// gReducedService = true; // a serial config upload/download is in progress } // Skipped authentic device check diff --git a/app/app.h b/app/app.h index f71765d..8d029b0 100644 --- a/app/app.h +++ b/app/app.h @@ -23,6 +23,11 @@ #include "frequencies.h" #include "radio.h" +extern const uint8_t orig_lna_short; +extern const uint8_t orig_lna; +extern const uint8_t orig_mixer; +extern const uint8_t orig_pga; + void APP_EndTransmission(void); void CHANNEL_Next(bool bFlag, int8_t Direction); void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix); diff --git a/app/uart.c b/app/uart.c index 21f7f1d..913b56f 100644 --- a/app/uart.c +++ b/app/uart.c @@ -230,8 +230,7 @@ static void CMD_0514(const uint8_t *pBuffer) gFmRadioCountdown_500ms = fm_radio_countdown_500ms; #endif - gSerialConfigCountDown_500ms = 6; // 3 sec - gSerialConfigCountDown_done = false; + gSerialConfigCountDown_500ms = 12; // 6 sec // turn the LCD backlight off GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); @@ -248,8 +247,7 @@ static void CMD_051B(const uint8_t *pBuffer) if (pCmd->Timestamp != Timestamp) return; - gSerialConfigCountDown_500ms = 6; // 3 sec - gSerialConfigCountDown_done = false; + gSerialConfigCountDown_500ms = 12; // 6 sec #ifdef ENABLE_FMRADIO gFmRadioCountdown_500ms = fm_radio_countdown_500ms; @@ -280,9 +278,8 @@ static void CMD_051D(const uint8_t *pBuffer) if (pCmd->Timestamp != Timestamp) return; - gSerialConfigCountDown_500ms = 6; // 3 sec - gSerialConfigCountDown_done = false; - + gSerialConfigCountDown_500ms = 12; // 6 sec + bReloadEeprom = false; #ifdef ENABLE_FMRADIO @@ -404,8 +401,7 @@ static void CMD_052F(const uint8_t *pBuffer) if (gCurrentFunction == FUNCTION_POWER_SAVE) FUNCTION_Select(FUNCTION_FOREGROUND); - gSerialConfigCountDown_500ms = 6; // 3 sec - gSerialConfigCountDown_done = false; + gSerialConfigCountDown_500ms = 12; // 6 sec Timestamp = pCmd->Timestamp; diff --git a/firmware.bin b/firmware.bin index 96c9974..087459c 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 3e97c4c..5b72d44 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/misc.c b/misc.c index ab3897b..2d8df9d 100644 --- a/misc.c +++ b/misc.c @@ -126,7 +126,6 @@ volatile bool gDualWatchCountdownExpired = true; bool gDualWatchActive = false; volatile uint8_t gSerialConfigCountDown_500ms; -volatile bool gSerialConfigCountDown_done; volatile bool gNextTimeslice_500ms; diff --git a/misc.h b/misc.h index 5d8bd8a..38c2288 100644 --- a/misc.h +++ b/misc.h @@ -196,7 +196,6 @@ extern volatile bool gDualWatchCountdownExpired; extern bool gDualWatchActive; extern volatile uint8_t gSerialConfigCountDown_500ms; -extern volatile bool gSerialConfigCountDown_done; extern volatile bool gNextTimeslice_500ms; diff --git a/scheduler.c b/scheduler.c index 2afecfa..21ae085 100644 --- a/scheduler.c +++ b/scheduler.c @@ -57,7 +57,7 @@ void SystickHandler(void) gNextTimeslice_500ms = true; DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached); - DECREMENT_AND_TRIGGER(gSerialConfigCountDown_500ms, gSerialConfigCountDown_done); + DECREMENT(gSerialConfigCountDown_500ms); } if ((gGlobalSysTickCounter & 3) == 0) diff --git a/ui/menu.c b/ui/menu.c index 618c4e3..4c5ecea 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -574,6 +574,7 @@ void UI_DisplayMenu(void) #ifdef ENABLE_AM_FIX_TEST1 case MENU_AM_FIX_TEST1: strcpy(String, gSubMenu_AM_fix_test1[gSubMenuSelection]); +// gSetting_AM_fix = gSubMenuSelection; break; #endif