Bug in set_sleep_mode() for at least ATMEGA8515
Brought to you by:
slz
ATMEGA8515 chip have three sleep mode bits SM0, SM1 and SM2
located at different registers EMCUCR.7, MCUCR.4 and MCUCSR.5
respectively.
But set_sleep_mode() for ATMEGA8515 defined:
# define set_sleep_mode(mode) (MCUCR = ((MCUCR &
~_SLEEP_MODE_MASK) | (mode)))
And set_sleep_mode(SLEEP_MODE_IDLE) doing:
MCUCR = ((MCUCR & 0x4F) | (0x00))
or another words:
SRE=0, SE=0 and SM1=0;
--
Unrau Alexander
Logged In: YES
user_id=21260
Have to fix by avr-libc developers. Please inform the
related project:
http://savannah.nongnu.org/projects/avr-libc