Desktop screenshot with two terminal windows. The left window has a text editor with some C code:
#include <stdio.h>
#include "pico/stdlib.h"
void handle_panic(void) {
printf("%f\n", 3.1415926f);
while (1);
}
int main(void) {
stdio_init_all();
sleep_ms(5000);
printf("%f\n", 3.1415926f);
panic("test");
}
The right window shows a serial communication session with a Raspberry Pi Pico. The Pico has printed
3.141593
2.000000
(The last number should of course also be 3.141593 based on the C code.)
can anyone explain why the Pi Pico SDK's printf thinks pi=2 when called from inside a panic handler
#raspberrypi #embedded