On Tue, 11 Jan 2011 01:24:16 +0100, Olivier Fauchon
<[email protected]> wrote:
> This patch let you use --continuous option with demo driver .
>
Here is the patch
> --
> Olivier Fauchon
> www.oflabs.com
>
>
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any company
> that requires sensitive data to be transmitted over the Web. Learn how to
> best implement a security strategy that keeps consumers' information secure
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> sigrok-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sigrok-devel
--
Olivier Fauchon
www.oflabs.com
From 1ab28035e5fc682d69b1a683fc6b7459338c89c7 Mon Sep 17 00:00:00 2001
From: Olivier Fauchon <[email protected]>
Date: Tue, 11 Jan 2011 01:16:18 +0100
Subject: [PATCH] -Continuous mode for demo driver
---
libsigrok/hardware/demo/demo.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/libsigrok/hardware/demo/demo.c b/libsigrok/hardware/demo/demo.c
index 05b44a3..a864dfd 100644
--- a/libsigrok/hardware/demo/demo.c
+++ b/libsigrok/hardware/demo/demo.c
@@ -48,6 +48,7 @@ static int capabilities[] = {
HWCAP_LOGIC_ANALYZER,
HWCAP_SAMPLERATE,
HWCAP_LIMIT_SAMPLES,
+ HWCAP_CONTINUOUS
};
/* Random selection of samplerates this "device" shall support. */
@@ -83,7 +84,7 @@ static GSList *device_instances = NULL;
/* TODO: All of these should go in a device-specific struct. */
static uint64_t cur_samplerate = 0;
-static uint64_t limit_samples = 0;
+static uint64_t limit_samples = -1;
// static uint8_t probe_mask = 0;
// static uint8_t trigger_mask[NUM_TRIGGER_STAGES] = { 0 };
// static uint8_t trigger_value[NUM_TRIGGER_STAGES] = { 0 };
@@ -227,7 +228,10 @@ static void thread_func(void *data)
uint64_t nb_to_send = 0;
while (thread_running) {
- nb_to_send = limit_samples - mydata->samples_counter;
+ if (limit_samples>0)
+ nb_to_send = limit_samples - mydata->samples_counter;
+ else
+ nb_to_send = BUFSIZE; // CONTINUOUS MODE
if (nb_to_send == 0) {
close(mydata->pipe_fds[1]);
--
1.7.3.2
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web. Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel