Add Not In List and All In List

This commit is contained in:
Armel FAUVEAU
2024-06-24 05:41:21 +02:00
parent d356541788
commit ee59118fce
11 changed files with 75 additions and 25 deletions

View File

@@ -4,7 +4,7 @@
# 1 = enable
# ---- STOCK QUANSHENG FERATURES ----
ENABLE_FMRADIO ?= 1
ENABLE_FMRADIO ?= 0
ENABLE_UART ?= 1
ENABLE_AIRCOPY ?= 0
ENABLE_NOAA ?= 0

View File

@@ -219,7 +219,7 @@ void ACTION_Scan(bool bRestart)
}
// channel mode. Keep scanning but toggle between scan lists
gEeprom.SCAN_LIST_DEFAULT = (gEeprom.SCAN_LIST_DEFAULT + 1) % 4;
gEeprom.SCAN_LIST_DEFAULT = (gEeprom.SCAN_LIST_DEFAULT + 1) % 6;
// jump to the next channel
CHFRSCANNER_Start(false, gScanStateDir);

View File

@@ -195,7 +195,7 @@ static void NextFreqChannel(void)
static void NextMemChannel(void)
{
static unsigned int prev_mr_chan = 0;
const bool enabled = (gEeprom.SCAN_LIST_DEFAULT < 3) ? gEeprom.SCAN_LIST_ENABLED[gEeprom.SCAN_LIST_DEFAULT] : true;
const bool enabled = (gEeprom.SCAN_LIST_DEFAULT < 5) ? gEeprom.SCAN_LIST_ENABLED[gEeprom.SCAN_LIST_DEFAULT] : true;
const int chan1 = -1;
const int chan2 = -1;
const int chan3 = -1;
@@ -267,7 +267,7 @@ static void NextMemChannel(void)
if (!enabled || chan == 0xff)
{
chan = RADIO_FindNextChannel(gNextMrChannel + gScanStateDir, gScanStateDir, (gEeprom.SCAN_LIST_DEFAULT < 3) ? true : false, gEeprom.SCAN_LIST_DEFAULT);
chan = RADIO_FindNextChannel(gNextMrChannel + gScanStateDir, gScanStateDir, (gEeprom.SCAN_LIST_DEFAULT < 5) ? true : false, gEeprom.SCAN_LIST_DEFAULT);
if (chan == 0xFF)
{ // no valid channel found
chan = MR_CHANNEL_FIRST;

View File

@@ -568,7 +568,7 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
if (bKeyPressed) { // long press MENU key
#ifdef ENABLE_FEAT_F4HWN
if(gScanStateDir != SCAN_OFF && gEeprom.SCAN_LIST_DEFAULT < 3)
if(gScanStateDir != SCAN_OFF && gEeprom.SCAN_LIST_DEFAULT < 5)
{
if(FUNCTION_IsRx())
{

View File

@@ -311,7 +311,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
case MENU_S_LIST:
//*pMin = 0;
*pMax = 3;
*pMax = 5;
break;
#ifdef ENABLE_DTMF_CALLING

View File

@@ -38,19 +38,6 @@ const uint8_t gFontKeyLock[1][9] =
{0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c}
};
const uint8_t gFontScanAll[9] =
{
0b00111110,
0b01000001,
0b01000001,
0b00100010,
0b00011100,
0b00100010,
0b01000001,
0b01000001,
0b00111110
};
const uint8_t gFontLight[9] =
{
0b00001100,
@@ -205,6 +192,49 @@ const uint8_t BITMAP_ScanList3[7] =
0b01111111,
};
const uint8_t BITMAP_ScanList4[7] =
{ // '0' symbol
0b01111111,
0b01111111,
0b01000011,
0b01011101,
0b01100001,
0b01111111,
0b01111111,
};
const uint8_t BITMAP_ScanList5[11] =
{
// 'All List' symbol
0b11111111,
0b11000011,
0b10111101,
0b10111101,
0b11011011,
0b11100111,
0b11011011,
0b10111101,
0b10111101,
0b11000011,
0b11111111
};
const uint8_t BITMAP_ScanList6[11] =
{
// 'All' symbol
0b00000000,
0b00111100,
0b01000010,
0b01000010,
0b00100100,
0b00011000,
0b00100100,
0b01000010,
0b01000010,
0b00111100,
0b00000000
};
const uint8_t BITMAP_compand[6] =
{
0b00000000,

View File

@@ -11,7 +11,6 @@ extern const uint8_t gFontF[1][8];
extern const uint8_t gFontS[1][6];
extern const uint8_t gFontKeyLock[1][9];
extern const uint8_t gFontScanAll[9];
extern const uint8_t gFontLight[9];
extern const uint8_t gFontXB[2][6];
@@ -34,6 +33,9 @@ extern const uint8_t BITMAP_VFO_NotDefault[8];
extern const uint8_t BITMAP_ScanList1[7];
extern const uint8_t BITMAP_ScanList2[7];
extern const uint8_t BITMAP_ScanList3[7];
extern const uint8_t BITMAP_ScanList4[7];
extern const uint8_t BITMAP_ScanList5[11];
extern const uint8_t BITMAP_ScanList6[11];
extern const uint8_t BITMAP_compand[6];
#ifndef ENABLE_CUSTOM_MENU_LAYOUT

10
radio.c
View File

@@ -73,7 +73,7 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL
if (att.band > BAND7_470MHz)
return false;
if (!checkScanList || scanList > 2)
if (!checkScanList || scanList > 4)
return true;
//sprintf(str, "scanList %d / att.scanlist1 %d / att.scanlist2 %d / att.scanlist3 %d\n", scanList, att.scanlist1, att.scanlist2, att.scanlist3);
@@ -92,6 +92,14 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL
{
return false;
}
else if(scanList == 3 && (att.scanlist1 == 1 || att.scanlist2 == 1 || att.scanlist3 == 1))
{
return false;
}
else if(scanList == 4 && (att.scanlist1 == 0 && att.scanlist2 == 0 && att.scanlist3 == 0))
{
return false;
}
//sprintf(str, ">>> %d\n", scanList);
//LogUart(str);

View File

@@ -225,11 +225,11 @@ void SETTINGS_InitEEPROM(void)
// 0F18..0F1F
EEPROM_ReadBuffer(0x0F18, Data, 8);
gEeprom.SCAN_LIST_DEFAULT = (Data[0] < 3) ? Data[0] : 0; // we now have 'all' channel scan option
gEeprom.SCAN_LIST_DEFAULT = (Data[0] < 5) ? Data[0] : 0; // we now have 'all' channel scan option
for (unsigned int i = 0; i < 2; i++)
{
const unsigned int j = 1 + (i * 3);
gEeprom.SCAN_LIST_ENABLED[i] = (Data[j + 0] < 2) ? Data[j] : false;
gEeprom.SCAN_LIST_ENABLED[i] = (Data[j + 0] < 5) ? Data[j] : false;
gEeprom.SCANLIST_PRIORITY_CH1[i] = Data[j + 1];
gEeprom.SCANLIST_PRIORITY_CH2[i] = Data[j + 2];
}

View File

@@ -810,7 +810,11 @@ void UI_DisplayMenu(void)
case MENU_S_LIST:
if (gSubMenuSelection < 3)
sprintf(String, "LIST%u", 1 + gSubMenuSelection);
else
else if (gSubMenuSelection == 3)
strcpy(String, "NOT\nIN LISTS");
else if (gSubMenuSelection == 4)
strcpy(String, "ALL\nIN LISTS");
else if (gSubMenuSelection == 5)
strcpy(String, "ALL");
break;

View File

@@ -105,7 +105,13 @@ void UI_DisplayStatus()
memcpy(line + x + 2, BITMAP_ScanList3, sizeof(BITMAP_ScanList3));
break;
case 3:
memcpy(line + x, gFontScanAll, sizeof(gFontScanAll));
memcpy(line + x + 2, BITMAP_ScanList4, sizeof(BITMAP_ScanList4));
break;
case 4:
memcpy(line + x, BITMAP_ScanList5, sizeof(BITMAP_ScanList5));
break;
case 5:
memcpy(line + x, BITMAP_ScanList6, sizeof(BITMAP_ScanList6));
break;
}
}