diff --git a/hal/src/main/native/athena/mockdata/Reset.cpp b/hal/src/main/native/athena/mockdata/Reset.cpp new file mode 100644 index 0000000000..7cbeea36d7 --- /dev/null +++ b/hal/src/main/native/athena/mockdata/Reset.cpp @@ -0,0 +1,5 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +extern "C" void HALSIM_ResetAllSimData(void) {} diff --git a/hal/src/main/native/include/hal/simulation/Reset.h b/hal/src/main/native/include/hal/simulation/Reset.h new file mode 100644 index 0000000000..447321c4e6 --- /dev/null +++ b/hal/src/main/native/include/hal/simulation/Reset.h @@ -0,0 +1,7 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +extern "C" void HALSIM_ResetAllSimData(void); diff --git a/hal/src/main/native/sim/mockdata/Reset.cpp b/hal/src/main/native/sim/mockdata/Reset.cpp new file mode 100644 index 0000000000..bb8397321b --- /dev/null +++ b/hal/src/main/native/sim/mockdata/Reset.cpp @@ -0,0 +1,109 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../PortsInternal.h" + +extern "C" void HALSIM_ResetAllSimData(void) { + for (int32_t i = 0; i < hal::kAccelerometers; i++) { + HALSIM_ResetAccelerometerData(i); + } + + for (int32_t i = 0; i < hal::kNumAddressableLEDs; i++) { + HALSIM_ResetAddressableLEDData(i); + } + + for (int32_t i = 0; i < hal::kNumAccumulators; i++) { + HALSIM_ResetAnalogGyroData(i); + } + + for (int32_t i = 0; i < hal::kNumAnalogInputs; i++) { + HALSIM_ResetAnalogInData(i); + } + + for (int32_t i = 0; i < hal::kNumAnalogOutputs; i++) { + HALSIM_ResetAnalogOutData(i); + } + + for (int32_t i = 0; i < hal::kNumAnalogTriggers; i++) { + HALSIM_ResetAnalogTriggerData(i); + } + + HALSIM_ResetCanData(); + + for (int32_t i = 0; i < hal::kNumCTREPCMModules; i++) { + HALSIM_ResetCTREPCMData(i); + } + + for (int32_t i = 0; i < hal::kNumDigitalPWMOutputs; i++) { + HALSIM_ResetDigitalPWMData(i); + } + + for (int32_t i = 0; i < hal::kNumDigitalChannels; i++) { + HALSIM_ResetDIOData(i); + } + + HALSIM_ResetDriverStationData(); + + for (int32_t i = 0; i < hal::kNumDutyCycles; i++) { + HALSIM_ResetDutyCycleData(i); + } + + for (int32_t i = 0; i < hal::kNumEncoders; i++) { + HALSIM_ResetEncoderData(i); + } + + for (int32_t i = 0; i < hal::kI2CPorts; i++) { + HALSIM_ResetI2CData(i); + } + + for (int32_t i = 0; i < hal::kNumPDSimModules; i++) { + HALSIM_ResetPowerDistributionData(i); + } + + for (int32_t i = 0; i < hal::kNumPWMChannels; i++) { + HALSIM_ResetPWMData(i); + } + + for (int32_t i = 0; i < hal::kNumRelayHeaders; i++) { + HALSIM_ResetRelayData(i); + } + + for (int32_t i = 0; i < hal::kNumREVPHModules; i++) { + HALSIM_ResetREVPHData(i); + } + + HALSIM_ResetRoboRioData(); + HALSIM_ResetSimDeviceData(); + + for (int32_t i = 0; i < hal::kSPIAccelerometers; i++) { + HALSIM_ResetSPIAccelerometerData(i); + } + + for (int32_t i = 0; i < hal::kSPIPorts; i++) { + HALSIM_ResetSPIData(i); + } +}