mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Add function that can register all the HAL callbacks at once (#646)
Since all of the callbacks issue a string identifier, it makes it possible and easy to have one function callback, and differentiate the path to take based on the string. Hooking up all the callbacks at once makes it easier for the simulator developer to know when something was added to wpilib rather than looking at the commits.
This commit is contained in:
committed by
Peter Johnson
parent
f4e2e41aaf
commit
a6e6ae41b9
@@ -361,4 +361,14 @@ HAL_Bool HALSIM_GetPWMZeroLatch(int32_t index) {
|
||||
void HALSIM_SetPWMZeroLatch(int32_t index, HAL_Bool zeroLatch) {
|
||||
SimPWMData[index].SetZeroLatch(zeroLatch);
|
||||
}
|
||||
|
||||
void HALSIM_RegisterPWMAllCallbacks(int32_t index, HAL_NotifyCallback callback,
|
||||
void* param, HAL_Bool initialNotify) {
|
||||
SimPWMData[index].RegisterInitializedCallback(callback, param, initialNotify);
|
||||
SimPWMData[index].RegisterRawValueCallback(callback, param, initialNotify);
|
||||
SimPWMData[index].RegisterSpeedCallback(callback, param, initialNotify);
|
||||
SimPWMData[index].RegisterPositionCallback(callback, param, initialNotify);
|
||||
SimPWMData[index].RegisterPeriodScaleCallback(callback, param, initialNotify);
|
||||
SimPWMData[index].RegisterZeroLatchCallback(callback, param, initialNotify);
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user