From: hackbard Date: Fri, 7 Sep 2007 17:43:30 +0000 (+0200) Subject: example for the button api X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6814c7408b23db8a441f731b44d4b638df24c64;p=my-code%2Farm.git example for the button api --- diff --git a/betty/betty.c b/betty/betty.c index af593d8..3b19542 100644 --- a/betty/betty.c +++ b/betty/betty.c @@ -255,9 +255,8 @@ void bl_off(void) { 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(); @@ -265,23 +264,21 @@ int main() { 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<