Hi,
after receiving button event application crashes. I get NRF_ERROR_NOT_FOUND from app_sched_event_get and device stop responding.
What can be the reason?
Thanks! Patriko
Buttons init:
static app_button_cfg_t buttons[] =
{
{SHUTTER_UP_BUTTON, true, NRF_GPIO_PIN_PULLUP, button_event_handler},
{SHUTTER_DOWN_BUTTON, true, NRF_GPIO_PIN_PULLUP, button_event_handler}
};
APP_BUTTON_INIT(buttons, sizeof(buttons) / sizeof(buttons[0]),
BUTTON_DETECTION_DELAY, true);
app_button_enable();
event handler:
static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
uint32_t err_code;
shutter.desiredState = SHUTTER_STATE_STOP;
switch(pin_no)
{
case SHUTTER_UP_BUTTON:
shutter.desiredState = SHUTTER_STATE_MOVE_UP;
break;
case SHUTTER_DOWN_BUTTON:
shutter.desiredState = SHUTTER_STATE_MOVE_DOWN;
break;
default:
// APP_ERROR_HANDLER(pin_no);
break;
}
check_and_change_shutter_state(&shutter);
}