in ev3-api/src/ev3api_brick.c [107:116]
void ev3_button_set_on_clicked(button_t button, ISR handler, intptr_t exinf) {
if(button < 0 || button >= TNUM_BUTTON) {
API_ERROR("Invalid button.");
return;
}
// TODO: protect button_exinfs & button_handlers when accessed concurrently (lock ?)
button_exinfs[button] = exinf;
button_handlers[button] = handler;
set_event_handler(usr_evt_hdr); // Do once
}