Browse Source

Idle mode for bitforce

nfactor-troky
Paul Sheppard 13 years ago
parent
commit
ec394533a2
  1. 9
      driver-bitforce.c

9
driver-bitforce.c

@ -284,8 +284,8 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
if (temp > 0) { if (temp > 0) {
bitforce->temp = temp; bitforce->temp = temp;
if (temp > bitforce->cutofftemp) { if (temp > bitforce->cutofftemp) {
applog(LOG_WARNING, "Hit thermal cutoff limit on %s %d, disabling!", bitforce->api->name, bitforce->device_id); applog(LOG_WARNING, "Hit thermal cutoff limit on %s %d, setting idle", bitforce->api->name, bitforce->device_id);
bitforce->deven = DEV_RECOVER; bitforce->deven = DEV_IDLE;
bitforce->device_last_not_well = time(NULL); bitforce->device_last_not_well = time(NULL);
bitforce->device_not_well_reason = REASON_DEV_THERMAL_CUTOFF; bitforce->device_not_well_reason = REASON_DEV_THERMAL_CUTOFF;
@ -399,7 +399,9 @@ static uint64_t bitforce_get_result(struct thr_info *thr, struct work *work)
static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint64_t __maybe_unused max_nonce) static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint64_t __maybe_unused max_nonce)
{ {
struct cgpu_info *bitforce = thr->cgpu; struct cgpu_info *bitforce = thr->cgpu;
bool dev_enabled = (bitforce->deven == DEV_ENABLED);
if (dev_enabled)
if (!bitforce_send_work(thr, work)) if (!bitforce_send_work(thr, work))
return 0; return 0;
@ -408,7 +410,10 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
usleep(BITFORCE_SLEEP_US); usleep(BITFORCE_SLEEP_US);
if (dev_enabled)
return bitforce_get_result(thr, work); return bitforce_get_result(thr, work);
else
return 1;
} }
struct device_api bitforce_api = { struct device_api bitforce_api = {

Loading…
Cancel
Save