gfroerli / firmware

Firmware for the water temperature sensor project
GNU General Public License v3.0
6 stars 1 forks source link

WIP: Implement custom panic handler #99

Closed dbrgn closed 2 years ago

dbrgn commented 3 years ago

Sleep for a while until restarting to avoid draining the battery with a panic loop.

This is still WIP, I couldn't yet test the code. But @rnestler you could already take a look (especially since I had to do some unsafe things).

dbrgn commented 2 years ago

I started implementing this, but it adds a lot of complexity (because the panic handler also needs access to Rcc in order to put the device to standby using the Rtc abstraction).

I'd suggest leaving away this feature for now. If the code panic-loops, we have a problem anyways. (It sucks that the battery is drained quickly, but we could improve this in a future version.)