Nuvoton
/
NuMaker-mbed-noXRAM-example
NuMaker without external SRAM configuration
main.cpp
- Committer:
- ccli8
- Date:
- 2017-03-01
- Revision:
- 1:a3b9047e5ae0
- Parent:
- 0:763694026416
File content as of revision 1:a3b9047e5ae0:
#include "mbed.h" // main() runs in its own thread in the OS int main() { while (true) { void *heap = new uint8_t[32]; uint32_t heap_ = ((uint32_t) heap) & 0xF0000000; switch (heap_) { case 0x20000000: printf("Heap allocated at 0x%08x (IRAM)\r\n", heap); break; case 0x60000000: printf("Heap allocated at 0x%08x (XRAM)\r\n", heap); break; default: printf("Heap allocated at 0x%08x (ILLEGAL)\r\n", heap); } delete [] heap; heap = NULL; wait(2.0); } return 0; }