pentabug/firmware/apps/tonictest.c

32 lines
444 B
C
Raw Normal View History

2013-08-30 18:54:23 +02:00
#include <pentabug/app.h>
#include <pentabug/pentatonic.h>
2013-08-30 19:25:42 +02:00
#include <pentabug/hal.h>
2013-08-30 18:54:23 +02:00
static void init(void) {
2013-08-30 19:25:42 +02:00
pentatonic_direction(ALL_IN);
2013-08-30 18:54:23 +02:00
}
static void run(void) {
2013-08-30 19:25:42 +02:00
pentatonic_direction(ALL_IN);
2013-08-30 18:54:23 +02:00
2013-08-30 19:25:42 +02:00
for(;;) {
uint8_t buttons = pentatonic_buttons();
2013-08-30 18:54:23 +02:00
2013-08-30 19:25:42 +02:00
if(buttons) {
pentatonic_direction(ALL_OUT);
2013-08-30 18:54:23 +02:00
2013-08-30 19:25:42 +02:00
pentatonic_all_led_set(buttons);
2013-08-30 18:54:23 +02:00
2013-08-30 19:25:42 +02:00
led_inv(RIGHT);
wait_ms(1000);
break;
}
wait_ms(1);
2013-08-30 18:54:23 +02:00
}
}
REGISTER(run, init, NULL);