X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Flink-mso19%2Fprotocol.c;h=5f7aa719876b11c9bd0eab0096f90e5a8d9102f2;hb=102f12396660e0784134bccce5cc0679db325751;hp=09c7bc7de2430c2c7489f1b00db6264c6425a679;hpb=ff08a52a0fb66abb471fa0bfe0369300c313778f;p=libsigrok.git diff --git a/hardware/link-mso19/protocol.c b/hardware/link-mso19/protocol.c index 09c7bc7d..5f7aa719 100644 --- a/hardware/link-mso19/protocol.c +++ b/hardware/link-mso19/protocol.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrok project. * * Copyright (C) 2011 Daniel Ribeiro * Copyright (C) 2012 Renato Caldas @@ -215,7 +215,8 @@ SR_PRIV int mso_parse_serial(const char *iSerial, const char *iProduct, { 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")) @@ -293,7 +294,7 @@ SR_PRIV void stop_acquisition(const struct sr_dev_inst *sdi) 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; @@ -434,10 +435,10 @@ SR_PRIV int mso_receive_data(int fd, int revents, void *cb_data) 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; @@ -451,21 +452,21 @@ SR_PRIV int mso_configure_probes(const struct sr_dev_inst *sdi) 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; } }