mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
Maybe fixed reboot when serial comms start
This commit is contained in:
parent
6a3a26c470
commit
b3ca095af1
5
Makefile
5
Makefile
@ -28,7 +28,7 @@ ENABLE_REVERSE_BAT_SYMBOL := 1
|
|||||||
ENABLE_CODE_SCAN_TIMEOUT := 0
|
ENABLE_CODE_SCAN_TIMEOUT := 0
|
||||||
ENABLE_AM_FIX := 1
|
ENABLE_AM_FIX := 1
|
||||||
ENABLE_AM_FIX_SHOW_DATA := 1
|
ENABLE_AM_FIX_SHOW_DATA := 1
|
||||||
ENABLE_SQUELCH_LOWER := 0
|
ENABLE_SQUELCH_LOWER := 1
|
||||||
ENABLE_RSSI_BAR := 1
|
ENABLE_RSSI_BAR := 1
|
||||||
ENABLE_AUDIO_BAR := 1
|
ENABLE_AUDIO_BAR := 1
|
||||||
#ENABLE_COPY_CHAN_TO_VFO := 1
|
#ENABLE_COPY_CHAN_TO_VFO := 1
|
||||||
@ -40,6 +40,7 @@ ENABLE_AUDIO_BAR := 1
|
|||||||
TARGET = firmware
|
TARGET = firmware
|
||||||
|
|
||||||
ifeq ($(ENABLE_LTO), 1)
|
ifeq ($(ENABLE_LTO), 1)
|
||||||
|
# can't have LTO and OVERLAY enabled at same time
|
||||||
ENABLE_OVERLAY := 0
|
ENABLE_OVERLAY := 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -101,7 +102,9 @@ OBJS += app/scanner.o
|
|||||||
ifeq ($(ENABLE_UART),1)
|
ifeq ($(ENABLE_UART),1)
|
||||||
OBJS += app/uart.o
|
OBJS += app/uart.o
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ENABLE_AM_FIX), 1)
|
||||||
OBJS += am_fix.o
|
OBJS += am_fix.o
|
||||||
|
endif
|
||||||
OBJS += audio.o
|
OBJS += audio.o
|
||||||
OBJS += bitmaps.o
|
OBJS += bitmaps.o
|
||||||
OBJS += board.o
|
OBJS += board.o
|
||||||
|
6
am_fix.c
6
am_fix.c
@ -30,12 +30,6 @@
|
|||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "misc.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
|
#ifdef ENABLE_AM_FIX
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
23
app/app.c
23
app/app.c
@ -62,6 +62,12 @@
|
|||||||
#include "ui/status.h"
|
#include "ui/status.h"
|
||||||
#include "ui/ui.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 APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||||
|
|
||||||
static void updateRSSI(const int vfo)
|
static void updateRSSI(const int vfo)
|
||||||
@ -538,10 +544,10 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
|
|||||||
// ******************************************
|
// ******************************************
|
||||||
|
|
||||||
// original setting
|
// original setting
|
||||||
uint8_t lna_short = orig_lna_short;
|
uint16_t lna_short = orig_lna_short;
|
||||||
uint8_t lna = orig_lna;
|
uint16_t lna = orig_lna;
|
||||||
uint8_t mixer = orig_mixer;
|
uint16_t mixer = orig_mixer;
|
||||||
uint8_t pga = orig_pga;
|
uint16_t pga = orig_pga;
|
||||||
|
|
||||||
if (gRxVfo->AM_mode)
|
if (gRxVfo->AM_mode)
|
||||||
{ // AM
|
{ // AM
|
||||||
@ -577,7 +583,7 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// apply the front end gain settings
|
// 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)
|
if (gSerialConfigCountDown_500ms > 0)
|
||||||
{
|
{
|
||||||
gReducedService = true; // a serial config upload/download is in progress
|
// gReducedService = true; // a serial config upload/download is in progress
|
||||||
|
|
||||||
// if (gCurrentFunction == FUNCTION_TRANSMIT)
|
|
||||||
// { // stop transmitting
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skipped authentic device check
|
// Skipped authentic device check
|
||||||
|
@ -23,6 +23,11 @@
|
|||||||
#include "frequencies.h"
|
#include "frequencies.h"
|
||||||
#include "radio.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 APP_EndTransmission(void);
|
||||||
void CHANNEL_Next(bool bFlag, int8_t Direction);
|
void CHANNEL_Next(bool bFlag, int8_t Direction);
|
||||||
void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix);
|
void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix);
|
||||||
|
12
app/uart.c
12
app/uart.c
@ -230,8 +230,7 @@ static void CMD_0514(const uint8_t *pBuffer)
|
|||||||
gFmRadioCountdown_500ms = fm_radio_countdown_500ms;
|
gFmRadioCountdown_500ms = fm_radio_countdown_500ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gSerialConfigCountDown_500ms = 6; // 3 sec
|
gSerialConfigCountDown_500ms = 12; // 6 sec
|
||||||
gSerialConfigCountDown_done = false;
|
|
||||||
|
|
||||||
// turn the LCD backlight off
|
// turn the LCD backlight off
|
||||||
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
|
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
|
||||||
@ -248,8 +247,7 @@ static void CMD_051B(const uint8_t *pBuffer)
|
|||||||
if (pCmd->Timestamp != Timestamp)
|
if (pCmd->Timestamp != Timestamp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gSerialConfigCountDown_500ms = 6; // 3 sec
|
gSerialConfigCountDown_500ms = 12; // 6 sec
|
||||||
gSerialConfigCountDown_done = false;
|
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
gFmRadioCountdown_500ms = fm_radio_countdown_500ms;
|
gFmRadioCountdown_500ms = fm_radio_countdown_500ms;
|
||||||
@ -280,8 +278,7 @@ static void CMD_051D(const uint8_t *pBuffer)
|
|||||||
if (pCmd->Timestamp != Timestamp)
|
if (pCmd->Timestamp != Timestamp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gSerialConfigCountDown_500ms = 6; // 3 sec
|
gSerialConfigCountDown_500ms = 12; // 6 sec
|
||||||
gSerialConfigCountDown_done = false;
|
|
||||||
|
|
||||||
bReloadEeprom = false;
|
bReloadEeprom = false;
|
||||||
|
|
||||||
@ -404,8 +401,7 @@ static void CMD_052F(const uint8_t *pBuffer)
|
|||||||
if (gCurrentFunction == FUNCTION_POWER_SAVE)
|
if (gCurrentFunction == FUNCTION_POWER_SAVE)
|
||||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||||
|
|
||||||
gSerialConfigCountDown_500ms = 6; // 3 sec
|
gSerialConfigCountDown_500ms = 12; // 6 sec
|
||||||
gSerialConfigCountDown_done = false;
|
|
||||||
|
|
||||||
Timestamp = pCmd->Timestamp;
|
Timestamp = pCmd->Timestamp;
|
||||||
|
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
1
misc.c
1
misc.c
@ -126,7 +126,6 @@ volatile bool gDualWatchCountdownExpired = true;
|
|||||||
bool gDualWatchActive = false;
|
bool gDualWatchActive = false;
|
||||||
|
|
||||||
volatile uint8_t gSerialConfigCountDown_500ms;
|
volatile uint8_t gSerialConfigCountDown_500ms;
|
||||||
volatile bool gSerialConfigCountDown_done;
|
|
||||||
|
|
||||||
volatile bool gNextTimeslice_500ms;
|
volatile bool gNextTimeslice_500ms;
|
||||||
|
|
||||||
|
1
misc.h
1
misc.h
@ -196,7 +196,6 @@ extern volatile bool gDualWatchCountdownExpired;
|
|||||||
extern bool gDualWatchActive;
|
extern bool gDualWatchActive;
|
||||||
|
|
||||||
extern volatile uint8_t gSerialConfigCountDown_500ms;
|
extern volatile uint8_t gSerialConfigCountDown_500ms;
|
||||||
extern volatile bool gSerialConfigCountDown_done;
|
|
||||||
|
|
||||||
extern volatile bool gNextTimeslice_500ms;
|
extern volatile bool gNextTimeslice_500ms;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ void SystickHandler(void)
|
|||||||
gNextTimeslice_500ms = true;
|
gNextTimeslice_500ms = true;
|
||||||
|
|
||||||
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
||||||
DECREMENT_AND_TRIGGER(gSerialConfigCountDown_500ms, gSerialConfigCountDown_done);
|
DECREMENT(gSerialConfigCountDown_500ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gGlobalSysTickCounter & 3) == 0)
|
if ((gGlobalSysTickCounter & 3) == 0)
|
||||||
|
@ -574,6 +574,7 @@ void UI_DisplayMenu(void)
|
|||||||
#ifdef ENABLE_AM_FIX_TEST1
|
#ifdef ENABLE_AM_FIX_TEST1
|
||||||
case MENU_AM_FIX_TEST1:
|
case MENU_AM_FIX_TEST1:
|
||||||
strcpy(String, gSubMenu_AM_fix_test1[gSubMenuSelection]);
|
strcpy(String, gSubMenu_AM_fix_test1[gSubMenuSelection]);
|
||||||
|
// gSetting_AM_fix = gSubMenuSelection;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user