[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

@@ -5,7 +5,6 @@
#include "DigitalInternal.h"
#include "PortsInternal.h"
#include "hal/AnalogTrigger.h"
#include "hal/Errors.h"
#include "hal/handles/DigitalHandleResource.h"
#include "hal/handles/HandlesInternal.h"
@@ -25,33 +24,6 @@ void InitializeDigitalInternal() {
}
} // namespace init
bool remapDigitalSource(HAL_Handle digitalSourceHandle,
HAL_AnalogTriggerType analogTriggerType,
uint8_t& channel, uint8_t& module,
bool& analogTrigger) {
if (isHandleType(digitalSourceHandle, HAL_HandleEnum::AnalogTrigger)) {
// If handle passed, index is not negative
int32_t index = getHandleIndex(digitalSourceHandle);
channel = (index << 2) + analogTriggerType;
module = channel >> 4;
analogTrigger = true;
return true;
} else if (isHandleType(digitalSourceHandle, HAL_HandleEnum::DIO)) {
int32_t index = getHandleIndex(digitalSourceHandle);
if (index >= kNumDigitalHeaders) {
channel = remapMXPChannel(index);
module = 1;
} else {
channel = index;
module = 0;
}
analogTrigger = false;
return true;
} else {
return false;
}
}
int32_t remapMXPChannel(int32_t channel) {
return channel - 10;
}