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
Przemyslaw Stekiel 2019-10-30 15:26:56 +01:00
parent 419556b84a
commit b35a6797d0
1 changed files with 1 additions and 1 deletions

View File

@ -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)