aboutsummaryrefslogtreecommitdiffstats
path: root/synology-autopoweron/Makefile
diff options
context:
space:
mode:
authorVG <vg@devys.org>2015-10-05 20:56:15 +0200
committerVG <vg@devys.org>2015-10-05 20:56:15 +0200
commit21a6c53bfb10d51a72f5b3135c65b8fd7440ac28 (patch)
tree268dde8e1005769224213322978bcf4b8eb7078a /synology-autopoweron/Makefile
parent1215068c8ff39cb10d5d5256e7693e83be1834e3 (diff)
downloadavr-21a6c53bfb10d51a72f5b3135c65b8fd7440ac28.tar.gz
avr-21a6c53bfb10d51a72f5b3135c65b8fd7440ac28.tar.bz2
avr-21a6c53bfb10d51a72f5b3135c65b8fd7440ac28.zip
add synology auto-poweron manager
Diffstat (limited to 'synology-autopoweron/Makefile')
-rw-r--r--synology-autopoweron/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/synology-autopoweron/Makefile b/synology-autopoweron/Makefile
new file mode 100644
index 0000000..2646d03
--- /dev/null
+++ b/synology-autopoweron/Makefile
@@ -0,0 +1,39 @@
+DEVICE = attiny25
+CLOCK = 1000000
+FUSES = -U lfuse:w:0x62:m -U hfuse:w:0xdd:m
+
+PROGRAMMER = avrdude
+PROGRAMMER += -c buspirate
+PROGRAMMER += -P /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A400XJSH-if00-port0
+PROGRAMMER += -p $(DEVICE) -B 4
+
+DEFS = -DF_CPU=$(CLOCK)UL
+CFLAGS = -Wall -Werror -pedantic -std=c99
+CFLAGS += -O2 -funsigned-bitfields -fpack-struct -fshort-enums
+CFLAGS += -mmcu=$(DEVICE) $(DEFS)
+#LIBS = -Wl,--relax,--gc-sections,--print-gc-sections,--entry=main
+#LIBS = -Wl,--entry=main,--gc-sections,--rela
+#LDFLAGS = $(LIBS)
+
+all: main.hex size
+
+main.hex: main.c
+ avr-gcc -o main.elf $? $(CFLAGS) $(LDFLAGS)
+ avr-objcopy -j .text -j .data -O ihex main.elf main.hex
+
+f: flash
+flash: all
+ $(PROGRAMMER) -U flash:w:main.hex:i
+
+fuse:
+ $(PROGRAMMER) $(FUSES)
+
+clean:
+ rm -f *.o *.elf *.hex
+
+size:
+ avr-size --mcu=$(DEVICE) -t -A main.elf
+ avr-size --mcu=$(DEVICE) -C main.elf
+ avr-nm --size-sort main.elf
+
+