Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ChainingBlockDevice_ex_1 by
main.cpp
00001 #include "mbed.h" 00002 #include "HeapBlockDevice.h" 00003 #include "ProfilingBlockDevice.h" 00004 00005 #define BLOCK_SIZE 512 00006 00007 HeapBlockDevice bd(2048, BLOCK_SIZE); // 2048 bytes with a block size of 512 bytes 00008 uint8_t block[BLOCK_SIZE] = "Hello World!\n"; 00009 00010 int main() { 00011 ProfilingBlockDevice profiler(&bd); 00012 profiler.init(); 00013 profiler.erase(0, BLOCK_SIZE); 00014 profiler.program(block, 0, BLOCK_SIZE); 00015 profiler.read(block, 0, BLOCK_SIZE); 00016 00017 printf("%s", block); 00018 printf("read count: %lld\n", profiler.get_read_count()); 00019 printf("program count: %lld\n", profiler.get_program_count()); 00020 printf("erase count: %lld\n", profiler.get_erase_count()); 00021 }
Generated on Wed Jul 20 2022 03:29:14 by
1.7.2
