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:
authorDavid Crocker <dcrocker@eschertech.com>2020-01-04 17:32:40 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-01-04 17:32:40 +0300
commit8ded9143fa9d07dcddd525683403980c42881f1a (patch)
treee3ee49f1ee85bdf7cd9d4ba01533634603af1e7e /src/GCodes/GCodeMachineState.h
parent06a753856ed5e59aab098384920423d759743ced (diff)
Networking and conditional GCode changes
Removed LWIP_GMAC_TASK definition. We now always use a separate task for the GMAC. Added loop counter constant 'iterations' Fixed some expressoin evaluation bugs
Diffstat (limited to 'src/GCodes/GCodeMachineState.h')
-rw-r--r--src/GCodes/GCodeMachineState.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/GCodes/GCodeMachineState.h b/src/GCodes/GCodeMachineState.h
index e7033de5..81450766 100644
--- a/src/GCodes/GCodeMachineState.h
+++ b/src/GCodes/GCodeMachineState.h
@@ -140,20 +140,24 @@ public:
BlockState() : blockType((uint32_t)BlockType::plain) {}
BlockType GetType() const { return (BlockType) blockType; }
+ uint32_t GetIterations() const { return iterationsDone; }
uint32_t GetLineNumber() const { return lineNumber; }
FilePosition GetFilePosition() const { return fpos; }
- void SetLoopBlock(FilePosition filePos, uint32_t lineNum) { fpos = filePos; lineNumber = lineNum; }
- void SetPlainBlock() { blockType = (uint32_t)BlockType::plain; }
- void SetIfTrueBlock() { blockType = (uint32_t)BlockType::ifTrue; }
- void SetIfFalseNoneTrueBlock() { blockType = (uint32_t)BlockType::ifFalseNoneTrue; }
- void SetIfFalseHadTrueBlock() { blockType = (uint32_t)BlockType::ifFalseHadTrue; }
+ void SetLoopBlock(FilePosition filePos, uint32_t lineNum) { fpos = filePos; lineNumber = lineNum; iterationsDone = 0; }
+ void SetPlainBlock() { blockType = (uint32_t)BlockType::plain; iterationsDone = 0; }
+ void SetIfTrueBlock() { blockType = (uint32_t)BlockType::ifTrue; iterationsDone = 0; }
+ void SetIfFalseNoneTrueBlock() { blockType = (uint32_t)BlockType::ifFalseNoneTrue; iterationsDone = 0; }
+ void SetIfFalseHadTrueBlock() { blockType = (uint32_t)BlockType::ifFalseHadTrue; iterationsDone = 0; }
+
+ void IncrementIterations() { ++iterationsDone; }
private:
FilePosition fpos; // the file offset at which the current block started
uint32_t lineNumber : 29, // the line number at which the current block started
blockType : 3; // the type of this block
+ uint32_t iterationsDone;
};
GCodeMachineState();
@@ -220,8 +224,9 @@ public:
}
BlockState& CurrentBlockState();
+ int32_t GetIterations() const;
- void CreateBlock();
+ bool CreateBlock();
void EndBlock();
static void Release(GCodeMachineState *ms);