The ATmega8A manual defines the bits contained in MCUCR register at page 56.
These definitions don't match the #define
s contained in the ATmega8A I/O library supplied by avr-gcc, located at /usr/lib/avr/include/avr/iom8a.h
.
For example, the SE bit (Sleep Enable) is defined in the manual as bit 5, while in the above library it is #define SE 7
.
I haven't checked if the AVR actually misinterprets these MCUCR flags. Am I missing something here?
The data sheet seems to be wrong.
Section "14.8.1. MCUCR – MCU Control Register" on page 56 states
while section "17.1.1. MCUCR – MCU Control Register" on page 74 states
which is not possible, since bit 2 and 3 would be ambiguous.
The register summary is correct:
That means the library definitions are correct.