ants1 - fix/enable temperature checking and remove unneeded temp_old
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/driver-bitmain.c b/driver-bitmain.c
index 8eb013e..d32fe48 100644
--- a/driver-bitmain.c
+++ b/driver-bitmain.c
@@ -754,16 +754,16 @@ static void bitmain_update_temps(struct cgpu_info *bitmain, struct bitmain_info
applog(LOG_INFO, msg);
info->temp_history_index++;
info->temp_sum += bitmain->temp;
- applog(LOG_DEBUG, "BitMain: temp_index: %d, temp_count: %d, temp_old: %d",
- info->temp_history_index, info->temp_history_count, info->temp_old);
+ applog(LOG_DEBUG, "BitMain: temp_index: %d, temp_count: %d, temp_max: %d",
+ info->temp_history_index, info->temp_history_count, info->temp_max);
if (info->temp_history_index == info->temp_history_count) {
info->temp_history_index = 0;
info->temp_sum = 0;
}
- if (unlikely(info->temp_old >= opt_bitmain_overheat)) {
+ if (unlikely(info->temp_max >= opt_bitmain_overheat)) {
applog(LOG_WARNING, "BTM%d overheat! Idling", bitmain->device_id);
info->overheat = true;
- } else if (info->overheat && info->temp_old <= opt_bitmain_temp) {
+ } else if (info->overheat && info->temp_max <= opt_bitmain_temp) {
applog(LOG_WARNING, "BTM%d cooled, restarting", bitmain->device_id);
info->overheat = false;
}
@@ -1315,7 +1315,6 @@ static struct cgpu_info *bitmain_detect_one(libusb_device *dev, struct usb_find_
info->temp_history_index = 0;
info->temp_sum = 0;
- info->temp_old = 0;
if (!add_cgpu(bitmain))
goto unshin;
diff --git a/driver-bitmain.h b/driver-bitmain.h
index ac2b68c..605fdd9 100644
--- a/driver-bitmain.h
+++ b/driver-bitmain.h
@@ -191,7 +191,6 @@ struct bitmain_info {
int temp_history_count;
int temp_history_index;
int temp_sum;
- int temp_old;
int fan_pwm;
int frequency;