From 4eb5e5e8d4c64dec18a43cb8b08da2b6aa2b79c4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 Dec 2019 11:44:30 +1100 Subject: [PATCH] StorageManager: use hal.storage->erase() --- libraries/StorageManager/StorageManager.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) 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"); } - } /*