MPM controlled 16ch RGB LED dimmer
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.

54 lines
1.2KB

  1. PRG = rgb16mpm
  2. OBJ = main.o
  3. MCU_TARGET = atmega32
  4. OPTIMIZE = -Os
  5. DEFS =
  6. LIBS =
  7. # You should not have to change anything below here.
  8. CC = avr-gcc
  9. # Override is only needed by avr-lib build system.
  10. override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS)
  11. override LDFLAGS = -Wl,-Map,$(PRG).map
  12. OBJCOPY = avr-objcopy
  13. OBJDUMP = avr-objdump
  14. SIZE = avr-size
  15. all: $(PRG).elf lst text
  16. $(SIZE) -x -A $(PRG).elf
  17. $(PRG).elf: $(OBJ)
  18. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
  19. clean:
  20. rm -rf *.o *.lst *.map $(PRG).elf *.hex *.bin
  21. lst: $(PRG).lst
  22. %.lst: %.elf
  23. $(OBJDUMP) -h -S $< > $@
  24. # Rules for building the .text rom images
  25. text: hex bin
  26. hex: $(PRG).hex
  27. bin: $(PRG).bin
  28. %.hex: %.elf
  29. $(OBJCOPY) -j .text -j .data -O ihex $< $@
  30. %.bin: %.elf
  31. $(OBJCOPY) -j .text -j .data -O binary $< $@
  32. install: text
  33. # uisp -dprog=stk200 --erase --upload if=$(PRG).hex --verify
  34. # avrdude -p m16 -c butterfly -b 19200 -P /dev/ttyUSB0 -U flash:w:$(PRG).hex
  35. # avrdude -p m16 -c dragon_isp -P usb -U flash:w:$(PRG).hex
  36. avrdude -p m32 -c dragon_isp -P usb -U flash:w:$(PRG).hex