Skip to content

Commit 287ee93

Browse files
committed
SFU: don't allocate PluggableMassStorage
1 parent 46fc039 commit 287ee93

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

libraries/SFU/src/SFU.cpp

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
11
#include "SFU.h"
22
#include "FlashIAPBlockDevice.h"
33
#include "FATFileSystem.h"
4-
#include "PluggableUSBMSD.h"
4+
//#include "PluggableUSBMSD.h"
55

66
const unsigned char SFU[0x10000] __attribute__ ((section(".second_stage_ota"), used)) = {
77
#include "rp2040.h"
88
};
99

1010
FlashIAPBlockDevice bd(XIP_BASE + 0x100000, 0x100000);
11-
12-
void USBMSD::begin()
13-
{
14-
int err = getFileSystem().mount(&bd);
15-
if (err) {
16-
err = getFileSystem().reformat(&bd);
17-
}
18-
}
19-
20-
mbed::FATFileSystem& USBMSD::getFileSystem()
21-
{
22-
static mbed::FATFileSystem fs("ota");
23-
return fs;
24-
}
25-
26-
USBMSD MassStorage(&bd);
11+
static mbed::FATFileSystem fs("ota");
2712

2813
int SFU::begin() {
29-
MassStorage.begin();
14+
int err = fs.mount(&bd);
15+
if (err) {
16+
err = fs.reformat(&bd);
17+
}
3018
}
3119

3220
int SFU::download(const char* url) {

libraries/SFU/src/SFU.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#pragma once
2+
13
#include "WiFiNINA.h"
24

35
class SFU {

0 commit comments

Comments
 (0)