sforkowany z mirror/meshtastic-firmware
Merge pull request #2492 from meshtastic/bug-2490
fixes #2490 - hard coded 8 hour limitraspi-portduino
commit
0009b98996
|
@ -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
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
class RangeTestModule : private concurrency::OSThread
|
||||
{
|
||||
bool firstTime = 1;
|
||||
unsigned long started = 0;
|
||||
|
||||
public:
|
||||
RangeTestModule();
|
||||
|
|
Ładowanie…
Reference in New Issue