mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
committed by
Peter Johnson
parent
877a9eae1f
commit
f4779379c3
@@ -22,4 +22,4 @@ void HAL_SetAccelerometerRange(HAL_AccelerometerRange range) {
|
||||
double HAL_GetAccelerometerX(void) { return SimAccelerometerData[0].GetX(); }
|
||||
double HAL_GetAccelerometerY(void) { return SimAccelerometerData[0].GetY(); }
|
||||
double HAL_GetAccelerometerZ(void) { return SimAccelerometerData[0].GetZ(); }
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -103,4 +103,4 @@ void HAL_GetAccumulatorOutput(HAL_AnalogInputHandle analogPortHandle,
|
||||
*count = SimAnalogInData[port->channel].GetAccumulatorCount();
|
||||
*value = SimAnalogInData[port->channel].GetAccumulatorValue();
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -21,7 +21,7 @@ struct AnalogGyro {
|
||||
HAL_AnalogInputHandle handle;
|
||||
uint8_t index;
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -132,4 +132,4 @@ double HAL_GetAnalogGyroOffset(HAL_GyroHandle handle, int32_t* status) {
|
||||
int32_t HAL_GetAnalogGyroCenter(HAL_GyroHandle handle, int32_t* status) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace hal {
|
||||
IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort, kNumAnalogInputs,
|
||||
HAL_HandleEnum::AnalogInput>
|
||||
analogInputHandles;
|
||||
}
|
||||
} // namespace hal
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace {
|
||||
struct AnalogOutput {
|
||||
uint8_t channel;
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
static IndexedHandleResource<HAL_AnalogOutputHandle, AnalogOutput,
|
||||
kNumAnalogOutputs, HAL_HandleEnum::AnalogOutput>
|
||||
@@ -85,4 +85,4 @@ double HAL_GetAnalogOutput(HAL_AnalogOutputHandle analogOutputHandle,
|
||||
|
||||
return SimAnalogOutData[port->channel].GetVoltage();
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -22,7 +22,7 @@ struct AnalogTrigger {
|
||||
uint8_t index;
|
||||
HAL_Bool trigState;
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -25,4 +25,4 @@ void HAL_CAN_ReadStreamSession(uint32_t sessionHandle,
|
||||
void HAL_CAN_GetCANStatus(float* percentBusUtilization, uint32_t* busOffCount,
|
||||
uint32_t* txFullCount, uint32_t* receiveErrorCount,
|
||||
uint32_t* transmitErrorCount, int32_t* status) {}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -15,4 +15,4 @@ extern "C" {
|
||||
int32_t HAL_GetSystemClockTicksPerMicrosecond(void) {
|
||||
return kSystemClockTicksPerMicrosecond;
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
|
||||
namespace hal {
|
||||
constexpr int32_t kSystemClockTicksPerMicrosecond = 40;
|
||||
}
|
||||
} // namespace hal
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace hal {
|
||||
LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
|
||||
HAL_HandleEnum::Counter>
|
||||
counterHandles;
|
||||
}
|
||||
} // namespace hal
|
||||
|
||||
extern "C" {
|
||||
HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index,
|
||||
@@ -83,4 +83,4 @@ HAL_Bool HAL_GetCounterDirection(HAL_CounterHandle counterHandle,
|
||||
void HAL_SetCounterReverseDirection(HAL_CounterHandle counterHandle,
|
||||
HAL_Bool reverseDirection,
|
||||
int32_t* status) {}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -333,4 +333,4 @@ void HAL_SetFilterPeriod(int32_t filterIndex, int64_t value, int32_t* status) {
|
||||
int64_t HAL_GetFilterPeriod(int32_t filterIndex, int32_t* status) {
|
||||
return 0; // TODO(Thad) figure this out
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -25,7 +25,7 @@ struct Encoder {
|
||||
uint8_t index;
|
||||
};
|
||||
struct Empty {};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
static LimitedHandleResource<HAL_EncoderHandle, Encoder,
|
||||
kNumEncoders + kNumCounters,
|
||||
|
||||
@@ -23,4 +23,4 @@ int32_t HAL_ReadI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* buffer,
|
||||
return 0;
|
||||
}
|
||||
void HAL_CloseI2C(HAL_I2CPort port) {}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -309,4 +309,4 @@ double HALSIM_GetAccelerometerZ(int32_t index) {
|
||||
void HALSIM_SetAccelerometerZ(int32_t index, double z) {
|
||||
SimAccelerometerData[index].SetZ(z);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -192,4 +192,4 @@ HAL_Bool HALSIM_GetAnalogGyroInitialized(int32_t index) {
|
||||
void HALSIM_SetAnalogGyroInitialized(int32_t index, HAL_Bool initialized) {
|
||||
SimAnalogGyroData[index].SetInitialized(initialized);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -550,4 +550,4 @@ void HALSIM_SetAnalogInAccumulatorDeadband(int32_t index,
|
||||
int32_t accumulatorDeadband) {
|
||||
SimAnalogInData[index].SetAccumulatorDeadband(accumulatorDeadband);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -135,4 +135,4 @@ HAL_Bool HALSIM_GetAnalogOutInitialized(int32_t index) {
|
||||
void HALSIM_SetAnalogOutInitialized(int32_t index, HAL_Bool initialized) {
|
||||
SimAnalogOutData[index].SetInitialized(initialized);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -254,4 +254,4 @@ void HALSIM_SetAnalogTriggerTriggerMode(int32_t index,
|
||||
HALSIM_AnalogTriggerMode triggerMode) {
|
||||
SimAnalogTriggerData[index].SetTriggerMode(triggerMode);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -303,4 +303,4 @@ int32_t HALSIM_GetDIOFilterIndex(int32_t index) {
|
||||
void HALSIM_SetDIOFilterIndex(int32_t index, int32_t filterIndex) {
|
||||
SimDIOData[index].SetFilterIndex(filterIndex);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -192,4 +192,4 @@ int32_t HALSIM_GetDigitalPWMPin(int32_t index) {
|
||||
void HALSIM_SetDigitalPWMPin(int32_t index, int32_t pin) {
|
||||
SimDigitalPWMData[index].SetPin(pin);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -485,4 +485,4 @@ void HALSIM_SetEncoderSamplesToAverage(int32_t index,
|
||||
int32_t samplesToAverage) {
|
||||
SimEncoderData[index].SetSamplesToAverage(samplesToAverage);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -448,4 +448,4 @@ double HALSIM_GetPCMCompressorCurrent(int32_t index) {
|
||||
void HALSIM_SetPCMCompressorCurrent(int32_t index, double compressorCurrent) {
|
||||
SimPCMData[index].SetCompressorCurrent(compressorCurrent);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -250,4 +250,4 @@ double HALSIM_GetPDPCurrent(int32_t index, int32_t channel) {
|
||||
void HALSIM_SetPDPCurrent(int32_t index, int32_t channel, double current) {
|
||||
SimPDPData[index].SetCurrent(channel, current);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -361,4 +361,4 @@ HAL_Bool HALSIM_GetPWMZeroLatch(int32_t index) {
|
||||
void HALSIM_SetPWMZeroLatch(int32_t index, HAL_Bool zeroLatch) {
|
||||
SimPWMData[index].SetZeroLatch(zeroLatch);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -251,4 +251,4 @@ HAL_Bool HALSIM_GetRelayReverse(int32_t index) {
|
||||
void HALSIM_SetRelayReverse(int32_t index, HAL_Bool reverse) {
|
||||
SimRelayData[index].SetReverse(reverse);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -887,4 +887,4 @@ int32_t HALSIM_GetRoboRioUserFaults3V3(int32_t index) {
|
||||
void HALSIM_SetRoboRioUserFaults3V3(int32_t index, int32_t userFaults3V3) {
|
||||
SimRoboRioData[index].SetUserFaults3V3(userFaults3V3);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -306,4 +306,4 @@ double HALSIM_GetSPIAccelerometerZ(int32_t index) {
|
||||
void HALSIM_SetSPIAccelerometerZ(int32_t index, double z) {
|
||||
SimSPIAccelerometerData[index].SetZ(z);
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -51,4 +51,4 @@ void HALSIM_WaitForProgramStart(void) {
|
||||
void HALSIM_SetProgramStarted(void) { SetProgramStarted(); }
|
||||
|
||||
void HALSIM_RestartTiming(void) { RestartTiming(); }
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -19,4 +19,4 @@ int64_t GetFPGATime();
|
||||
double GetFPGATimestamp();
|
||||
|
||||
void SetProgramStarted();
|
||||
}
|
||||
} // namespace hal
|
||||
|
||||
@@ -44,4 +44,4 @@ int32_t HAL_WriteOSSerial(HAL_SerialPort port, const char* buffer,
|
||||
void HAL_FlushOSSerial(HAL_SerialPort port, int32_t* status) {}
|
||||
void HAL_ClearOSSerial(HAL_SerialPort port, int32_t* status) {}
|
||||
void HAL_CloseOSSerial(HAL_SerialPort port, int32_t* status) {}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -38,4 +38,4 @@ double HAL_GetPDPTotalPower(int32_t module, int32_t* status) { return 0.0; }
|
||||
double HAL_GetPDPTotalEnergy(int32_t module, int32_t* status) { return 0.0; }
|
||||
void HAL_ResetPDPTotalEnergy(int32_t module, int32_t* status) {}
|
||||
void HAL_ClearPDPStickyFaults(int32_t module, int32_t* status) {}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -31,4 +31,4 @@ int32_t HAL_GetNumSolenoidChannels(void) { return kNumSolenoidChannels; }
|
||||
int32_t HAL_GetNumPDPModules(void) { return kNumPDPModules; }
|
||||
int32_t HAL_GetNumPDPChannels(void) { return kNumPDPChannels; }
|
||||
int32_t HAL_GetNumCanTalons(void) { return kNumCanTalons; }
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -18,7 +18,7 @@ struct Relay {
|
||||
uint8_t channel;
|
||||
bool fwd;
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
static IndexedHandleResource<HAL_RelayHandle, Relay, kNumRelayChannels,
|
||||
HAL_HandleEnum::Relay>
|
||||
|
||||
@@ -61,4 +61,4 @@ void HAL_FlushSerial(HAL_SerialPort port, int32_t* status) {}
|
||||
void HAL_ClearSerial(HAL_SerialPort port, int32_t* status) {}
|
||||
|
||||
void HAL_CloseSerial(HAL_SerialPort port, int32_t* status) {}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -18,7 +18,7 @@ struct Solenoid {
|
||||
uint8_t module;
|
||||
uint8_t channel;
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
using namespace hal;
|
||||
|
||||
@@ -117,4 +117,4 @@ HAL_Bool HAL_GetPCMSolenoidVoltageFault(int32_t module, int32_t* status) {
|
||||
return 0;
|
||||
}
|
||||
void HAL_ClearAllPCMStickyFaults(int32_t module, int32_t* status) {}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user