Menu style build option ENABLE_CUSTOM_MENU_LAYOUT
This commit is contained in:
4
Makefile
4
Makefile
@@ -25,6 +25,7 @@ ENABLE_FLASHLIGHT ?= 1
|
|||||||
# ---- CUSTOM MODS ----
|
# ---- CUSTOM MODS ----
|
||||||
ENABLE_BIG_FREQ ?= 1
|
ENABLE_BIG_FREQ ?= 1
|
||||||
ENABLE_SMALL_BOLD ?= 1
|
ENABLE_SMALL_BOLD ?= 1
|
||||||
|
ENABLE_CUSTOM_MENU_LAYOUT ?= 1
|
||||||
ENABLE_KEEP_MEM_NAME ?= 1
|
ENABLE_KEEP_MEM_NAME ?= 1
|
||||||
ENABLE_WIDE_RX ?= 1
|
ENABLE_WIDE_RX ?= 1
|
||||||
ENABLE_TX_WHEN_AM ?= 0
|
ENABLE_TX_WHEN_AM ?= 0
|
||||||
@@ -373,6 +374,9 @@ endif
|
|||||||
ifeq ($(ENABLE_UART_RW_BK_REGS),1)
|
ifeq ($(ENABLE_UART_RW_BK_REGS),1)
|
||||||
CFLAGS += -DENABLE_UART_RW_BK_REGS
|
CFLAGS += -DENABLE_UART_RW_BK_REGS
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ENABLE_CUSTOM_MENU_LAYOUT),1)
|
||||||
|
CFLAGS += -DENABLE_CUSTOM_MENU_LAYOUT
|
||||||
|
endif
|
||||||
|
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections
|
LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections
|
||||||
|
13
bitmaps.c
13
bitmaps.c
@@ -312,3 +312,16 @@ const uint8_t BITMAP_compand[6] =
|
|||||||
0b01000010,
|
0b01000010,
|
||||||
0b00100100
|
0b00100100
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef ENABLE_CUSTOM_MENU_LAYOUT
|
||||||
|
const uint8_t BITMAP_CurrentIndicator[8] = {
|
||||||
|
0xFF,
|
||||||
|
0xFF,
|
||||||
|
0x7E,
|
||||||
|
0x7E,
|
||||||
|
0x3C,
|
||||||
|
0x3C,
|
||||||
|
0x18,
|
||||||
|
0x18
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
@@ -43,4 +43,9 @@ extern const uint8_t BITMAP_ScanList1[6];
|
|||||||
extern const uint8_t BITMAP_ScanList2[6];
|
extern const uint8_t BITMAP_ScanList2[6];
|
||||||
|
|
||||||
extern const uint8_t BITMAP_compand[6];
|
extern const uint8_t BITMAP_compand[6];
|
||||||
|
|
||||||
|
#ifndef ENABLE_CUSTOM_MENU_LAYOUT
|
||||||
|
extern const uint8_t BITMAP_CurrentIndicator[8];
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
58
ui/menu.c
58
ui/menu.c
@@ -404,49 +404,45 @@ void UI_DisplayMenu(void)
|
|||||||
|
|
||||||
UI_DisplayClear();
|
UI_DisplayClear();
|
||||||
|
|
||||||
#if 0
|
#ifndef ENABLE_CUSTOM_MENU_LAYOUT
|
||||||
// original menu layout
|
// original menu layout
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
if (gMenuCursor > 0 || i > 0)
|
||||||
|
if ((gMenuListCount - 1) != gMenuCursor || i != 2)
|
||||||
|
UI_PrintString(MenuList[gMenuCursor + i - 1].name, 0, 0, i * 2, 8);
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
// invert the current menu list item pixels
|
||||||
if (gMenuCursor > 0 || i > 0)
|
for (i = 0; i < (8 * menu_list_width); i++)
|
||||||
if ((gMenuListCount - 1) != gMenuCursor || i != 2)
|
{
|
||||||
UI_PrintString(MenuList[gMenuCursor + i - 1].name, 0, 0, i * 2, 8);
|
gFrameBuffer[2][i] ^= 0xFF;
|
||||||
|
gFrameBuffer[3][i] ^= 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
// invert the current menu list item pixels
|
// draw vertical separating dotted line
|
||||||
for (i = 0; i < (8 * menu_list_width); i++)
|
for (i = 0; i < 7; i++)
|
||||||
{
|
gFrameBuffer[i][(8 * menu_list_width) + 1] = 0xAA;
|
||||||
gFrameBuffer[2][i] ^= 0xFF;
|
|
||||||
gFrameBuffer[3][i] ^= 0xFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
// draw vertical separating dotted line
|
// draw the little sub-menu triangle marker
|
||||||
for (i = 0; i < 7; i++)
|
if (gIsInSubMenu)
|
||||||
gFrameBuffer[i][(8 * menu_list_width) + 1] = 0xAA;
|
memcpy(gFrameBuffer[0] + (8 * menu_list_width) + 1, BITMAP_CurrentIndicator, sizeof(BITMAP_CurrentIndicator));
|
||||||
|
|
||||||
// draw the little sub-menu triangle marker
|
// draw the menu index number/count
|
||||||
if (gIsInSubMenu)
|
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||||
memcpy(gFrameBuffer[0] + (8 * menu_list_width) + 1, BITMAP_CurrentIndicator, sizeof(BITMAP_CurrentIndicator));
|
|
||||||
|
|
||||||
// draw the menu index number/count
|
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
|
||||||
|
|
||||||
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
#else
|
||||||
|
|
||||||
#else
|
|
||||||
{ // new menu layout .. experimental & unfinished
|
{ // new menu layout .. experimental & unfinished
|
||||||
|
|
||||||
const int menu_index = gMenuCursor; // current selected menu item
|
const int menu_index = gMenuCursor; // current selected menu item
|
||||||
i = 1;
|
i = 1;
|
||||||
|
|
||||||
if (!gIsInSubMenu)
|
if (!gIsInSubMenu) {
|
||||||
{
|
|
||||||
while (i < 2)
|
while (i < 2)
|
||||||
{ // leading menu items - small text
|
{ // leading menu items - small text
|
||||||
const int k = menu_index + i - 2;
|
const int k = menu_index + i - 2;
|
||||||
if (k < 0)
|
if (k < 0)
|
||||||
UI_PrintStringSmallNormal(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
|
UI_PrintStringSmallNormal(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
|
||||||
else
|
else if (k >= 0 && k < (int)gMenuListCount)
|
||||||
if (k >= 0 && k < (int)gMenuListCount)
|
|
||||||
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, i);
|
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, i);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@@ -461,8 +457,7 @@ void UI_DisplayMenu(void)
|
|||||||
const int k = menu_index + i - 2;
|
const int k = menu_index + i - 2;
|
||||||
if (k >= 0 && k < (int)gMenuListCount)
|
if (k >= 0 && k < (int)gMenuListCount)
|
||||||
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, 1 + i);
|
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, 1 + i);
|
||||||
else
|
else if (k >= (int)gMenuListCount)
|
||||||
if (k >= (int)gMenuListCount)
|
|
||||||
UI_PrintStringSmallNormal(MenuList[gMenuListCount - k].name, 0, 0, 1 + i); // wrap-a-round
|
UI_PrintStringSmallNormal(MenuList[gMenuListCount - k].name, 0, 0, 1 + i); // wrap-a-round
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@@ -471,15 +466,14 @@ void UI_DisplayMenu(void)
|
|||||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||||
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||||
}
|
}
|
||||||
else
|
else if (menu_index >= 0 && menu_index < (int)gMenuListCount)
|
||||||
if (menu_index >= 0 && menu_index < (int)gMenuListCount)
|
|
||||||
{ // current menu item
|
{ // current menu item
|
||||||
// strcat(String, ":");
|
// strcat(String, ":");
|
||||||
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
|
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
|
||||||
// UI_PrintStringSmallNormal(String, 0, 0, 0);
|
// UI_PrintStringSmallNormal(String, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// **************
|
// **************
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user