Skip to content

Commit 8ff1fc7

Browse files
committed
make use of usb mass storage optional, default off
this has proven to be unreliable for me
1 parent 5e84c3e commit 8ff1fc7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

runcpm-rp2040-dvi-usb/runcpm-pico/hardware/pico/feather_dvi.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
// SPDX-License-Identifier: MIT
55

66
#include <SdFat.h> // SDFat - Adafruit Fork
7-
#include <Adafruit_TinyUSB.h>
87
#include <PicoDVI.h>
98
#include "../../console.h"
109
#include "../../arduino_hooks.h"
1110

1211
#undef USE_DISPLAY
1312
#define USE_DISPLAY (1)
1413

14+
#ifndef USE_MSC
15+
#define USE_MSC (0)
16+
#endif
17+
1518
#if USE_DISPLAY
1619
DVItext1 display(DVI_RES_800x240p30, adafruit_feather_dvi_cfg);
1720
#endif
@@ -20,7 +23,6 @@ DVItext1 display(DVI_RES_800x240p30, adafruit_feather_dvi_cfg);
2023
#define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SPI_CLOCK)
2124
DedicatedSpiCard blockdevice;
2225
FatFileSystem SD; // Filesystem object from SdFat
23-
Adafruit_USBD_MSC usb_msc; // USB mass storage object
2426

2527
// =========================================================================================
2628
// Define Board-Data
@@ -34,6 +36,8 @@ Adafruit_USBD_MSC usb_msc; // USB mass storage object
3436

3537
// FUNCTIONS REQUIRED FOR USB MASS STORAGE ---------------------------------
3638

39+
#if USE_MSC
40+
Adafruit_USBD_MSC usb_msc; // USB mass storage object
3741
static bool msc_changed = true; // Is set true on filesystem changes
3842

3943
// Callback on READ10 command.
@@ -54,6 +58,7 @@ void msc_flush_cb(void) {
5458
digitalWrite(LED_BUILTIN, LOW);
5559
msc_changed = true;
5660
}
61+
#endif
5762

5863
#if USE_DISPLAY
5964
uint16_t underCursor = ' ';
@@ -110,6 +115,7 @@ bool port_init_early() {
110115
if (!usb_msc.begin()) {
111116
_puts("Failed to initialize USB MSC"); return false;
112117
}
118+
#endif
113119
return true;
114120
}
115121

0 commit comments

Comments
 (0)