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
@@ -135,4 +135,13 @@ HAL_Bool HALSIM_GetAnalogOutInitialized(int32_t index) {
|
||||
void HALSIM_SetAnalogOutInitialized(int32_t index, HAL_Bool initialized) {
|
||||
SimAnalogOutData[index].SetInitialized(initialized);
|
||||
}
|
||||
|
||||
void HALSIM_RegisterAnalogOutAllCallbacks(int32_t index,
|
||||
HAL_NotifyCallback callback,
|
||||
void* param, HAL_Bool initialNotify) {
|
||||
SimAnalogOutData[index].RegisterVoltageCallback(callback, param,
|
||||
initialNotify);
|
||||
SimAnalogOutData[index].RegisterInitializedCallback(callback, param,
|
||||
initialNotify);
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user