diff --git a/hal/src/main/native/athena/HAL.cpp b/hal/src/main/native/athena/HAL.cpp index c2ed275de7..eda229af95 100644 --- a/hal/src/main/native/athena/HAL.cpp +++ b/hal/src/main/native/athena/HAL.cpp @@ -253,12 +253,10 @@ const char* HAL_GetErrorMessage(int32_t code) { } } +static HAL_RuntimeType runtimeType = HAL_Runtime_RoboRIO; + HAL_RuntimeType HAL_GetRuntimeType(void) { - nLoadOut::tTargetClass targetClass = nLoadOut::getTargetClass(); - if (targetClass == nLoadOut::kTargetClass_RoboRIO2) { - return HAL_Runtime_RoboRIO2; - } - return HAL_Runtime_RoboRIO; + return runtimeType; } int32_t HAL_GetFPGAVersion(int32_t* status) { @@ -523,6 +521,13 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) { return false; } + nLoadOut::tTargetClass targetClass = nLoadOut::getTargetClass(); + if (targetClass == nLoadOut::kTargetClass_RoboRIO2) { + runtimeType = HAL_Runtime_RoboRIO2; + } else { + runtimeType = HAL_Runtime_RoboRIO; + } + InterruptManager::Initialize(global->getSystemInterface()); hal::InitializeDriverStation();