You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
361 B
18 lines
361 B
5 years ago
|
#include "AP_HAL.h"
|
||
|
#include "Storage.h"
|
||
|
#include <AP_Math/AP_Math.h>
|
||
|
|
||
|
/*
|
||
|
default erase method
|
||
|
*/
|
||
|
bool AP_HAL::Storage::erase(void)
|
||
|
{
|
||
|
uint8_t blk[16] {};
|
||
|
uint32_t ofs;
|
||
|
for (ofs=0; ofs<HAL_STORAGE_SIZE; ofs += sizeof(blk)) {
|
||
|
uint32_t n = MIN(sizeof(blk), HAL_STORAGE_SIZE - ofs);
|
||
|
write_block(ofs, blk, n);
|
||
|
}
|
||
|
return true;
|
||
|
}
|