esp8266/scripts: Don't try to create filesystem on 512KB devices or less.

There's no space for it.
This commit is contained in:
Paul Sokolovsky 2016-04-18 17:14:00 +03:00
parent 89e56a80b8
commit 8dcce92606
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,8 @@ import builtins
from flashbdev import bdev
try:
vfs = uos.VfsFat(bdev, "")
if bdev:
vfs = uos.VfsFat(bdev, "")
except OSError:
import inisetup
inisetup.check_bootsec()

View File

@ -26,4 +26,7 @@ class FlashBdev:
if op == 5: # BP_IOCTL_SEC_SIZE
return self.SEC_SIZE
bdev = FlashBdev()
if esp.flash_size() < 1024*1024:
bdev = None
else:
bdev = FlashBdev()