Init the cur_sample_rate to 200kHz. This is now the default sample
rate for the ASIX Sigma if no other is specified by -c samplerate=N
on the command line. Without this change, the driver would crash on
SIGFPE because a division by zero would happen.

Signed-off-by: Marek Vasut <[email protected]>
---
 hardware/asix-sigma/asix-sigma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c
index e2193fc..c57ce36 100644
--- a/hardware/asix-sigma/asix-sigma.c
+++ b/hardware/asix-sigma/asix-sigma.c
@@ -360,7 +360,7 @@ static GSList *scan(GSList *options)
 
        sr_info("Found ASIX SIGMA - Serial: %s", serial_txt);
 
-       devc->cur_samplerate = 0;
+       devc->cur_samplerate = samplerates[0];
        devc->period_ps = 0;
        devc->limit_msec = 0;
        devc->cur_firmware = -1;
-- 
1.8.5.3


------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to