diff --git a/app/si.c b/app/si.c index 1ccee86..f46cc15 100644 --- a/app/si.c +++ b/app/si.c @@ -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); + } diff --git a/app/spectrum.c b/app/spectrum.c index b0ef09a..216f4de 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -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