Id routine update

This commit is contained in:
Jim Colderwood 2024-04-04 14:23:50 +01:00
parent 6f441bd22e
commit 566cbfd52e

View File

@ -121,19 +121,28 @@ void loop() {
serial_writer(&myrpt->serial, "REPEATER: TIMEOUT RESET"); serial_writer(&myrpt->serial, "REPEATER: TIMEOUT RESET");
} }
tx(myrpt); if (myrpt->state > SLEEP && millis() - id >= (IDTIME - 60000)) {
/* Check if the repeater is in use
* wait the full ID time
*/
if (myrpt->state > IDLE && millis() - id < IDTIME) {
return;
}
if (myrpt->state > SLEEP && millis() - id >= IDTIME) {
serial_writer(&myrpt->serial, "REPEATER: ID");
/* Repeater is IDLE, bring the transmitter up */ /* Repeater is IDLE, bring the transmitter up */
if (!myrpt->transmitter.tx) { if (!myrpt->transmitter.tx) {
myrpt->state = HANG; myrpt->state = HANG;
tx(myrpt); tx(myrpt);
myrpt->state = SLEEP; myrpt->state = SLEEP;
} }
serial_writer(&myrpt->serial, "REPEATER: ID");
sendID(myrpt); sendID(myrpt);
id = millis(); id = millis();
} }
tx(myrpt);
} }
} }