Hi there!
Okay, we're back again... I'm using ARMGCC in combination with Make, nRF5 SDK, nRF SDK for Mesh, FreeRTOS and C++. This time I wanted to use the APP_BUTTON library to get notified when a pin changes value. This works fine. The problem, however, is that it doesn't work when compiled with Mesh.
So, to be more clear; the APP_BUTTON library works fine in combination with FreeRTOS and the app_timer_freertos.c but doesn't work at all when the app_timer_freertos.c is replaced with app_timer_mesh.c. App_button.init then returns ERROR 8 [NRF_ERROR_INVALID_STATE]. I can't figure out how to resolve it... The code underneath results in the error.
void battery_c::gpiote_init(){
APP_ERROR_CHECK(nrf_drv_gpiote_init());
app_button_cfg_t charge_pin_config;
charge_pin_config.pin_no = CHARGE_PIN;
charge_pin_config.active_state = APP_BUTTON_ACTIVE_LOW;
charge_pin_config.pull_cfg = NRF_GPIO_PIN_PULLUP;
charge_pin_config.button_handler = pin_event_handler;
app_button_cfg_t standby_pin_config;
standby_pin_config.pin_no = STANDBY_PIN;
standby_pin_config.active_state = APP_BUTTON_ACTIVE_LOW;
standby_pin_config.pull_cfg = NRF_GPIO_PIN_PULLUP;
standby_pin_config.button_handler = pin_event_handler;
static app_button_cfg_t pin_configs[] = {charge_pin_config, standby_pin_config};
APP_ERROR_CHECK(app_button_init(pin_configs, 2, 500));
APP_ERROR_CHECK(app_button_enable());
}
The question boils down to the following; is it possible to use the APP_BUTTON library while the Mesh SDK is running? If so; how? Thanks in advance!
Kind regards,
Jochem