From 66b28e95a7fe79331ba6cd4232b2d91153de932b Mon Sep 17 00:00:00 2001 From: Thad House Date: Fri, 30 Oct 2015 23:29:39 -0700 Subject: [PATCH] Adds new CanTalon HAL Functions to C library New functions were added to CanTalonSRX in the HAL, however they were not added to the C side of the library. Change-Id: I15197e5dce5db0f5ff207d1318c21be485c90741 --- hal/include/HAL/CanTalonSRX.h | 5 +++++ hal/lib/Athena/ctre/CanTalonSRX.cpp | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/hal/include/HAL/CanTalonSRX.h b/hal/include/HAL/CanTalonSRX.h index 3ef520dbc8..4cbff71eec 100644 --- a/hal/include/HAL/CanTalonSRX.h +++ b/hal/include/HAL/CanTalonSRX.h @@ -411,6 +411,11 @@ extern "C" { CTR_Code c_TalonSRX_SetProfileSlotSelect(void *handle, int param); CTR_Code c_TalonSRX_SetRampThrottle(void *handle, int param); CTR_Code c_TalonSRX_SetRevFeedbackSensor(void *handle, int param); + CTR_Code c_TalonSRX_GetPulseWidthPosition(void *handle, int *param); + CTR_Code c_TalonSRX_GetPulseWidthVelocity(void *handle, int *param); + CTR_Code c_TalonSRX_GetPulseWidthRiseToFallUs(void *handle, int *param); + CTR_Code c_TalonSRX_GetPulseWidthRiseToRiseUs(void *handle, int *param); + CTR_Code c_TalonSRX_IsPulseWidthSensorPresent(void *handle, int *param); } #endif diff --git a/hal/lib/Athena/ctre/CanTalonSRX.cpp b/hal/lib/Athena/ctre/CanTalonSRX.cpp index 5fe551840f..56e68e1ec1 100644 --- a/hal/lib/Athena/ctre/CanTalonSRX.cpp +++ b/hal/lib/Athena/ctre/CanTalonSRX.cpp @@ -1394,4 +1394,24 @@ CTR_Code c_TalonSRX_SetRevFeedbackSensor(void *handle, int param) { return ((CanTalonSRX*)handle)->SetRevFeedbackSensor(param); } +CTR_Code c_TalonSRX_GetPulseWidthPosition(void *handle, int *param) +{ + return ((CanTalonSRX*)handle)->GetPulseWidthPosition(*param); +} +CTR_Code c_TalonSRX_GetPulseWidthVelocity(void *handle, int *param) +{ + return ((CanTalonSRX*)handle)->GetPulseWidthVelocity(*param); +} +CTR_Code c_TalonSRX_GetPulseWidthRiseToFallUs(void *handle, int *param) +{ + return ((CanTalonSRX*)handle)->GetPulseWidthRiseToFallUs(*param); +} +CTR_Code c_TalonSRX_GetPulseWidthRiseToRiseUs(void *handle, int *param) +{ + return ((CanTalonSRX*)handle)->GetPulseWidthRiseToRiseUs(*param); +} +CTR_Code c_TalonSRX_IsPulseWidthSensorPresent(void *handle, int *param) +{ + return ((CanTalonSRX*)handle)->IsPulseWidthSensorPresent(*param); +} }