diff options
author | Christian Hammacher <bmasterc@gmail.com> | 2020-09-25 14:07:19 +0300 |
---|---|---|
committer | Christian Hammacher <bmasterc@gmail.com> | 2020-09-25 14:07:19 +0300 |
commit | ae595786ba8f0c0d9284470e0bf053c9c1aeb633 (patch) | |
tree | 4bcb9354a24c1637f5e220f1cbad6ca2939c825a /src/GCodes/GCodes3.cpp | |
parent | 37629b8574adddad99aa1395c2534b05ea4786af (diff) |
Added synchronisation to heightmap calls
Fixed a minor bug introduced in the last commit
Diffstat (limited to 'src/GCodes/GCodes3.cpp')
-rw-r--r-- | src/GCodes/GCodes3.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/GCodes/GCodes3.cpp b/src/GCodes/GCodes3.cpp index 18454f27..eae574f5 100644 --- a/src/GCodes/GCodes3.cpp +++ b/src/GCodes/GCodes3.cpp @@ -266,6 +266,8 @@ GCodeResult GCodes::DefineGrid(GCodeBuffer& gb, const StringRef &reply) if (!seenX && !seenY && !seenR && !seenS && !seenP) { + ReadLocker locker(reprap.GetMove().heightMapLock); + // Just print the existing grid parameters if (defaultGrid.IsValid()) { @@ -353,6 +355,7 @@ GCodeResult GCodes::DefineGrid(GCodeBuffer& gb, const StringRef &reply) } } + WriteLocker locker(reprap.GetMove().heightMapLock); const bool ok = defaultGrid.Set(xValues, yValues, radius, spacings); reprap.MoveUpdated(); if (ok) |