/*
- * This file is part of the sigrok project.
+ * This file is part of the libsigrok project.
*
* Copyright (C) 2011 Daniel Ribeiro <drwyrm@gmail.com>
* Copyright (C) 2012 Renato Caldas <rmsc@fe.up.pt>
uint16_t ops[18];
ops[0] = mso_trans(3, threshold_value & 0xff);
//The trigger_config also holds the 2 MSB bits from the threshold value
- ops[1] = mso_trans(4, trigger_config | (threshold_value >> 8) & 0x03);
+ ops[1] = mso_trans(4, trigger_config | ((threshold_value >> 8) & 0x03));
ops[2] = mso_trans(5, devc->la_trigger);
ops[3] = mso_trans(6, devc->la_trigger_mask);
ops[4] = mso_trans(7, devc->trigger_holdoff[0]);
{
unsigned int u1, u2, u3, u4, u5, u6;
- iProduct = iProduct;
+ (void)iProduct;
+
/* FIXME: This code is in the original app, but I think its
* used only for the GUI */
/* if (strstr(iProduct, "REV_02") || strstr(iProduct, "REV_03"))
struct dev_context *devc;
devc = sdi->priv;
- sr_source_remove(devc->serial->fd);
+ serial_source_remove(sdi->session, devc->serial);
/* Terminate session */
packet.type = SR_DF_END;
return ret;
}
-SR_PRIV int mso_check_trigger(struct sr_serial_dev_inst *serial, uint8_t * info)
+SR_PRIV int mso_check_trigger(struct sr_serial_dev_inst *serial, uint8_t *info)
{
uint16_t ops[] = { mso_trans(REG_TRIGGER, 0) };
int ret;
uint8_t buf = 0;
if (serial_read(serial, &buf, 1) != 1) /* FIXME: Need timeout */
ret = SR_ERR;
- *info = buf;
+ if (!info)
+ *info = buf;
sr_dbg("Trigger state is: 0x%x.", *info);
return ret;
/* FIXME: Need to do conversion to mV */
analog_out[i] = (devc->buffer[i * 3] & 0x3f) |
((devc->buffer[i * 3 + 1] & 0xf) << 6);
+ (void)analog_out;
logic_out[i] = ((devc->buffer[i * 3 + 1] & 0x30) >> 4) |
((devc->buffer[i * 3 + 2] & 0x3f) << 2);
}
return TRUE;
}
-SR_PRIV int mso_configure_probes(const struct sr_dev_inst *sdi)
+SR_PRIV int mso_configure_channels(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
- struct sr_probe *probe;
+ struct sr_channel *ch;
GSList *l;
char *tc;
devc->trigger_chan = 3; //LA combination trigger
devc->use_trigger = FALSE;
- for (l = sdi->probes; l; l = l->next) {
- probe = (struct sr_probe *)l->data;
- if (probe->enabled == FALSE)
+ for (l = sdi->channels; l; l = l->next) {
+ ch = (struct sr_channel *)l->data;
+ if (ch->enabled == FALSE)
continue;
- int probe_bit = 1 << (probe->index);
- if (!(probe->trigger))
+ int channel_bit = 1 << (ch->index);
+ if (!(ch->trigger))
continue;
devc->use_trigger = TRUE;
//Configure trigger mask and value.
- for (tc = probe->trigger; *tc; tc++) {
- devc->la_trigger_mask &= ~probe_bit;
+ for (tc = ch->trigger; *tc; tc++) {
+ devc->la_trigger_mask &= ~channel_bit;
if (*tc == '1')
- devc->la_trigger |= probe_bit;
+ devc->la_trigger |= channel_bit;
}
}