From 06bd5297af938f28728b2fedffb2c7eee4be7d3a Mon Sep 17 00:00:00 2001 From: Kevin Gilbert Date: Tue, 10 Oct 2017 17:19:24 -0500 Subject: [PATCH] Add erase to example Use defined blocksize constant --- features/filesystem/bd/HeapBlockDevice.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/features/filesystem/bd/HeapBlockDevice.h b/features/filesystem/bd/HeapBlockDevice.h index 92f1e33c27..d812beaaec 100644 --- a/features/filesystem/bd/HeapBlockDevice.h +++ b/features/filesystem/bd/HeapBlockDevice.h @@ -34,13 +34,16 @@ * #include "mbed.h" * #include "HeapBlockDevice.h" * - * HeapBlockDevice bd(2048, 512); // 2048 bytes with a block size of 512 bytes - * uint8_t block[512] = "Hello World!\n"; + * #define BLOCK_SIZE 512 + * + * HeapBlockDevice bd(2048, BLOCK_SIZE); // 2048 bytes with a block size of 512 bytes + * uint8_t block[BLOCK_SIZE] = "Hello World!\n"; * * int main() { * bd.init(); - * bd.program(block, 0, bd.get_program_size()); - * bd.read(block, 0, bd.get_read_size()); + * bd.erase(0, BLOCK_SIZE); + * bd.program(block, 0, BLOCK_SIZE); + * bd.read(block, 0, BLOCK_SIZE); * printf("%s", block); * bd.deinit(); * }