Fix for CIRCUITPY_USB_MSC=0

Avoid undefined functions when MSC is disabled.
This commit is contained in:
Radomir Dopieralski 2021-02-27 15:05:00 +01:00
parent 888a0c5f08
commit 8c8d60fb80
2 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,7 @@
#define CFG_TUD_CDC 1
#endif
#define CFG_TUD_MSC 1
#define CFG_TUD_MSC CIRCUITPY_USB_MSC
#define CFG_TUD_HID CIRCUITPY_USB_HID
#define CFG_TUD_MIDI CIRCUITPY_USB_MIDI
#define CFG_TUD_VENDOR CIRCUITPY_USB_VENDOR

View File

@ -131,12 +131,16 @@ void usb_irq_handler(void) {
// Invoked when device is mounted
void tud_mount_cb(void) {
#if CIRCUITPY_USB_MSC
usb_msc_mount();
#endif
}
// Invoked when device is unmounted
void tud_umount_cb(void) {
#if CIRCUITPY_USB_MSC
usb_msc_umount();
#endif
}
// Invoked when usb bus is suspended