fix #2460 - we only really need the router object after nodedb init, so lets move it there.

pull/2465/head^2
Thomas Göttgens 2023-05-04 09:55:12 +02:00
rodzic e360c62480
commit 313860c8a4
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -234,8 +234,6 @@ void setup()
fsInit();
router = new ReliableRouter();
#ifdef I2C_SDA1
Wire1.begin(I2C_SDA1, I2C_SCL1);
#endif
@ -413,6 +411,8 @@ void setup()
// If we're taking on the repeater role, use flood router
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER)
router = new FloodingRouter();
else
router = new ReliableRouter();
#if HAS_BUTTON
// Buttons. Moved here cause we need NodeDB to be initialized