1
0
mirror of https://github.com/richardghirst/PiBits.git synced 2024-11-28 12:24:11 +01:00

Oops, allow "=0" to turn off a servo output.

This commit is contained in:
Richard Hirst 2014-01-03 10:09:59 +00:00
parent e603254240
commit 2ea384c0c7

View File

@ -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