diff options
Diffstat (limited to 'src/arch/arduino-nano-168')
-rw-r--r-- | src/arch/arduino-nano-168/Makefile.inc | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/arch/arduino-nano-168/Makefile.inc b/src/arch/arduino-nano-168/Makefile.inc index de4ac8b..534ac27 100644 --- a/src/arch/arduino-nano-168/Makefile.inc +++ b/src/arch/arduino-nano-168/Makefile.inc @@ -4,6 +4,8 @@ MCU = atmega168 PORT = /dev/ttyUSB0 BAUD = 19200 +cpu_freq ?= 16000000 + COMMON_FLAGS += -Werror=overflow COMMON_FLAGS += -mmcu=${MCU} -DF_CPU=16000000UL -DMULTIPASS_ARCH_arduino_nano COMMON_FLAGS += -flto @@ -37,38 +39,35 @@ ifneq ($(findstring timer,${arch_drivers}), ) TARGETS += src/arch/arduino-nano/driver/timer.cc endif -ifneq (${i2c_freq}, ) - COMMON_FLAGS += -DF_I2C=${i2c_freq} -endif - -ifneq (${timer_freq}, ) - COMMON_FLAGS += -DF_TIMER=${timer_freq} -endif - OBJECTS = ${TARGETS:.cc=.o} .cc.o: - ${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc} + ${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc} build/system.elf: ${OBJECTS} - ${CXX} ${COMMON_FLAGS} ${CXXFLAGS} -Wl,--gc-sections -o $@ ${OBJECTS} - avr-size --format=avr --mcu=${MCU} $@ + ${QUIET}${CXX} ${COMMON_FLAGS} ${CXXFLAGS} -Wl,--gc-sections -o $@ ${OBJECTS} + ${QUIET}avr-size --format=avr --mcu=${MCU} $@ build/system.hex: build/system.elf - ${OBJCOPY} -O ihex ${@:.hex=.elf} $@ + ${QUIET}${OBJCOPY} -O ihex ${@:.hex=.elf} $@ program: build/system.hex - avrdude -p ${MCU} -c arduino -P ${PORT} -b ${BAUD} -U flash:w:build/system.hex + ${QUIET}avrdude -p ${MCU} -c arduino -P ${PORT} -b ${BAUD} -U flash:w:build/system.hex arch_clean: - rm -f ${OBJECTS} build/system.hex + ${QUIET}rm -f ${OBJECTS} build/system.hex monitor: - screen ${PORT} 115200 + ${QUIET}screen ${PORT} 115200 arch_help: @echo "arduino-nano specific flags:" @echo " PORT = ${PORT}" @echo " BAUD = ${BAUD} (only used for programming)" -.PHONY: arch_clean arch_help monitor program +arch_info: + @echo "CPU Freq: ${cpu_freq} Hz" + @echo "Timer Freq: ${timer_freq} Hz" + @echo "I2C Freq: ${i2c_freq} Hz" + +.PHONY: arch_clean arch_help arch_info monitor program |