mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user