From 463eea4804253970199bd9b705768b8dde83deb7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 30 Nov 2018 09:28:09 +0100 Subject: arduino: check program size is below 100% before flashing --- src/arch/arduino-nano/Makefile.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/arch/arduino-nano/Makefile.inc') diff --git a/src/arch/arduino-nano/Makefile.inc b/src/arch/arduino-nano/Makefile.inc index 8896681..50109eb 100644 --- a/src/arch/arduino-nano/Makefile.inc +++ b/src/arch/arduino-nano/Makefile.inc @@ -79,6 +79,7 @@ OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} build/system.elf: ${OBJECTS} ${QUIET}${CXX} ${COMMON_FLAGS} ${CXXFLAGS} -Wl,--gc-sections -o $@ ${OBJECTS} ${QUIET}avr-size --format=avr --mcu=${MCU} $@ + ${QUIET}test $$(avr-size --format=avr --mcu=${MCU} build/system.elf | fgrep Program | grep -o '[0-9.]*%' | cut -d . -f 1) -lt 100 build/system.hex: build/system.elf ${QUIET}${OBJCOPY} -O ihex ${@:.hex=.elf} $@ -- cgit v1.2.3