mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Merge "Use either DO PWM A or B not A and B and update javadoc to reflect 6 generators (artf3698)"
This commit is contained in:
@@ -296,8 +296,10 @@ void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) {
|
||||
// The resolution of the duty cycle drops close to the highest frequencies.
|
||||
rawDutyCycle = rawDutyCycle / pow(2.0, 4 - pwmPeriodPower);
|
||||
}
|
||||
digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status);
|
||||
digitalSystem->writePWMDutyCycleB(id, (uint8_t)rawDutyCycle, status);
|
||||
if(id < 4)
|
||||
digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status);
|
||||
else
|
||||
digitalSystem->writePWMDutyCycleB(id - 3, (uint8_t)rawDutyCycle, status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ uint32_t DigitalOutput::GetChannel()
|
||||
|
||||
/**
|
||||
* Output a single pulse on the digital output line.
|
||||
* Send a single pulse on the digital output line where the pulse diration is specified in seconds.
|
||||
* Send a single pulse on the digital output line where the pulse duration is specified in seconds.
|
||||
* Maximum pulse length is 0.0016 seconds.
|
||||
* @param length The pulselength in seconds
|
||||
*/
|
||||
@@ -131,7 +131,7 @@ void DigitalOutput::SetPWMRate(float rate)
|
||||
/**
|
||||
* Enable a PWM Output on this line.
|
||||
*
|
||||
* Allocate one of the 4 DO PWM generator resources from this module.
|
||||
* Allocate one of the 6 DO PWM generator resources from this module.
|
||||
*
|
||||
* Supply the initial duty-cycle to output so as to avoid a glitch when first starting.
|
||||
*
|
||||
@@ -162,7 +162,7 @@ void DigitalOutput::EnablePWM(float initialDutyCycle)
|
||||
/**
|
||||
* Change this line from a PWM output back to a static Digital Output line.
|
||||
*
|
||||
* Free up one of the 4 DO PWM generator resources that were in use.
|
||||
* Free up one of the 6 DO PWM generator resources that were in use.
|
||||
*/
|
||||
void DigitalOutput::DisablePWM()
|
||||
{
|
||||
|
||||
@@ -150,7 +150,7 @@ public class DigitalOutput extends DigitalSource implements LiveWindowSendable {
|
||||
/**
|
||||
* Enable a PWM Output on this line.
|
||||
*
|
||||
* Allocate one of the 4 DO PWM generator resources.
|
||||
* Allocate one of the 6 DO PWM generator resources.
|
||||
*
|
||||
* Supply the initial duty-cycle to output so as to avoid a glitch when
|
||||
* first starting.
|
||||
@@ -178,7 +178,7 @@ public class DigitalOutput extends DigitalSource implements LiveWindowSendable {
|
||||
/**
|
||||
* Change this line from a PWM output back to a static Digital Output line.
|
||||
*
|
||||
* Free up one of the 4 DO PWM generator resources that were in use.
|
||||
* Free up one of the 6 DO PWM generator resources that were in use.
|
||||
*/
|
||||
public void disablePWM() {
|
||||
if (m_pwmGenerator == null)
|
||||
|
||||
Reference in New Issue
Block a user