WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Notifier Functions

Functions

HAL_NotifierHandle HAL_CreateNotifier (int32_t *status)
 Creates a notifier.
HAL_Bool HAL_SetNotifierThreadPriority (HAL_Bool realTime, int32_t priority, int32_t *status)
 Sets the HAL notifier thread priority.
void HAL_SetNotifierName (HAL_NotifierHandle notifierHandle, const struct WPI_String *name, int32_t *status)
 Sets the name of a notifier.
void HAL_DestroyNotifier (HAL_NotifierHandle notifierHandle)
 Destroys a notifier.
void HAL_SetNotifierAlarm (HAL_NotifierHandle notifierHandle, uint64_t alarmTime, uint64_t intervalTime, HAL_Bool absolute, HAL_Bool ack, int32_t *status)
 Updates the initial and interval alarm times for a notifier.
void HAL_CancelNotifierAlarm (HAL_NotifierHandle notifierHandle, HAL_Bool ack, int32_t *status)
 Cancels all future notifier alarms for a notifier.
void HAL_AcknowledgeNotifierAlarm (HAL_NotifierHandle notifierHandle, int32_t *status)
 Indicates the notifier alarm has been serviced.
int32_t HAL_GetNotifierOverrun (HAL_NotifierHandle notifierHandle, int32_t *status)
 Gets the overrun count for a notifier.

Detailed Description

Function Documentation

◆ HAL_AcknowledgeNotifierAlarm()

void HAL_AcknowledgeNotifierAlarm ( HAL_NotifierHandle notifierHandle,
int32_t * status )

Indicates the notifier alarm has been serviced.

Makes no change to future alarms.

One of HAL_SetNotifierAlarm (with ack=true), HAL_CancelNotifierAlarm (with ack=true), or this function must be called before waiting for the next alarm.

Parameters
[in]notifierHandlethe notifier handle
[out]statusError status variable. 0 on success.

◆ HAL_CancelNotifierAlarm()

void HAL_CancelNotifierAlarm ( HAL_NotifierHandle notifierHandle,
HAL_Bool ack,
int32_t * status )

Cancels all future notifier alarms for a notifier.

Parameters
[in]notifierHandlethe notifier handle
[in]acktrue to acknowledge any prior alarm
[out]statusError status variable. 0 on success.

◆ HAL_CreateNotifier()

HAL_NotifierHandle HAL_CreateNotifier ( int32_t * status)

Creates a notifier.

A notifier is an timer that alarms at an initial and (optionally) repeated intervals. This can be used to make precise control loops.

Parameters
[out]statusError status variable. 0 on success.
Returns
the created notifier

◆ HAL_DestroyNotifier()

void HAL_DestroyNotifier ( HAL_NotifierHandle notifierHandle)

Destroys a notifier.

Destruction wakes up any waiters.

Parameters
[in]notifierHandlethe notifier handle

◆ HAL_GetNotifierOverrun()

int32_t HAL_GetNotifierOverrun ( HAL_NotifierHandle notifierHandle,
int32_t * status )

Gets the overrun count for a notifier.

An overrun occurs when a notifier's alarm is not serviced before the next scheduled alarm time.

Parameters
[in]notifierHandlethe notifier handle
[out]statusError status variable. 0 on success.
Returns
overrun count

◆ HAL_SetNotifierAlarm()

void HAL_SetNotifierAlarm ( HAL_NotifierHandle notifierHandle,
uint64_t alarmTime,
uint64_t intervalTime,
HAL_Bool absolute,
HAL_Bool ack,
int32_t * status )

Updates the initial and interval alarm times for a notifier.

The alarmTime is an absolute time (using the WPI_Now() time base) if absolute is true, or relative to the current time if absolute is false.

If intervalTime is non-zero, the notifier will alarm periodically following alarmTime at the given interval.

If an absolute alarmTime is in the past, the notifier will alarm immediately.

Parameters
[in]notifierHandlethe notifier handle
[in]alarmTimethe first alarm time (in microseconds)
[in]intervalTimethe periodic interval time (in microseconds)
[in]absolutetrue if the alarm time is absolute
[in]acktrue to acknowledge any prior alarm
[out]statusError status variable. 0 on success.

◆ HAL_SetNotifierName()

void HAL_SetNotifierName ( HAL_NotifierHandle notifierHandle,
const struct WPI_String * name,
int32_t * status )

Sets the name of a notifier.

Parameters
[in]notifierHandlethe notifier handle
[in]namename
[out]statusError status variable. 0 on success.

◆ HAL_SetNotifierThreadPriority()

HAL_Bool HAL_SetNotifierThreadPriority ( HAL_Bool realTime,
int32_t priority,
int32_t * status )

Sets the HAL notifier thread priority.

The HAL notifier thread is responsible for managing the system's notifier interrupt and waking up user's Notifiers when it's their time to run. Giving the HAL notifier thread real-time priority helps ensure the user's real-time Notifiers, if any, are notified to run in a timely manner.

Parameters
[in]realTimeSet to true to set a real-time priority, false for standard priority.
[in]priorityPriority to set the thread to. For real-time, this is 1-99 with 99 being highest. For non-real-time, this is forced to 0. See "man 7 sched" for more details.
[out]statusError status variable. 0 on success.
Returns
True on success.