You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 16, 2024. It is now read-only.
Confirmed with 1.20.2.rc3 on a FiPy, almost always. A simple fix is to check for values <= 0, and return immediately in that case. Tested and confirmed, it works.
P.S., just in case someone from the Pycom team is taking care of issues: I added these lines to the start of the function mp_obj_t machine_sleep () in esp32/mods/modmachine.c:
int64_t sleep_time = 1000; // Safe default value, just to silence compiler warnings
if (n_args > 0) {
sleep_time = (int64_t)mp_obj_get_int_truncated(arg[0]) * 1000;
if (sleep_time <= 0) {
return mp_const_none;
}
}
And deleted the then obsolete line to set sleep_time a few lines down the row.
amotl
pushed a commit
to daq-tools/pycom-micropython
that referenced
this issue
Mar 6, 2020
machine.sleep(0) causes a crash on LoPy4 with v1.20.1 firmware.
The text was updated successfully, but these errors were encountered: