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.
main.cpp
00001 #include "mbed.h" 00002 00003 /** 00004 * @file StackHeapCodeDataInfo 00005 * @brief print the location of heap, stack, data and code. 00006 * @author Helmut Tschemernjak 00007 * @version 1.0 00008 */ 00009 00010 Serial *bs; 00011 00012 int main() 00013 { 00014 int temp = 0; 00015 00016 bs = new Serial(USBTX, USBRX); 00017 bs->baud(115200); 00018 00019 char *p1 = new char[4096]; 00020 00021 bs->printf(" main=0x%x\r\n", &main); 00022 bs->printf(" data=0x%x\r\n", &bs); 00023 bs->printf("stack=0x%x\r\n", &temp); 00024 bs->printf(" heap=0x%x-0x%x\r\n", p1, p1+4096); 00025 for(;;) 00026 sleep(); 00027 } 00028
Generated on Thu Jul 14 2022 07:42:33 by
1.7.2