Add RAM location test

This commit is contained in:
Starbeamrainbowlabs 2019-09-30 18:52:48 +01:00
parent 54ecfddc7f
commit cc2fe93ed8
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 28 additions and 0 deletions

View 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() {
}