devs display - show ZOMBIEs after all others
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
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);