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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #23850: ATMega8 does not have MCUSR defined

Submitter:  zohair ahmad <zohair>
Submitted:  Tue 15 Jul 2008 06:41:33 AM UTC
   
 
Category:  Header Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Header files
Status:  Fixed Assigned to:  arcanum
Percent Complete:  100% Open/Closed:  Closed
Release:  1.6.2 Fixed Release:  1.7.0

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.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-07-18 arcanum StatusNone Fixed
        Percent Complete0% 100%
        Assigned toNone arcanum
        Open/ClosedOpen Closed
        Fixed ReleaseNone 1.7.0

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code