diff options
Diffstat (limited to 'libk8055/libk8055.c')
-rw-r--r-- | libk8055/libk8055.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libk8055/libk8055.c b/libk8055/libk8055.c index 00aab65..85ee4a3 100644 --- a/libk8055/libk8055.c +++ b/libk8055/libk8055.c @@ -79,8 +79,9 @@ **/ -#include <string.h> +#include <stdlib.h> #include <stdio.h> +#include <string.h> #include <assert.h> #include <math.h> #include <libusb.h> @@ -110,6 +111,16 @@ /* set debug to 0 to not print excess info */ static int debug = 0; +struct k8055_dev* k8055_alloc( void ) { + struct k8055_dev *dev = (struct k8055_dev*) malloc( sizeof(struct k8055_dev) ); + dev->dev_no=0; + return dev; +} + +void k8055_free( struct k8055_dev* dev ) { + free(dev); +} + /* Actual read of data from the device endpoint, retry READ_RETRY times if not responding ok */ int k8055_read( struct k8055_dev* dev ) { if( dev->dev_no==0 ) return K8055_ERROR; |