From: Mathieu Pilato Date: Fri, 31 Mar 2023 07:59:11 +0000 (+0200) Subject: binary_helpers: Add support for 24 bits wide integers. X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=d6b236ef58eda0ce4d61a05685f7cabca3d21c57 binary_helpers: Add support for 24 bits wide integers. --- diff --git a/src/binary_helpers.c b/src/binary_helpers.c index f9b6655d..e15787e9 100644 --- a/src/binary_helpers.c +++ b/src/binary_helpers.c @@ -41,11 +41,13 @@ SR_PRIV int bv_get_value(float *out, const struct binary_value_spec *spec, VALUE_TYPE(BVT_UINT8, read_u8, sizeof(uint8_t)); VALUE_TYPE(BVT_BE_UINT16, read_u16be, sizeof(uint16_t)); + VALUE_TYPE(BVT_BE_UINT24, read_u24be, 3 * sizeof(uint8_t)); VALUE_TYPE(BVT_BE_UINT32, read_u32be, sizeof(uint32_t)); VALUE_TYPE(BVT_BE_UINT64, read_u64be, sizeof(uint64_t)); VALUE_TYPE(BVT_BE_FLOAT, read_fltbe, sizeof(float)); VALUE_TYPE(BVT_LE_UINT16, read_u16le, sizeof(uint16_t)); + VALUE_TYPE(BVT_LE_UINT24, read_u24le, 3 * sizeof(uint8_t)); VALUE_TYPE(BVT_LE_UINT32, read_u32le, sizeof(uint32_t)); VALUE_TYPE(BVT_LE_UINT64, read_u64le, sizeof(uint64_t)); VALUE_TYPE(BVT_LE_FLOAT, read_fltle, sizeof(float)); diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 215fce16..bb7e2a9c 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -2221,11 +2221,13 @@ enum binary_value_type { BVT_LE_UINT8 = BVT_UINT8, BVT_BE_UINT16, + BVT_BE_UINT24, BVT_BE_UINT32, BVT_BE_UINT64, BVT_BE_FLOAT, BVT_LE_UINT16, + BVT_LE_UINT24, BVT_LE_UINT32, BVT_LE_UINT64, BVT_LE_FLOAT,