From: Kevin Rosenberg Date: Mon, 31 Mar 2008 00:25:36 +0000 (-0600) Subject: add -fwhole-program X-Git-Url: http://git.kpe.io/?p=avr_serial_lcd.git;a=commitdiff_plain;h=32f563c436c2f9ae80b083280b54aa24af7f5398 add -fwhole-program --- diff --git a/gcc_c/Makefile b/gcc_c/Makefile index 65d5f15..5b9ade7 100644 --- a/gcc_c/Makefile +++ b/gcc_c/Makefile @@ -12,7 +12,7 @@ COMMON = -mmcu=$(MCU) ## Compile options common for all C compilation units. CFLAGS = $(COMMON) -CFLAGS += -gdwarf-2 -DF_CPU=14745600UL -Os +CFLAGS += -gdwarf-2 -DF_CPU=14745600UL -Os -combine -fwhole-program CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wa,-adhlns=./$(*F).lst CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections CFLAGS += -MMD -MP -MT $(*F).o -MF .dep/$(@F).d diff --git a/serial_lcd.c b/serial_lcd.c index dc375fd..b611fa1 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 @@ -434,12 +434,12 @@ ISR(USART_RX_vect) // erroroneous byte received return; } -#if HANDLE_DATA_OVER_RUN_ERROR +#ifdef HANDLE_DATA_OVER_RUN_ERROR if (UCSRA & (1<