X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fprotocol.c;h=1d0c9f208839200ee97c5de38fc66d479b55f187;hp=272c8a8c3baa6f34206a9552cb12b3146de00f58;hb=5e23fcab889c62864b92aa3ad6902ce3e9f5be49;hpb=bc497772512c2fd37516964ade58b69448aae37c diff --git a/src/hardware/pipistrello-ols/protocol.c b/src/hardware/pipistrello-ols/protocol.c index 272c8a8c..1d0c9f20 100644 --- a/src/hardware/pipistrello-ols/protocol.c +++ b/src/hardware/pipistrello-ols/protocol.c @@ -219,7 +219,6 @@ SR_PRIV int pols_convert_trigger(const struct sr_dev_inst *sdi) SR_PRIV struct sr_dev_inst *p_ols_get_metadata(uint8_t *buf, int bytes_read, struct dev_context *devc) { struct sr_dev_inst *sdi; - struct sr_channel *ch; uint32_t tmp_int, ui; uint8_t key, type, token; GString *tmp_str, *devname, *version; @@ -288,11 +287,9 @@ SR_PRIV struct sr_dev_inst *p_ols_get_metadata(uint8_t *buf, int bytes_read, str switch (token) { case 0x00: /* Number of usable channels */ - for (ui = 0; ui < tmp_int; ui++) { - ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE, + for (ui = 0; ui < tmp_int; ui++) + sr_channel_new(sdi, ui, SR_CHANNEL_LOGIC, TRUE, p_ols_channel_names[ui]); - sdi->channels = g_slist_append(sdi->channels, ch); - } break; case 0x01: /* Amount of sample memory available (bytes) */ @@ -324,11 +321,9 @@ SR_PRIV struct sr_dev_inst *p_ols_get_metadata(uint8_t *buf, int bytes_read, str switch (token) { case 0x00: /* Number of usable channels */ - for (ui = 0; ui < tmp_c; ui++) { - ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE, + for (ui = 0; ui < tmp_c; ui++) + sr_channel_new(sdi, ui, SR_CHANNEL_LOGIC, TRUE, p_ols_channel_names[ui]); - sdi->channels = g_slist_append(sdi->channels, ch); - } break; case 0x01: /* protocol version */