patchAVR C Runtime Library - Patches: patch #4611, sleep.h sleep_mode() not interrupt...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4611: sleep.h sleep_mode() not interrupt safe

Submitter:  Risto Eerola <eerola>
Submitted:  Fri 11 Nov 2005 05:42:37 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  joerg_wunsch Open/Closed:  Closed

Tue 27 Dec 2005 10:44:49 PM UTC, comment #1: 

I just committed your patch to CVS, with the sleep() macro
name changed into sleep_cpu() (so it still starts with the
word "sleep" but cannot be confused with the Posix function
sleep()), and without the sleep_if() macro.  There has been
some discussion in avr-gcc-list, namely

http://lists.gnu.org/archive/html/avr-gcc-list/2005-12/msg00088.html

convinced me to rather add some explanation and an example
about how to use the other macros to get the effect of an
atomic test-and-sleep functionality.

Joerg Wunsch <joerg_wunsch>
Group administrator
Fri 11 Nov 2005 05:42:37 PM UTC, original submission:  

Attached is a new sleep.h with the following macros added at the end:

sleep_enable()
sleep_disable()
sleep()
sleep_if(condition)

First three will break the old sleep_mode()into parts allowing sei()to be added before sleep().
The last one combines them and sei() into an atomic "test-and-sleep" action where the condition is checked.

-Ripa

Risto Eerola <eerola>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #6280:  sleep.h added by eerola (8KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-27 joerg_wunsch StatusNone Done
    Assigned toNone joerg_wunsch
    Open/ClosedOpen Closed
2005-11-11 eerola Attached File- Added sleep.h, #5460

Back to the top

Powered by Savane 3.13-3230.
Corresponding source code