mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Adds port constants to the HAL (#130)
This commit is contained in:
committed by
Peter Johnson
parent
0e127679c1
commit
b45e0917ae
@@ -10,13 +10,14 @@
|
||||
#include "ChipObject.h"
|
||||
#include "HAL/AnalogInput.h"
|
||||
#include "HAL/cpp/priority_mutex.h"
|
||||
#include "PortsInternal.h"
|
||||
|
||||
namespace hal {
|
||||
priority_recursive_mutex analogRegisterWindowMutex;
|
||||
tAI* analogInputSystem = nullptr;
|
||||
tAO* analogOutputSystem = nullptr;
|
||||
|
||||
IndexedHandleResource<HalAnalogInputHandle, hal::AnalogPort, kAnalogInputPins,
|
||||
IndexedHandleResource<HalAnalogInputHandle, hal::AnalogPort, kNumAnalogInputs,
|
||||
HalHandleEnum::AnalogInput>
|
||||
analogInputHandles;
|
||||
|
||||
@@ -32,7 +33,7 @@ void initializeAnalog(int32_t* status) {
|
||||
if (analogSystemInitialized) return;
|
||||
analogInputSystem = tAI::create(status);
|
||||
analogOutputSystem = tAO::create(status);
|
||||
setAnalogNumChannelsToActivate(kAnalogInputPins);
|
||||
setAnalogNumChannelsToActivate(kNumAnalogInputs);
|
||||
setAnalogSampleRate(kDefaultSampleRate, status);
|
||||
analogSystemInitialized = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user