mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Simulate ADX* family of accelerometers and gyros (#688)
This commit is contained in:
committed by
Peter Johnson
parent
cd1dbb1e3a
commit
303c259b89
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "AccelerometerDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "AnalogGyroDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "AnalogInDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "AnalogOutDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "AnalogTriggerDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "DIODataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "DigitalPWMDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "DriverStationDataInternal.h"
|
||||
#include "HAL/cpp/make_unique.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
namespace hal {
|
||||
struct JoystickOutputStore {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "EncoderDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "I2CDataInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
#include "PCMDataInternal.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
#include "PDPDataInternal.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
#include "PWMDataInternal.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
#include "RelayDataInternal.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
#include "RoboRioDataInternal.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
#include "SPIAccelerometerDataInternal.h"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "../PortsInternal.h"
|
||||
#include "NotifyCallbackHelpers.h"
|
||||
#include "MockData/NotifyCallbackHelpers.h"
|
||||
#include "SPIDataInternal.h"
|
||||
|
||||
using namespace hal;
|
||||
@@ -178,6 +178,9 @@ int32_t SPIData::Write(const uint8_t* dataToSend, int32_t sendSize) {
|
||||
int32_t SPIData::Transaction(const uint8_t* dataToSend, uint8_t* dataReceived,
|
||||
int32_t size) {
|
||||
std::lock_guard<wpi::mutex> lock(m_dataMutex);
|
||||
InvokeCallback(m_writeCallbacks, "Write", dataToSend, size);
|
||||
InvokeCallback(m_readCallbacks, "Read", dataReceived, size);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user