Go Down

Topic: A quick reference please sei() (Read 499 times) previous topic - next topic

greywolf271

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

Grumpy_Mike


GoForSmoke

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().

Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

greywolf271

#3
Jan 21, 2013, 10:58 pm Last Edit: Jan 21, 2013, 10:59 pm by greywolf271 Reason: 1

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

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