mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 14:48:03 +03:00
Maybe fixed reboot when serial comms start
This commit is contained in:
23
app/app.c
23
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
|
||||
|
@ -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);
|
||||
|
14
app/uart.c
14
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;
|
||||
|
||||
|
Reference in New Issue
Block a user