busy function returns state

This commit is contained in:
Jim Colderwood 2024-04-02 14:50:06 +01:00
parent 043aeff73d
commit 5a222e98ee
2 changed files with 8 additions and 3 deletions

View File

@ -66,7 +66,7 @@ void loop() {
if (ht - tot < PIP_KEYCHUNK) if (ht - tot < PIP_KEYCHUNK)
continue; continue;
delay(350); delay(350);
if (!digitalRead(COS)) { if (busy(myrpt)) {
continue; continue;
} }
courtesyTone(myrpt); courtesyTone(myrpt);

View File

@ -29,15 +29,20 @@ void rx(repeater* myrpt) {
} }
} }
bool busy(repeater* myrpt) {
rx(myrpt);
return (!myrpt->receiver.rx || !myrpt->gateway.receiver.rx);
}
void courtesyTone(repeater* myrpt) { void courtesyTone(repeater* myrpt) {
switch(myrpt->params.courtesy) { switch(myrpt->params.courtesy) {
case 0: case 0:
myrpt->last == TT ? tone(3, myrpt->params.pip_pitch, myrpt->params.pip_length) : tone(3, myrpt->params.pip_gw_pitch, myrpt->params.pip_gw_length); myrpt->last == TT ? tone(3, myrpt->params.pip_pitch, myrpt->params.pip_length) : tone(3, myrpt->params.pip_gw_pitch, myrpt->params.pip_gw_length);
if (TAILPIPS)
delay(150);
break; break;
case 1: case 1:
myrpt->last == TT ? sendChar(myrpt->params.pip_speed,myrpt->params.pip_pitch,myrpt->params.pip_letter) : sendChar(myrpt->params.pip_speed,myrpt->params.pip_gw_pitch, myrpt->params.pip_gw_letter); myrpt->last == TT ? sendChar(myrpt->params.pip_speed,myrpt->params.pip_pitch,myrpt->params.pip_letter) : sendChar(myrpt->params.pip_speed,myrpt->params.pip_gw_pitch, myrpt->params.pip_gw_letter);
break; break;
} }
if (TAILPIPS)
delay(150);
} }