2 Replies Latest reply on May 15, 2018 8:26 PM by scnoc_1258126

    Preserve global interrupt status?



      I am still learning about the Cortex architecture after many years using 8 bitters; apologies if this is too simple....


      Is there a way to store the global interrupt enable status prior to entering a critical code section?


      For example, in AVR, you can preserve the global interrupt state with, instead of a naive cli(); sei();


      uint8_t sreg = SREG; //preseve global mask state

      cli(); //disable global interrupts


      //do something critical


      SREG = sreg; //restore global state


      How is this done w/ PSOC 6?


      Thanks in advance...