Skip to content

Commit c0178a1

Browse files
committed
More comprehensive description of the usage of forcedLightSleep.
1 parent c106a20 commit c0178a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/libraries.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ Some ESP-specific APIs related to the deep, modem, and light sleep modes, RTC an
8181

8282
``ESP.forcedModemSleepOff()`` immediately returns the chip to the automatic sleep mode in effect before the preceeding call to ``ESP.forcedModemSleep``.
8383

84-
``ESP.forcedLightSleepBegin(microseconds, callback)`` works in tandem with ``ESP.forcedLightSleepEnd(cancel)`` to put the chip into forced ``LIGHT_SLEEP``. A microseconds duration after which the sleep mode returns to the automatic sleep mode that was effective before this call can be given, a value of 0 or 0xFFFFFFF turns off that timeout. The optional callback function will be invoked when the forced light sleep ends. Forced light sleep halts the CPU, in addition to the timeout, it can be awakened via GPIO input. Between the calls to ``ESP.forcedLightSleepBegin`` and ``ESP.forcedLightSleepEnd`` any GPIOs except GPIO16 to use for wakeup can be set up.
84+
``ESP.forcedLightSleepBegin(microseconds, callback)`` works in tandem with ``ESP.forcedLightSleepEnd(cancel)`` to put the chip into forced ``LIGHT_SLEEP``. A microseconds duration after which the sleep mode returns to the automatic sleep mode that was effective before this call can be given, a value of 0 or 0xFFFFFFF turns off that timeout. The optional callback function will be invoked when the forced light sleep ends. Forced light sleep halts the CPU, in addition to the timeout, it can be awakened via GPIO input. Between the calls to ``ESP.forcedLightSleepBegin`` and ``ESP.forcedLightSleepEnd`` any GPIOs except GPIO16 to use for wakeup can be set up. Care must be taken not to allow the chip to enter the idle task before the call to ``ESP.forcedLightSleepEnd(cancel)``, so for instance no direct or indirect calls to ``delay()`` are possible. Otherwise the forced light sleep may engange too early, breaking the required logic of the tandem calls.
8585

86-
``ESP.forcedLightSleepEnd(cancel)`` causes the chip to enter the forced light sleep mode that was set up as described for ``ESP.forcedLightSleepBegin``. The optional cancel argument, if true, prevents the sleep mode transition from occuring and returns to the automatic sleep mode that was effective before ``ESP.forcedLightSleepBegin``.
86+
``ESP.forcedLightSleepEnd(cancel)`` causes the chip to enter the forced light sleep mode that was set up as described for ``ESP.forcedLightSleepBegin``. The optional cancel argument, if true, prevents the sleep mode transition from occuring and returns to the automatic sleep mode that was effective before ``ESP.forcedLightSleepBegin``. This can be used, for instance, if setting up the level-triggered GPIO interrupts for wakeup fails.
8787

8888
``ESP.autoModemSleep()`` immediately puts the chip into automatic ``MODEM_SLEEP``.
8989

0 commit comments

Comments
 (0)