Re: [sigrok-devel] Usage of PulseView code

2017-03-14 Thread Lars-Peter Clausen
Hi Joel, On 03/13/2017 10:56 PM, Joel Holdsworth wrote: > Dear Paul, Alexndra, Dan and Adrian, > > I recently discovered your work on the scopy software oscilloscope, and > its usage of code derived from PulseView. As the founding author of the > PulseView project, I wanted to reach out to you

Re: [sigrok-devel] generic iio driver follow up

2016-06-10 Thread Lars-Peter Clausen
On 06/10/2016 11:40 AM, Neil Armstrong wrote: > Hi Lars, > Thanks for your quick reply > > On 06/09/2016 06:13 PM, Lars-Peter Clausen wrote: >> Hi, >> >> Thanks for the update. I also did some work on the what Hubert released this >> year. >> >>

Re: [sigrok-devel] generic iio driver follow up

2016-06-09 Thread Lars-Peter Clausen
On 06/09/2016 05:27 PM, Neil Armstrong wrote: > Hi Sigrok community, > > This is a follow-up from the first draft of a Generic IIO driver for Sigrok > posted at [1]. > > Since, I made a backport for the 0.3.0 release and PPA packages to run it on > current Ubuntu distributions. > > The 0.4.0 v

Re: [sigrok-devel] generic iio driver follow up

2016-06-09 Thread Lars-Peter Clausen
Hi, Thanks for the update. I also did some work on the what Hubert released this year. Part of this I created a generic software event based session source. It's cross platform and even works on Windows. You can find it here: https://github.com/analogdevicesinc/libsigrok/tree/sr_event The other

Re: [sigrok-devel] [PATCH 1/5] new-driver: fix for libsigrok since dd5c48a6

2016-05-31 Thread Lars-Peter Clausen
On 05/30/2016 10:00 PM, david.dou...@sdfa3.org wrote: > From: David Douard > > This patch in libsigrok removes the drivers.c completely, so new-driver > should not try to modify it any more. It has been replaced by a register > mechanism to add driver pointer in a new special section. > So drv-ap

[sigrok-devel] [PATCH 3/3] Remove unnecessary std_init() wrapper functions

2016-05-08 Thread Lars-Peter Clausen
Now that the signature of std_init() matches that of the driver init() callback we can remove all wrapper functions around std_init() and use it directly as the init() callback. Signed-off-by: Lars-Peter Clausen --- src/hardware/agilent-dmm/api.c | 7 +-- src/hardware/appa

[sigrok-devel] [PATCH 1/3] Match std_init() parameter order to the driver init() callback

2016-05-08 Thread Lars-Peter Clausen
than having to swap them around. It also allow to eventually use the std_init() function directly as the init() callback. Signed-off-by: Lars-Peter Clausen --- src/hardware/agilent-dmm/api.c | 2 +- src/hardware/appa-55ii/api.c | 2 +- src/hardware/arachnid-labs-re

[sigrok-devel] [PATCH 2/3] std_init(): Drop check if pass in driver is non-NULL

2016-05-08 Thread Lars-Peter Clausen
init() callback signature which will allow to directly use it as such. Signed-off-by: Lars-Peter Clausen --- src/hardware/agilent-dmm/api.c | 2 +- src/hardware/appa-55ii/api.c | 2 +- src/hardware/arachnid-labs-re-load-pro/api.c | 2 +- src/hardware/asix-sigma/api.c

[sigrok-devel] [PATCH 2/4] testo: Fix USB device list leak

2016-05-06 Thread Lars-Peter Clausen
) ... when != libusb_free_device_list(devlist, ...) *return ...; // Signed-off-by: Lars-Peter Clausen --- src/hardware/testo/api.c | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/hardware/testo/api.c b/src/hardware/testo/api.c index d22edc2..d83

[sigrok-devel] [PATCH 1/4] lascar-el-usb: lascar_scan(): Fix USB device list leak

2016-05-06 Thread Lars-Peter Clausen
) ... when != libusb_free_device_list(devlist, ...) *return ...; // Signed-off-by: Lars-Peter Clausen --- src/hardware/lascar-el-usb/protocol.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hardware/lascar-el-usb/protocol.c b/src/hardware/lascar-el-usb/protocol.c index e4fae68..f7b

[sigrok-devel] [PATCH 3/4] victor-dmm: Fix USB device list leak

