mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Squashed commit of the following:
commit a3ccfab0a42414aa169792356bfc47ee8d0d2d7b Author: Kevin O'Connor <koconnor@usfirst.org> Date: Tue Sep 23 13:56:59 2014 -0400 Implement zero latch (used to reduce brownout latency) in Java Change-Id: I3bf4ffbf20cf3d8a42da4fa1755b4306c49ede34 commit 0af37dfcc0d1172974519c44126973c302385d55 Author: Kevin O'Connor <koconnor@usfirst.org> Date: Tue Sep 23 13:03:07 2014 -0400 Implement zero latch (used to improve brownout latency) in C++ Change-Id: I62bedd1af65d367c32e2ab0b5a4fc679776eecb5 Change-Id: Ic27f37a9ab45aad82c1f7154d4edfbccfaa19229
This commit is contained in:
@@ -26,6 +26,7 @@ void Jaguar::InitJaguar()
|
||||
SetBounds(2.31, 1.55, 1.507, 1.454, .697);
|
||||
SetPeriodMultiplier(kPeriodMultiplier_1X);
|
||||
SetRaw(m_centerPwm);
|
||||
SetZeroLatch();
|
||||
|
||||
HALReport(HALUsageReporting::kResourceType_Jaguar, GetChannel());
|
||||
LiveWindow::GetInstance()->AddActuator("Jaguar", GetChannel(), this);
|
||||
|
||||
@@ -352,6 +352,16 @@ void PWM::SetPeriodMultiplier(PeriodMultiplier mult)
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
}
|
||||
|
||||
void PWM::SetZeroLatch()
|
||||
{
|
||||
if (StatusIsFatal()) return;
|
||||
|
||||
int32_t status = 0;
|
||||
|
||||
latchPWMZero(m_pwm_ports[m_channel], &status);
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
}
|
||||
|
||||
|
||||
void PWM::ValueChanged(ITable* source, const std::string& key, EntryValue value, bool isNew) {
|
||||
SetSpeed(value.f);
|
||||
|
||||
@@ -27,6 +27,7 @@ void Talon::InitTalon() {
|
||||
SetBounds(2.037, 1.539, 1.513, 1.487, .989);
|
||||
SetPeriodMultiplier(kPeriodMultiplier_2X);
|
||||
SetRaw(m_centerPwm);
|
||||
SetZeroLatch();
|
||||
|
||||
HALReport(HALUsageReporting::kResourceType_Talon, GetChannel());
|
||||
LiveWindow::GetInstance()->AddActuator("Talon", GetChannel(), this);
|
||||
|
||||
@@ -29,6 +29,7 @@ void Victor::InitVictor() {
|
||||
|
||||
SetPeriodMultiplier(kPeriodMultiplier_2X);
|
||||
SetRaw(m_centerPwm);
|
||||
SetZeroLatch();
|
||||
|
||||
LiveWindow::GetInstance()->AddActuator("Victor", GetChannel(), this);
|
||||
HALReport(HALUsageReporting::kResourceType_Victor, GetChannel());
|
||||
|
||||
Reference in New Issue
Block a user