Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 8 months ago.
"sleep" prototype for use in mDot
I'm running an mDot. Trying to play with some sample code that has a call to sleep
prototype for sleep: void sleep(const uint32_t& interval, const uint8_t& wakeup_mode = RTC_ALARM, const bool& deepsleep = true);
The example code I am using does not specify anything at the "deepsleep" location
So, what's the difference? What mode do I get if it's left out and what mode do I get if it's set FALSE or TRUE? ( The docs for the stm32 have a SLEEP STOP STANDBY - not "deepsleep" vs not "deepsleep" )
Thanks.
Btw regarding your questions about this being a weird forum: It isn't a forum, it is questions. Forum is also available, but due to how they show new forum topics you miss it very easily, in which case people won't answer simply because they don't know about the question.
Deepsleep is probably equal to STOP mode, I don't have an mDot myself but it seems they ignore all the normal mbed functions and terminology, which really isn't handy. If you don't fill in anything there it will use deepsleep (the = true part makes sure that if ommitted that value is true).
posted by Erik - 09 Apr 2016Admittedly I'm inexperienced with C++ with defaults parameters and overloaded functions so thanks for that.
In the interest of experimentation I entered a '0' in the last spot in that function call, and the debug screen output still indicates it's entering so-called "deepsleep"
So at this point it seems a) "no entry", b) an entry of '1' and c) an entry of '0' do the same thing, sadly.
posted by Mike G 11 Apr 2016