]> www.average.org Git - pulsecounter.git/blobdiff - Hal/Hal.c
pass handler id to userspace
[pulsecounter.git] / Hal / Hal.c
index b4944e2c79090a97dcba17ea049e04377d85a231..f7b801c4aed7174759f08fc616f26a4ade4f54d9 100644 (file)
--- a/Hal/Hal.c
+++ b/Hal/Hal.c
@@ -97,7 +97,7 @@
 static void buttonHandler(uint8_t id);
 static void postEvent(uint8_t handlerId);
 
 static void buttonHandler(uint8_t id);
 static void postEvent(uint8_t handlerId);
 
-static void (*appButtonHandler)(void);
+static Hal_Handler appButtonHandler;
 static volatile uint16_t handlerEvents = 0;
 static uint16_t clockTick = 0;
 static Hal_Handler handlerTab[NUM_HANDLERS];
 static volatile uint16_t handlerEvents = 0;
 static uint16_t clockTick = 0;
 static Hal_Handler handlerTab[NUM_HANDLERS];
@@ -105,7 +105,7 @@ static Hal_Handler handlerTab[NUM_HANDLERS];
 
 /* -------- APP-HAL INTERFACE -------- */
 
 
 /* -------- APP-HAL INTERFACE -------- */
 
-void Hal_buttonEnable(void (*handler)(void)) {
+void Hal_buttonEnable(Hal_Handler handler) {
     handlerTab[BUTTON_HANDLER_ID] = buttonHandler;
     appButtonHandler = handler;
     BUTTON_CONFIG();
     handlerTab[BUTTON_HANDLER_ID] = buttonHandler;
     appButtonHandler = handler;
     BUTTON_CONFIG();
@@ -331,7 +331,7 @@ void Em_Hal_watchOn(void) {
 static void buttonHandler(uint8_t id) {
     Hal_delay(BUTTON_DEBOUNCE_MSECS);
     if (BUTTON_PRESSED() && appButtonHandler) {
 static void buttonHandler(uint8_t id) {
     Hal_delay(BUTTON_DEBOUNCE_MSECS);
     if (BUTTON_PRESSED() && appButtonHandler) {
-        appButtonHandler();
+        appButtonHandler(id);
     }
     BUTTON_ENABLE();
 }
     }
     BUTTON_ENABLE();
 }