X-Git-Url: http://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/c8028bb0e1137541373f46638370b96f02924e32..6e1f414fe8b4997ed96e5af5d31b066bfcd7c11b:/badge/main.c diff --git a/badge/main.c b/badge/main.c index 466ae3e..546c585 100644 --- a/badge/main.c +++ b/badge/main.c @@ -53,6 +53,7 @@ #include "core/cmd/cmd.h" #endif +#include "fahrplan.h" #include "init.h" #include "ui/browser.h" #include "ui/display.h" @@ -190,7 +191,6 @@ static void usbmode(void) { badge_event_stop(); badge_framebuffer fb = { { { 0 } } }; - badge_framebuffer_render_text(&fb, 23, 30, "USB-Modus"); /* badge_framebuffer_render_number(&fb, 23, 50, sizeof(jumpnrun_tile)); @@ -198,31 +198,26 @@ static void usbmode(void) { badge_framebuffer_render_number(&fb, 48, 50, sizeof(jumpnrun_enemy)); */ badge_framebuffer_flush(&fb); + usbMSCInit(); - for(;;); -} -static void fahrplan(void) { - f_chdir("/fahrplan"); - badge_browse_textfiles("fahrplan.lst"); + for(;;) { + pmuSleep(); + } } uint8_t main_menu_show(uint8_t selected) { - char const menu_buf[][15] = { + // first_visible = 0, weil das Menü so kurz ist. Sollte es + // größer werden: Parameter aus main_menu empfangen und merken. + size_t first_visible = 0; + char const *const menu[] = { "Vanity-Screen", "Super Hackio", "Fahrplan", "USB-Modus" }; - char const *menu[ARRAY_SIZE(menu_buf)]; - for(uint8_t i = 0; i < ARRAY_SIZE(menu_buf); ++i) { - menu[i] = menu_buf[i]; - } - f_chdir("/"); - // first_visible = 0, weil Menü so kurz. Ggf. Parameter aus main_menu empfangen und merken. - size_t first_visible = 0; return (uint8_t) badge_menu(menu, ARRAY_SIZE(menu), &first_visible, selected); } @@ -234,7 +229,7 @@ void main_menu(void) { switch(selected) { case 0: badge_vanity_show(); break; case 1: jumpnrun_play (); break; - case 2: fahrplan (); break; + case 2: badge_fahrplan (); break; case 3: usbmode (); break; } } @@ -245,7 +240,7 @@ int main(void) cpuInit(); systickInit(CFG_SYSTICK_DELAY_IN_MS); - // pmuInit(); + pmuInit(); // adcInit(); #ifdef R0KET rbInit();