I can not find the macro:
APP_TIMER_DEF(m_led_a_timer_id);
How do I create the timer ID with the SDK 0.9.2 for the nRF52?
I can not find the macro:
APP_TIMER_DEF(m_led_a_timer_id);
How do I create the timer ID with the SDK 0.9.2 for the nRF52?
If you found that macro, you probably took it from SDK newer than 0.9.2. This library differs a bit between SDK 0.9.2 and newest nRF5 SDK.
if you really want to use 0.9.2, use this instead:
static app_timer_id_t m_led_a_timer_id;
Each SDK (excluding legacy ones...) has it's own documentation on infocenter.
If you aren't stuck on SDK 0.9.2, I would recommend moving to SDK11 for the nRF52. There will be no more nRF52 specific SDK updates now that they have merged 51 and 52 in SDK11 which also means unless you migrate to SDK 11+, you will never have a production tested SDK to build your application on.
As suggested by several others, you would probably be better off switching to SDK 11 as soon as possible.
However, to answer your question you should note that the tutorial explains the differences in API for nRF51 SDK 9 and 10. The app timer in nRF52 SDK 0.9.2 has the same API as nRF51 SDK 9.
There are essentially two differences. You have to declare the timer ID this way, rather than using the APP_TIMER_DEF
macro:
static app_timer_id_t m_led_a_timer_id;
and you have to initialize the apptimer library in the following way:
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);
where the APP_TIMER_MAX_TIMERS
is the max number of timers you are going to create.
thank you for your help. in the tutorial it was not clear for me which code i have to use for the nRF52 SDK 0.9.2, but now it works.