bugAVR C Runtime Library - Bugs: bug #23850, ATMega8 does not have MCUSR defined

 
 

bug #23850: ATMega8 does not have MCUSR defined

Submitted by:  zohair ahmad <zohair>
Submitted on:  Tue 15 Jul 2008 06:41:33 AM UTC  
 
Category: HeaderSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Header files
Status: FixedPercent Complete: 100%
Assigned to: Eric Weddington <arcanum>Open/Closed: Closed
Release: 1.6.2Fixed Release: 1.7.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 15 Jul 2008 06:41:33 AM UTC, original submission:

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.

zohair ahmad <zohair>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by arcanum (Updated the item)
  • -unavailable- added by zohair (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 Jul 2008 04:10:28 AM UTCarcanumStatusNone=>Fixed
      Percent Complete0%=>100%
      Assigned toNone=>arcanum
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>1.7.0

    Back to the top


    Powered by Savane 3.1-cleanup1