From 8984b441a014ce1902ddd9ea431aa6a6f97864f8 Mon Sep 17 00:00:00 2001 From: David Sidrane <david_s5@nscdg.com> Date: Thu, 2 Mar 2017 16:24:06 -1000 Subject: [PATCH] pwm test uses Onshot API At at a period greater than the the max Oneshot pulse width Trigger all timer's channels in Oneshot mode to fire the oneshots with updated values. --- src/systemcmds/pwm/pwm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/systemcmds/pwm/pwm.c b/src/systemcmds/pwm/pwm.c index b8fec68314..4f56ee824b 100644 --- a/src/systemcmds/pwm/pwm.c +++ b/src/systemcmds/pwm/pwm.c @@ -87,7 +87,6 @@ usage(const char *reason) "\t[-g <channel group>]\t(e.g. 0,1,2)\n" "\t[-m <channel mask> ]\t(e.g. 0xF)\n" "\t[-a]\t\t\tConfigure all outputs\n" - "\t-t <pulse>\t\tOneshot duration (1 to 65535 125nS)\n" "\n" "rate ...\t\t\tConfigure PWM rates\n" "\t[-g <channel group>]\t(e.g. 0,1,2)\n" @@ -350,7 +349,7 @@ pwm_main(int argc, char *argv[]) /* change alternate PWM rate or set oneshot */ if (oneshot || alt_rate > 0) { - ret = px4_ioctl(fd, PWM_SERVO_SET_UPDATE_RATE, alt_rate); + ret = px4_ioctl(fd, PWM_SERVO_SET_UPDATE_RATE, oneshot ? 0 : alt_rate); if (ret != OK) { PX4_ERR("PWM_SERVO_SET_UPDATE_RATE (check rate for sanity)"); -- GitLab