From ed5115564078bc5f413a011b46ac2ce957db9bfb Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Fri, 1 Dec 2023 14:00:21 +0100 Subject: [PATCH] updated sensor --- Cargo.lock | 4 ++-- src/pcsensor.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b05fba..1dc71d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,9 +135,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] diff --git a/src/pcsensor.c b/src/pcsensor.c index 7a6f4f8..c246fe6 100644 --- a/src/pcsensor.c +++ b/src/pcsensor.c @@ -185,7 +185,7 @@ int setup_libusb_access(temper_device_t *devices) { for (int i = 0; i < numdev; i++) { usb_detach(devices[i].handle, INTERFACE1); usb_detach(devices[i].handle, INTERFACE2); - libusb_reset_device(devices[i].handle); + //libusb_reset_device(devices[i].handle); if (libusb_set_configuration(devices[i].handle, 0x01) < 0) { fprintf(stderr, "Could not set configuration 1\n"); @@ -236,7 +236,7 @@ void interrupt_read(libusb_device_handle *dev, unsigned char *answer, const char s = libusb_interrupt_transfer(dev, endpoint_Int_in, answer, reqIntLen, &r, timeout); - if (strcmp(product_name, "TEMPerGold")==0) { + if (strcmp(product_name, "TEMPerGold") == 0) { libusb_interrupt_transfer(dev, endpoint_Int_out, (unsigned char *)question, reqIntLen, &r, timeout); s = libusb_interrupt_transfer(dev, endpoint_Int_in, answer, reqIntLen, &r, timeout); } @@ -244,6 +244,7 @@ void interrupt_read(libusb_device_handle *dev, unsigned char *answer, const char if (s != 0) { fprintf(stderr, "USB read failed: %s\n", libusb_error_name(s)); perror("USB interrupt read"); + exit(1); return; }