summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile4
-rw-r--r--src/illuminate.c3
-rw-r--r--src/instru2light.c7
3 files changed, 9 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index 17b646f..d4f0979 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,10 +1,10 @@
CC=gcc
# For debug
-#CFLAGS=-W -Wall -Werror -Wno-error=unused-parameter -g
+CFLAGS=-W -Wall -Werror -Wno-error=unused-parameter -g
#LDFLAGS=-Werror -g
# For release
-CFLAGS=-W -Wall -Werror -Wno-unused-parameter -O2
+#CFLAGS=-W -Wall -Werror -Wno-unused-parameter -O2
LDFLAGS=-export-dynamic -Werror
EXEC=instru2light
diff --git a/src/illuminate.c b/src/illuminate.c
index b3afbfb..d5d40b2 100644
--- a/src/illuminate.c
+++ b/src/illuminate.c
@@ -75,7 +75,8 @@ int dmx_init() {
//Always take the first device
if (devlist==NULL || devlist->dev==NULL) {
fprintf(stderr, "No usb device detected (looking for USB ID 0x%04X:0x%04X)\n", VID, PID);
- return(2);
+ ftdi_deinit(&ftdi);
+ return 1;
}
dev=devlist->dev;
diff --git a/src/instru2light.c b/src/instru2light.c
index 33892b5..a72fd0f 100644
--- a/src/instru2light.c
+++ b/src/instru2light.c
@@ -29,6 +29,8 @@ gint *audio_vumeter_val, *light_h, *light_s, *light_v, *light_r, *light_g, *ligh
void my_process(float *data, size_t nsamples, size_t nchan);
int main (int argc, char **argv) {
+ int dmx_init_res;
+
GtkWidget *mainwin;
gint vals_for_vumeters[7]={0,0,0,0,0,0,0}; //sound,h,s,v,r,g,b
//Some handy references to the previous array items to make things clear whenever possible
@@ -50,7 +52,7 @@ int main (int argc, char **argv) {
mainwin=win_main_build();
gtk_widget_show_all (mainwin);
- dmx_init();
+ dmx_init_res=dmx_init();
printf("debug : main my_process==%p\n", my_process);
printf("debug : main (void *)my_process==%p\n", (void *)my_process);
@@ -60,7 +62,8 @@ int main (int argc, char **argv) {
gtk_main ();
gdk_threads_leave();
- dmx_deinit();
+
+ if (dmx_init_res==0) dmx_deinit();
return 0;
}