[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [bug #23850] ATMega8 does not have MCUSR defined
From: |
zohair ahmad |
Subject: |
[avr-libc-dev] [bug #23850] ATMega8 does not have MCUSR defined |
Date: |
Tue, 15 Jul 2008 06:41:35 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 |
URL:
<http://savannah.nongnu.org/bugs/?23850>
Summary: ATMega8 does not have MCUSR defined
Project: AVR C Runtime Library
Submitted by: zohair
Submitted on: Tuesday 07/15/2008 at 06:41
Category: Header
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Header files
Status: None
Percent Complete: 0%
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release: 1.6.2
Fixed Release: None
_______________________________________________________
Details:
The file avr/iom8.h does not have MCUSR defined. This could have been changed
to MCUCSR for compatibility with the datasheet, but the change was not
reflected in avr/wdt.h. Thus rendering the following code ( written in the
documentation:
http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html )
unusable for the ATMega8.
#include <stdint.h>
#include <avr/wdt.h>
uint8_t mcusr_mirror _attribute_ ((section (".noinit")));
void get_mcusr(void) \
__attribute__((naked)) \
__attribute__((section(".init3")));
void get_mcusr(void)
{
mcusr_mirror = MCUSR;
MCUSR = 0;
wdt_disable();
}
Most other controller header files have both MCUCSR and MCUSR defined for
backward compatibility. I am not sure but this may be a problem with some
other headers as well.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?23850>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [avr-libc-dev] [bug #23850] ATMega8 does not have MCUSR defined,
zohair ahmad <=