[CLI] reboot command added

This commit is contained in:
Bertrand Songis
2016-02-20 16:55:05 +01:00
parent 0f4f49b64e
commit 67a599e0b9
45 changed files with 920 additions and 605 deletions
+185 -93
View File
@@ -20,66 +20,120 @@
#include "opentx.h"
const uint8_t * LBM_SCREENS_SETUP_ICONS[] = {
LBM_MAINVIEWS_ICON,
LBM_MAINVIEWS_TOPBAR_ICON,
LBM_MAINVIEWS_ICONS[0],
LBM_MAINVIEWS_ICONS[1],
LBM_MAINVIEWS_ICONS[2],
LBM_MAINVIEWS_ICONS[3],
LBM_MAINVIEWS_ICONS[4]
};
Layout * currentScreen;
WidgetsContainerInterface * currentContainer;
Widget * currentWidget;
uint8_t currentZone;
#define SCREENS_SETUP_2ND_COLUMN 200
ZoneOptionValue editZoneOption(coord_t y, const ZoneOption * option, ZoneOptionValue value, LcdFlags attr, evt_t event)
char fileSelection[sizeof(ZoneOptionValue::stringValue)];
uint8_t fileSelectionDone;
int updateMainviewsMenu();
bool menuScreenAdd(evt_t event);
void onScreenSetupMenu(const char * result);
void onZoneOptionFileSelectionMenu(const char * result)
{
if (result == STR_UPDATE_LIST) {
if (!sdListFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(ZoneOptionValue::stringValue), NULL)) {
POPUP_WARNING(STR_NO_BITMAPS_ON_SD);
}
}
else {
fileSelectionDone = true;
memcpy(fileSelection, result, sizeof(fileSelection));
}
}
void editZoneOption(coord_t y, const ZoneOption * option, ZoneOptionValue * value, LcdFlags attr, uint32_t i_flags, evt_t event)
{
lcdDrawText(MENUS_MARGIN_LEFT, y, option->name);
if (option->type == ZoneOption::Bool) {
value.boolValue = editCheckBox(value.boolValue, SCREENS_SETUP_2ND_COLUMN, y, attr, event);
value->boolValue = editCheckBox(value->boolValue, SCREENS_SETUP_2ND_COLUMN, y, attr, event); // TODO always does storageDirty(EE_MODEL)
}
else if (option->type == ZoneOption::Integer) {
lcdDrawNumber(SCREENS_SETUP_2ND_COLUMN, y, value.signedValue, attr | LEFT);
lcdDrawNumber(SCREENS_SETUP_2ND_COLUMN, y, value->signedValue, attr | LEFT);
if (attr) {
CHECK_INCDEC_MODELVAR(event, value.signedValue, -30000, 30000);
CHECK_INCDEC_MODELVAR(event, value->signedValue, -30000, 30000); // TODO i_flags
}
}
else if (option->type == ZoneOption::String) {
editName(SCREENS_SETUP_2ND_COLUMN, y, value.stringValue, sizeof(value.stringValue), event, attr);
editName(SCREENS_SETUP_2ND_COLUMN, y, value->stringValue, sizeof(value->stringValue), event, attr); // TODO i_flags?
}
else if (option->type == ZoneOption::File) {
if (ZEXIST(value->stringValue))
lcdDrawSizedText(SCREENS_SETUP_2ND_COLUMN, y, value->stringValue, sizeof(value->stringValue), attr);
else
lcdDrawTextAtIndex(SCREENS_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr); // TODO define
if (attr) {
if (event==EVT_KEY_BREAK(KEY_ENTER)) {
s_editMode = 0;
if (sdListFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(value->stringValue), value->stringValue, LIST_NONE_SD_FILE)) {
fileSelectionDone = false;
popupMenuHandler = onZoneOptionFileSelectionMenu;
}
else {
POPUP_WARNING(STR_NO_BITMAPS_ON_SD);
}
}
else if (fileSelectionDone) {
memcpy(value->stringValue, fileSelection, sizeof(fileSelection));
fileSelectionDone = false;
storageDirty(i_flags);
}
}
}
else if (option->type == ZoneOption::TextSize) {
lcdDrawTextAtIndex(SCREENS_SETUP_2ND_COLUMN, y, "\010StandardTiny\0 Small\0 Mid\0 Double", value.unsignedValue, attr);
lcdDrawTextAtIndex(SCREENS_SETUP_2ND_COLUMN, y, "\010StandardTiny\0 Small\0 Mid\0 Double", value->unsignedValue, attr);
if (attr) {
value.unsignedValue = checkIncDec(event, value.unsignedValue, 0, 4, EE_MODEL);
value->unsignedValue = checkIncDec(event, value->unsignedValue, 0, 4, i_flags);
}
}
else if (option->type == ZoneOption::Timer) {
drawStringWithIndex(SCREENS_SETUP_2ND_COLUMN, y, STR_TIMER, value.unsignedValue + 1, attr);
drawStringWithIndex(SCREENS_SETUP_2ND_COLUMN, y, STR_TIMER, value->unsignedValue + 1, attr);
if (attr) {
value.unsignedValue = checkIncDec(event, value.unsignedValue, 0, MAX_TIMERS - 1, EE_MODEL);
value->unsignedValue = checkIncDec(event, value->unsignedValue, 0, MAX_TIMERS - 1, i_flags);
}
}
else if (option->type == ZoneOption::Source) {
putsMixerSource(SCREENS_SETUP_2ND_COLUMN, y, value.unsignedValue, attr);
putsMixerSource(SCREENS_SETUP_2ND_COLUMN, y, value->unsignedValue, attr);
if (attr) {
CHECK_INCDEC_MODELSOURCE(event, value.unsignedValue, 1, MIXSRC_LAST);
CHECK_INCDEC_MODELSOURCE(event, value->unsignedValue, 1, MIXSRC_LAST);
}
}
else if (option->type == ZoneOption::Color) {
lcdSetColor(value.unsignedValue);
lcdSetColor(value->unsignedValue);
lcdDrawSolidRect(SCREENS_SETUP_2ND_COLUMN, y, 40, 15, 1, attr ? TEXT_INVERTED_BGCOLOR : TEXT_COLOR);
lcdDrawSolidFilledRect(SCREENS_SETUP_2ND_COLUMN + 1, y + 1, 38, 13, CUSTOM_COLOR);
if (attr) {
CHECK_INCDEC_MODELVAR(event, value.unsignedValue, 0, 65535);
value->unsignedValue = checkIncDec(event, value->unsignedValue, i_flags, 65535, 0);
}
}
return value;
}
bool menuWidgetSettings(evt_t event)
template <class T>
bool menuSettings(const char * title, const T * object, uint32_t i_flags, evt_t event)
{
linesCount = 0;
const ZoneOption * options = currentWidget->getFactory()->getOptions();
const ZoneOption * options = object->getOptions();
for (const ZoneOption * option = options; option->name; option++) {
linesCount++;
}
SUBMENU_WITH_OPTIONS("Widget settings", LBM_MAINVIEWS_ICON, linesCount, OPTION_MENU_TITLE_BAR, { 0, 0, 0 });
SUBMENU_WITH_OPTIONS(title, LBM_MAINVIEWS_ICON, linesCount, OPTION_MENU_TITLE_BAR, { 0, 0, 0 });
for (int i=0; i<NUM_BODY_LINES+1; i++) {
coord_t y = MENU_CONTENT_TOP + i * FH;
@@ -88,17 +142,24 @@ bool menuWidgetSettings(evt_t event)
LcdFlags attr = (menuVerticalPosition == k ? blink : 0);
if (k < linesCount) {
const ZoneOption * option = &options[k];
ZoneOptionValue value = currentWidget->getOptionValue(k);
value = editZoneOption(y, option, value, attr, event);
if (attr) {
currentWidget->setOptionValue(k, value);
}
ZoneOptionValue * value = object->getOptionValue(k);
editZoneOption(y, option, value, attr, i_flags, event);
}
}
return true;
}
bool menuWidgetSettings(evt_t event)
{
return menuSettings<Widget>("Widget settings", currentWidget, EE_MODEL, event);
}
bool menuThemeSettings(evt_t event)
{
return menuSettings<Theme>("Theme settings", theme, EE_GENERAL, event);
}
bool menuWidgetChoice(evt_t event)
{
static Widget * previousWidget;
@@ -108,8 +169,8 @@ bool menuWidgetChoice(evt_t event)
case EVT_ENTRY:
{
const WidgetFactory * factory;
previousWidget = currentScreen->getWidget(currentZone);
currentScreen->setWidget(currentZone, NULL);
previousWidget = currentContainer->getWidget(currentZone);
currentContainer->setWidget(currentZone, NULL);
menuHorizontalPosition = 0;
if (previousWidget) {
factory = previousWidget->getFactory();
@@ -123,19 +184,19 @@ bool menuWidgetChoice(evt_t event)
else {
factory = registeredWidgets[0];
}
currentWidget = factory->create(currentScreen->getZone(currentZone), &tempData);
currentWidget = factory->create(currentContainer->getZone(currentZone), &tempData);
break;
}
case EVT_KEY_BREAK(KEY_EXIT):
delete currentWidget;
currentScreen->setWidget(currentZone, previousWidget);
currentContainer->setWidget(currentZone, previousWidget);
popMenu();
return false;
case EVT_KEY_BREAK(KEY_ENTER):
delete previousWidget;
currentScreen->createWidget(currentZone, registeredWidgets[menuHorizontalPosition]);
currentContainer->createWidget(currentZone, registeredWidgets[menuHorizontalPosition]);
storageDirty(EE_MODEL);
popMenu();
return false;
@@ -143,21 +204,21 @@ bool menuWidgetChoice(evt_t event)
case EVT_ROTARY_RIGHT:
if (menuHorizontalPosition < int(countRegisteredWidgets-1)) {
delete currentWidget;
currentWidget = registeredWidgets[++menuHorizontalPosition]->create(currentScreen->getZone(currentZone), &tempData);
currentWidget = registeredWidgets[++menuHorizontalPosition]->create(currentContainer->getZone(currentZone), &tempData);
}
break;
case EVT_ROTARY_LEFT:
if (menuHorizontalPosition > 0) {
delete currentWidget;
currentWidget = registeredWidgets[--menuHorizontalPosition]->create(currentScreen->getZone(currentZone), &tempData);
currentWidget = registeredWidgets[--menuHorizontalPosition]->create(currentContainer->getZone(currentZone), &tempData);
}
break;
}
currentScreen->refresh();
Zone zone = currentScreen->getZone(currentZone);
Zone zone = currentContainer->getZone(currentZone);
lcdDrawFilledRect(0, 0, zone.x-2, LCD_H, SOLID, OVERLAY_COLOR | (8<<24));
lcdDrawFilledRect(zone.x+zone.w+2, 0, LCD_W-zone.x-zone.w-2, LCD_H, SOLID, OVERLAY_COLOR | (8<<24));
lcdDrawFilledRect(zone.x-2, 0, zone.w+4, zone.y-2, SOLID, OVERLAY_COLOR | (8<<24));
@@ -176,20 +237,18 @@ bool menuWidgetChoice(evt_t event)
void onZoneMenu(const char * result)
{
if (result == STR_SELECT_WIDGET) {
currentZone = menuVerticalPosition;
pushMenu(menuWidgetChoice);
}
else if (result == STR_WIDGET_SETTINGS) {
currentWidget = currentScreen->getWidget(menuVerticalPosition);
pushMenu(menuWidgetSettings);
}
else if (result == STR_REMOVE_WIDGET) {
currentScreen->setWidget(menuVerticalPosition, NULL);
currentContainer->setWidget(currentZone, NULL);
storageDirty(EE_MODEL);
}
}
bool menuSetupWidgets(evt_t event)
bool menuWidgetsSetup(evt_t event)
{
switch (event) {
case EVT_ENTRY:
@@ -200,17 +259,30 @@ bool menuSetupWidgets(evt_t event)
return false;
}
currentScreen->refresh(true);
currentScreen->refresh();
for (int i=currentScreen->getZonesCount()-1; i>=0; i--) {
Zone zone = currentScreen->getZone(i);
for (int i=currentContainer->getZonesCount()-1; i>=0; i--) {
Zone zone = currentContainer->getZone(i);
LcdFlags color;
int padding, thickness;
if (currentContainer == topbar) {
color = MENU_TITLE_COLOR;
padding = 2;
thickness = 1;
}
else {
color = TEXT_INVERTED_BGCOLOR;
padding = 4;
thickness = 2;
}
if (menuVerticalPosition == i) {
lcdDrawSolidRect(zone.x-4, zone.y-4, zone.w+8, zone.h+8, 2, TEXT_INVERTED_BGCOLOR);
lcdDrawSolidRect(zone.x-padding, zone.y-padding, zone.w+2*padding, zone.h+2*padding, thickness, color);
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
Widget * widget = currentScreen->getWidget(i);
if (widget) {
currentZone = menuVerticalPosition;
currentWidget = currentContainer->getWidget(menuVerticalPosition);
if (currentWidget) {
POPUP_MENU_ADD_ITEM(STR_SELECT_WIDGET);
if (widget->getFactory()->getOptions())
if (currentWidget->getFactory()->getOptions())
POPUP_MENU_ADD_ITEM(STR_WIDGET_SETTINGS);
POPUP_MENU_ADD_ITEM(STR_REMOVE_WIDGET);
popupMenuHandler = onZoneMenu;
@@ -221,15 +293,13 @@ bool menuSetupWidgets(evt_t event)
}
}
else {
lcdDrawRect(zone.x-4, zone.y-4, zone.w+8, zone.h+8, 2, 0x3F, TEXT_INVERTED_BGCOLOR);
lcdDrawRect(zone.x-padding, zone.y-padding, zone.w+2*padding, zone.h+2*padding, thickness, 0x3F, color);
}
}
navigate(event, currentScreen->getZonesCount(), currentScreen->getZonesCount(), 1);
navigate(event, currentContainer->getZonesCount(), currentContainer->getZonesCount(), 1);
return true;
}
extern int updateMainviewsMenu();
template <class T>
T * editThemeChoice(coord_t x, coord_t y, T * array[], uint8_t count, T * current, bool needsOffsetCheck, LcdFlags attr, evt_t event)
{
@@ -291,12 +361,19 @@ T * editThemeChoice(coord_t x, coord_t y, T * array[], uint8_t count, T * curren
return NULL;
}
enum menuScreensThemeItems {
ITEM_SCREEN_SETUP_THEME,
ITEM_SCREEN_SETUP_THEME_SETTINGS = ITEM_SCREEN_SETUP_THEME+2,
ITEM_SCREEN_SETUP_TOPBAR,
ITEM_SCREEN_SETUP_MAX
};
bool menuScreensTheme(evt_t event)
{
bool needsOffsetCheck = (menuVerticalPosition != 0 || menuHorizontalPosition < 0);
menuPageCount = updateMainviewsMenu();
MENU_WITH_OPTIONS("User interface", LBM_MAINVIEWS_ICONS, menuTabMainviews, menuPageCount, 0, 1, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredThemes-1)), ORPHAN_ROW, 0, 0, 0, 0 });
MENU_WITH_OPTIONS("User interface", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, 0, ITEM_SCREEN_SETUP_MAX, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredThemes-1)), ORPHAN_ROW, 0, 0, 0, 0 });
for (int i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_CONTENT_TOP + i * FH;
@@ -304,10 +381,11 @@ bool menuScreensTheme(evt_t event)
LcdFlags blink = ((s_editMode > 0) ? BLINK | INVERS : INVERS);
LcdFlags attr = (menuVerticalPosition == k ? blink : 0);
switch (k) {
case 0: {
case ITEM_SCREEN_SETUP_THEME: {
lcdDrawText(MENUS_MARGIN_LEFT, y + FH / 2, "Theme");
const Theme * new_theme = editThemeChoice<const Theme>(SCREENS_SETUP_2ND_COLUMN, y, registeredThemes, countRegisteredThemes, theme, needsOffsetCheck, attr, event);
if (new_theme) {
new_theme->init();
loadTheme(new_theme);
strncpy(g_eeGeneral.themeName, new_theme->getName(), sizeof(g_eeGeneral.themeName));
storageDirty(EE_GENERAL);
@@ -315,34 +393,56 @@ bool menuScreensTheme(evt_t event)
break;
}
case 1:
case ITEM_SCREEN_SETUP_THEME_SETTINGS:
drawButton(SCREENS_SETUP_2ND_COLUMN, y, "Theme settings", attr);
if (attr && event == EVT_KEY_BREAK(KEY_ENTER) && theme->getOptions()) {
s_editMode = 0;
pushMenu(menuThemeSettings);
}
break;
case ITEM_SCREEN_SETUP_TOPBAR:
lcdDrawText(MENUS_MARGIN_LEFT, y, "Top bar");
drawButton(SCREENS_SETUP_2ND_COLUMN, y, "Setup", attr);
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
currentScreen = customScreens[0];
currentContainer = topbar;
pushMenu(menuWidgetsSetup);
}
break;
}
}
return true;
}
bool menuScreenAdd(evt_t event);
void onScreenSetupMenu(const char * result);
enum menuScreenSetup {
ITEM_SCREEN_SETUP_LAYOUT,
ITEM_SCREEN_SETUP_WIDGETS_SETUP = ITEM_SCREEN_SETUP_LAYOUT+2,
ITEM_SCREEN_SETUP_LAYOUT_OPTION1,
};
template <int T>
bool menuScreenSetup(evt_t event)
bool menuScreenSetup(int index, evt_t event)
{
currentScreen = customScreens[T];
if (customScreens[index] == NULL) {
return menuScreenAdd(event);
}
currentScreen = customScreens[index];
currentContainer = currentScreen;
bool needsOffsetCheck = (menuVerticalPosition != 0 || menuHorizontalPosition < 0);
linesCount = 3;
linesCount = ITEM_SCREEN_SETUP_LAYOUT_OPTION1;
const ZoneOption * options = currentScreen->getFactory()->getOptions();
for (const ZoneOption * option = options; option->name; option++) {
linesCount++;
}
char title[] = "Main view X";
title[sizeof(title)-2] = '1' + T;
title[sizeof(title)-2] = '1' + index;
menuPageCount = updateMainviewsMenu();
MENU_WITH_OPTIONS(title, LBM_MAINVIEWS_ICONS, menuTabMainviews, menuPageCount, T+1, linesCount, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 });
MENU_WITH_OPTIONS(title, LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, index+1, linesCount, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 });
for (int i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_CONTENT_TOP + i * FH;
@@ -350,46 +450,43 @@ bool menuScreenSetup(evt_t event)
LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
LcdFlags attr = (menuVerticalPosition == k ? blink : 0);
switch(k) {
case 0:
case ITEM_SCREEN_SETUP_LAYOUT:
{
lcdDrawText(MENUS_MARGIN_LEFT, y + FH / 2, "Layout");
const LayoutFactory * factory = editThemeChoice<const LayoutFactory>(SCREENS_SETUP_2ND_COLUMN, y, registeredLayouts, countRegisteredLayouts, currentScreen->getFactory(), needsOffsetCheck, attr, event);
if (factory) {
delete customScreens[T];
customScreens[T] = factory->create(&g_model.screenData[T].layoutData);
strncpy(g_model.screenData[T].layoutName, factory->getName(), sizeof(g_model.screenData[T].layoutName));
delete customScreens[index];
customScreens[index] = factory->create(&g_model.screenData[index].layoutData);
strncpy(g_model.screenData[index].layoutName, factory->getName(), sizeof(g_model.screenData[index].layoutName));
storageDirty(EE_MODEL);
}
break;
}
case 1:
case ITEM_SCREEN_SETUP_LAYOUT+1:
break;
case 2:
case ITEM_SCREEN_SETUP_WIDGETS_SETUP:
drawButton(SCREENS_SETUP_2ND_COLUMN, y, "Setup widgets", attr);
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
pushMenu(menuSetupWidgets);
pushMenu(menuWidgetsSetup);
}
break;
default:
if (k < linesCount) {
uint8_t index = k - 3;
uint8_t index = k - ITEM_SCREEN_SETUP_LAYOUT_OPTION1;
const ZoneOption * option = &options[index];
ZoneOptionValue value = currentScreen->getOptionValue(index);
value = editZoneOption(y, option, value, attr, event);
if (attr) {
currentScreen->setOptionValue(index, value);
}
ZoneOptionValue * value = currentScreen->getOptionValue(index);
editZoneOption(y, option, value, attr, EE_MODEL, event);
}
break;
}
}
if (menuVerticalPosition == -1 && T > 0 && event == EVT_KEY_LONG(KEY_ENTER)) {
if (menuVerticalPosition == -1 && index > 0 && event == EVT_KEY_LONG(KEY_ENTER)) {
killEvents(KEY_ENTER);
menuHorizontalPosition = T;
menuHorizontalPosition = index;
POPUP_MENU_ADD_ITEM(STR_REMOVE_SCREEN);
popupMenuHandler = onScreenSetupMenu;
}
@@ -397,33 +494,29 @@ bool menuScreenSetup(evt_t event)
return true;
}
MenuHandlerFunc menuTabMainviews[1+MAX_CUSTOM_SCREENS] = {
menuScreensTheme,
menuScreenSetup<0>,
menuScreenSetup<1>,
menuScreenSetup<2>,
menuScreenSetup<3>,
menuScreenSetup<4>
};
template<int N>
bool menuCustomScreenSetup(evt_t event)
{
return menuScreenSetup(N, event);
}
const MenuHandlerFunc menuMainviews[MAX_CUSTOM_SCREENS] = {
menuScreenSetup<0>,
menuScreenSetup<1>,
menuScreenSetup<2>,
menuScreenSetup<3>,
menuScreenSetup<4>
const MenuHandlerFunc menuTabScreensSetup[1+MAX_CUSTOM_SCREENS] = {
menuScreensTheme,
menuCustomScreenSetup<0>,
menuCustomScreenSetup<1>,
menuCustomScreenSetup<2>,
menuCustomScreenSetup<3>,
menuCustomScreenSetup<4>
};
int updateMainviewsMenu()
{
for (int index=1; index<MAX_CUSTOM_SCREENS; index++) {
if (customScreens[index]) {
menuTabMainviews[1+index] = menuMainviews[index];
LBM_MAINVIEWS_ICONS[2+index] = LBM_MAINVIEWS_ITEM_OUT_ICON;
LBM_SCREENS_SETUP_ICONS[2+index] = LBM_MAINVIEWS_ICONS[index];
}
else {
menuTabMainviews[1+index] = menuScreenAdd;
LBM_MAINVIEWS_ICONS[2+index] = LBM_MAINVIEWS_ADD_ICON;
LBM_SCREENS_SETUP_ICONS[2+index] = LBM_MAINVIEWS_ADD_ICON;
return 2+index;
}
}
@@ -436,12 +529,11 @@ bool menuScreenAdd(evt_t event)
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
customScreens[menuPageCount-2] = registeredLayouts[0]->create(&g_model.screenData[menuPageCount-2].layoutData);
chainMenu(menuMainviews[menuPageCount-2]);
s_editMode = 0;
return false;
}
MENU_WITH_OPTIONS("Add main view", LBM_MAINVIEWS_ICONS, menuTabMainviews, menuPageCount, menuPageCount-1, 0, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 });
SIMPLE_MENU_WITH_OPTIONS("Add main view", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, menuPageCount-1, 0);
return true;
}
@@ -455,6 +547,6 @@ void onScreenSetupMenu(const char * result)
}
memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData));
customScreens[MAX_CUSTOM_SCREENS-1] = NULL;
chainMenu(menuMainviews[menuHorizontalPosition > 0 ? menuHorizontalPosition-1 : 0]);
// chainMenu(menuMainviews[menuHorizontalPosition > 0 ? menuHorizontalPosition-1 : 0]);
}
}