ysbaddaden / nanolib.cr

16 stars 0 forks source link

Panic handlers (customizable) #2

Open ysbaddaden opened 4 months ago

ysbaddaden commented 4 months ago

The panic handler is very nice on CPU with an operating system, a standard error, etc. but they won't fare well on microcontrollers such as AVR or RP2040.

We should have different kinds of default panic handlers to choose from, as well as the ability to have a customer panic handler. For example on AVR we could enter an infinite loop, with the option to make a led blink N times to report the error status.

See https://docs.rust-embedded.org/book/start/panicking.html for examples.