summaryrefslogtreecommitdiffstats
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 9bbbfaec99..f7e179b040 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -126,6 +126,10 @@
#include "bootdata.h"
#endif
+#ifdef FIIO_M3K
+#include "installer.h"
+#endif
+
static const char* threads_getname(int selected_item, void *data,
char *buffer, size_t buffer_len)
{
@@ -2491,6 +2495,52 @@ static bool dbg_boot_data(void)
}
#endif /* defined(HAVE_BOOTDATA) && !defined(SIMULATOR) */
+#ifdef FIIO_M3K
+/* Note: this is temporary and should NOT be merged, ensure it is removed */
+static int fiio_debug_menu_action_callback(int action, struct gui_synclist *lists)
+{
+ if(action == ACTION_REDRAW) {
+ simplelist_set_line_count(0);
+ simplelist_addline("Back to menu");
+ simplelist_addline("Install bootloader");
+ simplelist_addline("Dump bootloader");
+ action = ACTION_REDRAW;
+ }
+
+ if(action == ACTION_STD_OK) {
+ int sel = gui_synclist_get_sel_pos(lists);
+ int rc = 0;
+ switch(sel) {
+ case 1:
+ rc = install_bootloader("/boot.install");
+ break;
+ case 2:
+ rc = dump_bootloader("/boot.dump");
+ break;
+ default:
+ break;
+ }
+
+ if(sel == 1 || sel == 2) {
+ const char* msg = installer_strerror(rc);
+ splashf(3*HZ, "(%d) %s", rc, msg);
+ }
+
+ action = ACTION_STD_CANCEL;
+ }
+
+ return action;
+}
+
+static bool dbg_fiio_menu(void)
+{
+ struct simplelist_info info;
+ simplelist_info_init(&info, "FiiO debug menu", 3, NULL);
+ info.action_callback = fiio_debug_menu_action_callback;
+ return simplelist_show_list(&info);
+}
+#endif
+
/****** The menu *********/
static const struct {
unsigned char *desc; /* string or ID */
@@ -2598,6 +2648,9 @@ static const struct {
#if defined(HAVE_BOOTDATA) && !defined(SIMULATOR)
{"Boot data", dbg_boot_data },
#endif
+#ifdef FIIO_M3K
+ {"FiiO debug menu", dbg_fiio_menu},
+#endif
};
static int menu_action_callback(int btn, struct gui_synclist *lists)