From 714b372019597c44535edddd3d86175974b4c8c2 Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 30 Apr 2005 20:22:57 +0000 Subject: [PATCH] use -i0 by default but allow TRAIN_PPWDATA_SEL_BIT to override; allow comb-* to try out fancy combinations (which are known not to work properly, but hey) --- parport/odyssey-train | 7 ++++++- parport/train-pic-prog-select.c | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/parport/odyssey-train b/parport/odyssey-train index a945b6f..3b74aa0 100755 --- a/parport/odyssey-train +++ b/parport/odyssey-train @@ -10,7 +10,7 @@ badusage () { which=$1 -tpps='train-pic-prog-select -i1' +tpps="train-pic-prog-select -i${TRAIN_PPWDATA_SEL_BIT-0}" case "$which" in all) @@ -23,6 +23,11 @@ all) whichconfig=single echo "Selected #$which" ;; +comb-*) + $tpps ${which#comb-} + whichconfig=all + echo "Trying $which" + ;; *) badusage ;; diff --git a/parport/train-pic-prog-select.c b/parport/train-pic-prog-select.c index 7dc12b5..5b58a6a 100644 --- a/parport/train-pic-prog-select.c +++ b/parport/train-pic-prog-select.c @@ -47,7 +47,7 @@ static void wpause(int ioctlnum, unsigned char value) { ioctlnum == PPWDATA ? "" : 0, value); doioctl(ioctlnum, &value, value); - usleep(1); + usleep(5000); } int main(int argc, const char *const *argv) { @@ -108,7 +108,7 @@ int main(int argc, const char *const *argv) { } printf("Selecting %d/%d; bytes:", nselected, ROWS*COLUMNS); - wpause(PPWCONTROL, 0x02 /* !ENGAGE_VPP, !PC, !PDW */); + wpause(PPWCONTROL, ((void)0x02 /* !ENGAGE_VPP, !PC, !PDW */, 0x00)); for (row=0; row