diff --git a/esp8266/scripts/_boot.py b/esp8266/scripts/_boot.py index 532c5b77e2..28b5b13dae 100644 --- a/esp8266/scripts/_boot.py +++ b/esp8266/scripts/_boot.py @@ -7,8 +7,4 @@ try: vfs = uos.VfsFat(bdev, "") except OSError: import inisetup - inisetup.check_bootsec() - print("Performing initial setup") - uos.VfsFat.mkfs(bdev) - vfs = uos.VfsFat(bdev, "") - inisetup.wifi() + vfs = inisetup.setup() diff --git a/esp8266/scripts/inisetup.py b/esp8266/scripts/inisetup.py index 963876ae52..9f2654e400 100644 --- a/esp8266/scripts/inisetup.py +++ b/esp8266/scripts/inisetup.py @@ -30,3 +30,11 @@ factory reprogramming of MicroPython firmware (completely erase flash, followed by firmware programming). """) time.sleep(3) + +def setup(): + check_bootsec() + print("Performing initial setup") + wifi() + uos.VfsFat.mkfs(bdev) + vfs = uos.VfsFat(bdev, "") + return vfs