]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Do GPIO init before autostart.
authorc vw <dl1ycf@darc.de>
Thu, 23 Jul 2020 08:28:05 +0000 (10:28 +0200)
committerc vw <dl1ycf@darc.de>
Thu, 23 Jul 2020 08:28:05 +0000 (10:28 +0200)
discovery.c

index 2f546ea74a1a49b9f6e919aaba81f1cf78d0b31b..cfc7e0f600d1ab7c1f4e11d013999e3f020f1bf4 100644 (file)
@@ -532,6 +532,11 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name);
       }
     }
 
+#ifdef GPIO
+    controller=CONTROLLER2_V2;
+    gpio_set_defaults(controller);
+    gpio_restore_state();
+#endif
 
     g_print("%s: devices=%d autostart=%d\n",__FUNCTION__,devices,autostart);
 
@@ -574,10 +579,6 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name);
 #endif
 
 #ifdef GPIO
-    controller=CONTROLLER2_V2;
-    gpio_set_defaults(controller);
-    gpio_restore_state();
-
     GtkWidget *gpio=gtk_combo_box_text_new();
     gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(gpio),NULL,"No Controller");
     gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(gpio),NULL,"Controller1");