Change hal sim to use spinlocks (#1291)

This makes callback registration completely thread safe.

This patch also uses templates and macros to dramatically reduce the amount of
manual boilerplate.
This commit is contained in:
Peter Johnson
2018-09-03 16:08:07 -07:00
committed by GitHub
parent 67b1c85315
commit c0ff6198b3
65 changed files with 1305 additions and 7639 deletions

View File

@@ -7,6 +7,7 @@
#include "hal/HAL.h"
#include <wpi/mutex.h>
#include <wpi/raw_ostream.h>
#include "ErrorsInternal.h"
@@ -213,7 +214,7 @@ int64_t HAL_GetFPGARevision(int32_t* status) {
uint64_t HAL_GetFPGATime(int32_t* status) { return hal::GetFPGATime(); }
HAL_Bool HAL_GetFPGAButton(int32_t* status) {
return SimRoboRioData[0].GetFPGAButton();
return SimRoboRioData[0].fpgaButton;
}
HAL_Bool HAL_GetSystemActive(int32_t* status) {