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_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
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

View File

@ -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

Binary file not shown.

Binary file not shown.

2
main.c
View File

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

View File

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

View File

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

View File

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