This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

AN36 Button handling warning

I'm sorry if I'm missing something... AN36 p.29 has a code snippet:

static app_button_cfg_t buttons[] = {
    {WAKEUP_BUTTON_PIN, false, NRF_GPIO_PIN_PULLUP, NULL},
    {LEDBUTTON_BUTTON_PIN_NO, false, NRF_GPIO_PIN_PULLUP, button_event_handler},
};

app_button_cfg_t is defined in app_button.h as:

typedef struct {
    uint8_t              pin_no;
    bool                 active_high;
    nrf_gpio_pin_pull_t  pull_cfg;
    app_button_handler_t button_handler;                       
} app_button_cfg_t;

app_button_handler_t is defined at the same place as:

typedef void (*app_button_handler_t)(uint8_t pin_no);

AN36 p.30 defines button_event_handler from p.29 as:

static void button_event_handler(uint8_t pin_no, uint8_t button action);

And as a result there is a type mismatch warning.

What am I missing?

Thank you.

Parents Reply Children
Related