tail pip timer
This commit is contained in:
parent
a1e2d5307f
commit
90a826c8b2
@ -74,16 +74,16 @@ void loop() {
|
|||||||
myrpt->last = myrpt->state;
|
myrpt->last = myrpt->state;
|
||||||
myrpt->state = HANG;
|
myrpt->state = HANG;
|
||||||
ht = millis();
|
ht = millis();
|
||||||
|
myrpt->tail = ht;
|
||||||
if (ht - tot < PIP_KEYCHUNK || busy(myrpt))
|
if (ht - tot < PIP_KEYCHUNK || busy(myrpt))
|
||||||
continue;
|
continue;
|
||||||
courtesyTone(myrpt);
|
courtesyTone(myrpt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myrpt->state == HANG && TAILPIPS) {
|
if (myrpt->state == HANG && TAILPIPS) {
|
||||||
static unsigned long bc = millis();
|
if (millis() - myrpt->tail >= TAIL_PIP_DELAY && !busy(myrpt)) {
|
||||||
if (millis() - bc >= 1000 && !busy(myrpt)) {
|
myrpt->tail = millis();
|
||||||
bc = millis();
|
tone(PIP, TAILPIP_PITCH, myrpt->params.pip_length);
|
||||||
tone(3, TAILPIP_PITCH, myrpt->params.pip_length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ typedef struct {
|
|||||||
serial serial;
|
serial serial;
|
||||||
state state;
|
state state;
|
||||||
transmitter transmitter;
|
transmitter transmitter;
|
||||||
|
unsigned long tail;
|
||||||
}repeater;
|
}repeater;
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user