bugAVR C Runtime Library - Bugs: bug #10489, Sleep.h omission for...

 
 

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

bug #10489: Sleep.h omission for atmega48/88/168 family

Submitter:  None
Submitted:  Fri 24 Sep 2004 09:57:42 PM UTC
   
 
Category:  Header Severity:  6 - Security
Priority:  9 - Immediate Item Group:  None
Status:  Fixed Assigned to:  arcanum
Percent Complete:  100% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Wed 22 Dec 2004 10:48:33 PM UTC, comment #1: 

Set to 100%, fix is not yet committed. Waiting for

Eric Weddington <arcanum>
Group administrator
Fri 24 Sep 2004 09:57:42 PM UTC, original submission:  

To support the ATMega48/88/168 family, the sleep_mode() #define in sleep.h file needs to include a branch for "if SMCR defined".  The set_sleep_mode() function had this branch, but not sleep_mode().  The SE bit resides in the SMCR register on these devices.


#if defined(DOXYGEN)
extern void sleep_mode (void);
#else
# if defined (SMCR)
#  define sleep_mode() \
{                                              \
     SMCR |= _BV(SE);                          \
_asm_ __volatile__ ("sleep" "\n\t" :: ); \
SMCR &= ~_BV(SE);                         \
}
# else
#  define sleep_mode() \
{                                              \
MCUCR |= _BV(SE);                          \
_asm_ __volatile__ ("sleep" "\n\t" :: ); \
MCUCR &= ~_BV(SE);                         \
}
# endif
#endif

Attached is a proposed fix. It is based on V1.6 of sleep.h, since I get the following compiler error at the lines where I call set_sleep_mode in 1.7 (and 1.6.2.1): 

error: parse error before '}' token

during compilewhen it inserts the


Anonymous

 

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

Attached Files
file #1800:  sleep.h added by None (5KiB - text/plain - Proposed change for sleep.h)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-12-30 arcanum StatusNone Fixed
    Open/ClosedOpen Closed
2004-12-22 arcanum Percent Complete0% 100%
2004-12-22 arcanum Priority5 - Normal 9 - Immediate
2004-12-21 arcanum Severity3 - Normal 6 - Security
2004-11-22 arcanum Assigned toNone arcanum
2004-09-24 None Attached File- Added sleep.h, #1705

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code