Commit e4ab2e07a467da95e1ac6cb3a60bf3586c4cdadc

kanoi 2013-06-02T17:31:53

Merge pull request #434 from kanoi/master Alice v0.1 +

diff --git a/API.java b/API.java
index 54dcda9..74c57a2 100644
--- a/API.java
+++ b/API.java
@@ -1,5 +1,7 @@
 /*
  *
+ * Copyright (C) Andrew Smith 2012-2013
+ *
  * Usage: java API command ip port
  *
  * If any are missing or blank they use the defaults:
diff --git a/cgminer.c b/cgminer.c
index 3bf959f..0714d9c 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2034,10 +2034,9 @@ static void adj_width(int var, int *length)
 
 static int dev_width;
 
-static void curses_print_devstatus(int thr_id)
+static void curses_print_devstatus(struct cgpu_info *cgpu, int count)
 {
 	static int awidth = 1, rwidth = 1, hwwidth = 1, uwidth = 1;
-	struct cgpu_info *cgpu;
 	char logline[256];
 	char displayed_hashes[16], displayed_rolling[16];
 	uint64_t dh64, dr64;
@@ -2045,14 +2044,12 @@ static void curses_print_devstatus(int thr_id)
 	if (opt_compact)
 		return;
 
-	cgpu = get_thr_cgpu(thr_id);
-
-	if (cgpu->cgminer_id >= start_devices || devcursor + cgpu->cgminer_id > LINES - 2)
+	if (count >= start_devices || devcursor + count > LINES - 2)
 		return;
 
 	cgpu->utility = cgpu->accepted / total_secs * 60;
 
-	wmove(statuswin,devcursor + cgpu->cgminer_id, 0);
+	wmove(statuswin,devcursor + count, 0);
 	wprintw(statuswin, " %s %*d: ", cgpu->drv->name, dev_width, cgpu->device_id);
 	logline[0] = '\0';
 	cgpu->drv->get_statline_before(logline, cgpu);
@@ -6385,10 +6382,28 @@ static void *watchdog_thread(void __maybe_unused *userdata)
 
 #ifdef HAVE_CURSES
 		if (curses_active_locked()) {
+			struct cgpu_info *cgpu;
+			int count;
+
 			change_logwinsize();
 			curses_print_status();
-			for (i = 0; i < mining_threads; i++)
-				curses_print_devstatus(i);
+			count = 0;
+			for (i = 0; i < mining_threads; i++) {
+				cgpu = get_thr_cgpu(i);
+#ifndef USE_USBUTILS
+				if (cgpu)
+#else
+				if (cgpu && !cgpu->usbinfo.nodev)
+#endif
+					curses_print_devstatus(cgpu, count++);
+			}
+#ifdef USE_USBUTILS
+			for (i = 0; i < mining_threads; i++) {
+				cgpu = get_thr_cgpu(i);
+				if (cgpu && cgpu->usbinfo.nodev)
+					curses_print_devstatus(cgpu, count++);
+			}
+#endif
 			touchwin(statuswin);
 			wrefresh(statuswin);
 			touchwin(logwin);