Add RAM location test
This commit is contained in:
parent
54ecfddc7f
commit
cc2fe93ed8
1 changed files with 28 additions and 0 deletions
28
RamLocationTest/RamLocationTest.ino
Normal file
28
RamLocationTest/RamLocationTest.ino
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
struct Test {
|
||||||
|
uint32_t a;
|
||||||
|
char b;
|
||||||
|
};
|
||||||
|
|
||||||
|
Test global_var;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Serial.begin(115200);
|
||||||
|
|
||||||
|
Test stack;
|
||||||
|
Test* heap = new Test();
|
||||||
|
|
||||||
|
Serial.print(F("Stack location: "));
|
||||||
|
Serial.println((uint32_t)(&stack), DEC);
|
||||||
|
|
||||||
|
Serial.print(F("Heap location: "));
|
||||||
|
Serial.println((uint32_t)heap, DEC);
|
||||||
|
|
||||||
|
Serial.print(F("Global location: "));
|
||||||
|
Serial.println((uint32_t)&global_var, DEC);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue