Hi I using nrf51DK using keil MDK 5 softdevice s110.
I need to update battery level on every 60s and I have initialize timer and start with this code.
static void battery_level_meas_timeout_handler(void * p_context)
{
UNUSED_PARAMETER(p_context);
battery_level_update();
}
/**@brief Start application timers.
*/
static void application_timers_start(void)
{
uint32_t err_code;
// Start application timers
err_code = app_timer_start(m_battery_timer_id, BATTERY_LEVEL_MEAS_INTERVAL, NULL);
APP_ERROR_CHECK(err_code);
}
/**@brief Timer initialization.
*
* @details Initializes the timer module. This creates and starts application timers.
*/
static void timers_init(void)
{
uint32_t err_code;
//initialize the low frequency cloc
//err_code = nrf_drv_clock_init(NULL);
//APP_ERROR_CHECK(err_code);
//nrf_drv_clock_lfclk_request();
// Initialize timer module
APP_TIMER_INIT(APP_TIMER_PRESCALER,APP_TIMER_OP_QUEUE_SIZE, false);
// Create timers
err_code = app_timer_create(&m_battery_timer_id,
APP_TIMER_MODE_REPEATED,
battery_level_meas_timeout_handler);
APP_ERROR_CHECK(err_code);
}
when I write time_init() and application_timer_start() on main my device doesn't advertise and when i remove this two function it's start advertise normally.
can you help me on this what is the problem in my timer function.
Thanks,
Sachin