[hal, wpilib] Remove DigitalSource and AnalogTrigger (#7753)

This commit is contained in:
Thad House
2025-01-30 18:58:21 -08:00
committed by GitHub
parent 7533b323d1
commit 6e704370b3
63 changed files with 7 additions and 2994 deletions

View File

@@ -1,100 +0,0 @@
// 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 "hal/AnalogTrigger.h"
#include <memory>
#include "HALInitializer.h"
#include "HALInternal.h"
#include "PortsInternal.h"
#include "hal/AnalogInput.h"
#include "hal/DutyCycle.h"
#include "hal/Errors.h"
#include "hal/handles/HandlesInternal.h"
#include "hal/handles/LimitedHandleResource.h"
using namespace hal;
namespace hal::init {
void InitializeAnalogTrigger() {}
} // namespace hal::init
extern "C" {
HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(
HAL_AnalogInputHandle portHandle, int32_t* status) {
hal::init::CheckInit();
*status = HAL_HANDLE_ERROR;
return HAL_kInvalidHandle;
}
HAL_AnalogTriggerHandle HAL_InitializeAnalogTriggerDutyCycle(
HAL_DutyCycleHandle dutyCycleHandle, int32_t* status) {
hal::init::CheckInit();
*status = HAL_HANDLE_ERROR;
return HAL_kInvalidHandle;
}
void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle) {}
void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
int32_t lower, int32_t upper,
int32_t* status) {
*status = HAL_HANDLE_ERROR;
return;
}
void HAL_SetAnalogTriggerLimitsDutyCycle(
HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
int32_t* status) {
*status = HAL_HANDLE_ERROR;
return;
}
void HAL_SetAnalogTriggerLimitsVoltage(
HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
int32_t* status) {
*status = HAL_HANDLE_ERROR;
return;
}
void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle,
HAL_Bool useAveragedValue, int32_t* status) {
*status = HAL_HANDLE_ERROR;
return;
}
void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle,
HAL_Bool useFilteredValue, int32_t* status) {
*status = HAL_HANDLE_ERROR;
return;
}
HAL_Bool HAL_GetAnalogTriggerInWindow(
HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status) {
*status = HAL_HANDLE_ERROR;
return false;
}
HAL_Bool HAL_GetAnalogTriggerTriggerState(
HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status) {
*status = HAL_HANDLE_ERROR;
return false;
}
HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle,
HAL_AnalogTriggerType type,
int32_t* status) {
*status = HAL_HANDLE_ERROR;
return false;
}
int32_t HAL_GetAnalogTriggerFPGAIndex(
HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status) {
*status = HAL_HANDLE_ERROR;
return 0;
}
} // extern "C"

View File

@@ -50,7 +50,6 @@ void InitializeHAL() {
InitializeREVPH();
InitializeAddressableLED();
InitializeAnalogInput();
InitializeAnalogTrigger();
InitializeCAN();
InitializeCANAPI();
InitializeConstants();

View File

@@ -21,7 +21,6 @@ extern void InitializeREVPH();
extern void InitializeAddressableLED();
extern void InitializeAnalogInput();
extern void InitializeAnalogInternal();
extern void InitializeAnalogTrigger();
extern void InitializeCAN();
extern void InitializeCANAPI();
extern void InitializeConstants();

View File

@@ -13,9 +13,6 @@ void InitializePorts() {}
} // namespace hal::init
extern "C" {
int32_t HAL_GetNumAnalogTriggers(void) {
return kNumAnalogTriggers;
}
int32_t HAL_GetNumAnalogInputs(void) {
return kNumAnalogInputs;
}

View File

@@ -10,7 +10,6 @@ namespace hal {
constexpr int32_t kNumSmartIo = 5;
constexpr int32_t kNumAccumulators = 0;
constexpr int32_t kNumAnalogTriggers = 0;
constexpr int32_t kNumAnalogInputs = 8;
constexpr int32_t kNumAnalogOutputs = 0;
constexpr int32_t kNumCounters = 0;

View File

@@ -1,30 +0,0 @@
// 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 "hal/simulation/AnalogTriggerData.h"
#include "hal/simulation/SimDataValue.h"
extern "C" {
int32_t HALSIM_FindAnalogTriggerForChannel(int32_t channel) {
return 0;
}
void HALSIM_ResetAnalogTriggerData(int32_t index) {}
#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, AnalogTrigger##CAPINAME, RETURN)
DEFINE_CAPI(HAL_Bool, Initialized, false)
DEFINE_CAPI(double, TriggerLowerBound, 0)
DEFINE_CAPI(double, TriggerUpperBound, 0)
DEFINE_CAPI(HALSIM_AnalogTriggerMode, TriggerMode,
HALSIM_AnalogTriggerUnassigned)
void HALSIM_RegisterAnalogTriggerAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify) {}
} // extern "C"