updated sensor

This commit is contained in:
Paul 2023-12-01 14:00:21 +01:00
parent 9d010120d5
commit ed51155640
2 changed files with 5 additions and 4 deletions

4
Cargo.lock generated
View File

@ -135,9 +135,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.69" version = "1.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]

View File

@ -185,7 +185,7 @@ int setup_libusb_access(temper_device_t *devices) {
for (int i = 0; i < numdev; i++) { for (int i = 0; i < numdev; i++) {
usb_detach(devices[i].handle, INTERFACE1); usb_detach(devices[i].handle, INTERFACE1);
usb_detach(devices[i].handle, INTERFACE2); 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) { if (libusb_set_configuration(devices[i].handle, 0x01) < 0) {
fprintf(stderr, "Could not set configuration 1\n"); 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); 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); 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); 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) { if (s != 0) {
fprintf(stderr, "USB read failed: %s\n", libusb_error_name(s)); fprintf(stderr, "USB read failed: %s\n", libusb_error_name(s));
perror("USB interrupt read"); perror("USB interrupt read");
exit(1);
return; return;
} }