Skip to content

Commit

Permalink
Merge pull request #1333 from bdring/dymk/dollar-command-flow-control
Browse files Browse the repository at this point in the history
Flow control: skip dollar commands if parser is skipping blocks
  • Loading branch information
dymk authored Sep 26, 2024
2 parents 6d51b89 + 6abc914 commit 83787c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions FluidNC/src/ProcessSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,9 @@ Error execute_line(char* line, Channel& channel, AuthenticationLevel auth_level)
}
// User '$' or WebUI '[ESPxxx]' command
if (line[0] == '$' || line[0] == '[') {
if (gc_state.skip_blocks) {
return Error::Ok;
}
return settings_execute_line(line, channel, auth_level);
}
// Everything else is gcode. Block if in alarm or jog mode.
Expand Down
12 changes: 12 additions & 0 deletions fixture_tests/fixtures/flow_control_alarm.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-> $X
<~ [MSG:INFO: Caution: Unlocked]
<- ok
-> o100 if [1 NE 1]
-> $Alarm/Send = 1
-> o100 else
-> (print, success)
<- ok
-> o100 endif
<- ok
<- ok
<- [MSG:INFO: PRINT, success]

0 comments on commit 83787c3

Please sign in to comment.