Checking if USB storage is enabled using CircuitPython

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
MrVolts
 
Posts: 1
Joined: Sat Dec 03, 2022 2:31 pm

Checking if USB storage is enabled using CircuitPython

Post by MrVolts »

Is there a way to check if the Adafruit Trinket QT2040's storage device is enabled using the CircuitPython storage library? I have used the storage.disable_usb_drive() and storage.enable_usb_drive() functions in boot.py, but I'm not sure how to check the current status of the storage device in main.py. Thanks

Storage library: https://docs.circuitpython.org/en/lates ... index.html

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Checking if USB storage is enabled using CircuitPython

Post by mikeysklar »

If you check the value returned from does that work?

Code: Select all

storage.getmount("CIRCUITPY")

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”