This commit is contained in:
Tristan Krause 2019-06-18 09:54:23 +02:00
parent 38a28a595b
commit 377aa5a8f0
3 changed files with 5 additions and 1 deletions

BIN
firmware/.getMCU.swp Normal file

Binary file not shown.

View file

@ -18,11 +18,12 @@ OBJCOPY_PATH = avr-objcopy
PROGRAMMER = avrispmkII
OUTPUT = b15f.elf
HEX = b15f.hex
MCU = atmega1284p
MCU = m1284p
CFLAGS = -Wall -Wextra -std=c++14 -O3 -mmcu=$(MCU) -DF_CPU=$(F_CPU) $(DEBUG)
LDFLAGS =
OBJECTS = main.o spi.o mcp23s17.o tlc5615.o adu.o selftest.o global_vars.o usart.o requests.o interrupts.o pwm.o
COMPILE = $(COMPILER_PATH) $(CFLAGS)
FUSES = (E:$(EFUSE), H:$(HFUSE), L:$(LFUSE))
@ -34,6 +35,8 @@ b15f: $(OBJECTS)
$(OBJCOPY_PATH) -O ihex -R .eeprom -R .fuse -R .lock -R .signature $(OUTPUT) $(HEX)
help:
$(eval MCU = $(shell bash -c "avrdude -c $(PROGRAMMER) -Pusb -p m16 2>&1 | grep 'Device signature =' | awk -F 'probably ' '{print $2}' | head -c-2"))
@echo $(MCU)
@echo "This Makefile has the following rules:"
@echo "make b15f .... to compile (default)"
@echo "make clean ... to delete objects, elf and hex file"

1
firmware/getMCU Executable file
View file

@ -0,0 +1 @@
avrdude -c $(PROGRAMMER) -Pusb -p m16 2>&1 | grep 'Device signature =' | awk -F 'probably ' '{print $2}' | head -c-2