Guest User

Untitled

a guest
Oct 30th, 2023
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.53 KB | None | 0 0
  1. DEVICE     = attiny85
  2. CLOCK      = 1000000
  3. PROGRAMMER = usbasp
  4. FILENAME   = main
  5. COMPILE    = avr-gcc -std=c11  -Wall -g0 -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE)
  6.  
  7. all: clean build upload
  8.  
  9. build:
  10.     $(COMPILE) -c $(FILENAME).c -o $(FILENAME).o
  11.     $(COMPILE) -o $(FILENAME).elf $(FILENAME).o
  12.     avr-objcopy -j .text -j .data -O ihex $(FILENAME).elf $(FILENAME).hex
  13.     avr-size --format=gnu  $(FILENAME).elf
  14.  
  15. upload:
  16.     avrdude -v -p $(DEVICE) -c $(PROGRAMMER) -U flash:w:$(FILENAME).hex:i
  17.  
  18.  
  19. clean:
  20.     del main.o
  21.     del main.elf
  22.     del main.hex
Tags: ATtiny85
Advertisement
Add Comment
Please, Sign In to add comment