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 <mastensg@ping.uio.no> for the patch!
This commit is contained in:
Uwe Hermann 2011-03-25 13:44:16 +01:00
parent 8bb416becf
commit 82957b65b1
1 changed files with 5 additions and 4 deletions

View File

@ -1205,11 +1205,10 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
struct sr_datafeed_packet packet; struct sr_datafeed_packet packet;
struct sr_datafeed_header header; struct sr_datafeed_header header;
struct clockselect_50 clockselect; struct clockselect_50 clockselect;
int frac; int frac, triggerpin, ret;
uint8_t triggerselect; uint8_t triggerselect;
struct triggerinout triggerinout_conf; struct triggerinout triggerinout_conf;
struct triggerlut lut; struct triggerlut lut;
int triggerpin;
session_device_id = session_device_id; 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; sigma = sdi->priv;
/* If the samplerate has not been set, default to 200 KHz. */ /* If the samplerate has not been set, default to 200 KHz. */
if (sigma->cur_firmware == -1) if (sigma->cur_firmware == -1) {
set_samplerate(sdi, SR_KHZ(200)); if ((ret = set_samplerate(sdi, SR_KHZ(200))) != SR_OK)
return ret;
}
/* Enter trigger programming mode. */ /* Enter trigger programming mode. */
sigma_set_register(WRITE_TRIGGER_SELECT1, 0x20, sigma); sigma_set_register(WRITE_TRIGGER_SELECT1, 0x20, sigma);