mirror of
https://github.com/DualTachyon/uv-k5-firmware.git
synced 2024-11-27 08:59:52 +08:00
Fixed scanlist behaviour.
This commit is contained in:
parent
3847d3bcbe
commit
858d983935
30
app/app.c
30
app/app.c
@ -45,7 +45,6 @@
|
||||
#include "driver/st7565.h"
|
||||
#include "driver/system.h"
|
||||
#include "dtmf.h"
|
||||
#include "external/printf/printf.h"
|
||||
#include "frequencies.h"
|
||||
#include "functions.h"
|
||||
#include "helper/battery.h"
|
||||
@ -404,8 +403,8 @@ static void FREQ_NextChannel(void)
|
||||
|
||||
static void MR_NextChannel(void)
|
||||
{
|
||||
uint8_t Ch1 = gEeprom.SCANLIST_PRIORITY_CH1[gEeprom.SCAN_LIST_DEFAULT];
|
||||
uint8_t Ch2 = gEeprom.SCANLIST_PRIORITY_CH2[gEeprom.SCAN_LIST_DEFAULT];
|
||||
const uint8_t Ch1 = gEeprom.SCANLIST_PRIORITY_CH1[gEeprom.SCAN_LIST_DEFAULT];
|
||||
const uint8_t Ch2 = gEeprom.SCANLIST_PRIORITY_CH2[gEeprom.SCAN_LIST_DEFAULT];
|
||||
uint8_t PreviousCh, Ch;
|
||||
bool bEnabled;
|
||||
|
||||
@ -429,19 +428,22 @@ static void MR_NextChannel(void)
|
||||
}
|
||||
if (gCurrentScanList == 2) {
|
||||
gNextMrChannel = gPreviousMrChannel;
|
||||
} else {
|
||||
goto Skip;
|
||||
Ch = RADIO_FindNextChannel(gNextMrChannel + gScanState, gScanState, true, gEeprom.SCAN_LIST_DEFAULT);
|
||||
if (Ch == 0xFF) {
|
||||
return;
|
||||
}
|
||||
|
||||
gNextMrChannel = Ch;
|
||||
}
|
||||
} else {
|
||||
Ch = RADIO_FindNextChannel(gNextMrChannel + gScanState, gScanState, true, gEeprom.SCAN_LIST_DEFAULT);
|
||||
if (Ch == 0xFF) {
|
||||
return;
|
||||
}
|
||||
|
||||
gNextMrChannel = Ch;
|
||||
}
|
||||
|
||||
Ch = RADIO_FindNextChannel(gNextMrChannel + gScanState, gScanState, true, gEeprom.SCAN_LIST_DEFAULT);
|
||||
if (Ch == 0xFF) {
|
||||
return;
|
||||
}
|
||||
|
||||
gNextMrChannel = Ch;
|
||||
|
||||
Skip:
|
||||
if (PreviousCh != gNextMrChannel) {
|
||||
gEeprom.MrChannel[gEeprom.RX_CHANNEL] = gNextMrChannel;
|
||||
gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = gNextMrChannel;
|
||||
@ -453,7 +455,7 @@ Skip:
|
||||
bScanKeepFrequency = false;
|
||||
if (bEnabled) {
|
||||
gCurrentScanList++;
|
||||
if (gCurrentScanList >= 2) {
|
||||
if (gCurrentScanList > 2) {
|
||||
gCurrentScanList = 0;
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ volatile uint16_t ScanPauseDelayIn10msec;
|
||||
uint8_t gScanProgressIndicator;
|
||||
uint8_t gScanHitCount;
|
||||
bool gScanUseCssResult;
|
||||
uint8_t gScanState;
|
||||
int8_t gScanState;
|
||||
bool bScanKeepFrequency;
|
||||
|
||||
static void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
|
@ -48,7 +48,7 @@ extern volatile uint16_t ScanPauseDelayIn10msec;
|
||||
extern uint8_t gScanProgressIndicator;
|
||||
extern uint8_t gScanHitCount;
|
||||
extern bool gScanUseCssResult;
|
||||
extern uint8_t gScanState;
|
||||
extern int8_t gScanState;
|
||||
extern bool bScanKeepFrequency;
|
||||
|
||||
void SCANNER_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||
|
Loading…
Reference in New Issue
Block a user