diff --git a/devel/Makefile b/devel/Makefile index 9537f94e3d6d..afa2093f78b0 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -852,6 +852,7 @@ SUBDIR += libiqxmlrpc SUBDIR += libisofs SUBDIR += libixp + SUBDIR += libk8055 SUBDIR += liblas SUBDIR += libleaftag SUBDIR += liblogging diff --git a/devel/libk8055/Makefile b/devel/libk8055/Makefile new file mode 100644 index 000000000000..d99e9dcfc3dd --- /dev/null +++ b/devel/libk8055/Makefile @@ -0,0 +1,31 @@ +# New ports collection makefile for: libk8055 +# Date created: 9 October 2011 +# Whom: Jake Smith +# +# $FreeBSD$ +# + +PORTNAME= libk8055 +PORTVERSION= 0.2 +CATEGORIES= devel +MASTER_SITES= http://www.horizon9.org/~geroy/download/k8055/ \ + http://xz.cx/downloads/k8055/ + +MAINTAINER= jake@xz.cx +COMMENT= Velleman K8055 USB experimental board support and command line tool + +MAN1= k8055.1 +MANCOMPRESSED= yes +USE_LDCONFIG= yes + +PLIST_FILES= bin/k8055 \ + lib/libk8055.c \ + lib/libk8055.o \ + lib/libk8055.so \ + lib/libk8055.so.0.2 \ + include/k8055.h + +post-patch: + @${RM} ${WRKSRC}/libk8055.c.orig + +.include diff --git a/devel/libk8055/distinfo b/devel/libk8055/distinfo new file mode 100644 index 000000000000..7d6147960ac8 --- /dev/null +++ b/devel/libk8055/distinfo @@ -0,0 +1,2 @@ +SHA256 (libk8055-0.2.tar.gz) = be936622f2ab10f0b79ce853757f65a5a9436ca921e23185ac1f65c4be87eb29 +SIZE (libk8055-0.2.tar.gz) = 8529 diff --git a/devel/libk8055/files/patch-libk8055.c b/devel/libk8055/files/patch-libk8055.c new file mode 100644 index 000000000000..a31c4a68a5de --- /dev/null +++ b/devel/libk8055/files/patch-libk8055.c @@ -0,0 +1,109 @@ +--- libk8055.c 2006-07-29 11:02:26.000000000 +0100 ++++ libk8055.c.orig 2011-10-09 21:34:57.693521803 +0100 +@@ -83,7 +83,7 @@ + return -1; /*throw -1 to show that OpenDevice failed */ + } + else +- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20); ++ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20); + if (open_status!=8) + return -1; + else +@@ -101,7 +101,7 @@ + + long ReadAnalogChannel(long Channelno){ + int open_status=0; +- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20); ++ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20); + if (open_status==8){ + if (Channelno==2) + return data_in[3]; +@@ -114,7 +114,7 @@ + + int ReadAllAnalog(long* data1, long* data2){ + int open_status=0; +- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20); ++ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20); + if (open_status==8){ + *data1=data_in[2]; + *data2=data_in[3]; +@@ -131,8 +131,8 @@ + data_out[3]=(unsigned char)data; + else + data_out[2]=(unsigned char)data; +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); + if (open_status!=8) + return -1; + else +@@ -144,8 +144,8 @@ + data_out[0]=0x05; /* analog out or digital out command */ + data_out[2]=(unsigned char)data1; + data_out[3]=(unsigned char)data2; +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); + if (open_status!=8) + return -1; + else +@@ -179,8 +179,8 @@ + int open_status=0; + data_out[0]=0x05; /* analog out or digital out command */ + data_out[1]=(unsigned char)data; +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); + if (open_status!=8) + return -1; + else +@@ -225,7 +225,7 @@ + int open_status=0,i; + unsigned char mask=8; + if (channel>0 && channel<6){ +- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20); ++ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20); + if (open_status==8){ + for (i=1;i<=channel;i++) + if (i!=3) mask*=2; +@@ -244,7 +244,7 @@ + long ReadAllDigital(){ + int open_status=0,i,return_data=0; + unsigned char mask=8,pow=1; +- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20); ++ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20); + if (open_status==8){ + for (i=1;i<=5;i++){ + mask*=2; +@@ -269,8 +269,8 @@ + if (counternr==1 || counternr==2){ + data_out[0]=0x02+(unsigned char)counternr; /* counter selection */ + data_out[3+counternr]=0x00; +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); + if (open_status==8) + return 0; + else +@@ -283,7 +283,7 @@ + long ReadCounter(long counterno){ + int open_status=0; + if (counterno==1 || counterno==2){ +- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20); ++ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20); + if (open_status==8){ + if (counterno==2) + return data_in[6]; +@@ -316,7 +316,7 @@ + value+=1; + data_out[5+counterno]=(unsigned char)value; + if (DEBUG) fprintf(stderr,"Debouncetime%d value for k8055:%d\n",(int)counterno,data_out[5+counterno]); +- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20); ++ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20); + if (open_status==8) + return 0; + else diff --git a/devel/libk8055/pkg-descr b/devel/libk8055/pkg-descr new file mode 100644 index 000000000000..1db11b7b3713 --- /dev/null +++ b/devel/libk8055/pkg-descr @@ -0,0 +1,5 @@ +Port for libk8055 to provide support for the Velleman K8055 USB +Experiment Board. Package also include k8055 command line tool. Now +you can use it with shells scripts/cron jobs. + +WWW: http://www.horizon9.org/~geroy/