From 56fbb1fc332a5b2cdf9183cd20991b8ec7b89597 Mon Sep 17 00:00:00 2001 From: Starlight220 <53231611+Starlight220@users.noreply.github.com> Date: Fri, 20 Mar 2020 08:25:21 +0200 Subject: [PATCH] Make Ultrasonic.setAuto() static (#2419) Ultrasonic.setAuto() has static behavior and is static in C++. Tweak docs to be clear about this. Fixes #2417 --- .../main/java/edu/wpi/first/wpilibj/Ultrasonic.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Ultrasonic.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Ultrasonic.java index db7454ab2f..0e14c962e3 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Ultrasonic.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Ultrasonic.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -239,8 +239,10 @@ public class Ultrasonic implements PIDSource, Sendable, AutoCloseable { } /** - * Turn Automatic mode on/off. When in Automatic mode, all sensors will fire in round robin, - * waiting a set time between each sensor. + * Turn Automatic mode on/off for all sensors. + * + *

When in Automatic mode, all sensors will fire in round robin, waiting a set time between + * each sensor. * * @param enabling Set to true if round robin scheduling should start for all the ultrasonic * sensors. This scheduling method assures that the sensors are non-interfering @@ -248,7 +250,7 @@ public class Ultrasonic implements PIDSource, Sendable, AutoCloseable { * is preferred, it can be implemented by pinging the sensors manually and waiting * for the results to come back. */ - public void setAutomaticMode(boolean enabling) { + public static void setAutomaticMode(boolean enabling) { if (enabling == m_automaticEnabled) { return; // ignore the case of no change }