Remove boolean, read pin!

This commit is contained in:
Jim Colderwood 2024-04-06 22:22:59 +01:00
parent aab8ebd76c
commit dead17ab27

View File

@ -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);
}
}