1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00
This commit is contained in:
jflyper 2017-04-07 18:04:56 +09:00
parent f15d5dd12c
commit b10412ac9b
2 changed files with 18 additions and 18 deletions

View file

@ -500,8 +500,9 @@ long cmsMenuChange(displayPort_t *pDisplay, const void *ptr)
{ {
CMS_Menu *pMenu = (CMS_Menu *)ptr; CMS_Menu *pMenu = (CMS_Menu *)ptr;
if (!pMenu) if (!pMenu) {
return 0; return 0;
}
#ifdef CMS_MENU_DEBUG #ifdef CMS_MENU_DEBUG
if (pMenu->GUARD_type != OME_MENU) { if (pMenu->GUARD_type != OME_MENU) {
@ -547,11 +548,13 @@ STATIC_UNIT_TESTED long cmsMenuBack(displayPort_t *pDisplay)
{ {
// Let onExit function decide whether to allow exit or not. // Let onExit function decide whether to allow exit or not.
if (currentCtx.menu->onExit && currentCtx.menu->onExit(pageTop + currentCtx.cursorRow) < 0) if (currentCtx.menu->onExit && currentCtx.menu->onExit(pageTop + currentCtx.cursorRow) < 0) {
return -1; return -1;
}
if (!menuStackIdx) if (!menuStackIdx) {
return 0; return 0;
}
currentCtx = menuStack[--menuStackIdx]; currentCtx = menuStack[--menuStackIdx];
@ -609,39 +612,39 @@ long cmsMenuExit(displayPort_t *pDisplay, const void *ptr)
switch (exitType) { switch (exitType) {
case CMS_EXIT_SAVE: case CMS_EXIT_SAVE:
case CMS_EXIT_SAVEREBOOT: case CMS_EXIT_SAVEREBOOT:
cmsTraverseGlobalExit(&menuMain); cmsTraverseGlobalExit(&menuMain);
if (currentCtx.menu->onExit) if (currentCtx.menu->onExit)
currentCtx.menu->onExit((OSD_Entry *)NULL); // Forced exit currentCtx.menu->onExit((OSD_Entry *)NULL); // Forced exit
saveConfigAndNotify(); saveConfigAndNotify();
break; break;
case CMS_EXIT: case CMS_EXIT:
break; break;
} }
cmsInMenu = false; cmsInMenu = false;
displayRelease(pDisplay); displayRelease(pDisplay);
currentCtx.menu = NULL; currentCtx.menu = NULL;
if (exitType == CMS_EXIT_SAVEREBOOT) { if (exitType == CMS_EXIT_SAVEREBOOT) {
displayClearScreen(pDisplay); displayClearScreen(pDisplay);
displayWrite(pDisplay, 5, 3, "REBOOTING..."); displayWrite(pDisplay, 5, 3, "REBOOTING...");
displayResync(pDisplay); // Was max7456RefreshAll(); why at this timing? displayResync(pDisplay); // Was max7456RefreshAll(); why at this timing?
stopMotors(); stopMotors();
stopPwmAllMotors(); stopPwmAllMotors();
delay(200); delay(200);
systemReset(); systemReset();
} }
ENABLE_ARMING_FLAG(OK_TO_ARM); ENABLE_ARMING_FLAG(OK_TO_ARM);
return 0; return 0;
} }

View file

@ -161,9 +161,6 @@
#define USE_ESCSERIAL #define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
//#define USE_I2C
//#define I2C_DEVICE (I2CDEV_2)
#define USE_SPI #define USE_SPI
#define USE_SPI_DEVICE_1 #define USE_SPI_DEVICE_1