mirror of
https://github.com/dbisu/pico-ducky.git
synced 2025-12-06 02:41:45 +00:00
Added USB enable-disable mode (#25)
This commit is contained in:
16
boot.py
Normal file
16
boot.py
Normal 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")
|
||||
Reference in New Issue
Block a user