ajout README et reset auto au make upload
This commit is contained in:
parent
0463138b61
commit
0a9c829541
3 changed files with 47 additions and 0 deletions
|
|
@ -46,6 +46,7 @@
|
|||
# $Id$
|
||||
|
||||
PORT = /dev/serial/by-id/usb-Arduino_LLC_Arduino_Micro-if00
|
||||
RESETPORT = /dev/serial/by-id/usb-Loupiottes_DMXv3_Micro-if00
|
||||
TARGET = dmx512_micro
|
||||
SRC = lib/wiring.c lib/wiring_analog.c lib/wiring_digital.c
|
||||
CXXSRC = dmx512_micro.cpp lib/CDC.cpp lib/USBCore.cpp
|
||||
|
|
@ -133,6 +134,7 @@ sym: $(TARGET).sym
|
|||
|
||||
# Program the device.
|
||||
upload: $(TARGET).hex $(TARGET).eep
|
||||
python ./reset_and_wait.py $(RESETPORT) $(PORT)
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
|
||||
|
||||
|
||||
|
|
|
|||
16
dmx512_micro/README
Normal file
16
dmx512_micro/README
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Dépendances (debian) :
|
||||
|
||||
avrdude gcc-avr avr-libc python-serial
|
||||
|
||||
Pour compiler :
|
||||
make build
|
||||
|
||||
Pour uploader :
|
||||
make upload
|
||||
|
||||
Pour nettoyer :
|
||||
make clean
|
||||
|
||||
Pour tout faire d'un seul coup :
|
||||
make upload clean
|
||||
|
||||
29
dmx512_micro/reset_and_wait.py
Executable file
29
dmx512_micro/reset_and_wait.py
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import serial
|
||||
import os.path
|
||||
import argparse
|
||||
from time import sleep
|
||||
|
||||
parser = argparse.ArgumentParser(description='Reset an Arduino')
|
||||
parser.add_argument('resetport', nargs=1, help='Serial device e.g. /dev/ttyACM0')
|
||||
parser.add_argument('port', nargs=1, help='Serial device e.g. /dev/ttyACM0')
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
if not os.path.exists(args.resetport[0]):
|
||||
ser = serial.Serial("/dev/serial/by-id/usb-Arduino_LLC_Arduino_Leonardo-if00", 57600)
|
||||
else:
|
||||
ser = serial.Serial(args.resetport[0], 57600)
|
||||
ser.close()
|
||||
ser.open()
|
||||
ser.close()
|
||||
ser.setBaudrate(1200)
|
||||
ser.open()
|
||||
ser.close()
|
||||
sleep(1)
|
||||
|
||||
while not os.path.exists(args.port[0]):
|
||||
sleep(1)
|
||||
|
||||
|
||||
Loading…
Reference in a new issue