2016-05-06 Thread Lars-Peter Clausen
) ... when != libusb_free_device_list(devlist, ...) *return ...; // Signed-off-by: Lars-Peter Clausen --- src/hardware/victor-dmm/api.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/hardware/victor-dmm/api.c b/src/hardware/victor-dmm/api.c index 8f20f59..96f

[sigrok-devel] [PATCH 4/4] zeroplus-logic-cube: Fix USB device list

2016-05-06 Thread Lars-Peter Clausen
) ... when != libusb_free_device_list(devlist, ...) *return ...; // Signed-off-by: Lars-Peter Clausen --- src/hardware/zeroplus-logic-cube/api.c | 36 +- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/src/hardware/zeroplus-logic-cube/api.c b/s

[sigrok-devel] [PATCH] Remove unnecessary driver context checks

2016-05-02 Thread Lars-Peter Clausen
these checks are not necessary since they never evaluate to true and can be dropped. If they should ever become necessary they should be done in the sigrok core so all drivers and all callbacks are equally handled. Signed-off-by: Lars-Peter Clausen --- src/hardware/ikalogic-scanalogic2/api.c | 13

[sigrok-devel] [PATCH] Drop SR_CONF_SET flag from SR_CONF_CONTINUOUS options

2016-05-02 Thread Lars-Peter Clausen
f the drivers which set SR_CONF_SET for SR_CONF_CONTINUOUS handle it in their config_set() callback and return an error if an application tried to perform a config_set() operation for SR_CONF_CONTINUOUS. Simply remove the SR_CONF_SET flag from all SR_CONF_CONTINUOUS options. Signed-off-by: Lars-

[sigrok-devel] [PATCH 5/9] deree-de5000: Provide dev_clear()

2016-04-29 Thread Lars-Peter Clausen
the additional data. This will cause memory leaks when sr_dev_clear() is called for this driver. To fix this provide a dev_clear() implementation that frees the additional data. Signed-off-by: Lars-Peter Clausen --- src/hardware/deree-de5000/api.c | 9 +++-- 1 file changed, 7 insertions

[sigrok-devel] [PATCH 7/9] Introduce standard cleanup helper

2016-04-29 Thread Lars-Peter Clausen
callback for all existing drivers, which reduces the amount of boiler-plate code quite a bit. All drivers are updated to use the new helper function. Signed-off-by: Lars-Peter Clausen --- src/hardware/agilent-dmm/api.c | 7 +-- src/hardware/appa-55ii/api.c | 7

[sigrok-devel] [PATCH 9/9] Introduce standard implementation of the dev_list callback

2016-04-29 Thread Lars-Peter Clausen
Every single hardware driver has the very same implementation of the dev_list() callback. Put this into a helper function in the standard helper library and use it throughout the drivers. This reduces boiler-plate code by quite a bit. Signed-off-by: Lars-Peter Clausen --- src/hardware/agilent

[sigrok-devel] [PATCH 0/9] Memory leak fixes and boiler-plate code reduction

2016-04-29 Thread Lars-Peter Clausen
last two patches in this series remove additional boiler-plate code by removing all dev_clear() implementation that implement the default behavior and by introducing a new standard helper function for retrieving the drivers device list. - Lars Lars-Peter Clausen (9): ftdi-la: Properly cleanup in

[sigrok-devel] [PATCH 3/9] beaglelogic: Use std_dev_clear() instead of open-coding it

2016-04-29 Thread Lars-Peter Clausen
The beaglelogic has an open-coded version of std_dev_clear(), replace it with std_dev_clear(). Signed-off-by: Lars-Peter Clausen --- src/hardware/beaglelogic/api.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/hardware/beaglelogic/api.c b/src

[sigrok-devel] [PATCH 6/9] scpi-pps: Fix dev_clear() implementation

2016-04-29 Thread Lars-Peter Clausen
. To fix this let the dev_clear() free the additional data. Signed-off-by: Lars-Peter Clausen --- src/hardware/scpi-pps/api.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index a29744e..dbe8dcb 100644 --- a

[sigrok-devel] [PATCH 8/9] Remove unnecessary dev_clear() callbacks

2016-04-29 Thread Lars-Peter Clausen
If a driver does not implement a dev_clear() callback the core will automatically call std_dev_clear(di, NULL). Remove all driver dev_clear() implementations that are identical to default. This reduces the amount of boiler-plate code. Signed-off-by: Lars-Peter Clausen --- src/hardware/arachnid

