]> sigrok.org Git - libsigrok.git/commitdiff
siglent-sds: Consistently use gboolean/TRUE/FALSE.
authorUwe Hermann <redacted>
Sun, 14 Oct 2018 22:04:21 +0000 (00:04 +0200)
committerUwe Hermann <redacted>
Sun, 21 Oct 2018 21:33:15 +0000 (23:33 +0200)
src/hardware/siglent-sds/api.c
src/hardware/siglent-sds/protocol.c
src/hardware/siglent-sds/protocol.h

index ce7288190f3d5e44cda080c03cdd2fcb02ec7fe8..4cecce03b3d29685be4711b3982c6b85b58933a7 100644 (file)
@@ -201,32 +201,32 @@ static const struct siglent_sds_series supported_series[] = {
 #define SERIES(x) &supported_series[x]
 /* series, model, min timebase, analog channels, digital */
 static const struct siglent_sds_model supported_models[] = {
 #define SERIES(x) &supported_series[x]
 /* series, model, min timebase, analog channels, digital */
 static const struct siglent_sds_model supported_models[] = {
-       { SERIES(SDS1000CML), "SDS1152CML", { 20, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000CML), "SDS1102CML", { 10, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000CML), "SDS1072CML", { 5, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000CNL), "SDS1202CNL", { 20, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000CNL), "SDS1102CNL", { 10, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000CNL), "SDS1072CNL", { 5, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000DL), "SDS1202DL", { 20, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000DL), "SDS1102DL", { 10, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000DL), "SDS1022DL", { 5, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000DL), "SDS1052DL", { 5, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000DL), "SDS1052DL+", { 5, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000X), "SDS1102X", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000XP), "SDS1102X+", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000X), "SDS1202X", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000XP), "SDS1202X+", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000XE), "SDS1202X-E", { 1, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS1000XE), "SDS1104X-E", { 1, 1000000000 }, 4, true, 16 },
-       { SERIES(SDS1000XE), "SDS1204X-E", { 1, 1000000000 }, 4, true, 16 },
-       { SERIES(SDS2000X), "SDS2072X", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS2000X), "SDS2074X", { 2, 1000000000 }, 4, false, 0 },
-       { SERIES(SDS2000X), "SDS2102X", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS2000X), "SDS2104X", { 2, 1000000000 }, 4, false, 0 },
-       { SERIES(SDS2000X), "SDS2202X", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS2000X), "SDS2204X", { 2, 1000000000 }, 4, false, 0 },
-       { SERIES(SDS2000X), "SDS2302X", { 2, 1000000000 }, 2, false, 0 },
-       { SERIES(SDS2000X), "SDS2304X", { 2, 1000000000 }, 4, false, 0 },
+       { SERIES(SDS1000CML), "SDS1152CML", { 20, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000CML), "SDS1102CML", { 10, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000CML), "SDS1072CML", { 5, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000CNL), "SDS1202CNL", { 20, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000CNL), "SDS1102CNL", { 10, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000CNL), "SDS1072CNL", { 5, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000DL), "SDS1202DL", { 20, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000DL), "SDS1102DL", { 10, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000DL), "SDS1022DL", { 5, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000DL), "SDS1052DL", { 5, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000DL), "SDS1052DL+", { 5, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000X), "SDS1102X", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000XP), "SDS1102X+", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000X), "SDS1202X", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000XP), "SDS1202X+", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000XE), "SDS1202X-E", { 1, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS1000XE), "SDS1104X-E", { 1, 1000000000 }, 4, TRUE, 16 },
+       { SERIES(SDS1000XE), "SDS1204X-E", { 1, 1000000000 }, 4, TRUE, 16 },
+       { SERIES(SDS2000X), "SDS2072X", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS2000X), "SDS2074X", { 2, 1000000000 }, 4, FALSE, 0 },
+       { SERIES(SDS2000X), "SDS2102X", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS2000X), "SDS2104X", { 2, 1000000000 }, 4, FALSE, 0 },
+       { SERIES(SDS2000X), "SDS2202X", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS2000X), "SDS2204X", { 2, 1000000000 }, 4, FALSE, 0 },
+       { SERIES(SDS2000X), "SDS2302X", { 2, 1000000000 }, 2, FALSE, 0 },
+       { SERIES(SDS2000X), "SDS2304X", { 2, 1000000000 }, 4, FALSE, 0 },
 };
 
 SR_PRIV struct sr_dev_driver siglent_sds_driver_info;
 };
 
 SR_PRIV struct sr_dev_driver siglent_sds_driver_info;
index 3f1749a0c01d6054552e2e9cd9700a972c170af8..af2f2d9b0b9a1c00f028e7b33013da4fbabf56d7 100644 (file)
@@ -467,7 +467,7 @@ SR_PRIV int siglent_sds_receive(int fd, int revents, void *cb_data)
        struct sr_channel *ch;
        int len, i;
        float wait;
        struct sr_channel *ch;
        int len, i;
        float wait;
-       gboolean read_complete = false;
+       gboolean read_complete = FALSE;
 
        (void)fd;
 
 
        (void)fd;
 
@@ -556,7 +556,7 @@ SR_PRIV int siglent_sds_receive(int fd, int revents, void *cb_data)
                        }
 
                        do {
                        }
 
                        do {
-                               read_complete = false;
+                               read_complete = FALSE;
                                if (devc->num_block_bytes > devc->num_samples) {
                                        /* We received all data as one block. */
                                        /* Offset the data block buffer past the IEEE header and description header. */
                                if (devc->num_block_bytes > devc->num_samples) {
                                        /* We received all data as one block. */
                                        /* Offset the data block buffer past the IEEE header and description header. */
@@ -612,7 +612,7 @@ SR_PRIV int siglent_sds_receive(int fd, int revents, void *cb_data)
                                        sr_dbg("Transfer has been completed.");
                                        devc->num_header_bytes = 0;
                                        devc->num_block_bytes = 0;
                                        sr_dbg("Transfer has been completed.");
                                        devc->num_header_bytes = 0;
                                        devc->num_block_bytes = 0;
-                                       read_complete = true;
+                                       read_complete = TRUE;
                                        if (!sr_scpi_read_complete(scpi)) {
                                                sr_err("Read should have been completed.");
                                                packet.type = SR_DF_FRAME_END;
                                        if (!sr_scpi_read_complete(scpi)) {
                                                sr_err("Read should have been completed.");
                                                packet.type = SR_DF_FRAME_END;
index 091652054df2178dc6c9046817f58c0c4696258a..89abaf640b9331c347897190c947f0936f3d82b6 100644 (file)
@@ -20,7 +20,6 @@
 #ifndef LIBSIGROK_HARDWARE_SIGLENT_SDS_PROTOCOL_H
 #define LIBSIGROK_HARDWARE_SIGLENT_SDS_PROTOCOL_H
 
 #ifndef LIBSIGROK_HARDWARE_SIGLENT_SDS_PROTOCOL_H
 #define LIBSIGROK_HARDWARE_SIGLENT_SDS_PROTOCOL_H
 
-#include <stdbool.h>
 #include <stdint.h>
 #include <glib.h>
 #include <libsigrok/libsigrok.h>
 #include <stdint.h>
 #include <glib.h>
 #include <libsigrok/libsigrok.h>
@@ -78,7 +77,7 @@ struct siglent_sds_model {
        const char *name;
        uint64_t min_timebase[2];
        unsigned int analog_channels;
        const char *name;
        uint64_t min_timebase[2];
        unsigned int analog_channels;
-       bool has_digital;
+       gboolean has_digital;
        unsigned int digital_channels;
 };
 
        unsigned int digital_channels;
 };