Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devt #618

Merged
merged 13 commits into from
Sep 28, 2020
1 change: 1 addition & 0 deletions Grbl_Esp32/src/Error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ std::map<Error, const char*> ErrorCodes = {
{ Error::TravelExceeded, "Max travel exceeded during jog" },
{ Error::InvalidJogCommand, "Invalid jog command" },
{ Error::SettingDisabledLaser, "Laser mode requires PWM output" },
{ Error::HomingNoCycles, "No Homing/Cycle defined in settings" },
{ Error::GcodeUnsupportedCommand, "Unsupported GCode command" },
{ Error::GcodeModalGroupViolation, "Gcode modal group violation" },
{ Error::GcodeUndefinedFeedRate, "Gcode undefined feed rate" },
Expand Down
1 change: 1 addition & 0 deletions Grbl_Esp32/src/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum class Error : uint8_t {
TravelExceeded = 15,
InvalidJogCommand = 16,
SettingDisabledLaser = 17,
HomingNoCycles = 18,
GcodeUnsupportedCommand = 20,
GcodeModalGroupViolation = 21,
GcodeUndefinedFeedRate = 22,
Expand Down
2 changes: 1 addition & 1 deletion Grbl_Esp32/src/Grbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// Grbl versioning system

const char* const GRBL_VERSION = "1.3a";
const char* const GRBL_VERSION_BUILD = "20200927";
const char* const GRBL_VERSION_BUILD = "20200928";

//#include <sdkconfig.h>
#include <Arduino.h>
Expand Down
6 changes: 6 additions & 0 deletions Grbl_Esp32/src/MotionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ static bool axis_is_squared(uint8_t axis_mask) {
// NOTE: There should be no motions in the buffer and Grbl must be in an idle state before
// executing the homing cycle. This prevents incorrect buffered plans after homing.
void mc_homing_cycle(uint8_t cycle_mask) {
bool no_cycles_defined = true;
#ifdef USE_CUSTOM_HOMING
if (user_defined_homing()) {
return;
Expand Down Expand Up @@ -316,6 +317,7 @@ void mc_homing_cycle(uint8_t cycle_mask) {
for (int cycle = 0; cycle < MAX_N_AXIS; cycle++) {
auto homing_mask = homing_cycle[cycle]->get();
if (homing_mask) { // if there are some axes in this cycle
no_cycles_defined = false;
if (!axis_is_squared(homing_mask)) {
limits_go_home(homing_mask); // Homing cycle 0
} else {
Expand All @@ -331,6 +333,10 @@ void mc_homing_cycle(uint8_t cycle_mask) {
}
}
}

if (no_cycles_defined) {
report_status_message(Error::HomingNoCycles, CLIENT_ALL);
}
}
protocol_execute_realtime(); // Check for reset and set system abort.
if (sys.abort) {
Expand Down
6 changes: 2 additions & 4 deletions Grbl_Esp32/src/ProcessSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,8 @@ Error system_execute_line(char* line, WebUI::ESPResponseStream* out, WebUI::Auth
}

Error system_execute_line(char* line, uint8_t client, WebUI::AuthenticationLevel auth_level) {
auto resp = new WebUI::ESPResponseStream(client, true);
auto ret = system_execute_line(line, resp, auth_level);
delete resp;
return ret;
WebUI::ESPResponseStream stream(client, true);
return system_execute_line(line, &stream, auth_level);
}

void system_execute_startup(char* line) {
Expand Down