mega168 with four 5x7 LEDs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
976B

  1. PRG = 5x7test
  2. OBJ = 5x7test.o
  3. MCU_TARGET = atmega168
  4. OPTIMIZE = -Os
  5. DEFS =
  6. LIBS =
  7. # Override is only needed by avr-lib build system.
  8. override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS)
  9. override LDFLAGS = -Wl,-Map,$(PRG).map
  10. CC = avr-gcc
  11. OBJCOPY = avr-objcopy
  12. OBJDUMP = avr-objdump
  13. SIZE = avr-size
  14. all: $(PRG).elf lst text
  15. $(SIZE) -x -A $(PRG).elf
  16. $(PRG).elf: $(OBJ)
  17. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
  18. clean:
  19. rm -rf *.o *.lst *.map $(PRG).elf *.hex *.bin
  20. lst: $(PRG).lst
  21. %.lst: %.elf
  22. $(OBJDUMP) -h -S $< > $@
  23. text: hex bin
  24. hex: $(PRG).hex
  25. bin: $(PRG).bin
  26. %.hex: %.elf
  27. $(OBJCOPY) -j .text -j .data -O ihex $< $@
  28. %.bin: %.elf
  29. $(OBJCOPY) -j .text -j .data -O binary $< $@
  30. install: all
  31. # avrdude -p 2313 -c avr910 -b 115200 -P /dev/ttyUSB0 -e -V -U flash:w:$(PRG).hex
  32. avrdude -c dragon_isp -P usb -p m168 -e -V -U flash:w:$(PRG).hex