Allow the title of top level pages to be overridden in the Atmel Studio help.
[pub/USBasp.git] / Projects / SerialToLCD / SerialToLCD.c
index 59522b3..385bcde 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2012.
+     Copyright (C) Dean Camera, 2013.
 
   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 2013  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
@@ -83,7 +83,7 @@ int main(void)
 
        RingBuffer_InitBuffer(&FromHost_Buffer, FromHost_Buffer_Data, sizeof(FromHost_Buffer_Data));
 
 
        RingBuffer_InitBuffer(&FromHost_Buffer, FromHost_Buffer_Data, sizeof(FromHost_Buffer_Data));
 
-       sei();
+       GlobalInterruptEnable();
 
        for (;;)
        {
 
        for (;;)
        {
@@ -99,27 +99,28 @@ int main(void)
 
                while (RingBuffer_GetCount(&FromHost_Buffer) > 0)
                {
 
                while (RingBuffer_GetCount(&FromHost_Buffer) > 0)
                {
-                       static uint8_t escape_pending = 0;
+                       static uint8_t EscapePending = 0;
                        int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer);
                        
                        if (HD44780Byte == COMMAND_ESCAPE)
                        {
                        int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer);
                        
                        if (HD44780Byte == COMMAND_ESCAPE)
                        {
-                               if (escape_pending)
+                               if (EscapePending)
                                {
                                        HD44780_WriteData(HD44780Byte);
                                {
                                        HD44780_WriteData(HD44780Byte);
-                                       escape_pending = 0;
+                                       EscapePending = 0;
                                }
                                else
                                {
                                }
                                else
                                {
-                                       escape_pending = 1;
+                                       /* Next received character is the command byte */
+                                       EscapePending = 1;
                                }
                        }
                        else
                        {
                                }
                        }
                        else
                        {
-                               if (escape_pending)
+                               if (EscapePending)
                                {
                                        HD44780_WriteCommand(HD44780Byte);
                                {
                                        HD44780_WriteCommand(HD44780Byte);
-                                       escape_pending = 0;
+                                       EscapePending = 0;
                                }
                                else
                                {
                                }
                                else
                                {
@@ -147,7 +148,7 @@ void SetupHardware(void)
        USB_Init();
 
        /* Power up the HD44780 Interface */
        USB_Init();
 
        /* Power up the HD44780 Interface */
-       HD44780_Initialise();
+       HD44780_Initialize();
        HD44780_WriteCommand(CMD_DISPLAY_ON);
        
        /* Start the flush timer so that overflows occur rapidly to push received bytes to the USB interface */
        HD44780_WriteCommand(CMD_DISPLAY_ON);
        
        /* Start the flush timer so that overflows occur rapidly to push received bytes to the USB interface */
@@ -157,9 +158,7 @@ void SetupHardware(void)
 /** Event handler for the library USB Configuration Changed event. */
 void EVENT_USB_Device_ConfigurationChanged(void)
 {
 /** Event handler for the library USB Configuration Changed event. */
 void EVENT_USB_Device_ConfigurationChanged(void)
 {
-       bool ConfigSuccess = true;
-
-       ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
+       CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
 }
 
 /** Event handler for the library USB Control Request reception event. */
 }
 
 /** Event handler for the library USB Control Request reception event. */