From d6814c7408b23db8a441f731b44d4b638df24c64 Mon Sep 17 00:00:00 2001 From: hackbard Date: Fri, 7 Sep 2007 19:43:30 +0200 Subject: [PATCH] example for the button api --- betty/betty.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) 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<