hi, after connecting to peripheral device. app_timer_cnt_get() function always gives 0. why it is so. i am not able to understand it. can anyone help me to get the current timer.
thanks!!
hi, after connecting to peripheral device. app_timer_cnt_get() function always gives 0. why it is so. i am not able to understand it. can anyone help me to get the current timer.
thanks!!
According to documentation, this function returns error code. You have to give it the pointer to variable that you want get the rtc count to...
It is described really well in documentation
Also, you can just check source code to fully understand it.
According to documentation, this function returns error code. You have to give it the pointer to variable that you want get the rtc count to...
It is described really well in documentation
Also, you can just check source code to fully understand it.
Before using app_timer_cnt_get(&watchdog_timer)
, how to declare watchdog_timer so that it can get the RTC count? At present, I only declare uint32_t watchdog_timer;
, and I think this may be the reason that app_timer_cnt_get(&watchdog_timer)
returns zero.
I just want to double check, did you remember to start the timer?