Close the data collection file. Avoid a race between the two tasks that access it.
| 90 | |
| 91 | // Close the data collection file. Avoid a race between the two tasks that access it. |
| 92 | static void CloseDataCollectionFile() noexcept |
| 93 | { |
| 94 | FileStore *const f = closedLoopFile.exchange(nullptr); |
| 95 | if (f != nullptr) |
| 96 | { |
| 97 | f->Truncate(); // truncate the file in case we didn't write all the preallocated space |
| 98 | f->Close(); |
| 99 | reprap.GetExpansion().AddClosedLoopRun(expectedRemoteBoardAddress, expectedRemoteSampleNumber); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | // Handle M569.5 - Collect closed loop data |
| 104 | GCodeResult ClosedLoop::StartDataCollection(DriverId driverId, GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeException) |
no test coverage detected