[wpilibc] Transition C++ classes to units::second_t (#3396)

A lot of these are breaking changes. frc::Timer was replaced with the
contents of frc2::Timer. The others were in-place argument changes or
removing deprecated non-unit overloads.
This commit is contained in:
Tyler Veness
2021-05-28 22:06:59 -07:00
committed by GitHub
parent 827b17a52b
commit e09293a15e
99 changed files with 503 additions and 790 deletions

View File

@@ -15,7 +15,6 @@
#include <hal/Types.h>
#include <units/time.h>
#include <wpi/deprecated.h>
#include <wpi/mutex.h>
namespace frc {
@@ -80,19 +79,6 @@ class Notifier {
*/
void SetHandler(std::function<void()> handler);
/**
* Register for single event notification.
*
* A timer event is queued for a single event after the specified delay.
*
* @deprecated Use unit-safe StartSingle(units::second_t delay) method
* instead.
*
* @param delay Seconds to wait before the handler is called.
*/
WPI_DEPRECATED("Use unit-safe StartSingle method instead.")
void StartSingle(double delay);
/**
* Register for single event notification.
*
@@ -102,22 +88,6 @@ class Notifier {
*/
void StartSingle(units::second_t delay);
/**
* Register for periodic event notification.
*
* A timer event is queued for periodic event notification. Each time the
* interrupt occurs, the event will be immediately requeued for the same time
* interval.
*
* @deprecated Use unit-safe StartPeriodic(units::second_t period) method
* instead
*
* @param period Period in seconds to call the handler starting one period
* after the call to this method.
*/
WPI_DEPRECATED("Use unit-safe StartPeriodic method instead.")
void StartPeriodic(double period);
/**
* Register for periodic event notification.
*
@@ -184,10 +154,10 @@ class Notifier {
std::function<void()> m_handler;
// The absolute expiration time
double m_expirationTime = 0;
units::second_t m_expirationTime = 0_s;
// The relative time (either periodic or single)
double m_period = 0;
units::second_t m_period = 0_s;
// True if this is a periodic event
bool m_periodic = false;