X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/bd3f6794dd95c8a8895b3cf25de3332bda603241..3c1b28cf5ff16fede61f2abf37d5616f3e661036:/Projects/SerialToLCD/SerialToLCD.c diff --git a/Projects/SerialToLCD/SerialToLCD.c b/Projects/SerialToLCD/SerialToLCD.c index 59522b351..b94c5a4a2 100644 --- a/Projects/SerialToLCD/SerialToLCD.c +++ b/Projects/SerialToLCD/SerialToLCD.c @@ -99,27 +99,28 @@ int main(void) 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) { - if (escape_pending) + if (EscapePending) { HD44780_WriteData(HD44780Byte); - escape_pending = 0; + EscapePending = 0; } else { - escape_pending = 1; + /* Next received character is the command byte */ + EscapePending = 1; } } else { - if (escape_pending) + if (EscapePending) { HD44780_WriteCommand(HD44780Byte); - escape_pending = 0; + EscapePending = 0; } else { @@ -147,7 +148,7 @@ void SetupHardware(void) 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 */ @@ -157,9 +158,7 @@ void SetupHardware(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. */