[sigrok-devel] [PATCH 4/9] demo: Provide dev_clear()

2016-04-29 Thread Lars-Peter Clausen
additional data. This will cause memory leaks when sr_dev_clear() is called for this driver. To fix this provide a dev_clear() implementation that frees the additional data. Signed-off-by: Lars-Peter Clausen --- src/hardware/demo/demo.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions

[sigrok-devel] [PATCH 2/9] baylibre-acme: Properly free GErrors returned by g_file_get_contents()

2016-04-29 Thread Lars-Peter Clausen
found. Add the missing g_error_free() invocations to fix the issue. Signed-off-by: Lars-Peter Clausen --- src/hardware/baylibre-acme/protocol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index 0bef0b2..fdc16c8

[sigrok-devel] [PATCH 1/9] ftdi-la: Properly cleanup in scan_all()

2016-04-29 Thread Lars-Peter Clausen
Make sure to free the FTDI device list and the FTDI context in scan_all() otherwise memory leaks can be observed. Also make sure to free the FTDI context in scan_device() on the error path. Signed-off-by: Lars-Peter Clausen --- src/hardware/ftdi-la/api.c | 4 1 file changed, 4 insertions

[sigrok-devel] [PATCH 1/2] srzip: Fix handling of analog channels with index 0

2016-04-28 Thread Lars-Peter Clausen
session file. Instead use -1, which is not a valid channel index, as the terminating entry value. Signed-off-by: Lars-Peter Clausen --- src/output/srzip.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/output/srzip.c b/src/output/srzip.c index 8d01e5f..bfc42b2 100644

[sigrok-devel] [PATCH 2/2] srzip: zip_append_analog(): Fix memory leaks

2016-04-28 Thread Lars-Peter Clausen
. Signed-off-by: Lars-Peter Clausen --- src/output/srzip.c | 39 +-- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/output/srzip.c b/src/output/srzip.c index bfc42b2..b554558 100644 --- a/src/output/srzip.c +++ b/src/output/srzip.c

[sigrok-devel] [PATCH] hung-chang-dso-2100: Fix session source fd

2016-01-23 Thread Lars-Peter Clausen
For session sources without a file descriptor to poll a negative number should be passed for the fd parameter. The hung-chang-dso-2100 driver currently passes 0 instead, which is the stdin stream. Fix it the issue by passing -1 for the fd parameter. Signed-off-by: Lars-Peter Clausen --- src

Re: [sigrok-devel] Fwd: Re: generic iio driver draft

2016-01-04 Thread Lars-Peter Clausen
On 01/04/2016 10:17 AM, Marc Titinger wrote: > On 03/01/2016 12:44, Lars-Peter Clausen wrote: >> Hi, >> >> On 12/31/2015 02:53 PM, Marc Titinger wrote: >>> >>> On behalf of Hubert Chaumette (author) >>> >>> >>> Clarification on usa

Re: [sigrok-devel] Fwd: Re: generic iio driver draft

2016-01-03 Thread Lars-Peter Clausen
Hi, On 12/31/2015 02:53 PM, Marc Titinger wrote: > > On behalf of Hubert Chaumette (author) > > > Clarification on usage: > > 'conn' was used for the IP in previous iterations, but the current code > uses libiio's IIOD_REMOTE variable for that. Instead, conn is now used > to choose a device, o

[sigrok-devel] [PATCH] sr: session_driver: Remove source on completion

2012-09-02 Thread Lars-Peter Clausen
Remove the session source once we are done loading the file, otherwise we'll spin forever in sr_session_run. Reported-by: Joel Holdsworth Signed-off-by: Lars-Peter Clausen --- libsigrok/session_driver.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/libs

[sigrok-devel] [PATCH 4/5] sr: session: Add session source

2012-07-06 Thread Lars-Peter Clausen
blocking and non-blocking sampling mode. Signed-off-by: Lars-Peter Clausen --- libsigrok/libsigrok.h | 13 +--- libsigrok/proto.h |1 + libsigrok/session.c | 203 - 3 files changed, 169 insertions(+), 48 deletions(-) diff --git a

[sigrok-devel] [PATCH 3/5] sr: session: Moves sources to session struct

2012-07-06 Thread Lars-Peter Clausen
The sources really belong to the session, so move them into the session struct. Signed-off-by: Lars-Peter Clausen --- libsigrok/libsigrok.h | 11 +++ libsigrok/session.c | 86 +++-- 2 files changed, 51 insertions(+), 46 deletions(-) diff

