23
23
24
24
#include < stm32h7xx_hal_rtc_ex.h>
25
25
26
- #include " FlashIAPBlockDevice.h"
27
-
28
26
#include < assert.h>
29
27
30
28
using namespace arduino ;
@@ -41,6 +39,7 @@ extern RTC_HandleTypeDef RTCHandle;
41
39
42
40
Arduino_Portenta_OTA_InternalFlash::Arduino_Portenta_OTA_InternalFlash (StorageTypePortenta const storage_type, uint32_t const _data_offset)
43
41
: Arduino_Portenta_OTA(storage_type, _data_offset)
42
+ , _bd(0x8000000 + _data_offset, 2 * 1024 * 1024 - _data_offset)
44
43
, _fs_flash(" fs" )
45
44
, _littlefs_fs_flash(" little_fs" )
46
45
, _update_size_internal_flash{0 }
@@ -55,11 +54,9 @@ Arduino_Portenta_OTA_InternalFlash::Arduino_Portenta_OTA_InternalFlash(StorageTy
55
54
56
55
bool Arduino_Portenta_OTA_InternalFlash::init ()
57
56
{
58
- FlashIAPBlockDevice bd (0x8000000 + _data_offset, 2 * 1024 * 1024 - _data_offset);
59
-
60
57
if (_storage_type == INTERNAL_FLASH_FATFS)
61
58
{
62
- int const err = _fs_flash.mount (&bd );
59
+ int const err = _fs_flash.mount (&_bd );
63
60
if (err)
64
61
{
65
62
Serial1.print (" Error while mounting flash filesystem: " );
@@ -71,7 +68,7 @@ bool Arduino_Portenta_OTA_InternalFlash::init()
71
68
72
69
if (_storage_type == INTERNAL_FLASH_LITTLEFS)
73
70
{
74
- int const err = _littlefs_fs_flash.mount (&bd );
71
+ int const err = _littlefs_fs_flash.mount (&_bd );
75
72
if (err)
76
73
{
77
74
Serial1.print (" Error while mounting littlefs filesystem: " );
0 commit comments