tail pip timer

This commit is contained in:
Jim Colderwood 2024-04-17 20:30:32 +01:00
parent a1e2d5307f
commit 90a826c8b2
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -61,6 +61,7 @@ typedef struct {
serial serial;
state state;
transmitter transmitter;
unsigned long tail;
}repeater;
#endif