From 3de14b3df77e00a6f5e46c8b2d075e95202699c8 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Thu, 10 Oct 2024 16:11:46 -0400 Subject: [PATCH] Fix error message to say spi instead of serial --- hal/src/main/native/athena/SPI.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/hal/src/main/native/athena/SPI.cpp b/hal/src/main/native/athena/SPI.cpp index e89fe27262b..d77f81ec7bb 100644 --- a/hal/src/main/native/athena/SPI.cpp +++ b/hal/src/main/native/athena/SPI.cpp @@ -125,9 +125,8 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) { if (port < 0 || port >= kSpiMaxHandles) { *status = PARAMETER_OUT_OF_RANGE; hal::SetLastError( - status, - fmt::format("Serial port must be between 0 and {}. Requested {}", - kSpiMaxHandles, static_cast(port))); + status, fmt::format("SPI port must be between 0 and {}. Requested {}", + kSpiMaxHandles, static_cast(port))); return; } @@ -430,9 +429,8 @@ void HAL_SetSPIChipSelectActiveHigh(HAL_SPIPort port, int32_t* status) { if (port < 0 || port >= kSpiMaxHandles) { *status = PARAMETER_OUT_OF_RANGE; hal::SetLastError( - status, - fmt::format("Serial port must be between 0 and {}. Requested {}", - kSpiMaxHandles, static_cast(port))); + status, fmt::format("SPI port must be between 0 and {}. Requested {}", + kSpiMaxHandles, static_cast(port))); return; } @@ -456,9 +454,8 @@ void HAL_SetSPIChipSelectActiveLow(HAL_SPIPort port, int32_t* status) { if (port < 0 || port >= kSpiMaxHandles) { *status = PARAMETER_OUT_OF_RANGE; hal::SetLastError( - status, - fmt::format("Serial port must be between 0 and {}. Requested {}", - kSpiMaxHandles, static_cast(port))); + status, fmt::format("SPI port must be between 0 and {}. Requested {}", + kSpiMaxHandles, static_cast(port))); return; } @@ -481,9 +478,8 @@ void HAL_InitSPIAuto(HAL_SPIPort port, int32_t bufferSize, int32_t* status) { if (port < 0 || port >= kSpiMaxHandles) { *status = PARAMETER_OUT_OF_RANGE; hal::SetLastError( - status, - fmt::format("Serial port must be between 0 and {}. Requested {}", - kSpiMaxHandles, static_cast(port))); + status, fmt::format("SPI port must be between 0 and {}. Requested {}", + kSpiMaxHandles, static_cast(port))); return; } @@ -521,9 +517,8 @@ void HAL_FreeSPIAuto(HAL_SPIPort port, int32_t* status) { if (port < 0 || port >= kSpiMaxHandles) { *status = PARAMETER_OUT_OF_RANGE; hal::SetLastError( - status, - fmt::format("Serial port must be between 0 and {}. Requested {}", - kSpiMaxHandles, static_cast(port))); + status, fmt::format("SPI port must be between 0 and {}. Requested {}", + kSpiMaxHandles, static_cast(port))); return; }