Merge pull request #1306 from wolfmanjm/upstreamedge
authorJim Morris <morris@wolfman.com>
Wed, 11 Apr 2018 18:32:48 +0000 (19:32 +0100)
committerGitHub <noreply@github.com>
Wed, 11 Apr 2018 18:32:48 +0000 (19:32 +0100)
save some memory in endstops

src/modules/communication/SerialConsole.cpp
src/modules/tools/endstops/Endstops.cpp

index a9e1c7d..d8737c6 100644 (file)
@@ -67,6 +67,11 @@ void SerialConsole::on_idle(void * argument)
     if(halt_flag) {
         halt_flag= false;
         THEKERNEL->call_event(ON_HALT, nullptr);
+        if(THEKERNEL->is_grbl_mode()) {
+            puts("ALARM: Abort during cycle\r\n");
+        } else {
+            puts("HALTED, M999 or $X to exit HALT state\r\n");
+        }
     }
 }
 
index 3a8fca1..07b4ff2 100644 (file)
@@ -202,6 +202,9 @@ bool Endstops::load_old_config()
     // if no pins defined then disable the module
     if(endstops.empty()) return false;
 
+    homing_axis.shrink_to_fit();
+    endstops.shrink_to_fit();
+
     get_global_configs();
 
     if(limit_enabled) {
@@ -362,6 +365,10 @@ bool Endstops::load_config()
         }
     }
 
+    // saves some memory
+    homing_axis.shrink_to_fit();
+    endstops.shrink_to_fit();
+
     // sets some endstop global configs applicable to all endstops
     get_global_configs();