mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[commands] Add idle command (#5555)
This commit is contained in:
@@ -24,6 +24,10 @@ CommandPtr cmd::None() {
|
||||
return InstantCommand().ToPtr();
|
||||
}
|
||||
|
||||
CommandPtr cmd::Idle() {
|
||||
return Run([] {});
|
||||
}
|
||||
|
||||
CommandPtr cmd::RunOnce(std::function<void()> action,
|
||||
std::initializer_list<Subsystem*> requirements) {
|
||||
return InstantCommand(std::move(action), requirements).ToPtr();
|
||||
|
||||
@@ -31,6 +31,14 @@ namespace cmd {
|
||||
[[nodiscard]]
|
||||
CommandPtr None();
|
||||
|
||||
/**
|
||||
* Constructs a command that does nothing until interrupted.
|
||||
*
|
||||
* @return the command
|
||||
*/
|
||||
[[nodiscard]]
|
||||
CommandPtr Idle();
|
||||
|
||||
// Action Commands
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user