Add DMA support to HAL and WPILibC (#2080)

This commit is contained in:
Thad House
2019-11-14 22:52:34 -08:00
committed by Peter Johnson
parent 8280b7e3af
commit 82b2170feb
22 changed files with 1672 additions and 2 deletions

View File

@@ -238,6 +238,19 @@ void InitializeEncoder() {
} // namespace init
} // namespace hal
namespace hal {
bool GetEncoderBaseHandle(HAL_EncoderHandle handle,
HAL_FPGAEncoderHandle* fpgaHandle,
HAL_CounterHandle* counterHandle) {
auto encoder = encoderHandles->Get(handle);
if (!handle) return false;
*fpgaHandle = encoder->m_encoder;
*counterHandle = encoder->m_counter;
return true;
}
} // namespace hal
extern "C" {
HAL_EncoderHandle HAL_InitializeEncoder(
HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA,