diff --git a/app/fileblockdevice/FileBlockDevice.cpp b/app/fileblockdevice/FileBlockDevice.cpp index c8bfc1b..b93b44b 100644 --- a/app/fileblockdevice/FileBlockDevice.cpp +++ b/app/fileblockdevice/FileBlockDevice.cpp @@ -121,6 +121,12 @@ int FileBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size) return BD_ERROR_DEVICE_ERROR; } + err = fflush(_file[0]); + if (err != 0u) { + printf("E-Program:flush\n"); + return BD_ERROR_DEVICE_ERROR; + } + return BD_ERROR_OK; } @@ -148,6 +154,12 @@ int FileBlockDevice::erase(bd_addr_t addr, bd_size_t size) } } + int err = fflush(_file[0]); + if (err != 0u) { + printf("E-Erase:flush\n"); + return BD_ERROR_DEVICE_ERROR; + } + return BD_ERROR_OK; }