diff --git a/firmware/.getMCU.swp b/firmware/.getMCU.swp new file mode 100644 index 0000000..4a59443 Binary files /dev/null and b/firmware/.getMCU.swp differ diff --git a/firmware/Makefile b/firmware/Makefile index b4a8479..689212e 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -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" diff --git a/firmware/getMCU b/firmware/getMCU new file mode 100755 index 0000000..a89b1b2 --- /dev/null +++ b/firmware/getMCU @@ -0,0 +1 @@ +avrdude -c $(PROGRAMMER) -Pusb -p m16 2>&1 | grep 'Device signature =' | awk -F 'probably ' '{print $2}' | head -c-2