Skip to content

Commit

Permalink
Block homing with certain control switches
Browse files Browse the repository at this point in the history
Door, Hold, E-Stop and fault control switches block homing.
  • Loading branch information
bdring committed Dec 12, 2024
1 parent 7e73b08 commit 2d569cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions FluidNC/src/Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ std::string Control::report_status() {
return ret;
}

bool Control::pins_block_reset() {
std::string blockers("DHFE"); // Door, Hold, Fault, E-Stop block reset and homing
for (auto pin : _pins) {
if (pin->get() && blockers.find(pin->letter()) != std::string::npos) {
return true;
}
}
return false;
}

bool Control::stuck() {
for (auto pin : _pins) {
if (pin->get()) {
Expand Down
1 change: 1 addition & 0 deletions FluidNC/src/Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Control : public Configuration::Configurable {

bool stuck();
bool safety_door_ajar();
bool pins_block_reset();

std::string report_status();

Expand Down
4 changes: 4 additions & 0 deletions FluidNC/src/ProcessSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ static Error cmd_log_verbose(const char* value, AuthenticationLevel auth_level,
return Error::Ok;
}
static Error home(AxisMask axisMask, Channel& out) {
// see if blocking control switches are active
if (config->_control->pins_block_reset()) {
return Error::CheckControlPins;
}
if (axisMask != Machine::Homing::AllCycles) { // if not AllCycles we need to make sure the cycle is not prohibited
// if there is a cycle it is the axis from $H<axis>
auto n_axis = Axes::_numberAxis;
Expand Down

0 comments on commit 2d569cd

Please sign in to comment.