From dead17ab279cdccc6903d3cc9620b72321a2b79d Mon Sep 17 00:00:00 2001 From: Jim Colderwood Date: Sat, 6 Apr 2024 22:22:59 +0100 Subject: [PATCH] Remove boolean, read pin! --- GB3TX/cw.ino | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/GB3TX/cw.ino b/GB3TX/cw.ino index ca0fefa..4764593 100644 --- a/GB3TX/cw.ino +++ b/GB3TX/cw.ino @@ -37,7 +37,6 @@ void sendChar(int speed, int pitch, char c) { } void sendID(repeater* myrpt) { - bool pip_att = false; if (myrpt->callsign == NULL) { return; } @@ -46,16 +45,13 @@ void sendID(repeater* myrpt) { /* attenuate pips in active T/T * unless first ID from sleep */ - if (myrpt->state != KEYCHUNK && busy(myrpt) && !pip_att) { - pip_att = true; + if (myrpt->state != KEYCHUNK && busy(myrpt) && !digitalRead(PIP_ATT)) digitalWrite(PIP_ATT, HIGH); - } sendChar(myrpt->params.cw_speed, myrpt->params.cw_pitch, myrpt->callsign[i]); delay(myrpt->params.cw_speed * 3); } - if (pip_att) { + if (digitalRead(PIP_ATT)) digitalWrite(PIP_ATT, LOW); - } }