]> Johnzone git - FakeRadio.git/commitdiff
makefile working now plus small stuff
authorJohn Janus <mail@johnzone.org>
Sat, 16 Sep 2017 22:26:32 +0000 (00:26 +0200)
committerJohn Janus <mail@johnzone.org>
Sat, 16 Sep 2017 22:26:32 +0000 (00:26 +0200)
.gitignore
Makefile
fakeradio [deleted file]
mp3player.c
simple_try.c

index 7c1e38e..bb00e1e 100644 (file)
@@ -1,2 +1,4 @@
 *.o
 *swp
+fakeradio
+
index 3669f8c..b7fa73d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,15 @@
 CC     =       gcc
 CFLAGS =       -std=gnu11 -Wall
 LDFLAGS        =       -lpthread -lao -lmpg123 -lwiringPi
-fakeradio: main.o mp3player.o
+fakeradio : mp3player.o main.o
        $(CC) $(CFLAGS) -o fakeradio main.o mp3player.o $(LDFLAGS)
 
-main.o: simple_try.c
-       $(CC) $(CFLAGS) -o main.o simple_try.c $(LDFLAGS)
+main.o : simple_try.c
+       $(CC) $(CFLAGS) -c -o main.o simple_try.c $(LDFLAGS)
 
-mp3player.o: mp3player.h mp3player.c
-       $(CC) $(CFLAGS) -o mp3player.o mp3player.c $(LDFLAGS)
+mp3player.o : mp3player.h mp3player.c
+       $(CC) $(CFLAGS) -c -o mp3player.o mp3player.c $(LDFLAGS)
 
+.PHONY : clean
+clean :
+       rm main.o mp3player.o fakeradio
diff --git a/fakeradio b/fakeradio
deleted file mode 100755 (executable)
index 4e75de1..0000000
Binary files a/fakeradio and /dev/null differ
index 954f141..5e91ba6 100644 (file)
@@ -58,11 +58,3 @@ void* playFunc(void* file)
     
 }
 
-/*int main (int argc, char** argv)
-{
-    pthread_t thread = startPlayThread("platt01.mp3");
-    void* status;
-    pthread_join(thread, status);
-    //playFunc("platt01.mp3");
-}*/
-
index ddf1106..00c829a 100644 (file)
@@ -91,7 +91,6 @@ int main(void) {
         pthread_cond_wait(wakeup, mut);
         
         if (playThread) {
-            printf("playing");
             pthread_cancel(playThread);
         }
         
@@ -99,6 +98,7 @@ int main(void) {
             digitalWrite(PWRLED, HIGH);
             digitalWrite(CHNL1LED, HIGH);
             digitalWrite(CHNL2LED, HIGH);
+            chnl1=true;
         } else {
             digitalWrite(PWRLED, LOW);
             if (chnl1) {