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:
Jeremy White
2017-10-18 02:27:55 -05:00
committed by Peter Johnson
parent 2fc60680f4
commit be77f9cb26
11 changed files with 284 additions and 0 deletions

View File

@@ -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();