Skip to content

Commit bdb9195

Browse files
committed
Update pin validation to avoid compiler warning
1 parent c3cfbcf commit bdb9195

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ur_controllers/src/gpio_controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ bool GPIOController::setAnalogOutput(ur_msgs::srv::SetAnalogOutput::Request::Sha
407407
return false;
408408
}
409409

410-
if (req->data.pin < 0 || req->data.pin > 1) {
410+
if (!(req->data.pin == 0 || req->data.pin == 1)) {
411411
RCLCPP_ERROR(get_node()->get_logger(), "Invalid pin selected. Only pins 0 and 1 are allowed.");
412412
resp->success = false;
413413
return false;

0 commit comments

Comments
 (0)