static void button_event_handler(uint8_t pin_no, uint8_t button_action) { uint32_t err_code; switch (pin_no) { case LEDBUTTON_BUTTON_PIN: switch (button_action) { case APP_BUTTON_PUSH: // Do your task break; case APP_BUTTON_RELEASE: // Do your task break; default: break; } break; default: APP_ERROR_HANDLER(pin_no); break; } }