mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Add name to HAL Notifier
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/Notifier.h>
|
||||
#include <wpi/SmallString.h>
|
||||
|
||||
#include "frc/Timer.h"
|
||||
#include "frc/Utility.h"
|
||||
@@ -91,6 +92,13 @@ Notifier& Notifier::operator=(Notifier&& rhs) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Notifier::SetName(const wpi::Twine& name) {
|
||||
wpi::SmallString<64> nameBuf;
|
||||
int32_t status = 0;
|
||||
HAL_SetNotifierName(m_notifier,
|
||||
name.toNullTerminatedStringRef(nameBuf).data(), &status);
|
||||
}
|
||||
|
||||
void Notifier::SetHandler(std::function<void()> handler) {
|
||||
std::scoped_lock lock(m_processMutex);
|
||||
m_handler = handler;
|
||||
|
||||
Reference in New Issue
Block a user