Corrected EOL (and EOL fixup script)

This commit is contained in:
skarg
2010-06-01 19:43:15 +00:00
parent 5964f49880
commit ed40541c36
4 changed files with 32 additions and 28 deletions
+6 -3
View File
@@ -1,15 +1,18 @@
#!/bin/sh #!/bin/sh
# fix DOS/Unix names and Subversion EOL-Style, and remove backup files # fix DOS/Unix names and Subversion EOL-Style, and remove backup files
#DOS2UNIX=/usr/bin/dos2unix
DOS2UNIX=/usr/bin/fromdos
# exit silently if utility is not installed # exit silently if utility is not installed
[ -x /usr/bin/dos2unix ] || exit 0 [ -x ${DOS2UNIX} ] || exit 0
[ -x /usr/bin/svn ] || exit 0 [ -x /usr/bin/svn ] || exit 0
directory=${1-`pwd`} directory=${1-`pwd`}
for filename in $( find ${directory} -name '*.c' ) for filename in $( find ${directory} -name '*.c' )
do do
echo Fixing DOS/Unix ${filename} echo Fixing DOS/Unix ${filename}
/usr/bin/dos2unix ${filename} ${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename} echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename} /usr/bin/svn propset svn:eol-style native ${filename}
done done
@@ -17,7 +20,7 @@ done
for filename in $( find ${directory} -name '*.h' ) for filename in $( find ${directory} -name '*.h' )
do do
echo Fixing DOS/Unix ${filename} echo Fixing DOS/Unix ${filename}
/usr/bin/dos2unix ${filename} ${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename} echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename} /usr/bin/svn propset svn:eol-style native ${filename}
done done
+21 -20
View File
@@ -18,11 +18,12 @@ SIZE = avr-size
AVRDUDE = avrdude AVRDUDE = avrdude
LINT = splint LINT = splint
SIZE_OPTIONS = -C --mcu=${MCU} SIZE_OPTIONS = -t
#SIZE_OPTIONS = -C --mcu=${MCU}
# programmer id--check the avrdude for complete list # programmer id--check the avrdude for complete list
# of available opts. These should include stk500, # of available opts. These should include stk500,
# avr910, avrisp, bsd, pony and more. Set this to # avr910, avrisp, bsd, pony and more. Set this to
# one of the valid "-c PROGRAMMER-ID" values # one of the valid "-c PROGRAMMER-ID" values
# described in the avrdude info page. # described in the avrdude info page.
# jtag2fast = Atmel JTAG ICE mkII, running at 115200 Bd # jtag2fast = Atmel JTAG ICE mkII, running at 115200 Bd
# jtag2slow = Atmel JTAG ICE mkII, running at 19200 Bd # jtag2slow = Atmel JTAG ICE mkII, running at 19200 Bd
@@ -34,7 +35,7 @@ AVRDUDE_PROGRAMMERID = avrispmkII
#AVRDUDE_PROGRAMMERID = dragon_isp #AVRDUDE_PROGRAMMERID = dragon_isp
#AVRDUDE_PROGRAMMERID = dragon_jtag #AVRDUDE_PROGRAMMERID = dragon_jtag
# #
# port--serial or parallel port to which your # port--serial or parallel port to which your
# hardware programmer is attached # hardware programmer is attached
# usb can just be usb # usb can just be usb
AVRDUDE_PORT = usb AVRDUDE_PORT = usb
@@ -137,7 +138,7 @@ LIBRARY = lib$(TARGET).a
COMMON = -mmcu=$(MCU) COMMON = -mmcu=$(MCU)
# define something from the Makefile or batch file # define something from the Makefile or batch file
DEFINES = DEFINES =
OPTIMIZE_FLAGS = -mcall-prologues OPTIMIZE_FLAGS = -mcall-prologues
OPTIMIZE_FLAGS += -finline-functions-called-once OPTIMIZE_FLAGS += -finline-functions-called-once
@@ -195,7 +196,7 @@ LDFLAGS = $(COMMON)
#dead code removal #dead code removal
#LDFLAGS += -Wl,-nostartfiles,-nostdlib #LDFLAGS += -Wl,-nostartfiles,-nostdlib
LDFLAGS += -Wl,--gc-sections,-static LDFLAGS += -Wl,--gc-sections,-static
LDFLAGS += -Wl,--section-start=.bootloader=$(BOOTLOAD) LDFLAGS += -Wl,--section-start=.bootloader=$(BOOTLOAD)
LDFLAGS += -Wl,-Map=$(TARGET).map LDFLAGS += -Wl,-Map=$(TARGET).map
LDFLAGS += -Wl,-L=.,-l$(TARGET) LDFLAGS += -Wl,-L=.,-l$(TARGET)
@@ -209,7 +210,7 @@ HEX_FUSE_FLAGS = -j .fuse
HEX_FUSE_FLAGS += --change-section-lma .fuse=0 --no-change-warnings HEX_FUSE_FLAGS += --change-section-lma .fuse=0 --no-change-warnings
AVRDUDE_FLAGS = -c $(AVRDUDE_PROGRAMMERID) AVRDUDE_FLAGS = -c $(AVRDUDE_PROGRAMMERID)
AVRDUDE_FLAGS += -p $(AVRDUDE_MCU) AVRDUDE_FLAGS += -p $(AVRDUDE_MCU)
AVRDUDE_FLAGS += -P $(AVRDUDE_PORT) AVRDUDE_FLAGS += -P $(AVRDUDE_PORT)
AVRDUDE_FLAGS += -B 8 AVRDUDE_FLAGS += -B 8
@@ -217,7 +218,7 @@ AVRDUDE_FLAGS += -B 8
# Fuse high byte (0=enable,1=disable): # Fuse high byte (0=enable,1=disable):
# 0x93 = 1 0 0 1 0 0 1 1 # 0x93 = 1 0 0 1 0 0 1 1
# 0x17 = 0 0 0 1 0 1 1 1 - default # 0x17 = 0 0 0 1 0 1 1 1 - default
# ^ ^ ^ ^ ^ \+/ ^ # ^ ^ ^ ^ ^ \+/ ^
# | | | | | | |---- BOOTRST (Enable Bootloader Reset Vector) # | | | | | | |---- BOOTRST (Enable Bootloader Reset Vector)
# | | | | | +------- BOOTSZ 1..0 (Select Boot Size) # | | | | | +------- BOOTSZ 1..0 (Select Boot Size)
# | | | | | +------- [00=4k, 01=2k, 10=1k, 11=512] # | | | | | +------- [00=4k, 01=2k, 10=1k, 11=512]
@@ -248,13 +249,13 @@ AVRDUDE_FLAGS += -B 8
# Fuse extended byte (0=enable,1=disable): # Fuse extended byte (0=enable,1=disable):
# 0xFC = 1 1 1 1 1 1 0 0 # 0xFC = 1 1 1 1 1 1 0 0
# 0xFC = 1 1 1 1 1 1 1 1 - default # 0xFC = 1 1 1 1 1 1 1 1 - default
# ^ ^ ^ ^ ^ \-+-/ # ^ ^ ^ ^ ^ \-+-/
# | | | | | +------ BODLEVEL 2..0 (brownout trigger level) # | | | | | +------ BODLEVEL 2..0 (brownout trigger level)
# | | | | | +------ [100=4.3V, 101=2.7V, 110=1.8V, 111=disabled] # | | | | | +------ [100=4.3V, 101=2.7V, 110=1.8V, 111=disabled]
# | | | | +---------- # | | | | +----------
# | | | +-------------- # | | | +--------------
# | | +---------------- # | | +----------------
# | +------------------ # | +------------------
# +-------------------- # +--------------------
AVRDUDE_DEFAULT_FUSES = -U hfuse:w:0x17:m -U lfuse:w:0x62:m -U efuse:w:0xFF:m AVRDUDE_DEFAULT_FUSES = -U hfuse:w:0x17:m -U lfuse:w:0x62:m -U efuse:w:0xFF:m
@@ -286,7 +287,7 @@ all: $(LIBRARY) \
$(TARGET_ELF): $(OBJECTS) $(LIBRARY) $(TARGET_ELF): $(OBJECTS) $(LIBRARY)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@ $(CC) $(OBJECTS) $(LDFLAGS) -o $@
%.hex: $(TARGET_ELF) %.hex: $(TARGET_ELF)
$(OBJCOPY) -O ihex $(HEX_FLASH_FLAGS) $< $@ $(OBJCOPY) -O ihex $(HEX_FLASH_FLAGS) $< $@
%.eep: $(TARGET_ELF) %.eep: $(TARGET_ELF)
@@ -309,22 +310,22 @@ size: ${TARGET_ELF}
@${SIZE} ${SIZE_OPTIONS} ${TARGET_ELF} @${SIZE} ${SIZE_OPTIONS} ${TARGET_ELF}
lint: lint:
$(LINT) $(BFLAGS) $(CSRC) $(LINT) $(BFLAGS) $(CSRC)
install: $(TARGET_ELF) install: $(TARGET_ELF)
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_INSTALL) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_INSTALL)
writefuses: writefuses:
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FUSES) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FUSES)
bootloadfuses: bootloadfuses:
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_BOOTL_FUSES) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_BOOTL_FUSES)
defaultfuses: defaultfuses:
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_DEFAULT_FUSES) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_DEFAULT_FUSES)
showfuses: showfuses:
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_READ_FUSES) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_READ_FUSES)
bootloader: bootloader:
make -C bootloader all make -C bootloader all
@@ -29,11 +29,6 @@
/* Internal EEPROM of the AVR - http://supp.iar.com/Support/?note=45745 */ /* Internal EEPROM of the AVR - http://supp.iar.com/Support/?note=45745 */
#if defined(__GNUC__)
/* bug in WinAVR - not quite IAR compatible */
#define __EEPUT _EEPUT
#define __EEGET _EEGET
#endif
int eeprom_bytes_read( int eeprom_bytes_read(
uint16_t eeaddr, /* EEPROM starting memory address (offset of zero) */ uint16_t eeaddr, /* EEPROM starting memory address (offset of zero) */
@@ -211,6 +211,11 @@ typedef struct {
#if defined(__GNUC__) #if defined(__GNUC__)
#include <avr/eeprom.h> #include <avr/eeprom.h>
#define EEPROM_DECLARE(x) x __attribute__((section (".eeprom"))) #define EEPROM_DECLARE(x) x __attribute__((section (".eeprom")))
#if ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 3)))
/* bug in WinAVR - not quite IAR compatible */
#define __EEPUT _EEPUT
#define __EEGET _EEGET
#endif
#endif #endif
/* IAR intrinsic routines */ /* IAR intrinsic routines */