Fixed broken USE_RAM_DESCRIPTORS compile time option when the FIXED_NUM_CONFIGURATION...
[pub/USBasp.git] / Projects / SerialToLCD / SerialToLCD.c
index 8134014..007f3ad 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2012.
+     Copyright (C) Dean Camera, 2015.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2015  Dean Camera (dean [at] fourwalledcubicle [dot] com)
   Copyright 2012  Simon Foster (simon.foster [at] inbox [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
@@ -29,7 +29,7 @@
   this software.
 */
 
-/** \file 
+/** \file
  *
  *  Main source file for the SerialToLCD program. This file contains the main tasks of
  *  the project and is responsible for the initial application hardware configuration.
@@ -51,7 +51,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC_TX_EPADDR,
@@ -101,7 +101,7 @@ int main(void)
                {
                        static uint8_t EscapePending = 0;
                        int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer);
-                       
+
                        if (HD44780Byte == COMMAND_ESCAPE)
                        {
                                if (EscapePending)
@@ -137,12 +137,14 @@ int main(void)
 /** Configures the board hardware and chip peripherals for the application'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);
+#endif
 
        /* Hardware Initialization */
        USB_Init();
@@ -150,7 +152,7 @@ void SetupHardware(void)
        /* Power up the HD44780 Interface */
        HD44780_Initialize();
        HD44780_WriteCommand(CMD_DISPLAY_ON);
-       
+
        /* Start the flush timer so that overflows occur rapidly to push received bytes to the USB interface */
        TCCR0B = (1 << CS02);
 }