Move ID check

This commit is contained in:
Jim Colderwood 2024-04-01 22:21:45 +01:00
parent 88e15d9207
commit 70772219c7

View File

@ -42,17 +42,6 @@ void loop() {
while (1) {
rx(myrpt);
if (myrpt->state > SLEEP && millis() - id >= IDTIME) {
/* Repeater is IDLE, bring the transmitter up */
if (!myrpt->transmitter.tx) {
myrpt->state = HANG;
tx(myrpt);
myrpt->state = SLEEP;
}
sendID(myrpt);
id = millis();
}
if (((!myrpt->receiver.rx || !myrpt->gateway.receiver.rx)) && myrpt->state < 2) {
myrpt->state = KEYCHUNK;
if (!myrpt->receiver.rx)
@ -124,6 +113,17 @@ void loop() {
}
tx(myrpt);
if (myrpt->state > SLEEP && millis() - id >= IDTIME) {
/* Repeater is IDLE, bring the transmitter up */
if (!myrpt->transmitter.tx) {
myrpt->state = HANG;
tx(myrpt);
myrpt->state = SLEEP;
}
sendID(myrpt);
id = millis();
}
}
}