1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefiles/tools/avrdude.inc.mk: migrate to use PROG_DEV

- Move serial.inc.mk in mega-xplained/Makefile.include after
  PROG_DEV so PROG_DEV can still default to PORT
- Add deprecation warning for arduino-leonardo and mega-xplained
This commit is contained in:
Francisco Molina 2019-10-15 14:16:44 +02:00
parent 66e3cf569e
commit bf25e12602
4 changed files with 27 additions and 16 deletions

View File

@ -1,5 +1,11 @@
# For backward compatibility
ifneq (,$(AVRDUDE_PORT))
$(warning Warning! AVRDUDE_PORT is deprecated use PROG_DEV)
PROG_DEV ?= $(AVRDUDE_PORT)
endif
PORT_LINUX ?= /dev/ttyUSB0
AVRDUDE_PORT ?= /dev/ttyACM0
PROG_DEV ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600

View File

@ -55,8 +55,8 @@ the user program, flashing will fail. See below to work arround
## Mac Users
Mac Users have export the environment variable both `PORT` and `AVRDUDE_PORT`
Mac Users have export the environment variable both `PORT` and `PROG_DEV`
to point to the device file of the TTL adapter (`PORT`) and the device file of
the Arduino Leonardo (`AVRDUDE_PORT`).
the Arduino Leonardo (`PROG_DEV`).
*/

View File

@ -3,22 +3,28 @@
BOOTLOADER_SIZE ?= 4K
ROM_RESERVED ?= $(BOOTLOADER_SIZE)
# For backward compatibility
ifneq (,$(AVRDUDE_PORT))
$(warning Warning! AVRDUDE_PORT is deprecated use PROG_DEV)
PROG_DEV ?= $(AVRDUDE_PORT)
endif
# PROGRAMMER defaults to the external flasher Bus Pirate ISP using avrdude.
PROGRAMMER ?= buspirate
# set serial port for avrdude with buspirate
ifeq ($(OS),Linux)
PROG_DEV ?= /dev/ttyUSB0
else ifeq ($(OS),Darwin)
PROG_DEV ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
endif
# avoid error if mcu signature doesn't match
FFLAGS_EXTRA += -F
# configure the terminal program
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600
include $(RIOTMAKE)/tools/serial.inc.mk
# PROGRAMMER defaults to the external flasher Bus Pirate ISP using avrdude.
PROGRAMMER ?= buspirate
# set serial port for avrdude with buspirate
ifeq ($(OS),Linux)
AVRDUDE_PORT ?= /dev/ttyUSB0
else ifeq ($(OS),Darwin)
AVRDUDE_PORT ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
endif
# avoid error if mcu signature doesn't match
FFLAGS_EXTRA += -F
include $(RIOTMAKE)/tools/avrdude.inc.mk
include $(RIOTBOARD)/common/atmega/Makefile.include

View File

@ -12,8 +12,7 @@ PROGRAMMER_FLAGS = -p $(subst atmega,m,$(CPU))
ifneq (,$(filter $(PROGRAMMER),arduino avr109 buspirate stk500v1 stk500v2 wiring))
# make the flasher port configurable (e.g. with atmelice the port is usb)
# defaults to terminal's serial port if not configured
AVRDUDE_PORT ?= $(PORT)
PROGRAMMER_FLAGS += -P $(AVRDUDE_PORT)
PROGRAMMER_FLAGS += -P $(PROG_DEV)
endif
PROGRAMMER_FLAGS += $(FFLAGS_EXTRA)