diff --git a/src/dmm/bm25x.c b/src/dmm/bm25x.c
index 4966eedb..385d246e 100644
--- a/src/dmm/bm25x.c
+++ b/src/dmm/bm25x.c
@@ -209,7 +209,7 @@ SR_PRIV int sr_brymen_bm25x_parse(const uint8_t *buf, float *floatval,
val = -val;
*floatval = val;
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/dmm/dtm0660.c b/src/dmm/dtm0660.c
index 66e894af..e9c20bfb 100644
--- a/src/dmm/dtm0660.c
+++ b/src/dmm/dtm0660.c
@@ -384,7 +384,7 @@ SR_PRIV int sr_dtm0660_parse(const uint8_t *buf, float *floatval,
parse_flags(buf, info_local);
handle_flags(analog, floatval, &exponent, info_local);
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/dmm/fs9721.c b/src/dmm/fs9721.c
index d4a857d3..9fbcd289 100644
--- a/src/dmm/fs9721.c
+++ b/src/dmm/fs9721.c
@@ -364,7 +364,7 @@ SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval,
parse_flags(buf, info_local);
handle_flags(analog, floatval, &exponent, info_local);
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/dmm/fs9922.c b/src/dmm/fs9922.c
index 11fc7736..6e745412 100644
--- a/src/dmm/fs9922.c
+++ b/src/dmm/fs9922.c
@@ -370,7 +370,7 @@ SR_PRIV int sr_fs9922_parse(const uint8_t *buf, float *floatval,
parse_flags(buf, info_local);
handle_flags(analog, floatval, &exponent, info_local);
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/dmm/metex14.c b/src/dmm/metex14.c
index 2677484a..8198082a 100644
--- a/src/dmm/metex14.c
+++ b/src/dmm/metex14.c
@@ -153,17 +153,17 @@ static void parse_flags(const char *buf, struct metex14_info *info)
info->is_unitless = TRUE;
/* Bytes 0-1: Measurement mode, except AC/DC */
- info->is_resistance = !strncmp(buf, "OH", 2) ||
+ info->is_resistance = !strncmp(buf, "OH", 2) ||
(!strncmp(buf, " ", 2) && info->is_ohm);
- info->is_capacity = !strncmp(buf, "CA", 2) ||
+ info->is_capacity = !strncmp(buf, "CA", 2) ||
(!strncmp(buf, " ", 2) && info->is_farad);
info->is_temperature = !strncmp(buf, "TE", 2);
- info->is_diode = !strncmp(buf, "DI", 2) ||
+ info->is_diode = !strncmp(buf, "DI", 2) ||
(!strncmp(buf, " ", 2) && info->is_volt && info->is_milli);
- info->is_frequency = !strncmp(buf, "FR", 2) ||
+ info->is_frequency = !strncmp(buf, "FR", 2) ||
(!strncmp(buf, " ", 2) && info->is_hertz);
- info->is_gain = !strncmp(buf, "DB", 2);
- info->is_hfe = !strncmp(buf, "HF", 2) ||
+ info->is_gain = !strncmp(buf, "DB", 2);
+ info->is_hfe = !strncmp(buf, "HF", 2) ||
(!strncmp(buf, " ", 2) && !info->is_volt && !info->is_ohm &&
!info->is_logic && !info->is_farad && !info->is_hertz);
/*
@@ -350,7 +350,7 @@ SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval,
parse_flags((const char *)buf, info_local);
handle_flags(analog, floatval, &exponent, info_local);
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/dmm/rs9lcd.c b/src/dmm/rs9lcd.c
index ed542815..5f4d8668 100644
--- a/src/dmm/rs9lcd.c
+++ b/src/dmm/rs9lcd.c
@@ -438,7 +438,7 @@ SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval,
*floatval = rawval;
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/dmm/ut71x.c b/src/dmm/ut71x.c
index 442b6e12..23f72c2d 100644
--- a/src/dmm/ut71x.c
+++ b/src/dmm/ut71x.c
@@ -343,7 +343,7 @@ SR_PRIV int sr_ut71x_parse(const uint8_t *buf, float *floatval,
handle_flags(analog, floatval, info);
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/dmm/vc870.c b/src/dmm/vc870.c
index 43be935e..a2b2b72a 100644
--- a/src/dmm/vc870.c
+++ b/src/dmm/vc870.c
@@ -167,7 +167,7 @@ static int parse_range(uint8_t b, float *floatval, int *exponent,
static void parse_flags(const uint8_t *buf, struct vc870_info *info)
{
- /* Bytes 0/1: Function / function select */
+ /* Bytes 0/1: Function / function select */
/* Note: Some of these mappings are fixed up later. */
switch (buf[0]) {
case 0x30: /* DCV / ACV */
@@ -429,7 +429,7 @@ SR_PRIV int sr_vc870_parse(const uint8_t *buf, float *floatval,
handle_flags(analog, floatval, info_local);
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
diff --git a/src/drivers.c b/src/drivers.c
index d2763414..c6165b63 100644
--- a/src/drivers.c
+++ b/src/drivers.c
@@ -27,7 +27,7 @@
* sr_driver_list is a special section contains pointers to all the hardware
* drivers built into the library. The __start and __stop symbols are
* auto-generated by the linker (OSX needs a little help) and point to the start
- * and end of the section. They are used to iterate over the list of all
+ * and end of the section. They are used to iterate over the list of all
* drivers.
*/
#ifdef __APPLE__
diff --git a/src/hardware/agilent-dmm/agilent-dmm.h b/src/hardware/agilent-dmm/agilent-dmm.h
index 1e829055..e89c7c14 100644
--- a/src/hardware/agilent-dmm/agilent-dmm.h
+++ b/src/hardware/agilent-dmm/agilent-dmm.h
@@ -22,7 +22,7 @@
#define LOG_PREFIX "agilent-dmm"
-#define AGDMM_BUFSIZE 256
+#define AGDMM_BUFSIZE 256
/* Always USB-serial, 1ms is plenty. */
#define SERIAL_WRITE_TIMEOUT_MS 1
diff --git a/src/hardware/agilent-dmm/sched.c b/src/hardware/agilent-dmm/sched.c
index eeda2b5c..27dddc7f 100644
--- a/src/hardware/agilent-dmm/sched.c
+++ b/src/hardware/agilent-dmm/sched.c
@@ -480,14 +480,14 @@ static int recv_conf_u124x_5x(const struct sr_dev_inst *sdi, GMatchInfo *match)
devc->mode_squarewave = 0;
- rstr = g_match_info_fetch(match, 4);
+ rstr = g_match_info_fetch(match, 4);
if (rstr && sr_atoi(rstr, &resolution) == SR_OK) {
devc->cur_digits = -resolution;
devc->cur_encoding = -resolution + 1;
}
g_free(rstr);
- mstr = g_match_info_fetch(match, 1);
+ mstr = g_match_info_fetch(match, 1);
if (!strncmp(mstr, "VOLT", 4)) {
devc->cur_mq = SR_MQ_VOLTAGE;
devc->cur_unit = SR_UNIT_VOLT;
@@ -553,7 +553,7 @@ static int recv_conf_u124x_5x(const struct sr_dev_inst *sdi, GMatchInfo *match)
devc->cur_digits = 4;
devc->cur_encoding = 5;
} else if (!strncmp(mstr, "T1", 2) || !strncmp(mstr, "T2", 2) ||
- !strncmp(mstr, "TEMP", 2)) {
+ !strncmp(mstr, "TEMP", 2)) {
devc->cur_mq = SR_MQ_TEMPERATURE;
m2 = g_match_info_fetch(match, 2);
if (!strcmp(m2, "FAR"))
diff --git a/src/hardware/appa-55ii/protocol.c b/src/hardware/appa-55ii/protocol.c
index ef265ff0..c22ede50 100644
--- a/src/hardware/appa-55ii/protocol.c
+++ b/src/hardware/appa-55ii/protocol.c
@@ -23,11 +23,11 @@
#include "protocol.h"
typedef enum {
- LIVE_DATA = 0x00,
- LOG_METADATA = 0x11,
- LOG_DATA = 0x14,
- LOG_START = 0x18,
- LOG_END = 0x19,
+ LIVE_DATA = 0x00,
+ LOG_METADATA = 0x11,
+ LOG_DATA = 0x14,
+ LOG_START = 0x18,
+ LOG_END = 0x19,
} packet_type;
static gboolean appa_55ii_checksum(const uint8_t *buf)
diff --git a/src/hardware/appa-55ii/protocol.h b/src/hardware/appa-55ii/protocol.h
index eeae8e1a..248d672e 100644
--- a/src/hardware/appa-55ii/protocol.h
+++ b/src/hardware/appa-55ii/protocol.h
@@ -27,9 +27,9 @@
#define LOG_PREFIX "appa-55ii"
-#define APPA_55II_NUM_CHANNELS 2
-#define APPA_55II_BUF_SIZE (4 + 32 + 1)
-#define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE
+#define APPA_55II_NUM_CHANNELS 2
+#define APPA_55II_BUF_SIZE (4 + 32 + 1)
+#define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE
enum {
DATA_SOURCE_LIVE,
@@ -40,7 +40,7 @@ enum {
struct dev_context {
/* Acquisition settings */
struct sr_sw_limits limits;
- gboolean data_source; /**< Whether to read live samples or memory */
+ gboolean data_source; /**< Whether to read live samples or memory */
/* Temporary state across callbacks */
uint8_t buf[APPA_55II_BUF_SIZE];
diff --git a/src/hardware/brymen-bm86x/protocol.c b/src/hardware/brymen-bm86x/protocol.c
index f6ccc306..3181fef0 100644
--- a/src/hardware/brymen-bm86x/protocol.c
+++ b/src/hardware/brymen-bm86x/protocol.c
@@ -153,11 +153,11 @@ static void brymen_bm86x_parse(unsigned char *buf, float *floatval,
buf[15] &= ~0x04;
/* SI prefix */
- if (buf[14] & 0x40) { floatval[0] *= 1e-9; digits[0] += 9; } /* n */
- if (buf[15] & 0x08) { floatval[0] *= 1e-6; digits[0] += 6; } /* µ */
- if (buf[15] & 0x04) { floatval[0] *= 1e-3; digits[0] += 3; } /* m */
- if (buf[15] & 0x40) { floatval[0] *= 1e3; digits[0] -= 3; } /* k */
- if (buf[15] & 0x20) { floatval[0] *= 1e6; digits[0] -= 6; } /* M */
+ if (buf[14] & 0x40) { floatval[0] *= 1e-9; digits[0] += 9; } /* n */
+ if (buf[15] & 0x08) { floatval[0] *= 1e-6; digits[0] += 6; } /* µ */
+ if (buf[15] & 0x04) { floatval[0] *= 1e-3; digits[0] += 3; } /* m */
+ if (buf[15] & 0x40) { floatval[0] *= 1e3; digits[0] -= 3; } /* k */
+ if (buf[15] & 0x20) { floatval[0] *= 1e6; digits[0] -= 6; } /* M */
if (over_limit) floatval[0] = INFINITY;
@@ -192,10 +192,10 @@ static void brymen_bm86x_parse(unsigned char *buf, float *floatval,
if (buf[9] & 0x20) analog[1].meaning->mqflags |= SR_MQFLAG_AC;
/* SI prefix */
- if (buf[ 9] & 0x01) { floatval[1] *= 1e-6; digits[1] += 6; } /* µ */
- if (buf[ 9] & 0x02) { floatval[1] *= 1e-3; digits[1] += 3; } /* m */
- if (buf[14] & 0x02) { floatval[1] *= 1e3; digits[1] -= 3; } /* k */
- if (buf[14] & 0x01) { floatval[1] *= 1e6; digits[1] -= 6; } /* M */
+ if (buf[ 9] & 0x01) { floatval[1] *= 1e-6; digits[1] += 6; } /* µ */
+ if (buf[ 9] & 0x02) { floatval[1] *= 1e-3; digits[1] += 3; } /* m */
+ if (buf[14] & 0x02) { floatval[1] *= 1e3; digits[1] -= 3; } /* k */
+ if (buf[14] & 0x01) { floatval[1] *= 1e6; digits[1] -= 6; } /* M */
analog[1].encoding->digits = digits[1];
analog[1].spec->spec_digits = digits[1];
@@ -260,7 +260,7 @@ static int brymen_bm86x_send_command(const struct sr_dev_inst *sdi)
sr_dbg("Sending HID set report.");
ret = libusb_control_transfer(usb->devhdl,
- LIBUSB_REQUEST_TYPE_CLASS |
+ LIBUSB_REQUEST_TYPE_CLASS |
LIBUSB_RECIPIENT_INTERFACE |
LIBUSB_ENDPOINT_OUT,
9, /* bRequest: HID set_report */
diff --git a/src/hardware/cem-dt-885x/protocol.c b/src/hardware/cem-dt-885x/protocol.c
index 77b2f6ad..88fa8b7f 100644
--- a/src/hardware/cem-dt-885x/protocol.c
+++ b/src/hardware/cem-dt-885x/protocol.c
@@ -770,11 +770,11 @@ SR_PRIV int cem_dt_885x_meas_range_set(const struct sr_dev_inst *sdi,
devc = sdi->priv;
if (low == 30 && high == 130)
token = TOKEN_MEAS_RANGE_30_130;
- else if (low == 30 && high == 80)
+ else if (low == 30 && high == 80)
token = TOKEN_MEAS_RANGE_30_80;
- else if (low == 50 && high == 100)
+ else if (low == 50 && high == 100)
token = TOKEN_MEAS_RANGE_50_100;
- else if (low == 80 && high == 130)
+ else if (low == 80 && high == 130)
token = TOKEN_MEAS_RANGE_80_130;
else
return SR_ERR;
diff --git a/src/hardware/colead-slm/protocol.c b/src/hardware/colead-slm/protocol.c
index d5c75b3c..2f6957ab 100644
--- a/src/hardware/colead-slm/protocol.c
+++ b/src/hardware/colead-slm/protocol.c
@@ -138,7 +138,7 @@ static void process_packet(const struct sr_dev_inst *sdi)
case 0x9:
/* Mean over a time period between 11 seconds and 24 hours.
* Which is so silly that there's no point in expressing
- * either this or the previous case. */
+ * either this or the previous case. */
analog.meaning->mqflags |= SR_MQFLAG_SPL_LAT \
| SR_MQFLAG_SPL_FREQ_WEIGHT_A \
| SR_MQFLAG_SPL_TIME_WEIGHT_F;
diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c
index d50b446e..cfa503d5 100644
--- a/src/hardware/conrad-digi-35-cpu/api.c
+++ b/src/hardware/conrad-digi-35-cpu/api.c
@@ -17,9 +17,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Conrad DIGI 35 CPU power supply driver
- * @internal
+/**
+ * @file
+ *
+ * Conrad DIGI 35 CPU power supply driver
+ *
+ * @internal
*/
#include
diff --git a/src/hardware/conrad-digi-35-cpu/protocol.h b/src/hardware/conrad-digi-35-cpu/protocol.h
index 340cc23b..99d2cb70 100644
--- a/src/hardware/conrad-digi-35-cpu/protocol.h
+++ b/src/hardware/conrad-digi-35-cpu/protocol.h
@@ -19,7 +19,9 @@
/**
* @file
+ *
* Conrad DIGI 35 CPU power supply driver
+ *
* @internal
*/
diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c
index baf715ba..a1f8c6bf 100644
--- a/src/hardware/demo/demo.c
+++ b/src/hardware/demo/demo.c
@@ -30,16 +30,16 @@
#define LOG_PREFIX "demo"
-#define DEFAULT_NUM_LOGIC_CHANNELS 8
-#define DEFAULT_NUM_ANALOG_CHANNELS 4
+#define DEFAULT_NUM_LOGIC_CHANNELS 8
+#define DEFAULT_NUM_ANALOG_CHANNELS 4
/* The size in bytes of chunks to send through the session bus. */
-#define LOGIC_BUFSIZE 4096
+#define LOGIC_BUFSIZE 4096
/* Size of the analog pattern space per channel. */
-#define ANALOG_BUFSIZE 4096
+#define ANALOG_BUFSIZE 4096
-#define DEFAULT_ANALOG_AMPLITUDE 10
-#define ANALOG_SAMPLES_PER_PERIOD 20
+#define DEFAULT_ANALOG_AMPLITUDE 10
+#define ANALOG_SAMPLES_PER_PERIOD 20
/* Logic patterns we can generate. */
enum {
@@ -663,10 +663,8 @@ static void logic_generator(struct sr_dev_inst *sdi, uint64_t size)
}
static void send_analog_packet(struct analog_gen *ag,
- struct sr_dev_inst *sdi,
- uint64_t *analog_sent,
- uint64_t analog_pos,
- uint64_t analog_todo)
+ struct sr_dev_inst *sdi, uint64_t *analog_sent,
+ uint64_t analog_pos, uint64_t analog_todo)
{
struct sr_datafeed_packet packet;
struct dev_context *devc;
diff --git a/src/hardware/fluke-dmm/fluke-dmm.h b/src/hardware/fluke-dmm/fluke-dmm.h
index ecfa36cb..a54c7ef0 100644
--- a/src/hardware/fluke-dmm/fluke-dmm.h
+++ b/src/hardware/fluke-dmm/fluke-dmm.h
@@ -22,7 +22,7 @@
#define LOG_PREFIX "fluke-dmm"
-#define FLUKEDMM_BUFSIZE 256
+#define FLUKEDMM_BUFSIZE 256
/* Always USB-serial, 1ms is plenty. */
#define SERIAL_WRITE_TIMEOUT_MS 1
diff --git a/src/hardware/ftdi-la/api.c b/src/hardware/ftdi-la/api.c
index 22715a1f..0927d3a2 100644
--- a/src/hardware/ftdi-la/api.c
+++ b/src/hardware/ftdi-la/api.c
@@ -120,7 +120,7 @@ static void scan_device(struct ftdi_context *ftdic,
model = g_malloc(32);
serial_num = g_malloc(32);
rv = ftdi_usb_get_strings(ftdic, dev, vendor, 32,
- model, 32, serial_num, 32);
+ model, 32, serial_num, 32);
switch (rv) {
case 0:
break;
diff --git a/src/hardware/fx2lafw/protocol.c b/src/hardware/fx2lafw/protocol.c
index fc875d04..70186518 100644
--- a/src/hardware/fx2lafw/protocol.c
+++ b/src/hardware/fx2lafw/protocol.c
@@ -403,7 +403,7 @@ SR_PRIV void mso_send_data_proc(struct sr_dev_inst *sdi,
/* Send the logic */
for (i = 0; i < length; i++) {
- devc->logic_buffer[i] = data[i * 2];
+ devc->logic_buffer[i] = data[i * 2];
/* Rescale to -10V - +10V from 0-255. */
devc->analog_buffer[i] = (data[i * 2 + 1] - 128.0f) / 12.8f;
};
diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c
index 048a0afc..303d435b 100644
--- a/src/hardware/gmc-mh-1x-2x/api.c
+++ b/src/hardware/gmc-mh-1x-2x/api.c
@@ -17,9 +17,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Gossen Metrawatt Metrahit 1x/2x drivers
- * @internal
+/**
+ * @file
+ *
+ * Gossen Metrawatt Metrahit 1x/2x drivers
+ *
+ * @internal
*/
#include
@@ -40,7 +43,7 @@ static const uint32_t scanopts[] = {
/** Hardware capabilities for Metrahit 1x/2x devices in send mode. */
static const uint32_t devopts_sm[] = {
SR_CONF_MULTIMETER,
- SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
+ SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
@@ -49,7 +52,7 @@ static const uint32_t devopts_sm[] = {
/** Hardware capabilities for Metrahit 2x devices in bidirectional Mode. */
static const uint32_t devopts_bd[] = {
SR_CONF_MULTIMETER,
- SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
+ SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
@@ -118,7 +121,7 @@ static enum model scan_model_sm(struct sr_serial_dev_inst *serial)
for (cnt = 0; cnt < 4; cnt++) {
byte = read_byte(serial, timeout_us);
if ((byte == -1) ||
- ((byte & MSGID_MASK) != MSGID_DATA))
+ ((byte & MSGID_MASK) != MSGID_DATA))
{
model = METRAHIT_NONE;
bytecnt = 100;
diff --git a/src/hardware/gmc-mh-1x-2x/protocol.c b/src/hardware/gmc-mh-1x-2x/protocol.c
index 93f28e80..20bf81fc 100644
--- a/src/hardware/gmc-mh-1x-2x/protocol.c
+++ b/src/hardware/gmc-mh-1x-2x/protocol.c
@@ -17,9 +17,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Gossen Metrawatt Metrahit 1x/2x drivers
- * @internal
+/**
+ * @file
+ *
+ * Gossen Metrawatt Metrahit 1x/2x drivers
+ *
+ * @internal
*/
#include
@@ -783,7 +786,7 @@ static void process_msg_inf_10(struct sr_dev_inst *sdi)
devc->value += pow(10.0, cnt) * dgt;
}
sr_spew("process_msg_inf_10() value=%f scale=%d scalet=%d",
- devc->value, devc->scale, devc->scale1000);
+ devc->value, devc->scale, devc->scale1000);
if (devc->value != NAN)
devc->value *= pow(10, devc->scale) * pow(1000.0, devc->scale1000);
@@ -880,9 +883,11 @@ static void process_msg_inf_13(struct sr_dev_inst *sdi)
send_value(sdi);
}
-/** Dump contents of 14-byte message.
- * @param buf Pointer to array of 14 data bytes.
- * @param[in] raw Write only data bytes, no interpretation.
+/**
+ * Dump contents of 14-byte message.
+ *
+ * @param buf Pointer to array of 14 data bytes.
+ * @param[in] raw Write only data bytes, no interpretation.
*/
static void dump_msg14(guchar *buf, gboolean raw)
{
@@ -903,10 +908,11 @@ static void dump_msg14(guchar *buf, gboolean raw)
buf[12], buf[13]);
}
-/** Calc checksum for 14 byte message type.
+/**
+ * Calc checksum for 14 byte message type.
*
- * @param[in] dta Pointer to array of 13 data bytes.
- * @return Checksum.
+ * @param[in] dta Pointer to array of 13 data bytes.
+ * @return Checksum.
*/
static guchar calc_chksum_14(guchar *dta)
{
@@ -924,7 +930,7 @@ static int chk_msg14(struct sr_dev_inst *sdi)
struct dev_context *devc;
int retc;
gboolean isreq; /* Message is request to multimeter (otherwise response) */
- uint8_t addr; /* Adaptor address */
+ uint8_t addr; /* Adaptor address */
retc = SR_OK;
@@ -1024,7 +1030,7 @@ SR_PRIV int process_msg14(struct sr_dev_inst *sdi)
sr_spew("Measurement Function: %d ", (int)devc->buf[7]);
decode_ctmv_2x(devc->buf[7], devc);
sr_spew("Range: 0x%x", devc->buf[8]);
- decode_rs_2x_TR2(devc->buf[8] & 0x0f, devc); /* Docs wrong, uses conversion table TR_2! */
+ decode_rs_2x_TR2(devc->buf[8] & 0x0f, devc); /* Docs wrong, uses conversion table TR_2! */
devc->autorng = (devc->buf[8] & 0x20) == 0;
// TODO 9, 10: 29S special functions
devc->ubatt = 0.1 * (float)devc->buf[11];
@@ -1035,7 +1041,7 @@ SR_PRIV int process_msg14(struct sr_dev_inst *sdi)
sr_spew("Internal version %d.%d", (int)devc->buf[5], (int)devc->buf[4]);
sr_spew("Comm mode: 0x%x", (int)devc->buf[6]);
sr_spew("Block cnt%%64: %d", (int)devc->buf[7]);
- sr_spew("drpCi: %d drpCh: %d", (int)devc->buf[8], (int)devc->buf[9]);
+ sr_spew("drpCi: %d drpCh: %d", (int)devc->buf[8], (int)devc->buf[9]);
// Semantics undocumented. Possibly Metrahit 29S dropouts stuff?
break;
default:
@@ -1248,13 +1254,15 @@ SR_PRIV int gmc_mh_2x_receive_data(int fd, int revents, void *cb_data)
return TRUE;
}
-/** Create 14 (42) byte command for Metrahit 2x multimeter in bidir mode.
+/**
+ * Create 14 (42) byte command for Metrahit 2x multimeter in bidir mode.
*
- * Actually creates 42 bytes due to the encoding method used.
- * @param[in] addr Device address (0=adapter, 1..15 multimeter; for byte 0).
- * @param[in] func Function code (byte 3).
- * @param[in] params Further parameters (9 bytes)
- * @param[out] buf Buffer to create msg in (42 bytes).
+ * Actually creates 42 bytes due to the encoding method used.
+ *
+ * @param[in] addr Device address (0=adapter, 1..15 multimeter; for byte 0).
+ * @param[in] func Function code (byte 3).
+ * @param[in] params Further parameters (9 bytes)
+ * @param[out] buf Buffer to create msg in (42 bytes).
*/
static void create_cmd_14(guchar addr, guchar func, guchar *params, guchar *buf)
{
@@ -1316,8 +1324,11 @@ int req_meas14(const struct sr_dev_inst *sdi)
return SR_OK;
}
-/** Request status from 2x multimeter (msg 3).
- * @param[in] power_on Try to power on powered off multimeter by sending additional messages.
+/**
+ * Request status from 2x multimeter (msg 3).
+ *
+ * @param[in] power_on Try to power on powered off multimeter by sending
+ * additional messages.
*/
int req_stat14(const struct sr_dev_inst *sdi, gboolean power_on)
{
@@ -1412,11 +1423,12 @@ SR_PRIV int gmc_decode_model_sm(uint8_t mcode)
}
}
-/** Convert GMC model code in bidirectional mode to sigrok-internal one.
+/**
+ * Convert GMC model code in bidirectional mode to sigrok-internal one.
*
- * @param[in] mcode Model code.
+ * @param[in] mcode Model code.
*
- * @return Model code.
+ * @return Model code.
*/
SR_PRIV int gmc_decode_model_bd(uint8_t mcode)
{
@@ -1447,11 +1459,12 @@ SR_PRIV int gmc_decode_model_bd(uint8_t mcode)
}
}
-/** Convert sigrok-internal model code to string.
+/**
+ * Convert sigrok-internal model code to string.
*
- * @param[in] mcode Model code.
+ * @param[in] mcode Model code.
*
- * @return Model code string.
+ * @return Model code string.
*/
SR_PRIV const char *gmc_model_str(enum model mcode)
{
diff --git a/src/hardware/gmc-mh-1x-2x/protocol.h b/src/hardware/gmc-mh-1x-2x/protocol.h
index 8668ff34..52563d95 100644
--- a/src/hardware/gmc-mh-1x-2x/protocol.h
+++ b/src/hardware/gmc-mh-1x-2x/protocol.h
@@ -17,9 +17,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Gossen Metrawatt Metrahit 1x/2x drivers
- * @internal
+/**
+ * @file
+ *
+ * Gossen Metrawatt Metrahit 1x/2x drivers
+ *
+ * @internal
*/
#ifndef LIBSIGROK_HARDWARE_GMC_MH_1X_2X_PROTOCOL_H
@@ -42,7 +45,7 @@
#define MSGID_DTA 0x20 /**< Start of data message, displayed, averaged */
#define MSGID_DATA 0x30 /**< Data byte in message */
-#define MSGC_MASK 0x0f /**< Mask to get message byte contents in send mode */
+#define MSGC_MASK 0x0f /**< Mask to get message byte contents in send mode */
#define MSGSRC_MASK 0xc0 /**< Mask to get bits related to message source */
diff --git a/src/hardware/gwinstek-gds-800/api.c b/src/hardware/gwinstek-gds-800/api.c
index 2889a814..99c29a3e 100644
--- a/src/hardware/gwinstek-gds-800/api.c
+++ b/src/hardware/gwinstek-gds-800/api.c
@@ -66,8 +66,8 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
devc = g_malloc0(sizeof(struct dev_context));
devc->frame_limit = 1;
- devc->sample_rate = 0.;
- devc->df_started = FALSE;
+ devc->sample_rate = 0.0;
+ devc->df_started = FALSE;
sdi->priv = devc;
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "CH1");
diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c
index 2681a8f0..85712f8d 100644
--- a/src/hardware/hameg-hmo/protocol.c
+++ b/src/hardware/hameg-hmo/protocol.c
@@ -284,7 +284,7 @@ static void scope_state_dump(const struct scope_config *config,
for (i = 0; i < config->analog_channels; i++) {
tmp = sr_voltage_string((*config->vdivs)[state->analog_channels[i].vdiv][0],
(*config->vdivs)[state->analog_channels[i].vdiv][1]);
- sr_info("State of analog channel %d -> %s : %s (coupling) %s (vdiv) %2.2e (offset)",
+ sr_info("State of analog channel %d -> %s : %s (coupling) %s (vdiv) %2.2e (offset)",
i + 1, state->analog_channels[i].state ? "On" : "Off",
(*config->coupling_options)[state->analog_channels[i].coupling],
tmp, state->analog_channels[i].vertical_offset);
diff --git a/src/hardware/hantek-6xxx/api.c b/src/hardware/hantek-6xxx/api.c
index 349b557b..0f00cd3e 100644
--- a/src/hardware/hantek-6xxx/api.c
+++ b/src/hardware/hantek-6xxx/api.c
@@ -307,7 +307,7 @@ static int dev_open(struct sr_dev_inst *sdi)
err = libusb_claim_interface(usb->devhdl, USB_INTERFACE);
if (err != 0) {
sr_err("Unable to claim interface: %s.",
- libusb_error_name(err));
+ libusb_error_name(err));
return SR_ERR;
}
diff --git a/src/hardware/hantek-6xxx/protocol.h b/src/hardware/hantek-6xxx/protocol.h
index c32792e3..0e3e04d4 100644
--- a/src/hardware/hantek-6xxx/protocol.h
+++ b/src/hardware/hantek-6xxx/protocol.h
@@ -31,7 +31,7 @@
#define MAX_RENUM_DELAY_MS 3000
#define DEFAULT_VOLTAGE 2
-#define DEFAULT_COUPLING COUPLING_DC
+#define DEFAULT_COUPLING COUPLING_DC
#define DEFAULT_SAMPLERATE SR_MHZ(8)
#define NUM_CHANNELS 2
@@ -43,7 +43,7 @@
SR_KHZ(100),
#define SAMPLERATE_REGS \
- 48, 30, 24, 16, 8, 4, 1, 50, 20, 10,
+ 48, 30, 24, 16, 8, 4, 1, 50, 20, 10,
#define VDIV_VALUES \
{ 100, 1000 }, \
diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c
index e9aa4e58..7b99b0f0 100644
--- a/src/hardware/hantek-dso/api.c
+++ b/src/hardware/hantek-dso/api.c
@@ -39,8 +39,8 @@
/* TODO tune this properly */
#define TICK 1
-#define NUM_TIMEBASE 10
-#define NUM_VDIV 8
+#define NUM_TIMEBASE 10
+#define NUM_VDIV 8
#define NUM_BUFFER_SIZES 2
@@ -389,7 +389,7 @@ static int dev_open(struct sr_dev_inst *sdi)
err = libusb_claim_interface(usb->devhdl, USB_INTERFACE);
if (err != 0) {
sr_err("Unable to claim interface: %s.",
- libusb_error_name(err));
+ libusb_error_name(err));
return SR_ERR;
}
@@ -767,7 +767,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
num_samples = transfer->actual_length / 2;
sr_spew("Got %d-%d/%d samples in frame.", devc->samp_received + 1,
- devc->samp_received + num_samples, devc->framesize);
+ devc->samp_received + num_samples, devc->framesize);
/*
* The device always sends a full frame, but the beginning of the frame
@@ -798,7 +798,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
/* The rest of this chunk starts with the trigger point. */
sr_dbg("Reached trigger point, %d samples buffered.",
- devc->samp_buffered);
+ devc->samp_buffered);
/* Avoid the corner case where the chunk ended at
* exactly the trigger point. */
@@ -822,7 +822,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
/* That was the last chunk in this frame. Send the buffered
* pre-trigger samples out now, in one big chunk. */
sr_dbg("End of frame, sending %d pre-trigger buffered samples.",
- devc->samp_buffered);
+ devc->samp_buffered);
send_chunk(sdi, devc->framebuf, devc->samp_buffered);
/* Mark the end of this frame. */
diff --git a/src/hardware/hp-3457a/protocol.c b/src/hardware/hp-3457a/protocol.c
index bf673fde..dd8d6f8f 100644
--- a/src/hardware/hp-3457a/protocol.c
+++ b/src/hardware/hp-3457a/protocol.c
@@ -67,7 +67,7 @@ static const struct rear_card_info rear_card_parameters[] = {
};
static int send_mq_ac_dc(struct sr_scpi_dev_inst *scpi, const char *mode,
- enum sr_mqflag flags)
+ enum sr_mqflag flags)
{
const char *ac_flag, *dc_flag;
diff --git a/src/hardware/hung-chang-dso-2100/protocol.c b/src/hardware/hung-chang-dso-2100/protocol.c
index cfe84f41..160e5a0c 100644
--- a/src/hardware/hung-chang-dso-2100/protocol.c
+++ b/src/hardware/hung-chang-dso-2100/protocol.c
@@ -79,11 +79,11 @@
* trigger on (rising or falling)
* The next state is 0x0C
* 0x0C Same as state 0x0F but expects the calibration
- * value for the first channel's position
+ * value for the first channel's position
* (POS1 in the schematics)
* The next state is 0x0D
* 0x0D Same as state 0x0F but expects the calibration
- * value for the second channel's position
+ * value for the second channel's position
* (POS2 in the schematics)
* The next state is 0x0E
* 0x0E Same as state 0x0F but expects the trigger level
diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c
index a4e62619..30bb1b2a 100644
--- a/src/hardware/kecheng-kc-330b/api.c
+++ b/src/hardware/kecheng-kc-330b/api.c
@@ -184,7 +184,7 @@ static int dev_close(struct sr_dev_inst *sdi)
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
+ /* Nothing to do. */
return SR_OK;
/* This allows a frontend to configure the device without ever
diff --git a/src/hardware/lascar-el-usb/api.c b/src/hardware/lascar-el-usb/api.c
index 405c8f92..96ed3616 100644
--- a/src/hardware/lascar-el-usb/api.c
+++ b/src/hardware/lascar-el-usb/api.c
@@ -109,7 +109,7 @@ static int dev_close(struct sr_dev_inst *sdi)
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
+ /* Nothing to do. */
return SR_OK;
libusb_release_interface(usb->devhdl, LASCAR_INTERFACE);
diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c
index 97a9a300..59e30d3f 100644
--- a/src/hardware/manson-hcs-3xxx/api.c
+++ b/src/hardware/manson-hcs-3xxx/api.c
@@ -19,10 +19,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/** @file
- * Manson HCS-3xxx series power supply driver
- * @internal
- */
+/**
+ * @file
+ *
+ * Manson HCS-3xxx series power supply driver
+ *
+ * @internal
+ */
#include
#include "protocol.h"
diff --git a/src/hardware/manson-hcs-3xxx/protocol.c b/src/hardware/manson-hcs-3xxx/protocol.c
index 04e18a5f..7a377832 100644
--- a/src/hardware/manson-hcs-3xxx/protocol.c
+++ b/src/hardware/manson-hcs-3xxx/protocol.c
@@ -19,10 +19,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/** @file
- * Manson HCS-3xxx Series power supply driver
- * @internal
- */
+/**
+ * @file
+ *
+ * Manson HCS-3xxx Series power supply driver
+ *
+ * @internal
+ */
#include
#include "protocol.h"
@@ -56,10 +59,12 @@ SR_PRIV int hcs_send_cmd(struct sr_serial_dev_inst *serial, const char *cmd, ...
/**
* Read data from interface into buffer blocking until @a lines number of \\r chars
* received.
+ *
* @param serial Previously initialized serial port structure.
* @param[in] lines Number of \\r-terminated lines to read (1-n).
- * @param buf Buffer for result. Contents is NUL-terminated on success.
+ * @param buf Buffer for result. Contents is NUL-terminated on success.
* @param[in] buflen Buffer length (>0).
+ *
* @retval SR_OK Lines received and ending with "OK\r" (success).
* @retval SR_ERR Error.
* @retval SR_ERR_ARG Invalid argument.
diff --git a/src/hardware/manson-hcs-3xxx/protocol.h b/src/hardware/manson-hcs-3xxx/protocol.h
index bb898f20..df8814ed 100644
--- a/src/hardware/manson-hcs-3xxx/protocol.h
+++ b/src/hardware/manson-hcs-3xxx/protocol.h
@@ -19,10 +19,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/** @file
- * Manson HCS-3xxx Series power supply driver
- * @internal
- */
+/**
+ * @file
+ *
+ * Manson HCS-3xxx Series power supply driver
+ *
+ * @internal
+ */
#ifndef LIBSIGROK_HARDWARE_MANSON_HCS_3XXX_PROTOCOL_H
#define LIBSIGROK_HARDWARE_MANSON_HCS_3XXX_PROTOCOL_H
diff --git a/src/hardware/maynuo-m97/api.c b/src/hardware/maynuo-m97/api.c
index 68225431..3ded72e9 100644
--- a/src/hardware/maynuo-m97/api.c
+++ b/src/hardware/maynuo-m97/api.c
@@ -53,9 +53,11 @@ static const uint32_t devopts_cg[] = {
SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE | SR_CONF_GET,
};
-/* The IDs in this list are only guessed and needs to be verified
- against some real hardware. If at least a few of them matches,
- it will probably be safe to enable the others. */
+/*
+ * The IDs in this list are only guessed and needs to be verified
+ * against some real hardware. If at least a few of them matches,
+ * it will probably be safe to enable the others.
+ */
static const struct maynuo_m97_model supported_models[] = {
// { 53, "M9711" , 30, 150, 150 },
// { 54, "M9712" , 30, 150, 300 },
@@ -170,12 +172,12 @@ static int config_compare(gconstpointer a, gconstpointer b)
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct sr_config default_serialcomm = {
- .key = SR_CONF_SERIALCOMM,
- .data = g_variant_new_string("9600/8n1"),
+ .key = SR_CONF_SERIALCOMM,
+ .data = g_variant_new_string("9600/8n1"),
};
struct sr_config default_modbusaddr = {
- .key = SR_CONF_MODBUSADDR,
- .data = g_variant_new_uint64(1),
+ .key = SR_CONF_MODBUSADDR,
+ .data = g_variant_new_uint64(1),
};
GSList *opts = options, *devices;
@@ -224,8 +226,7 @@ static int dev_close(struct sr_dev_inst *sdi)
/* Wait for the last data that was requested from the device. */
uint16_t registers[devc->expecting_registers];
sr_modbus_read_holding_registers(modbus, -1,
- devc->expecting_registers,
- registers);
+ devc->expecting_registers, registers);
}
maynuo_m97_set_bit(modbus, PC1, 0);
diff --git a/src/hardware/maynuo-m97/protocol.c b/src/hardware/maynuo-m97/protocol.c
index 05c3ae68..04fa2948 100644
--- a/src/hardware/maynuo-m97/protocol.c
+++ b/src/hardware/maynuo-m97/protocol.c
@@ -95,8 +95,8 @@ SR_PRIV int maynuo_m97_get_model_version(struct sr_modbus_dev_inst *modbus,
uint16_t registers[2];
int ret;
ret = sr_modbus_read_holding_registers(modbus, MODEL, 2, registers);
- *model = RB16(registers+0);
- *version = RB16(registers+1);
+ *model = RB16(registers + 0);
+ *version = RB16(registers + 1);
return ret;
}
diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c
index 1fe0d86c..de707f2d 100644
--- a/src/hardware/motech-lps-30x/api.c
+++ b/src/hardware/motech-lps-30x/api.c
@@ -18,9 +18,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Motech LPS-30x series power supply driver
- * @internal
+/**
+ * @file
+ *
+ * Motech LPS-30x series power supply driver
+ *
+ * @internal
*/
#include
@@ -173,7 +176,7 @@ SR_PRIV int lps_cmd_ok(struct sr_serial_dev_inst *serial, const char *fmt, ...)
va_list args;
char buf[LINELEN_MAX];
char *bufptr;
- int buflen;
+ int buflen;
/* Send command */
va_start(args, fmt);
@@ -194,8 +197,9 @@ SR_PRIV int lps_cmd_ok(struct sr_serial_dev_inst *serial, const char *fmt, ...)
return SR_ERR;
}
-/** Send command and read reply string.
- * @param reply Pointer to buffer of size LINELEN_MAX. Will be NUL-terminated.
+/**
+ * Send command and read reply string.
+ * @param reply Pointer to buffer of size LINELEN_MAX. Will be NUL-terminated.
*/
SR_PRIV int lps_cmd_reply(char *reply, struct sr_serial_dev_inst *serial, const char *fmt, ...)
{
@@ -203,7 +207,7 @@ SR_PRIV int lps_cmd_reply(char *reply, struct sr_serial_dev_inst *serial, const
va_list args;
char buf[LINELEN_MAX];
char *bufptr;
- int buflen;
+ int buflen;
reply[0] = '\0';
@@ -307,9 +311,11 @@ static gint64 calc_timeout_ms(gint64 start_us)
return result;
}
-/** Read message into buf until "OK" received.
- * @retval SR_OK Msg received; buf and buflen contain result, if any except OK.
- * @retval SR_ERR Error, including timeout.
+/**
+ * Read message into buf until "OK" received.
+ *
+ * @retval SR_OK Msg received; buf and buflen contain result, if any except OK.
+ * @retval SR_ERR Error, including timeout.
*/
SR_PRIV int lps_read_reply(struct sr_serial_dev_inst *serial, char **buf, int *buflen)
{
@@ -431,7 +437,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
g_strstrip(buf);
verstr = buf + 4;
}
- else /* Bug in device FW 1.17: Querying version string fails while output is active.
+ else /* Bug in device FW 1.17: Querying version string fails while output is active.
Therefore just print an error message, but do not exit with error. */
sr_err("Failed to query for hardware version: %s.",
sr_strerror(ret));
@@ -725,10 +731,10 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
case SR_CONF_DEVICE_OPTIONS:
if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- devopts_ch12, ARRAY_SIZE(devopts_ch12), sizeof(uint32_t));
+ devopts_ch12, ARRAY_SIZE(devopts_ch12), sizeof(uint32_t));
else /* Must be CH3 */
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t));
+ devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t));
break;
case SR_CONF_VOLTAGE_TARGET:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
diff --git a/src/hardware/motech-lps-30x/protocol.c b/src/hardware/motech-lps-30x/protocol.c
index 0681eed6..4de6f0e9 100644
--- a/src/hardware/motech-lps-30x/protocol.c
+++ b/src/hardware/motech-lps-30x/protocol.c
@@ -18,9 +18,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Motech LPS-30x series power supply driver
- * @internal
+/**
+ * @file
+ *
+ * Motech LPS-30x series power supply driver
+ *
+ * @internal
*/
#include
diff --git a/src/hardware/motech-lps-30x/protocol.h b/src/hardware/motech-lps-30x/protocol.h
index 71458728..cb74148f 100644
--- a/src/hardware/motech-lps-30x/protocol.h
+++ b/src/hardware/motech-lps-30x/protocol.h
@@ -18,9 +18,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Motech LPS-30x series power supply driver
- * @internal
+/**
+ * @file
+ *
+ * Motech LPS-30x series power supply driver
+ *
+ * @internal
*/
#ifndef LIBSIGROK_HARDWARE_MOTECH_LPS_30X_PROTOCOL_H
diff --git a/src/hardware/norma-dmm/protocol.c b/src/hardware/norma-dmm/protocol.c
index 96a47379..de31828a 100644
--- a/src/hardware/norma-dmm/protocol.c
+++ b/src/hardware/norma-dmm/protocol.c
@@ -17,9 +17,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Norma DM9x0/Siemens B102x DMMs driver.
- * @internal
+/**
+ * @file
+ *
+ * Norma DM9x0/Siemens B102x DMMs driver.
+ *
+ * @internal
*/
#include
@@ -350,13 +353,13 @@ static void nma_process_line(const struct sr_dev_inst *sdi)
/* 4: Flags. Evaluating this after setting value! */
flags = xgittoint(devc->buf[4]);
if (flags & 0x04) /* Invalid value */
- value = NAN;
+ value = NAN;
else if (flags & 0x01) /* Overload */
- value = INFINITY;
+ value = INFINITY;
if (flags & 0x02) { /* Duplicate value, has been sent before. */
- sr_spew("Duplicate value, dismissing!");
- devc->buflen = 0;
- return;
+ sr_spew("Duplicate value, dismissing!");
+ devc->buflen = 0;
+ return;
}
sr_spew("range=%d/scale=%f/value=%f", range,
diff --git a/src/hardware/norma-dmm/protocol.h b/src/hardware/norma-dmm/protocol.h
index 7ce7911f..bec61070 100644
--- a/src/hardware/norma-dmm/protocol.h
+++ b/src/hardware/norma-dmm/protocol.h
@@ -28,14 +28,17 @@
#include
#include "libsigrok-internal.h"
-/** @file
- * Norma DM9x0/Siemens B102x DMMs driver.
- * @internal
+/**
+ * @file
+ *
+ * Norma DM9x0/Siemens B102x DMMs driver.
+ *
+ * @internal
*/
#define LOG_PREFIX "norma-dmm"
-#define NMADMM_BUFSIZE 256
+#define NMADMM_BUFSIZE 256
#define NMADMM_TIMEOUT_MS 2000 /**< Request timeout. */
diff --git a/src/hardware/rigol-ds/protocol.c b/src/hardware/rigol-ds/protocol.c
index df72307d..77af43e9 100644
--- a/src/hardware/rigol-ds/protocol.c
+++ b/src/hardware/rigol-ds/protocol.c
@@ -221,7 +221,7 @@ static int rigol_ds_check_stop(const struct sr_dev_inst *sdi)
return SR_OK;
if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
- ch->index + 1) != SR_OK)
+ ch->index + 1) != SR_OK)
return SR_ERR;
/* Check that the number of samples will be accepted */
if (rigol_ds_config_set(sdi, ":WAV:POIN %d", devc->analog_frame_size) != SR_OK)
@@ -432,7 +432,7 @@ SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi)
break;
case PROTOCOL_V3:
if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
- ch->index + 1) != SR_OK)
+ ch->index + 1) != SR_OK)
return SR_ERR;
if (devc->data_source != DATA_SOURCE_LIVE) {
if (rigol_ds_config_set(sdi, ":WAV:RES") != SR_OK)
diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c
index 3597d3f1..e6b752d1 100644
--- a/src/hardware/saleae-logic16/api.c
+++ b/src/hardware/saleae-logic16/api.c
@@ -195,7 +195,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
for (j = 0; j < ARRAY_SIZE(channel_names); j++)
sr_channel_new(sdi, j, SR_CHANNEL_LOGIC, TRUE,
- channel_names[j]);
+ channel_names[j]);
devc = g_malloc0(sizeof(struct dev_context));
devc->selected_voltage_range = VOLTAGE_RANGE_18_33_V;
diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c
index 5bce3af0..57bdcb81 100644
--- a/src/hardware/scpi-pps/api.c
+++ b/src/hardware/scpi-pps/api.c
@@ -43,9 +43,8 @@ static const struct pps_channel_instance pci[] = {
};
static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi,
- int (*get_hw_id)(struct sr_scpi_dev_inst *scpi,
- struct sr_scpi_hw_info **scpi_response)
- )
+ int (*get_hw_id)(struct sr_scpi_dev_inst *scpi,
+ struct sr_scpi_hw_info **scpi_response))
{
struct dev_context *devc;
struct sr_dev_inst *sdi;
diff --git a/src/hardware/scpi-pps/profiles.c b/src/hardware/scpi-pps/profiles.c
index 7cd2e2b7..f2cbf737 100644
--- a/src/hardware/scpi-pps/profiles.c
+++ b/src/hardware/scpi-pps/profiles.c
@@ -481,7 +481,7 @@ static int philips_pm2800_probe_channels(struct sr_dev_inst *sdi,
sr_dbg("output %d: %.0f - %.0fV, %.0f - %.0fA, %.0f - %.0fW", i + 1,
spec->voltage[0], spec->voltage[1],
spec->current[0], spec->current[1],
- spec->power[0] , spec->power[1]);
+ spec->power[0], spec->power[1]);
(*channels)[i].name = (char *)philips_pm2800_names[i];
memcpy(&((*channels)[i].voltage), spec, sizeof(float) * 15);
(*channel_groups)[i].name = (char *)philips_pm2800_names[i];
diff --git a/src/hardware/serial-dmm/protocol.h b/src/hardware/serial-dmm/protocol.h
index f8ecbb42..97493456 100644
--- a/src/hardware/serial-dmm/protocol.h
+++ b/src/hardware/serial-dmm/protocol.h
@@ -35,11 +35,15 @@ struct dmm_info {
uint32_t baudrate;
/** Packet size in bytes. */
int packet_size;
- /** Request timeout [ms] before request is considered lost and a new
- * one is sent. Used only if device needs polling. */
+ /**
+ * Request timeout [ms] before request is considered lost and a new
+ * one is sent. Used only if device needs polling.
+ */
int64_t req_timeout_ms;
- /** Delay between reception of packet and next request. Some DMMs
- * need this. Used only if device needs polling. */
+ /**
+ * Delay between reception of packet and next request. Some DMMs
+ * need this. Used only if device needs polling.
+ */
int64_t req_delay_ms;
/** Packet request function. */
int (*packet_request)(struct sr_serial_dev_inst *);
@@ -64,8 +68,10 @@ struct dev_context {
int bufoffset;
int buflen;
- /** The timestamp [µs] to send the next request.
- * Used only if device needs polling. */
+ /**
+ * The timestamp [µs] to send the next request.
+ * Used only if device needs polling.
+ */
int64_t req_next_at;
};
diff --git a/src/hardware/sysclk-lwla/lwla1016.c b/src/hardware/sysclk-lwla/lwla1016.c
index b280b7a2..d16a35e7 100644
--- a/src/hardware/sysclk-lwla/lwla1016.c
+++ b/src/hardware/sysclk-lwla/lwla1016.c
@@ -121,7 +121,7 @@ static void read_response(struct acquisition_state *acq)
* alignment is guaranteed.
*/
out_p = (uint32_t *)&acq->out_packet[acq->out_index * UNIT_SIZE];
- in_p = &acq->xfer_buf_in[acq->in_index];
+ in_p = &acq->xfer_buf_in[acq->in_index];
/*
* Transfer two samples at a time, taking care to swap the 16-bit
* halves of each input word but keeping the samples themselves in
@@ -201,7 +201,7 @@ static int test_read_memory(const struct sr_dev_inst *sdi,
unsigned char reply[512];
devc = sdi->priv;
- usb = sdi->conn;
+ usb = sdi->conn;
command[0] = LWLA_WORD(CMD_READ_MEM32);
command[1] = LWLA_WORD_0(start);
@@ -317,7 +317,7 @@ static int setup_acquisition(const struct sr_dev_inst *sdi)
int ret;
devc = sdi->priv;
- usb = sdi->conn;
+ usb = sdi->conn;
ret = lwla_write_reg(usb, REG_CHAN_MASK, devc->channel_mask);
if (ret != SR_OK)
@@ -349,7 +349,7 @@ static int prepare_request(const struct sr_dev_inst *sdi)
unsigned int chunk_len, count;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
acq->xfer_out->length = 0;
acq->reg_seq_pos = 0;
@@ -409,7 +409,7 @@ static int handle_response(const struct sr_dev_inst *sdi)
int expect_len;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
switch (devc->state) {
case STATE_STATUS_REQUEST:
diff --git a/src/hardware/sysclk-lwla/lwla1034.c b/src/hardware/sysclk-lwla/lwla1034.c
index 14692c38..a4bda368 100644
--- a/src/hardware/sysclk-lwla/lwla1034.c
+++ b/src/hardware/sysclk-lwla/lwla1034.c
@@ -284,7 +284,7 @@ static int detect_short_transfer_quirk(const struct sr_dev_inst *sdi)
const int lreg_count = 10;
devc = sdi->priv;
- usb = sdi->conn;
+ usb = sdi->conn;
command[0] = LWLA_WORD(CMD_READ_LREGS);
command[1] = LWLA_WORD(0);
@@ -389,8 +389,8 @@ static int setup_acquisition(const struct sr_dev_inst *sdi)
int ret;
devc = sdi->priv;
- usb = sdi->conn;
- acq = devc->acquisition;
+ usb = sdi->conn;
+ acq = devc->acquisition;
ret = lwla_write_regs(usb, capture_init, ARRAY_SIZE(capture_init));
if (ret != SR_OK)
@@ -414,7 +414,7 @@ static int setup_acquisition(const struct sr_dev_inst *sdi)
bulk_long_set(acq, LREG_DIV_COUNT, divider_count);
bulk_long_set(acq, LREG_TRG_VALUE, devc->trigger_values);
- bulk_long_set(acq, LREG_TRG_TYPE, devc->trigger_edge_mask);
+ bulk_long_set(acq, LREG_TRG_TYPE, devc->trigger_edge_mask);
trigger_mask = devc->trigger_mask;
@@ -517,7 +517,7 @@ static int handle_response(const struct sr_dev_inst *sdi)
int expect_len;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
switch (devc->state) {
case STATE_STATUS_REQUEST:
@@ -527,7 +527,7 @@ static int handle_response(const struct sr_dev_inst *sdi)
return SR_ERR;
}
acq->mem_addr_fill = bulk_long_get(acq, LREG_MEM_FILL) & 0xFFFFFFFF;
- acq->duration_now = bulk_long_get(acq, LREG_DURATION);
+ acq->duration_now = bulk_long_get(acq, LREG_DURATION);
/* Shift left by one so the bit positions match the LWLA1016. */
acq->status = (bulk_long_get(acq, LREG_STATUS) & 0x3F) << 1;
/*
diff --git a/src/hardware/sysclk-lwla/protocol.c b/src/hardware/sysclk-lwla/protocol.c
index 986aa612..85997249 100644
--- a/src/hardware/sysclk-lwla/protocol.c
+++ b/src/hardware/sysclk-lwla/protocol.c
@@ -97,7 +97,7 @@ static int submit_request(const struct sr_dev_inst *sdi,
int ret;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
devc->state = state;
@@ -132,7 +132,7 @@ static void handle_status_response(const struct sr_dev_inst *sdi)
unsigned int old_status;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
old_status = acq->status;
if ((*devc->model->handle_response)(sdi) != SR_OK) {
@@ -168,7 +168,7 @@ static void handle_length_response(const struct sr_dev_inst *sdi)
struct acquisition_state *acq;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
if ((*devc->model->handle_response)(sdi) != SR_OK) {
devc->transfer_error = TRUE;
@@ -202,13 +202,13 @@ static void handle_read_response(const struct sr_dev_inst *sdi)
unsigned int end_addr;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
/* Prepare session packet. */
- packet.type = SR_DF_LOGIC;
+ packet.type = SR_DF_LOGIC;
packet.payload = &logic;
logic.unitsize = (devc->model->num_channels + 7) / 8;
- logic.data = acq->out_packet;
+ logic.data = acq->out_packet;
end_addr = MIN(acq->mem_addr_next, acq->mem_addr_stop);
acq->in_index = 0;
@@ -258,7 +258,7 @@ static void clear_acquisition_state(const struct sr_dev_inst *sdi)
struct acquisition_state *acq;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
devc->acquisition = NULL;
@@ -281,7 +281,7 @@ static int transfer_event(int fd, int revents, void *cb_data)
(void)fd;
- sdi = cb_data;
+ sdi = cb_data;
devc = sdi->priv;
drvc = sdi->driver->context;
@@ -289,7 +289,7 @@ static int transfer_event(int fd, int revents, void *cb_data)
return G_SOURCE_REMOVE;
/* Handle pending USB events without blocking. */
- tv.tv_sec = 0;
+ tv.tv_sec = 0;
tv.tv_usec = 0;
ret = libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx,
&tv, NULL);
@@ -329,9 +329,9 @@ static void LIBUSB_CALL transfer_out_completed(struct libusb_transfer *transfer)
struct dev_context *devc;
struct acquisition_state *acq;
- sdi = transfer->user_data;
+ sdi = transfer->user_data;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer to device failed (state %d): %s.",
@@ -394,9 +394,9 @@ static void LIBUSB_CALL transfer_in_completed(struct libusb_transfer *transfer)
struct dev_context *devc;
struct acquisition_state *acq;
- sdi = transfer->user_data;
+ sdi = transfer->user_data;
devc = sdi->priv;
- acq = devc->acquisition;
+ acq = devc->acquisition;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer from device failed (state %d): %s.",
@@ -457,7 +457,7 @@ static int init_acquisition_state(const struct sr_dev_inst *sdi)
struct acquisition_state *acq;
devc = sdi->priv;
- usb = sdi->conn;
+ usb = sdi->conn;
if (devc->acquisition) {
sr_err("Acquisition still in progress?");
diff --git a/src/hardware/teleinfo/protocol.h b/src/hardware/teleinfo/protocol.h
index 3f896523..f450547e 100644
--- a/src/hardware/teleinfo/protocol.h
+++ b/src/hardware/teleinfo/protocol.h
@@ -43,7 +43,7 @@ struct dev_context {
struct sr_sw_limits sw_limits;
/* Operational state */
- enum optarif optarif; /**< The device mode (which measures are reported) */
+ enum optarif optarif; /**< The device mode (which measures are reported) */
/* Temporary state across callbacks */
uint8_t buf[TELEINFO_BUF_SIZE];
diff --git a/src/hardware/testo/api.c b/src/hardware/testo/api.c
index 2f44eaad..90f589d7 100644
--- a/src/hardware/testo/api.c
+++ b/src/hardware/testo/api.c
@@ -174,7 +174,7 @@ static int dev_close(struct sr_dev_inst *sdi)
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
+ /* Nothing to do. */
return SR_OK;
libusb_release_interface(usb->devhdl, 0);
diff --git a/src/hardware/tondaj-sl-814/protocol.c b/src/hardware/tondaj-sl-814/protocol.c
index cf885191..063544e8 100644
--- a/src/hardware/tondaj-sl-814/protocol.c
+++ b/src/hardware/tondaj-sl-814/protocol.c
@@ -175,7 +175,7 @@ SR_PRIV int tondaj_sl_814_receive_data(int fd, int revents, void *cb_data)
} else if (devc->state == GET_PACKET) {
/* Read a packet from the device. */
ret = serial_read_nonblocking(serial, devc->buf + devc->buflen,
- 4 - devc->buflen);
+ 4 - devc->buflen);
if (ret < 0) {
sr_err("Error reading packet: %d.", ret);
return TRUE;
diff --git a/src/hardware/uni-t-dmm/api.c b/src/hardware/uni-t-dmm/api.c
index 2dab1be4..6176a460 100644
--- a/src/hardware/uni-t-dmm/api.c
+++ b/src/hardware/uni-t-dmm/api.c
@@ -165,7 +165,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
std_session_send_df_header(sdi);
sr_session_source_add(sdi->session, -1, 0, 10 /* poll_timeout */,
- uni_t_dmm_receive_data, (void *)sdi);
+ uni_t_dmm_receive_data, (void *)sdi);
return SR_OK;
}
@@ -181,7 +181,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
#define DMM(ID, CHIPSET, VENDOR, MODEL, BAUDRATE, PACKETSIZE, \
VALID, PARSE, DETAILS) \
- &((struct dmm_info) { \
+ &((struct dmm_info) { \
{ \
.name = ID, \
.longname = VENDOR " " MODEL, \
diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c
index 8e84c2c1..da53be9e 100644
--- a/src/hardware/uni-t-ut32x/api.c
+++ b/src/hardware/uni-t-ut32x/api.c
@@ -134,7 +134,7 @@ static int dev_close(struct sr_dev_inst *sdi)
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
+ /* Nothing to do. */
return SR_OK;
libusb_release_interface(usb->devhdl, USB_INTERFACE);
diff --git a/src/hardware/uni-t-ut32x/protocol.h b/src/hardware/uni-t-ut32x/protocol.h
index a2bad330..969ccfa6 100644
--- a/src/hardware/uni-t-ut32x/protocol.h
+++ b/src/hardware/uni-t-ut32x/protocol.h
@@ -38,7 +38,7 @@
#define EP_OUT 2
enum {
- DATA_SOURCE_LIVE,
+ DATA_SOURCE_LIVE,
DATA_SOURCE_MEMORY,
};
diff --git a/src/hardware/victor-dmm/api.c b/src/hardware/victor-dmm/api.c
index b5502043..ff0302d9 100644
--- a/src/hardware/victor-dmm/api.c
+++ b/src/hardware/victor-dmm/api.c
@@ -31,6 +31,7 @@
#define VICTOR_VENDOR "Victor"
#define VICTOR_INTERFACE 0
#define VICTOR_ENDPOINT (LIBUSB_ENDPOINT_IN | 1)
+
static int dev_acquisition_stop(struct sr_dev_inst *sdi);
static const uint32_t drvopts[] = {
@@ -133,7 +134,7 @@ static int dev_close(struct sr_dev_inst *sdi)
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
+ /* Nothing to do. */
return SR_OK;
libusb_release_interface(usb->devhdl, VICTOR_INTERFACE);
diff --git a/src/hardware/yokogawa-dlm/protocol.c b/src/hardware/yokogawa-dlm/protocol.c
index 5c9866e4..bd2f33f0 100644
--- a/src/hardware/yokogawa-dlm/protocol.c
+++ b/src/hardware/yokogawa-dlm/protocol.c
@@ -207,8 +207,8 @@ static const struct scope_config scope_models[] = {
.num_ydivs = 8,
},
{
- .model_id = {"710110", "710120", "710130", NULL},
- .model_name = {"DLM2024", "DLM2034", "DLM2054", NULL},
+ .model_id = {"710110", "710120", "710130", NULL},
+ .model_name = {"DLM2024", "DLM2034", "DLM2054", NULL},
.analog_channels = 4,
.digital_channels = 8,
.pods = 1,
@@ -224,9 +224,9 @@ static const struct scope_config scope_models[] = {
},
{
.model_id = {"701307", "701308", "701310", "701311",
- "701312", "701313", NULL},
+ "701312", "701313", NULL},
.model_name = {"DL9040", "DL9040L", "DL9140", "DL9140L",
- "DL9240", "DL9240L", NULL},
+ "DL9240", "DL9240L", NULL},
.analog_channels = 4,
.digital_channels = 0,
.pods = 0,
diff --git a/src/hardware/zeroplus-logic-cube/analyzer.c b/src/hardware/zeroplus-logic-cube/analyzer.c
index aa5643ab..321b17c0 100644
--- a/src/hardware/zeroplus-logic-cube/analyzer.c
+++ b/src/hardware/zeroplus-logic-cube/analyzer.c
@@ -420,7 +420,7 @@ SR_PRIV void analyzer_read_start(libusb_device_handle *devh)
}
SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer,
- unsigned int size)
+ unsigned int size)
{
return gl_read_bulk(devh, buffer, size);
}
@@ -555,7 +555,7 @@ SR_PRIV void analyzer_add_filter(int channel, int type)
}
g_filter_status[i] |=
- 1 << ((2 * channel) + (type == FILTER_LOW ? 1 : 0));
+ 1 << ((2 * channel) + (type == FILTER_LOW ? 1 : 0));
g_filter_enable = 1;
}
diff --git a/src/hardware/zeroplus-logic-cube/analyzer.h b/src/hardware/zeroplus-logic-cube/analyzer.h
index 41a1eed8..29f2c292 100644
--- a/src/hardware/zeroplus-logic-cube/analyzer.h
+++ b/src/hardware/zeroplus-logic-cube/analyzer.h
@@ -77,7 +77,7 @@
SR_PRIV void analyzer_set_freq(int freq, int scale);
SR_PRIV void analyzer_set_ramsize_trigger_address(unsigned int address);
SR_PRIV void analyzer_set_triggerbar_address(unsigned int address);
-SR_PRIV unsigned int analyzer_get_ramsize_trigger_address(void );
+SR_PRIV unsigned int analyzer_get_ramsize_trigger_address(void );
SR_PRIV unsigned int analyzer_get_triggerbar_address(void);
SR_PRIV void analyzer_set_compression(unsigned int type);
SR_PRIV void analyzer_set_memory_size(unsigned int size);
@@ -99,7 +99,7 @@ SR_PRIV void analyzer_initialize(libusb_device_handle *devh);
SR_PRIV void analyzer_wait(libusb_device_handle *devh, int set, int unset);
SR_PRIV void analyzer_read_start(libusb_device_handle *devh);
SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer,
- unsigned int size);
+ unsigned int size);
SR_PRIV void analyzer_read_stop(libusb_device_handle *devh);
SR_PRIV void analyzer_start(libusb_device_handle *devh);
SR_PRIV void analyzer_configure(libusb_device_handle *devh);
diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c
index dc9f2dea..3d0c3a41 100644
--- a/src/hardware/zeroplus-logic-cube/api.c
+++ b/src/hardware/zeroplus-logic-cube/api.c
@@ -413,10 +413,10 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
case SR_CONF_DEVICE_OPTIONS:
if (!sdi) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
+ drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
} else {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
+ devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
}
break;
case SR_CONF_SAMPLERATE:
diff --git a/src/hardware/zeroplus-logic-cube/gl_usb.c b/src/hardware/zeroplus-logic-cube/gl_usb.c
index 0d662f65..9899473f 100644
--- a/src/hardware/zeroplus-logic-cube/gl_usb.c
+++ b/src/hardware/zeroplus-logic-cube/gl_usb.c
@@ -92,9 +92,10 @@ static int gl_read_data(libusb_device_handle *devh)
SR_PRIV int gl_read_bulk(libusb_device_handle *devh, void *buffer,
unsigned int size)
{
- unsigned char packet[8] =
- { 0, 0, 0, 0, size & 0xff, (size & 0xff00) >> 8,
- (size & 0xff0000) >> 16, (size & 0xff000000) >> 24 };
+ unsigned char packet[8] = {
+ 0, 0, 0, 0, size & 0xff, (size & 0xff00) >> 8,
+ (size & 0xff0000) >> 16, (size & 0xff000000) >> 24
+ };
int ret, transferred = 0;
ret = libusb_control_transfer(devh, CTRL_OUT, 0x4, REQ_READBULK,
diff --git a/src/hwdriver.c b/src/hwdriver.c
index c23e761a..ab221010 100644
--- a/src/hwdriver.c
+++ b/src/hwdriver.c
@@ -553,9 +553,12 @@ SR_PRIV void sr_hw_cleanup_all(const struct sr_context *ctx)
}
}
-/** Allocate struct sr_config.
- * A floating reference can be passed in for data.
- * @private
+/**
+ * Allocate struct sr_config.
+ *
+ * A floating reference can be passed in for data.
+ *
+ * @private
*/
SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data)
{
@@ -568,8 +571,10 @@ SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data)
return src;
}
-/** Free struct sr_config.
- * @private
+/**
+ * Free struct sr_config.
+ *
+ * @private
*/
SR_PRIV void sr_config_free(struct sr_config *src)
{
@@ -680,7 +685,7 @@ static int check_key(const struct sr_dev_driver *driver,
* Otherwise it must be NULL. If sdi is != NULL, sdi->priv must
* also be != NULL.
* @param[in] cg The channel group on the device for which to list the
- * values, or NULL.
+ * values, or NULL.
* @param[in] key The configuration key (SR_CONF_*).
* @param[in,out] data Pointer to a GVariant where the value will be stored.
* Must not be NULL. The caller is given ownership of the GVariant
@@ -691,8 +696,8 @@ static int check_key(const struct sr_dev_driver *driver,
* @retval SR_OK Success.
* @retval SR_ERR Error.
* @retval SR_ERR_ARG The driver doesn't know that key, but this is not to be
- * interpreted as an error by the caller; merely as an indication
- * that it's not applicable.
+ * interpreted as an error by the caller; merely as an indication
+ * that it's not applicable.
*
* @since 0.3.0
*/
@@ -742,8 +747,8 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
* @retval SR_OK Success.
* @retval SR_ERR Error.
* @retval SR_ERR_ARG The driver doesn't know that key, but this is not to be
- * interpreted as an error by the caller; merely as an indication
- * that it's not applicable.
+ * interpreted as an error by the caller; merely as an indication
+ * that it's not applicable.
*
* @since 0.3.0
*/
@@ -814,8 +819,8 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
* @retval SR_OK Success.
* @retval SR_ERR Error.
* @retval SR_ERR_ARG The driver doesn't know that key, but this is not to be
- * interpreted as an error by the caller; merely as an indication
- * that it's not applicable.
+ * interpreted as an error by the caller; merely as an indication
+ * that it's not applicable.
*
* @since 0.3.0
*/
diff --git a/src/input/binary.c b/src/input/binary.c
index 4984edb0..91e4d3c4 100644
--- a/src/input/binary.c
+++ b/src/input/binary.c
@@ -29,9 +29,9 @@
#define LOG_PREFIX "input/binary"
-#define MAX_CHUNK_SIZE 4096
-#define DEFAULT_NUM_CHANNELS 8
-#define DEFAULT_SAMPLERATE 0
+#define MAX_CHUNK_SIZE 4096
+#define DEFAULT_NUM_CHANNELS 8
+#define DEFAULT_SAMPLERATE 0
struct context {
gboolean started;
diff --git a/src/input/csv.c b/src/input/csv.c
index 1eb20bff..8d151fdc 100644
--- a/src/input/csv.c
+++ b/src/input/csv.c
@@ -89,7 +89,7 @@ struct context {
/* Comment prefix character(s). */
GString *comment;
- /* Termination character(s) used in current stream. */
+ /* Termination character(s) used in current stream. */
char *termination;
/* Determines if sample data is stored in multiple columns. */
diff --git a/src/input/raw_analog.c b/src/input/raw_analog.c
index 9c7135f0..95b1d669 100644
--- a/src/input/raw_analog.c
+++ b/src/input/raw_analog.c
@@ -31,9 +31,9 @@
#define LOG_PREFIX "input/raw_analog"
/* How many bytes at a time to process and send to the session bus. */
-#define CHUNK_SIZE 4096
-#define DEFAULT_NUM_CHANNELS 1
-#define DEFAULT_SAMPLERATE 0
+#define CHUNK_SIZE 4096
+#define DEFAULT_NUM_CHANNELS 1
+#define DEFAULT_SAMPLERATE 0
struct context {
gboolean started;
diff --git a/src/input/trace32_ad.c b/src/input/trace32_ad.c
index a9b1ca4f..8cbd4d07 100644
--- a/src/input/trace32_ad.c
+++ b/src/input/trace32_ad.c
@@ -50,7 +50,7 @@
#define MAX_POD_COUNT 12
#define HEADER_SIZE 80
-#define TIMESTAMP_RESOLUTION ((double)0.000000000078125) /* 0.078125 ns */
+#define TIMESTAMP_RESOLUTION ((double)0.000000000078125) /* 0.078125 ns */
/*
* The resolution equals a sampling freq of 12.8 GHz. That's a bit high
@@ -79,7 +79,7 @@ enum {
enum {
AD_COMPR_NONE = 0, /* File created with /NOCOMPRESS */
- AD_COMPR_QCOMP = 6 /* File created with /COMPRESS or /QUICKCOMPRESS */
+ AD_COMPR_QCOMP = 6, /* File created with /COMPRESS or /QUICKCOMPRESS */
};
struct context {
@@ -253,8 +253,8 @@ static int process_header(GString *buf, struct context *inc)
inc->device = device_id;
inc->trigger_timestamp = RL64(buf->str + 32);
- inc->compression = R8(buf->str + 48); /* Maps to the enum. */
- inc->record_mode = R8(buf->str + 55); /* Maps to the enum. */
+ inc->compression = R8(buf->str + 48); /* Maps to the enum. */
+ inc->record_mode = R8(buf->str + 55); /* Maps to the enum. */
inc->record_size = record_size;
inc->record_count = RL32(buf->str + 60);
inc->last_record = RL32S(buf->str + 64);
diff --git a/src/input/vcd.c b/src/input/vcd.c
index 3b8aba82..1f200330 100644
--- a/src/input/vcd.c
+++ b/src/input/vcd.c
@@ -93,7 +93,7 @@ struct vcd_channel {
/*
* Reads a single VCD section from input file and parses it to name/contents.
- * e.g. $timescale 1ps $end => "timescale" "1ps"
+ * e.g. $timescale 1ps $end => "timescale" "1ps"
*/
static gboolean parse_section(GString *buf, gchar **name, gchar **contents)
{
diff --git a/src/input/wav.c b/src/input/wav.c
index 4f5744a7..243fd4ca 100644
--- a/src/input/wav.c
+++ b/src/input/wav.c
@@ -31,7 +31,7 @@
#define LOG_PREFIX "input/wav"
/* How many bytes at a time to process and send to the session bus. */
-#define CHUNK_SIZE 4096
+#define CHUNK_SIZE 4096
/* Minimum size of header + 1 8-bit mono PCM sample. */
#define MIN_DATA_CHUNK_OFFSET 45
diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c
index cd901366..9412ff46 100644
--- a/src/lcr/es51919.c
+++ b/src/lcr/es51919.c
@@ -490,21 +490,21 @@ static void parse_measurement(const uint8_t *pkt, float *floatval,
int unit;
int exponent;
} units[] = {
- { SR_UNIT_UNITLESS, 0 }, /* no unit */
- { SR_UNIT_OHM, 0 }, /* Ohm */
- { SR_UNIT_OHM, 3 }, /* kOhm */
- { SR_UNIT_OHM, 6 }, /* MOhm */
- { -1, 0 }, /* ??? */
- { SR_UNIT_HENRY, -6 }, /* uH */
- { SR_UNIT_HENRY, -3 }, /* mH */
- { SR_UNIT_HENRY, 0 }, /* H */
- { SR_UNIT_HENRY, 3 }, /* kH */
- { SR_UNIT_FARAD, -12 }, /* pF */
- { SR_UNIT_FARAD, -9 }, /* nF */
- { SR_UNIT_FARAD, -6 }, /* uF */
- { SR_UNIT_FARAD, -3 }, /* mF */
- { SR_UNIT_PERCENTAGE, 0 }, /* % */
- { SR_UNIT_DEGREE, 0 }, /* degree */
+ { SR_UNIT_UNITLESS, 0 }, /* no unit */
+ { SR_UNIT_OHM, 0 }, /* Ohm */
+ { SR_UNIT_OHM, 3 }, /* kOhm */
+ { SR_UNIT_OHM, 6 }, /* MOhm */
+ { -1, 0 }, /* ??? */
+ { SR_UNIT_HENRY, -6 }, /* uH */
+ { SR_UNIT_HENRY, -3 }, /* mH */
+ { SR_UNIT_HENRY, 0 }, /* H */
+ { SR_UNIT_HENRY, 3 }, /* kH */
+ { SR_UNIT_FARAD, -12 }, /* pF */
+ { SR_UNIT_FARAD, -9 }, /* nF */
+ { SR_UNIT_FARAD, -6 }, /* uF */
+ { SR_UNIT_FARAD, -3 }, /* mF */
+ { SR_UNIT_PERCENTAGE, 0 }, /* % */
+ { SR_UNIT_DEGREE, 0 }, /* degree */
};
const uint8_t *buf;
int digits, exponent;
diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h
index 2e196074..0856c480 100644
--- a/src/libsigrok-internal.h
+++ b/src/libsigrok-internal.h
@@ -17,9 +17,11 @@
* along with this program. If not, see .
*/
-/** @file
- * @internal
- */
+/**
+ * @file
+ *
+ * @internal
+ */
#ifndef LIBSIGROK_LIBSIGROK_INTERNAL_H
#define LIBSIGROK_LIBSIGROK_INTERNAL_H
@@ -428,9 +430,9 @@ struct sr_input_module {
* @retval SR_OK This module knows the format.
* @retval SR_ERR_NA There wasn't enough data for this module to
* positively identify the format.
- * @retval SR_ERR_DATA This module knows the format, but cannot handle it.
- * This means the stream is either corrupt, or indicates a feature
- * that the module does not support.
+ * @retval SR_ERR_DATA This module knows the format, but cannot handle
+ * it. This means the stream is either corrupt, or indicates a
+ * feature that the module does not support.
* @retval SR_ERR This module does not know the format.
*/
int (*format_match) (GHashTable *metadata);
@@ -468,16 +470,16 @@ struct sr_input_module {
*/
int (*end) (struct sr_input *in);
- /**
- * Reset the input module's input handling structures.
- *
- * Causes the input module to reset its internal state so that we can
- * re-send the input data from the beginning without having to
- * re-create the entire input module.
- *
- * @retval SR_OK Success.
- * @retval other Negative error code.
- */
+ /**
+ * Reset the input module's input handling structures.
+ *
+ * Causes the input module to reset its internal state so that we can
+ * re-send the input data from the beginning without having to
+ * re-create the entire input module.
+ *
+ * @retval SR_OK Success.
+ * @retval other Negative error code.
+ */
int (*reset) (struct sr_input *in);
/**
@@ -495,7 +497,7 @@ struct sr_input_module {
/** Output module instance. */
struct sr_output {
- /** A pointer to this output's module. */
+ /** A pointer to this output's module. */
const struct sr_output_module *module;
/**
@@ -612,7 +614,7 @@ struct sr_output_module {
/** Transform module instance. */
struct sr_transform {
- /** A pointer to this transform's module. */
+ /** A pointer to this transform's module. */
const struct sr_transform_module *module;
/**
diff --git a/src/modbus/modbus.c b/src/modbus/modbus.c
index bd8c8344..3c660a18 100644
--- a/src/modbus/modbus.c
+++ b/src/modbus/modbus.c
@@ -29,7 +29,7 @@ SR_PRIV extern const struct sr_modbus_dev_inst modbus_serial_rtu_dev;
static const struct sr_modbus_dev_inst *modbus_devs[] = {
#ifdef HAVE_LIBSERIALPORT
- &modbus_serial_rtu_dev, /* Must be last as it matches any resource. */
+ &modbus_serial_rtu_dev, /* Must be last as it matches any resource. */
#endif
};
diff --git a/src/output/ascii.c b/src/output/ascii.c
index cc67bd9e..ba9acf9d 100644
--- a/src/output/ascii.c
+++ b/src/output/ascii.c
@@ -182,7 +182,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
/* Flush line buffers. */
g_string_append_len(*out, ctx->lines[j]->str, ctx->lines[j]->len);
g_string_append_c(*out, '\n');
- if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) {
+ if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) {
offset = ctx->trigger + ctx->trigger / 8;
g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger);
ctx->trigger = -1;
diff --git a/src/output/bits.c b/src/output/bits.c
index 71cbd95a..f4868033 100644
--- a/src/output/bits.c
+++ b/src/output/bits.c
@@ -167,7 +167,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
/* Flush line buffers. */
g_string_append_len(*out, ctx->lines[j]->str, ctx->lines[j]->len);
g_string_append_c(*out, '\n');
- if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) {
+ if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) {
offset = ctx->trigger + ctx->trigger / 8;
g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger);
ctx->trigger = -1;
diff --git a/src/output/srzip.c b/src/output/srzip.c
index b5545585..43dbd16b 100644
--- a/src/output/srzip.c
+++ b/src/output/srzip.c
@@ -339,7 +339,7 @@ static int zip_append_analog(const struct sr_output *o,
if (outc->analog_index_map[index] == channel->index)
break;
if (outc->analog_index_map[index] == -1)
- return SR_ERR_ARG; /* Channel index was not in the list */
+ return SR_ERR_ARG; /* Channel index was not in the list */
index += outc->first_analog_index;
diff --git a/src/resource.c b/src/resource.c
index b921d93d..c87e7be0 100644
--- a/src/resource.c
+++ b/src/resource.c
@@ -224,15 +224,15 @@ SR_API int sr_resource_set_hooks(struct sr_context *ctx,
return SR_ERR_ARG;
}
if (open_cb && close_cb && read_cb) {
- ctx->resource_open_cb = open_cb;
+ ctx->resource_open_cb = open_cb;
ctx->resource_close_cb = close_cb;
- ctx->resource_read_cb = read_cb;
- ctx->resource_cb_data = cb_data;
+ ctx->resource_read_cb = read_cb;
+ ctx->resource_cb_data = cb_data;
} else if (!open_cb && !close_cb && !read_cb) {
- ctx->resource_open_cb = &resource_open_default;
+ ctx->resource_open_cb = &resource_open_default;
ctx->resource_close_cb = &resource_close_default;
- ctx->resource_read_cb = &resource_read_default;
- ctx->resource_cb_data = ctx;
+ ctx->resource_read_cb = &resource_read_default;
+ ctx->resource_cb_data = ctx;
} else {
sr_err("%s: inconsistent callback pointers.", __func__);
return SR_ERR_ARG;
@@ -332,7 +332,7 @@ SR_PRIV gssize sr_resource_read(struct sr_context *ctx,
* @param max_size Size limit. Error out if the resource is larger than this.
*
* @return A buffer containing the resource data, or NULL on failure. Must
- * be freed by the caller using g_free().
+ * be freed by the caller using g_free().
*
* @private
*/
diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c
index e54427ff..e4346e5d 100644
--- a/src/scpi/scpi.c
+++ b/src/scpi/scpi.c
@@ -90,7 +90,7 @@ static const struct sr_scpi_dev_inst *scpi_devs[] = {
&scpi_libgpib_dev,
#endif
#ifdef HAVE_LIBSERIALPORT
- &scpi_serial_dev, /* must be last as it matches any resource */
+ &scpi_serial_dev, /* Must be last as it matches any resource. */
#endif
};
@@ -446,7 +446,7 @@ SR_PRIV int sr_scpi_get_data(struct sr_scpi_dev_inst *scpi,
sr_err("Incompletely read SCPI response.");
return SR_ERR;
} else if (len > 0) {
- laststart = g_get_monotonic_time();
+ laststart = g_get_monotonic_time();
}
offset += len;
g_string_set_size(response, offset);
diff --git a/src/scpi/scpi_tcp.c b/src/scpi/scpi_tcp.c
index e87f5e78..a4cb6942 100644
--- a/src/scpi/scpi_tcp.c
+++ b/src/scpi/scpi_tcp.c
@@ -66,8 +66,8 @@ static int scpi_tcp_dev_inst_new(void *priv, struct drv_context *drvc,
}
tcp->address = g_strdup(params[1]);
- tcp->port = g_strdup(params[2]);
- tcp->socket = -1;
+ tcp->port = g_strdup(params[2]);
+ tcp->socket = -1;
return SR_OK;
}
diff --git a/src/scpi/scpi_usbtmc_libusb.c b/src/scpi/scpi_usbtmc_libusb.c
index 6e472750..decafdb6 100644
--- a/src/scpi/scpi_usbtmc_libusb.c
+++ b/src/scpi/scpi_usbtmc_libusb.c
@@ -48,8 +48,8 @@ struct scpi_usbtmc_libusb {
};
/* Some USBTMC-specific enums, as defined in the USBTMC standard. */
-#define SUBCLASS_USBTMC 0x03
-#define USBTMC_USB488 0x01
+#define SUBCLASS_USBTMC 0x03
+#define USBTMC_USB488 0x01
enum {
/* USBTMC control requests */
@@ -85,16 +85,16 @@ enum {
#define USB488_DEV_CAP_SCPI 0x08
/* Bulk messages constants */
-#define USBTMC_BULK_HEADER_SIZE 12
+#define USBTMC_BULK_HEADER_SIZE 12
/* Bulk MsgID values */
-#define DEV_DEP_MSG_OUT 1
-#define REQUEST_DEV_DEP_MSG_IN 2
-#define DEV_DEP_MSG_IN 2
+#define DEV_DEP_MSG_OUT 1
+#define REQUEST_DEV_DEP_MSG_IN 2
+#define DEV_DEP_MSG_IN 2
/* bmTransferAttributes */
-#define EOM 0x01
-#define TERM_CHAR_ENABLED 0x02
+#define EOM 0x01
+#define TERM_CHAR_ENABLED 0x02
struct usbtmc_blacklist {
uint16_t vid;
@@ -103,10 +103,10 @@ struct usbtmc_blacklist {
/* Devices that publish RL1 support, but don't support it. */
static struct usbtmc_blacklist blacklist_remote[] = {
- { 0x1ab1, 0x0588 }, /* Rigol DS1000 series */
- { 0x1ab1, 0x04b0 }, /* Rigol DS2000 series */
- { 0x0957, 0x0588 }, /* Agilent DSO1000 series (rebadged Rigol DS1000) */
- { 0x0b21, 0xffff }, /* All Yokogawa devices */
+ { 0x1ab1, 0x0588 }, /* Rigol DS1000 series */
+ { 0x1ab1, 0x04b0 }, /* Rigol DS2000 series */
+ { 0x0957, 0x0588 }, /* Agilent DSO1000 series (rebadged Rigol DS1000) */
+ { 0x0b21, 0xffff }, /* All Yokogawa devices */
ALL_ZERO
};
@@ -218,14 +218,9 @@ static int scpi_usbtmc_remote(struct scpi_usbtmc_libusb *uscpi)
return SR_OK;
sr_dbg("Locking out local control.");
- ret = libusb_control_transfer(usb->devhdl,
- LIBUSB_ENDPOINT_IN |
- LIBUSB_REQUEST_TYPE_CLASS |
- LIBUSB_RECIPIENT_INTERFACE,
- REN_CONTROL, 1,
- uscpi->interface,
- &status, 1,
- TRANSFER_TIMEOUT);
+ ret = libusb_control_transfer(usb->devhdl, LIBUSB_ENDPOINT_IN |
+ LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
+ REN_CONTROL, 1, uscpi->interface, &status, 1, TRANSFER_TIMEOUT);
if (ret < 0 || status != USBTMC_STATUS_SUCCESS) {
if (ret < 0)
sr_dbg("Failed to enter REN state: %s.", libusb_error_name(ret));
@@ -234,14 +229,10 @@ static int scpi_usbtmc_remote(struct scpi_usbtmc_libusb *uscpi)
return SR_ERR;
}
- ret = libusb_control_transfer(usb->devhdl,
- LIBUSB_ENDPOINT_IN |
- LIBUSB_REQUEST_TYPE_CLASS |
- LIBUSB_RECIPIENT_INTERFACE,
- LOCAL_LOCKOUT, 0,
- uscpi->interface,
- &status, 1,
- TRANSFER_TIMEOUT);
+ ret = libusb_control_transfer(usb->devhdl, LIBUSB_ENDPOINT_IN |
+ LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
+ LOCAL_LOCKOUT, 0, uscpi->interface, &status, 1,
+ TRANSFER_TIMEOUT);
if (ret < 0 || status != USBTMC_STATUS_SUCCESS) {
if (ret < 0)
sr_dbg("Failed to enter local lockout state: %s.",
@@ -272,14 +263,9 @@ static void scpi_usbtmc_local(struct scpi_usbtmc_libusb *uscpi)
return;
sr_dbg("Returning local control.");
- ret = libusb_control_transfer(usb->devhdl,
- LIBUSB_ENDPOINT_IN |
- LIBUSB_REQUEST_TYPE_CLASS |
- LIBUSB_RECIPIENT_INTERFACE,
- GO_TO_LOCAL, 0,
- uscpi->interface,
- &status, 1,
- TRANSFER_TIMEOUT);
+ ret = libusb_control_transfer(usb->devhdl, LIBUSB_ENDPOINT_IN |
+ LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
+ GO_TO_LOCAL, 0, uscpi->interface, &status, 1, TRANSFER_TIMEOUT);
if (ret < 0 || status != USBTMC_STATUS_SUCCESS) {
if (ret < 0)
sr_dbg("Failed to clear local lockout state: %s.",
@@ -323,7 +309,7 @@ static int scpi_usbtmc_libusb_open(struct sr_scpi_dev_inst *scpi)
for (intfidx = 0; intfidx < confdes->bNumInterfaces; intfidx++) {
intfdes = confdes->interface[intfidx].altsetting;
if (intfdes->bInterfaceClass != LIBUSB_CLASS_APPLICATION ||
- intfdes->bInterfaceSubClass != SUBCLASS_USBTMC ||
+ intfdes->bInterfaceSubClass != SUBCLASS_USBTMC ||
intfdes->bInterfaceProtocol != USBTMC_USB488)
continue;
uscpi->interface = intfdes->bInterfaceNumber;
@@ -385,29 +371,25 @@ static int scpi_usbtmc_libusb_open(struct sr_scpi_dev_inst *scpi)
}
/* Get capabilities. */
- ret = libusb_control_transfer(usb->devhdl,
- LIBUSB_ENDPOINT_IN |
- LIBUSB_REQUEST_TYPE_CLASS |
- LIBUSB_RECIPIENT_INTERFACE,
- GET_CAPABILITIES, 0,
- uscpi->interface,
- capabilities, sizeof(capabilities),
- TRANSFER_TIMEOUT);
+ ret = libusb_control_transfer(usb->devhdl, LIBUSB_ENDPOINT_IN |
+ LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
+ GET_CAPABILITIES, 0, uscpi->interface, capabilities,
+ sizeof(capabilities), TRANSFER_TIMEOUT);
if (ret == sizeof(capabilities)) {
uscpi->usbtmc_int_cap = capabilities[ 4];
uscpi->usbtmc_dev_cap = capabilities[ 5];
uscpi->usb488_dev_cap = capabilities[15];
}
sr_dbg("Device capabilities: %s%s%s%s%s, %s, %s",
- uscpi->usb488_dev_cap & USB488_DEV_CAP_SCPI ? "SCPI, " : "",
- uscpi->usbtmc_dev_cap & USBTMC_DEV_CAP_TERMCHAR ? "TermChar, ": "",
- uscpi->usbtmc_int_cap & USBTMC_INT_CAP_LISTEN_ONLY? "L3, " :
- uscpi->usbtmc_int_cap & USBTMC_INT_CAP_TALK_ONLY ? "" : "L4, ",
- uscpi->usbtmc_int_cap & USBTMC_INT_CAP_TALK_ONLY ? "T5, " :
- uscpi->usbtmc_int_cap & USBTMC_INT_CAP_LISTEN_ONLY? "" : "T6, ",
- uscpi->usb488_dev_cap & USB488_DEV_CAP_SR1 ? "SR1" : "SR0",
- uscpi->usb488_dev_cap & USB488_DEV_CAP_RL1 ? "RL1" : "RL0",
- uscpi->usb488_dev_cap & USB488_DEV_CAP_DT1 ? "DT1" : "DT0");
+ uscpi->usb488_dev_cap & USB488_DEV_CAP_SCPI ? "SCPI, " : "",
+ uscpi->usbtmc_dev_cap & USBTMC_DEV_CAP_TERMCHAR ? "TermChar, ": "",
+ uscpi->usbtmc_int_cap & USBTMC_INT_CAP_LISTEN_ONLY ? "L3, " :
+ uscpi->usbtmc_int_cap & USBTMC_INT_CAP_TALK_ONLY ? "" : "L4, ",
+ uscpi->usbtmc_int_cap & USBTMC_INT_CAP_TALK_ONLY ? "T5, " :
+ uscpi->usbtmc_int_cap & USBTMC_INT_CAP_LISTEN_ONLY ? "" : "T6, ",
+ uscpi->usb488_dev_cap & USB488_DEV_CAP_SR1 ? "SR1" : "SR0",
+ uscpi->usb488_dev_cap & USB488_DEV_CAP_RL1 ? "RL1" : "RL0",
+ uscpi->usb488_dev_cap & USB488_DEV_CAP_DT1 ? "DT1" : "DT0");
scpi_usbtmc_remote(uscpi);
@@ -436,14 +418,14 @@ static void usbtmc_bulk_out_header_write(void *header, uint8_t MsgID,
uint8_t bmTransferAttributes,
char TermChar)
{
- W8(header+ 0, MsgID);
- W8(header+ 1, bTag);
- W8(header+ 2, ~bTag);
- W8(header+ 3, 0);
- WL32(header+ 4, TransferSize);
- W8(header+ 8, bmTransferAttributes);
- W8(header+ 9, TermChar);
- WL16(header+10, 0);
+ W8(header + 0, MsgID);
+ W8(header + 1, bTag);
+ W8(header + 2, ~bTag);
+ W8(header + 3, 0);
+ WL32(header + 4, TransferSize);
+ W8(header + 8, bmTransferAttributes);
+ W8(header + 9, TermChar);
+ WL16(header + 10, 0);
}
static int usbtmc_bulk_in_header_read(void *header, uint8_t MsgID,
@@ -451,14 +433,15 @@ static int usbtmc_bulk_in_header_read(void *header, uint8_t MsgID,
int32_t *TransferSize,
uint8_t *bmTransferAttributes)
{
- if (R8(header+0) != MsgID ||
- R8(header+1) != bTag ||
- R8(header+2) != (unsigned char)~bTag)
+ if (R8(header + 0) != MsgID ||
+ R8(header + 1) != bTag ||
+ R8(header + 2) != (unsigned char)~bTag)
return SR_ERR;
if (TransferSize)
- *TransferSize = RL32(header+4);
+ *TransferSize = RL32(header + 4);
if (bmTransferAttributes)
- *bmTransferAttributes = R8(header+8);
+ *bmTransferAttributes = R8(header + 8);
+
return SR_OK;
}
@@ -469,23 +452,23 @@ static int scpi_usbtmc_bulkout(struct scpi_usbtmc_libusb *uscpi,
struct sr_usb_dev_inst *usb = uscpi->usb;
int padded_size, ret, transferred;
- if (data && size+USBTMC_BULK_HEADER_SIZE+3 > (int)sizeof(uscpi->buffer)) {
+ if (data && (size + USBTMC_BULK_HEADER_SIZE + 3) > (int)sizeof(uscpi->buffer)) {
sr_err("USBTMC bulk out transfer is too big.");
return SR_ERR;
}
uscpi->bTag++;
- uscpi->bTag += !uscpi->bTag; /* bTag == 0 is invalid so avoid it. */
+ uscpi->bTag += !uscpi->bTag; /* bTag == 0 is invalid so avoid it. */
usbtmc_bulk_out_header_write(uscpi->buffer, msg_id, uscpi->bTag,
size, transfer_attributes, 0);
if (data)
- memcpy(uscpi->buffer+USBTMC_BULK_HEADER_SIZE, data, size);
+ memcpy(uscpi->buffer + USBTMC_BULK_HEADER_SIZE, data, size);
else
size = 0;
size += USBTMC_BULK_HEADER_SIZE;
padded_size = (size + 3) & ~0x3;
- memset(uscpi->buffer+size, 0, padded_size - size);
+ memset(uscpi->buffer + size, 0, padded_size - size);
ret = libusb_bulk_transfer(usb->devhdl, uscpi->bulk_out_ep,
uscpi->buffer, padded_size, &transferred,
diff --git a/src/serial.c b/src/serial.c
index 27244da3..aa8d4dde 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -55,7 +55,7 @@
*
* @param serial Previously initialized serial port structure.
* @param[in] flags Flags to use when opening the serial port. Possible flags
- * include SERIAL_RDWR, SERIAL_RDONLY.
+ * include SERIAL_RDWR, SERIAL_RDONLY.
*
* If the serial structure contains a serialcomm string, it will be
* passed to serial_set_paramstr() after the port is opened.
@@ -360,8 +360,8 @@ static int _serial_read(struct sr_serial_dev_inst *serial, void *buf,
* @param[in] timeout_ms Timeout in ms, or 0 for no timeout.
*
* @retval SR_ERR_ARG Invalid argument.
- * @retval SR_ERR Other error.
- * @retval other The number of bytes read. If this is less than the number
+ * @retval SR_ERR Other error.
+ * @retval other The number of bytes read. If this is less than the number
* requested, the timeout was reached.
*
* @private
@@ -381,8 +381,8 @@ SR_PRIV int serial_read_blocking(struct sr_serial_dev_inst *serial, void *buf,
* @param[in] count The number of bytes to read.
*
* @retval SR_ERR_ARG Invalid argument.
- * @retval SR_ERR Other error.
- * @retval other The number of bytes read.
+ * @retval SR_ERR Other error.
+ * @retval other The number of bytes read.
*
* @private
*/
@@ -401,7 +401,7 @@ SR_PRIV int serial_read_nonblocking(struct sr_serial_dev_inst *serial, void *buf
* @param[in] parity The parity setting to use (0 = none, 1 = even, 2 = odd).
* @param[in] stopbits The number of stop bits to use (1 or 2).
* @param[in] flowcontrol The flow control settings to use (0 = none,
- * 1 = RTS/CTS, 2 = XON/XOFF).
+ * 1 = RTS/CTS, 2 = XON/XOFF).
* @param[in] rts Status of RTS line (0 or 1; required by some interfaces).
* @param[in] dtr Status of DTR line (0 or 1; required by some interfaces).
*
@@ -477,7 +477,7 @@ SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate,
* @param serial Previously initialized serial port structure.
* @param[in] paramstr A serial communication parameters string of the form
* "/{/