Merge pull request #2492 from meshtastic/bug-2490

fixes #2490 - hard coded 8 hour limit
raspi-portduino
Thomas Göttgens 2023-05-15 18:04:17 +02:00 zatwierdzone przez GitHub
commit 0009b98996
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -53,7 +53,8 @@ int32_t RangeTestModule::runOnce()
if (moduleConfig.range_test.sender) {
LOG_INFO("Initializing Range Test Module -- Sender\n");
return (5000); // Sending first message 5 seconds after initilization.
started = millis(); // make a note of when we started
return (5000); // Sending first message 5 seconds after initilization.
} else {
LOG_INFO("Initializing Range Test Module -- Receiver\n");
return disable();
@ -77,7 +78,13 @@ int32_t RangeTestModule::runOnce()
rangeTestModuleRadio->sendPayload();
}
return (senderHeartbeat);
// If we have been running for more than 8 hours, turn module back off
if (millis() - started > 28800000) {
LOG_INFO("Range Test Module - Disabling after 8 hours\n");
return disable();
} else {
return (senderHeartbeat);
}
} else {
return disable();
// This thread does not need to run as a receiver

Wyświetl plik

@ -9,6 +9,7 @@
class RangeTestModule : private concurrency::OSThread
{
bool firstTime = 1;
unsigned long started = 0;
public:
RangeTestModule();