]> sigrok.org Git - libsigrok.git/commitdiff
binary_helpers: Add support for 24 bits wide integers.
authorMathieu Pilato <redacted>
Fri, 31 Mar 2023 07:59:11 +0000 (09:59 +0200)
committerGerhard Sittig <redacted>
Sun, 30 Apr 2023 09:33:39 +0000 (11:33 +0200)
src/binary_helpers.c
src/libsigrok-internal.h

index f9b6655de87745af5c1e1e295a3c223a85a42f33..e15787e9feb0f655b40b69f12a850499ddc4bdb0 100644 (file)
@@ -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));
index 215fce16b3efb68a9e3d8a66b41deee414244bd0..bb7e2a9c4334f3cb7e9fc3eee2e4b61dbd13898d 100644 (file)
@@ -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,