Make the HAL self initialize when ever any initialization function is called (#1012)

This commit is contained in:
Thad House
2018-05-13 22:02:47 -07:00
committed by Peter Johnson
parent 59a8e9da57
commit e21a246a4d
50 changed files with 149 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
#include "HAL/Ports.h"
#include "HAL/handles/HandlesInternal.h"
#include "HAL/handles/IndexedHandleResource.h"
#include "HALInitializer.h"
#include "PCMInternal.h"
#include "PortsInternal.h"
#include "ctre/PCM.h"
@@ -49,6 +50,7 @@ extern "C" {
HAL_SolenoidHandle HAL_InitializeSolenoidPort(HAL_PortHandle portHandle,
int32_t* status) {
hal::init::CheckInit();
int16_t channel = getPortHandleChannel(portHandle);
int16_t module = getPortHandleModule(portHandle);
if (channel == InvalidHandleIndex) {