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/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev