all: Replace all uses of umodule in Python code.

Applies to drivers/examples/extmod/port-modules/tools.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2022-08-19 22:58:37 +10:00
parent 9d7eac0713
commit 5fd042e7d1
29 changed files with 99 additions and 121 deletions

View File

@@ -6,7 +6,7 @@ Note: v1.12-334 and newer (including v1.13) require an ESP8266 module with
2MiB of flash or more, and use littlefs as the filesystem by default. When
upgrading from older firmware please backup your files first, and either
erase all flash before upgrading, or after upgrading execute
`uos.VfsLfs2.mkfs(bdev)`.
`os.VfsLfs2.mkfs(bdev)`.
### OTA builds
Over-The-Air (OTA) builds of the ESP8266 firmware are also provided.

View File

@@ -2,4 +2,4 @@ The following are daily builds of the ESP8266 firmware tailored for modules with
only 1MiB of flash. This firmware uses littlefs as the filesystem.
When upgrading from older firmware that uses a FAT filesystem please backup your files
first, and either erase all flash before upgrading, or after upgrading execute
`uos.VfsLfs2.mkfs(bdev)`.
`os.VfsLfs2.mkfs(bdev)`.

View File

@@ -1,12 +1,12 @@
import gc
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
import os
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
os.mount(bdev, "/")
except:
import inisetup

View File

@@ -2,7 +2,7 @@
# MIT license; Copyright (c) 2022 Glenn Moloney @glenn20
from _espnow import *
from uselect import poll, POLLIN
from select import poll, POLLIN
class ESPNow(ESPNowBase):

View File

@@ -1,13 +1,13 @@
import uos
import os
import network
from flashbdev import bdev
def wifi():
import ubinascii
import binascii
ap_if = network.WLAN(network.AP_IF)
ssid = b"MicroPython-%s" % ubinascii.hexlify(ap_if.config("mac")[-3:])
ssid = b"MicroPython-%s" % binascii.hexlify(ap_if.config("mac")[-3:])
ap_if.config(ssid=ssid, security=network.AUTH_WPA_WPA2_PSK, key=b"micropythoN")
@@ -32,7 +32,7 @@ def fs_corrupted():
"""\
The filesystem starting at sector %d with size %d sectors looks corrupt.
You may want to make a flash snapshot and try to recover it. Otherwise,
format it with uos.VfsLfs2.mkfs(bdev), or completely erase the flash and
format it with os.VfsLfs2.mkfs(bdev), or completely erase the flash and
reprogram MicroPython.
"""
% (bdev.start_sec, bdev.blocks)
@@ -44,17 +44,17 @@ def setup():
check_bootsec()
print("Performing initial setup")
wifi()
uos.VfsLfs2.mkfs(bdev)
vfs = uos.VfsLfs2(bdev)
uos.mount(vfs, "/")
os.VfsLfs2.mkfs(bdev)
vfs = os.VfsLfs2(bdev)
os.mount(vfs, "/")
with open("boot.py", "w") as f:
f.write(
"""\
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import uos, machine
#uos.dupterm(None, 1) # disable REPL on UART(0)
import os, machine
#os.dupterm(None, 1) # disable REPL on UART(0)
import gc
#import webrepl
#webrepl.start()