Browse Source

Permit Stall Sensitivity of 0 (#17722)

Neil van Geffen 4 years ago
parent
commit
c56b66543d
No account linked to committer's email address

+ 22
- 22
Marlin/src/HAL/STM32/SoftwareSerial.cpp View File

47
 // The order is based on (lack of) features and compare channels, we choose the simplest available
47
 // The order is based on (lack of) features and compare channels, we choose the simplest available
48
 // because we only need an update interrupt
48
 // because we only need an update interrupt
49
 #if !defined(TIMER_SERIAL)
49
 #if !defined(TIMER_SERIAL)
50
-#if defined (TIM18_BASE)
50
+#if  defined(TIM18_BASE)
51
 #define TIMER_SERIAL TIM18
51
 #define TIMER_SERIAL TIM18
52
-#elif defined (TIM7_BASE)
52
+#elif defined(TIM7_BASE)
53
 #define TIMER_SERIAL TIM7
53
 #define TIMER_SERIAL TIM7
54
-#elif defined (TIM6_BASE)
54
+#elif defined(TIM6_BASE)
55
 #define TIMER_SERIAL TIM6
55
 #define TIMER_SERIAL TIM6
56
-#elif defined (TIM22_BASE)
56
+#elif defined(TIM22_BASE)
57
 #define TIMER_SERIAL TIM22
57
 #define TIMER_SERIAL TIM22
58
-#elif defined (TIM21_BASE)
58
+#elif defined(TIM21_BASE)
59
 #define TIMER_SERIAL TIM21
59
 #define TIMER_SERIAL TIM21
60
-#elif defined (TIM17_BASE)
60
+#elif defined(TIM17_BASE)
61
 #define TIMER_SERIAL TIM17
61
 #define TIMER_SERIAL TIM17
62
-#elif defined (TIM16_BASE)
62
+#elif defined(TIM16_BASE)
63
 #define TIMER_SERIAL TIM16
63
 #define TIMER_SERIAL TIM16
64
-#elif defined (TIM15_BASE)
64
+#elif defined(TIM15_BASE)
65
 #define TIMER_SERIAL TIM15
65
 #define TIMER_SERIAL TIM15
66
-#elif defined (TIM14_BASE)
66
+#elif defined(TIM14_BASE)
67
 #define TIMER_SERIAL TIM14
67
 #define TIMER_SERIAL TIM14
68
-#elif defined (TIM13_BASE)
68
+#elif defined(TIM13_BASE)
69
 #define TIMER_SERIAL TIM13
69
 #define TIMER_SERIAL TIM13
70
-#elif defined (TIM11_BASE)
70
+#elif defined(TIM11_BASE)
71
 #define TIMER_SERIAL TIM11
71
 #define TIMER_SERIAL TIM11
72
-#elif defined (TIM10_BASE)
72
+#elif defined(TIM10_BASE)
73
 #define TIMER_SERIAL TIM10
73
 #define TIMER_SERIAL TIM10
74
-#elif defined (TIM12_BASE)
74
+#elif defined(TIM12_BASE)
75
 #define TIMER_SERIAL TIM12
75
 #define TIMER_SERIAL TIM12
76
-#elif defined (TIM19_BASE)
76
+#elif defined(TIM19_BASE)
77
 #define TIMER_SERIAL TIM19
77
 #define TIMER_SERIAL TIM19
78
-#elif defined (TIM9_BASE)
78
+#elif defined(TIM9_BASE)
79
 #define TIMER_SERIAL TIM9
79
 #define TIMER_SERIAL TIM9
80
-#elif defined (TIM5_BASE)
80
+#elif defined(TIM5_BASE)
81
 #define TIMER_SERIAL TIM5
81
 #define TIMER_SERIAL TIM5
82
-#elif defined (TIM4_BASE)
82
+#elif defined(TIM4_BASE)
83
 #define TIMER_SERIAL TIM4
83
 #define TIMER_SERIAL TIM4
84
-#elif defined (TIM3_BASE)
84
+#elif defined(TIM3_BASE)
85
 #define TIMER_SERIAL TIM3
85
 #define TIMER_SERIAL TIM3
86
-#elif defined (TIM2_BASE)
86
+#elif defined(TIM2_BASE)
87
 #define TIMER_SERIAL TIM2
87
 #define TIMER_SERIAL TIM2
88
-#elif defined (TIM20_BASE)
88
+#elif defined(TIM20_BASE)
89
 #define TIMER_SERIAL TIM20
89
 #define TIMER_SERIAL TIM20
90
-#elif defined (TIM8_BASE)
90
+#elif defined(TIM8_BASE)
91
 #define TIMER_SERIAL TIM8
91
 #define TIMER_SERIAL TIM8
92
-#elif defined (TIM1_BASE)
92
+#elif defined(TIM1_BASE)
93
 #define TIMER_SERIAL TIM1
93
 #define TIMER_SERIAL TIM1
94
 #else
94
 #else
95
 #error No suitable timer found for SoftwareSerial, define TIMER_SERIAL in variant.h
95
 #error No suitable timer found for SoftwareSerial, define TIMER_SERIAL in variant.h

+ 1
- 1
Marlin/src/core/multi_language.h View File

22
 
22
 
23
 typedef const char Language_Str[];
23
 typedef const char Language_Str[];
24
 
24
 
25
-#if defined(LCD_LANGUAGE_5)
25
+#ifdef LCD_LANGUAGE_5
26
   #define NUM_LANGUAGES 5
26
   #define NUM_LANGUAGES 5
27
 #elif defined(LCD_LANGUAGE_4)
27
 #elif defined(LCD_LANGUAGE_4)
28
   #define NUM_LANGUAGES 4
28
   #define NUM_LANGUAGES 4

+ 3
- 3
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h View File

43
 //
43
 //
44
 // Limit Switches
44
 // Limit Switches
45
 //
45
 //
46
-#if X_STALL_SENSITIVITY
46
+#ifdef X_STALL_SENSITIVITY
47
   #define X_STOP_PIN                  X_DIAG_PIN
47
   #define X_STOP_PIN                  X_DIAG_PIN
48
   #if X_HOME_DIR < 0
48
   #if X_HOME_DIR < 0
49
     #define X_MAX_PIN                      P1_28  // X+
49
     #define X_MAX_PIN                      P1_28  // X+
55
   #define X_MAX_PIN                        P1_28  // X+
55
   #define X_MAX_PIN                        P1_28  // X+
56
 #endif
56
 #endif
57
 
57
 
58
-#if Y_STALL_SENSITIVITY
58
+#ifdef Y_STALL_SENSITIVITY
59
   #define Y_STOP_PIN                  Y_DIAG_PIN
59
   #define Y_STOP_PIN                  Y_DIAG_PIN
60
   #if Y_HOME_DIR < 0
60
   #if Y_HOME_DIR < 0
61
     #define Y_MAX_PIN                      P1_26  // Y+
61
     #define Y_MAX_PIN                      P1_26  // Y+
67
   #define Y_MAX_PIN                        P1_26  // Y+
67
   #define Y_MAX_PIN                        P1_26  // Y+
68
 #endif
68
 #endif
69
 
69
 
70
-#if Z_STALL_SENSITIVITY
70
+#ifdef Z_STALL_SENSITIVITY
71
   #define Z_STOP_PIN                  Z_DIAG_PIN
71
   #define Z_STOP_PIN                  Z_DIAG_PIN
72
   #if Z_HOME_DIR < 0
72
   #if Z_HOME_DIR < 0
73
     #define Z_MAX_PIN                      P1_24  // Z+
73
     #define Z_MAX_PIN                      P1_24  // Z+

+ 3
- 3
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h View File

57
 //
57
 //
58
 // Limit Switches
58
 // Limit Switches
59
 //
59
 //
60
-#if X_STALL_SENSITIVITY
60
+#ifdef X_STALL_SENSITIVITY
61
   #define X_STOP_PIN                  X_DIAG_PIN
61
   #define X_STOP_PIN                  X_DIAG_PIN
62
   #if X_HOME_DIR < 0
62
   #if X_HOME_DIR < 0
63
     #define X_MAX_PIN                      P1_26  // E0DET
63
     #define X_MAX_PIN                      P1_26  // E0DET
68
   #define X_STOP_PIN                       P1_29  // X-STOP
68
   #define X_STOP_PIN                       P1_29  // X-STOP
69
 #endif
69
 #endif
70
 
70
 
71
-#if Y_STALL_SENSITIVITY
71
+#ifdef Y_STALL_SENSITIVITY
72
   #define Y_STOP_PIN                  Y_DIAG_PIN
72
   #define Y_STOP_PIN                  Y_DIAG_PIN
73
   #if Y_HOME_DIR < 0
73
   #if Y_HOME_DIR < 0
74
     #define Y_MAX_PIN                      P1_25  // E1DET
74
     #define Y_MAX_PIN                      P1_25  // E1DET
79
   #define Y_STOP_PIN                       P1_28  // Y-STOP
79
   #define Y_STOP_PIN                       P1_28  // Y-STOP
80
 #endif
80
 #endif
81
 
81
 
82
-#if Z_STALL_SENSITIVITY
82
+#ifdef Z_STALL_SENSITIVITY
83
   #define Z_STOP_PIN                  Z_DIAG_PIN
83
   #define Z_STOP_PIN                  Z_DIAG_PIN
84
   #if Z_HOME_DIR < 0
84
   #if Z_HOME_DIR < 0
85
     #define Z_MAX_PIN                      P1_00  // PWRDET
85
     #define Z_MAX_PIN                      P1_00  // PWRDET

+ 3
- 3
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h View File

58
 //
58
 //
59
 // Limit Switches
59
 // Limit Switches
60
 //
60
 //
61
-#if X_STALL_SENSITIVITY
61
+#ifdef X_STALL_SENSITIVITY
62
   #define X_STOP_PIN                  X_DIAG_PIN
62
   #define X_STOP_PIN                  X_DIAG_PIN
63
   #if X_HOME_DIR < 0
63
   #if X_HOME_DIR < 0
64
     #define X_MAX_PIN                      P1_28  // X+
64
     #define X_MAX_PIN                      P1_28  // X+
70
   #define X_MAX_PIN                        P1_28  // X+
70
   #define X_MAX_PIN                        P1_28  // X+
71
 #endif
71
 #endif
72
 
72
 
73
-#if Y_STALL_SENSITIVITY
73
+#ifdef Y_STALL_SENSITIVITY
74
   #define Y_STOP_PIN                  Y_DIAG_PIN
74
   #define Y_STOP_PIN                  Y_DIAG_PIN
75
   #if Y_HOME_DIR < 0
75
   #if Y_HOME_DIR < 0
76
     #define Y_MAX_PIN                      P1_26  // Y+
76
     #define Y_MAX_PIN                      P1_26  // Y+
82
   #define Y_MAX_PIN                        P1_26  // Y+
82
   #define Y_MAX_PIN                        P1_26  // Y+
83
 #endif
83
 #endif
84
 
84
 
85
-#if Z_STALL_SENSITIVITY
85
+#ifdef Z_STALL_SENSITIVITY
86
   #define Z_STOP_PIN                  Z_DIAG_PIN
86
   #define Z_STOP_PIN                  Z_DIAG_PIN
87
   #if Z_HOME_DIR < 0
87
   #if Z_HOME_DIR < 0
88
     #define Z_MAX_PIN                      P1_24  // Z+
88
     #define Z_MAX_PIN                      P1_24  // Z+

+ 5
- 5
Marlin/src/pins/pins.h View File

1225
   //
1225
   //
1226
   // Auto-assign pins for stallGuard sensorless homing
1226
   // Auto-assign pins for stallGuard sensorless homing
1227
   //
1227
   //
1228
-  #if X2_STALL_SENSITIVITY && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG)
1228
+  #if defined(X2_STALL_SENSITIVITY) && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG)
1229
     #define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG)
1229
     #define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG)
1230
     #if   DIAG_REMAPPED(X2, X_MIN)      // If already remapped in the pins file...
1230
     #if   DIAG_REMAPPED(X2, X_MIN)      // If already remapped in the pins file...
1231
       #define X2_USE_ENDSTOP _XMIN_
1231
       #define X2_USE_ENDSTOP _XMIN_
1294
       #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX)
1294
       #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX)
1295
     #endif
1295
     #endif
1296
   #endif
1296
   #endif
1297
-  #if Y2_STALL_SENSITIVITY && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG)
1297
+  #if defined(Y2_STALL_SENSITIVITY) && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG)
1298
     #define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG)
1298
     #define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG)
1299
     #if   DIAG_REMAPPED(Y2, X_MIN)
1299
     #if   DIAG_REMAPPED(Y2, X_MIN)
1300
       #define Y2_USE_ENDSTOP _XMIN_
1300
       #define Y2_USE_ENDSTOP _XMIN_
1362
       #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX)
1362
       #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX)
1363
     #endif
1363
     #endif
1364
   #endif
1364
   #endif
1365
-  #if Z2_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG)
1365
+  #if defined(Z2_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG)
1366
     #define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG)
1366
     #define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG)
1367
     #if   DIAG_REMAPPED(Z2, X_MIN)
1367
     #if   DIAG_REMAPPED(Z2, X_MIN)
1368
       #define Z2_USE_ENDSTOP _XMIN_
1368
       #define Z2_USE_ENDSTOP _XMIN_
1431
       #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX)
1431
       #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX)
1432
     #endif
1432
     #endif
1433
   #endif
1433
   #endif
1434
-  #if Z3_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG)
1434
+  #if defined(Z3_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG)
1435
     #define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG)
1435
     #define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG)
1436
     #if   DIAG_REMAPPED(Z3, X_MIN)
1436
     #if   DIAG_REMAPPED(Z3, X_MIN)
1437
       #define Z3_USE_ENDSTOP _XMIN_
1437
       #define Z3_USE_ENDSTOP _XMIN_
1498
       #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX)
1498
       #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX)
1499
     #endif
1499
     #endif
1500
   #endif
1500
   #endif
1501
-  #if Z4_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG)
1501
+  #if defined(Z4_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG)
1502
     #define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG)
1502
     #define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG)
1503
     #if   DIAG_REMAPPED(Z4, X_MIN)
1503
     #if   DIAG_REMAPPED(Z4, X_MIN)
1504
       #define Z4_USE_ENDSTOP _XMIN_
1504
       #define Z4_USE_ENDSTOP _XMIN_

+ 3
- 3
Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h View File

51
 //
51
 //
52
 // Limit Switches
52
 // Limit Switches
53
 //
53
 //
54
-#if X_STALL_SENSITIVITY
54
+#ifdef X_STALL_SENSITIVITY
55
   #define X_STOP_PIN                  X_DIAG_PIN
55
   #define X_STOP_PIN                  X_DIAG_PIN
56
   #if X_HOME_DIR < 0
56
   #if X_HOME_DIR < 0
57
     #define X_MAX_PIN                       PE15  // E0
57
     #define X_MAX_PIN                       PE15  // E0
63
   #define X_MAX_PIN                         PE15  // E0
63
   #define X_MAX_PIN                         PE15  // E0
64
 #endif
64
 #endif
65
 
65
 
66
-#if Y_STALL_SENSITIVITY
66
+#ifdef Y_STALL_SENSITIVITY
67
   #define Y_STOP_PIN                  Y_DIAG_PIN
67
   #define Y_STOP_PIN                  Y_DIAG_PIN
68
   #if Y_HOME_DIR < 0
68
   #if Y_HOME_DIR < 0
69
     #define Y_MAX_PIN                       PE10  // E1
69
     #define Y_MAX_PIN                       PE10  // E1
75
   #define Y_MAX_PIN                         PE10  // E1
75
   #define Y_MAX_PIN                         PE10  // E1
76
 #endif
76
 #endif
77
 
77
 
78
-#if Z_STALL_SENSITIVITY
78
+#ifdef Z_STALL_SENSITIVITY
79
   #define Z_STOP_PIN                  Z_DIAG_PIN
79
   #define Z_STOP_PIN                  Z_DIAG_PIN
80
   #if Z_HOME_DIR < 0
80
   #if Z_HOME_DIR < 0
81
     #define Z_MAX_PIN                       PG5   // E2
81
     #define Z_MAX_PIN                       PG5   // E2

+ 1
- 1
buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp View File

34
 extern "C" {
34
 extern "C" {
35
 #endif
35
 #endif
36
 
36
 
37
-#if defined(ARDUINO_STEVAL)
37
+#ifdef ARDUINO_STEVAL
38
 // Pin number
38
 // Pin number
39
 // This array allows to wrap Arduino pin number(Dx or x)
39
 // This array allows to wrap Arduino pin number(Dx or x)
40
 // to STM32 PinName (PX_n)
40
 // to STM32 PinName (PX_n)

+ 1
- 1
buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h View File

41
 /*----------------------------------------------------------------------------
41
 /*----------------------------------------------------------------------------
42
  *        Pins
42
  *        Pins
43
  *----------------------------------------------------------------------------*/
43
  *----------------------------------------------------------------------------*/
44
-#if defined(ARDUINO_STEVAL)
44
+#ifdef ARDUINO_STEVAL
45
 
45
 
46
 
46
 
47
 /*----------------------------------------------------------------------------
47
 /*----------------------------------------------------------------------------

Loading…
Cancel
Save