diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-04-12 00:37:04 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-04-12 00:37:04 +0300 |
commit | 40f5ecd3a82e810203b39131cb61474f101de58e (patch) | |
tree | 765543f380ff64472af0fd7262f11c7fca5d112b /esp8266/scripts/_boot.py | |
parent | 2f5935269b7c1240bd5a8835b5d53ab0fb3a2058 (diff) | |
download | micropython-40f5ecd3a82e810203b39131cb61474f101de58e.tar.gz micropython-40f5ecd3a82e810203b39131cb61474f101de58e.zip |
esp8266: Add Python modules for initial configuration.
Main entry point is _boot.py which checks whether FAT FS in flash mountable,
and if so, mounts it. Otherwise, it checks if flash is empty, and if so,
performs initial module setup: makes FAT FS, configures default AP name,
etc. As a last option, if flash is not empty, and could not be mounted,
it means filesystem corruption, and warning message with instructions is
printed in an infinite loop.
Diffstat (limited to 'esp8266/scripts/_boot.py')
-rw-r--r-- | esp8266/scripts/_boot.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/esp8266/scripts/_boot.py b/esp8266/scripts/_boot.py new file mode 100644 index 0000000000..104034fb25 --- /dev/null +++ b/esp8266/scripts/_boot.py @@ -0,0 +1,12 @@ +import uos +import builtins +from flashbdev import bdev + +try: + vfs = uos.VfsFat(bdev, "/") +except OSError: + import inisetup + inisetup.check_bootsec() + uos.VfsFat.mkfs(bdev) + vfs = uos.VfsFat(bdev, "/") + inisetup.wifi() |