Pages: [1]   Go Down
Author Topic: Interrupts cli() & sei()  (Read 4444 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 64
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Tks
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13015
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1728
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

They are the same:

Courtesy of Arduino.h:
Code:
#define interrupts() sei()
#define noInterrupts() cli()
Logged

~Tom~

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 64
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: