aboutsummaryrefslogtreecommitdiff
path: root/devel/libk8055
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2011-11-25 18:36:29 +0000
committerMartin Wilke <miwi@FreeBSD.org>2011-11-25 18:36:29 +0000
commit6ad1b3600ea4ae6a9e93a4caf610ddfa4997f266 (patch)
tree98ff948cfc9b3dfc6624c889a630cec7d59f10ee /devel/libk8055
parent4626221edccf602d680bc4918662e8ff47a02b3a (diff)
Notes
Diffstat (limited to 'devel/libk8055')
-rw-r--r--devel/libk8055/Makefile31
-rw-r--r--devel/libk8055/distinfo2
-rw-r--r--devel/libk8055/files/patch-libk8055.c109
-rw-r--r--devel/libk8055/pkg-descr5
4 files changed, 147 insertions, 0 deletions
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 <jake@xz.cx>
+#
+# $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 <bsd.port.mk>
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/