1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-06 20:30:56 +02:00

Merge pull request #617 from bdring/NoHomingCycleAlarm

Tweak memory fix and add $H check for $Homing/Cycles
This commit is contained in:
Mitch Bradley
2020-09-28 10:05:43 -10:00
committed by GitHub
5 changed files with 11 additions and 5 deletions

View File

@@ -40,6 +40,7 @@ std::map<Error, const char*> ErrorCodes = {
{ Error::TravelExceeded, "Max travel exceeded during jog" }, { Error::TravelExceeded, "Max travel exceeded during jog" },
{ Error::InvalidJogCommand, "Invalid jog command" }, { Error::InvalidJogCommand, "Invalid jog command" },
{ Error::SettingDisabledLaser, "Laser mode requires PWM output" }, { Error::SettingDisabledLaser, "Laser mode requires PWM output" },
{ Error::HomingNoCycles, "No Homing/Cycle defined in settings" },
{ Error::GcodeUnsupportedCommand, "Unsupported GCode command" }, { Error::GcodeUnsupportedCommand, "Unsupported GCode command" },
{ Error::GcodeModalGroupViolation, "Gcode modal group violation" }, { Error::GcodeModalGroupViolation, "Gcode modal group violation" },
{ Error::GcodeUndefinedFeedRate, "Gcode undefined feed rate" }, { Error::GcodeUndefinedFeedRate, "Gcode undefined feed rate" },

View File

@@ -43,6 +43,7 @@ enum class Error : uint8_t {
TravelExceeded = 15, TravelExceeded = 15,
InvalidJogCommand = 16, InvalidJogCommand = 16,
SettingDisabledLaser = 17, SettingDisabledLaser = 17,
HomingNoCycles = 18,
GcodeUnsupportedCommand = 20, GcodeUnsupportedCommand = 20,
GcodeModalGroupViolation = 21, GcodeModalGroupViolation = 21,
GcodeUndefinedFeedRate = 22, GcodeUndefinedFeedRate = 22,

View File

@@ -23,7 +23,7 @@
// Grbl versioning system // Grbl versioning system
const char* const GRBL_VERSION = "1.3a"; 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 <sdkconfig.h>
#include <Arduino.h> #include <Arduino.h>

View File

@@ -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 // 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. // executing the homing cycle. This prevents incorrect buffered plans after homing.
void mc_homing_cycle(uint8_t cycle_mask) { void mc_homing_cycle(uint8_t cycle_mask) {
bool no_cycles_defined = true;
#ifdef USE_CUSTOM_HOMING #ifdef USE_CUSTOM_HOMING
if (user_defined_homing()) { if (user_defined_homing()) {
return; return;
@@ -316,6 +317,7 @@ void mc_homing_cycle(uint8_t cycle_mask) {
for (int cycle = 0; cycle < MAX_N_AXIS; cycle++) { for (int cycle = 0; cycle < MAX_N_AXIS; cycle++) {
auto homing_mask = homing_cycle[cycle]->get(); auto homing_mask = homing_cycle[cycle]->get();
if (homing_mask) { // if there are some axes in this cycle if (homing_mask) { // if there are some axes in this cycle
no_cycles_defined = false;
if (!axis_is_squared(homing_mask)) { if (!axis_is_squared(homing_mask)) {
limits_go_home(homing_mask); // Homing cycle 0 limits_go_home(homing_mask); // Homing cycle 0
} else { } else {
@@ -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. protocol_execute_realtime(); // Check for reset and set system abort.
if (sys.abort) { if (sys.abort) {

View File

@@ -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) { Error system_execute_line(char* line, uint8_t client, WebUI::AuthenticationLevel auth_level) {
auto resp = new WebUI::ESPResponseStream(client, true); WebUI::ESPResponseStream stream(client, true);
auto ret = system_execute_line(line, resp, auth_level); return system_execute_line(line, &stream, auth_level);
delete resp;
return ret;
} }
void system_execute_startup(char* line) { void system_execute_startup(char* line) {