From b1d434f0ea9a2958613da9bed32ff3ff3318065e Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 28 Aug 2018 21:57:52 +0200 Subject: [PATCH 1/2] Fix the libusb and hidapi includes The libusb and hidapi pkg-config files already add the subdirectory to the header search path with: -I/usr/include/libusb-1.0 -I/usr/include/hidapi Therefore, using the subdirectory in the include statement is wrong. In practice, this usualy works fine by accident, because the base directory (/usr/include) is typically listed in the default search path of the compiler. But that's not always true. For example when cross-compiling or when using the PKG_CONFIG_LIBDIR environment variable. --- src/atomics_cobalt.c | 2 +- src/usbhid.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/atomics_cobalt.c b/src/atomics_cobalt.c index 7c7dccb..21d5896 100644 --- a/src/atomics_cobalt.c +++ b/src/atomics_cobalt.c @@ -30,7 +30,7 @@ #ifdef _WIN32 #define NOGDI #endif -#include +#include #endif #include "atomics_cobalt.h" diff --git a/src/usbhid.c b/src/usbhid.c index a3ddc74..a9563c7 100644 --- a/src/usbhid.c +++ b/src/usbhid.c @@ -45,9 +45,9 @@ #ifdef _WIN32 #define NOGDI #endif -#include +#include #elif defined(USE_HIDAPI) -#include +#include #endif #include From 884f66a11518cb7dc984566e86317173a5d6aac2 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 7 Sep 2018 10:23:17 +0200 Subject: [PATCH 2/2] Fix the Mares Smart Apnea min/max temperature The minimum and maximum temperature were mixed up. Reported-By: Peter Balck --- src/mares_iconhd_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mares_iconhd_parser.c b/src/mares_iconhd_parser.c index aa44ace..e66d190 100644 --- a/src/mares_iconhd_parser.c +++ b/src/mares_iconhd_parser.c @@ -457,7 +457,7 @@ mares_iconhd_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi break; case DC_FIELD_TEMPERATURE_MINIMUM: if (parser->model == SMARTAPNEA) - *((double *) value) = (signed short) array_uint16_le (p + 0x3C) / 10.0; + *((double *) value) = (signed short) array_uint16_le (p + 0x3E) / 10.0; else if (parser->mode == FREEDIVE) *((double *) value) = (signed short) array_uint16_le (p + 0x1C) / 10.0; else @@ -465,7 +465,7 @@ mares_iconhd_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi break; case DC_FIELD_TEMPERATURE_MAXIMUM: if (parser->model == SMARTAPNEA) - *((double *) value) = (signed short) array_uint16_le (p + 0x3E) / 10.0; + *((double *) value) = (signed short) array_uint16_le (p + 0x3C) / 10.0; else if (parser->mode == FREEDIVE) *((double *) value) = (signed short) array_uint16_le (p + 0x1E) / 10.0; else