avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bugs #10489] Sleep.h omission for atmega48/88/168 family


From: anonymous
Subject: [avr-libc-dev] [bugs #10489] Sleep.h omission for atmega48/88/168 family
Date: Fri, 24 Sep 2004 18:04:26 -0400
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

This mail is an automated notification from the bugs tracker
 of the project: AVR C Runtime Library.




/**************************************************************************/
[bugs #10489] Full Item Snapshot:

URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=10489>
Project: AVR C Runtime Library
Submitted by: 0
On: Fri 09/24/2004 at 17:57

Category:  Header
Severity:  5 - Average
Item Group:  None
Resolution:  None
Privacy:  Public
Assigned to:  None
Originator Email:  address@hidden
Status:  Open


Summary:  Sleep.h omission for atmega48/88/168 family

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" "nt" :: ); 
         SMCR &= ~_BV(SE);                         
        }
# else
#  define sleep_mode() 
        {                                              
         MCUCR |= _BV(SE);                          
         __asm__ __volatile__ ("sleep" "nt" :: ); 
         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 







File Attachments
-------------------

-------------------------------------------------------
Date: Fri 09/24/2004 at 17:57  Name: sleep.h  Size: 5.08KB   By: None
Proposed change for sleep.h
http://savannah.nongnu.org/bugs/download.php?item_id=10489&amp;item_file_id=1705






For detailed info, follow this link:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=10489>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]