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

 
 

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

bug #37847: Xmega power.h groupings are wrong

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

Mon 09 Mar 2015 06:41:28 AM UTC, comment #1: 
Pitchumani <pitchumani>
Group 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.)

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.13-cf05.
    Corresponding source code