busy function returns state
This commit is contained in:
parent
043aeff73d
commit
5a222e98ee
@ -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);
|
||||||
|
@ -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);
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user