avr-libc
avr-libc copied to clipboard
[bug #37847] Xmega power.h groupings are wrong
Sat 01 Dec 2012 01:34:10 AM CET
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().
This issue was migrated from https://savannah.nongnu.org/bugs/?37847
Pitchumani
This is fixed by patch #8563. https://savannah.nongnu.org/patch/?func=detailitem&item_id=8563