Get the number of iterations of the closest enclosing loop in the current file, or -1 if there is on enclosing loop
| 335 | |
| 336 | // Get the number of iterations of the closest enclosing loop in the current file, or -1 if there is on enclosing loop |
| 337 | int32_t GCodeMachineState::GetIterations() const noexcept |
| 338 | { |
| 339 | for (const BlockState *_ecv_null bs = currentBlockState; bs != nullptr; bs = bs->GetPrevious()) |
| 340 | { |
| 341 | if (bs->GetType() == BlockType::loop) |
| 342 | { |
| 343 | return bs->GetIterations(); |
| 344 | } |
| 345 | } |
| 346 | return -1; |
| 347 | } |
| 348 | |
| 349 | // Create a new block returning true if successful, false if maximum indent level exceeded |
| 350 | void GCodeMachineState::CreateBlock(uint16_t indentLevel) noexcept |
no test coverage detected