ret = ftdi_read_data(&devc->ftdic, (unsigned char *)buf, size);
if (ret < 0) {
- sr_err("sigma: ftdi_read_data failed: %s",
+ sr_err("ftdi_read_data failed: %s",
ftdi_get_error_string(&devc->ftdic));
}
ret = ftdi_write_data(&devc->ftdic, (unsigned char *)buf, size);
if (ret < 0) {
- sr_err("sigma: ftdi_write_data failed: %s",
+ sr_err("ftdi_write_data failed: %s",
ftdi_get_error_string(&devc->ftdic));
} else if ((size_t) ret != size) {
- sr_err("sigma: ftdi_write_data did not complete write.");
+ sr_err("ftdi_write_data did not complete write.");
}
return ret;
uint8_t value;
if (1 != sigma_read_register(reg, &value, 1, devc)) {
- sr_err("sigma: sigma_get_register: 1 byte expected");
+ sr_err("sigma_get_register: 1 byte expected");
return 0;
}
f = g_fopen(filename, "rb");
if (!f) {
- sr_err("sigma: g_fopen(\"%s\", \"rb\")", filename);
+ sr_err("g_fopen(\"%s\", \"rb\")", filename);
return SR_ERR;
}
if (-1 == fseek(f, 0, SEEK_END)) {
- sr_err("sigma: fseek on %s failed", filename);
+ sr_err("fseek on %s failed", filename);
fclose(f);
return SR_ERR;
}
fseek(f, 0, SEEK_SET);
if (!(firmware = g_try_malloc(buffer_size))) {
- sr_err("sigma: %s: firmware malloc failed", __func__);
+ sr_err("%s: firmware malloc failed", __func__);
fclose(f);
return SR_ERR_MALLOC;
}
fclose(f);
if(fwsize != file_size) {
- sr_err("sigma: %s: Error reading firmware", filename);
+ sr_err("%s: Error reading firmware", filename);
fclose(f);
g_free(firmware);
return SR_ERR;
*buf = p = (unsigned char *)g_try_malloc(*buf_size);
if (!p) {
- sr_err("sigma: %s: buf/p malloc failed", __func__);
+ sr_err("%s: buf/p malloc failed", __func__);
g_free(firmware);
return SR_ERR_MALLOC;
}
if (offset != *buf_size) {
g_free(*buf);
- sr_err("sigma: Error reading firmware %s "
+ sr_err("Error reading firmware %s "
"offset=%ld, file_size=%ld, buf_size=%zd.",
filename, offset, file_size, *buf_size);
for (l = drvc->instances; l; l = l->next) {
if (!(sdi = l->data)) {
/* Log error, but continue cleaning up the rest. */
- sr_err("sigma: %s: sdi was NULL, continuing", __func__);
+ sr_err("%s: sdi was NULL, continuing", __func__);
continue;
}
if (sdi->priv) {
struct drv_context *drvc;
if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
- sr_err("asix-sigma: driver context malloc failed.");
+ sr_err("Driver context malloc failed.");
return SR_ERR_MALLOC;
}
adi->priv = drvc;
clear_instances();
if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
- sr_err("sigma: %s: devc malloc failed", __func__);
+ sr_err("%s: devc malloc failed", __func__);
return NULL;
}
sscanf(serial_txt, "%x", &serial);
if (serial < 0xa6010000 || serial > 0xa602ffff) {
- sr_err("sigma: Only SIGMA and SIGMA2 are supported "
- "in this version of sigrok.");
+ sr_err("Only SIGMA and SIGMA2 are supported "
+ "in this version of libsigrok.");
goto free;
}
/* Register SIGMA device. */
if (!(sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, USB_VENDOR_NAME,
USB_MODEL_NAME, USB_MODEL_VERSION))) {
- sr_err("sigma: %s: sdi was NULL", __func__);
+ sr_err("%s: sdi was NULL", __func__);
goto free;
}
sdi->driver = adi;
/* Make sure it's an ASIX SIGMA. */
if ((ret = ftdi_usb_open_desc(&devc->ftdic,
USB_VENDOR, USB_PRODUCT, USB_DESCRIPTION, NULL)) < 0) {
- sr_err("sigma: ftdi_usb_open failed: %s",
+ sr_err("ftdi_usb_open failed: %s",
ftdi_get_error_string(&devc->ftdic));
return 0;
}
if ((ret = ftdi_set_bitmode(&devc->ftdic, 0xdf, BITMODE_BITBANG)) < 0) {
- sr_err("sigma: ftdi_set_bitmode failed: %s",
+ sr_err("ftdi_set_bitmode failed: %s",
ftdi_get_error_string(&devc->ftdic));
return 0;
}
/* Four times the speed of sigmalogan - Works well. */
if ((ret = ftdi_set_baudrate(&devc->ftdic, 750000)) < 0) {
- sr_err("sigma: ftdi_set_baudrate failed: %s",
+ sr_err("ftdi_set_baudrate failed: %s",
ftdi_get_error_string(&devc->ftdic));
return 0;
}
firmware_files[firmware_idx]);
if ((ret = bin2bitbang(firmware_path, &buf, &buf_size)) != SR_OK) {
- sr_err("sigma: An error occured while reading the firmware: %s",
+ sr_err("An error occured while reading the firmware: %s",
firmware_path);
return ret;
}
/* Upload firmare. */
- sr_info("sigma: Uploading firmware %s", firmware_files[firmware_idx]);
+ sr_info("Uploading firmware file '%s'.", firmware_files[firmware_idx]);
sigma_write(buf, buf_size, devc);
g_free(buf);
if ((ret = ftdi_set_bitmode(&devc->ftdic, 0x00, BITMODE_RESET)) < 0) {
- sr_err("sigma: ftdi_set_bitmode failed: %s",
+ sr_err("ftdi_set_bitmode failed: %s",
ftdi_get_error_string(&devc->ftdic));
return SR_ERR;
}
ret = sigma_read(result, 3, devc);
if (ret != 3 ||
result[0] != 0xa6 || result[1] != 0x55 || result[2] != 0xaa) {
- sr_err("sigma: Configuration failed. Invalid reply received.");
+ sr_err("Configuration failed. Invalid reply received.");
return SR_ERR;
}
devc->cur_firmware = firmware_idx;
- sr_info("sigma: Firmware uploaded");
+ sr_info("Firmware uploaded.");
return SR_OK;
}
if ((ret = ftdi_usb_open_desc(&devc->ftdic,
USB_VENDOR, USB_PRODUCT, USB_DESCRIPTION, NULL)) < 0) {
- sr_err("sigma: ftdi_usb_open failed: %s",
+ sr_err("ftdi_usb_open failed: %s",
ftdi_get_error_string(&devc->ftdic));
return 0;
if (devc->cur_samplerate >= SR_MHZ(100)) {
/* Fast trigger support. */
if (trigger_set) {
- sr_err("sigma: ASIX SIGMA only supports a single "
- "pin trigger in 100 and 200MHz mode.");
+ sr_err("Only a single pin trigger in 100 and "
+ "200MHz mode is supported.");
return SR_ERR;
}
if (probe->trigger[0] == 'f')
else if (probe->trigger[0] == 'r')
devc->trigger.risingmask |= probebit;
else {
- sr_err("sigma: ASIX SIGMA only supports "
- "rising/falling trigger in 100 "
- "and 200MHz mode.");
+ sr_err("Only rising/falling trigger in 100 "
+ "and 200MHz mode is supported.");
return SR_ERR;
}
* does not permit ORed triggers.
*/
if (trigger_set > 1) {
- sr_err("sigma: ASIX SIGMA only supports 1 "
- "rising/falling triggers.");
+ sr_err("Only 1 rising/falling trigger "
+ "is supported.");
return SR_ERR;
}
}
struct dev_context *devc;
if (!(devc = sdi->priv)) {
- sr_err("sigma: %s: sdi->priv was NULL", __func__);
+ sr_err("%s: sdi->priv was NULL", __func__);
return SR_ERR_BUG;
}
static int hw_cleanup(void)
{
-
if (!adi->priv)
return SR_OK;
}
static int hw_info_get(int info_id, const void **data,
- const struct sr_dev_inst *sdi)
+ const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
}
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
- const void *value)
+ const void *value)
{
struct dev_context *devc;
int ret;
uint64_t running_msec;
struct timeval tv;
- /* Avoid compiler warnings. */
(void)fd;
(void)revents;
newchunks = MIN(chunks_per_read,
numchunks - devc->state.chunks_downloaded);
- sr_info("sigma: Downloading sample data: %.0f %%",
+ sr_info("Downloading sample data: %.0f %%.",
100.0 * devc->state.chunks_downloaded / numchunks);
bufsz = sigma_read_dram(devc->state.chunks_downloaded,
devc = sdi->priv;
if (configure_probes(sdi) != SR_OK) {
- sr_err("asix-sigma: failed to configured probes");
+ sr_err("Failed to configure probes.");
return SR_ERR;
}
devc->session_dev_id = cb_data;
if (!(packet = g_try_malloc(sizeof(struct sr_datafeed_packet)))) {
- sr_err("sigma: %s: packet malloc failed.", __func__);
+ sr_err("%s: packet malloc failed.", __func__);
return SR_ERR_MALLOC;
}
if (!(header = g_try_malloc(sizeof(struct sr_datafeed_header)))) {
- sr_err("sigma: %s: header malloc failed.", __func__);
+ sr_err("%s: header malloc failed.", __func__);
return SR_ERR_MALLOC;
}
sr_source_remove(0);
if (!(devc = sdi->priv)) {
- sr_err("sigma: %s: sdi->priv was NULL", __func__);
+ sr_err("%s: sdi->priv was NULL", __func__);
return SR_ERR_BUG;
}