I'm running SDK 15.3 with SD 132 and SES 4.30.
I am working with the ble_app_uart_c as the base code and adding other functions. I've gone through the app_timer tutorial and other blogs but can't get the timer to trigger the app_timer_handler function. I've attached a screenshot showing the system running with a break point set in the handler. It never triggers. I've enabled the RTC, RTC1 and RTC2 in sdk_config.
I am also integrating the saadc example code which uses a timer function (originally using timer 0 which I changed to timer 1 because of SD) and GPIOTE for the ADC function. Could this timer code be affecting the RTC function?
I've attached my code:
/***************************************************************************************** Set up timers for our general use ******************************************************************************************/ void perf_shwr_timer_handler(nrf_timer_event_t event_type, void* p_context) { perf_shwr_timer_counter++; printf("Perf_Shwr Timer Triggered!"); perfect_shower_main(); } void timer_init(void) { ret_code_t err_code = app_timer_init(); // initialize library APP_ERROR_CHECK(err_code); APP_TIMER_DEF(perf_shwr_timer); // create a main system timer to run perfect_shower_main every 1 sec. err_code = app_timer_create(&perf_shwr_timer, APP_TIMER_TICKS(1000000), perf_shwr_timer_handler); //} //void timers_start(void) //{ err_code = app_timer_start(perf_shwr_timer, APP_TIMER_TICKS(1000000), NULL); //1000000 uS=1 sec APP_ERROR_CHECK(err_code); } /* /
Note: I was getting an error: 'perf_shwr_timer' undeclared (first use in this function); did you mean 'perf_shwr_timer_handler'? When the start_timers() function was standalone. I had to move the function into the timer_init() function where the timer is defined to eliminate this error. Why isn't the linker finding the predefined timer?