From d21c44704d691bb47efe38b752f34941f3cd3001 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 3 Mar 2017 10:41:39 -1000 Subject: [PATCH] Propgate any errors in setting the rate up. Since the Onshot<->PWM mode is changed based on rate. The this signale the higher layers that the operation is invalid test case: fmu task mode_pwm2cap2 pwm oneshot -m 0xf -g 0 -d /dev/pwm_output0 should fail, because all the channels in the group are not in the same mode. --- src/drivers/stm32/drv_pwm_servo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/drivers/stm32/drv_pwm_servo.c b/src/drivers/stm32/drv_pwm_servo.c index 0ee9ab3b60..6d841d6fee 100644 --- a/src/drivers/stm32/drv_pwm_servo.c +++ b/src/drivers/stm32/drv_pwm_servo.c @@ -133,8 +133,7 @@ int up_pwm_servo_set_rate_group_update(unsigned group, unsigned rate) } } - io_timer_set_rate(group, rate); - return OK; + return io_timer_set_rate(group, rate); } void up_pwm_update(void)