From 34157e25616e1e0afdf707961401c8d6ab518c66 Mon Sep 17 00:00:00 2001 From: John Janus Date: Sun, 27 Aug 2017 13:55:21 +0200 Subject: [PATCH] cleanup --- simple_try.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/simple_try.c b/simple_try.c index d55a5fc..f53943e 100644 --- a/simple_try.c +++ b/simple_try.c @@ -2,6 +2,7 @@ #include #include #include +#include #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); } -- 2.47.0