From: Gerhard Sittig Date: Thu, 16 Mar 2023 01:28:51 +0000 (+0100) Subject: rdtech-tc: eliminate excessive indentation, address whitespace issues X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5955b58c964f4db6f05d5f7110327fb722e963ba;p=libsigrok.git rdtech-tc: eliminate excessive indentation, address whitespace issues [ see a whitespace ignoring diff for review ] --- diff --git a/src/hardware/rdtech-tc/api.c b/src/hardware/rdtech-tc/api.c index e02a38c0..962e8f24 100644 --- a/src/hardware/rdtech-tc/api.c +++ b/src/hardware/rdtech-tc/api.c @@ -46,8 +46,8 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_MSEC | SR_CONF_SET, }; -static GSList *rdtech_tc_scan(struct sr_dev_driver *di, const char *conn, - const char *serialcomm) +static GSList *rdtech_tc_scan(struct sr_dev_driver *di, + const char *conn, const char *serialcomm) { struct sr_serial_dev_inst *serial; GSList *devices = NULL; @@ -119,7 +119,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) } static int config_set(uint32_t key, GVariant *data, - const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; @@ -131,7 +131,7 @@ static int config_set(uint32_t key, GVariant *data, } static int config_list(uint32_t key, GVariant **data, - const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts); } @@ -145,7 +145,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) std_session_send_df_header(sdi); serial_source_add(sdi->session, serial, G_IO_IN, 50, - rdtech_tc_receive_data, (void *)sdi); + rdtech_tc_receive_data, (void *)sdi); return rdtech_tc_poll(sdi); } diff --git a/src/hardware/rdtech-tc/protocol.c b/src/hardware/rdtech-tc/protocol.c index 93e47981..46d0e83e 100644 --- a/src/hardware/rdtech-tc/protocol.c +++ b/src/hardware/rdtech-tc/protocol.c @@ -93,7 +93,7 @@ static int check_pac_crc(uint8_t *data) } } -static int process_poll_pkt(struct dev_context *devc, uint8_t *dst) +static int process_poll_pkt(struct dev_context *devc, uint8_t *dst) { struct aes256_ctx ctx; @@ -117,13 +117,13 @@ static int process_poll_pkt(struct dev_context *devc, uint8_t *dst) return SR_OK; } -SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc) +SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc) { int len; uint8_t poll_pkt[TC_POLL_LEN]; if (serial_write_blocking(serial, &POLL_CMD, sizeof(POLL_CMD) - 1, - SERIAL_WRITE_TIMEOUT_MS) < 0) { + SERIAL_WRITE_TIMEOUT_MS) < 0) { sr_err("Unable to send probe request."); return SR_ERR; } @@ -153,7 +153,7 @@ SR_PRIV int rdtech_tc_poll(const struct sr_dev_inst *sdi) struct sr_serial_dev_inst *serial = sdi->conn; if (serial_write_blocking(serial, &POLL_CMD, sizeof(POLL_CMD) - 1, - SERIAL_WRITE_TIMEOUT_MS) < 0) { + SERIAL_WRITE_TIMEOUT_MS) < 0) { sr_err("Unable to send poll request."); return SR_ERR; } @@ -183,8 +183,8 @@ static void handle_poll_data(const struct sr_dev_inst *sdi) for (ch = sdi->channels, i = 0; ch; ch = g_slist_next(ch), i++) { bv_send_analog_channel(sdi, ch->data, - &devc->channels[i], poll_pkt, TC_POLL_LEN); - } + &devc->channels[i], poll_pkt, TC_POLL_LEN); + } sr_sw_limits_update_samples_read(&devc->limits, 1); } diff --git a/src/hardware/rdtech-tc/protocol.h b/src/hardware/rdtech-tc/protocol.h index 963c7765..9c7056d0 100644 --- a/src/hardware/rdtech-tc/protocol.h +++ b/src/hardware/rdtech-tc/protocol.h @@ -37,13 +37,12 @@ struct dev_context { struct rdtech_dev_info dev_info; const struct binary_analog_channel *channels; struct sr_sw_limits limits; - uint8_t buf[RDTECH_TC_BUFSIZE]; int buflen; int64_t cmd_sent_at; }; -SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc); +SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc); SR_PRIV int rdtech_tc_receive_data(int fd, int revents, void *cb_data); SR_PRIV int rdtech_tc_poll(const struct sr_dev_inst *sdi);