From: Uwe Hermann Date: Fri, 25 Mar 2011 12:44:16 +0000 (+0100) Subject: ASIX Sigma: Fix firmware loading bug. X-Git-Tag: libsigrok-0.1.0~305 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=82957b65b111437ebe445b7f165719eec2d4e147;p=libsigrok.git ASIX Sigma: Fix firmware loading bug. When no firmware file is found, return the right error code so sigrok doesn't continue running with no firmware loaded. Thanks Martin StensgÄrd for the patch! --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 5b6417d9..3cd83d35 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -1205,11 +1205,10 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) struct sr_datafeed_packet packet; struct sr_datafeed_header header; struct clockselect_50 clockselect; - int frac; + int frac, triggerpin, ret; uint8_t triggerselect; struct triggerinout triggerinout_conf; struct triggerlut lut; - int triggerpin; session_device_id = session_device_id; @@ -1219,8 +1218,10 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) sigma = sdi->priv; /* If the samplerate has not been set, default to 200 KHz. */ - if (sigma->cur_firmware == -1) - set_samplerate(sdi, SR_KHZ(200)); + if (sigma->cur_firmware == -1) { + if ((ret = set_samplerate(sdi, SR_KHZ(200))) != SR_OK) + return ret; + } /* Enter trigger programming mode. */ sigma_set_register(WRITE_TRIGGER_SELECT1, 0x20, sigma);