mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Replaced STL streams with LLVM's raw_ostream (#344)
std::cout and std::printf were replaced with llvm::outs() and std::cerr was replaced with llvm::errs().
This commit is contained in:
committed by
Peter Johnson
parent
c57a7f0a41
commit
9d93820717
@@ -8,7 +8,6 @@
|
||||
#include "HAL/SPI.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdio>
|
||||
|
||||
#include "DigitalInternal.h"
|
||||
#include "HAL/DIO.h"
|
||||
@@ -17,6 +16,7 @@
|
||||
#include "HAL/cpp/make_unique.h"
|
||||
#include "HAL/cpp/priority_mutex.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "llvm/raw_ostream.h"
|
||||
#include "spilib/spi-lib.h"
|
||||
|
||||
using namespace hal;
|
||||
@@ -165,20 +165,20 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
|
||||
if ((digitalHandles[5] = HAL_InitializeDIOPort(createPortHandleForSPI(14),
|
||||
false, status)) ==
|
||||
HAL_kInvalidHandle) {
|
||||
std::printf("Failed to allocate DIO 14\n");
|
||||
llvm::outs() << "Failed to allocate DIO 14\n";
|
||||
return;
|
||||
}
|
||||
if ((digitalHandles[6] = HAL_InitializeDIOPort(createPortHandleForSPI(15),
|
||||
false, status)) ==
|
||||
HAL_kInvalidHandle) {
|
||||
std::printf("Failed to allocate DIO 15\n");
|
||||
llvm::outs() << "Failed to allocate DIO 15\n";
|
||||
HAL_FreeDIOPort(digitalHandles[5]); // free the first port allocated
|
||||
return;
|
||||
}
|
||||
if ((digitalHandles[7] = HAL_InitializeDIOPort(createPortHandleForSPI(16),
|
||||
false, status)) ==
|
||||
HAL_kInvalidHandle) {
|
||||
std::printf("Failed to allocate DIO 16\n");
|
||||
llvm::outs() << "Failed to allocate DIO 16\n";
|
||||
HAL_FreeDIOPort(digitalHandles[5]); // free the first port allocated
|
||||
HAL_FreeDIOPort(digitalHandles[6]); // free the second port allocated
|
||||
return;
|
||||
@@ -186,7 +186,7 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
|
||||
if ((digitalHandles[8] = HAL_InitializeDIOPort(createPortHandleForSPI(17),
|
||||
false, status)) ==
|
||||
HAL_kInvalidHandle) {
|
||||
std::printf("Failed to allocate DIO 17\n");
|
||||
llvm::outs() << "Failed to allocate DIO 17\n";
|
||||
HAL_FreeDIOPort(digitalHandles[5]); // free the first port allocated
|
||||
HAL_FreeDIOPort(digitalHandles[6]); // free the second port allocated
|
||||
HAL_FreeDIOPort(digitalHandles[7]); // free the third port allocated
|
||||
|
||||
Reference in New Issue
Block a user