Am 19.09.2002 21:36:53, schrieb dimmy <[email protected]>: >> MSPGCC has _BIC_SR and BIS_SR, but is there a construct equivalent to >> _BIC_SR_IRQ in the IAR and Quadravox packages? > > >What's that?
its used to set/clear bits of the SR that is on the stack during an interrupt. so that you can wake up after an interrupt by doing _BIC_SR_IRQ(LMP4_bits); anywhere in the code. the simpler _BIC_SR and _BIS_SR are already in gcc, somewhere in the iomacros.h. >I believe that now almost everything can be effeciently coded in C. with _BIC_SR_IRQ and _BIS_SR_IRQ you have finer control than with the "wakeup" attribute. with "wakeup" is the cpu activated in any case but with the macros it's possible to activate the cpu only on cetain conditions (e.g. with an "if") the "*IRQ" macros are only allowed within an interrupt function. >Has anybody any suggestions about the code output? Or some additional >futures... ? just calculate the difference to the saved SP on the stack within an irq and modify the bits there. (gcc internals: is "FP" pointing at the TOS before pushing the regs or do you have eliminated FP? maybe something can be done with GET_FRAME_ADDR(name)?) _BIS_SR_IRQ(x) -> bis x, diff_to_svaedSP(r1), chris
