laanwj / k210-sdk-stuff

Kendryte K210 / MaixGo stuff
ISC License
141 stars 31 forks source link

pac::Peripherals::steal() can panic in debug #3

Closed Disasm closed 5 years ago

Disasm commented 5 years ago

Not a good idea to use it in the panic handler. It works fine in release, though.

laanwj commented 5 years ago

Oops, yes I haven't tried to use it in debug mode at all.

Should "steal" behave like that? I assumed it would unconditionally steal the peripherals. Which is unsafe when used by itself (at the least this handler should be disabling interrupts as well), but also, this is a panic handler and the attempt to deliver the message is best-effort at most.

laanwj commented 5 years ago

I think this was solved in rust-embedded/svd2rust#238