When the sigrok driver closes as the application shuts down, acquisition
of logic input channels will have completed. Generation of PWM signals
on output channels can be desirable to keep up. Do not de-initialize the
FPGA hardware in the close code path. Which allows to configure PWM by
means of sigrok-cli and use the signals between program invocations that
reconfigure the generator. Users can always disable channels before the
application shuts down if they prefer to. Similar use was seen with PSUs.
Make this approach a compile time option.
if (!usb->devhdl)
return SR_ERR_BUG;
- la2016_deinit_hardware(sdi);
+ if (WITH_DEINIT_IN_CLOSE)
+ la2016_deinit_hardware(sdi);
sr_info("Closing device on %d.%d (logical) / %s (physical) interface %d.",
usb->bus, usb->address, sdi->connection_id, USB_INTERFACE);
#define LA2016_NUM_PWMCH_MAX 2
+/*
+ * Whether to de-initialize the device hardware in the driver's close
+ * callback. It is desirable to e.g. configure PWM channels and leave
+ * the generator running after the application shuts down. Users can
+ * always disable channels on their way out if they want to.
+ */
+#define WITH_DEINIT_IN_CLOSE 0
+
#define LA2016_CONVBUFFER_SIZE (4 * 1024 * 1024)
struct kingst_model {