kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Badger2040: Sleep after writing the book, to fix possible write delay when on battery
rodzic
e0e34fef42
commit
72ff77aafa
|
@ -1,4 +1,5 @@
|
||||||
import badger2040
|
import badger2040
|
||||||
|
import time
|
||||||
import gc
|
import gc
|
||||||
import badger_os
|
import badger_os
|
||||||
|
|
||||||
|
@ -13,7 +14,10 @@ except OSError:
|
||||||
# If the specified file doesn't exist,
|
# If the specified file doesn't exist,
|
||||||
# pre-populate with Wind In The Willows
|
# pre-populate with Wind In The Willows
|
||||||
import witw
|
import witw
|
||||||
open(text_file, "wb").write(witw.data())
|
with open(text_file, "wb") as f:
|
||||||
|
f.write(witw.data())
|
||||||
|
f.flush()
|
||||||
|
time.sleep(0.1)
|
||||||
del witw
|
del witw
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
Ładowanie…
Reference in New Issue