Skip to content

Commit 2a9b446

Browse files
authored
Merge pull request arduino#90 from bcmi-labs/example-littlefs
Storage: LittleFs example update
2 parents 347920d + 77ee350 commit 2a9b446

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: libraries/Storage/examples/LittleFsOnQSPIFlash/LittleFsOnQSPIFlash.ino

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <string>
1717

1818
#include "QSPIFlashBlockDevice.h"
19+
#include <MBRBlockDevice.h>
1920
#include "LittleFileSystem.h"
2021

2122
#define TEST_FS_NAME "qspi"
@@ -24,7 +25,8 @@
2425
#define DELETE_FILE_DIMENSION 150
2526

2627

27-
QSPIFlashBlockDevice block_device(PIN_QSPI_CLK, PIN_QSPI_SS, PIN_QSPI_D0, PIN_QSPI_D1, PIN_QSPI_D2, PIN_QSPI_D3);
28+
BlockDevice* block_device = BlockDevice::get_default_instance();
29+
MBRBlockDevice mbr(block_device, 2);
2830
LittleFileSystem fs(TEST_FS_NAME);
2931

3032
std::string root_folder = std::string("/") + std::string(TEST_FS_NAME);
@@ -52,12 +54,12 @@ void setup() {
5254
*/
5355

5456
Serial.println("Mounting QSPI FLASH...");
55-
int err = fs.mount(&block_device);
57+
int err = fs.mount(&mbr);
5658
if (err) {
5759
// Reformat if we can't mount the filesystem
5860
// this should only happen on the first boot
5961
Serial.println("No filesystem found, formatting... ");
60-
err = fs.reformat(&block_device);
62+
err = fs.reformat(&mbr);
6163
}
6264

6365
if (err) {

0 commit comments

Comments
 (0)