In an earlier post, I said I was proposing to oblsolete lightsleep.
I meant that only with respect to RP2040 and RP2350.
I looked at the source code several ports do support lightsleep in a limited fashion.
mimxrt - implements lightsleep but it raises mp_raise_NotImplementedError exception. Basically unsupported in anyway.
nrf - implements lightsleep but it does not support sleeping for a specific time.
cc3200 - also does not support sleeping for a specific time.
Several other ports do not seem to have an implementation at all.
For instance the unix port (which I built and ran on my RPI 4) does not implement it.
Remember, the micropython documentation lightsleep is intentionally ambiguous about what lightsleep does (emphasis mine):
It just needs to be captured in the official documentation.
I meant that only with respect to RP2040 and RP2350.
There is clear precedent that is not required.For that to be accepted, you'd have to have equivalent code for all of the MicroPython ports.
I looked at the source code several ports do support lightsleep in a limited fashion.
mimxrt - implements lightsleep but it raises mp_raise_NotImplementedError exception. Basically unsupported in anyway.
nrf - implements lightsleep but it does not support sleeping for a specific time.
cc3200 - also does not support sleeping for a specific time.
Several other ports do not seem to have an implementation at all.
For instance the unix port (which I built and ran on my RPI 4) does not implement it.
Code:
>>> import machine>>> help(machine)object <module 'machine'> is of type module __name__ -- machine mem8 -- <8-bit memory> mem16 -- <16-bit memory> mem32 -- <32-bit memory> soft_reset -- <function> idle -- <function> time_pulse_us -- <function> PinBase -- <class 'PinBase'> Signal -- <class 'Signal'>
Remember, the micropython documentation lightsleep is intentionally ambiguous about what lightsleep does (emphasis mine):
The rp2 port can go its own way and implement something different.Stops execution in an attempt to enter a low power state.
...
With or without a timeout, execution may resume at any time if there are events that require processing.
...
The precise behaviour and power-saving capabilities of lightsleep and deepsleep is highly dependent on the underlying hardware.
It just needs to be captured in the official documentation.
Statistics: Posted by cpottle9 — Wed Dec 18, 2024 8:19 pm