X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Ffx2lafw%2Fprotocol.c;h=e2112af13abc6d96a0f1893f60451d0e04e22d72;hb=42be2adb5ab329a0b22d9df392d8eca84d5d9acf;hp=fc875d04446d2098b60827005f3a7acbe7b4468d;hpb=0cce2383bd8ca3ec3e406c3370d022161030304c;p=libsigrok.git diff --git a/src/hardware/fx2lafw/protocol.c b/src/hardware/fx2lafw/protocol.c index fc875d04..e2112af1 100644 --- a/src/hardware/fx2lafw/protocol.c +++ b/src/hardware/fx2lafw/protocol.c @@ -126,7 +126,7 @@ SR_PRIV int fx2lafw_command_start_acquisition(const struct sr_dev_inst *sdi) cmd.flags |= devc->sample_wide ? CMD_START_FLAGS_SAMPLE_16BIT : CMD_START_FLAGS_SAMPLE_8BIT; /* Enable CTL2 clock. */ - cmd.flags |= (devc->profile->dev_caps & DEV_CAPS_AX_ANALOG) ? CMD_START_FLAGS_CLK_CTL2 : 0; + cmd.flags |= (g_slist_length(devc->enabled_analog_channels) > 0) ? CMD_START_FLAGS_CLK_CTL2 : 0; /* Send the control message. */ ret = libusb_control_transfer(usb->devhdl, LIBUSB_REQUEST_TYPE_VENDOR | @@ -338,9 +338,11 @@ static void finish_acquisition(struct sr_dev_inst *sdi) devc->num_transfers = 0; g_free(devc->transfers); - /* Free the deinterlace buffers if we had them */ - g_free(devc->logic_buffer); - g_free(devc->analog_buffer); + /* Free the deinterlace buffers if we had them. */ + if (g_slist_length(devc->enabled_analog_channels) > 0) { + g_free(devc->logic_buffer); + g_free(devc->analog_buffer); + } if (devc->stl) { soft_trigger_logic_free(devc->stl); @@ -403,7 +405,7 @@ SR_PRIV void mso_send_data_proc(struct sr_dev_inst *sdi, /* Send the logic */ for (i = 0; i < length; i++) { - devc->logic_buffer[i] = data[i * 2]; + devc->logic_buffer[i] = data[i * 2]; /* Rescale to -10V - +10V from 0-255. */ devc->analog_buffer[i] = (data[i * 2 + 1] - 128.0f) / 12.8f; };