From dc81816404bff70668f6c769b02a7ecb9208d989 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Sat, 24 Oct 2020 10:42:47 +0100 Subject: Got rid of some code analysis and compiler warnings --- src/GCodes/GCodeBuffer/GCodeBuffer.cpp | 4 ++-- src/GCodes/GCodeBuffer/GCodeBuffer.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/GCodes/GCodeBuffer') diff --git a/src/GCodes/GCodeBuffer/GCodeBuffer.cpp b/src/GCodes/GCodeBuffer/GCodeBuffer.cpp index 87c126d6..b1a32939 100644 --- a/src/GCodes/GCodeBuffer/GCodeBuffer.cpp +++ b/src/GCodes/GCodeBuffer/GCodeBuffer.cpp @@ -84,7 +84,7 @@ const char *GCodeBuffer::GetStateText() const noexcept // Create a default GCodeBuffer GCodeBuffer::GCodeBuffer(GCodeChannel::RawType channel, GCodeInput *normalIn, FileGCodeInput *fileIn, MessageType mt, Compatibility::RawType c) noexcept - : codeChannel(channel), normalInput(normalIn), whenReportDueTimerStarted(millis()), + : codeChannel(channel), normalInput(normalIn), #if HAS_MASS_STORAGE fileInput(fileIn), #endif @@ -93,7 +93,7 @@ GCodeBuffer::GCodeBuffer(GCodeChannel::RawType channel, GCodeInput *normalIn, Fi binaryParser(*this), #endif stringParser(*this), - machineState(new GCodeMachineState()), + machineState(new GCodeMachineState()), whenReportDueTimerStarted(millis()), #if HAS_LINUX_INTERFACE isBinaryBuffer(false), #endif diff --git a/src/GCodes/GCodeBuffer/GCodeBuffer.h b/src/GCodes/GCodeBuffer/GCodeBuffer.h index 4b37981a..9933e31b 100644 --- a/src/GCodes/GCodeBuffer/GCodeBuffer.h +++ b/src/GCodes/GCodeBuffer/GCodeBuffer.h @@ -240,6 +240,8 @@ private: GCodeMachineState *machineState; // Machine state for this gcode source uint32_t whenTimerStarted; // When we started waiting + uint32_t whenReportDueTimerStarted; // When the report-due-timer has been started + static constexpr uint32_t reportDueInterval = 1000; // Interval in which we send in ms #if HAS_LINUX_INTERFACE bool isBinaryBuffer; @@ -247,9 +249,6 @@ private: bool timerRunning; // True if we are waiting bool motionCommanded; // true if this GCode stream has commanded motion since it last waited for motion to stop - uint32_t whenReportDueTimerStarted; // When the report-due-timer has been started - static constexpr uint32_t reportDueInterval = 1000; // Interval in which we send in ms - #if HAS_LINUX_INTERFACE alignas(4) char buffer[MaxCodeBufferSize]; // must be aligned because we do dword fetches from it #else -- cgit v1.2.3