Skip to content

Commit

Permalink
Workaround for boot delay affecting 3x reboot to enter wifi / binding
Browse files Browse the repository at this point in the history
  • Loading branch information
wvarty committed Feb 23, 2022
1 parent 9f43b7a commit 907f7e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/Vrx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,12 @@ RF_PRE_INIT()

void setup()
{
// VRX module class needs to be initialised first, as it calls delay()
// for some modules that require a boot delay before being operational
vrxModule.Init();
Serial.begin(VRX_UART_BAUD);
#if !defined(HDZERO_BACKPACK)
// Serial.begin() seems to prevent the HDZ VRX from booting
// If we're not on HDZ, init serial early for debug msgs
// Otherwise, delay it till the end of setup
Serial.begin(VRX_UART_BAUD);
#endif
eeprom.Begin();
config.SetStorageProvider(&eeprom);
config.Load();
Expand Down Expand Up @@ -390,6 +392,11 @@ void setup()
{
connectionState = running;
}

vrxModule.Init();
#if defined(HDZERO_BACKPACK)
Serial.begin(VRX_UART_BAUD);
#endif
DBGLN("Setup completed");
}

Expand Down
2 changes: 1 addition & 1 deletion targets/common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_flags =
board = esp12e
board_build.ldscript = eagle.flash.1m144.ld
upload_speed = 921600
monitor_speed = 115200
monitor_speed = 460800
board_build.f_cpu = 160000000L
build_flags =
-D PLATFORM_ESP8266=1
Expand Down

0 comments on commit 907f7e7

Please sign in to comment.