Make Ultrasonic.setAuto() static (#2419)

Ultrasonic.setAuto() has static behavior and is static in C++. Tweak docs to be clear about this.
Fixes #2417
This commit is contained in:
Starlight220
2020-03-20 08:25:21 +02:00
committed by GitHub
parent 33f6bf947e
commit 56fbb1fc33

View File

@@ -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.
*
* <p>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
}