mbed_example
/
HeapBlockDevice_ex_1
Example for HeapBlockDevice use
main.cpp
- Committer:
- kgilbert
- Date:
- 2017-10-10
- Revision:
- 2:e29db7517d42
- Parent:
- 1:fbc7acd77a77
- Child:
- 3:5991e7053465
File content as of revision 2:e29db7517d42:
#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"; int main() { bd.init(); bd.program(block, 0, bd.get_program_size()); bd.read(block, 0, bd.get_read_size()); printf("%s", block); bd.deinit(); }