Remove some unneeded double-spaces.

(also perform some other minor whitespace fixes while at it)
This commit is contained in:
Uwe Hermann 2016-08-29 17:48:18 +02:00
parent 2ecc745ccb
commit d9251a2c9f
85 changed files with 439 additions and 387 deletions

View File

@ -17,8 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* <em>Conrad DIGI 35 CPU</em> power supply driver
*
* @internal
*/

View File

@ -19,7 +19,9 @@
/**
* @file
*
* <em>Conrad DIGI 35 CPU</em> power supply driver
*
* @internal
*/

View File

@ -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;

View File

@ -17,8 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* Gossen Metrawatt Metrahit 1x/2x drivers
*
* @internal
*/

View File

@ -17,8 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* Gossen Metrawatt Metrahit 1x/2x drivers
*
* @internal
*/
@ -880,7 +883,9 @@ static void process_msg_inf_13(struct sr_dev_inst *sdi)
send_value(sdi);
}
/** Dump contents of 14-byte message.
/**
* Dump contents of 14-byte message.
*
* @param buf Pointer to array of 14 data bytes.
* @param[in] raw Write only data bytes, no interpretation.
*/
@ -903,7 +908,8 @@ 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.
@ -1248,9 +1254,11 @@ 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)
@ -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,7 +1423,8 @@ 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.
*
@ -1447,7 +1459,8 @@ 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.
*

View File

@ -17,8 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* Gossen Metrawatt Metrahit 1x/2x drivers
*
* @internal
*/

View File

@ -66,7 +66,7 @@ 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->sample_rate = 0.0;
devc->df_started = FALSE;
sdi->priv = devc;

View File

@ -19,8 +19,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** @file
/**
* @file
*
* <em>Manson HCS-3xxx series</em> power supply driver
*
* @internal
*/

View File

@ -19,8 +19,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** @file
/**
* @file
*
* <em>Manson HCS-3xxx Series</em> power supply driver
*
* @internal
*/
@ -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[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.

View File

@ -19,8 +19,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** @file
/**
* @file
*
* <em>Manson HCS-3xxx Series</em> power supply driver
*
* @internal
*/

View File

@ -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 },
@ -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);

View File

@ -18,8 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* <em>Motech LPS-30x series</em> power supply driver
*
* @internal
*/
@ -194,7 +197,8 @@ SR_PRIV int lps_cmd_ok(struct sr_serial_dev_inst *serial, const char *fmt, ...)
return SR_ERR;
}
/** Send command and read reply string.
/**
* 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, ...)
@ -307,7 +311,9 @@ static gint64 calc_timeout_ms(gint64 start_us)
return result;
}
/** Read message into buf until "OK" received.
/**
* 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.
*/

View File

@ -18,8 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* <em>Motech LPS-30x series</em> power supply driver
*
* @internal
*/

View File

@ -18,8 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* <em>Motech LPS-30x series</em> power supply driver
*
* @internal
*/

View File

@ -17,8 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* Norma DM9x0/Siemens B102x DMMs driver.
*
* @internal
*/

View File

@ -28,8 +28,11 @@
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
/** @file
/**
* @file
*
* Norma DM9x0/Siemens B102x DMMs driver.
*
* @internal
*/

View File

@ -44,8 +44,7 @@ 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)
)
struct sr_scpi_hw_info **scpi_response))
{
struct dev_context *devc;
struct sr_dev_inst *sdi;

View File

@ -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;
};

View File

@ -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[] = {

View File

@ -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,

View File

@ -553,8 +553,11 @@ SR_PRIV void sr_hw_cleanup_all(const struct sr_context *ctx)
}
}
/** Allocate struct sr_config.
/**
* 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,7 +571,9 @@ SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data)
return src;
}
/** Free struct sr_config.
/**
* Free struct sr_config.
*
* @private
*/
SR_PRIV void sr_config_free(struct sr_config *src)

View File

@ -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 {

View File

@ -17,7 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
/**
* @file
*
* @internal
*/
@ -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);

View File

@ -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
};

View File

@ -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,13 +229,9 @@ 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,
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)
@ -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.",
@ -385,14 +371,10 @@ 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];
@ -459,6 +441,7 @@ static int usbtmc_bulk_in_header_read(void *header, uint8_t MsgID,
*TransferSize = RL32(header + 4);
if (bmTransferAttributes)
*bmTransferAttributes = R8(header + 8);
return SR_OK;
}
@ -469,7 +452,7 @@ 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;
}

View File

@ -18,8 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** @file
/**
* @file
*
* Standard API helper functions.
*
* @internal
*/