This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to disable IRQ to stop occuring uart_evt_handler() for a short time

After I process some data (command) received by UART fifo module (I have installed handler for APP_UART_DATA_READY) I need to do a short atomic operation of a few instructions. What is the best way to disable interrupt(s) in this case? Is NVIC_DisableIRQ(UART0_IRQn) or sd_nvic_DisableIRQ(UART0_IRQn) enough? Or can I use sd_nvic_critical_region_enter() / exit - afaik this disable some other IRQs that I don't care...

Related