mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Pull request for the Extensions interface only (#655)
* Modify halsim to be able to load extension libraries if they are available. It will read the list of libraries to try from the HALSIM_EXTENSIONS environment variable. Multiple libraries can be given if separated by ';' (Windows) or ':' (Unix). The library must have an 'HALSIM_InitExtension' method that returns >= 0 on success. The library is expected to use the interface expressed by hal/src/src/main/native/include/MockData * Add a simple halsim library that just prints robot values. This makes a good test bed for cross platform purposes, and provides the ultimate in light weight simulators. This initial version only prints PWM values.
This commit is contained in:
committed by
Peter Johnson
parent
2fc60680f4
commit
be77f9cb26
@@ -10,6 +10,7 @@
|
||||
#include "ErrorsInternal.h"
|
||||
#include "HAL/DriverStation.h"
|
||||
#include "HAL/Errors.h"
|
||||
#include "HAL/Extensions.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "MockData/RoboRioDataInternal.h"
|
||||
#include "MockHooksInternal.h"
|
||||
@@ -203,6 +204,7 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) {
|
||||
// Second check in case another thread was waiting
|
||||
if (initialized) return true;
|
||||
|
||||
if (HAL_LoadExtensions() < 0) return false;
|
||||
hal::RestartTiming();
|
||||
HAL_InitializeDriverStation();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user