Commit bdb410919213e33c44b7c3968a78165870d1fcfe
1 parent
2056d0e3
MAJ
Showing
3 changed files
with
19 additions
and
19 deletions
Show diff stats
codes/Makefile
... | ... | @@ -6,47 +6,41 @@ export TARGET_ARCH = -mmcu=$(MCU) |
6 | 6 | export CFLAGS = -Wall -I. -DF_CPU=16000000 -Os #-pedantic -std=c99#-g |
7 | 7 | export LDFLAGS = -g $(TARGET_ARCH) -lm -Wl,--gc-sections # -Os |
8 | 8 | |
9 | -TARGET = libretour | |
10 | -TERM0 = /dev/ttyACM0 | |
11 | -TERM1 = /dev/ttyACM1 | |
9 | +TARGET = main | |
10 | +TERM0 = /dev/ttyPR0 | |
11 | +TERM1 = /dev/ttyPR1 | |
12 | 12 | CPPFLAGS = -mmcu=$(MCU) |
13 | 13 | #PGMER = -c stk500v1 -b 57600 -P $(TERM) |
14 | + | |
14 | 15 | #Dans le cas de l'upload par USB (selon le port) |
15 | 16 | PGMERISP0 = -c stk500v1 -b 115200 -P $(TERM0) |
16 | 17 | PGMERISP1 = -c stk500v1 -b 115200 -P $(TERM1) |
17 | -ARVDUDECONF= -C /usr/local/arduino/arduino-0021/hardware/tools/avrdude.conf | |
18 | +ARVDUDECONF= -C /etc/avrdude.conf | |
18 | 19 | export DUDE = /usr/bin/avrdude -F -v -p $(MCU) $(AVRDUDECONF) |
20 | + | |
19 | 21 | #Dans le cas de l'upload par SPI depuis la raspberry |
20 | 22 | PGMERISP_RPI = -c pi_3 |
21 | 23 | ARVDUDECONF_RPI = -C ~/avrdude_gpio.conf |
22 | -export DUDE_RPI = avrdude -v -p $(MCU) $(AVRDUDECONF_RPI) | |
24 | +export DUDE_RPI = /usr/bin/avrdude -F -v -p $(MCU) $(AVRDUDECONF_RPI) | |
23 | 25 | |
24 | -CLIB=ar cq | |
25 | 26 | C_SRC = $(wildcard *.c) |
26 | 27 | OBJS = $(C_SRC:.c=.o) |
27 | 28 | |
28 | -all: $(TARGET).a | |
29 | - | |
29 | +all: $(TARGET).hex | |
30 | 30 | |
31 | 31 | clean: |
32 | - rm -f *.o *.hex *.elf *.a build-uno | |
33 | - | |
34 | -$(TARGET).o: $(TARGET).c $(TARGET).h | |
35 | - $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ | |
32 | + rm -f *.o *.hex *.elf | |
36 | 33 | |
34 | +%.o:%.c | |
35 | + $(CC) -c $< $(CPPFLAGS) $(CFLAGS) | |
37 | 36 | |
38 | 37 | $(TARGET).elf: $(OBJS) |
39 | - $(CC) $(LDFLAGS) -o $@ $(OBJS) | |
38 | + $(CC) -o $@ $^ $(LDFLAGS) | |
40 | 39 | |
41 | 40 | $(TARGET).hex: $(TARGET).elf |
42 | 41 | avr-objcopy -j .text -j .data -O ihex $(TARGET).elf $(TARGET).hex |
43 | 42 | avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O ihex $(TARGET).elf eeprom.hex |
44 | 43 | |
45 | -$(TARGET).a: $(TARGET).o | |
46 | - rm -rf $@ | |
47 | - $(CLIB) $@ $+ | |
48 | - | |
49 | - | |
50 | 44 | #UPLOAD CONDITIONNEL |
51 | 45 | FOLDER = $(notdir $(CURDIR)) |
52 | 46 | ... | ... |
site/fichiersRPI/port.sh
... | ... | @@ -12,6 +12,7 @@ commande=$(udevadm info --name=$name --attribute-walk | egrep "idVendor|idProduc |
12 | 12 | idProduct=$(echo $commande | cut -f 1 -d " ") |
13 | 13 | idVendor=$(echo $commande | cut -f 2 -d " ") |
14 | 14 | serial=$(echo $commande | cut -f 3 -d " ") |
15 | +#echo $commande | |
15 | 16 | #echo $idProduct |
16 | 17 | #echo $idVendor |
17 | 18 | #echo $serial |
... | ... | @@ -20,5 +21,5 @@ newname="$newdev$port" |
20 | 21 | #echo $newname |
21 | 22 | rule="SUBSYSTEM==\"tty\", $serial, $idVendor, $idProduct, SYMLINK+=\"$newname\"" |
22 | 23 | #echo $rule |
23 | -echo $rule > /etc/udev/rules.d/usb-serial.rules | |
24 | +echo $rule >> /etc/udev/rules.d/usb-serial.rules | |
24 | 25 | udevadm trigger | ... | ... |
site/fichiersRPI/script.sh