mirror of https://github.com/ARMmbed/mbed-os.git
fix implemet pwm_write
parent
4fcffd40b1
commit
441a665302
|
@ -160,7 +160,8 @@ void pwmout_write(pwmout_t *obj, float value)
|
|||
if (value > 1.0f) {
|
||||
value = 1.0f;
|
||||
}
|
||||
uint16_t ticks = (uint16_t)((float)app_pwm_cycle_ticks_get(pwm->instance) * value);
|
||||
|
||||
app_pwm_channel_duty_set(pwm->instance, obj->pwm_channel, (app_pwm_duty_t)(value * 100.0f) );
|
||||
}
|
||||
|
||||
float pwmout_read(pwmout_t *obj)
|
||||
|
|
Loading…
Reference in New Issue