mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Removes statics from hal sim (#825)
Based off of #824, the equivelent in sim.
This commit is contained in:
committed by
Peter Johnson
parent
8bd48d6c34
commit
d2e7a90f41
@@ -15,12 +15,19 @@
|
||||
|
||||
namespace hal {
|
||||
|
||||
bool digitalSystemsInitialized = false;
|
||||
|
||||
DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
|
||||
kNumDigitalChannels + kNumPWMHeaders>
|
||||
kNumDigitalChannels + kNumPWMHeaders>*
|
||||
digitalChannelHandles;
|
||||
|
||||
namespace init {
|
||||
void InitializeDigitalInternal() {
|
||||
static DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
|
||||
kNumDigitalChannels + kNumPWMHeaders>
|
||||
dcH;
|
||||
digitalChannelHandles = &dcH;
|
||||
}
|
||||
} // namespace init
|
||||
|
||||
/**
|
||||
* Map DIO channel numbers from their physical number (10 to 26) to their
|
||||
* position in the bit field.
|
||||
@@ -69,7 +76,7 @@ bool remapDigitalSource(HAL_Handle digitalSourceHandle,
|
||||
}
|
||||
|
||||
int32_t GetDigitalInputChannel(HAL_DigitalHandle handle, int32_t* status) {
|
||||
auto digital = digitalChannelHandles.Get(handle, HAL_HandleEnum::DIO);
|
||||
auto digital = digitalChannelHandles->Get(handle, HAL_HandleEnum::DIO);
|
||||
if (digital == nullptr) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user