first upload
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
PROGRAM_NAME = example_blonk
|
||||
BUILD_DIR = build
|
||||
MCU = atmega2560
|
||||
MCUSHORT = m2560
|
||||
MCUDEFS = -DF_CPU=16000000UL -DAAIO_MEGA2560
|
||||
PROG_PARAMS = -c wiring -P /dev/ttyUSB0
|
||||
|
||||
#MCU = atmega328p
|
||||
#MCUSHORT = m328p
|
||||
#MCUDEFS = -DF_CPU=8000000UL -DAAIO_NANO
|
||||
#PROG_PARAMS = -c wiring -P /dev/ttyUSB0
|
||||
|
||||
SUDOCMD = doas
|
||||
|
||||
all: $(PROGRAM_NAME)
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir -pv $(BUILD_DIR)
|
||||
|
||||
$(PROGRAM_NAME): $(BUILD_DIR)
|
||||
avr-gcc -mmcu=$(MCU) $(MCUDEFS) -Wall -Os -o $(BUILD_DIR)/$(PROGRAM_NAME).elf $(PROGRAM_NAME).c
|
||||
avr-objcopy -j .text -j .data -O ihex $(BUILD_DIR)/$(PROGRAM_NAME).elf $(BUILD_DIR)/$(PROGRAM_NAME).hex
|
||||
|
||||
upload: $(PROGRAM_NAME)
|
||||
$(SUDOCMD) avrdude -p $(MCUSHORT) $(PROG_PARAMS) -D -U flash:w:$(BUILD_DIR)/$(PROGRAM_NAME).hex:i
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
Reference in New Issue
Block a user