X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/359fbfe14d00ab378f85a36664820ea9ba538c3f..3642ea0b9715cdf0196b10c9fc97898940eaefa6:/Projects/SerialToLCD/SerialToLCD.c?ds=inline diff --git a/Projects/SerialToLCD/SerialToLCD.c b/Projects/SerialToLCD/SerialToLCD.c index 952e2d4f2..007f3adb1 100644 --- a/Projects/SerialToLCD/SerialToLCD.c +++ b/Projects/SerialToLCD/SerialToLCD.c @@ -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 @@ -19,7 +19,7 @@ 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 @@ -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, @@ -83,7 +83,7 @@ int main(void) RingBuffer_InitBuffer(&FromHost_Buffer, FromHost_Buffer_Data, sizeof(FromHost_Buffer_Data)); - sei(); + GlobalInterruptEnable(); for (;;) { @@ -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,20 +137,22 @@ 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(); /* 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 */ TCCR0B = (1 << CS02); }