Menu items reordered

This commit is contained in:
Krzysiek Egzmont
2023-10-17 13:34:18 +02:00
parent 6172d942be
commit 4dd2445833
3 changed files with 46 additions and 50 deletions

19
main.c
View File

@@ -103,26 +103,21 @@ void Main(void)
#endif
BootMode = BOOT_GetMode();
// count the number of menu items
gMenuListCount = 0;
while (MenuList[gMenuListCount].name[0] != '\0')
gMenuListCount++;
if (BootMode == BOOT_MODE_F_LOCK)
{
gF_LOCK = true; // flag to say include the hidden menu items
}
else
{ // hide the hidden menu items
gMenuListCount -= 9;
// count the number of menu items
gMenuListCount = 0;
while (MenuList[gMenuListCount].name[0] != '\0') {
if(!gF_LOCK && MenuList[gMenuListCount].menu_id == FIRST_HIDDEN_MENU_ITEM)
break;
#ifndef ENABLE_F_CAL_MENU
gMenuListCount++;
#endif
gMenuListCount++;
}
// wait for user to release all butts before moving on
if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) ||
KEYBOARD_Poll() != KEY_INVALID ||