Go Down

Topic: Interrupts cli() & sei() (Read 7082 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy