bugAVR C Runtime Library - Bugs: bug #37847, Xmega power.h groupings are wrong

 
 

bug #37847: Xmega power.h groupings are wrong

Submitted by:  Erik Walthinsen <omega>
Submitted on:  Sat 01 Dec 2012 12:34:10 AM UTC  
 
Category:  Header Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Percent Complete:  0%
Assigned to:  None Open/Closed:  Open
Release:  1.8.0 Fixed Release:  None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 09 Mar 2015 06:41:28 AM UTC, comment #1:

This is fixed by patch #8563.
https://savannah.nongnu.org/patch/?func=detailitem&item_id=8563

Pitchumani <pitchumani>
Project Member
Sat 01 Dec 2012 12:34:10 AM UTC, original submission:

In working on a patch to add all xmega devices, I ran across the power.h code. The problem is that the groupings don't actually match the functionality of the various devices, and even within those groups some of the macros aren't consistent.

I'd propose that rather than defining them based on the individual chip macros, that each of the power_*_enable() and power_*_disable() macros be #ifdef'd based on whether the peripheral itself is defined:

#ifdef USARTF1
#define power_usartf1_enable() (PR_PRPF &= (uint8_t)~(PR_USART1_bm))
#define power_usartf1_disable() (PR_PRPF |= (uint8_t)PR_USART1_bm)
#endif

The _enable_all and _disable_all are a slightly tougher nut to crack, but that could be solved by adding in before the #endif a:

#define __power_usartf1_mask ((uint8_t)PR_USART1_bm)
#else
#define __power_usartf1_mask (0)

Then grouping all these macros together into a single pair of definitions for _all().

Erik Walthinsen <omega>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27005:  power.h added by omega (11KiB - text/x-chdr - Included full example of alternate power_() macros for Xmega)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pitchumani (Posted a comment)
  • -email is unavailable- added by omega (Submitted the item)
  •  

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-09 pitchumani StatusNone => Fixed
    2012-12-01 omega Attached File- => Added power.h, #27005

    Back to the top


    Powered by Savane 3.3