diff options
author | Christian Pointner <equinox@mur.at> | 2012-05-20 20:41:12 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2012-05-20 20:41:12 +0000 |
commit | 792d34f4e39b19bceeeb7dc3386ed824266ea807 (patch) | |
tree | 10e576646ec801abe0b89edeff34eb65b3e5d060 /software/avr.include.mk | |
parent | rx fifo could have overflowed (diff) |
updated avr utils from spreadspace (minor bugfixes)
git-svn-id: https://svn.spreadspace.org/mur.sat@459 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/avr.include.mk')
-rw-r--r-- | software/avr.include.mk | 101 |
1 files changed, 70 insertions, 31 deletions
diff --git a/software/avr.include.mk b/software/avr.include.mk index 8542449..93a34fb 100644 --- a/software/avr.include.mk +++ b/software/avr.include.mk @@ -3,7 +3,7 @@ ## ## ## Copyright (C) 2012 Christian Pointner <equinox@spreadspace.org> -## +## ## This file is part of spreadspace avr utils. ## ## spreadspace avr utils is free software: you can redistribute it and/or modify @@ -21,37 +21,77 @@ ## ifeq ($(BOARD_TYPE),teensy1) -MCU := at90usb162 -F_CPU := 16000000 -PROG := teensy + MCU := at90usb162 + F_CPU := 16000000 + PROG := teensy endif ifeq ($(BOARD_TYPE),teensy2) -MCU := atmega32u4 -F_CPU := 16000000 -PROG := teensy + MCU := atmega32u4 + F_CPU := 16000000 + PROG := teensy endif -ifeq ($(BOARD_TYPE),teensypp1) -MCU := at90usb646 -F_CPU := 16000000 -PROG := teensy +ifeq ($(BOARD_TYPE),teensy1pp) + MCU := at90usb646 + F_CPU := 16000000 + PROG := teensy endif -ifeq ($(BOARD_TYPE),teensypp2) -MCU := at90usb1286 -F_CPU := 16000000 -PROG := teensy +ifeq ($(BOARD_TYPE),teensy2pp) + MCU := at90usb1286 + F_CPU := 16000000 + PROG := teensy endif ifeq ($(BOARD_TYPE),hhd70dongle) -MCU := atmega32u4 -F_CPU := 16000000 -PROG := DFU + MCU := atmega32u4 + F_CPU := 16000000 + PROG := DFU +endif +ifeq ($(BOARD_TYPE),arduinoUno) + MCU := atmega328p + F_CPU := 16000000 + PROG := avrdude + UPLOAD_RATE := 57600 + PROG_TYPE := stk500v1 + AVRDUDE_PORT := /dev/ttyUSB0 + RESET_FUNC := ../tools/reset_arduino + RESET_PARAM = $(AVRDUDE_PORT) +endif +ifeq ($(BOARD_TYPE),arduino2009v2) + MCU := atmega328p + F_CPU := 16000000 + PROG := avrdude + UPLOAD_RATE := 57600 + PROG_TYPE := stk500v1 + AVRDUDE_PORT := /dev/ttyUSB0 + RESET_FUNC := ../tools/reset_arduino + RESET_PARAM = $(AVRDUDE_PORT) endif ifeq ($(BOARD_TYPE),arduino2009) -MCU := atmega168 -F_CPU := 16000000 -PROG := avrdude -UPLOAD_RATE := 19200 -PROG_TYPE := stk500v1 -AVRDUDE_PORT := /dev/ttyUSB0 + MCU := atmega168 + F_CPU := 16000000 + PROG := avrdude + UPLOAD_RATE := 19200 + PROG_TYPE := stk500v1 + AVRDUDE_PORT := /dev/ttyUSB0 + RESET_FUNC := ../tools/reset_arduino + RESET_PARAM = $(AVRDUDE_PORT) +endif +ifeq ($(BOARD_TYPE),arduino10000) + MCU := atmega168 + F_CPU := 16000000 + PROG := avrdude + UPLOAD_RATE := 19200 + PROG_TYPE := stk500v1 + AVRDUDE_PORT := /dev/ttyUSB0 + RESET_FUNC := ../tools/reset_arduino + RESET_PARAM = $(AVRDUDE_PORT) +endif +ifeq ($(BOARD_TYPE),arduinoNG) + MCU := atmega8 + F_CPU := 16000000 + PROG := avrdude + UPLOAD_RATE := 19200 + PROG_TYPE := stk500v1 + AVRDUDE_PORT := /dev/ttyUSB0 endif CC = avr-gcc @@ -143,11 +183,10 @@ endef ### avrdude define avrdude/erase - $(avrdude) -V -F -p $(MCU) -P $(AVRDUDE_PORT) -c $(PROG_TYPE) -b $(UPLOAD_RATE) -e endef define avrdude/flash - $(avrdude) -V -F -p $(MCU) -P $(AVRDUDE_PORT) -c $(PROG_TYPE) -b $(UPLOAD_RATE) -D -U flash:w:$1 + $(avrdude) -V -F -p $(MCU) -P $(AVRDUDE_PORT) -c $(PROG_TYPE) -b $(UPLOAD_RATE) -U flash:w:$1 endef define avrdude/run @@ -166,10 +205,10 @@ run: $(call $(PROG)/$@,) reset: - @if [ -n "$(RESET_FUNC)" ]; then \ - if [ -x "$(RESET_FUNC)" ]; then \ - "$(RESET_FUNC)"; \ - else \ + @if [ -n "$(RESET_FUNC)" ]; then \ + if [ -x "$(RESET_FUNC)" ]; then \ + eval $(RESET_FUNC) $(RESET_PARAM); \ + else \ echo "WARNING: ignoring non-existing or non-executable reset script"; \ - fi \ + fi \ fi |