|
|
|
@ -159,21 +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"); |
|
|
|
|
|
|
|
|
|
while (1) { |
|
|
|
|
char c; |
|
|
|
|
putstr("prompt> "); |
|
|
|
|
while (!getch(&c)) |
|
|
|
|
|
|
|
|
|
while (1) { |
|
|
|
|
FP0XVAL ^= 0x04000000; |
|
|
|
|
event_dispatch(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void menu_handler(void) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
char c; |
|
|
|
|
|
|
|
|
|
while (getch(&c)) { |
|
|
|
|
if (c == 0x0a) |
|
|
|
|
continue; |
|
|
|
|
putch(c); |
|
|
|
@ -265,7 +279,6 @@ int main(void) {
|
|
|
|
|
reply("Unrecognised command."); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
putstr("prompt> "); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|