mirror of
https://github.com/egzumer/uv-k5-firmware-custom
synced 2024-11-21 09:10:27 +00:00
Menu update, F-LOCK CE update, main screen fix
This commit is contained in:
parent
fa4ae2caa6
commit
fc1bc8791c
6
Makefile
6
Makefile
@ -33,8 +33,14 @@ ENABLE_AUDIO_BAR := 1
|
||||
#ENABLE_SINGLE_VFO_CHAN := 1
|
||||
#ENABLE_BAND_SCOPE := 1
|
||||
|
||||
#############################################################
|
||||
|
||||
TARGET = firmware
|
||||
|
||||
ifeq ($(ENABLE_LTO),1)
|
||||
ENABLE_OVERLAY := 0
|
||||
endif
|
||||
|
||||
BSP_DEFINITIONS := $(wildcard hardware/*/*.def)
|
||||
BSP_HEADERS := $(patsubst hardware/%,bsp/%,$(BSP_DEFINITIONS))
|
||||
BSP_HEADERS := $(patsubst %.def,%.h,$(BSP_HEADERS))
|
||||
|
@ -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_OVERLAY := 1 cpu FLASH stuff
|
||||
ENABLE_LTO := 0 **experimental, reduces size of compiled firmware but might break EEPROM reads
|
||||
ENABLE_OVERLAY := 0 cpu FLASH stuff
|
||||
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_AIRCOPY := 0 easier to just enter frequency
|
||||
ENABLE_FMRADIO := 1 WBFM VHF band 2 RX
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -205,6 +205,8 @@ int TX_FREQUENCY_Check(const uint32_t Frequency)
|
||||
case F_LOCK_CE:
|
||||
if (Frequency >= 14400000 && Frequency < 14600000)
|
||||
return 0;
|
||||
if (Frequency >= 43000000 && Frequency < 44000000)
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case F_LOCK_GB:
|
||||
|
@ -39,8 +39,10 @@ BOOT_Mode_t BOOT_GetMode(void)
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
||||
return BOOT_MODE_NORMAL;
|
||||
return BOOT_MODE_NORMAL; // PTT not pressed
|
||||
|
||||
Keys[i] = KEYBOARD_Poll();
|
||||
|
||||
SYSTEM_DelayMs(20);
|
||||
}
|
||||
|
||||
@ -48,6 +50,7 @@ BOOT_Mode_t BOOT_GetMode(void)
|
||||
{
|
||||
gKeyReading0 = Keys[0];
|
||||
gKeyReading1 = Keys[0];
|
||||
|
||||
gDebounceCounter = 2;
|
||||
|
||||
if (Keys[0] == KEY_SIDE1)
|
||||
@ -66,7 +69,7 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
|
||||
{
|
||||
if (Mode == BOOT_MODE_F_LOCK)
|
||||
{
|
||||
// enable all the menu items
|
||||
/* // enable all the menu items
|
||||
gMenuListCount = 0;
|
||||
// while (MenuList[gMenuListCount].name != NULL)
|
||||
while (MenuList[gMenuListCount].name[0] != '\0')
|
||||
@ -74,8 +77,10 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
|
||||
|
||||
gMenuCursor = MENU_350TX;
|
||||
gSubMenuSelection = gSetting_350TX;
|
||||
*/
|
||||
GUI_SelectNextDisplay(DISPLAY_MENU);
|
||||
gF_LOCK = true;
|
||||
|
||||
gF_LOCK = true;
|
||||
}
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
else
|
||||
|
48
main.c
48
main.c
@ -50,6 +50,7 @@ void _putchar(char c)
|
||||
void Main(void)
|
||||
{
|
||||
unsigned int i;
|
||||
BOOT_Mode_t BootMode;
|
||||
|
||||
// Enable clock gating of blocks we need
|
||||
SYSCON_DEV_CLK_GATE = 0
|
||||
@ -67,7 +68,7 @@ void Main(void)
|
||||
UART_Init();
|
||||
|
||||
boot_counter_10ms = 250; // 2.5 sec
|
||||
|
||||
|
||||
UART_Send(UART_Version, strlen(UART_Version));
|
||||
|
||||
// Not implementing authentic device checks
|
||||
@ -101,12 +102,38 @@ void Main(void)
|
||||
AM_fix_init();
|
||||
#endif
|
||||
|
||||
// count the number of menu list items
|
||||
gMenuListCount = 0;
|
||||
while (MenuList[gMenuListCount].name[0] != '\0')
|
||||
gMenuListCount++;
|
||||
gMenuListCount -= 8; // disable the last 'n' items
|
||||
BootMode = BOOT_GetMode();
|
||||
if (BootMode == BOOT_MODE_F_LOCK)
|
||||
{ // enable all the menu items
|
||||
gMenuListCount = 0;
|
||||
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)
|
||||
{
|
||||
FUNCTION_Select(FUNCTION_POWER_SAVE);
|
||||
@ -120,9 +147,8 @@ void Main(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOT_Mode_t BootMode;
|
||||
|
||||
UI_DisplayWelcome();
|
||||
|
||||
BACKLIGHT_TurnOn();
|
||||
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
|
||||
@ -131,7 +157,7 @@ void Main(void)
|
||||
{
|
||||
if (KEYBOARD_Poll() != KEY_INVALID)
|
||||
{ // halt boot beeps
|
||||
boot_counter_10ms = 0;
|
||||
boot_counter_10ms = 0;
|
||||
break;
|
||||
}
|
||||
#ifdef ENABLE_BOOT_BEEPS
|
||||
@ -141,8 +167,6 @@ void Main(void)
|
||||
}
|
||||
}
|
||||
|
||||
BootMode = BOOT_GetMode();
|
||||
|
||||
if (gEeprom.POWER_ON_PASSWORD < 1000000)
|
||||
{
|
||||
bIsInLockScreen = true;
|
||||
@ -179,6 +203,8 @@ void Main(void)
|
||||
#ifdef ENABLE_NOAA
|
||||
RADIO_ConfigureNOAA();
|
||||
#endif
|
||||
|
||||
// ******************
|
||||
}
|
||||
|
||||
while (1)
|
||||
|
@ -370,6 +370,9 @@ void UI_DisplayMenu(void)
|
||||
while (i < 2)
|
||||
{ // leading menu items
|
||||
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)
|
||||
UI_PrintStringSmall(MenuList[k].name, 0, 0, i);
|
||||
i++;
|
||||
@ -384,6 +387,9 @@ void UI_DisplayMenu(void)
|
||||
const int k = menu_index + i - 2;
|
||||
if (k >= 0 && k < (int)gMenuListCount)
|
||||
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++;
|
||||
}
|
||||
}
|
||||
|
12
ui/welcome.c
12
ui/welcome.c
@ -27,6 +27,18 @@
|
||||
#include "ui/status.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)
|
||||
{
|
||||
char WelcomeString0[16];
|
||||
|
@ -17,6 +17,7 @@
|
||||
#ifndef UI_WELCOME_H
|
||||
#define UI_WELCOME_H
|
||||
|
||||
void UI_DisplayReleaseKeys(void);
|
||||
void UI_DisplayWelcome(void);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user