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:
PJ Reiniger
2017-10-22 01:45:41 -04:00
committed by Peter Johnson
parent f4e2e41aaf
commit a6e6ae41b9
30 changed files with 301 additions and 0 deletions

View File

@@ -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"