mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
HALInitialize should be the first thing called
Constructing a new HardwareTimer before HALInitialize is called causes segfaults sometimes in user programs, since getFPGATime assumes that the tGlobal objected was constructed. This problem did not appear in integration tests, where the calls were in the correct order. Change-Id: I95471e9e8ad7bc5d48a65893856089e35c0b091a
This commit is contained in:
@@ -161,15 +161,15 @@ public abstract class RobotBase {
|
||||
*/
|
||||
public static void main(String args[]) {
|
||||
boolean errorOnExit = false;
|
||||
|
||||
|
||||
FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationReserve();
|
||||
FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationObserveUserProgramStarting();
|
||||
|
||||
// Set some implementations so that the static methods work properly
|
||||
Timer.SetImplementation(new HardwareTimer());
|
||||
HLUsageReporting.SetImplementation(new HardwareHLUsageReporting());
|
||||
RobotState.SetImplementation(DriverStation.getInstance());
|
||||
|
||||
FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationReserve();
|
||||
FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationObserveUserProgramStarting();
|
||||
|
||||
UsageReporting.report(tResourceType.kResourceType_Language, tInstances.kLanguage_Java);
|
||||
|
||||
String robotName = "";
|
||||
|
||||
Reference in New Issue
Block a user