Skip to content

Commit

Permalink
Cycle 0 and Macro Fixes
Browse files Browse the repository at this point in the history
- Homing cycle 0 was incorrectly running like -1 when run with $H<axis>
- Eliminated a needless macro error when the macro was empty.
  • Loading branch information
bdring committed Nov 4, 2023
1 parent fc3a378 commit 3a18102
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion FluidNC/src/Machine/Axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace Machine {
m->init();
}
}
if (_homing->_cycle) {
if (_homing && _homing->_cycle != Machine::Homing::set_mpos_only) {
_homing->init();
set_bitnum(Axes::homingMask, _axis);
}
Expand Down
12 changes: 6 additions & 6 deletions FluidNC/src/Machine/Macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ Cmd findOverride(std::string name) {
return it == overrideCodes.end() ? Cmd::None : it->second;
}

bool Macro::run() {
if (sys.state != State::Idle) {
log_error("Macro can only be used in idle state");
bool Macro::run() { // return true if the macro was run
const std::string& s = _gcode;
if (_gcode == "") {
return false;
}

const std::string& s = _gcode;
if (_gcode == "") {
return true;
if (sys.state != State::Idle) {
log_error("Macro can only be used in idle state");
return false;
}

log_info("Running macro " << _name << ": " << _gcode);
Expand Down

0 comments on commit 3a18102

Please sign in to comment.