changeset 75:0b86bf6808f8

new serial port module to read the PCF8591 chip with the sliders on it
author drewp
date Fri, 12 Jul 2002 09:55:52 +0000
parents 2dfae9ed1cda
children 4455a7e86643
files light8/Makefile light8/serport.i
diffstat 2 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/light8/Makefile	Thu Jul 11 15:54:24 2002 +0000
+++ b/light8/Makefile	Fri Jul 12 09:55:52 2002 +0000
@@ -1,14 +1,23 @@
 LIB=/usr/local/lib
+INC=-I/usr/local/include/python2.2
 
-go: parportmodule.so
+go: parportmodule.so FlyingFader.py serportmodule.so
+	result="your modules and links are now up to date"
+
+FlyingFader.py:
 	ln -s ../Widgets/FlyingFader.py
-	sudo python pypar
 
 parportmodule.so: parport_wrap.c
-	gcc -shared -I/usr/local/include/python2.2 parport_wrap.c parport.c -o parportmodule.so 
+	gcc -shared ${INC} parport_wrap.c parport.c -o parportmodule.so 
 
 parport_wrap.c: parport.c parport.i
 	swig -python parport.i
 
+serportmodule.so: serport_wrap.c
+	gcc -shared -O ${INC} serport_wrap.c -o serportmodule.so 
+
+serport_wrap.c: serport.i
+	swig -python serport.i
+
 clean:
-	rm -f parport_wrap.c *.o *.so
+	rm -f parport_wrap.c serport_wrap.c *.o *.so
--- a/light8/serport.i	Thu Jul 11 15:54:24 2002 +0000
+++ b/light8/serport.i	Fri Jul 12 09:55:52 2002 +0000
@@ -34,10 +34,6 @@
     #define CHAN_TO_TUPLE_POS(chan,idx) i2c_smbus_write_byte(file, chan);\
     PyTuple_SetItem(t,idx,PyInt_FromLong(i2c_smbus_read_byte(file)));
 
-    /*
-      these are shuffled here to match the way the pots read in. in
-      the returned tuple, 0=left pot..3=right pot.
-    */
     CHAN_TO_TUPLE_POS(1,0)
     CHAN_TO_TUPLE_POS(2,1)
     CHAN_TO_TUPLE_POS(3,2)