Complete the code to enable global interrupts.
sei(); // Call the function to [1] interruptsThe sei() function enables global interrupts in embedded C.
Complete the code to disable global interrupts.
cli(); // Call the function to [1] interruptsThe cli() function disables global interrupts in embedded C.
Fix the error in the code to enable interrupts.
void enable_interrupts() {
[1]();
}
cli() instead of sei()The correct function to enable interrupts is sei(). Using cli() disables them.
Fill both blanks to disable interrupts and then enable them again.
void toggle_interrupts() {
[1]();
// some code
[2]();
}
First, cli() disables interrupts, then sei() enables them again.
Fill all three blanks to check if interrupts are enabled, and disable them if yes.
if ([1] & (1 << [2])) { [3](); }
The SREG register holds the interrupt flag I. If set, interrupts are enabled. Then cli() disables them.
