From 2ea384c0c71033ca239b51943b1321d84b39350e Mon Sep 17 00:00:00 2001 From: Richard Hirst Date: Fri, 3 Jan 2014 10:09:59 +0000 Subject: [PATCH] Oops, allow "=0" to turn off a servo output. --- ServoBlaster/user/servod.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ServoBlaster/user/servod.c b/ServoBlaster/user/servod.c index 01548c1..088bf69 100644 --- a/ServoBlaster/user/servod.c +++ b/ServoBlaster/user/servod.c @@ -758,11 +758,13 @@ parse_width(int servo, char *width_arg) width = servo_min_ticks; } - if (width < servo_min_ticks || width > servo_max_ticks) { + if (width == 0) { + return (int)width; + } else if (width < servo_min_ticks || width > servo_max_ticks) { return -1; + } else { + return (int)width; } - - return (int)width; } static void