Update Studio Integration DLL, to include package logging.
[pub/USBasp.git] / Projects / SerialToLCD / SerialToLCD.c
index 21f3e4a..007f3ad 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2012.
+     Copyright (C) Dean Camera, 2015.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   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
   Copyright 2012  Simon Foster (simon.foster [at] inbox [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
@@ -19,7 +19,7 @@
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
-  The author disclaim all warranties with regard to this
+  The author disclaims all warranties with regard to this
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
@@ -29,7 +29,7 @@
   this software.
 */
 
   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.
  *
  *  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 =
                        {
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC_TX_EPADDR,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC_TX_EPADDR,
@@ -101,7 +101,7 @@ int main(void)
                {
                        static uint8_t EscapePending = 0;
                        int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer);
                {
                        static uint8_t EscapePending = 0;
                        int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer);
-                       
+
                        if (HD44780Byte == COMMAND_ESCAPE)
                        {
                                if (EscapePending)
                        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)
 {
 /** 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);
        /* 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();
 
        /* Hardware Initialization */
        USB_Init();
@@ -150,7 +152,7 @@ void SetupHardware(void)
        /* Power up the HD44780 Interface */
        HD44780_Initialize();
        HD44780_WriteCommand(CMD_DISPLAY_ON);
        /* 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);
 }
        /* Start the flush timer so that overflows occur rapidly to push received bytes to the USB interface */
        TCCR0B = (1 << CS02);
 }