Browse Source

Merge commit '86fd23a' into cg_merges_2012118

Conflicts:
	driver-modminer.c
Luke Dashjr 13 years ago
parent
commit
3e5bf7a802
4 changed files with 9 additions and 9 deletions
  1. 3 3
      driver-bitforce.c
  2. 1 1
      driver-modminer.c
  3. 3 3
      driver-ztex.c
  4. 2 2
      libztex.c

+ 3 - 3
driver-bitforce.c

@@ -29,7 +29,7 @@
 #define BITFORCE_LONG_TIMEOUT_MS (BITFORCE_LONG_TIMEOUT_S * 1000)
 #define BITFORCE_CHECK_INTERVAL_MS 10
 #define WORK_CHECK_INTERVAL_MS 50
-#define MAX_START_DELAY_US 100000
+#define MAX_START_DELAY_MS 100
 #define tv_to_ms(tval) (tval.tv_sec * 1000 + tval.tv_usec / 1000)
 #define TIME_AVG_CONSTANT 8
 
@@ -606,9 +606,9 @@ static bool bitforce_thread_init(struct thr_info *thr)
 
 	/* Pause each new thread at least 100ms between initialising
 	 * so the devices aren't making calls all at the same time. */
-	wait = thr->id * MAX_START_DELAY_US;
+	wait = thr->id * MAX_START_DELAY_MS;
 	applog(LOG_DEBUG, "BFL%i: Delaying start by %dms", bitforce->device_id, wait / 1000);
-	usleep(wait);
+	nmsleep(wait);
 
 	return true;
 }

+ 1 - 1
driver-modminer.c

@@ -668,7 +668,7 @@ modminer_process_results(struct thr_info*thr)
 		}
 		if (work_restart(thr) || !--iter)
 			break;
-		usleep(1000);
+		nmsleep(1);
 		if (work_restart(thr))
 			break;
 		mutex_lock(&modminer->device_mutex);

+ 3 - 3
driver-ztex.c

@@ -199,7 +199,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 	if (i < 0) {
 		// Something wrong happened in send
 		applog(LOG_ERR, "%s: Failed to send hash data with err %d, retrying", ztex->repr, i);
-		usleep(500000);
+		nmsleep(500);
 		i = libztex_sendHashData(ztex, sendbuf);
 		if (i < 0) {
 			// And there's nothing we can do about it
@@ -234,7 +234,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 
 	applog(LOG_DEBUG, "%s: entering poll loop", ztex->repr);
 	while (!(overflow || thr->work_restart)) {
-		usleep(250000);
+		nmsleep(250);
 		if (thr->work_restart) {
 			applog(LOG_DEBUG, "%s: New work detected", ztex->repr);
 			break;
@@ -244,7 +244,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 		if (i < 0) {
 			// Something wrong happened in read
 			applog(LOG_ERR, "%s: Failed to read hash data with err %d, retrying", ztex->repr, i);
-			usleep(500000);
+			nmsleep(500);
 			i = libztex_readHashData(ztex, &hdata[0]);
 			if (i < 0) {
 				// And there's nothing we can do about it

+ 2 - 2
libztex.c

@@ -223,7 +223,7 @@ static int libztex_configureFpgaHS(struct libztex_device *ztex, const char* firm
 
 	libusb_release_interface(ztex->hndl, settings[1]);
 
-	usleep(200000);
+	nmsleep(200);
 	applog(LOG_INFO, "%s: HS FPGA configuration done", ztex->repr);
 	return 0;
 
@@ -312,7 +312,7 @@ static int libztex_configureFpgaLS(struct libztex_device *ztex, const char* firm
 		applog(LOG_ERR, "%s: FPGA configuration failed: DONE pin does not go high", ztex->repr);
 		return 3;
 	}
-	usleep(200000);
+	nmsleep(200);
 	applog(LOG_INFO, "%s: FPGA configuration done", ztex->repr);
 	return 0;
 }