Added USB enable-disable mode (#25)

This commit is contained in:
dbisu
2021-10-03 15:19:54 -05:00
committed by GitHub
parent 83eba10713
commit 003cede2b3
3 changed files with 30 additions and 0 deletions

16
boot.py Normal file
View File

@@ -0,0 +1,16 @@
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")