Browse Source

dualminer: Use cgsleep_ms rather than usleep

Luke Dashjr 12 years ago
parent
commit
57cd9d99d1
2 changed files with 6 additions and 6 deletions
  1. 1 1
      driver-dualminer.c
  2. 5 5
      gc3355.c

+ 1 - 1
driver-dualminer.c

@@ -84,7 +84,7 @@ void dualminer_bootstrap_device(int fd)
 	else
 		gc3355_dualminer_init(fd);
 
-	usleep(1000);
+	cgsleep_ms(1);
 }
 
 static

+ 5 - 5
gc3355.c

@@ -24,7 +24,7 @@
   #include <io.h>
 #endif
 
-#define DEFAULT_DELAY_TIME 2000
+#define DEFAULT_DELAY_TIME_MS 2
 
 #define DEFAULT_0_9V_sha2 "60"
 #define DEFAULT_1_2V_sha2 "0"
@@ -305,7 +305,7 @@ static
 int gc3355_write(const int fd, const void * const buf, const size_t bufsz)
 {
 	const int rv = icarus_write(fd, buf, bufsz);
-	usleep(DEFAULT_DELAY_TIME);
+	cgsleep_ms(DEFAULT_DELAY_TIME_MS);
 	return rv;
 }
 
@@ -323,7 +323,7 @@ void gc3355_send_cmds(int fd, const char *cmds[])
 
 		hex2bin(ob_bin, cmds[i], strlen(cmds[i]) / 2);
 		icarus_write(fd, ob_bin, 8);
-		usleep(DEFAULT_DELAY_TIME);
+		cgsleep_ms(DEFAULT_DELAY_TIME_MS);
 	}
 }
 
@@ -412,7 +412,7 @@ void gc3355_open_sha2_unit(int fd, char *opt_sha2_gating)
 
 		hex2bin(ob_bin, sha2_gating[i], sizeof(ob_bin));
 		icarus_write(fd, ob_bin, 8);
-		usleep(DEFAULT_DELAY_TIME);
+		cgsleep_ms(DEFAULT_DELAY_TIME_MS);
 	}
 
 	opt_sha2_number = sha2_number;
@@ -438,7 +438,7 @@ void gc3355_open_sha2_unit_one_by_one(int fd, char *opt_sha2_gating)
 		{
 			hex2bin(ob_bin, sha2_open_cmd[i], sizeof(ob_bin));
 			icarus_write(fd, ob_bin, 8);
-			usleep(DEFAULT_DELAY_TIME * 2);
+			cgsleep_ms(DEFAULT_DELAY_TIME_MS * 2);
 		}
 		opt_sha2_number = unit_count;
 	}