mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #5292 from kegilbert/HeapBlockDevice-ex-update
Update HeapBlockDevice examplepull/4955/head
commit
20d93bf78d
|
@ -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.read(block, 0);
|
||||
* bd.erase(0, BLOCK_SIZE);
|
||||
* bd.program(block, 0, BLOCK_SIZE);
|
||||
* bd.read(block, 0, BLOCK_SIZE);
|
||||
* printf("%s", block);
|
||||
* bd.deinit();
|
||||
* }
|
||||
|
|
Loading…
Reference in New Issue