kopia lustrzana https://github.com/meshtastic/firmware
Merge pull request #2492 from meshtastic/bug-2490
fixes #2490 - hard coded 8 hour limitpull/2480/head^2
commit
0009b98996
|
@ -53,6 +53,7 @@ int32_t RangeTestModule::runOnce()
|
||||||
|
|
||||||
if (moduleConfig.range_test.sender) {
|
if (moduleConfig.range_test.sender) {
|
||||||
LOG_INFO("Initializing Range Test Module -- Sender\n");
|
LOG_INFO("Initializing Range Test Module -- Sender\n");
|
||||||
|
started = millis(); // make a note of when we started
|
||||||
return (5000); // Sending first message 5 seconds after initilization.
|
return (5000); // Sending first message 5 seconds after initilization.
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("Initializing Range Test Module -- Receiver\n");
|
LOG_INFO("Initializing Range Test Module -- Receiver\n");
|
||||||
|
@ -77,7 +78,13 @@ int32_t RangeTestModule::runOnce()
|
||||||
rangeTestModuleRadio->sendPayload();
|
rangeTestModuleRadio->sendPayload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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);
|
return (senderHeartbeat);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return disable();
|
return disable();
|
||||||
// This thread does not need to run as a receiver
|
// This thread does not need to run as a receiver
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
class RangeTestModule : private concurrency::OSThread
|
class RangeTestModule : private concurrency::OSThread
|
||||||
{
|
{
|
||||||
bool firstTime = 1;
|
bool firstTime = 1;
|
||||||
|
unsigned long started = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RangeTestModule();
|
RangeTestModule();
|
||||||
|
|
Ładowanie…
Reference in New Issue