From: Marek Vasut Date: Fri, 25 Apr 2014 16:03:47 +0000 (+0200) Subject: asix-sigma: Init cur_sample_rate X-Git-Tag: libsigrok-0.3.0~27 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;h=23b886bc40eaf14cc44c00cf9dba85404ddc267f;hp=1e23158b933e2c7d818d95fbbc45cb21cbff7065;p=libsigrok.git asix-sigma: Init cur_sample_rate 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 --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index e2193fc8..c57ce367 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;