Allow the edge of an external clock input to be configured by
means of an SR_CONF_CLOCK_EDGE configuration setting. This is
a string option with the same format as SR_CONF_TRIGGER_SLOPE.
(sr_dev_driver.config_probe_set): New optional callback enabling
drivers to be notified upon changes to probe settings.
(sr_dev_probe_enable, sr_dev_trigger_set): Invoke new driver
callback on changes.
(sr_dev_driver.config_commit): New optional callback allowing
drivers to defer application of configuration settings until
an explicit call to config_commit().
(sr_config_commit): New public wrapper function.
The maximum sample size that can be set on a device is now published
by sr_config_list(SR_CONF_LIMIT_SAMPLES). This returns a tuple of
uint64_t representing minimum and maximum number of samples.
The fields of this structure should not be used directly by frontends
(and none of the current ones do). Thus, make the struct opaque and hide
its contents from the API.
Allow channel groups to be swapped. This is useful
for demux at 200mhz with the unbuffered channels.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
This changes the new output API's recv() to receive(), and has it
return an integer status code. The output of the function, if any,
is stored in a new parameter as a pointer to a newly allocated GString.
All output modules using this API have been adjusted.
With the sigrok session running in a worker thread, if sr_session_stop is called
from another thread, it shuts down the pollfds used by the hardware drivers,
without ensuring that the sigrok event loop is no longer using those pollfds.
On the demo driver, this involves shutting down the GIOChannels, causing a
segfault when the sigrok event loop tries to use them. This is evident when
using the Stop button in PulseView, while the session is running.
This isn't a problem with just the demo driver; any driver's resources may be
freed by sr_session_stop concurrently with the sigrok session running.
To solve this problem, we don't touch the session itself in sr_session_stop().
Instead, we mark it for decommissioning and return. The session polls this flag,
and shuts itself down when requested.
This fixes bug 4.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Number of timebases is needed to properly interpret a frame's worth
of samples. Number of vertical divisions isn't, but may nevertheless
be interesting for a frontend that wants to reproduce the scope's
native display.