diff --git a/GB3TX/GB3TX.ino b/GB3TX/GB3TX.ino index 92cfc81..1af4be8 100644 --- a/GB3TX/GB3TX.ino +++ b/GB3TX/GB3TX.ino @@ -74,16 +74,16 @@ void loop() { myrpt->last = myrpt->state; myrpt->state = HANG; ht = millis(); + myrpt->tail = ht; if (ht - tot < PIP_KEYCHUNK || busy(myrpt)) continue; courtesyTone(myrpt); } if (myrpt->state == HANG && TAILPIPS) { - static unsigned long bc = millis(); - if (millis() - bc >= 1000 && !busy(myrpt)) { - bc = millis(); - tone(3, TAILPIP_PITCH, myrpt->params.pip_length); + if (millis() - myrpt->tail >= TAIL_PIP_DELAY && !busy(myrpt)) { + myrpt->tail = millis(); + tone(PIP, TAILPIP_PITCH, myrpt->params.pip_length); } } diff --git a/GB3TX/repeater.h b/GB3TX/repeater.h index 2cc4190..5270e3b 100644 --- a/GB3TX/repeater.h +++ b/GB3TX/repeater.h @@ -61,6 +61,7 @@ typedef struct { serial serial; state state; transmitter transmitter; + unsigned long tail; }repeater; #endif \ No newline at end of file