The unified diff between revisions [1dfe3b7e..] and [a39fe798..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'main.c'
# # old_revision [1dfe3b7eee76f3c8aea3b33932857682ee17701c] # new_revision [a39fe7980c8f14b70401f4c97f3e10232dce016a] # # patch "main.c" # from [cc6bdc935c17a517544beb8e177fc1093fff5249] # to [38594d91649f88377c87a52973d831d9ffeafb70] # ============================================================ --- main.c cc6bdc935c17a517544beb8e177fc1093fff5249 +++ main.c 38594d91649f88377c87a52973d831d9ffeafb70 @@ -159,20 +159,35 @@ void average_sample(void) putstr(")\r\n"); } -int main(void) { - int i; +void menu_handler(void); +int main(void) { init_interrupt(); init_uart(); init_i2c(); init_pins(); init_timer(); + + event_register(EVENT_UART_INPUT, menu_handler); + putstr("Your entire life has been a mathematical error... a mathematical error I'm about to correct!\r\n"); + putstr("prompt> "); + while (1) { - char c; - putstr("prompt> "); - c = getch(); + FP0XVAL ^= 0x04000000; + event_dispatch(); + } + + return 0; +} + +void menu_handler(void) +{ + int i; + char c; + + while (getch(&c)) { if (c == 0x0a) continue; putch(c); @@ -264,7 +279,6 @@ int main(void) { reply("Unrecognised command."); break; } + putstr("prompt> "); } - - return 0; }