avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #37847] Xmega power.h groupings are wrong


From: Erik Walthinsen
Subject: [avr-libc-dev] [bug #37847] Xmega power.h groupings are wrong
Date: Sat, 01 Dec 2012 00:34:11 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0

URL:
  <http://savannah.nongnu.org/bugs/?37847>

                 Summary: Xmega power.h groupings are wrong
                 Project: AVR C Runtime Library
            Submitted by: omega
            Submitted on: Fri 30 Nov 2012 04:34:10 PM PST
                Category: Header
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
        Percent Complete: 0%
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.8.0
           Fixed Release: None

    _______________________________________________________

Details:

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




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?37847>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]