1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

ztex: Correctly release mutex and reset FPGA if configuration fails

This commit is contained in:
Denis Ahrens 2012-11-26 02:41:07 +01:00
parent b28dbc2e1c
commit 0e5c716cfc

View File

@ -362,8 +362,11 @@ static bool ztex_prepare(struct thr_info *thr)
get_datestamp(cgpu->init, &now); get_datestamp(cgpu->init, &now);
ztex_selectFpga(ztex); ztex_selectFpga(ztex);
if (libztex_configureFpga(ztex) != 0) if (libztex_configureFpga(ztex) != 0) {
libztex_resetFpga(ztex);
ztex_releaseFpga(ztex);
return false; return false;
}
ztex_releaseFpga(ztex); ztex_releaseFpga(ztex);
ztex->freqM = ztex->freqMaxM+1;; ztex->freqM = ztex->freqMaxM+1;;
//ztex_updateFreq(ztex); //ztex_updateFreq(ztex);