[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [uracoli-devel] regarding the hif_put_blk() function
From: |
Charles Goyard |
Subject: |
Re: [uracoli-devel] regarding the hif_put_blk() function |
Date: |
Sat, 12 Jun 2010 22:35:39 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi all,
rifo rifo wrote:
> This is my first post to uracoli list.
Me too ;). Welcome !
> why don't we use a sei() at the end of the hif_put_blk() function.
That's a very common pattern in avr code :
- store current status of SREG ;
- disable interrupts, regardless of wether they are enabled or not
(faster than test && disable) ;
- do uninterruptible stuff ;
- restore the previous state of SREG.
It is done that way so that if interrupts where disabled before calling
the function, we don't enable them.
Hope that helps,
--
Charles