From d91ab8201496012add0ea774c6cdc6545a20b23a Mon Sep 17 00:00:00 2001 From: giuliof Date: Thu, 18 Apr 2019 12:44:45 +0200 Subject: [PATCH] not{A,B,C,D} -- to be tested --- ArcheryClock-Arduino.ino | 49 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/ArcheryClock-Arduino.ino b/ArcheryClock-Arduino.ino index 6abd7a8..998ec1c 100644 --- a/ArcheryClock-Arduino.ino +++ b/ArcheryClock-Arduino.ino @@ -312,34 +312,35 @@ void loop() digitalWrite(39, (((statevalue >> 7) & B00000111) == 2) and (trafficvalue & 0x8000)); //green left arrow for fita finals */ - // Set not{A,B,C,D,(E,F)} - /*if (cfg.abcd != 6) - { - uint8_t notABCD_on = 0; - // not A is on if archer group A is not selected - digitalWrite(notA_PIN, cfg.GroupsNumber > 1 && !(ReceivedCommand.t.ArcherGroups & _BV(0))); + // Set not{A,B,C,D,(E,F)}; EF not implemented in this hardware + // Note: GOLEM panel does not have not{A,B,C,D} + #ifndef GOLEM_PANEL + if (cfg.abcd != 6) { + // not A is on if archer group A is not selected + digitalWrite(notA_PIN, cfg.GroupsNumber > 1 && !(ReceivedCommand.t.ArcherGroups & _BV(0))); - // not B ~ not D are on if groups are effectively present and are not selected - if (cfg.competition != 2 && cfg.competition != 4) - { - digitalWrite(notB_PIN, cfg.GroupsNumber > 1 && !(ReceivedCommand.t.ArcherGroups & _BV(1))); - digitalWrite(notC_PIN, cfg.GroupsNumber > 2 && !(ReceivedCommand.t.ArcherGroups & _BV(2))); - digitalWrite(notD_PIN, cfg.GroupsNumber > 3 && !(ReceivedCommand.t.ArcherGroups & _BV(3))); - } - else - { - digitalWrite(notB_PIN, LOW); - digitalWrite(notC_PIN, LOW); - digitalWrite(notD_PIN, LOW); - } + // not B ~ not D are on if groups are effectively present and are not selected + if (cfg.competition != 2 && cfg.competition != 4) + { + digitalWrite(notB_PIN, cfg.GroupsNumber > 1 && !(ReceivedCommand.t.ArcherGroups & _BV(1))); + digitalWrite(notC_PIN, cfg.GroupsNumber > 2 && !(ReceivedCommand.t.ArcherGroups & _BV(2))); + digitalWrite(notD_PIN, cfg.GroupsNumber > 3 && !(ReceivedCommand.t.ArcherGroups & _BV(3))); } else { - digitalWrite(notA_PIN, HIGH); - digitalWrite(notB_PIN, HIGH); - digitalWrite(notC_PIN, HIGH); - digitalWrite(notD_PIN, HIGH); - }*/ + digitalWrite(notB_PIN, LOW); + digitalWrite(notC_PIN, LOW); + digitalWrite(notD_PIN, LOW); + } + #endif + } + else + { + digitalWrite(notA_PIN, HIGH); + digitalWrite(notB_PIN, HIGH); + digitalWrite(notC_PIN, HIGH); + digitalWrite(notD_PIN, HIGH); + } } // Parsing of STATE command else if (ReceivedCommand.s.cmd == 0b1111)