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];
/* -------- APP-HAL INTERFACE -------- */
-void Hal_buttonEnable(void (*handler)(void)) {
+void Hal_buttonEnable(Hal_Handler handler) {
handlerTab[BUTTON_HANDLER_ID] = buttonHandler;
appButtonHandler = handler;
BUTTON_CONFIG();
static void buttonHandler(uint8_t id) {
Hal_delay(BUTTON_DEBOUNCE_MSECS);
if (BUTTON_PRESSED() && appButtonHandler) {
- appButtonHandler();
+ appButtonHandler(id);
}
BUTTON_ENABLE();
}
* BUTTON interrupt enabled
*
**/
-extern void Hal_buttonEnable(void (*handler)(void));
+extern void Hal_buttonEnable(Hal_Handler handler);
/**
* --------- Hal_connected ---------
*
#include "Pulsecounter.h"
#include "Hal.h"
-static void buttonHandler(void);
+static void buttonHandler(uint8_t id);
static void tickHandler(void);
static bool connected = false;
static int32_t base4 = 0;
Hal_idleLoop();
}
-static void buttonHandler(void) {
+static void buttonHandler(uint8_t id) {
uint8_t i;
cold = !cold;