Skip to content

Commit bb6458b

Browse files
committed
docs/machine: More generic description of sleep's, WiPy details to its genref.
1 parent db99ae0 commit bb6458b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

docs/library/machine.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ Power related functions
6363
.. function:: sleep()
6464

6565
Stops the CPU and disables all peripherals except for WLAN. Execution is resumed from
66-
the point where the sleep was requested. Wake sources are ``Pin``, ``RTC`` and ``WLAN``.
66+
the point where the sleep was requested. For wake up to actually happen, wake sources
67+
should be configured first.
6768

6869
.. function:: deepsleep()
6970

70-
Stops the CPU and all peripherals including WLAN. Execution is resumed from main, just
71-
as with a reset. The reset cause can be checked to know that we are coming from
72-
``machine.DEEPSLEEP``. Wake sources are ``Pin`` and ``RTC``.
71+
Stops the CPU and all peripherals (including networking interfaces, if any). Execution
72+
is resumed from the main script, just as with a reset. The reset cause can be checked
73+
to know that we are coming from ``machine.DEEPSLEEP``. For wake up to actually happen,
74+
wake sources should be configured first, like ``Pin`` change or ``RTC`` timeout.
7375

7476
.. only:: port_wipy
7577

docs/wipy/general.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,11 @@ There are currently 2 kinds of errors that you might see:
170170
2. If the heartbeat LED stays on, then there was a hard fault, you cannot
171171
recover from this, the only way out is to press the reset switch.
172172

173-
Power consumption in various sleep modes
174-
----------------------------------------
173+
Details on sleep modes
174+
----------------------
175175

176-
* ``machine.idle()`` - ~12mA (in WLAN STA mode)
177-
* ``machine.sleep()`` - 950uA (in WLAN STA mode)
178-
* ``machine.deepsleep()`` - ~5uA
176+
* ``machine.idle()``: Power consumption: ~12mA (in WLAN STA mode). Wake sources:
177+
any hardware interrupt, no special configuration required.
178+
* ``machine.sleep()``: 950uA (in WLAN STA mode). Wake sources are ``Pin``, ``RTC``
179+
and ``WLAN``
180+
* ``machine.deepsleep()``: ~5uA. Wake sources are ``Pin`` and ``RTC``.

0 commit comments

Comments
 (0)