Not sure if this is the best place to post this, but I think I found a bug in a driver file:
ac_driver.c, line 182: ((scaleFactor << AC_SCALEFAC_bp) & AC_SCALEFAC_gm); should be: ((scaleFactor << AC_SCALEFAC0_bp) & AC_SCALEFAC_gm);
Also, I think the ADC driver is not easy to use, it has too many dependencies on other files, unlike the other drivers, for example, why use
irqflags_t flags = cpu_irq_save(); ... cpu_irq_restore(flags);
and not the macros in the avr_compiler.h?
/*! \brief This macro will protect the following code from interrupts. */ #define AVR_ENTER_CRITICAL_REGION( ) uint8_t volatile saved_sreg = SREG; \ cli(); #define AVR_LEAVE_CRITICAL_REGION( ) SREG = saved_sreg;
And, I think there are some inconsistencies, why is there an ioport.c in the ASF, but a port_driver.c in the XMEGA app notes?
maybe I'm just being a newbie...