MCPcopy Create free account
hub / github.com/PaulStoffregen/SerialFlash / erase

Method erase

SerialFlashDirectory.cpp:382–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380
381
382void SerialFlashFile::erase()
383{
384 uint32_t i, blocksize;
385
386 blocksize = SerialFlash.blockSize();
387 if (address & (blocksize - 1)) return; // must begin on a block boundary
388 if (length & (blocksize - 1)) return; // must be exact number of blocks
389 for (i=0; i < length; i += blocksize) {
390 SerialFlash.eraseBlock(address + i);
391 }
392}
393

Callers

nothing calls this directly

Calls 2

blockSizeMethod · 0.80
eraseBlockMethod · 0.80

Tested by

no test coverage detected