Changeset - a3dc9c1508ab
[Not reviewed]
default
0 2 0
Drew Perttula - 19 years ago 2006-06-16 16:57:33
drewp@bigasterisk.com
attemted parport fixes on dash. i don't think these got used
2 files changed with 20 insertions and 27 deletions:
0 comments (0 inline, 0 general)
light9/io/Makefile
Show inline comments
 
@@ -5,7 +5,7 @@ go: _parport.so _serport.so
 
	result="your modules and links are now up to date"
 

	
 
_parport.so: parport_wrap.c
 
	gcc -shared ${INC} parport_wrap.c parport.c -o _parport.so 
 
	gcc -shared -g ${INC} parport_wrap.c parport.c -o _parport.so 
 

	
 
parport_wrap.c: parport.c parport.i
 
	swig -python parport.i
light9/io/parport.c
Show inline comments
 
@@ -7,6 +7,7 @@
 
#include <Python.h>
 

	
 
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() {
0 comments (0 inline, 0 general)