From af452e756c4bbed60d3b35d7ed3f64bdcebd78ee Mon Sep 17 00:00:00 2001 From: David Crocker Date: Sat, 13 Nov 2021 16:07:08 +0000 Subject: Fixed Print::write overloaded and hidden functions mess --- src/Comms/AuxDevice.cpp | 2 +- src/Comms/PanelDueUpdater.cpp | 2 +- src/Platform/Platform.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Comms/AuxDevice.cpp b/src/Comms/AuxDevice.cpp index 05fa65cc..2d41a41b 100644 --- a/src/Comms/AuxDevice.cpp +++ b/src/Comms/AuxDevice.cpp @@ -136,7 +136,7 @@ bool AuxDevice::Flush() noexcept const size_t bytesToWrite = min(uart->canWrite(), auxOutputBuffer->BytesLeft()); if (bytesToWrite > 0) { - uart->write(auxOutputBuffer->Read(bytesToWrite), bytesToWrite); + uart->print(auxOutputBuffer->Read(bytesToWrite), bytesToWrite); } if (auxOutputBuffer->BytesLeft() == 0) diff --git a/src/Comms/PanelDueUpdater.cpp b/src/Comms/PanelDueUpdater.cpp index 41158da9..92c5989c 100644 --- a/src/Comms/PanelDueUpdater.cpp +++ b/src/Comms/PanelDueUpdater.cpp @@ -159,7 +159,7 @@ void PanelDueUpdater::Spin() noexcept // Since writing messages via AppendAuxReply is disabled while flashing we need to send it directly auto auxPort = GetAuxPort(); auxPort->write('\n'); // Make sure the previous message is regarded as terminated by PanelDue - auxPort->write(panelDueCommandEraseAndReset); + auxPort->print(panelDueCommandEraseAndReset); auxPort->flush(); state = FlashState::waitAfterEraseAndReset; erasedAndResetAt = millis(); diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index 8aafab9a..36b88370 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -962,7 +962,7 @@ bool Platform::FlushMessages() noexcept const size_t bytesToWrite = min(SERIAL_MAIN_DEVICE.canWrite(), usbOutputBuffer->BytesLeft()); if (bytesToWrite != 0) { - SERIAL_MAIN_DEVICE.write(usbOutputBuffer->Read(bytesToWrite), bytesToWrite); + SERIAL_MAIN_DEVICE.print(usbOutputBuffer->Read(bytesToWrite), bytesToWrite); } if (usbOutputBuffer->BytesLeft() == 0) @@ -3296,7 +3296,7 @@ void Platform::RawMessage(MessageType type, const char *_ecv_array message) noex size_t len = strlen(p); while (SERIAL_MAIN_DEVICE.IsConnected() && len != 0 && !reprap.SpinTimeoutImminent()) { - const size_t written = SERIAL_MAIN_DEVICE.write(p, len); + const size_t written = SERIAL_MAIN_DEVICE.print(p, len); len -= written; p += written; } -- cgit v1.2.3