pwm system command: Allow to force failsave (forcefail command)

This commit is contained in:
Lorenz Meier 2014-07-18 11:19:37 +02:00
parent 903b482378
commit 5c8c58a1e6
1 changed files with 16 additions and 0 deletions

View File

@ -635,7 +635,23 @@ pwm_main(int argc, char *argv[])
}
exit(0);
} else if (!strcmp(argv[1], "forcefail")) {
if (argc < 3) {
errx(1, "arg missing [on|off]");
} else {
if (!strcmp(argv[2], "on")) {
/* force failsafe */
ret = ioctl(fd, PWM_SERVO_SET_FORCE_FAILSAFE, 1);
} else {
/* force failsafe */
ret = ioctl(fd, PWM_SERVO_SET_FORCE_FAILSAFE, 0);
}
}
}
usage("specify arm|disarm|rate|failsafe|disarmed|min|max|test|info");
return 0;
}