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

Interrupt enable/disable in C

Hi,

I need to disable interrupts in a small function, to keep the contents atomic. I found '__disable_irq() / __enable_irq()', but their comments state "Can only be executed in Privileged modes". As far as I know the compiled code runs in User mode. How do I switch the mode to Privileged or is there another possibility to achive my goal?

The SW runs on a STM32F051 (if that matters).

Regards, Hans