From af1ede930ba643d68850c541ef4075d5f7fd4f02 Mon Sep 17 00:00:00 2001 From: Girts Folkmanis Date: Sat, 22 Jul 2017 15:54:50 -0700 Subject: [PATCH] esp8266: fix "uos" includes Fix couple places in startup scripts that still had "import uos". This would cause an exception when _boot.py was executed during startup. --- esp8266/modules/_boot.py | 5 +++-- esp8266/modules/inisetup.py | 10 +++++----- esp8266/modules/webrepl_setup.py | 1 - 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/esp8266/modules/_boot.py b/esp8266/modules/_boot.py index 81eb20dd63..cbaf2aba66 100644 --- a/esp8266/modules/_boot.py +++ b/esp8266/modules/_boot.py @@ -1,11 +1,12 @@ import gc gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4) -import uos from flashbdev import bdev +import storage try: if bdev: - uos.mount(bdev, '/') + vfs = storage.VfsFat(bdev) + storage.mount(vfs, '/') except OSError: import inisetup inisetup.setup() diff --git a/esp8266/modules/inisetup.py b/esp8266/modules/inisetup.py index af78dfad51..192ff5ea84 100644 --- a/esp8266/modules/inisetup.py +++ b/esp8266/modules/inisetup.py @@ -1,6 +1,6 @@ -import uos -import network from flashbdev import bdev +import network +import storage def wifi(): import ubinascii @@ -36,9 +36,9 @@ def setup(): check_bootsec() print("Performing initial setup") wifi() - uos.VfsFat.mkfs(bdev) - vfs = uos.VfsFat(bdev) - uos.mount(vfs, '/') + storage.VfsFat.mkfs(bdev) + vfs = storage.VfsFat(bdev) + storage.mount(vfs, '/') with open("boot.py", "w") as f: f.write("""\ # This file is executed on every boot (including wake-boot from deepsleep) diff --git a/esp8266/modules/webrepl_setup.py b/esp8266/modules/webrepl_setup.py index 473067974d..52c76863a1 100644 --- a/esp8266/modules/webrepl_setup.py +++ b/esp8266/modules/webrepl_setup.py @@ -1,5 +1,4 @@ import sys -#import uos as os import os import machine