X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=hardware%2Fasix-sigma%2Fasix-sigma.c;h=cac386200f12a488f68a1ce4c371c6c7a3362e99;hb=917e0e71d53cb0a0ac7965cb4f36791b14f7e5ff;hp=05467824cd4f60fcdfd1b70ede9e3c66e17fea85;hpb=bdfc7a89745a0fae422806c883cbd946f16eace3;p=libsigrok.git diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 05467824..cac38620 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -644,9 +644,15 @@ static int configure_probes(GSList *probes) static void hw_closedev(int device_index) { - device_index = device_index; + struct sigrok_device_instance *sdi; - ftdi_usb_close(&ftdic); + if ((sdi = get_sigrok_device_instance(device_instances, device_index))) + { + if (sdi->status == ST_ACTIVE) + ftdi_usb_close(&ftdic); + + sdi->status = ST_INACTIVE; + } } static void hw_cleanup(void) @@ -812,8 +818,9 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, while (sent < n) { tosend = MIN(2048, n - sent); - packet.type = DF_LOGIC16; + packet.type = DF_LOGIC; packet.length = tosend * sizeof(uint16_t); + packet.unitsize = 2; packet.payload = samples + sent; session_bus(user_data, &packet); @@ -854,8 +861,9 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, &trigger); if (tosend > 0) { - packet.type = DF_LOGIC16; + packet.type = DF_LOGIC; packet.length = tosend * sizeof(uint16_t); + packet.unitsize = 2; packet.payload = samples; session_bus(user_data, &packet); @@ -871,8 +879,9 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, /* Send rest of the chunk to sigrok. */ tosend = n - sent; - packet.type = DF_LOGIC16; + packet.type = DF_LOGIC; packet.length = tosend * sizeof(uint16_t); + packet.unitsize = 2; packet.payload = samples + sent; session_bus(user_data, &packet); @@ -1216,7 +1225,8 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) gettimeofday(&header.starttime, NULL); header.samplerate = cur_samplerate; header.protocol_id = PROTO_RAW; - header.num_probes = num_probes; + header.num_logic_probes = num_probes; + header.num_analog_probes = 0; session_bus(session_device_id, &packet); /* Add capture source. */