mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Make the HAL self initialize when ever any initialization function is called (#1012)
This commit is contained in:
committed by
Peter Johnson
parent
59a8e9da57
commit
e21a246a4d
@@ -7,8 +7,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace hal {
|
||||
namespace init {
|
||||
extern std::atomic_bool HAL_IsInitialized;
|
||||
extern void RunInitialize();
|
||||
static inline void CheckInit() {
|
||||
if (HAL_IsInitialized.load(std::memory_order_relaxed)) return;
|
||||
RunInitialize();
|
||||
}
|
||||
|
||||
extern void InitializeAccelerometerData();
|
||||
extern void InitializeAnalogGyroData();
|
||||
extern void InitializeAnalogInData();
|
||||
|
||||
Reference in New Issue
Block a user