From 566cbfd52ef664254a4f4c0eebf5b4c1db4a4fc7 Mon Sep 17 00:00:00 2001 From: Jim Colderwood Date: Thu, 4 Apr 2024 14:23:50 +0100 Subject: [PATCH] Id routine update --- GB3TX/GB3TX.ino | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/GB3TX/GB3TX.ino b/GB3TX/GB3TX.ino index 96a2850..4396aba 100644 --- a/GB3TX/GB3TX.ino +++ b/GB3TX/GB3TX.ino @@ -121,19 +121,28 @@ void loop() { 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 */ if (!myrpt->transmitter.tx) { myrpt->state = HANG; tx(myrpt); myrpt->state = SLEEP; } + serial_writer(&myrpt->serial, "REPEATER: ID"); sendID(myrpt); id = millis(); } + + tx(myrpt); } } \ No newline at end of file