[sigrok-devel] [PATCH 5/5] gtk: Add support for asynchronous sampling

2012-07-06 Thread Lars-Peter Clausen
ept active during sampling. If the button is deactivated will sampling is still in progress it will be aborted. Signed-off-by: Lars-Peter Clausen --- sigrok-gtk/main.c |3 +++ sigrok-gtk/sigrok-gtk.h |3 +++ sigrok-gtk/toolbar.c| 26 +++--- 3 files changed, 25

[sigrok-devel] [PATCH 2/5] sr: demodevice: Make read channel non-blocking

2012-07-06 Thread Lars-Peter Clausen
Lars-Peter Clausen --- libsigrok/hardware/demo/demo.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libsigrok/hardware/demo/demo.c b/libsigrok/hardware/demo/demo.c index 0cd23e3..91f105f 100644 --- a/libsigrok/hardware/demo/demo.c +++ b/libsigrok/hardware/demo/demo.c @@ -440,6 +

[sigrok-devel] [PATCH 1/5] sr: session: Realloc correct array for pollfds in _sr_session_source_remove

2012-07-06 Thread Lars-Peter Clausen
Commit 7149ad7c ("sr: session: Keep a global pollfd array") contained a small copy paste error. This patch fixes it. Signed-off-by: Lars-Peter Clausen --- libsigrok/session.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsigrok/session.c b/libsigrok/sessi

[sigrok-devel] [PATCH v2] sr: fx2lafw: Free transfers in reverse order

2012-07-05 Thread Lars-Peter Clausen
Free the USB transfers in the reverse order of which they were submitted. This will avoid that while transfer 0 is canceld transfer 1 is started by the host controller, and so on. Reported-by: Peter Stuge Signed-off-by: Lars-Peter Clausen --- Sorry, sent an old version of the patch as v1

[sigrok-devel] [PATCH] sr: fx2lafw: Free transfers in reverse order

2012-07-05 Thread Lars-Peter Clausen
Free the USB transfers in the reverse order of which they were submitted. This will avoid that while transfer 0 is canceld transfer 1 is started by the host controller, and so on. Reported-by: Peter Stuge Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c |4

[sigrok-devel] [PATCH 6/6] qt: Use sr_session_stop() instead of sr_session_halt()

2012-07-05 Thread Lars-Peter Clausen
Use sr_session_stop() instead of the deprecated sr_session_halt(). Signed-off-by: Lars-Peter Clausen --- sigrok-qt/mainwindow.cpp |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigrok-qt/mainwindow.cpp b/sigrok-qt/mainwindow.cpp index f0ca848..810228f 100644 --- a

[sigrok-devel] [PATCH 4/6] cli: Use sr_session_stop() instead of sr_session_halt()

2012-07-05 Thread Lars-Peter Clausen
Use sr_session_stop() instead of the deprecated sr_session_halt(). Signed-off-by: Lars-Peter Clausen --- sigrok-cli/sigrok-cli.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigrok-cli/sigrok-cli.c b/sigrok-cli/sigrok-cli.c index bce88e4..3a460bf 100644 --- a

[sigrok-devel] [PATCH 3/6] sr: session: Deprecate sr_session_halt()

2012-07-05 Thread Lars-Peter Clausen
sr_session_stop() and deprecate its usage. Signed-off-by: Lars-Peter Clausen --- libsigrok/session.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libsigrok/session.c b/libsigrok/session.c index 4ad2dff..a1bf6a7 100644 --- a/libsigrok/session.c +++ b/libsigrok

[sigrok-devel] [PATCH 5/6] gtk: Use sr_session_stop() instead of sr_session_halt()

2012-07-05 Thread Lars-Peter Clausen
Use sr_session_stop() instead of the deprecated sr_session_halt(). Signed-off-by: Lars-Peter Clausen --- sigrok-gtk/main.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigrok-gtk/main.c b/sigrok-gtk/main.c index 5406b04..9546e1a 100644 --- a/sigrok-gtk/main.c +++ b

[sigrok-devel] [PATCH 2/6] sr: session: Do not cleanup the driver state in sr_session_stop()

2012-07-05 Thread Lars-Peter Clausen
calling sr_session_save() after calling sr_session_stop() - which is for example done by sigrok-cli - will cause a segfault. This patch resolves the issue. Signed-off-by: Lars-Peter Clausen --- libsigrok/session.c |2 -- 1 file changed, 2 deletions(-) diff --git a/libsigrok/session.c b

