Last ID timer

This commit is contained in:
jimzah 2024-10-30 16:33:19 +00:00
parent 93fd840343
commit ff89787d39
3 changed files with 6 additions and 4 deletions

View File

@ -67,7 +67,7 @@ void loop() {
myrpt->timer.gw_start = millis();
}
tot = millis();
if (myrpt->params.start_up)
if (myrpt->params.start_up && millis() - myrpt->last_id >= LAST_ID_HOLD)
sendID(myrpt);
}
@ -117,7 +117,7 @@ void loop() {
}
if (myrpt->state == HANG && millis() - ht > HANGTIME) {
if (myrpt->params.close_down) {
if (myrpt->params.close_down && millis() - myrpt->last_id >= LAST_ID_HOLD) {
serial_writer(&myrpt->serial, "REPEATER: CLOSEDOWN ID");
myrpt->state = SLEEP;
sendID(myrpt);

View File

@ -45,14 +45,15 @@ void sendChar(repeater* myrpt, char c) {
void sendID(repeater* myrpt) {
myrpt->id_time = millis();
myrpt->last_id = myrpt->id_time;
if (myrpt->callsign == NULL) {
return;
}
delay(500);
if (myrpt->state == SLEEP)
digitalWrite(PIP_ATT, HIGH);
//if (myrpt->state == SLEEP)
// digitalWrite(PIP_ATT, HIGH);
for (int i=0; i < sizeof ID/sizeof ID[0]; i++) {
sendChar(myrpt, myrpt->callsign[i]);

View File

@ -70,6 +70,7 @@ typedef struct {
char* callsign;
gateway gateway;
unsigned long id_time;
unsigned long last_id;
state last;
params params;
receiver receiver;