Improve led-tool flashing and settings flow

Made-with: Cursor
This commit is contained in:
2026-03-10 22:50:00 +13:00
parent accf8f06a5
commit 8df1d9dd81
4 changed files with 245 additions and 279 deletions

View File

@@ -1,5 +1,9 @@
import errno
import platform
try:
import platform
except Exception: # MicroPython or restricted envs
platform = None
# This table maps numeric values defined by `py/mperrno.h` to host errno code.
MP_ERRNO_TABLE = {
@@ -51,5 +55,5 @@ MP_ERRNO_TABLE = {
115: errno.EINPROGRESS,
125: errno.ECANCELED,
}
if platform.system() != "Windows":
if (platform.system() if platform else None) != "Windows":
MP_ERRNO_TABLE[15] = errno.ENOTBLK