Menu update, F-LOCK CE update, main screen fix

This commit is contained in:
OneOfEleven 2023-10-01 14:34:51 +01:00
parent fa4ae2caa6
commit fc1bc8791c
10 changed files with 74 additions and 16 deletions

View File

@ -33,8 +33,14 @@ ENABLE_AUDIO_BAR := 1
#ENABLE_SINGLE_VFO_CHAN := 1 #ENABLE_SINGLE_VFO_CHAN := 1
#ENABLE_BAND_SCOPE := 1 #ENABLE_BAND_SCOPE := 1
#############################################################
TARGET = firmware TARGET = firmware
ifeq ($(ENABLE_LTO),1)
ENABLE_OVERLAY := 0
endif
BSP_DEFINITIONS := $(wildcard hardware/*/*.def) BSP_DEFINITIONS := $(wildcard hardware/*/*.def)
BSP_HEADERS := $(patsubst hardware/%,bsp/%,$(BSP_DEFINITIONS)) BSP_HEADERS := $(patsubst hardware/%,bsp/%,$(BSP_DEFINITIONS))
BSP_HEADERS := $(patsubst %.def,%.h,$(BSP_HEADERS)) BSP_HEADERS := $(patsubst %.def,%.h,$(BSP_HEADERS))

View File

@ -25,8 +25,8 @@ You'll find the options at the top of "Makefile" ('0' = disable, '1' = enable) .
``` ```
ENABLE_SWD := 0 only needed if using CPU's SWD port (debugging/programming) ENABLE_SWD := 0 only needed if using CPU's SWD port (debugging/programming)
ENABLE_OVERLAY := 1 cpu FLASH stuff ENABLE_OVERLAY := 0 cpu FLASH stuff
ENABLE_LTO := 0 **experimental, reduces size of compiled firmware but might break EEPROM reads ENABLE_LTO := 0 **experimental, reduces size of compiled firmware but might break EEPROM reads - DISABLE overlay if you enable this
ENABLE_UART := 1 without this you can't configure radio via PC ENABLE_UART := 1 without this you can't configure radio via PC
ENABLE_AIRCOPY := 0 easier to just enter frequency ENABLE_AIRCOPY := 0 easier to just enter frequency
ENABLE_FMRADIO := 1 WBFM VHF band 2 RX ENABLE_FMRADIO := 1 WBFM VHF band 2 RX

Binary file not shown.

Binary file not shown.

View File

@ -205,6 +205,8 @@ int TX_FREQUENCY_Check(const uint32_t Frequency)
case F_LOCK_CE: case F_LOCK_CE:
if (Frequency >= 14400000 && Frequency < 14600000) if (Frequency >= 14400000 && Frequency < 14600000)
return 0; return 0;
if (Frequency >= 43000000 && Frequency < 44000000)
return 0;
break; break;
case F_LOCK_GB: case F_LOCK_GB:

View File

