int main() {
- char buf[]="betty - live from the flash at 0x80000000! ;)\r\n";
- u64 keys;
- u8 i;
+ char buf[]="betty - live from flash at 0x80000000! ;)\r\n";
+ t_button button;
pll_init();
uart0_init();
pin_select_init();
init_lcd(0);
bl_init();
- button_init();
+ button_init(&button);
+ button_set_retries(&button,100);
pause(0xffffff);
bl_toggle();
while(1) {
- uart0_send_string("\n");
- //uart0_send_string(buf);
- //bl_toggle();
pause(0x0fffff);
- button_get_event(&keys,1000);
- for(i=0;i<42;i++) {
- //if(keys&(1<<i)) {
- // uart0_send_byte(0x30+i);
- // break;
- uart0_send_byte(keys&(1<<i)?0x31:0x30);
+
+ /* button test! */
+ if(button_get_event(&button)) {
+ uart0_send_string(buf);
+ if(button.key[0]==BUTTON_POWER)
+ bl_toggle();
}
}