From: ian Date: Sat, 2 Oct 2004 02:14:22 +0000 (+0000) Subject: Moved from norway, now includes odyssey-train script and make install target etc. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=fddc46b44ac38b16cccb3a141c1491ece91feef5;p=trains.git Moved from norway, now includes odyssey-train script and make install target etc. --- diff --git a/parport/Makefile b/parport/Makefile index 2623263..d1fee23 100644 --- a/parport/Makefile +++ b/parport/Makefile @@ -2,9 +2,20 @@ CFLAGS= -Wall -Wwrite-strings -Wpointer-arith \ -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes \ -O2 -targets: parport-ctl train-pic-prog-select siggen +CPROGS_I= parport-ctl train-pic-prog-select +SCRIPTS_I= odyssey-train +TARGETS= siggen $(CPROGS_I) + +all: $(TARGETS) + +install: + install -m 755 -o root -g staff $(CPROGS_I) /usr/local/bin/. + install -m 755 -o root -g staff $(SCRIPTS_I) /usr/local/bin/. train-pic-prog-select: train-pic-prog-select.o lib.o siggen: siggen.o lib.o train-pic-prog-select.o siggen.o lib.o: lib.h + +clean: + rm -f $(TARGETS) diff --git a/parport/odyssey-train b/parport/odyssey-train new file mode 100755 index 0000000..8f4fa69 --- /dev/null +++ b/parport/odyssey-train @@ -0,0 +1,47 @@ +#!/bin/sh +set -e + +badusage () { + odyssey || true + echo >&2 'usage: odyssey-train [|all] operation [filename]' + echo >&2 + exit 1 +} + +which=$1 + +case "$which" in +all) + train-pic-prog-select 0-55 + whichconfig=all + ;; +[0-9]|[0-9][0-9]) + train-pic-prog-select $which + whichconfig=single + ;; +*) + badusage + ;; +esac + +shift +echo "Selected $which" +echo + +operation=$1 + +case "$operation" in +check|write|update|read|verify|erase|blankcheck) + chiptype=PIC18F458 + ;; +init|test) + chiptype='' + ;; +*) + badusage + ;; +esac + +export HOME=/etc/odyssey + +exec odyssey -f $whichconfig $chiptype "$@"