[sigrok-devel] [PATCH 1/6] sr: session: Close a device when it is removed from a session

2012-07-05 Thread Lars-Peter Clausen
A device is opened when it is added to a session, in the same fashion it should be closed again when it is removed from a session. Also remove all still attached devices from a session when the session is destroyed. Signed-off-by: Lars-Peter Clausen --- libsigrok/session.c | 11

Re: [sigrok-devel] [PATCH 2/4] sr: session: Keep a global pollfd array

2012-07-03 Thread Lars-Peter Clausen
On 07/04/2012 01:21 AM, Bert Vermeulen wrote: > On 07/01/2012 02:37 PM, Lars-Peter Clausen wrote: >> On 06/30/2012 08:54 PM, Lars-Peter Clausen wrote: >>> [...] >>> >>> - new_sources = g_try_realloc(sources, sizeof(struct source) * >>> (num_sourc

[sigrok-devel] [PATCH] sr: demodevice: Reset sample limit when setting time limit and vice versa

2012-07-03 Thread Lars-Peter Clausen
Only one limit should be active at a time. Make sure that the sample limit is disabled when a time limit is set and vice versa. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/demo/demo.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libsigrok/hardware/demo/demo.c b

[sigrok-devel] [PATCH 2/3] sr: fx2lafw: Do not start a new acquisition if the old is still running

2012-07-03 Thread Lars-Peter Clausen
d-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c |4 1 file changed, 4 insertions(+) diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.c b/libsigrok/hardware/fx2lafw/fx2lafw.c index 2886613..11e41ff 100644 --- a/libsigrok/hardware/fx2lafw/fx2lafw.c +++ b/libsigrok/har

[sigrok-devel] [PATCH 3/3] sr: fx2lafw: Fix potential leaks in acquisition_start error paths

2012-07-03 Thread Lars-Peter Clausen
Call abort_acquisition if starting sampling fails in acquisition_start, this will ensure that all already allocated resources are being freed again. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[sigrok-devel] [PATCH 1/3] sr: fx2lafw: Abort pending transfers when sampling is stopped

2012-07-03 Thread Lars-Peter Clausen
freed almost immediately and the additional delay will disappear. Also make sure, that if we know, that we just have received the last transfer to not resubmit this transfer again. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c | 28

Re: [sigrok-devel] [PATCH 2/4] sr: session: Keep a global pollfd array

2012-07-01 Thread Lars-Peter Clausen
On 06/30/2012 08:54 PM, Lars-Peter Clausen wrote: >[...] > > - new_sources = g_try_realloc(sources, sizeof(struct source) * > (num_sources - 1)); > + new_pollfds = g_try_realloc(sources, sizeof(GPollFD) * num_sources); Ok, here is obviously a copy&paste error. >

[sigrok-devel] [PATCH 2/4] sr: session: Keep a global pollfd array

2012-06-30 Thread Lars-Peter Clausen
constructing and subsequent freeing of the pollfd array in sr_session_run(), on the other hand it will allow us to implement support for non-fd based pollfds. Signed-off-by: Lars-Peter Clausen --- libsigrok/session.c | 76 +++ 1 file changed, 40

[sigrok-devel] [PATCH 3/4] sr: session: Add support for GPollFD or GIOChannel based sources

2012-06-30 Thread Lars-Peter Clausen
A raw file descriptor to poll on is not always available, this patch adds support for adding a source for a GIOChannel or GPollFD. Signed-off-by: Lars-Peter Clausen --- libsigrok/session.c | 164 +- libsigrok/sigrok-proto.h |6 ++ 2 files

[sigrok-devel] [PATCH 4/4] sr: session/demo: Remove Windows specific hack

2012-06-30 Thread Lars-Peter Clausen
no longer required. The patch moves the GIOChannels used by the demo device to the demo device context and uses sr_session_source_add_channel to register a source for the channels instead of using the raw pipe fds. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/demo/demo.c | 29

[sigrok-devel] [PATCH 1/4] sr: session: Use realloc to resize source array

2012-06-30 Thread Lars-Peter Clausen
one element down in the array. Only after that has been done the array is re-allocated. Signed-off-by: Lars-Peter Clausen --- libsigrok/session.c | 43 +++ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/libsigrok/session.c b/libsigrok

[sigrok-devel] [PATCH] sr: fxlafw: Move empty_transfer_count to device ctx

2012-06-27 Thread Lars-Peter Clausen
If one device is failing it should not affect the transfers of other devices. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c |9 - libsigrok/hardware/fx2lafw/fx2lafw.h |1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsigrok

[sigrok-devel] [PATCH v2] sr: fx2lafw: Calculate buffer size and timeout based on sample rate

2012-06-27 Thread Lars-Peter Clausen
e the CPU load of sigrok-cli when sampling at 24Mhz goes down from ~25% to 3-4%. Signed-off-by: Lars-Peter Clausen --- Changes since v1: * Minor code style changes --- libsigrok/hardware/fx2lafw/fx2lafw.c | 68 +++--- 1 file changed, 47 insertions(+

Re: [sigrok-devel] [PATCH 5/5] sr: fx2lafw: Calculate buffer size and timeout based on sample rate

2012-06-26 Thread Lars-Peter Clausen
legible as it is right now, but this is just bikeshedding anyway, so I'll change it. > > I'd like to see these things fixed, but otherwise, great stuff. This > patch was badly needed. > Are you OK with patch 1-4? If yes I'd just resend patch 5 and not the whole ser

[sigrok-devel] [PATCH 4/5] sr: fx2lafw: Handle the transfer's status

2012-06-25 Thread Lars-Peter Clausen
: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.c b/libsigrok/hardware/fx2lafw/fx2lafw.c index 0cfe436..b56f810 100644 --- a/libsigrok/hardware/fx2lafw/fx2lafw.c

[sigrok-devel] [PATCH 1/5] sr: fx2lafw: Allocate header and packet struct on the stack

2012-06-25 Thread Lars-Peter Clausen
The header and packet struct are only used in the scope of this function and they are freed at the end of it. Also these structs are rather small, so they can safely be allocate on the stack. By doing so memory leaks on the error paths are avoided. Signed-off-by: Lars-Peter Clausen

[sigrok-devel] [PATCH 2/5] sr: fx2lafw: Properly free transfers

2012-06-25 Thread Lars-Peter Clausen
When freeing a transfer we have to free the transfer buffer as well. We also have to keep track of the number of allocated transfers and if the freed transfer was the last one stop acquisition. This patch introduces a helper function which takes care of all of this. Signed-off-by: Lars-Peter

[sigrok-devel] [PATCH 5/5] sr: fx2lafw: Calculate buffer size and timeout based on sample rate

2012-06-25 Thread Lars-Peter Clausen
e the CPU load of sigrok-cli when sampling at 24Mhz goes down from ~25% to 3-4%. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c | 67 +++--- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/libsigrok/hardware/fx2lafw/fx2lafw

[sigrok-devel] [PATCH 3/5] sr: fx2lafw: Avoid unnecessary alloc/free combo

2012-06-25 Thread Lars-Peter Clausen
allocated if the size of the old one is not 4096 bytes. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c | 47 +- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.c b/libsigrok/hardware

[sigrok-devel] [PATCH] cli: Fix typo in protocol decoder stacking example

2012-06-24 Thread Lars-Peter Clausen
Probe assignments are separated by colon and not by comma. Signed-off-by: Lars-Peter Clausen --- sigrok-cli/doc/sigrok-cli.1 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigrok-cli/doc/sigrok-cli.1 b/sigrok-cli/doc/sigrok-cli.1 index 48f02af..cc13722 100644 --- a

[sigrok-devel] [PATCH] sr: fx2lafw: Set correct unitsize for trigger buffer

2012-06-21 Thread Lars-Peter Clausen
f() of the trigger buffer. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.c b/libsigrok/hardware/fx2lafw/fx2lafw.c index afdd950..76c5019 100644 --- a/libsigro

[sigrok-devel] [PATCH 1/2] sr: fx2lafw: Fix multistage trigger

2012-06-21 Thread Lars-Peter Clausen
next stage. In order for this to work we also make sure that the trigger stage is only reset if the current sample does not match. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a

[sigrok-devel] [PATCH 2/2] sr: fx2lafw: Fix memory leaks in receive_transfer

2012-06-21 Thread Lars-Peter Clausen
leaks are on the error paths in that function. Signed-off-by: Lars-Peter Clausen --- libsigrok/hardware/fx2lafw/fx2lafw.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.c b/libsigrok/hardware/fx2lafw/fx2lafw.c index 5d8b49b..afdd950