diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c b/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c index b0b1988eeb1..6e83a81fcad 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c @@ -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)