Added power-on compile option

This commit is contained in:
OneOfEleven 2023-10-06 00:18:47 +01:00
parent 16c908f0bf
commit f25e0230f0
8 changed files with 27 additions and 10 deletions

View File

@ -15,6 +15,7 @@ ENABLE_VOICE := 0
ENABLE_VOX := 0 ENABLE_VOX := 0
ENABLE_ALARM := 0 ENABLE_ALARM := 0
ENABLE_TX1750 := 0 ENABLE_TX1750 := 0
ENABLE_PWRON_PASSWORD := 1
ENABLE_BIG_FREQ := 0 ENABLE_BIG_FREQ := 0
ENABLE_SMALL_BOLD := 1 ENABLE_SMALL_BOLD := 1
ENABLE_KEEP_MEM_NAME := 1 ENABLE_KEEP_MEM_NAME := 1
@ -133,7 +134,9 @@ ifeq ($(ENABLE_FMRADIO),1)
endif endif
OBJS += ui/helper.o OBJS += ui/helper.o
OBJS += ui/inputbox.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/main.o
OBJS += ui/menu.o OBJS += ui/menu.o
OBJS += ui/scanner.o OBJS += ui/scanner.o
@ -242,6 +245,9 @@ endif
ifeq ($(ENABLE_TX1750),1) ifeq ($(ENABLE_TX1750),1)
CFLAGS += -DENABLE_TX1750 CFLAGS += -DENABLE_TX1750
endif endif
ifeq ($(ENABLE_PWRON_PASSWORD),1)
CFLAGS += -DENABLE_PWRON_PASSWORD
endif
ifeq ($(ENABLE_KEEP_MEM_NAME),1) ifeq ($(ENABLE_KEEP_MEM_NAME),1)
CFLAGS += -DENABLE_KEEP_MEM_NAME CFLAGS += -DENABLE_KEEP_MEM_NAME
endif endif

View File

@ -42,6 +42,7 @@ ENABLE_VOICE := 0 want to hear voices ?
ENABLE_VOX := 0 ENABLE_VOX := 0
ENABLE_ALARM := 0 TX alarms ENABLE_ALARM := 0 TX alarms
ENABLE_1750HZ := 0 side key 1750Hz TX tone (older style repeater access) 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_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_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 ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel

Binary file not shown.

Binary file not shown.

14
main.c
View File

@ -174,12 +174,14 @@ void Main(void)
} }
} }
if (gEeprom.POWER_ON_PASSWORD < 1000000) #ifdef ENABLE_PWRON_PASSWORD
{ if (gEeprom.POWER_ON_PASSWORD < 1000000)
bIsInLockScreen = true; {
UI_DisplayLock(); bIsInLockScreen = true;
bIsInLockScreen = false; UI_DisplayLock();
} bIsInLockScreen = false;
}
#endif
BOOT_ProcessMode(BootMode); BOOT_ProcessMode(BootMode);

View File

@ -117,8 +117,10 @@ void SETTINGS_SaveSettings(void)
EEPROM_WriteBuffer(0x0E90, State); EEPROM_WriteBuffer(0x0E90, State);
memset(Password, 0xFF, sizeof(Password)); memset(Password, 0xFF, sizeof(Password));
Password[0] = gEeprom.POWER_ON_PASSWORD; #ifdef ENABLE_PWRON_PASSWORD
EEPROM_WriteBuffer(0x0E98, State); Password[0] = gEeprom.POWER_ON_PASSWORD;
#endif
EEPROM_WriteBuffer(0x0E98, Password);
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
memset(State, 0xFF, sizeof(State)); memset(State, 0xFF, sizeof(State));

View File

@ -14,6 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#ifdef ENABLE_PWRON_PASSWORD
#include <string.h> #include <string.h>
#include "ARMCM0.h" #include "ARMCM0.h"
@ -156,3 +158,5 @@ void UI_DisplayLock(void)
} }
} }
} }
#endif

View File

@ -17,7 +17,9 @@
#ifndef UI_LOCK_H #ifndef UI_LOCK_H
#define UI_LOCK_H #define UI_LOCK_H
void UI_DisplayLock(void); #ifdef ENABLE_PWRON_PASSWORD
void UI_DisplayLock(void);
#endif
#endif #endif