mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 09:06:02 +00:00
Fix static ip assignment on wifi for rp2040 (#3896)
by rearranging the arguments to match the expected input order. The lwip library makes an internal reorder or the arguments depending on the netmask to work with both ESP and Arduino platforms. The input order was incorrect when running on an rp2040 device. Co-authored-by: Henrik Witt-Hansen <henrik@hardttoolkit.org> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
4cd70f3cbd
commit
1d42a6c48f
@ -225,10 +225,16 @@ bool initWifi()
|
||||
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.setHostname(ourHost);
|
||||
|
||||
if (config.network.address_mode == meshtastic_Config_NetworkConfig_AddressMode_STATIC &&
|
||||
config.network.ipv4_config.ip != 0) {
|
||||
#ifndef ARCH_RP2040
|
||||
WiFi.config(config.network.ipv4_config.ip, config.network.ipv4_config.gateway, config.network.ipv4_config.subnet,
|
||||
config.network.ipv4_config.dns);
|
||||
#else
|
||||
WiFi.config(config.network.ipv4_config.ip, config.network.ipv4_config.dns, config.network.ipv4_config.gateway,
|
||||
config.network.ipv4_config.subnet);
|
||||
#endif
|
||||
}
|
||||
#ifndef ARCH_RP2040
|
||||
WiFi.onEvent(WiFiEvent);
|
||||
|
Loading…
Reference in New Issue
Block a user