Skip to content

Commit d2361cc

Browse files
committed
UsbMsd: MSD_QSPI use get_default_instance()
Former-commit-id: 8b3d8e7
1 parent 8fc0c42 commit d2361cc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libraries/UsbMsd/examples/MSD_QSPI/MSD_QSPI.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Portenta H33 - USB MASS STORAGE DEVICE
33
44
The sketch shows how mount an H33 as Mass Storage Device on QSPI Flash
5+
Before running this sketch, to properly format the QSPI flash run the
6+
Storage/QSPIFormat.ino sketch
57
68
The circuit:
79
- Portenta H33
@@ -23,8 +25,8 @@
2325
#include "UsbMsd.h"
2426
#include "FATFileSystem.h"
2527

26-
QSPIFlashBlockDevice block_device(PIN_QSPI_CLK, PIN_QSPI_SS, PIN_QSPI_D0, PIN_QSPI_D1, PIN_QSPI_D2, PIN_QSPI_D3);
27-
USBMSD msd(&block_device);
28+
BlockDevice* root = BlockDevice::get_default_instance();
29+
USBMSD msd(root);
2830
FATFileSystem fs(TEST_FS_NAME);
2931

3032
std::string root_folder = std::string("/") + std::string(TEST_FS_NAME);
@@ -73,7 +75,7 @@ void setup() {
7375

7476

7577
/* Mount the partition */
76-
int err = fs.mount(&block_device);
78+
int err = fs.mount(root);
7779
if (err) {
7880
Serial.println("Unable to mount filesystem");
7981
while(1) {

0 commit comments

Comments
 (0)