2022-04-22 17:00:31 +00:00
|
|
|
from board import *
|
|
|
|
import digitalio
|
|
|
|
import storage
|
|
|
|
|
|
|
|
noStorageStatus = False
|
2022-04-22 17:01:34 +00:00
|
|
|
noStoragePin = digitalio.DigitalInOut(GP0)
|
2022-04-22 17:00:31 +00:00
|
|
|
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")
|