@ -39,8 +39,10 @@ BOOT_Mode_t BOOT_GetMode(void)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT)) if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
return BOOT_MODE_NORMAL; return BOOT_MODE_NORMAL; // PTT not pressed
Keys[i] = KEYBOARD_Poll(); Keys[i] = KEYBOARD_Poll();
SYSTEM_DelayMs(20); SYSTEM_DelayMs(20);
} }
@ -48,6 +50,7 @@ BOOT_Mode_t BOOT_GetMode(void)
{ {
gKeyReading0 = Keys[0]; gKeyReading0 = Keys[0];
gKeyReading1 = Keys[0]; gKeyReading1 = Keys[0];
gDebounceCounter = 2; gDebounceCounter = 2;
if (Keys[0] == KEY_SIDE1) if (Keys[0] == KEY_SIDE1)
@ -66,7 +69,7 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
{ {
if (Mode == BOOT_MODE_F_LOCK) if (Mode == BOOT_MODE_F_LOCK)
{ {
// enable all the menu items /* // enable all the menu items
gMenuListCount = 0; gMenuListCount = 0;
// while (MenuList[gMenuListCount].name != NULL) // while (MenuList[gMenuListCount].name != NULL)
while (MenuList[gMenuListCount].name[0] != '\0') while (MenuList[gMenuListCount].name[0] != '\0')
@ -74,8 +77,10 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
gMenuCursor = MENU_350TX; gMenuCursor = MENU_350TX;
gSubMenuSelection = gSetting_350TX; gSubMenuSelection = gSetting_350TX;
*/
GUI_SelectNextDisplay(DISPLAY_MENU); GUI_SelectNextDisplay(DISPLAY_MENU);
gF_LOCK = true;
gF_LOCK = true;
} }
#ifdef ENABLE_AIRCOPY #ifdef ENABLE_AIRCOPY
else else

44
main.c
View File

@ -50,6 +50,7 @@ void _putchar(char c)
void Main(void) void Main(void)
{ {
unsigned int i; unsigned int i;
BOOT_Mode_t BootMode;
// Enable clock gating of blocks we need // Enable clock gating of blocks we need
SYSCON_DEV_CLK_GATE = 0 SYSCON_DEV_CLK_GATE = 0
@ -101,11 +102,37 @@ void Main(void)
AM_fix_init(); AM_fix_init();
#endif #endif
// count the number of menu list items BootMode = BOOT_GetMode();
gMenuListCount = 0; if (BootMode == BOOT_MODE_F_LOCK)
while (MenuList[gMenuListCount].name[0] != '\0') { // enable all the menu items
gMenuListCount++; gMenuListCount = 0;
gMenuListCount -= 8; // disable the last 'n' items while (MenuList[gMenuListCount].name[0] != '\0')
gMenuListCount++;
gMenuCursor = MENU_350TX;
gSubMenuSelection = gSetting_350TX;
gF_LOCK = true;
}
else
{ // hide the hidden menu items
gMenuListCount = 0;
while (MenuList[gMenuListCount].name[0] != '\0')
gMenuListCount++;
gMenuListCount -= 8; // disable the last 'n' items
}
// wait for user to release all keys/butts before moving on
if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) || KEYBOARD_Poll() != KEY_INVALID)
{ // keys are pressed
UI_DisplayReleaseKeys();
BACKLIGHT_TurnOn();
i = 0;
while (i < 50) // 500ms
{
i = (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) && KEYBOARD_Poll() == KEY_INVALID) ? i + 1 : 0;
SYSTEM_DelayMs(10);
}
}
if (!gChargingWithTypeC && !gBatteryDisplayLevel) if (!gChargingWithTypeC && !gBatteryDisplayLevel)
{ {
@ -120,9 +147,8 @@ void Main(void)
} }
else else
{ {
BOOT_Mode_t BootMode;
UI_DisplayWelcome(); UI_DisplayWelcome();
BACKLIGHT_TurnOn(); BACKLIGHT_TurnOn();
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE) if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
@ -141,8 +167,6 @@ void Main(void)
} }
} }
BootMode = BOOT_GetMode();
if (gEeprom.POWER_ON_PASSWORD < 1000000) if (gEeprom.POWER_ON_PASSWORD < 1000000)
{ {
bIsInLockScreen = true; bIsInLockScreen = true;
@ -179,6 +203,8 @@ void Main(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
RADIO_ConfigureNOAA(); RADIO_ConfigureNOAA();
#endif #endif
// ******************
} }
while (1) while (1)

View File

@ -370,6 +370,9 @@ void UI_DisplayMenu(void)
while (i < 2) while (i < 2)
{ // leading menu items { // leading menu items
const int k = menu_index + i - 2; const int k = menu_index + i - 2;
if (k < 0)
UI_PrintStringSmall(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
else
if (k >= 0 && k < (int)gMenuListCount) if (k >= 0 && k < (int)gMenuListCount)
UI_PrintStringSmall(MenuList[k].name, 0, 0, i); UI_PrintStringSmall(MenuList[k].name, 0, 0, i);
i++; i++;
@ -384,6 +387,9 @@ void UI_DisplayMenu(void)
const int k = menu_index + i - 2; const int k = menu_index + i - 2;
if (k >= 0 && k < (int)gMenuListCount) if (k >= 0 && k < (int)gMenuListCount)
UI_PrintStringSmall(MenuList[k].name, 0, 0, 1 + i); UI_PrintStringSmall(MenuList[k].name, 0, 0, 1 + i);
else
if (k >= (int)gMenuListCount)
UI_PrintStringSmall(MenuList[gMenuListCount - k].name, 0, 0, 1 + i); // wrap-a-round
i++; i++;
} }
} }

View File

@ -27,6 +27,18 @@
#include "ui/status.h" #include "ui/status.h"
#include "version.h" #include "version.h"
void UI_DisplayReleaseKeys(void)
{
memset(gStatusLine, 0, sizeof(gStatusLine));
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
UI_PrintString("RELEASE", 0, 127, 1, 10);
UI_PrintString("ALL KEYS", 0, 127, 3, 10);
ST7565_BlitStatusLine(); // blank status line
ST7565_BlitFullScreen();
}
void UI_DisplayWelcome(void) void UI_DisplayWelcome(void)
{ {
char WelcomeString0[16]; char WelcomeString0[16];

View File

@ -17,6 +17,7 @@
#ifndef UI_WELCOME_H #ifndef UI_WELCOME_H
#define UI_WELCOME_H #define UI_WELCOME_H
void UI_DisplayReleaseKeys(void);
void UI_DisplayWelcome(void); void UI_DisplayWelcome(void);
#endif #endif