You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to interact with the MSP430's various low power modes?
In C this is done through compiler intrinsics like __bis_SR_register() and __bic_SR_register_on_exit().
The text was updated successfully, but these errors were encountered:
An optimized inline asm implementation needs to know the surrounding codegen before codegen actually occurs.
A Rust implementation of the intrinsics requires an LLVM feature that is likely to never be stabilized.
A slightly less optimal version using naked functions should be possible, where the outer naked interrupt handler- the one that the vector points to- immediately calls an inner interrupt function. I've never personally implemented this, but @pftbest gave an example code snippet1. I also believe @vadixidav got it working, and I never followed up.
Note that the code snippet implements a hypothetical __bis_SR_register_on_entry() :P. I think on_exit semantics would require pushing a fake return address and flags onto the stack, and then jmping to the inner function, and then bic, since the inner function will end with reti.
It has been a while since I touched this. We ended up not using MSP430 ultimately, so I didn't feel the need to continue working on this. Everything I did should be available in the fork I have. If something is missing (downstream), let me know, and I might be able to dig it up.
Hi,
Is there any way to interact with the MSP430's various low power modes?
In C this is done through compiler intrinsics like
__bis_SR_register()
and__bic_SR_register_on_exit()
.The text was updated successfully, but these errors were encountered: