Table of Contents
This page discusses some of the things you may want to do with relation to interrupts.
Enabling and Disabling Interrupts¶
In some cases, you may want to ensure a section of code is not interrupted. For example, you might be talking to a peripheral where the whole transaction must happen in one go, and an interrupt could cause the operation to fail.
The simplest way to avoid this is to disable interrupts for the critical section of your code:
__disable_irq(); // Disable Interrupts // do something that can't be interrupted __enable_irq(); // Enable Interrupts
Posting comments for this page has been disabled