mirror of https://github.com/ARMmbed/mbed-os.git
Fix for issue #11769 (Cypress: PWM FPGA test wrong assert)
Implementation of pwmout_read() is not consistent with the requirements. This function should return the current float-point output duty-cycle in range <0.0f, 1.0f>. Currently it returns decimal percentage value.pull/11776/head
parent
419556b84a
commit
b35a6797d0
|
@ -50,7 +50,7 @@ void pwmout_write(pwmout_t *obj, float percent)
|
|||
|
||||
float pwmout_read(pwmout_t *obj)
|
||||
{
|
||||
return 100.0f * obj->width_us / obj->period_us;
|
||||
return ((float)(obj->width_us) / obj->period_us);
|
||||
}
|
||||
|
||||
void pwmout_period(pwmout_t *obj, float seconds)
|
||||
|
|
Loading…
Reference in New Issue