Closed vladak closed 4 months ago
The goal is to have a appendable log file with the safe mode reasons. Avoid using JSON as appending to the file without reading and parsing the contents will produce invalid JSON. Text entries are enough. The timestamps will not tell much because they get reset, however at least might reveal for how long the code was running.
Tested by using:
#!/usr/bin/env python3
import microcontroller
print("switching info safe mode")
microcontroller.on_next_reset(microcontroller.RunMode.SAFE_MODE)
microcontroller.reset()
follow-up to #23: consider passing the reason for safe mode entry to
code.py
.Inspiration: https://gist.github.com/anecdata/fe35dc6a94069fc920edf61a64750b53