mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user