From f2432ea9a23c79d13ca987dd1cc99a4638aea53a Mon Sep 17 00:00:00 2001 From: ColPaulR <35244547+ColPaulR@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:21:02 -0400 Subject: [PATCH 01/14] Resynced with bdring & updated ProcessSettings.cpp --- FluidNC/src/ProcessSettings.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/FluidNC/src/ProcessSettings.cpp b/FluidNC/src/ProcessSettings.cpp index 5016ab0fa..90dc31a98 100644 --- a/FluidNC/src/ProcessSettings.cpp +++ b/FluidNC/src/ProcessSettings.cpp @@ -34,8 +34,12 @@ // WU Readable and writable as user and admin // WA Readable as user and admin, writable as admin +static Error switchInchMM(const char* value, AuthenticationLevel auth_level, Channel& out); + static Error fakeMaxSpindleSpeed(const char* value, AuthenticationLevel auth_level, Channel& out); +static Error report_init_message_cmd(const char* value, AuthenticationLevel auth_level, Channel& out); + // If authentication is disabled, auth_level will be LEVEL_ADMIN static bool auth_failed(Word* w, const char* value, AuthenticationLevel auth_level) { permissions_t permissions = w->getPermissions(); @@ -193,9 +197,13 @@ static void show_settings(Channel& out, type_t type) { show_setting(s->getGrblName(), s->getCompatibleValue(), NULL, out); } } + // Print Report/Inches + switchInchMM(NULL, AuthenticationLevel::LEVEL_ADMIN, out); + // need this per issue #1036 fakeMaxSpindleSpeed(NULL, AuthenticationLevel::LEVEL_ADMIN, out); } + static Error report_normal_settings(const char* value, AuthenticationLevel auth_level, Channel& out) { show_settings(out, GRBL); // GRBL non-axis settings return Error::Ok; @@ -705,6 +713,22 @@ static Error dump_config(const char* value, AuthenticationLevel auth_level, Chan return Error::Ok; } +static Error report_init_message_cmd(const char* value, AuthenticationLevel auth_level, Channel& out) { + report_init_message(out); + + return Error::Ok; +} + +static Error switchInchMM(const char* value, AuthenticationLevel auth_level, Channel& out) { + if (!value) { + log_stream(out, "$13=" << (config->_reportInches ? "1" : "0")); + } else { + config->_reportInches = ((value[0]=='1') ? true : false); + } + + return Error::Ok; +} + static Error fakeMaxSpindleSpeed(const char* value, AuthenticationLevel auth_level, Channel& out) { if (!value) { log_stream(out, "$30=" << spindle->maxSpeed()); @@ -837,9 +861,12 @@ void make_user_commands() { new UserCommand("RI", "Report/Interval", setReportInterval, anyState); + new UserCommand("13", "Report/Inches", switchInchMM, notIdleOrAlarm); new UserCommand("30", "FakeMaxSpindleSpeed", fakeMaxSpindleSpeed, notIdleOrAlarm); new UserCommand("32", "FakeLaserMode", fakeLaserMode, notIdleOrAlarm); + new UserCommand("GS", "GRBL/Show", report_init_message_cmd, notIdleOrAlarm); + new AsyncUserCommand("J", "Jog", doJog, notIdleOrJog); new AsyncUserCommand("G", "GCode/Modes", report_gcode, anyState); }; From 1af90c231fc3f3e625c791be1a2e9fb52c649a85 Mon Sep 17 00:00:00 2001 From: Joacim Breiler Date: Sat, 7 Dec 2024 10:42:05 +0100 Subject: [PATCH 02/14] Do not end motion on jog cancel --- FluidNC/src/Protocol.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FluidNC/src/Protocol.cpp b/FluidNC/src/Protocol.cpp index 2f9325a8c..dd6a38822 100644 --- a/FluidNC/src/Protocol.cpp +++ b/FluidNC/src/Protocol.cpp @@ -492,7 +492,10 @@ static void protocol_start_holding() { } static void protocol_cancel_jogging() { - if (!sys.suspend.bit.motionCancel) { + if (!(sys.suspend.bit.motionCancel || sys.suspend.bit.jogCancel)) { // Block, if already holding. + sys.step_control = {}; + Stepper::update_plan_block_parameters(); + sys.step_control.executeHold = true; // Initiate suspend state with active flag. sys.suspend.bit.jogCancel = true; } } @@ -525,7 +528,6 @@ void protocol_do_motion_cancel() { break; case State::Jog: - protocol_start_holding(); protocol_cancel_jogging(); // When jogging, we do not set motionCancel, hence return not break return; @@ -571,7 +573,6 @@ static void protocol_do_feedhold() { break; case State::Jog: - protocol_start_holding(); protocol_cancel_jogging(); return; // Do not change the state to Hold } @@ -623,7 +624,6 @@ static void protocol_do_safety_door() { protocol_start_holding(); break; case State::Jog: - protocol_start_holding(); protocol_cancel_jogging(); break; } From 1c2caed2edb7e4788fced8e14e54dfcda18ef4e5 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Tue, 10 Dec 2024 10:15:37 -1000 Subject: [PATCH 03/14] Fix #1385 - I2SO synchronous_write was not waiting long enough --- FluidNC/esp32/i2s_engine.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/FluidNC/esp32/i2s_engine.c b/FluidNC/esp32/i2s_engine.c index e80db4ad2..7ff4d202c 100644 --- a/FluidNC/esp32/i2s_engine.c +++ b/FluidNC/esp32/i2s_engine.c @@ -159,14 +159,10 @@ static int i2s_out_start() { static bool timer_running = false; -// -// External functions -// +// i2s_out_delay() is used by synchronous_write(), to ensure that that +// the newly-written data has arrived at the shift register output void i2s_out_delay() { - // Depending on the timing, it may not be reflected immediately, - // so wait twice as long just in case. - uint32_t wait_counts = timer_running ? FIFO_THRESHOLD + FIFO_RELOAD : 2; - delay_us(I2S_OUT_USEC_PER_PULSE * wait_counts); + delay_us((FIFO_LENGTH + FIFO_RELOAD) * (I2S_OUT_USEC_PER_PULSE / 2)); } void IRAM_ATTR i2s_out_write(pinnum_t pin, uint8_t val) { From 748555cecd55f439e95695d36fccf74e51968403 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Tue, 10 Dec 2024 10:17:21 -1000 Subject: [PATCH 04/14] More aggressive wco change reporting --- FluidNC/src/GCode.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FluidNC/src/GCode.cpp b/FluidNC/src/GCode.cpp index 17e6e3bc0..d11980720 100644 --- a/FluidNC/src/GCode.cpp +++ b/FluidNC/src/GCode.cpp @@ -1603,7 +1603,7 @@ Error gc_execute_line(char* line) { // NOTE: Pass zero spindle speed for all restricted laser motions. if (!disableLaser) { pl_data->spindle_speed = gc_state.spindle_speed; // Record data for planner use. - } // else { pl_data->spindle_speed = 0.0; } // Initialized as zero already. + } // else { pl_data->spindle_speed = 0.0; } // Initialized as zero already. // [5. Select tool ]: NOT SUPPORTED. Only tracks tool value. // [M6. Change tool ]: if (gc_block.modal.tool_change == ToolChange::Enable) { @@ -1627,9 +1627,9 @@ Error gc_execute_line(char* line) { } if (gc_block.modal.set_tool_number == SetToolNumber::Enable) { gc_state.selected_tool = gc_block.values.q; - bool stopped_spindle = false; // was spindle stopped via the change - bool new_spindle = false; // was the spindle changed - protocol_buffer_synchronize(); // wait for motion in buffer to finish + bool stopped_spindle = false; // was spindle stopped via the change + bool new_spindle = false; // was the spindle changed + protocol_buffer_synchronize(); // wait for motion in buffer to finish Spindles::Spindle::switchSpindle(gc_state.selected_tool, Spindles::SpindleFactory::objects(), spindle, stopped_spindle, new_spindle); if (stopped_spindle) { gc_block.modal.spindle = SpindleState::Disable; @@ -1786,10 +1786,10 @@ Error gc_execute_line(char* line) { switch (gc_block.non_modal_command) { case NonModal::SetCoordinateData: coords[coord_select]->set(coord_data); + gc_wco_changed(); // Update system coordinate system if currently active. if (gc_state.modal.coord_select == coord_select) { copyAxes(gc_state.coord_system, coord_data); - gc_wco_changed(); } break; case NonModal::GoHome0: From 726983be1ffe8f9223b8e93c61a1d83770c3ba17 Mon Sep 17 00:00:00 2001 From: bdring Date: Wed, 11 Dec 2024 13:49:34 -0600 Subject: [PATCH 05/14] Added $32 read only proxy --- FluidNC/src/SettingsDefinitions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/FluidNC/src/SettingsDefinitions.cpp b/FluidNC/src/SettingsDefinitions.cpp index f17b0450a..e5b331820 100644 --- a/FluidNC/src/SettingsDefinitions.cpp +++ b/FluidNC/src/SettingsDefinitions.cpp @@ -116,4 +116,5 @@ void make_settings() { INT_PROXY("21", "Grbl/HardLimitsEnable", config._axes->hasHardLimits()) INT_PROXY("22", "Grbl/HomingCycleEnable", (bool)Axes::homingMask) INT_PROXY("23", "Grbl/HomingInvertMask", Homing::direction_mask) + INT_PROXY("32", "Grbl/LaserMode", spindle->isRateAdjusted()) } From 08f99fcb36b42fd6751191de885e1401b1e18975 Mon Sep 17 00:00:00 2001 From: bdring Date: Wed, 11 Dec 2024 15:05:22 -0600 Subject: [PATCH 06/14] Update GCode.cpp --- FluidNC/src/GCode.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FluidNC/src/GCode.cpp b/FluidNC/src/GCode.cpp index d11980720..0c1436ea8 100644 --- a/FluidNC/src/GCode.cpp +++ b/FluidNC/src/GCode.cpp @@ -64,7 +64,9 @@ gc_modal_t modal_defaults = { void gc_init() { // Reset parser state: + auto save_tlo = gc_state.tool_length_offset; // we want TLO to persist until reboot. memset(&gc_state, 0, sizeof(parser_state_t)); + gc_state.tool_length_offset = save_tlo; // Load default G54 coordinate system. gc_state.modal = modal_defaults; From 2d569cd461ae79d60d36b1cae092eadc39828033 Mon Sep 17 00:00:00 2001 From: bdring Date: Thu, 12 Dec 2024 13:35:18 -0600 Subject: [PATCH 07/14] Block homing with certain control switches Door, Hold, E-Stop and fault control switches block homing. --- FluidNC/src/Control.cpp | 10 ++++++++++ FluidNC/src/Control.h | 1 + FluidNC/src/ProcessSettings.cpp | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/FluidNC/src/Control.cpp b/FluidNC/src/Control.cpp index e71cd8ab0..6989ac21d 100644 --- a/FluidNC/src/Control.cpp +++ b/FluidNC/src/Control.cpp @@ -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()) { diff --git a/FluidNC/src/Control.h b/FluidNC/src/Control.h index 78cc386a0..a425e3841 100644 --- a/FluidNC/src/Control.h +++ b/FluidNC/src/Control.h @@ -22,6 +22,7 @@ class Control : public Configuration::Configurable { bool stuck(); bool safety_door_ajar(); + bool pins_block_reset(); std::string report_status(); diff --git a/FluidNC/src/ProcessSettings.cpp b/FluidNC/src/ProcessSettings.cpp index f080ac512..70c5f14a6 100644 --- a/FluidNC/src/ProcessSettings.cpp +++ b/FluidNC/src/ProcessSettings.cpp @@ -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 auto n_axis = Axes::_numberAxis; From 7b56b8fd41d533af8e3e32ebf1810805d9729646 Mon Sep 17 00:00:00 2001 From: bdring Date: Fri, 13 Dec 2024 13:58:25 -0600 Subject: [PATCH 08/14] Changed wording --- FluidNC/src/Control.cpp | 4 ++-- FluidNC/src/Control.h | 2 +- FluidNC/src/ProcessSettings.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FluidNC/src/Control.cpp b/FluidNC/src/Control.cpp index 6989ac21d..e3c0725e4 100644 --- a/FluidNC/src/Control.cpp +++ b/FluidNC/src/Control.cpp @@ -42,8 +42,8 @@ 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 +bool Control::pins_block_unlock() { + std::string blockers("DHFE"); // Door, Hold, Fault, E-Stop block unlock and homing for (auto pin : _pins) { if (pin->get() && blockers.find(pin->letter()) != std::string::npos) { return true; diff --git a/FluidNC/src/Control.h b/FluidNC/src/Control.h index a425e3841..470a732ec 100644 --- a/FluidNC/src/Control.h +++ b/FluidNC/src/Control.h @@ -22,7 +22,7 @@ class Control : public Configuration::Configurable { bool stuck(); bool safety_door_ajar(); - bool pins_block_reset(); + bool pins_block_unlock(); std::string report_status(); diff --git a/FluidNC/src/ProcessSettings.cpp b/FluidNC/src/ProcessSettings.cpp index 70c5f14a6..484842b42 100644 --- a/FluidNC/src/ProcessSettings.cpp +++ b/FluidNC/src/ProcessSettings.cpp @@ -378,7 +378,7 @@ static Error cmd_log_verbose(const char* value, AuthenticationLevel auth_level, } static Error home(AxisMask axisMask, Channel& out) { // see if blocking control switches are active - if (config->_control->pins_block_reset()) { + if (config->_control->pins_block_unlock()) { return Error::CheckControlPins; } if (axisMask != Machine::Homing::AllCycles) { // if not AllCycles we need to make sure the cycle is not prohibited From 241481355894a3f3731121bbb293dfe4f4dba6a4 Mon Sep 17 00:00:00 2001 From: bdring Date: Sat, 14 Dec 2024 10:05:35 -0600 Subject: [PATCH 09/14] Removed Door and Hold Door and Hold are already handled sufficiently. --- FluidNC/src/Control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FluidNC/src/Control.cpp b/FluidNC/src/Control.cpp index e3c0725e4..008fc46f2 100644 --- a/FluidNC/src/Control.cpp +++ b/FluidNC/src/Control.cpp @@ -43,7 +43,7 @@ std::string Control::report_status() { } bool Control::pins_block_unlock() { - std::string blockers("DHFE"); // Door, Hold, Fault, E-Stop block unlock and homing + std::string blockers("FE"); // Fault, E-Stop block unlock and homing for (auto pin : _pins) { if (pin->get() && blockers.find(pin->letter()) != std::string::npos) { return true; From 1322144ff371eb21c5b1c3f8c8c964731f3498d6 Mon Sep 17 00:00:00 2001 From: Mike Melancon Date: Mon, 16 Dec 2024 14:53:16 -0600 Subject: [PATCH 10/14] Remove extra ': ' from JSON --- FluidNC/src/WebUI/WifiConfig.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/FluidNC/src/WebUI/WifiConfig.cpp b/FluidNC/src/WebUI/WifiConfig.cpp index f424e86c7..d1d1701a3 100644 --- a/FluidNC/src/WebUI/WifiConfig.cpp +++ b/FluidNC/src/WebUI/WifiConfig.cpp @@ -255,16 +255,16 @@ namespace WebUI { modeName = "???"; } - j.id_value_object("Phy Mode: ", modeName); - j.id_value_object("Channel: ", WiFi.channel()); + j.id_value_object("Phy Mode", modeName); + j.id_value_object("Channel", WiFi.channel()); tcpip_adapter_dhcp_status_t dhcp_status; tcpip_adapter_dhcpc_get_status(TCPIP_ADAPTER_IF_STA, &dhcp_status); - j.id_value_object("IP Mode: ", (dhcp_status == TCPIP_ADAPTER_DHCP_STARTED ? "DHCP" : "Static")); - j.id_value_object("IP: ", IP_string(WiFi.localIP())); - j.id_value_object("Gateway: ", IP_string(WiFi.gatewayIP())); - j.id_value_object("Mask: ", IP_string(WiFi.subnetMask())); - j.id_value_object("DNS: ", IP_string(WiFi.dnsIP())); + j.id_value_object("IP Mode", (dhcp_status == TCPIP_ADAPTER_DHCP_STARTED ? "DHCP" : "Static")); + j.id_value_object("IP", IP_string(WiFi.localIP())); + j.id_value_object("Gateway", IP_string(WiFi.gatewayIP())); + j.id_value_object("Mask", IP_string(WiFi.subnetMask())); + j.id_value_object("DNS", IP_string(WiFi.dnsIP())); } //this is web command so connection => no command j.id_value_object("Disabled Mode", std::string("AP (") + WiFi.softAPmacAddress().c_str() + ")"); @@ -275,9 +275,9 @@ namespace WebUI { wifi_country_t country; esp_wifi_get_config(WIFI_IF_AP, &conf); esp_wifi_get_country(&country); - j.id_value_object("SSID: ", (const char*)conf.ap.ssid); - j.id_value_object("Visible: ", (conf.ap.ssid_hidden == 0 ? "Yes" : "No")); - j.id_value_object("Radio country set: ", + j.id_value_object("SSID", (const char*)conf.ap.ssid); + j.id_value_object("Visible", (conf.ap.ssid_hidden == 0 ? "Yes" : "No")); + j.id_value_object("Radio country set", std::string("") + country.cc[0] + country.cc[1] + " (channels " + std::to_string(country.schan) + "-" + std::to_string((country.schan + country.nchan - 1)) + ", max power " + std::to_string(country.max_tx_power) + "dBm)"); From 4eec327c347132753dd46ceff4603e48e55ebd4e Mon Sep 17 00:00:00 2001 From: bdring Date: Tue, 17 Dec 2024 11:26:32 -0600 Subject: [PATCH 11/14] Adding a default, no I/O, config.yaml to the filesystem Having a default config will prevent users from getting errors the first time they load FluidNC. It will also be a helpful starting point for creating their first file. --- FluidNC/data/config.yaml | 156 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 FluidNC/data/config.yaml diff --git a/FluidNC/data/config.yaml b/FluidNC/data/config.yaml new file mode 100644 index 000000000..27008cf42 --- /dev/null +++ b/FluidNC/data/config.yaml @@ -0,0 +1,156 @@ +board: None +name: Default (Test Drive no I/O) +meta: +stepping: + engine: RMT + idle_ms: 255 + pulse_us: 4 + dir_delay_us: 0 + disable_delay_us: 0 + segments: 12 + +spi: + miso_pin: NO_PIN + mosi_pin: NO_PIN + sck_pin: NO_PIN + +sdcard: + cs_pin: NO_PIN + card_detect_pin: NO_PIN + frequency_hz: 8000000 + +kinematics: + Cartesian: + +axes: + shared_stepper_disable_pin: NO_PIN + shared_stepper_reset_pin: NO_PIN + homing_runs: 2 + x: + steps_per_mm: 80.000000 + max_rate_mm_per_min: 1000.000000 + acceleration_mm_per_sec2: 25.000000 + max_travel_mm: 1000.000000 + soft_limits: false + motor0: + limit_neg_pin: NO_PIN + limit_pos_pin: NO_PIN + limit_all_pin: NO_PIN + hard_limits: false + pulloff_mm: 1.000000 + null_motor: + + y: + steps_per_mm: 80.000000 + max_rate_mm_per_min: 1000.000000 + acceleration_mm_per_sec2: 25.000000 + max_travel_mm: 1000.000000 + soft_limits: false + motor0: + limit_neg_pin: NO_PIN + limit_pos_pin: NO_PIN + limit_all_pin: NO_PIN + hard_limits: false + pulloff_mm: 1.000000 + null_motor: + + z: + steps_per_mm: 80.000000 + max_rate_mm_per_min: 1000.000000 + acceleration_mm_per_sec2: 25.000000 + max_travel_mm: 1000.000000 + soft_limits: false + motor0: + limit_neg_pin: NO_PIN + limit_pos_pin: NO_PIN + limit_all_pin: NO_PIN + hard_limits: false + pulloff_mm: 1.000000 + null_motor: + +control: + safety_door_pin: NO_PIN + reset_pin: NO_PIN + feed_hold_pin: NO_PIN + cycle_start_pin: NO_PIN + macro0_pin: NO_PIN + macro1_pin: NO_PIN + macro2_pin: NO_PIN + macro3_pin: NO_PIN + fault_pin: NO_PIN + estop_pin: NO_PIN + +coolant: + flood_pin: NO_PIN + mist_pin: NO_PIN + delay_ms: 0 + +probe: + pin: NO_PIN + toolsetter_pin: NO_PIN + check_mode_start: true + hard_stop: false + +macros: + startup_line0: + startup_line1: + Macro0: + Macro1: + Macro2: + Macro3: + after_homing: + after_reset: + after_unlock: + +start: + must_home: false + deactivate_parking: false + check_limits: true + +parking: + enable: false + axis: Z + target_mpos_mm: -5.000000 + rate_mm_per_min: 800.000000 + pullout_distance_mm: 5.000000 + pullout_rate_mm_per_min: 250.000000 + +user_outputs: + analog0_pin: NO_PIN + analog1_pin: NO_PIN + analog2_pin: NO_PIN + analog3_pin: NO_PIN + analog0_hz: 5000 + analog1_hz: 5000 + analog2_hz: 5000 + analog3_hz: 5000 + digital0_pin: NO_PIN + digital1_pin: NO_PIN + digital2_pin: NO_PIN + digital3_pin: NO_PIN + digital4_pin: NO_PIN + digital5_pin: NO_PIN + digital6_pin: NO_PIN + digital7_pin: NO_PIN + +user_inputs: + analog0_pin: NO_PIN + analog1_pin: NO_PIN + analog2_pin: NO_PIN + analog3_pin: NO_PIN + digital0_pin: NO_PIN + digital1_pin: NO_PIN + digital2_pin: NO_PIN + digital3_pin: NO_PIN + digital4_pin: NO_PIN + digital5_pin: NO_PIN + digital6_pin: NO_PIN + digital7_pin: NO_PIN + +arc_tolerance_mm: 0.002000 +junction_deviation_mm: 0.010000 +verbose_errors: true +report_inches: false +enable_parking_override_control: false +use_line_numbers: false +planner_blocks: 16 From ae0055d5c1d40c4e9a4dc661ef1f587e32ccb625 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Sun, 22 Dec 2024 18:36:50 -1000 Subject: [PATCH 12/14] Case-independent GCode file extensions --- FluidNC/src/Channel.cpp | 6 +++++- FluidNC/src/Channel.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/FluidNC/src/Channel.cpp b/FluidNC/src/Channel.cpp index 1d626beda..80cd8fd96 100644 --- a/FluidNC/src/Channel.cpp +++ b/FluidNC/src/Channel.cpp @@ -9,6 +9,7 @@ #include "Logging.h" #include "Job.h" #include +#include void Channel::flushRx() { _linelen = 0; @@ -328,7 +329,7 @@ void Channel::sendLine(MsgLevel level, const std::string& line) { } } -bool Channel::is_visible(const std::string& stem, const std::string& extension, bool isdir) { +bool Channel::is_visible(const std::string& stem, std::string extension, bool isdir) { if (stem.length() && stem[0] == '.') { // Exclude hidden files and directories return false; @@ -341,6 +342,9 @@ bool Channel::is_visible(const std::string& stem, const std::string& extension, return true; } + // Convert extension to canonical lower case format + std::transform(extension.begin(), extension.end(), extension.begin(), [](unsigned char c) { return std::tolower(c); }); + // common gcode extensions std::string_view extensions(".g .gc .gco .gcode .nc .ngc .ncc .txt .cnc .tap"); int pos = 0; diff --git a/FluidNC/src/Channel.h b/FluidNC/src/Channel.h index 2eae69485..0a3a6c703 100644 --- a/FluidNC/src/Channel.h +++ b/FluidNC/src/Channel.h @@ -137,7 +137,7 @@ class Channel : public Stream { return readBytes(buffer, length); } - virtual bool is_visible(const std::string& stem, const std::string& extension, bool isdir); + virtual bool is_visible(const std::string& stem, std::string extension, bool isdir); size_t timedReadBytes(uint8_t* buffer, size_t length, TickType_t timeout) { return timedReadBytes(reinterpret_cast(buffer), length, timeout); From 5702c1a010fbcad079989e3c94e72a55a587fd59 Mon Sep 17 00:00:00 2001 From: bdring Date: Fri, 27 Dec 2024 08:08:57 -0600 Subject: [PATCH 13/14] Remove end motion --- FluidNC/src/Protocol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FluidNC/src/Protocol.cpp b/FluidNC/src/Protocol.cpp index dd6a38822..383e9d6c9 100644 --- a/FluidNC/src/Protocol.cpp +++ b/FluidNC/src/Protocol.cpp @@ -485,7 +485,7 @@ static void protocol_start_holding() { if (!(sys.suspend.bit.motionCancel || sys.suspend.bit.jogCancel)) { // Block, if already holding. sys.step_control = {}; if (!Stepper::update_plan_block_parameters()) { // Notify stepper module to recompute for hold deceleration. - sys.step_control.endMotion = true; + //sys.step_control.endMotion = true; } sys.step_control.executeHold = true; // Initiate suspend state with active flag. } @@ -496,7 +496,7 @@ static void protocol_cancel_jogging() { sys.step_control = {}; Stepper::update_plan_block_parameters(); sys.step_control.executeHold = true; // Initiate suspend state with active flag. - sys.suspend.bit.jogCancel = true; + sys.suspend.bit.jogCancel = true; } } From 8b0f3218bad1c2e24e0a0652db784c26f5f73e81 Mon Sep 17 00:00:00 2001 From: bdring Date: Fri, 27 Dec 2024 12:28:49 -0600 Subject: [PATCH 14/14] Cleanup --- FluidNC/src/Protocol.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/FluidNC/src/Protocol.cpp b/FluidNC/src/Protocol.cpp index 383e9d6c9..98548f5d5 100644 --- a/FluidNC/src/Protocol.cpp +++ b/FluidNC/src/Protocol.cpp @@ -484,9 +484,7 @@ static void protocol_do_alarm(void* alarmVoid) { static void protocol_start_holding() { if (!(sys.suspend.bit.motionCancel || sys.suspend.bit.jogCancel)) { // Block, if already holding. sys.step_control = {}; - if (!Stepper::update_plan_block_parameters()) { // Notify stepper module to recompute for hold deceleration. - //sys.step_control.endMotion = true; - } + Stepper::update_plan_block_parameters(); sys.step_control.executeHold = true; // Initiate suspend state with active flag. } }