X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=libsigrok-internal.h;h=95978b2094dba7ce3e54809fe070266a0a640db8;hb=417e9f3ab427ceb61bde663e357b67dfdac09371;hp=51780c2dc9e7b3f975f9ee3994e64f0a090432ab;hpb=72e1672fc9267cd34fe9e6b174a80ec6aae420d8;p=libsigrok.git diff --git a/libsigrok-internal.h b/libsigrok-internal.h index 51780c2d..95978b20 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -43,6 +43,13 @@ #define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a) #endif +/* Portability fixes for FreeBSD. */ +#ifdef __FreeBSD__ +#define LIBUSB_CLASS_APPLICATION 0xfe +#define libusb_handle_events_timeout_completed(ctx, tv, c) \ + libusb_handle_events_timeout(ctx, tv) +#endif + struct sr_context { #ifdef HAVE_LIBUSB_1_0 libusb_context *libusb_ctx; @@ -200,7 +207,11 @@ SR_PRIV int sr_es51922_parse(const uint8_t *buf, float *floatval, /*--- hardware/common/dmm/es519xx.c -----------------------------------------*/ -#define ES519XX_11B_PACKET_SIZE (2 * 11) +/** + * All 11-byte es519xx chips repeat each block twice for each conversion cycle + * so always read 2 blocks at a time. + */ +#define ES519XX_11B_PACKET_SIZE (11 * 2) #define ES519XX_14B_PACKET_SIZE 14 struct es519xx_info { @@ -221,7 +232,7 @@ SR_PRIV gboolean sr_es519xx_2400_11b_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_2400_11b_parse(const uint8_t *buf, float *floatval, struct sr_datafeed_analog *analog, void *info); SR_PRIV gboolean sr_es519xx_19200_11b_5digits_packet_valid(const uint8_t *buf); -SR_PRIV int sr_es519xx_19200_11b_5difits_parse(const uint8_t *buf, +SR_PRIV int sr_es519xx_19200_11b_5digits_parse(const uint8_t *buf, float *floatval, struct sr_datafeed_analog *analog, void *info); SR_PRIV gboolean sr_es519xx_19200_11b_clamp_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_19200_11b_clamp_parse(const uint8_t *buf, @@ -280,8 +291,9 @@ SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *i struct metex14_info { gboolean is_ac, is_dc, is_resistance, is_capacity, is_temperature; gboolean is_diode, is_frequency, is_ampere, is_volt, is_farad; - gboolean is_hertz, is_ohm, is_celsius, is_nano, is_micro, is_milli; - gboolean is_kilo, is_mega, is_gain, is_decibel, is_hfe, is_unitless; + gboolean is_hertz, is_ohm, is_celsius, is_pico, is_nano, is_micro; + gboolean is_milli, is_kilo, is_mega, is_gain, is_decibel, is_hfe; + gboolean is_unitless; }; SR_PRIV int sr_metex14_packet_request(struct sr_serial_dev_inst *serial);