How to retain led state after waking up from extended sleep mode

⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
Ruchi Patel
Offline
Last seen:2 years 6 months ago
加入:2017-03-29 10:50
How to retain led state after waking up from extended sleep mode

Dear Dialog_Support Team,

I am configuring extended sleep mode in my custom application. I have followed ble_app_sleepmode example to configure extended sleep mode. And my device is able to go into sleep mode and if i press push button, it is able to wake up from sleep. Right now i have written program like if i pressed push button then device must be awake and LED will turn on. But led remain ON for a while only. Means as i released the push button led becomes OFF. What could be the reason? Why LED is not able to retain its state? This same happening while i am turning LED ON from ble scanner App.

With Regards,
Ruchi Patel

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi Ruchi Patel,

Hi Ruchi Patel,

设备保留销的状态的时候goes in sleep mode, so while you are in sleep mode the led should remain ON, but when waking up the device will run the periph_init() function and when that part of the code executes it will also reconfigure the pins in their default state. So in order to have the LED on at all times you will have to "remember" the state of the pin when waking up, and when the periph_init() function executes you will have to re-apply the value of the pin while it was sleeping.

Thanks MT_dialog