mbed_example / Mbed OS HeapBlockDevice_ex_1

main.cpp

Committer:
kgilbert
Date:
2017-10-10
Revision:
1:fbc7acd77a77
Parent:
0:acdc1ce79ab5
Child:
2:e29db7517d42

File content as of revision 1:fbc7acd77a77:

#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.read(block, 0);
    printf("%s", block);
    bd.deinit();
}