]> Chaos Git - corbenik/corbenik.git/commitdiff
Clean up obsoleted code in menu.c
authorchaoskagami <chaos.kagami@gmail.com>
Tue, 14 Jun 2016 04:22:24 +0000 (00:22 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Tue, 14 Jun 2016 04:22:24 +0000 (00:22 -0400)
source/menu.c
source/std/abort.h

index b818e9bbe289a5a3f6b13dd6d1ce994596dc6ea4..6bb11e3d063574c7637c1b439d955b94ab420b50 100644 (file)
@@ -2,16 +2,6 @@
 #include "firm/firm.h"
 #include "firm/headers.h"
 
-#define MENU_MAIN    1
-#define MENU_OPTIONS 2
-#define MENU_PATCHES 3
-#define MENU_INFO    4
-#define MENU_HELP    5
-#define MENU_RESET   6
-#define MENU_POWER   7
-#define MENU_SAVECFG 8
-#define MENU_BOOTME  9
-
 #define MAX_PATCHES ((FCRAM_SPACING / 2) / sizeof(struct options_s))
 struct options_s *patches = (struct options_s *)FCRAM_MENU_LOC;
 uint8_t *enable_list = (uint8_t *)FCRAM_PATCHLIST_LOC;
@@ -191,23 +181,19 @@ list_patches_build(char *name, int desc_is_fname)
 
 int show_menu(struct options_s *options, uint8_t *toggles);
 
-int
+void
 menu_patches()
 {
     show_menu(patches, enable_list);
-
-    return MENU_MAIN;
 }
 
-int
+void
 menu_options()
 {
     show_menu(options, config.options);
-
-    return MENU_MAIN;
 }
 
-int
+void
 menu_info()
 {
     // This menu requres firm to be loaded. Unfortunately.
@@ -234,11 +220,9 @@ menu_info()
 
     need_redraw = 1;
     clear_screen(TOP_SCREEN);
-
-    return MENU_MAIN;
 }
 
-int
+void
 menu_help()
 {
     clear_screen(TOP_SCREEN);
@@ -268,12 +252,10 @@ menu_help()
 
     need_redraw = 1;
     clear_screen(TOP_SCREEN);
-
-    return MENU_MAIN;
 }
 
-int
-menu_reset()
+void
+reset()
 {
     fumount(); // Unmount SD.
 
@@ -284,8 +266,8 @@ menu_reset()
         ;
 }
 
-int
-menu_poweroff()
+void
+poweroff()
 {
     fumount(); // Unmount SD.
 
@@ -296,38 +278,23 @@ menu_poweroff()
         ;
 }
 
-int menu_saveconfig() {
-    save_config(); // Save config, including the reconfigured flag.
-
-       return MENU_MAIN;
-}
-
 static struct options_s main_s[] = {
     // space
-    { 0, "Options",            "", call_fun, (uint32_t)menu_options,    0 },
-    { 0, "Patches",            "", call_fun, (uint32_t)menu_patches,    0 },
-    { 0, "Info",               "", call_fun, (uint32_t)menu_info,       0 },
-    { 0, "Help/Readme",        "", call_fun, (uint32_t)menu_help,       0 },
-    { 0, "Reboot",             "", call_fun, (uint32_t)menu_reset,      0 },
-    { 0, "Power off",          "", call_fun, (uint32_t)menu_poweroff,   0 },
-    { 0, "Save Configuration", "", call_fun, (uint32_t)menu_saveconfig, 0 },
+    { 0, "Options",            "", call_fun, (uint32_t)menu_options, 0 },
+    { 0, "Patches",            "", call_fun, (uint32_t)menu_patches, 0 },
+    { 0, "Info",               "", call_fun, (uint32_t)menu_info,    0 },
+    { 0, "Help/Readme",        "", call_fun, (uint32_t)menu_help,    0 },
+    { 0, "Reboot",             "", call_fun, (uint32_t)reset,        0 },
+    { 0, "Power off",          "", call_fun, (uint32_t)poweroff,     0 },
+    { 0, "Save Configuration", "", call_fun, (uint32_t)save_config,  0 },
     { 0, "Boot Firmware",      "", break_menu, 0, 0 },
 
     // Sentinel.
     { -1, "", "", 0, -1, -1 }, // cursor_min and cursor_max are stored in the last two.
 };
 
-int
-menu_main()
-{
-    // TODO - Stop using different menu code here.
-    show_menu(main_s, NULL);
-
-    return 0;
-}
-
-int
+void
 menu_handler()
 {
-    return menu_main();
+    show_menu(main_s, NULL);
 }
index 14cce9c3c87fa345a40e2c3b44b975e7b8999b64..ff8919e5778dc376d6af4a2c354f8b233f4bfc4c 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "draw.h"
 
-int menu_poweroff();
+void poweroff();
 uint32_t wait_key();
 
 #define abort(x...)                                                                                                                                            \
@@ -12,7 +12,7 @@ uint32_t wait_key();
         wait_key();                                                                                                                                            \
         clear_disp(stderr);                                                                                                                                    \
         set_cursor(stderr, 0, 0);                                                                                                                              \
-        menu_poweroff();                                                                                                                                       \
+        poweroff();                                                                                                                                            \
     }
 
 #endif