Extract default intervals and coalesce methods into their own file / static class methods (#3425)

* Extract default intervals and coalesce methods into their own file / static class methods

* Missed pax

* Still managed to miss one
This commit is contained in:
Ben Meadors
2024-03-17 08:18:30 -05:00
committed by GitHub
parent bb57ccfc9e
commit 0d1d79b6d1
20 changed files with 103 additions and 73 deletions

View File

@@ -1,5 +1,6 @@
#include "DeviceTelemetry.h"
#include "../mesh/generated/meshtastic/telemetry.pb.h"
#include "Default.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
@@ -16,7 +17,7 @@ int32_t DeviceTelemetryModule::runOnce()
{
uint32_t now = millis();
if (((lastSentToMesh == 0) ||
((now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.device_update_interval))) &&
((now - lastSentToMesh) >= Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.device_update_interval))) &&
airTime->isTxAllowedChannelUtil() && airTime->isTxAllowedAirUtil() &&
config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER &&
config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT_HIDDEN) {