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:
Thomas Clark
2014-07-30 11:19:50 -04:00
parent 5e8ea38465
commit 231bb55b2a

View File

@@ -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 = "";