X-Git-Url: http://git.kpe.io/?p=avr_serial_lcd.git;a=blobdiff_plain;f=serial_lcd.c;h=bef0e8c463f004adf5e54eed0adaaca9be901741;hp=dc375fddf158cebe842ac39c929cf63e2ac95863;hb=HEAD;hpb=33392d88dc86a994345ea22358d6bde02fc9c93e diff --git a/serial_lcd.c b/serial_lcd.c index dc375fd..bef0e8c 100644 --- a/serial_lcd.c +++ b/serial_lcd.c @@ -26,12 +26,12 @@ #if defined(__GNUC__) //FUSES = { -// .low = SUT1, +// .low = SUT1, // .high = (unsigned char) (DWEN & WDTON & RSTDISBL & BODLEVEL1 & BODLEVEL2), // .extended = EFUSE_DEFAULT, //}; #endif - + // Number of PWM brightness levels supported #define LED_BRIGHTNESS_LEVELS 8 @@ -40,20 +40,20 @@ #define LCD_ON 0x0C // Clear display command #define LCD_CLR 0x01 -// Set 4 data bits -#define LCD_4_Bit 0x20 -// Set 8 data bits -#define LCD_8_Bit 0x30 -// Set number of lines -#define LCD_4_Line 0x08 +// Set 4 data bits +#define LCD_4_Bit 0x20 +// Set 8 data bits +#define LCD_8_Bit 0x30 +// Set number of lines +#define LCD_4_Line 0x08 // Set 8 data bits #define DATA_8 0x30 -// Set character font -#define LCD_Font 0x04 -// Turn the cursor on -#define LCD_CURSOR_ON 0x02 -// Turn on cursor blink -#define LCD_CURSOR_BLINK 0x01 +// Set character font +#define LCD_Font 0x04 +// Turn the cursor on +#define LCD_CURSOR_ON 0x02 +// Turn on cursor blink +#define LCD_CURSOR_BLINK 0x01 ////// Serial command codes /////// // ASCII control code to set brightness level @@ -419,14 +419,9 @@ unsigned char LcdBusyWait (void) { return (LCDStatus); } -#if defined(__IMAGECRAFT__) -#pragma interrupt_handler usart_rx_handler:iv_USART0_RXC -void usart_rx_handler(void) -#else -ISR(USART_RX_vect) -#endif -{ - unsigned char rx, tmphead; +INLINE_FUNC_DECLARE(static void UartStoreRx (uint8_t rx)); +static inline void UartStoreRx (uint8_t rx) { + unsigned char tmphead; if (UCSRA & (1<