Go Down

Topic: Interrupts cli() & sei() (Read 5358 times) previous topic - next topic

OzGrant

G'day,
Have seen a few sketches use cli() and sei().

How do they differ from noInterrupts() & interrupts(), and are they interchangeable.

Tks

Coding Badly


Interchangeable.  The latter is presumably more portable in case you're considering the Due.

Tom Carpenter

They are the same:

Courtesy of Arduino.h:
Code: [Select]

#define interrupts() sei()
#define noInterrupts() cli()
~Tom~

OzGrant

Tom,
Fantastic, tks for the info (heck had to wait nearly 5 minutes for the answer, you will just have to do better next time).
Grant

Go Up