This commit is contained in:
losehu
2025-02-22 15:03:06 +08:00
parent fcbdb3c0f1
commit 4f6ce32836
2 changed files with 5 additions and 18 deletions

View File

@ -62,20 +62,8 @@ static SI47XX_SsbFilterBW ssbBw = SI47XX_SSB_BW_3_kHz;
static int8_t currentBandIndex = -1;
bool SNR_flag = true;
bool SI_run = true;
#ifndef ENABLE_SPECTRUM
typedef enum State {
SPECTRUM,
FREQ_INPUT,
STILL,
} State;
State previousState,currentState ;
void SetState(State state) {
previousState = currentState;
currentState = state;
}
#else
#include "app/spectrum.h"
#endif
typedef struct // Band data
{
const char *bandName; // Bandname
@ -619,7 +607,5 @@ void SI4732_Main() {
SYSTEM_DelayMs(1);
}
SI_deinit();
// fix a bug when in SI mode using key 5 to input a frequency , after that can not go to spectrum
if (currentState==FREQ_INPUT )
SetState(SPECTRUM);
}

View File

@ -96,7 +96,7 @@ bool preventKeypress = true;
bool audioState = true;
bool lockAGC = false;
State currentState = SPECTRUM, previousState = SPECTRUM;
State currentState ,previousState ;
PeakInfo peak;
ScanInfo scanInfo;
@ -1581,7 +1581,8 @@ static void Tick() {
void APP_RunSpectrum() {
currentState = SPECTRUM;
previousState=SPECTRUM;
// TX here coz it always? set to active VFO
vfo = gEeprom.TX_VFO;
// set the current frequency in the middle of the display