Line data Source code
1 : #include "AP_HAL.h" 2 : #include "Storage.h" 3 : #include <AP_Math/AP_Math.h> 4 : 5 : /* 6 : default erase method 7 : */ 8 295 : bool AP_HAL::Storage::erase(void) 9 : { 10 295 : uint8_t blk[16] {}; 11 : uint32_t ofs; 12 302375 : for (ofs=0; ofs<HAL_STORAGE_SIZE; ofs += sizeof(blk)) { 13 302080 : uint32_t n = MIN(sizeof(blk), HAL_STORAGE_SIZE - ofs); 14 302080 : write_block(ofs, blk, n); 15 : } 16 295 : return true; 17 : }