Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 48 lines (33 sloc) 1.057 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
all: hyperlog.hex

.SUFFIXES: .elf .hex .eep .lss .sym .upload .dsm .c .s .S .o .l

CPU=atmega328p
#PORT=/dev/rfcomm0
PORT=/dev/ttyUSB0
#Note: -O will break something, it won't output characters
#XTAL=16000000 #OpenLog
XTAL=8000000 #Arduino 3.3v Pro
#XTAL=14745600 #JPEG Trigger
CFLAGS=-g -Os -Wall -mmcu=$(CPU) -DF_CPU=$(XTAL) -I../fat32lib -I../uart -DRXBUFBITS=10 -DTXBUFBITS=4 -DHYPERLOG
CC=avr-gcc

.c.o:
$(CC) $(CFLAGS) -c $< -o $@

.S.o:
$(CC) $(CFLAGS) -c $< -o $@

.c.s:
$(CC) $(CFLAGS) -S $< -o $@

.elf.dsm:
avr-objdump --disassemble -S $^ >$@

MAP=-Wl,"-Map" -Wl,"$@.map" -Wl,"--cref"

.elf.hex:
avr-objcopy -O ihex -R .eeprom $^ $@

clean:
rm -f *.eep *.elf *.lss *.sym *.dsm *.o *.a *.d *.hex

flash: all
avrdude -c stk500v1 -b 57600 -P /dev/ttyUSB0 -p m328p -U hyperlog.hex

../fat32lib/libfat32.a:
make -C ../fat32lib

uart.o: ../uart/uart.c
avr-gcc $(CFLAGS) -Wall -c $^ -o $@

OBJS := main.o ../fat32lib/sdhc.o uart.o

hyperlog.elf: $(OBJS) ../fat32lib/libfat32.a
$(CC) $(CFLAGS) -o hyperlog.elf $(OBJS) -L../fat32lib -lfat32
Something went wrong with that request. Please try again.