mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fixed C++ PWM values to be 16 bits
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user