Fixed C++ PWM values to be 16 bits

This commit is contained in:
thomasclark
2014-06-04 11:06:37 -04:00
parent 15c2798ded
commit 4c61ab4ea3
2 changed files with 4 additions and 4 deletions

View File

@@ -91,7 +91,7 @@ void DigitalModule::SetPWM(uint32_t channel, unsigned short value)
}
/**
* Get a value from a PWM channel. The values range from 0 to 255.
* Get a value from a PWM channel.
*
* @param channel The PWM channel to read from.
* @return The raw PWM value.
@@ -99,7 +99,7 @@ void DigitalModule::SetPWM(uint32_t channel, unsigned short value)
unsigned short DigitalModule::GetPWM(uint32_t channel)
{
int32_t status = 0;
uint8_t value = getPWM(m_pwm_ports[channel-1], &status);
uint16_t value = getPWM(m_pwm_ports[channel-1], &status);
wpi_setErrorWithContext(status, getHALErrorMessage(status));
return value;
}

View File

@@ -319,7 +319,7 @@ float PWM::GetSpeed()
*
* Write a raw value to a PWM channel.
*
* @param value Raw PWM value. Range 0 - 255.
* @param value Raw PWM value.
*/
void PWM::SetRaw(unsigned short value)
{
@@ -332,7 +332,7 @@ void PWM::SetRaw(unsigned short value)
*
* Read a raw value from a PWM channel.
*
* @return Raw PWM control value. Range: 0 - 255.
* @return Raw PWM control value.
*/
unsigned short PWM::GetRaw()
{