Changeset 4fbae10 in avrstuff


Ignore:
Timestamp:
Jul 23, 2014, 8:47:10 PM (10 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
49e72b6
Parents:
8e1fb41
Message:

Make it easier to use blinkdel with various AVRs.

git-svn-id: svn://pulkomandy.tk/avrstuff@97 c6672c3c-f6b6-47f9-9001-1fd6b12fecbe

Location:
blinkled
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • blinkled/Makefile

    r8e1fb41 r4fbae10  
    11#Set vars
    2 MCU=attiny2313
     2MCU=atmega48p
     3FCPU=16000000
    34COMPILE = avr-gcc -Wall -Os -std=c99 -mmcu=$(MCU) -DF_CPU=20000000
    45
    56#Rules
    6 blinkdel.hex: blinkdel.bin
    7         avr-objcopy -j .text -j .data -O ihex blinkdel.bin blinkdel.hex
     7$(MCU).hex: blinkdel.bin
     8        avr-objcopy -j .text -j .data -O ihex $^ $@
    89
    910blinkdel.bin: main.o
    1011        $(COMPILE) main.o -o blinkdel.bin
    11 
    12 main.o: main.c
    13         $(COMPILE) -c main.c -o main.o
    1412
    1513#Generic rules
     
    1816
    1917.c.o:
    20         $(COMPILE) -std=c99 -c $< -o $@
     18        $(COMPILE) -mmcu=$(MCU) -std=c99 -c $< -o $@
    2119
    2220flash:
    23         avrdude -c usbasp -p $(MCU) -Uflash:w:blinkdel.hex
     21        avrdude -c usbasp -p $(MCU) -Uflash:w:$(MCU).hex
    2422
    2523clean:
  • blinkled/main.c

    r8e1fb41 r4fbae10  
    77#include <string.h>
    88#include <stdbool.h>
     9
     10#ifdef __AVR_ATmega48P__
     11#define TIFR TIFR0
     12#endif
    913
    1014int main() {
Note: See TracChangeset for help on using the changeset viewer.