Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 66f1151

Browse files
committed
safe boot.py
1 parent 170630b commit 66f1151

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

esp32/modules/inisetup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def setup():
66
with open("/boot.py", "w") as f:
77
f.write("""\
88
# This file is executed on every boot (including wake-boot from deepsleep)
9-
import badge, machine, esp, ugfx
9+
import badge, machine, esp, ugfx, deepsleep
1010
badge.init()
1111
ugfx.init()
1212
esp.rtcmem_write(0,0)
@@ -21,6 +21,10 @@ def setup():
2121
splash = load_me
2222
print("starting %s" % load_me)
2323
esp.rtcmem_write_string("")
24-
__import__(splash)
24+
try:
25+
__import__(splash)
26+
exception:
27+
badge.nvs_set_str('badge','boot.splash','splash')
28+
deepsleep.reboot()
2529
""")
2630
return vfs

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy