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:
authorChristian Hammacher <bmasterc@gmail.com>2019-03-30 21:15:41 +0300
committerChristian Hammacher <bmasterc@gmail.com>2019-03-30 21:15:41 +0300
commit095df6b75b505a650188ad74935d268429d41a63 (patch)
tree7959b92266f5df230f7ffc61c90d1858828e2799 /src/GCodes/GCodeQueue.h
parent9a8acc6ba9c7e3d973fcb23a901322acdcc896ca (diff)
Work on the new the SPI interface
Transfers over the SPI1 channel of the SAME70 working Refactored GCodeBuffer for two data types: 1. For string-based inputs (standard text-based approach) 2. For binary data transfers as used in the new SPI protocol (untested) Added OpenOCD script for SAME70 <-> Atmel ICE Fixed relative workspace paths in the linker settings again
Diffstat (limited to 'src/GCodes/GCodeQueue.h')
-rw-r--r--src/GCodes/GCodeQueue.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/GCodes/GCodeQueue.h b/src/GCodes/GCodeQueue.h
index a366218f..113d3d64 100644
--- a/src/GCodes/GCodeQueue.h
+++ b/src/GCodes/GCodeQueue.h
@@ -8,17 +8,19 @@
#define GCODEQUEUE_H
#include "RepRapFirmware.h"
-#include "GCodeBuffer.h"
+#include "GCodeBuffer/GCodeBuffer.h"
class QueuedCode;
+const size_t BufferSizePerQueueItem = SHORT_GCODE_LENGTH;
+
class GCodeQueue
{
public:
GCodeQueue();
static bool ShouldQueueCode(GCodeBuffer &gb); // Return true if this code should be queued
- bool QueueCode(GCodeBuffer &gb); // Queue a G-code
+ bool QueueCode(GCodeBuffer &gb); // Queue a G-code and return true if it could be stored
bool FillBuffer(GCodeBuffer *gb); // If there is another move to execute at this time, fill a buffer
void PurgeEntries(); // Remove stored codes when a print is being paused
void Clear(); // Clean up all the stored codes
@@ -36,13 +38,15 @@ class QueuedCode
public:
friend class GCodeQueue;
- QueuedCode(QueuedCode *n) : next(n) { }
+ QueuedCode(QueuedCode *n) : next(n), dataLength(0) { }
QueuedCode *Next() const { return next; }
private:
QueuedCode *next;
- char code[SHORT_GCODE_LENGTH];
+ char data[BufferSizePerQueueItem];
+ size_t dataLength;
+
uint32_t executeAtMove;
int toolNumberAdjust;