@@ -32,8 +32,8 @@ using namespace arduino;
32
32
Arduino_Portenta_OTA_InternalFlash::Arduino_Portenta_OTA_InternalFlash (StorageTypePortenta const storage_type, uint32_t const _data_offset)
33
33
: Arduino_Portenta_OTA(storage_type, _data_offset)
34
34
, _bd(0x8000000 + _data_offset, 2 * 1024 * 1024 - _data_offset)
35
- , _fs_flash( " fs " )
36
- , _littlefs_fs_flash( " little_fs " )
35
+ , _fs_flash{ NULL }
36
+ , _littlefs_fs_flash{ NULL }
37
37
{
38
38
assert (_storage_type == INTERNAL_FLASH_FATFS ||
39
39
_storage_type == INTERNAL_FLASH_LITTLEFS);
@@ -47,7 +47,8 @@ bool Arduino_Portenta_OTA_InternalFlash::init()
47
47
{
48
48
if (_storage_type == INTERNAL_FLASH_FATFS)
49
49
{
50
- int const err = _fs_flash.mount (&_bd);
50
+ _fs_flash = new mbed::FATFileSystem (" fs" );
51
+ int const err = _fs_flash->mount (&_bd);
51
52
if (err)
52
53
{
53
54
Serial1.print (" Error while mounting flash filesystem: " );
@@ -59,7 +60,8 @@ bool Arduino_Portenta_OTA_InternalFlash::init()
59
60
60
61
if (_storage_type == INTERNAL_FLASH_LITTLEFS)
61
62
{
62
- int const err = _littlefs_fs_flash.mount (&_bd);
63
+ _littlefs_fs_flash = new mbed::LittleFileSystem (" little_fs" );
64
+ int const err = _littlefs_fs_flash->mount (&_bd);
63
65
if (err)
64
66
{
65
67
Serial1.print (" Error while mounting littlefs filesystem: " );
0 commit comments