Serial.println((unsigned long )foo,HEX);
uint32_t ff = (uint32_t)*foo;
Serial.println(ff,HEX);
(thanks for the fast help.)
Explore... Chat... Share...
Serial.println((unsigned long )foo,HEX);
uint32_t ff = (uint32_t)*foo;
Serial.println(ff,HEX);
int fubar(void) {
return random(100);
}
void setup() {
delay(5000);
Serial.begin(115200);
char *foo;
foo=(char *)&fubar;
Serial.print("Addr: ");
Serial.println((unsigned long )foo,HEX);
Serial.print("Value: ");
Serial.println((byte)*(unsigned long*)foo); // <-- should not reboot here provided that foo is aligned.
}
Addr: 40210834
Value:
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
ReinholdHiller wrote:But it does.Addr: 40210834
Value:
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
int fubar(void) {
return random(100);
}
void setup() {
delay(5000);
Serial.begin(115200);
char *foo;
foo=(char *)&fubar;
Serial.print("Addr: ");
Serial.println((unsigned long )foo,HEX);
Serial.print("Value: ");
Serial.println((byte)*(volatile unsigned long*)foo); // <-- does not reboot here provided that foo is aligned.
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]