Skip to content

Commit

Permalink
Fix error message to say spi instead of serial
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Oct 30, 2024
1 parent aff1790 commit 3de14b3
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions hal/src/main/native/athena/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(port)));
status, fmt::format("SPI port must be between 0 and {}. Requested {}",
kSpiMaxHandles, static_cast<int>(port)));
return;
}

Expand Down Expand Up @@ -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<int>(port)));
status, fmt::format("SPI port must be between 0 and {}. Requested {}",
kSpiMaxHandles, static_cast<int>(port)));
return;
}

Expand All @@ -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<int>(port)));
status, fmt::format("SPI port must be between 0 and {}. Requested {}",
kSpiMaxHandles, static_cast<int>(port)));
return;
}

Expand All @@ -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<int>(port)));
status, fmt::format("SPI port must be between 0 and {}. Requested {}",
kSpiMaxHandles, static_cast<int>(port)));
return;
}

Expand Down Expand Up @@ -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<int>(port)));
status, fmt::format("SPI port must be between 0 and {}. Requested {}",
kSpiMaxHandles, static_cast<int>(port)));
return;
}

Expand Down

0 comments on commit 3de14b3

Please sign in to comment.