I was working today when I came across the following function:
void button_scheduler_event_handler(void *p_event_data, uint16_t event_size)
{
button_handler(*((nrf_drv_gpiote_pin_t*)p_event_data));
}
with button handler defined as the following:
void button_handler(nrf_drv_gpiote_pin_t pin)
I'm not sure Í have encountered this syntax:
button_handler(*((nrf_drv_gpiote_pin_t*)p_event_data));
before and I am a bit bewildered. My first thought is that the syntax for calling button_handler should be:
button_handler(((*nrf_drv_gpiote_pin_t) *p_event_data));
I do however not have any good explanation for why.
Can anyone explain this?
Edit: after input from user UnholySheep