Browse Source

esp8266: Explicitly collect garbage in bootstrap scripts.

Leads to less fragmentation at teh time user code starts.
pull/2211/head
Paul Sokolovsky 8 years ago
parent
commit
686367dcfc
  1. 3
      esp8266/modules/_boot.py
  2. 2
      esp8266/scripts/inisetup.py

3
esp8266/modules/_boot.py

@ -1,3 +1,4 @@
import gc
import uos import uos
from flashbdev import bdev from flashbdev import bdev
@ -7,3 +8,5 @@ try:
except OSError: except OSError:
import inisetup import inisetup
vfs = inisetup.setup() vfs = inisetup.setup()
gc.collect()

2
esp8266/scripts/inisetup.py

@ -40,7 +40,9 @@ def setup():
with open("/boot.py", "w") as f: with open("/boot.py", "w") as f:
f.write("""\ f.write("""\
# This file is executed on every boot (including wake-boot from deepsleep) # This file is executed on every boot (including wake-boot from deepsleep)
import gc
#import webrepl #import webrepl
#webrepl.start() #webrepl.start()
gc.collect()
""") """)
return vfs return vfs

Loading…
Cancel
Save