Merge branch 'master' into neighborinfo

This commit is contained in:
Ben Meadors 2023-06-06 19:29:59 -05:00 committed by GitHub
commit 5c438ae792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 5 deletions

View File

@ -40,10 +40,12 @@ body:
- T-Echo
- Rak4631
- Rak11200
- Rak11310
- Heltec v1
- Heltec v2
- Heltec v2.1
- Heltec V3
- Raspberry Pi Pico (W)
- Relay v1
- Relay v2
- DIY

View File

@ -7,7 +7,8 @@
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
- Please do not check in files that don't have real changes
- Please do not reformat lines that you didn't have to change the code on
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor and the 'clang-format' extension,
because automatically follows our indentation rules and it's auto reformatting will not cause spurious changes to lines.
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor along with the ['Trunk Check' extension](https://marketplace.visualstudio.com/items?itemName=trunk.io) (WSL2 is required on windows),
because it automatically follows our indentation rules and its auto reformatting will not cause spurious changes to lines.
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
- If your other co-developers have comments on your PR please tweak as needed.
- Please also enable "Allow edits by maintainers".

View File

@ -232,7 +232,8 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr)
delay = random(0, 2 * CWsize) * slotTimeMsec;
LOG_DEBUG("rx_snr found in packet. As a router, setting tx delay:%d\n", delay);
} else {
delay = random(0, pow(2, CWsize)) * slotTimeMsec;
// offset the maximum delay for routers: (2 * CWmax * slotTimeMsec)
delay = (2 * CWmax * slotTimeMsec) + random(0, pow(2, CWsize)) * slotTimeMsec;
LOG_DEBUG("rx_snr found in packet. Setting tx delay:%d\n", delay);
}

View File

@ -98,6 +98,11 @@ static int32_t reconnectETH()
return 5000; // every 5 seconds
}
static uint32_t bigToLittleEndian(uint32_t value)
{
return ((value >> 24) & 0xFF) | ((value >> 8) & 0xFF00) | ((value << 8) & 0xFF0000) | ((value << 24) & 0xFF000000);
}
// Startup Ethernet
bool initEthernet()
{
@ -126,7 +131,15 @@ bool initEthernet()
status = Ethernet.begin(mac);
} else if (config.network.address_mode == meshtastic_Config_NetworkConfig_AddressMode_STATIC) {
LOG_INFO("starting Ethernet Static\n");
Ethernet.begin(mac, config.network.ipv4_config.ip, config.network.ipv4_config.dns, config.network.ipv4_config.subnet);
IPAddress ip = IPAddress(bigToLittleEndian(config.network.ipv4_config.ip));
IPAddress dns = IPAddress(bigToLittleEndian(config.network.ipv4_config.dns));
IPAddress gateway = IPAddress(bigToLittleEndian(config.network.ipv4_config.gateway));
IPAddress subnet = IPAddress(bigToLittleEndian(config.network.ipv4_config.subnet));
Ethernet.begin(mac, ip, dns, gateway, subnet);
status = 1;
} else {
LOG_INFO("Ethernet Disabled\n");
return false;

View File

@ -1,4 +1,4 @@
[VERSION]
major = 2
minor = 1
build = 15
build = 16