If I can understand correctly from you question, that you want to accomplish is to use a software timer in order to wake up periodically when the device is in extended sleep mode? Please check the app_easy_timer(). Otherwise, please clarify your question.
Hi, you right understand my question, but for clear understand app_easy_timer() working, i need check any sample, but in SDK i don't see sample with app_easy_timer() wake up from ext. sleep mode. Do you have it?
Use the ble_app_sleepmode example of the SDK6.0.10 (6.0.10.511\projects\target_apps\ble_examples\ble_app_sleepmode). This example demonstrates how to put the DA14585 into permanent sleep. A timer is set up in the user_app_adv_start() function and upon its expiration, the device will stop advertising and goes into extended sleep mode. You can wake it up via the wake up controller by pressing a button. Please see below the modifications should be done in order to wake it up via the app_easy_timer():
3. Define the WAKEUP_TO into ble_app_sleepmode.h header file
4. When it is expires the wakeup_timer_cb() will be trigger. The device will wake up and start advertising again
静态的空白wakeup_timer_cb(void) { if (GetBits16(SYS_STAT_REG, PER_IS_DOWN)) { periph_init(); } if (arch_ble_ext_wakeup_get()) { arch_set_sleep_mode(app_default_sleep_mode); arch_ble_force_wakeup(); arch_ble_ext_wakeup_off(); app_easy_wakeup(); } // If state is not idle, ignore the message if (ke_state_get(TASK_APP) == APP_CONNECTABLE) { user_app_adv_start(); } }
5. Stop the timer up connection.
app_easy_timer_cancel(wakeup_timer_used);
If you follow the step above, the system will advertise for APP_ADV_DATA_UPDATE_TO seconds. Then it will go into sleep mode and it will wake up after WAKEUP_TO seconds. If you found the steps useful, please mark the ticket as “accepted”.
Hi Lyadnov,
If I can understand correctly from you question, that you want to accomplish is to use a software timer in order to wake up periodically when the device is in extended sleep mode? Please check the app_easy_timer(). Otherwise, please clarify your question.
Thanks, PM_Dialog
Hi, you right understand my question, but for clear understand app_easy_timer() working, i need check any sample, but in SDK i don't see sample with app_easy_timer() wake up from ext. sleep mode. Do you have it?
Hi Lyadnov,
Use the ble_app_sleepmode example of the SDK6.0.10 (6.0.10.511\projects\target_apps\ble_examples\ble_app_sleepmode). This example demonstrates how to put the DA14585 into permanent sleep. A timer is set up in the user_app_adv_start() function and upon its expiration, the device will stop advertising and goes into extended sleep mode. You can wake it up via the wake up controller by pressing a button. Please see below the modifications should be done in order to wake it up via the app_easy_timer():
1.定义一个新的定时器处理函数:
2. Comment out app_button_enable() from the user_app_adv_undirect_complete() and set up a timer:
3. Define the WAKEUP_TO into ble_app_sleepmode.h header file
4. When it is expires the wakeup_timer_cb() will be trigger. The device will wake up and start advertising again
5. Stop the timer up connection.
If you follow the step above, the system will advertise for APP_ADV_DATA_UPDATE_TO seconds. Then it will go into sleep mode and it will wake up after WAKEUP_TO seconds. If you found the steps useful, please mark the ticket as “accepted”.
Thanks, PM_Dialog