Skip to content

Commit 31190e6

Browse files
committed
replaced unsafe_boot.py with simplier version
1 parent 80ddaeb commit 31190e6

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

PyPortal_CMA_Art_Frame/unsafe_boot.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
import time
2-
import digitalio
32
import storage
4-
import board
53

6-
# Either of these should work for the PyPortal
7-
switch = digitalio.DigitalInOut(board.D4) # upper port
8-
#switch = digitalio.DigitalInOut(board.D3) # lower port
9-
10-
switch.direction = digitalio.Direction.INPUT
11-
switch.pull = digitalio.Pull.UP
12-
13-
# If the switch pin is connected to ground CircuitPython can write to the drive
14-
# Use a female/female jumper wire to connect the outer pins in the D4 connecter
15-
16-
storage.remount("/", disable_concurrent_write_protection= not switch.value)
17-
if switch.value:
18-
print("File system is read-only, insert jumper in data port between")
19-
print("pins 1 and 3 to make it writeable.")
20-
else:
21-
print("File system is writable, remove jumper in data port to make")
22-
print("it read-only and available to CircuitPython.")
4+
print("**************** WARNING ******************")
5+
print("Using the filesystem as a write-able cache!")
6+
print("This is risky behavior, backup your files!")
7+
print("**************** WARNING ******************")
238

9+
storage.remount("/", disable_concurrent_write_protection=True)
2410
time.sleep(5)

0 commit comments

Comments
 (0)