From 84d185e6725920716d7f7075647d97d815f6bd3f Mon Sep 17 00:00:00 2001 From: bdring Date: Wed, 22 Apr 2020 16:01:05 -0500 Subject: [PATCH] Minor fixes Fixing typo Include machine type MSG with $I response. Stop using the laser mode flag. You don't need it if laser is select by class. --- Grbl_Esp32/Grbl_Esp32.ino | 2 +- Grbl_Esp32/report.cpp | 5 +++++ Grbl_Esp32/report.h | 2 ++ Grbl_Esp32/tools/Laser.cpp | 3 +-- Grbl_Esp32/tools/PWMSpindle.cpp | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Grbl_Esp32/Grbl_Esp32.ino b/Grbl_Esp32/Grbl_Esp32.ino index a3e38a72..5eaa59a1 100644 --- a/Grbl_Esp32/Grbl_Esp32.ino +++ b/Grbl_Esp32/Grbl_Esp32.ino @@ -56,7 +56,7 @@ void setup() { #else #define MACHINE_STRING MACHINE_NAME #endif - grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "Using machine:%s", MACHINE_STRING); + report_machine_type(CLIENT_SERIAL); #endif settings_init(); // Load Grbl settings from EEPROM stepper_init(); // Configure stepper pins and interrupt timers diff --git a/Grbl_Esp32/report.cpp b/Grbl_Esp32/report.cpp index fc9294a2..8fa196ad 100644 --- a/Grbl_Esp32/report.cpp +++ b/Grbl_Esp32/report.cpp @@ -549,6 +549,7 @@ void report_build_info(char* line, uint8_t client) { // These will likely have a comma delimiter to separate them. strcat(build_info, "]\r\n"); grbl_send(client, build_info); // ok to send to all + report_machine_type(client); #if defined (ENABLE_WIFI) grbl_send(client, (char*)wifi_config.info()); #endif @@ -775,6 +776,10 @@ void report_gcode_comment(char* comment) { } } +void report_machine_type(uint8_t client) { + grbl_msg_sendf(client, MSG_LEVEL_INFO, "Using machine:%s", MACHINE_NAME); +} + /* Print a message in hex format diff --git a/Grbl_Esp32/report.h b/Grbl_Esp32/report.h index 2f811013..81c9570b 100644 --- a/Grbl_Esp32/report.h +++ b/Grbl_Esp32/report.h @@ -170,6 +170,8 @@ void report_gcode_comment(char* comment); void report_realtime_debug(); #endif +void report_machine_type(uint8_t client); + void report_hex_msg(char* buf, const char *prefix, int len); char report_get_axis_letter(uint8_t axis); diff --git a/Grbl_Esp32/tools/Laser.cpp b/Grbl_Esp32/tools/Laser.cpp index 36c15211..12abf5b9 100644 --- a/Grbl_Esp32/tools/Laser.cpp +++ b/Grbl_Esp32/tools/Laser.cpp @@ -27,8 +27,7 @@ bool Laser :: isRateAdjusted() { - // must be in $32=1 (laser mode) - return (settings.flags & BITFLAG_LASER_MODE); + return true; // can use M4 (CCW) laser mode. } void Laser :: config_message() { diff --git a/Grbl_Esp32/tools/PWMSpindle.cpp b/Grbl_Esp32/tools/PWMSpindle.cpp index 341d0585..b1fc820b 100644 --- a/Grbl_Esp32/tools/PWMSpindle.cpp +++ b/Grbl_Esp32/tools/PWMSpindle.cpp @@ -107,7 +107,7 @@ float PWMSpindle::set_rpm(float rpm) { // apply override rpm *= (0.010 * sys.spindle_speed_ovr); // Scale by spindle speed override value (percent) - // apply limits limits + // apply limits if ((_min_rpm >= _max_rpm) || (rpm >= _max_rpm)) { rpm = _max_rpm; } else if (rpm != 0.0 && rpm <= _min_rpm) {