Update allwpilib and CTRE Phoenix6 libraries
Notes:
* Ran into https://github.com/CrossTheRoadElec/Phoenix-Releases/issues/55
* Some HAL functions changed names/units: https://github.com/wpilibsuite/allwpilib/pull/5283
Tested on third robot; confirmed that CAN drivetrain motors worked (both
in terms of reporting position & enabling/running). Also checked:
* Joysticks work.
* Auto/Teleop modes work.
* Red/blue alliance setting wrks.
* Quadrature encoders and PWM pulse width reading works.
Remaining thing to check when we can:
* That PWM outputs work.
* That reading potentiometers works.
* More rigorous timing investigations.
Change-Id: Idc4ff798c644f1c0e9c0fc74156a3ea1447872e8
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/wpilib/ahal/PWM.cc b/frc971/wpilib/ahal/PWM.cc
index 3c42bc4..72219aa 100644
--- a/frc971/wpilib/ahal/PWM.cc
+++ b/frc971/wpilib/ahal/PWM.cc
@@ -103,8 +103,9 @@
void PWM::SetBounds(double max, double deadbandMax, double center,
double deadbandMin, double min) {
int32_t status = 0;
- HAL_SetPWMConfig(m_handle, max, deadbandMax, center, deadbandMin, min,
- &status);
+ HAL_SetPWMConfigMicroseconds(m_handle, max * 1000.0, deadbandMax * 1000.0,
+ center * 1000.0, deadbandMin * 1000.0,
+ min * 1000.0, &status);
HAL_CHECK_STATUS(status);
}
@@ -124,8 +125,9 @@
void PWM::SetRawBounds(int max, int deadbandMax, int center, int deadbandMin,
int min) {
int32_t status = 0;
- HAL_SetPWMConfigRaw(m_handle, max, deadbandMax, center, deadbandMin, min,
- &status);
+ HAL_SetPWMConfigMicroseconds(m_handle, max * 1000, deadbandMax * 1000,
+ center * 1000, deadbandMin * 1000, min * 1000,
+ &status);
HAL_CHECK_STATUS(status);
}
@@ -136,6 +138,8 @@
* controller. The values determine the upper and lower speeds as well as the
* deadband bracket.
*
+ * Values in microseconds.
+ *
* @param max The Minimum pwm value
* @param deadbandMax The high end of the deadband range
* @param center The center speed (off)
@@ -145,8 +149,8 @@
void PWM::GetRawBounds(int *max, int *deadbandMax, int *center,
int *deadbandMin, int *min) {
int32_t status = 0;
- HAL_GetPWMConfigRaw(m_handle, max, deadbandMax, center, deadbandMin, min,
- &status);
+ HAL_GetPWMConfigMicroseconds(m_handle, max, deadbandMax, center, deadbandMin,
+ min, &status);
HAL_CHECK_STATUS(status);
}
@@ -230,7 +234,7 @@
*/
void PWM::SetRaw(uint16_t value) {
int32_t status = 0;
- HAL_SetPWMRaw(m_handle, value, &status);
+ HAL_SetPWMPulseTimeMicroseconds(m_handle, value, &status);
HAL_CHECK_STATUS(status);
}
@@ -243,7 +247,7 @@
*/
uint16_t PWM::GetRaw() const {
int32_t status = 0;
- uint16_t value = HAL_GetPWMRaw(m_handle, &status);
+ uint16_t value = HAL_GetPWMPulseTimeMicroseconds(m_handle, &status);
HAL_CHECK_STATUS(status);
return value;