⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Ankit
Offline
Last seen:3 months 1 week ago
加入:2017-05-24 07:42
app_easy_timer

Hi,

my application is based on the timer. So, I want a general timer for my application. In normal mode, I was using timer0 and everything was working fine. But after enabling extended sleep mode, I found that timer0 is not working. So, after searching few documents and support, I come to know that timer0 cannot be used in sleep mode as it is being used by BLE. So, now I am using app_easy_timer(); in my application. It is working fine in extended sleep mode but on power up ( when the device is not in sleep mode ), app_easy_timer() does not work. It only works when the device enters into sleep mode.

1. Is there any way I can use app_easy_timer() in normal mode ( on power up only ).
2. Is there any function or entry point indication from where I can start using app_easy_timer(). So, I can do power up functionalities there.

Device:
STS_Dialog (not verified)
Hi Ankit,

Hi Ankit,

About your first question I used the app_easy_timer() function both in the normal mode and the extended sleep mode events, it worked fine. For the second question, it’s sure that you can use the app_easy_timer() in every functionality you want to implement, except if you set up the timer before the .app_on_init() callback function(after the completion of this function you can use the timer) then a GAPM_RESET is issued after that function and all the messages in the kernel queue are flushed including timers and in general after a GAPM_RESET all the timers that are issued before that command are flushed. So you will have to check if the timer is indeed set and that a GAPM_RESET is not invoked before the timer has elapsed.

Thanks,

STS_Dialog.

Ankit
Offline
Last seen:3 months 1 week ago
加入:2017-05-24 07:42
That is what exactly happens.

That is what exactly happens. I am calling app_easy_timer() inside .app_on_init() function.
So, where I should start app_easy_timer? Is there any other callback which is being called after .app_on_init()? and it must be called only once as I have to do initialization only once when my board power-up.

Currently, I am doing my initialization at .default_operation_adv() function and app_easy_timer() is working fine.

STS_Dialog (not verified)
后的吗

后的吗app_on_init() function you can use the app_easy_timer() anywhere you want.There are many callbacks after the end of the app_on_init() that you can use, for example .app_on_db_init_complete callcack in user_callback_config.h.

Thanks,

STS_Dialog.