mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Switches HAL to manual instead of static initialization (#824)
Only athena. Will fix a whole lot of init issues.
This commit is contained in:
committed by
Peter Johnson
parent
1fa0adb091
commit
8bd48d6c34
@@ -21,8 +21,8 @@ wpi::mutex analogRegisterWindowMutex;
|
||||
std::unique_ptr<tAI> analogInputSystem;
|
||||
std::unique_ptr<tAO> analogOutputSystem;
|
||||
|
||||
IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort, kNumAnalogInputs,
|
||||
HAL_HandleEnum::AnalogInput>
|
||||
IndexedHandleResource<HAL_AnalogInputHandle, ::hal::AnalogPort,
|
||||
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>*
|
||||
analogInputHandles;
|
||||
|
||||
static int32_t analogNumChannelsToActivate = 0;
|
||||
@@ -31,6 +31,15 @@ static std::atomic<bool> analogSystemInitialized{false};
|
||||
|
||||
bool analogSampleRateSet = false;
|
||||
|
||||
namespace init {
|
||||
void InitializeAnalogInternal() {
|
||||
static IndexedHandleResource<HAL_AnalogInputHandle, ::hal::AnalogPort,
|
||||
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>
|
||||
alH;
|
||||
analogInputHandles = &alH;
|
||||
}
|
||||
} // namespace init
|
||||
|
||||
/**
|
||||
* Initialize the analog System.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user