mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[hal] Rename kAddressableLEDLength to all caps
This commit is contained in:
@@ -79,13 +79,13 @@ void HAL_SetAddressableLEDStart(HAL_AddressableLEDHandle handle, int32_t start,
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
}
|
||||
if (start > HAL_kAddressableLEDMaxLength || start < 0) {
|
||||
if (start > HAL_ADDRESSABLE_LED_MAX_LEN || start < 0) {
|
||||
*status = PARAMETER_OUT_OF_RANGE;
|
||||
wpi::hal::SetLastError(
|
||||
status,
|
||||
fmt::format(
|
||||
"LED start must be less than or equal to {}. {} was requested",
|
||||
HAL_kAddressableLEDMaxLength, start));
|
||||
HAL_ADDRESSABLE_LED_MAX_LEN, start));
|
||||
return;
|
||||
}
|
||||
SimAddressableLEDData[port->channel].start = start;
|
||||
@@ -99,13 +99,13 @@ void HAL_SetAddressableLEDLength(HAL_AddressableLEDHandle handle,
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
}
|
||||
if (length > HAL_kAddressableLEDMaxLength || length < 0) {
|
||||
if (length > HAL_ADDRESSABLE_LED_MAX_LEN || length < 0) {
|
||||
*status = PARAMETER_OUT_OF_RANGE;
|
||||
wpi::hal::SetLastError(
|
||||
status,
|
||||
fmt::format(
|
||||
"LED length must be less than or equal to {}. {} was requested",
|
||||
HAL_kAddressableLEDMaxLength, length));
|
||||
HAL_ADDRESSABLE_LED_MAX_LEN, length));
|
||||
return;
|
||||
}
|
||||
SimAddressableLEDData[port->channel].length = length;
|
||||
|
||||
@@ -29,8 +29,8 @@ void AddressableLEDData::ResetData() {
|
||||
|
||||
void AddressableLEDDataBuffer::SetData(int32_t start, int32_t len,
|
||||
const HAL_AddressableLEDData* d) {
|
||||
if ((start + len) > HAL_kAddressableLEDMaxLength) {
|
||||
len = HAL_kAddressableLEDMaxLength - start;
|
||||
if ((start + len) > HAL_ADDRESSABLE_LED_MAX_LEN) {
|
||||
len = HAL_ADDRESSABLE_LED_MAX_LEN - start;
|
||||
}
|
||||
if (len <= 0) {
|
||||
return;
|
||||
@@ -44,8 +44,8 @@ void AddressableLEDDataBuffer::SetData(int32_t start, int32_t len,
|
||||
|
||||
int32_t AddressableLEDDataBuffer::GetData(int32_t start, int32_t len,
|
||||
HAL_AddressableLEDData* d) {
|
||||
if ((start + len) > HAL_kAddressableLEDMaxLength) {
|
||||
len = HAL_kAddressableLEDMaxLength - start;
|
||||
if ((start + len) > HAL_ADDRESSABLE_LED_MAX_LEN) {
|
||||
len = HAL_ADDRESSABLE_LED_MAX_LEN - start;
|
||||
}
|
||||
if (len <= 0) {
|
||||
return 0;
|
||||
|
||||
@@ -31,7 +31,7 @@ class AddressableLEDDataBuffer {
|
||||
HAL_SIMDATAVALUE_DEFINE_NAME(Data)
|
||||
|
||||
wpi::util::recursive_spinlock m_dataMutex;
|
||||
HAL_AddressableLEDData m_data[HAL_kAddressableLEDMaxLength];
|
||||
HAL_AddressableLEDData m_data[HAL_ADDRESSABLE_LED_MAX_LEN];
|
||||
|
||||
public:
|
||||
void SetData(int32_t start, int32_t len, const HAL_AddressableLEDData* d);
|
||||
|
||||
Reference in New Issue
Block a user