From f25e0230f04fb9adf457102a9cd984c13cbf6183 Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Fri, 6 Oct 2023 00:18:47 +0100 Subject: [PATCH] Added power-on compile option --- Makefile | 8 +++++++- README.md | 1 + firmware.bin | Bin 53860 -> 53860 bytes firmware.packed.bin | Bin 53878 -> 53878 bytes main.c | 14 ++++++++------ settings.c | 6 ++++-- ui/lock.c | 4 ++++ ui/lock.h | 4 +++- 8 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 849e661..c7e0521 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ ENABLE_VOICE := 0 ENABLE_VOX := 0 ENABLE_ALARM := 0 ENABLE_TX1750 := 0 +ENABLE_PWRON_PASSWORD := 1 ENABLE_BIG_FREQ := 0 ENABLE_SMALL_BOLD := 1 ENABLE_KEEP_MEM_NAME := 1 @@ -133,7 +134,9 @@ ifeq ($(ENABLE_FMRADIO),1) endif OBJS += ui/helper.o OBJS += ui/inputbox.o -OBJS += ui/lock.o +ifeq ($(ENABLE_PWRON_PASSWORD),1) + OBJS += ui/lock.o +endif OBJS += ui/main.o OBJS += ui/menu.o OBJS += ui/scanner.o @@ -242,6 +245,9 @@ endif ifeq ($(ENABLE_TX1750),1) CFLAGS += -DENABLE_TX1750 endif +ifeq ($(ENABLE_PWRON_PASSWORD),1) + CFLAGS += -DENABLE_PWRON_PASSWORD +endif ifeq ($(ENABLE_KEEP_MEM_NAME),1) CFLAGS += -DENABLE_KEEP_MEM_NAME endif diff --git a/README.md b/README.md index af5a874..d586bc1 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ ENABLE_VOICE := 0 want to hear voices ? ENABLE_VOX := 0 ENABLE_ALARM := 0 TX alarms ENABLE_1750HZ := 0 side key 1750Hz TX tone (older style repeater access) +ENABLE_PWRON_PASSWORD := 1 enable the power-on password stuff ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware) ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode) ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel diff --git a/firmware.bin b/firmware.bin index bf60880877a16611e5f240707e3d285af1258be6..985866918bec3ec27c3b1936c39f4f90b24f1fe8 100644 GIT binary patch delta 43 scmaE|g!#!5<_!jtOqp(*jU?ADVmCBPwluIv+x%>|9UGjZeaKP(0A_R#KL7v# delta 43 scmaE|g!#!5<_!jtOo|MfjU?ADVz*2-Pcch0-u!I09UGjZeaKP(09#5A5dZ)H diff --git a/firmware.packed.bin b/firmware.packed.bin index b02f8a55ca6d093085865a7fb6e8de7c655084f3..3b838c8428099f958dc4a58c7f980ff698f505ec 100644 GIT binary patch delta 59 zcmV-B0L1_HqyzS(1F$d|0@Js%G8xnc2YI5>Sy1B%vkf5Pn+NBaQ_UPt)U)=xJ_ZL? RX>6~@@mjMx!Z{EEmd!Dc8(jbZ delta 59 zcmV-B0L1_HqyzS(1F$d|0-N!(G8xnc2XXg?1Xj9Svkf5Pn+NaA2ap;TfwT6zJ_ZL~ RJUH^fs1LI{!Z{EEGtLki8BG8H diff --git a/main.c b/main.c index 7df450b..a7d82f2 100644 --- a/main.c +++ b/main.c @@ -174,12 +174,14 @@ void Main(void) } } - if (gEeprom.POWER_ON_PASSWORD < 1000000) - { - bIsInLockScreen = true; - UI_DisplayLock(); - bIsInLockScreen = false; - } + #ifdef ENABLE_PWRON_PASSWORD + if (gEeprom.POWER_ON_PASSWORD < 1000000) + { + bIsInLockScreen = true; + UI_DisplayLock(); + bIsInLockScreen = false; + } + #endif BOOT_ProcessMode(BootMode); diff --git a/settings.c b/settings.c index 7755012..b7821f8 100644 --- a/settings.c +++ b/settings.c @@ -117,8 +117,10 @@ void SETTINGS_SaveSettings(void) EEPROM_WriteBuffer(0x0E90, State); memset(Password, 0xFF, sizeof(Password)); - Password[0] = gEeprom.POWER_ON_PASSWORD; - EEPROM_WriteBuffer(0x0E98, State); + #ifdef ENABLE_PWRON_PASSWORD + Password[0] = gEeprom.POWER_ON_PASSWORD; + #endif + EEPROM_WriteBuffer(0x0E98, Password); #ifdef ENABLE_VOICE memset(State, 0xFF, sizeof(State)); diff --git a/ui/lock.c b/ui/lock.c index ea5e87f..1dca0a2 100644 --- a/ui/lock.c +++ b/ui/lock.c @@ -14,6 +14,8 @@ * limitations under the License. */ +#ifdef ENABLE_PWRON_PASSWORD + #include #include "ARMCM0.h" @@ -156,3 +158,5 @@ void UI_DisplayLock(void) } } } + +#endif diff --git a/ui/lock.h b/ui/lock.h index 4ad4f49..e42758d 100644 --- a/ui/lock.h +++ b/ui/lock.h @@ -17,7 +17,9 @@ #ifndef UI_LOCK_H #define UI_LOCK_H -void UI_DisplayLock(void); +#ifdef ENABLE_PWRON_PASSWORD + void UI_DisplayLock(void); +#endif #endif