mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
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.
This commit is contained in:
committed by
Lorenz Meier
parent
6dc3b1cac6
commit
8984b441a0
@@ -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)");
|
||||
|
||||
Reference in New Issue
Block a user