X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/b12224bdcee4781c77d3e8540b50a27b9b4022f5..6e1f414fe8b4997ed96e5af5d31b066bfcd7c11b:/badge/ui/event.c diff --git a/badge/ui/event.c b/badge/ui/event.c index 779398f..157c8c9 100644 --- a/badge/ui/event.c +++ b/badge/ui/event.c @@ -29,6 +29,13 @@ uint8_t badge_input_raw(void) { if (gpioGetValue(RB_BTN1) == 0) { result |= BADGE_EVENT_KEY_LEFT ; } if (gpioGetValue(RB_HB0 ) == 0) { result |= BADGE_EVENT_KEY_BTN_A ; } if (gpioGetValue(RB_HB1 ) == 0) { result |= BADGE_EVENT_KEY_BTN_B ; } +#elif defined(HOB_REV2) + if (gpioGetValue(HOB_PORT(HOB_BTN_UP ), HOB_PIN(HOB_BTN_UP )) == 0) { result |= BADGE_EVENT_KEY_UP ; } + if (gpioGetValue(HOB_PORT(HOB_BTN_DOWN ), HOB_PIN(HOB_BTN_DOWN )) == 0) { result |= BADGE_EVENT_KEY_DOWN ; } + if (gpioGetValue(HOB_PORT(HOB_BTN_LEFT ), HOB_PIN(HOB_BTN_LEFT )) == 0) { result |= BADGE_EVENT_KEY_LEFT ; } + if (gpioGetValue(HOB_PORT(HOB_BTN_RIGHT ), HOB_PIN(HOB_BTN_RIGHT )) == 0) { result |= BADGE_EVENT_KEY_RIGHT ; } + if (gpioGetValue(HOB_PORT(HOB_BTN_A ), HOB_PIN(HOB_BTN_A )) == 0) { result |= BADGE_EVENT_KEY_BTN_A ; } + if (gpioGetValue(HOB_PORT(HOB_BTN_B ), HOB_PIN(HOB_BTN_B )) == 0) { result |= BADGE_EVENT_KEY_BTN_B ; } #else if (gpioGetValue(HOB_PORT(HOB_BTN_UP ), HOB_PIN(HOB_BTN_UP )) == 1) { result |= BADGE_EVENT_KEY_UP ; } if (gpioGetValue(HOB_PORT(HOB_BTN_DOWN ), HOB_PIN(HOB_BTN_DOWN )) == 1) { result |= BADGE_EVENT_KEY_DOWN ; } @@ -81,3 +88,7 @@ void badge_event_start(void) { timer32SetIntHandler(badge_event_irq); timer32Enable(0); } + +void badge_event_stop (void) { + timer32Disable(0); +}