Merge pull request #1173 from keyboardio/gd32/flash-fix

k::d::storage::GD32Flash: Implement isSliceUninitialized()
pull/1174/head
Jesse Vincent 2 years ago committed by GitHub
commit 4619f90297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,6 +38,14 @@ class GD32Flash : public EEPROMClass<_StorageProps::length> {
void setup() {
EEPROMClass<_StorageProps::length>::begin();
}
bool isSliceUninitialized(uint16_t offset, uint16_t size) {
for (uint16_t o = offset; o < offset + size; o++) {
if (this->read(o) != _StorageProps::uninitialized_byte)
return false;
}
return true;
}
};
} // namespace storage

Loading…
Cancel
Save