浏览代码

Fix some compiler warnings

Scott Lahteine 7 年前
父节点
当前提交
f5aaa2d6c0
共有 2 个文件被更改,包括 25 次插入23 次删除
  1. 23
    23
      Marlin/src/gcode/feature/trinamic/M911-M915.cpp
  2. 2
    0
      Marlin/src/module/temperature.cpp

+ 23
- 23
Marlin/src/gcode/feature/trinamic/M911-M915.cpp 查看文件

31
 #include "../../queue.h"
31
 #include "../../queue.h"
32
 
32
 
33
 #define M91x_USE(A) (ENABLED(A##_IS_TMC2130) || (ENABLED(A##_IS_TMC2208) && PIN_EXISTS(A##_SERIAL_RX)))
33
 #define M91x_USE(A) (ENABLED(A##_IS_TMC2130) || (ENABLED(A##_IS_TMC2208) && PIN_EXISTS(A##_SERIAL_RX)))
34
+#define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N))
34
 #define M91x_USE_X  (ENABLED(IS_TRAMS) || M91x_USE(X))
35
 #define M91x_USE_X  (ENABLED(IS_TRAMS) || M91x_USE(X))
35
 #define M91x_USE_Y  (ENABLED(IS_TRAMS) || M91x_USE(Y))
36
 #define M91x_USE_Y  (ENABLED(IS_TRAMS) || M91x_USE(Y))
36
 #define M91x_USE_Z  (ENABLED(IS_TRAMS) || M91x_USE(Z))
37
 #define M91x_USE_Z  (ENABLED(IS_TRAMS) || M91x_USE(Z))
37
-#define M91x_USE_E0 (ENABLED(IS_TRAMS) || M91x_USE(E0))
38
+#define M91x_USE_E0 (ENABLED(IS_TRAMS) || M91x_USE_E(0))
38
 
39
 
39
 /**
40
 /**
40
  * M911: Report TMC stepper driver overtemperature pre-warn flag
41
  * M911: Report TMC stepper driver overtemperature pre-warn flag
62
   #if M91x_USE_E0
63
   #if M91x_USE_E0
63
     tmc_report_otpw(stepperE0, TMC_E0);
64
     tmc_report_otpw(stepperE0, TMC_E0);
64
   #endif
65
   #endif
65
-  #if M91x_USE(E1)
66
+  #if M91x_USE_E(1)
66
     tmc_report_otpw(stepperE1, TMC_E1);
67
     tmc_report_otpw(stepperE1, TMC_E1);
67
   #endif
68
   #endif
68
-  #if M91x_USE(E2)
69
+  #if M91x_USE_E(2)
69
     tmc_report_otpw(stepperE2, TMC_E2);
70
     tmc_report_otpw(stepperE2, TMC_E2);
70
   #endif
71
   #endif
71
-  #if M91x_USE(E3)
72
+  #if M91x_USE_E(3)
72
     tmc_report_otpw(stepperE3, TMC_E3);
73
     tmc_report_otpw(stepperE3, TMC_E3);
73
   #endif
74
   #endif
74
-  #if M91x_USE(E4)
75
+  #if M91x_USE_E(4)
75
     tmc_report_otpw(stepperE4, TMC_E4);
76
     tmc_report_otpw(stepperE4, TMC_E4);
76
   #endif
77
   #endif
77
 }
78
 }
105
       #endif
106
       #endif
106
     #endif
107
     #endif
107
 
108
 
108
-    #define M91x_USE_Y (M91x_USE(Y) || ENABLED(IS_TRAMS))
109
     #if M91x_USE_Y || M91x_USE(Y2)
109
     #if M91x_USE_Y || M91x_USE(Y2)
110
       const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10);
110
       const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10);
111
       #if M91x_USE_Y
111
       #if M91x_USE_Y
116
       #endif
116
       #endif
117
     #endif
117
     #endif
118
 
118
 
119
-    #define M91x_USE_Z (M91x_USE(Z) || ENABLED(IS_TRAMS))
120
     #if M91x_USE_Z || M91x_USE(Z2)
119
     #if M91x_USE_Z || M91x_USE(Z2)
121
       const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10);
120
       const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10);
122
       #if M91x_USE_Z
121
       #if M91x_USE_Z
127
       #endif
126
       #endif
128
     #endif
127
     #endif
129
 
128
 
130
-    const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10);
131
-
132
-    #if M91x_USE_E0
133
-      if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0);
134
-    #endif
135
-    #if E_STEPPERS > 1 && M91x_USE(E1)
136
-      if (hasNone || eval == 1 || (hasE && eval == 10)) tmc_clear_otpw(stepperE1, TMC_E1);
137
-    #endif
138
-    #if E_STEPPERS > 2 && M91x_USE(E2)
139
-      if (hasNone || eval == 2 || (hasE && eval == 10)) tmc_clear_otpw(stepperE2, TMC_E2);
140
-    #endif
141
-    #if E_STEPPERS > 3 && M91x_USE(E3)
142
-      if (hasNone || eval == 3 || (hasE && eval == 10)) tmc_clear_otpw(stepperE3, TMC_E3);
143
-    #endif
144
-    #if E_STEPPERS > 4 && M91x_USE(E4)
145
-      if (hasNone || eval == 4 || (hasE && eval == 10)) tmc_clear_otpw(stepperE4, TMC_E4);
129
+    #if M91x_USE_E0 || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4)
130
+      const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10);
131
+      #if M91x_USE_E0
132
+        if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0);
133
+      #endif
134
+      #if M91x_USE_E(1)
135
+        if (hasNone || eval == 1 || (hasE && eval == 10)) tmc_clear_otpw(stepperE1, TMC_E1);
136
+      #endif
137
+      #if M91x_USE_E(2)
138
+        if (hasNone || eval == 2 || (hasE && eval == 10)) tmc_clear_otpw(stepperE2, TMC_E2);
139
+      #endif
140
+      #if M91x_USE_E(3)
141
+        if (hasNone || eval == 3 || (hasE && eval == 10)) tmc_clear_otpw(stepperE3, TMC_E3);
142
+      #endif
143
+      #if M91x_USE_E(4)
144
+        if (hasNone || eval == 4 || (hasE && eval == 10)) tmc_clear_otpw(stepperE4, TMC_E4);
145
+      #endif
146
     #endif
146
     #endif
147
 }
147
 }
148
 
148
 

+ 2
- 0
Marlin/src/module/temperature.cpp 查看文件

1009
     const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]);
1009
     const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]);
1010
     SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]);
1010
     SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]);
1011
   #endif
1011
   #endif
1012
+
1013
+  return 0;
1012
 }
1014
 }
1013
 
1015
 
1014
 #if HAS_HEATED_BED
1016
 #if HAS_HEATED_BED

正在加载...
取消
保存