busy function returns state
This commit is contained in:
parent
043aeff73d
commit
5a222e98ee
@ -66,7 +66,7 @@ void loop() {
|
||||
if (ht - tot < PIP_KEYCHUNK)
|
||||
continue;
|
||||
delay(350);
|
||||
if (!digitalRead(COS)) {
|
||||
if (busy(myrpt)) {
|
||||
continue;
|
||||
}
|
||||
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) {
|
||||
switch(myrpt->params.courtesy) {
|
||||
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);
|
||||
if (TAILPIPS)
|
||||
delay(150);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
}
|
||||
if (TAILPIPS)
|
||||
delay(150);
|
||||
}
|
Loading…
Reference in New Issue
Block a user