Skip to content

Commit

Permalink
Fixe menu count
Browse files Browse the repository at this point in the history
  • Loading branch information
spm81 committed Mar 12, 2024
1 parent de4e07b commit 936f516
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
18 changes: 17 additions & 1 deletion helper/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "ui/menu.h"
#include "ui/ui.h"

#include "../driver/eeprom.h"

BOOT_Mode_t BOOT_GetMode(void)
{
KEY_Code_t Keys[2];
Expand All @@ -50,7 +52,21 @@ BOOT_Mode_t BOOT_GetMode(void)
if (Keys[0] == KEY_SIDE2) {
return BOOT_MODE_AIRCOPY;
}

#endif
/*
////Erase with FF 512 EEPROM after offset 0x2000
if (Keys[0] == KEY_MENU) {
uint8_t data[16];
memset(data, 0xff, sizeof(data));
for (int i = 0x2000; i <= 0x10000; i += 16) {
EEPROM_WriteBuffer(i, data);
}
return BOOT_MODE_NORMAL;
}
*/
}

return BOOT_MODE_NORMAL;
Expand Down Expand Up @@ -156,9 +172,9 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
gMenuListCount++;
#endif
#endif
#ifdef ENABLE_MESSENGER_ENCRYPTION
gMenuListCount += 2;
#endif
#endif

//gMenuListCount = MENU_ITEMS_COUNT;
Expand Down
23 changes: 12 additions & 11 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,25 @@ void Main(void) {
BACKLIGHT_TurnOn();
SYSTEM_DelayMs(2500);
#if defined(ENABLE_DTMF_CALLING) && !defined(ENABLE_STATUS_BATTERY_PERC) && defined(ENABLE_ROGERBEEP)
gMenuListCount = 49;
gMenuListCount = 50;
#elif defined(ENABLE_DTMF_CALLING) && !defined(ENABLE_STATUS_BATTERY_PERC) && !defined(ENABLE_ROGERBEEP) && defined(ENABLE_MDC)
gMenuListCount = 49;
gMenuListCount = 50;
#elif defined(ENABLE_DTMF_CALLING) && !defined(ENABLE_STATUS_BATTERY_PERC) && !defined(ENABLE_ROGERBEEP)
gMenuListCount = 48;
gMenuListCount = 49;
#elif defined(ENABLE_DTMF_CALLING) && defined(ENABLE_STATUS_BATTERY_PERC) && defined(ENABLE_ROGERBEEP)
gMenuListCount = 50;
gMenuListCount = 51;
#elif defined(ENABLE_DTMF_CALLING) && defined(ENABLE_STATUS_BATTERY_PERC) && !defined(ENABLE_ROGERBEEP) && defined(ENABLE_MDC)
gMenuListCount = 50;
gMenuListCount = 51;
#elif defined(ENABLE_DTMF_CALLING) && defined(ENABLE_STATUS_BATTERY_PERC) && !defined(ENABLE_ROGERBEEP)
gMenuListCount = 49;
gMenuListCount = 51;
#elif !defined(ENABLE_DTMF_CALLING) && defined(ENABLE_STATUS_BATTERY_PERC) && defined(ENABLE_ROGERBEEP)
gMenuListCount = 40;
gMenuListCount = 41;
#elif !defined(ENABLE_DTMF_CALLING) && defined(ENABLE_STATUS_BATTERY_PERC) && !defined(ENABLE_ROGERBEEP) && defined(ENABLE_MDC)
gMenuListCount = 40;
gMenuListCount = 41;
#elif !defined(ENABLE_DTMF_CALLING) && defined(ENABLE_STATUS_BATTERY_PERC) && !defined(ENABLE_ROGERBEEP)
gMenuListCount = 39;
gMenuListCount = 40;
#else
gMenuListCount = 38;
gMenuListCount = 39;
#endif
#if defined(ENABLE_LCD_CONTRAST_OPTION)
gMenuListCount += 1;
Expand All @@ -170,10 +170,11 @@ void Main(void) {
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
gMenuListCount++;
#endif
#endif
#ifdef ENABLE_MESSENGER_ENCRYPTION
gMenuListCount += 2;
#endif
#endif

BootMode = BOOT_GetMode();
if (gEeprom.POWER_ON_PASSWORD < 1000000) {
bIsInLockScreen = true;
Expand Down

0 comments on commit 936f516

Please sign in to comment.