summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/sudoku/sudoku.c10
-rw-r--r--apps/plugins/sudoku/sudoku.h12
2 files changed, 12 insertions, 10 deletions
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index da41a6986b..f8a438592d 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -1164,7 +1164,7 @@ enum {
SM_QUIT,
};
-bool sudoku_menu(struct sudoku_state_t* state)
+int sudoku_menu(struct sudoku_state_t* state)
{
int result;
@@ -1224,14 +1224,13 @@ bool sudoku_menu(struct sudoku_state_t* state)
case SM_QUIT:
save_sudoku(state);
- return true;
break;
default:
break;
}
- return (result==MENU_ATTACHED_USB);
+ return result;
}
/* Menu used when user is in edit mode - i.e. creating a new game manually */
@@ -1518,9 +1517,12 @@ enum plugin_status plugin_start(const void* parameter)
exit = true;
}
} else {
- if (sudoku_menu(&state)) {
+ res = sudoku_menu(&state);
+ if (res == MENU_ATTACHED_USB) {
rc = PLUGIN_USB_CONNECTED;
exit = true;
+ } else if (res == SM_QUIT) {
+ exit = true;
}
}
}
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index 54e04f12b2..75ceb1d3f2 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -135,13 +135,13 @@
#define SUDOKU_BUTTON_POSSIBLE BUTTON_REC
#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
-#define SUDOKU_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT)
-#define SUDOKU_BUTTON_UP BUTTON_UP
-#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
-#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
-#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
+#define SUDOKU_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT)
+#define SUDOKU_BUTTON_UP BUTTON_UP
+#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
+#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
+#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
#define SUDOKU_BUTTON_TOGGLEBACK BUTTON_SCROLL_BACK
-#define SUDOKU_BUTTON_TOGGLE BUTTON_SCROLL_FWD
+#define SUDOKU_BUTTON_TOGGLE BUTTON_SCROLL_FWD
#define SUDOKU_BUTTON_MENU (BUTTON_HOME | BUTTON_REL)
#define SUDOKU_BUTTON_POSSIBLE (BUTTON_SELECT | BUTTON_UP)