Coldfire (MCF5235) Interrupt Problem

Claus, Ric claus at slac.stanford.edu
Fri May 11 17:45:16 UTC 2012


Ditto on "_old_handler".  And I suppose "TPU_INT_VECTOR" is supposed to be "_vector".

BTW, what is the purpose of the "do {...} while(0)" construct?  I've seen it used several times in RTEMS code and don't understand its purpose.  Is there some side-effect I'm not aware of?  Otherwise, why not use "{...}" by itself to introduce a new scope block?  Please educate me.

Ric


On May 11, 2012, at 10:29 AM, Cudmore, Alan P. (GSFC-5820) wrote:

> In the macro below you use "_level" but in the rtems_interrupt_enable call you use "level" without the underscore.
> 
> Could that be a problem?
> 
> Alan
> 
> On May 11, 2012, at 11:55 AM, Ivica Eftimovski wrote:
> 
>> #define TPUInterruptSetHandler(_level,_vector,_old_handler)  \
>>      do {                                                     \
>>            rtems_interrupt_disable(_level);                     \
>>            MCF5235_INTC0_IMRL &= ~(MCF5235_INTC0_IMRL_INT4 |    \
>>                      MCF5235_INTC0_IMRL_MASKALL);                 \
>>            handle_status = rtems_interrupt_catch(TPUInterruptHandler, \
>>                      TPU_INT_VECTOR, &old_handler); \
>>            rtems_interrupt_enable(level);                       \
>>      } while(0)
> 
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users





More information about the users mailing list