瀏覽代碼

Merge pull request #6327 from Bob-the-Kuhn/M43-toggle-&-Z-probe-fixes

M43 Toggle & Z servo test - fix bug & add another check
Scott Lahteine 7 年之前
父節點
當前提交
de569e3d4e
共有 2 個檔案被更改,包括 10 行新增8 行删除
  1. 1
    1
      .travis.yml
  2. 9
    7
      Marlin/Marlin_main.cpp

+ 1
- 1
.travis.yml 查看文件

@@ -334,7 +334,7 @@ script:
334 334
   # RA_CONTROL_PANEL
335 335
   #
336 336
   - restore_configs
337
-  - opt_enable RA_CONTROL_PANEL
337
+  - opt_enable RA_CONTROL_PANEL PINS_DEBUGGING
338 338
   - build_marlin
339 339
   #
340 340
   ######## I2C LCD/PANELS ##############

+ 9
- 7
Marlin/Marlin_main.cpp 查看文件

@@ -5841,12 +5841,11 @@ inline void gcode_M42() {
5841 5841
     #if !(NUM_SERVOS >= 1 && HAS_SERVO_0)
5842 5842
       SERIAL_ERROR_START;
5843 5843
       SERIAL_ERRORLNPGM("SERVO not setup");
5844
+    #elif !HAS_Z_SERVO_ENDSTOP
5845
+      SERIAL_ERROR_START;
5846
+      SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup");
5844 5847
     #else
5845
-
5846
-      #if !defined(z_servo_angle)
5847
-        const int z_servo_angle[2] = Z_SERVO_ANGLES;
5848
-      #endif
5849
-      uint8_t probe_index = code_seen('P') ? code_value_byte() : 0;
5848
+      uint8_t probe_index = code_seen('P') ? code_value_byte() : Z_ENDSTOP_SERVO_NR;
5850 5849
       SERIAL_PROTOCOLLNPGM("Servo probe test");
5851 5850
       SERIAL_PROTOCOLLNPAIR(".  using index:  ", probe_index);
5852 5851
       SERIAL_PROTOCOLLNPAIR(".  deploy angle: ", z_servo_angle[0]);
@@ -5862,7 +5861,6 @@ inline void gcode_M42() {
5862 5861
         probe_inverting = Z_MIN_ENDSTOP_INVERTING;
5863 5862
       #elif ENABLED(Z_MIN_PROBE_ENDSTOP)
5864 5863
         #define PROBE_TEST_PIN Z_MIN_PROBE_PIN
5865
-
5866 5864
         SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN);
5867 5865
         SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)");
5868 5866
         SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: ");
@@ -5887,7 +5885,7 @@ inline void gcode_M42() {
5887 5885
       if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
5888 5886
       refresh_cmd_timeout();
5889 5887
       if (deploy_state != stow_state) {
5890
-        SERIAL_PROTOCOLLNPGM("TLTouch detected");         // BLTouch clone?
5888
+        SERIAL_PROTOCOLLNPGM("BLTouch clone detected");
5891 5889
         if (deploy_state) {
5892 5890
           SERIAL_PROTOCOLLNPGM(".  DEPLOYED state: HIGH (logic 1)");
5893 5891
           SERIAL_PROTOCOLLNPGM(".  STOWED (triggered) state: LOW (logic 0)");
@@ -5896,6 +5894,10 @@ inline void gcode_M42() {
5896 5894
           SERIAL_PROTOCOLLNPGM(".  DEPLOYED state: LOW (logic 0)");
5897 5895
           SERIAL_PROTOCOLLNPGM(".  STOWED (triggered) state: HIGH (logic 1)");
5898 5896
         }
5897
+        #if ENABLED(BLTOUCH)
5898
+          SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true.");
5899
+        #endif
5900
+
5899 5901
       }
5900 5902
       else {                                           // measure active signal length
5901 5903
         servo[probe_index].move(z_servo_angle[0]); //deploy

Loading…
取消
儲存