Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform')
-rw-r--r--src/Platform/Heap.h6
-rw-r--r--src/Platform/MessageType.h2
-rw-r--r--src/Platform/OutputMemory.h34
-rw-r--r--src/Platform/Platform.h42
-rw-r--r--src/Platform/Tasks.cpp2
5 files changed, 43 insertions, 43 deletions
diff --git a/src/Platform/Heap.h b/src/Platform/Heap.h
index 01458d99..58b449cc 100644
--- a/src/Platform/Heap.h
+++ b/src/Platform/Heap.h
@@ -25,7 +25,7 @@ class StringHandle
{
public:
StringHandle() noexcept { slotPtr = nullptr; }
- StringHandle(const char *s) noexcept;
+ explicit StringHandle(const char *s) noexcept;
StringHandle(const char *s, size_t len) noexcept;
#if 0 // unused
@@ -55,7 +55,7 @@ protected:
static void GarbageCollectInternal() noexcept;
static void AdjustHandles(char *startAddr, char *endAddr, size_t moveDown, unsigned int numHandles) noexcept;
- IndexSlot *slotPtr;
+ IndexSlot * null slotPtr;
static ReadWriteLock heapLock;
static IndexBlock *indexRoot;
@@ -73,7 +73,7 @@ class AutoStringHandle : public StringHandle
{
public:
AutoStringHandle() noexcept : StringHandle() { }
- AutoStringHandle(const char *s) noexcept : StringHandle(s) { }
+ explicit AutoStringHandle(const char *s) noexcept : StringHandle(s) { }
AutoStringHandle(const char *s, size_t len) noexcept : StringHandle(s, len) { }
AutoStringHandle(const AutoStringHandle& other) noexcept;
AutoStringHandle(AutoStringHandle&& other) noexcept;
diff --git a/src/Platform/MessageType.h b/src/Platform/MessageType.h
index 7f82f0f2..70072808 100644
--- a/src/Platform/MessageType.h
+++ b/src/Platform/MessageType.h
@@ -45,7 +45,7 @@ enum MessageType : uint32_t
LogMessageHighBit = 0x80000000u, // Log level consists of two bits this is the high bit
// Common combinations
- NoDestinationMessage = 0, // A message that is going nowhere
+ NoDestinationMessage = 0u, // A message that is going nowhere
GenericMessage = UsbMessage | AuxMessage | HttpMessage | TelnetMessage, // A message that is to be sent to the web, Telnet, USB and panel
LogOff = LogMessageLowBit | LogMessageHighBit, // Log level "off (3): do not log this message
LogWarn = LogMessageHighBit, // Log level "warn" (2): all messages of type Error and Warning are logged
diff --git a/src/Platform/OutputMemory.h b/src/Platform/OutputMemory.h
index b86bb84f..c8a3f59b 100644
--- a/src/Platform/OutputMemory.h
+++ b/src/Platform/OutputMemory.h
@@ -21,44 +21,44 @@ const size_t OUTPUT_STACK_DEPTH = 4; // Number of OutputBuffer chains that can b
class OutputBuffer
{
public:
- OutputBuffer(OutputBuffer *n) noexcept : next(n) { }
+ explicit OutputBuffer(OutputBuffer *null n) noexcept : next(n) { }
OutputBuffer(const OutputBuffer&) = delete;
void Append(OutputBuffer *other) noexcept;
- OutputBuffer *Next() const noexcept { return next; }
+ OutputBuffer *null Next() const noexcept { return next; }
bool IsReferenced() const noexcept { return isReferenced; }
bool HadOverflow() const noexcept { return hadOverflow; }
void IncreaseReferences(size_t refs) noexcept;
- const char *Data() const noexcept { return data; }
- const char *UnreadData() const noexcept { return data + bytesRead; }
+ const char *_ecv_array Data() const noexcept { return data; }
+ const char *_ecv_array UnreadData() const noexcept { return data + bytesRead; }
size_t DataLength() const noexcept { return dataLength; } // How many bytes have been written to this instance?
size_t Length() const noexcept; // How many bytes have been written to the whole chain?
char& operator[](size_t index) noexcept;
char operator[](size_t index) const noexcept;
- const char *Read(size_t len) noexcept;
+ const char *_ecv_array Read(size_t len) noexcept;
void Taken(size_t len) noexcept { bytesRead += len; }
size_t BytesLeft() const noexcept { return dataLength - bytesRead; } // How many bytes have not been sent yet?
uint32_t WhenQueued() const noexcept { return whenQueued; }
void UpdateWhenQueued() noexcept;
- size_t vprintf(const char *fmt, va_list vargs) noexcept;
- size_t printf(const char *fmt, ...) noexcept __attribute__ ((format (printf, 2, 3)));
- size_t vcatf(const char *fmt, va_list vargs) noexcept;
- size_t catf(const char *fmt, ...) noexcept __attribute__ ((format (printf, 2, 3)));
- size_t lcatf(const char *fmt, ...) noexcept __attribute__ ((format (printf, 2, 3)));
+ size_t vprintf(const char *_ecv_array fmt, va_list vargs) noexcept;
+ size_t printf(const char *_ecv_array fmt, ...) noexcept __attribute__ ((format (printf, 2, 3)));
+ size_t vcatf(const char *_ecv_array fmt, va_list vargs) noexcept;
+ size_t catf(const char *_ecv_array fmt, ...) noexcept __attribute__ ((format (printf, 2, 3)));
+ size_t lcatf(const char *_ecv_array fmt, ...) noexcept __attribute__ ((format (printf, 2, 3)));
size_t copy(const char c) noexcept;
- size_t copy(const char *src) noexcept;
- size_t copy(const char *src, size_t len) noexcept;
+ size_t copy(const char *_ecv_array src) noexcept;
+ size_t copy(const char *_ecv_array src, size_t len) noexcept;
size_t cat(const char c) noexcept;
- size_t cat(const char *src) noexcept;
- size_t lcat(const char *src) noexcept;
- size_t cat(const char *src, size_t len) noexcept;
- size_t lcat(const char *src, size_t len) noexcept;
+ size_t cat(const char *_ecv_array src) noexcept;
+ size_t lcat(const char *_ecv_array src) noexcept;
+ size_t cat(const char *_ecv_array src, size_t len) noexcept;
+ size_t lcat(const char *_ecv_array src, size_t len) noexcept;
size_t cat(StringRef &str) noexcept;
size_t EncodeChar(char c) noexcept;
@@ -96,7 +96,7 @@ public:
private:
void Clear() noexcept;
- OutputBuffer *next;
+ OutputBuffer *null next;
OutputBuffer *last;
uint32_t whenQueued; // milliseconds timer when this buffer was filled in
diff --git a/src/Platform/Platform.h b/src/Platform/Platform.h
index a2246047..44473d3e 100644
--- a/src/Platform/Platform.h
+++ b/src/Platform/Platform.h
@@ -364,7 +364,7 @@ public:
time_t GetDateTime() const noexcept { return realTime; } // Retrieves the current RTC datetime
bool GetDateTime(tm& rslt) const noexcept { return gmtime_r(&realTime, &rslt) != nullptr && realTime != 0; }
// Retrieves the broken-down current RTC datetime and returns true if it's valid
- bool SetDateTime(time_t time) noexcept; // Sets the current RTC date and time or returns false on error
+ bool SetDateTime(time_t t) noexcept; // Sets the current RTC date and time or returns false on error
// Communications and data storage
void AppendUsbReply(OutputBuffer *buffer) noexcept;
@@ -405,9 +405,9 @@ public:
bool Delete(const char* folder, const char *filename) const noexcept;
#endif
- const char* GetWebDir() const noexcept; // Where the html etc files are
- const char* GetGCodeDir() const noexcept; // Where the gcodes are
- const char* GetMacroDir() const noexcept; // Where the user-defined macros are
+ const char *_ecv_array GetWebDir() const noexcept; // Where the html etc files are
+ const char *_ecv_array GetGCodeDir() const noexcept; // Where the gcodes are
+ const char *_ecv_array GetMacroDir() const noexcept; // Where the user-defined macros are
// Functions to work with the system files folder
GCodeResult SetSysDir(const char* dir, const StringRef& reply) noexcept; // Set the system files path
@@ -422,13 +422,13 @@ public:
#endif
// Message output (see MessageType for further details)
- void Message(MessageType type, const char *message) noexcept;
+ void Message(MessageType type, const char *_ecv_array message) noexcept;
void Message(MessageType type, OutputBuffer *buffer) noexcept;
- void MessageF(MessageType type, const char *fmt, ...) noexcept __attribute__ ((format (printf, 3, 4)));
- void MessageF(MessageType type, const char *fmt, va_list vargs) noexcept;
- void DebugMessage(const char *fmt, va_list vargs) noexcept;
+ void MessageF(MessageType type, const char *_ecv_array fmt, ...) noexcept __attribute__ ((format (printf, 3, 4)));
+ void MessageF(MessageType type, const char *_ecv_array fmt, va_list vargs) noexcept;
+ void DebugMessage(const char *_ecv_array fmt, va_list vargs) noexcept;
bool FlushMessages() noexcept; // Flush messages to USB and aux, returning true if there is more to send
- void SendAlert(MessageType mt, const char *message, const char *title, int sParam, float tParam, AxesBitmap controls) noexcept;
+ void SendAlert(MessageType mt, const char *_ecv_array message, const char *_ecv_array title, int sParam, float tParam, AxesBitmap controls) noexcept;
void StopLogging() noexcept;
// Movement
@@ -448,7 +448,7 @@ public:
void EmergencyDisableDrivers() noexcept;
void SetDriversIdle() noexcept;
GCodeResult ConfigureDriverBrakePort(GCodeBuffer& gb, const StringRef& reply, size_t driver) noexcept
- pre(drive < GetNumActualDirectDrivers());
+ pre(driver < GetNumActualDirectDrivers());
GCodeResult SetMotorCurrent(size_t axisOrExtruder, float current, int code, const StringRef& reply) noexcept;
int GetMotorCurrent(size_t axisOrExtruder, int code) const noexcept;
void SetIdleCurrentFactor(float f) noexcept;
@@ -459,14 +459,14 @@ public:
void SetDriverStepTiming(size_t driver, const float microseconds[4]) noexcept;
bool GetDriverStepTiming(size_t driver, float microseconds[4]) const noexcept;
float DriveStepsPerUnit(size_t axisOrExtruder) const noexcept;
- const float *GetDriveStepsPerUnit() const noexcept
+ const float *_ecv_array GetDriveStepsPerUnit() const noexcept
{ return driveStepsPerUnit; }
void SetDriveStepsPerUnit(size_t axisOrExtruder, float value, uint32_t requestedMicrostepping) noexcept;
float Acceleration(size_t axisOrExtruder) const noexcept;
- const float* Accelerations() const noexcept;
+ const float *_ecv_array Accelerations() const noexcept;
void SetAcceleration(size_t axisOrExtruder, float value) noexcept;
float MaxFeedrate(size_t axisOrExtruder) const noexcept;
- const float* MaxFeedrates() const noexcept { return maxFeedrates; }
+ const float *_ecv_array MaxFeedrates() const noexcept { return maxFeedrates; }
void SetMaxFeedrate(size_t axisOrExtruder, float value) noexcept;
float MinMovementSpeed() const noexcept { return minimumMovementSpeed; }
void SetMinMovementSpeed(float value) noexcept;
@@ -499,7 +499,7 @@ public:
void SetExtruderDriver(size_t extruder, DriverId driver) noexcept
pre(extruder < MaxExtruders);
uint32_t GetDriversBitmap(size_t axisOrExtruder) const noexcept // get the bitmap of driver step bits for this axis or extruder
- pre(axisOrExtruder < MaxAxesPlusExtruders + NumLocalDrivers)
+ pre(axisOrExtruder < MaxAxesPlusExtruders + NumDirectDrivers)
{ return driveDriverBits[axisOrExtruder]; }
uint32_t GetSlowDriversBitmap() const noexcept { return slowDriversBitmap; }
uint32_t GetSlowDriverStepHighClocks() const noexcept { return slowDriverStepTimingClocks[0]; }
@@ -508,7 +508,7 @@ public:
uint32_t GetSlowDriverDirHoldClocks() const noexcept { return slowDriverStepTimingClocks[3]; }
uint32_t GetSteppingEnabledDrivers() const noexcept { return steppingEnabledDriversBitmap; }
void DisableSteppingDriver(uint8_t driver) noexcept { steppingEnabledDriversBitmap &= ~StepPins::CalcDriverBitmap(driver); }
- void EnableAllSteppingDrivers() noexcept { steppingEnabledDriversBitmap = 0xFFFFFFFF; }
+ void EnableAllSteppingDrivers() noexcept { steppingEnabledDriversBitmap = 0xFFFFFFFFu; }
#if SUPPORT_NONLINEAR_EXTRUSION
bool GetExtrusionCoefficients(size_t extruder, float& a, float& b, float& limit) const noexcept;
@@ -616,7 +616,7 @@ public:
GCodeResult ConfigurePort(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeException);
GpOutputPort& GetGpOutPort(size_t gpoutPortNumber) noexcept
- pre(gpioPortNumber < MaxGpOutPorts) { return gpoutPorts[gpoutPortNumber]; }
+ pre(gpoutPortNumber < MaxGpOutPorts) { return gpoutPorts[gpoutPortNumber]; }
const GpInputPort& GetGpInPort(size_t gpinPortNumber) const noexcept
pre(gpinPortNumber < MaxGpInPorts) { return gpinPorts[gpinPortNumber]; }
@@ -705,7 +705,7 @@ private:
// Drives
void UpdateMotorCurrent(size_t driver, float current) noexcept;
void SetDriverDirection(uint8_t driver, bool direction) noexcept
- pre(driver < DRIVES);
+ pre(driver < NumDirectDrivers);
#if VARIABLE_NUM_DRIVERS && SUPPORT_12864_LCD
size_t numActualDirectDrivers;
@@ -894,18 +894,18 @@ private:
#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES
// Where the htm etc files are
-inline const char* Platform::GetWebDir() const noexcept
+inline const char *_ecv_array Platform::GetWebDir() const noexcept
{
return WEB_DIR;
}
// Where the gcodes are
-inline const char* Platform::GetGCodeDir() const noexcept
+inline const char *_ecv_array Platform::GetGCodeDir() const noexcept
{
return GCODE_DIR;
}
-inline const char* Platform::GetMacroDir() const noexcept
+inline const char *_ecv_array Platform::GetMacroDir() const noexcept
{
return MACRO_DIR;
}
@@ -926,7 +926,7 @@ inline float Platform::Acceleration(size_t drive) const noexcept
return accelerations[drive];
}
-inline const float* Platform::Accelerations() const noexcept
+inline const float *_ecv_array Platform::Accelerations() const noexcept
{
return accelerations;
}
diff --git a/src/Platform/Tasks.cpp b/src/Platform/Tasks.cpp
index 6cd12a2d..d3388c0b 100644
--- a/src/Platform/Tasks.cpp
+++ b/src/Platform/Tasks.cpp
@@ -183,7 +183,7 @@ void *Tasks::GetNVMBuffer(const uint32_t *stk) noexcept
// If we reset immediately then the user area write doesn't complete and the bits get set to all 1s.
delayMicroseconds(10000);
- Reset();
+ ResetProcessor();
}
}
}