]> www.fi.muni.cz Git - openparking.git/commitdiff
Directory layout
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 20 May 2015 19:34:28 +0000 (21:34 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 20 May 2015 19:34:28 +0000 (21:34 +0200)
- PCB-related files in board/
- Arduino firmware in firmware/
- OpenSCAD objects in things/

14 files changed:
board-20150430-2227.zip [deleted file]
board/1812.fp [moved from 1812.fp with 100% similarity]
board/Makefile [moved from Makefile with 51% similarity]
board/board-20150504-1149.zip [moved from board-20150504-1149.zip with 100% similarity]
board/board.pcb [moved from board.pcb with 100% similarity]
board/board.prj [moved from board.prj with 100% similarity]
board/board.sch [moved from board.sch with 100% similarity]
firmware/.gitignore [new file with mode: 0644]
firmware/Makefile [new file with mode: 0644]
firmware/firmware.c [moved from firmware.c with 100% similarity]
firmware/rs485.c [moved from rs485.c with 100% similarity]
firmware/rs485.h [moved from rs485.h with 100% similarity]
things/hc-sr04.scad [moved from hc-sr04.scad with 100% similarity]
things/semaphore.scad [moved from semaphore.scad with 100% similarity]

diff --git a/board-20150430-2227.zip b/board-20150430-2227.zip
deleted file mode 100644 (file)
index 21565f7..0000000
Binary files a/board-20150430-2227.zip and /dev/null differ
similarity index 100%
rename from 1812.fp
rename to board/1812.fp
similarity index 51%
rename from Makefile
rename to board/Makefile
index 23528a0821dd8cd349a3ebd319e2e9e77b12cb23..076d26cdb436e01ca63551a87b40361579b0c3e4 100644 (file)
--- a/Makefile
@@ -1,25 +1,3 @@
-
-PROGRAM=firmware
-SRC=firmware.c rs485.c
-OBJ=$(SRC:.c=.o)
-
-
-MCU=atmega328p
-# AVRDUDE_MCU=$(MCU)
-AVRDUDE_MCU=atmega328p
-AVRDUDE_PROGRAMMER=arduino
-
-CFLAGS=-Wall -Os -mmcu=$(MCU) -DUSE_LOGGING=1 -DF_CPU=16000000UL -std=gnu99
-LDFLAGS=
-AVRDUDE_FLAGS= -p$(AVRDUDE_MCU) -c $(AVRDUDE_PROGRAMMER) -P /dev/ttyUSB0 -b 57600
-
-FORMAT=ihex
-
-CC=avr-gcc
-OBJCOPY=avr-objcopy
-OBJDUMP=avr-objdump
-AVRDUDE=avrdude
-
 WEB_DIR=/home/kas/html/board/
 WEB_FILES=pcb-back.png pcb-front.png schematics.png handlebar.png
 GERBER_FILES=\
@@ -32,14 +10,13 @@ GERBER_FILES=\
        board.outline.gbr \
        board.plated-drill.cnc
 
-all: $(PROGRAM).hex $(PROGRAM).eep
+all:
+       @echo "Usage: make [clean|web|gerber|fab|board.pcb]"
 
 clean:
        rm -f board.cmd board.jpg board.net board.new.pcb board.pcb- \
                board.png board.ps board.sch~ pcb-back.png pcb-front.png \
-               schematics.png *.gbr *.cnc \
-               $(PROGRAM).hex $(PROGRAM).eep $(PROGRAM).elf *.o *.s \
-               eeprom.raw version.c
+               schematics.png *.gbr *.cnc
 
 web: $(WEB_FILES)
        test -d $(WEB_DIR) && install -m 644 $(WEB_FILES) $(WEB_DIR)
@@ -84,49 +61,3 @@ fab: $(GERBER_FILES)
                echo "You may also want to do git tag gerber-fab-$$D" '
 
 .PHONY: gerber
-
-program: $(PROGRAM).hex $(PROGRAM).eep
-       $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(PROGRAM).hex:i -U eeprom:w:$(PROGRAM).eep:i
-
-program_flash: $(PROGRAM).hex
-       $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(PROGRAM).hex:i
-
-program_eeprom: $(PROGRAM).eep
-       $(AVRDUDE) $(AVRDUDE_FLAGS) eeprom:w:$(PROGRAM).eep:i
-
-dump_eeprom:
-       $(AVRDUDE) $(AVRDUDE_FLAGS) -U eeprom:r:eeprom.raw:r
-       od -tx1 eeprom.raw
-
-objdump: $(PROGRAM).elf
-       $(OBJDUMP) --disassemble $<
-
-.PRECIOUS : $(OBJ) $(PROGRAM).elf
-
-%.hex: %.elf
-       $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
-
-%.eep: %.elf
-       $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
-               --change-section-lma .eeprom=0 -O $(FORMAT) $< $@
-
-%.elf: $(OBJ)
-       $(CC) $(CFLAGS) $(OBJ) -o $@ $(LDFLAGS)
-
-%.o: %.c lights.h Makefile
-       $(CC) -c $(CFLAGS) $< -o $@
-
-%.s: %.c lights.h Makefile
-       $(CC) -S -c $(CFLAGS) $< -o $@
-
-%.o: %.S
-       $(CC) -c $(CFLAGS) $< -o $@
-
-clean:
-
-version.c:
-       ./version.pl > version.c
-
-.PHONY: all clean dump_eeprom program program_flash program_eeprom objdump \
-       version.c
-
similarity index 100%
rename from board.pcb
rename to board/board.pcb
similarity index 100%
rename from board.prj
rename to board/board.prj
similarity index 100%
rename from board.sch
rename to board/board.sch
diff --git a/firmware/.gitignore b/firmware/.gitignore
new file mode 100644 (file)
index 0000000..34692c7
--- /dev/null
@@ -0,0 +1,4 @@
+firmware.eep
+firmware.elf
+firmware.hex
+*.o
diff --git a/firmware/Makefile b/firmware/Makefile
new file mode 100644 (file)
index 0000000..40ec933
--- /dev/null
@@ -0,0 +1,69 @@
+
+PROGRAM=firmware
+SRC=firmware.c rs485.c
+OBJ=$(SRC:.c=.o)
+
+MCU=atmega328p
+# AVRDUDE_MCU=$(MCU)
+AVRDUDE_MCU=atmega328p
+AVRDUDE_PROGRAMMER=arduino
+
+CFLAGS=-Wall -Os -mmcu=$(MCU) -DUSE_LOGGING=1 -DF_CPU=16000000UL -std=gnu99
+LDFLAGS=
+AVRDUDE_FLAGS= -p$(AVRDUDE_MCU) -c $(AVRDUDE_PROGRAMMER) -P /dev/ttyUSB0 -b 57600
+
+FORMAT=ihex
+
+CC=avr-gcc
+OBJCOPY=avr-objcopy
+OBJDUMP=avr-objdump
+AVRDUDE=avrdude
+
+all: $(PROGRAM).hex $(PROGRAM).eep
+
+program: $(PROGRAM).hex $(PROGRAM).eep
+       $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(PROGRAM).hex:i -U eeprom:w:$(PROGRAM).eep:i
+
+program_flash: $(PROGRAM).hex
+       $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(PROGRAM).hex:i
+
+program_eeprom: $(PROGRAM).eep
+       $(AVRDUDE) $(AVRDUDE_FLAGS) eeprom:w:$(PROGRAM).eep:i
+
+dump_eeprom:
+       $(AVRDUDE) $(AVRDUDE_FLAGS) -U eeprom:r:eeprom.raw:r
+       od -tx1 eeprom.raw
+
+objdump: $(PROGRAM).elf
+       $(OBJDUMP) --disassemble $<
+
+.PRECIOUS : $(OBJ) $(PROGRAM).elf
+
+%.hex: %.elf
+       $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+       $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+               --change-section-lma .eeprom=0 -O $(FORMAT) $< $@
+
+%.elf: $(OBJ)
+       $(CC) $(CFLAGS) $(OBJ) -o $@ $(LDFLAGS)
+
+%.o: %.c lights.h Makefile
+       $(CC) -c $(CFLAGS) $< -o $@
+
+%.s: %.c lights.h Makefile
+       $(CC) -S -c $(CFLAGS) $< -o $@
+
+%.o: %.S
+       $(CC) -c $(CFLAGS) $< -o $@
+
+clean:
+       rm -f *.o $(PROGRAM).hex $(PROGRAM).eep $(PROGRAM).elf
+
+version.c:
+       ./version.pl > version.c
+
+.PHONY: all clean dump_eeprom program program_flash program_eeprom objdump \
+       version.c
+
similarity index 100%
rename from firmware.c
rename to firmware/firmware.c
similarity index 100%
rename from rs485.c
rename to firmware/rs485.c
similarity index 100%
rename from rs485.h
rename to firmware/rs485.h
similarity index 100%
rename from hc-sr04.scad
rename to things/hc-sr04.scad
similarity index 100%
rename from semaphore.scad
rename to things/semaphore.scad