Use the timer to kick off WMP readings regularly.
This commit is contained in:
11
main.c
11
main.c
@@ -159,6 +159,11 @@ void average_sample(void)
|
||||
putstr(")\r\n");
|
||||
}
|
||||
|
||||
void timer_event_handler(void)
|
||||
{
|
||||
wmp_start_sample();
|
||||
}
|
||||
|
||||
void menu_handler(void);
|
||||
|
||||
int main(void) {
|
||||
@@ -170,6 +175,10 @@ int main(void) {
|
||||
|
||||
event_register(EVENT_UART_INPUT, menu_handler);
|
||||
|
||||
event_register(EVENT_I2C_COMPLETE, wmp_event_handler);
|
||||
|
||||
event_register(EVENT_TIMER, timer_event_handler);
|
||||
|
||||
putstr("Your entire life has been a mathematical error... a mathematical error I'm about to correct!\r\n");
|
||||
|
||||
putstr("prompt> ");
|
||||
@@ -268,7 +277,7 @@ void menu_handler(void)
|
||||
break;
|
||||
case 'P':
|
||||
putstr("Initialising timer... ");
|
||||
timer_set_period(10000*TIMER_MS);
|
||||
timer_set_period(10*TIMER_MS);
|
||||
reply("done");
|
||||
break;
|
||||
case 'E':
|
||||
|
||||
Reference in New Issue
Block a user