This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Global Interruption Disable/Enable

Which is the easiest way for Global Interruptions Disable/Enable in CA for LPC2129?

Varuzhan

Parents
  • As I understand, if program uses both IRQ and FIQ, the __swi function cannot be used. More, if I want to disable interruptions not for the whole function, but only for a part of code, I must write to the VICIntEnClr register as in the example. But in the example one need to disable only TIMER0 interruption. What if I need to disable all interruptions?
    If I write

    temp = VICIntEnable;
    VICIntEnClr = temp;
    ...
    VICIntEnable = temp;

    there is a risk, that if interruption happened between the two first operators, and the interrupt handler changes the value of the VICIntEnable register, a wrong value will be restored by the last operator.
    Am I wrong?
    Is there an absolutely reliable way to disable ALL interruptions for LPC2100? It is so easy in other microcontrollers.

    Varuzhan

Reply
  • As I understand, if program uses both IRQ and FIQ, the __swi function cannot be used. More, if I want to disable interruptions not for the whole function, but only for a part of code, I must write to the VICIntEnClr register as in the example. But in the example one need to disable only TIMER0 interruption. What if I need to disable all interruptions?
    If I write

    temp = VICIntEnable;
    VICIntEnClr = temp;
    ...
    VICIntEnable = temp;

    there is a risk, that if interruption happened between the two first operators, and the interrupt handler changes the value of the VICIntEnable register, a wrong value will be restored by the last operator.
    Am I wrong?
    Is there an absolutely reliable way to disable ALL interruptions for LPC2100? It is so easy in other microcontrollers.

    Varuzhan

Children