mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-22 09:47:28 +00:00
I thought git would be smart enough to understand all the whitespace changes but even with all the flags I know to make it ignore theses it still blows up if there are identical changes on both sides.
I have a solution but it require creating a new commit at the merge base for each conflicting PR and merging it into develop.
I don't think blowing up all PRs is worth for now, maybe if we can coordinate this for V3 let's say.
This reverts commit 0d11331d18.
This commit is contained in:
@@ -2,22 +2,25 @@
|
||||
|
||||
#include "meshUtils.h"
|
||||
|
||||
uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval, uint32_t defaultInterval) {
|
||||
if (configuredInterval > 0)
|
||||
return configuredInterval * 1000;
|
||||
return defaultInterval * 1000;
|
||||
uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval, uint32_t defaultInterval)
|
||||
{
|
||||
if (configuredInterval > 0)
|
||||
return configuredInterval * 1000;
|
||||
return defaultInterval * 1000;
|
||||
}
|
||||
|
||||
uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval) {
|
||||
if (configuredInterval > 0)
|
||||
return configuredInterval * 1000;
|
||||
return default_broadcast_interval_secs * 1000;
|
||||
uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval)
|
||||
{
|
||||
if (configuredInterval > 0)
|
||||
return configuredInterval * 1000;
|
||||
return default_broadcast_interval_secs * 1000;
|
||||
}
|
||||
|
||||
uint32_t Default::getConfiguredOrDefault(uint32_t configured, uint32_t defaultValue) {
|
||||
if (configured > 0)
|
||||
return configured;
|
||||
return defaultValue;
|
||||
uint32_t Default::getConfiguredOrDefault(uint32_t configured, uint32_t defaultValue)
|
||||
{
|
||||
if (configured > 0)
|
||||
return configured;
|
||||
return defaultValue;
|
||||
}
|
||||
/**
|
||||
* Calculates the scaled value of the configured or default value in ms based on the number of online nodes.
|
||||
@@ -32,30 +35,33 @@ uint32_t Default::getConfiguredOrDefault(uint32_t configured, uint32_t defaultVa
|
||||
* @param numOnlineNodes The number of online nodes.
|
||||
* @return The scaled value of the configured or default value.
|
||||
*/
|
||||
uint32_t Default::getConfiguredOrDefaultMsScaled(uint32_t configured, uint32_t defaultValue, uint32_t numOnlineNodes) {
|
||||
// If we are a router, we don't scale the value. It's already significantly higher.
|
||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER)
|
||||
return getConfiguredOrDefaultMs(configured, defaultValue);
|
||||
uint32_t Default::getConfiguredOrDefaultMsScaled(uint32_t configured, uint32_t defaultValue, uint32_t numOnlineNodes)
|
||||
{
|
||||
// If we are a router, we don't scale the value. It's already significantly higher.
|
||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER)
|
||||
return getConfiguredOrDefaultMs(configured, defaultValue);
|
||||
|
||||
// Additionally if we're a tracker or sensor, we want priority to send position and telemetry
|
||||
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_SENSOR, meshtastic_Config_DeviceConfig_Role_TRACKER))
|
||||
return getConfiguredOrDefaultMs(configured, defaultValue);
|
||||
// Additionally if we're a tracker or sensor, we want priority to send position and telemetry
|
||||
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_SENSOR, meshtastic_Config_DeviceConfig_Role_TRACKER))
|
||||
return getConfiguredOrDefaultMs(configured, defaultValue);
|
||||
|
||||
return getConfiguredOrDefaultMs(configured, defaultValue) * congestionScalingCoefficient(numOnlineNodes);
|
||||
return getConfiguredOrDefaultMs(configured, defaultValue) * congestionScalingCoefficient(numOnlineNodes);
|
||||
}
|
||||
|
||||
uint32_t Default::getConfiguredOrMinimumValue(uint32_t configured, uint32_t minValue) {
|
||||
// If zero, intervals should be coalesced later by getConfiguredOrDefault... methods
|
||||
if (configured == 0)
|
||||
return configured;
|
||||
uint32_t Default::getConfiguredOrMinimumValue(uint32_t configured, uint32_t minValue)
|
||||
{
|
||||
// If zero, intervals should be coalesced later by getConfiguredOrDefault... methods
|
||||
if (configured == 0)
|
||||
return configured;
|
||||
|
||||
return configured < minValue ? minValue : configured;
|
||||
return configured < minValue ? minValue : configured;
|
||||
}
|
||||
|
||||
uint8_t Default::getConfiguredOrDefaultHopLimit(uint8_t configured) {
|
||||
uint8_t Default::getConfiguredOrDefaultHopLimit(uint8_t configured)
|
||||
{
|
||||
#if USERPREFS_EVENT_MODE
|
||||
return (configured > HOP_RELIABLE) ? HOP_RELIABLE : config.lora.hop_limit;
|
||||
return (configured > HOP_RELIABLE) ? HOP_RELIABLE : config.lora.hop_limit;
|
||||
#else
|
||||
return (configured >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit;
|
||||
return (configured >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit;
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user