Get rid of the redundant ATTR_NEVER_INLINE macro which translated to the same as...
[pub/USBasp.git] / Demos / Device / Incomplete / TestAndMeasurement / TestAndMeasurement.c
index ac14066..4bd7027 100644 (file)
@@ -93,12 +93,24 @@ int main(void)
 /** Configures the board hardware and chip peripherals for the demo's functionality. */
 void SetupHardware(void)
 {
+#if (ARCH == ARCH_AVR8)
        /* Disable watchdog if enabled by bootloader/fuses */
        MCUSR &= ~(1 << WDRF);
        wdt_disable();
 
        /* Disable clock division */
        clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+       /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+       XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+       XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+       /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+       XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+       XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+       PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
 
        /* Hardware Initialization */
        LEDs_Init();
@@ -407,7 +419,7 @@ void TMC_Task(void)
  *
  *  \param[out] MessageHeader  Pointer to a location where the read header (if any) should be stored
  *
- *  \return Boolean true if a header was read, false otherwise
+ *  \return Boolean \c true if a header was read, \c false otherwise
  */
 bool ReadTMCHeader(TMC_MessageHeader_t* const MessageHeader)
 {