STM32 sleep wake time problem
rtc.wakeup(ms)
machine.lightsleep(ms)
Do these two functions use the same wake-up source?
What is the maximum value of ms?
docs/machine: Change sleep to lightsleep and add timeout arguments.
The machine.sleep() function can be misleading because it clashes with time.sleep() which has quite different semantics. So I propose to change it to machine.lightsleep() which shows that it is closer in behaviour to machine.deepsleep(), and update the wording of these functions in an attempt to make them generic.
Also, add an optional argument to these two sleep functions to specify a maximum time to sleep for. This is a common operation and underlying hardware usually has a special way of performing this operation.
The existing machine.sleep() function will remain for backwards compatibility purposes, and it can simply be an alias for machine.lightsleep() without arguments. The behaviour will be the same.
This PR only changes the docs. If it goes through then I'll follow with implementations on the ports that already have these functions.