cortex-m
cortex-m copied to clipboard
Enhancing the default handler
I was looking into the default handler implementation and found some (seemingly) low-hanging fruit. I wanted to get your opinion before I made any changes though.
- I think the trampoline should test link register to determine if the exception frame is referenced in MSP or PSP. I've used this code in the past.
- I think the
default_handler!
macro should include the trampoline and call the specified function with the exception frame as the argument. This would allow me to define my own handler without having to reinvent the trampoline, but it would break backward compatibility.