From 3fe79c2e4bc04758186875119c2ded1ffb3e66c8 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 11 Dec 2020 21:26:25 +0100 Subject: [PATCH] chore: rm TaskGreenLed+comment out TaskEffect call --- main.cpp | 55 +++---------------------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/main.cpp b/main.cpp index fda6587..6983c00 100644 --- a/main.cpp +++ b/main.cpp @@ -54,12 +54,10 @@ void LED_control(bool d1, bool d2, bool d3); bool SW1_pressed; /* we'll do blinking, but not by default, values are -1/1 */ int blinkingpls = -1; -// Promenna state je nove lokalni uvnitr tasku (funkce) pro blikani // Prototypy funkci void TaskSwitches(void); void TaskEffect(void); -void TaskGreenLed(void); void TaskL1(void); void TaskL2(void); void TaskL3(void); @@ -70,16 +68,14 @@ int main(void) { while (1) { - TaskSwitches(); - TaskEffect(); - TaskGreenLed(); + TaskSwitches(); + //TaskEffect(); TaskL1(); TaskL2(); TaskL3(); - } // while + } - /* Never leave main */ return 0; } @@ -305,51 +301,6 @@ void TaskL3() { } -// Ukazka dalsiho tasku - blika pri stisknutem tlacitku RGB LED -void TaskGreenLed() { - static enum { - ST_LED_ON, - ST_ON_WAIT, - ST_LED_OFF, - ST_OFF_WAIT - - } stav = ST_LED_ON; - - static uint32_t startTime; - - // uloha se provadi jen pri stisknutem tlacitku - if (SW1_pressed) { - - switch (stav) { - - case ST_LED_ON: - pinWrite(LED_GREEN, LOW); - startTime = SYSTICK_millis(); - stav = ST_ON_WAIT; - break; - - case ST_ON_WAIT: - if (SYSTICK_millis() - startTime >= GREEN_ON_DELAY) - stav = ST_LED_OFF; - break; - - case ST_LED_OFF: - pinWrite(LED_GREEN, HIGH); - startTime = SYSTICK_millis(); - stav = ST_OFF_WAIT; - break; - - case ST_OFF_WAIT: - if (SYSTICK_millis() - startTime >= GREEN_OFF_DELAY) - stav = ST_LED_ON; - break; - } // switch - } else { - pinWrite(LED_GREEN, HIGH); // zhasni LED - stav = ST_LED_ON; // resetuj stav LED - } -} - // Pomocne funkce // inicializace