Pages: [1]   Go Down
Author Topic: A quick reference please sei()  (Read 440 times)
0 Members and 1 Guest are viewing this topic.
Land of Oz
Offline Offline
Jr. Member
**
Karma: 3
Posts: 73
I dream in Assembler
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
If anyone can provide a quick reference..........
Is  sei()  an AVR assembler macro ?
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34551
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It enables interrupts.
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

reference from AVR LibC

http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
Quote
#define sei    (       )    

Enables interrupts by setting the global interrupt mask. This function actually compiles into a single line of assembly, so there is no function call overhead. However, the macro also implies a memory barrier which can cause additional loss of optimization.

In order to implement atomic access to multi-byte objects, consider using the macros from <util/atomic.h>, rather than implementing them manually with cli() and sei().
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Land of Oz
Offline Offline
Jr. Member
**
Karma: 3
Posts: 73
I dream in Assembler
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

reference from AVR LibC

http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html


           Many thanks, exactly what I was trying to locate
« Last Edit: January 21, 2013, 04:59:47 pm by greywolf271 » Logged

Pages: [1]   Go Up
Jump to: