  	int tmp;
  
  	int type = AVA2_GETS_ERROR;
-@@ -232,7 +289,6 @@ static int decode_pkg(struct thr_info *thr, struct avalon2_ret *ar, uint8_t *pkg
+@@ -232,7 +311,6 @@ static int decode_pkg(struct thr_info *thr, struct avalon2_ret *ar, uint8_t *pkg
  			memcpy(&nonce2, ar->data + 8, 4);
  			/* Calc time    ar->data + 12 */
  			memcpy(&nonce, ar->data + 16, 4);

 int opt_avalon2_freq_min = AVA2_DEFAULT_FREQUENCY;
 int opt_avalon2_freq_max = AVA2_DEFAULT_FREQUENCY_MAX;
 
@@ -52,6 +54,11 @@ int opt_avalon2_voltage_min = AVA2_DEFAULT_VOLTAGE;
 int opt_avalon2_voltage_max = AVA2_DEFAULT_VOLTAGE_MAX;
 
 int opt_avalon2_overheat = AVALON2_TEMP_OVERHEAT;

 
 	return true;
 }
@@ -668,12 +788,25 @@ static int polling(struct thr_info *thr)
 	struct cgpu_info *avalon2 = thr->cgpu;
 	struct avalon2_info *info = avalon2->device_data;
 
