Start using the new FRC compiler define (#797)

Remove all definitions from the MockData headers when in simulation mode.
Add a constexpr IsReal and IsSimulation in RobotBase.
This commit is contained in:
Thad House
2017-12-08 22:47:21 -08:00
committed by Peter Johnson
parent b42285fddd
commit aa4f0ef4f8
24 changed files with 102 additions and 0 deletions

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -63,3 +65,5 @@ void HALSIM_RegisterAccelerometerAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -45,3 +47,5 @@ void HALSIM_RegisterAnalogGyroAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -95,3 +97,5 @@ void HALSIM_RegisterAnalogInAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -38,3 +40,5 @@ void HALSIM_RegisterAnalogOutAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -62,3 +64,5 @@ void HALSIM_RegisterAnalogTriggerAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "HAL_Value.h"
#include "NotifyListener.h"
@@ -72,3 +74,5 @@ void HALSIM_CancelCanGetCANStatusCallback(int32_t uid);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -59,3 +61,5 @@ void HALSIM_RegisterDIOAllCallbacks(int32_t index, HAL_NotifyCallback callback,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -45,3 +47,5 @@ void HALSIM_RegisterDigitalPWMAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/DriverStation.h"
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -93,3 +95,5 @@ void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -85,3 +87,5 @@ void HALSIM_RegisterEncoderAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/Types.h"
/** HAL data types. */
@@ -65,3 +67,5 @@ inline HAL_Value MakeDouble(double v) {
value.data.v_double = v;
return value;
}
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -37,3 +39,5 @@ void HALSIM_CancelI2CWriteCallback(int32_t index, int32_t uid);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,8 +7,12 @@
#pragma once
#ifndef __FRC_ROBORIO__
extern "C" {
void HALSIM_WaitForProgramStart(void);
void HALSIM_SetProgramStarted(void);
void HALSIM_RestartTiming(void);
} // extern "C"
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include <memory>
#include "MockData/NotifyListenerVector.h"
@@ -65,3 +67,5 @@ std::shared_ptr<hal::ConstBufferListenerVector> CancelCallback(
void InvokeCallback(
std::shared_ptr<hal::ConstBufferListenerVector> currentVector,
const char* name, const uint8_t* buffer, int32_t count);
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL_Value.h"
typedef void (*HAL_NotifyCallback)(const char* name, void* param,
@@ -34,3 +36,5 @@ struct HalCallbackListener {
};
} // namespace hal
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include <memory>
#include <queue>
#include <vector>
@@ -136,3 +138,5 @@ typedef HalCallbackListenerVectorImpl<HAL_ConstBufferCallback>
ConstBufferListenerVector;
} // namespace hal
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -87,3 +89,5 @@ void HALSIM_RegisterPCMAllSolenoidCallbacks(int32_t index, int32_t channel,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -54,3 +56,5 @@ void HALSIM_RegisterPDPAllNonCurrentCallbacks(int32_t index, int32_t channel,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -66,3 +68,5 @@ void HALSIM_RegisterPWMAllCallbacks(int32_t index, HAL_NotifyCallback callback,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -54,3 +56,5 @@ void HALSIM_RegisterRelayAllCallcbaks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -140,3 +142,5 @@ void HALSIM_RegisterRoboRioAllCallbacks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -61,3 +63,5 @@ void HALSIM_RegisterSPIAccelerometerAllCallbcaks(int32_t index,
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifndef __FRC_ROBORIO__
#include "HAL/HAL.h"
#include "NotifyListener.h"
@@ -50,3 +52,5 @@ int64_t HALSIM_GetSPIGetAccumulatorValue(int32_t index);
#ifdef __cplusplus
} // extern "C"
#endif
#endif