From: Uwe Hermann Date: Sun, 14 Oct 2018 22:04:21 +0000 (+0200) Subject: siglent-sds: Consistently use gboolean/TRUE/FALSE. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=827139ef49bf0e2eab33beed8da2f1a4ce7c5a3b;p=libsigrok.git siglent-sds: Consistently use gboolean/TRUE/FALSE. --- diff --git a/src/hardware/siglent-sds/api.c b/src/hardware/siglent-sds/api.c index ce728819..4cecce03 100644 --- a/src/hardware/siglent-sds/api.c +++ b/src/hardware/siglent-sds/api.c @@ -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[] = { - { 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; diff --git a/src/hardware/siglent-sds/protocol.c b/src/hardware/siglent-sds/protocol.c index 3f1749a0..af2f2d9b 100644 --- a/src/hardware/siglent-sds/protocol.c +++ b/src/hardware/siglent-sds/protocol.c @@ -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; - gboolean read_complete = false; + gboolean read_complete = FALSE; (void)fd; @@ -556,7 +556,7 @@ SR_PRIV int siglent_sds_receive(int fd, int revents, void *cb_data) } 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. */ @@ -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; - 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; diff --git a/src/hardware/siglent-sds/protocol.h b/src/hardware/siglent-sds/protocol.h index 09165205..89abaf64 100644 --- a/src/hardware/siglent-sds/protocol.h +++ b/src/hardware/siglent-sds/protocol.h @@ -20,7 +20,6 @@ #ifndef LIBSIGROK_HARDWARE_SIGLENT_SDS_PROTOCOL_H #define LIBSIGROK_HARDWARE_SIGLENT_SDS_PROTOCOL_H -#include #include #include #include @@ -78,7 +77,7 @@ struct siglent_sds_model { const char *name; uint64_t min_timebase[2]; unsigned int analog_channels; - bool has_digital; + gboolean has_digital; unsigned int digital_channels; };