diff --git a/codes/Makefile b/codes/Makefile index a94ffdb..d7811c6 100644 --- a/codes/Makefile +++ b/codes/Makefile @@ -6,47 +6,41 @@ export TARGET_ARCH = -mmcu=$(MCU) export CFLAGS = -Wall -I. -DF_CPU=16000000 -Os #-pedantic -std=c99#-g export LDFLAGS = -g $(TARGET_ARCH) -lm -Wl,--gc-sections # -Os -TARGET = libretour -TERM0 = /dev/ttyACM0 -TERM1 = /dev/ttyACM1 +TARGET = main +TERM0 = /dev/ttyPR0 +TERM1 = /dev/ttyPR1 CPPFLAGS = -mmcu=$(MCU) #PGMER = -c stk500v1 -b 57600 -P $(TERM) + #Dans le cas de l'upload par USB (selon le port) PGMERISP0 = -c stk500v1 -b 115200 -P $(TERM0) PGMERISP1 = -c stk500v1 -b 115200 -P $(TERM1) -ARVDUDECONF= -C /usr/local/arduino/arduino-0021/hardware/tools/avrdude.conf +ARVDUDECONF= -C /etc/avrdude.conf export DUDE = /usr/bin/avrdude -F -v -p $(MCU) $(AVRDUDECONF) + #Dans le cas de l'upload par SPI depuis la raspberry PGMERISP_RPI = -c pi_3 ARVDUDECONF_RPI = -C ~/avrdude_gpio.conf -export DUDE_RPI = avrdude -v -p $(MCU) $(AVRDUDECONF_RPI) +export DUDE_RPI = /usr/bin/avrdude -F -v -p $(MCU) $(AVRDUDECONF_RPI) -CLIB=ar cq C_SRC = $(wildcard *.c) OBJS = $(C_SRC:.c=.o) -all: $(TARGET).a - +all: $(TARGET).hex clean: - rm -f *.o *.hex *.elf *.a build-uno - -$(TARGET).o: $(TARGET).c $(TARGET).h - $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + rm -f *.o *.hex *.elf +%.o:%.c + $(CC) -c $< $(CPPFLAGS) $(CFLAGS) $(TARGET).elf: $(OBJS) - $(CC) $(LDFLAGS) -o $@ $(OBJS) + $(CC) -o $@ $^ $(LDFLAGS) $(TARGET).hex: $(TARGET).elf avr-objcopy -j .text -j .data -O ihex $(TARGET).elf $(TARGET).hex avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O ihex $(TARGET).elf eeprom.hex -$(TARGET).a: $(TARGET).o - rm -rf $@ - $(CLIB) $@ $+ - - #UPLOAD CONDITIONNEL FOLDER = $(notdir $(CURDIR)) diff --git a/site/fichiersRPI/port.sh b/site/fichiersRPI/port.sh index e14a6a0..7716f48 100755 --- a/site/fichiersRPI/port.sh +++ b/site/fichiersRPI/port.sh @@ -12,6 +12,7 @@ commande=$(udevadm info --name=$name --attribute-walk | egrep "idVendor|idProduc idProduct=$(echo $commande | cut -f 1 -d " ") idVendor=$(echo $commande | cut -f 2 -d " ") serial=$(echo $commande | cut -f 3 -d " ") +#echo $commande #echo $idProduct #echo $idVendor #echo $serial @@ -20,5 +21,5 @@ newname="$newdev$port" #echo $newname rule="SUBSYSTEM==\"tty\", $serial, $idVendor, $idProduct, SYMLINK+=\"$newname\"" #echo $rule -echo $rule > /etc/udev/rules.d/usb-serial.rules +echo $rule >> /etc/udev/rules.d/usb-serial.rules udevadm trigger diff --git a/site/fichiersRPI/script.sh b/site/fichiersRPI/script.sh index 04cf2d3..810f381 100755 --- a/site/fichiersRPI/script.sh +++ b/site/fichiersRPI/script.sh @@ -2,6 +2,11 @@ echo $$ > /var/run/script.pid +echo 4 > /sys/class/gpio/unexport +echo 9 > /sys/class/gpio/unexport +echo 10 > /sys/class/gpio/unexport +echo 11 > /sys/class/gpio/unexport + sudo make clean sudo make sudo make upload -- libgit2 0.21.2