17 lines
403 B
Python
17 lines
403 B
Python
|
from board import *
|
||
|
import digitalio
|
||
|
import storage
|
||
|
|
||
|
noStorageStatus = False
|
||
|
noStoragePin = digitalio.DigitalInOut(GP15)
|
||
|
noStoragePin.switch_to_input(pull=digitalio.Pull.UP)
|
||
|
noStorageStatus = not noStoragePin.value
|
||
|
|
||
|
if(noStorageStatus == True):
|
||
|
# don't show USB drive to host PC
|
||
|
storage.disable_usb_drive()
|
||
|
print("Disabling USB drive")
|
||
|
else:
|
||
|
# normal boot
|
||
|
print("USB drive enabled")
|