]> Johnzone git - FakeRadio.git/commitdiff
cleanup
authorJohn Janus <mail@johnzone.org>
Sun, 27 Aug 2017 11:55:21 +0000 (13:55 +0200)
committerJohn Janus <mail@johnzone.org>
Sun, 27 Aug 2017 11:55:21 +0000 (13:55 +0200)
simple_try.c

index d55a5fc51699444f338a6490866046b335630018..f53943e26be36bcf499331267eb07b3bb06d788a 100644 (file)
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <signal.h>
+#include <unistd.h>
 
 #define PWRLED 8
 #define CHNL1LED 9
@@ -18,7 +19,6 @@ static volatile bool chnl1 = true;
 void ctrlCHandler(int dummy) {
     running = false;
     return;
-
 }
 
 void pwrBtn(void) {
@@ -61,6 +61,7 @@ int main(void) {
             digitalWrite(PWRLED, HIGH);
             digitalWrite(CHNL1LED, HIGH);
             digitalWrite(CHNL2LED, HIGH);
+            sleep(0.3);
             continue;
         }
         digitalWrite(PWRLED, LOW);
@@ -71,12 +72,16 @@ int main(void) {
             digitalWrite(CHNL2LED, LOW);
             digitalWrite(CHNL1LED, HIGH);
         }
-        delay(200);
+        //delay(200);
+        sleep(0.3);
 
     }
     printf("ShuttingDown\n");
     digitalWrite(PWRLED, HIGH);
     digitalWrite(CHNL1LED, HIGH);
     digitalWrite(CHNL2LED, HIGH);
+    pullUpDnControl(PWRBTN, PUD_DOWN);
+    pullUpDnControl(CHNL1BTN, PUD_DOWN);
+    pullUpDnControl(CHNL2BTN, PUD_DOWN);
 }