[hal, wpilib] Load joystick values upon code initialization (#4950)

During HAL_Initialize, wait up to 100ms for a DS packet to be received. Then in RobotBase, right after calling HAL_Initialize, call each language's RefreshData function to force a high level DS update. If the DS is connected, will get joystick data. If there is no data, nothing different will happen, but in that case there's no joysticks anyway.
This commit is contained in:
Thad House
2023-01-15 16:36:44 -08:00
committed by GitHub
parent ab0e8c37a7
commit 5cb0340a8c
8 changed files with 28 additions and 10 deletions

View File

@@ -41,6 +41,7 @@ int frc::RunHALInitialization() {
std::puts("FATAL ERROR: HAL could not be initialized");
return -1;
}
DriverStation::RefreshData();
HAL_Report(HALUsageReporting::kResourceType_Language,
HALUsageReporting::kLanguage_CPlusPlus, 0, GetWPILibVersion());