diff --git a/libraries/StorageManager/StorageManager.cpp b/libraries/StorageManager/StorageManager.cpp index fc5b6136f5..d3a5b1d3d8 100644 --- a/libraries/StorageManager/StorageManager.cpp +++ b/libraries/StorageManager/StorageManager.cpp @@ -21,6 +21,7 @@ #include #include "StorageManager.h" +#include extern const AP_HAL::HAL& hal; @@ -110,21 +111,9 @@ const StorageManager::StorageArea *StorageManager::layout = layout_default; */ void StorageManager::erase(void) { - uint8_t blk[16]; - memset(blk, 0, sizeof(blk)); - for (uint8_t i=0; i length) { - n = length - ofs; - } - hal.storage->write_block(offset + ofs, blk, n); - } + if (!hal.storage->erase()) { + ::printf("StorageManager: erase failed\n"); } - } /*