diff --git a/light9/io/parport.c b/light9/io/parport.c --- a/light9/io/parport.c +++ b/light9/io/parport.c @@ -7,6 +7,7 @@ #include int getparport() { + printf("parport - ver 4\n"); if( ioperm(888,3,1) ) { printf("Couldn't get parallel port at 888-890\n"); @@ -26,34 +27,26 @@ void outcontrol( unsigned char val ) { } void outbyte( unsigned char val ) { + int i; // set data, raise clock, lower clock outdata(val); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); - outcontrol(2); + + /* this was originally 26 outcontrol calls, but on new dash that + leads to screwed up dmx about once a minute. I tried doing 26*4 + outcontrol calls, but it still screwed up. I suspect the athlon64 + or my new kernel version is sending the parport really fast, + sometimes faster than the pic sees the bits. Then I put a 1ms + sleep after the outcontrol(2)'s and that didn't help either, so + I'm not sure what's going on. Putting the parallel cable on miles + seems to work. + + todo: + try a little pause after outcontrol(3) to make sure pic sees that + */ + + for (i=0; i<26*4; i++) { + outcontrol(2); + } outcontrol(3); } void outstart() {