mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal] Rename HAL_kInvalidHandle to HAL_INVALID_HANDLE (#8698)
This commit is contained in:
@@ -35,7 +35,7 @@ HAL_DigitalHandle HAL_InitializePWMPort(int32_t channel,
|
||||
*status = RESOURCE_OUT_OF_RANGE;
|
||||
wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for PWM", 0,
|
||||
kNumSmartIo, channel);
|
||||
return HAL_kInvalidHandle;
|
||||
return HAL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
HAL_DigitalHandle handle;
|
||||
@@ -51,7 +51,7 @@ HAL_DigitalHandle HAL_InitializePWMPort(int32_t channel,
|
||||
wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for PWM", 0,
|
||||
kNumSmartIo, channel);
|
||||
}
|
||||
return HAL_kInvalidHandle; // failed to allocate. Pass error back.
|
||||
return HAL_INVALID_HANDLE; // failed to allocate. Pass error back.
|
||||
}
|
||||
|
||||
port->channel = channel;
|
||||
@@ -59,14 +59,14 @@ HAL_DigitalHandle HAL_InitializePWMPort(int32_t channel,
|
||||
*status = port->InitializeMode(SmartIoMode::PwmOutput);
|
||||
if (*status != 0) {
|
||||
smartIoHandles->Free(handle, HAL_HandleEnum::PWM);
|
||||
return HAL_kInvalidHandle;
|
||||
return HAL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
// Disable the PWM output.
|
||||
HAL_SetPWMPulseTimeMicroseconds(handle, 0, status);
|
||||
if (*status != 0) {
|
||||
smartIoHandles->Free(handle, HAL_HandleEnum::PWM);
|
||||
return HAL_kInvalidHandle;
|
||||
return HAL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
port->previousAllocation = allocationLocation ? allocationLocation : "";
|
||||
|
||||
Reference in New Issue
Block a user