From d6e5d5a6d4fc36f102b72a9331833c117d826e6e Mon Sep 17 00:00:00 2001 From: shakemid Date: Wed, 13 Sep 2017 21:25:24 +0900 Subject: [PATCH] Replace interrupt_read_temperature function --- pcsensor.c | 54 ++++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/pcsensor.c b/pcsensor.c index fada631..0aa56d6 100644 --- a/pcsensor.c +++ b/pcsensor.c @@ -213,9 +213,8 @@ void control_transfer(libusb_device_handle *dev, const char *pquestion) { } } -void interrupt_read(libusb_device_handle *dev) { +void interrupt_read(libusb_device_handle *dev, unsigned char *answer) { int r,s,i; - unsigned char answer[reqIntLen]; bzero(answer, reqIntLen); s = libusb_interrupt_transfer(dev, endpoint_Int_in, answer, reqIntLen, &r, timeout); @@ -231,33 +230,6 @@ void interrupt_read(libusb_device_handle *dev) { } } -void interrupt_read_temperature(libusb_device_handle *dev, float *tempInC, float *tempExC) { - int r,s,i, temperature; - unsigned char answer[reqIntLen]; - bzero(answer, reqIntLen); - - s = libusb_interrupt_transfer(dev, endpoint_Int_in, answer, reqIntLen, &r, timeout); - if(r != reqIntLen) { - fprintf(stderr, "USB read failed: %d\n", s); - perror("USB interrupt read"); bad("USB read failed"); - } - - if(debug) { - for (i=0;i