瀏覽代碼

Fix some warnings, Melzi pins

Jason Smith 5 年之前
父節點
當前提交
c305c2cc6b

+ 1
- 1
Marlin/src/feature/dac/stepper_dac.cpp 查看文件

68
 void dac_current_raw(uint8_t channel, uint16_t val) {
68
 void dac_current_raw(uint8_t channel, uint16_t val) {
69
   if (!dac_present) return;
69
   if (!dac_present) return;
70
 
70
 
71
-  NOMORE(val, DAC_STEPPER_MAX);
71
+  NOMORE(val, uint16_t(DAC_STEPPER_MAX));
72
 
72
 
73
   mcp4728_analogWrite(dac_order[channel], val);
73
   mcp4728_analogWrite(dac_order[channel], val);
74
   mcp4728_simpleCommand(UPDATE);
74
   mcp4728_simpleCommand(UPDATE);

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

1395
 
1395
 
1396
       #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1396
       #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1397
         const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z);
1397
         const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z);
1398
-      #else
1398
+      #elif DISABLED(MESH_BED_LEVELING)
1399
         constexpr float fade_scaling_factor = 1.0;
1399
         constexpr float fade_scaling_factor = 1.0;
1400
       #endif
1400
       #endif
1401
 
1401
 
1432
 
1432
 
1433
         #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1433
         #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1434
           const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z);
1434
           const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z);
1435
-        #else
1435
+        #elif DISABLED(MESH_BED_LEVELING)
1436
           constexpr float fade_scaling_factor = 1.0;
1436
           constexpr float fade_scaling_factor = 1.0;
1437
         #endif
1437
         #endif
1438
 
1438
 

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

2912
     ) {
2912
     ) {
2913
       #if TEMP_RESIDENCY_TIME > 0
2913
       #if TEMP_RESIDENCY_TIME > 0
2914
         millis_t residency_start_ms = 0;
2914
         millis_t residency_start_ms = 0;
2915
+        bool first_loop = true;
2915
         // Loop until the temperature has stabilized
2916
         // Loop until the temperature has stabilized
2916
         #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL))
2917
         #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL))
2917
       #else
2918
       #else
2929
       #endif
2930
       #endif
2930
 
2931
 
2931
       float target_temp = -1.0, old_temp = 9999.0;
2932
       float target_temp = -1.0, old_temp = 9999.0;
2932
-      bool wants_to_cool = false, first_loop = true;
2933
+      bool wants_to_cool = false;
2933
       wait_for_heatup = true;
2934
       wait_for_heatup = true;
2934
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
2935
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
2935
       do {
2936
       do {
2982
             residency_start_ms = now;
2983
             residency_start_ms = now;
2983
           }
2984
           }
2984
 
2985
 
2986
+          first_loop = false;
2987
+
2985
         #endif
2988
         #endif
2986
 
2989
 
2987
         // Prevent a wait-forever situation if R is misused i.e. M109 R0
2990
         // Prevent a wait-forever situation if R is misused i.e. M109 R0
3002
           }
3005
           }
3003
         #endif
3006
         #endif
3004
 
3007
 
3005
-        first_loop = false;
3006
-
3007
       } while (wait_for_heatup && TEMP_CONDITIONS);
3008
       } while (wait_for_heatup && TEMP_CONDITIONS);
3008
 
3009
 
3009
       if (wait_for_heatup) {
3010
       if (wait_for_heatup) {
3151
     bool Temperature::wait_for_chamber(const bool no_wait_for_cooling/*=true*/) {
3152
     bool Temperature::wait_for_chamber(const bool no_wait_for_cooling/*=true*/) {
3152
       #if TEMP_CHAMBER_RESIDENCY_TIME > 0
3153
       #if TEMP_CHAMBER_RESIDENCY_TIME > 0
3153
         millis_t residency_start_ms = 0;
3154
         millis_t residency_start_ms = 0;
3155
+        bool first_loop = true;
3154
         // Loop until the temperature has stabilized
3156
         // Loop until the temperature has stabilized
3155
         #define TEMP_CHAMBER_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL))
3157
         #define TEMP_CHAMBER_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL))
3156
       #else
3158
       #else
3159
       #endif
3161
       #endif
3160
 
3162
 
3161
       float target_temp = -1, old_temp = 9999;
3163
       float target_temp = -1, old_temp = 9999;
3162
-      bool wants_to_cool = false, first_loop = true;
3164
+      bool wants_to_cool = false;
3163
       wait_for_heatup = true;
3165
       wait_for_heatup = true;
3164
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
3166
       millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
3165
 
3167
 
3212
             residency_start_ms = now;
3214
             residency_start_ms = now;
3213
           }
3215
           }
3214
 
3216
 
3217
+          first_loop = false;
3215
         #endif // TEMP_CHAMBER_RESIDENCY_TIME > 0
3218
         #endif // TEMP_CHAMBER_RESIDENCY_TIME > 0
3216
 
3219
 
3217
         // Prevent a wait-forever situation if R is misused i.e. M191 R0
3220
         // Prevent a wait-forever situation if R is misused i.e. M191 R0
3224
             old_temp = temp;
3227
             old_temp = temp;
3225
           }
3228
           }
3226
         }
3229
         }
3227
-
3228
-        first_loop = false;
3229
-
3230
       } while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS);
3230
       } while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS);
3231
 
3231
 
3232
       if (wait_for_heatup) ui.reset_status();
3232
       if (wait_for_heatup) ui.reset_status();

+ 23
- 0
Marlin/src/pins/mega/pins_CNCONTROLS_11.h 查看文件

1
 /**
1
 /**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
2
  * CartesioV11 pin assignments
25
  * CartesioV11 pin assignments
3
  */
26
  */
4
 
27
 

+ 23
- 0
Marlin/src/pins/mega/pins_CNCONTROLS_12.h 查看文件

1
 /**
1
 /**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
2
  * CartesioV12 pin assignments
25
  * CartesioV12 pin assignments
3
  */
26
  */
4
 
27
 

+ 24
- 1
Marlin/src/pins/mega/pins_CNCONTROLS_15.h 查看文件

1
 /**
1
 /**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
2
  * CNControls V15 for HMS434 pin assignments
25
  * CNControls V15 for HMS434 pin assignments
3
  */
26
  */
4
 
27
 
64
 //
87
 //
65
 // Fans
88
 // Fans
66
 //
89
 //
67
-#define FAN0_PIN              8
90
+#define FAN_PIN               8
68
 #define ORIG_E0_AUTO_FAN_PIN 30
91
 #define ORIG_E0_AUTO_FAN_PIN 30
69
 #define ORIG_E1_AUTO_FAN_PIN 30
92
 #define ORIG_E1_AUTO_FAN_PIN 30
70
 #define ORIG_E2_AUTO_FAN_PIN 30
93
 #define ORIG_E2_AUTO_FAN_PIN 30

+ 3
- 1
Marlin/src/pins/ramps/pins_RAMPS.h 查看文件

508
       #ifndef SD_DETECT_PIN
508
       #ifndef SD_DETECT_PIN
509
         #define SD_DETECT_PIN   49
509
         #define SD_DETECT_PIN   49
510
       #endif
510
       #endif
511
-      #define KILL_PIN          41
511
+      #ifndef KILL_PIN
512
+        #define KILL_PIN        41
513
+      #endif
512
 
514
 
513
       #if ENABLED(BQ_LCD_SMART_CONTROLLER)
515
       #if ENABLED(BQ_LCD_SMART_CONTROLLER)
514
         #define LCD_BACKLIGHT_PIN 39
516
         #define LCD_BACKLIGHT_PIN 39

+ 50
- 45
Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h 查看文件

156
 //
156
 //
157
 #if HAS_SPI_LCD
157
 #if HAS_SPI_LCD
158
 
158
 
159
+  #define SD_DETECT_PIN         -1
160
+
159
   #if HAS_GRAPHICAL_LCD
161
   #if HAS_GRAPHICAL_LCD
160
 
162
 
161
-    #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
163
+    #if ENABLED(LCD_FOR_MELZI)
164
+
165
+      #define LCD_PINS_RS       17
166
+      #define LCD_PINS_ENABLE   16
167
+      #define LCD_PINS_D4       11
168
+
169
+      #define BOARD_ST7920_DELAY_1 DELAY_NS(0)
170
+      #define BOARD_ST7920_DELAY_2 DELAY_NS(188)
171
+      #define BOARD_ST7920_DELAY_3 DELAY_NS(0)
172
+
173
+    #elif ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
162
 
174
 
163
       #if IS_MELZI
175
       #if IS_MELZI
164
         #define LCD_PINS_RS     30   // CS chip select /SS chip slave select
176
         #define LCD_PINS_RS     30   // CS chip select /SS chip slave select
177
         #define LCD_PINS_D7     27
189
         #define LCD_PINS_D7     27
178
       #endif
190
       #endif
179
 
191
 
180
-    #else // DOGM SPI LCD Support
192
+    #else
181
 
193
 
182
       #define DOGLCD_A0         30
194
       #define DOGLCD_A0         30
183
 
195
 
201
     #endif
213
     #endif
202
 
214
 
203
     // Uncomment screen orientation
215
     // Uncomment screen orientation
204
-    #define LCD_SCREEN_ROT_0
216
+    //#define LCD_SCREEN_ROT_0
205
     //#define LCD_SCREEN_ROT_90
217
     //#define LCD_SCREEN_ROT_90
206
     //#define LCD_SCREEN_ROT_180
218
     //#define LCD_SCREEN_ROT_180
207
     //#define LCD_SCREEN_ROT_270
219
     //#define LCD_SCREEN_ROT_270
208
 
220
 
209
-  #else // !HAS_GRAPHICAL_LCD
210
-
211
-    #define LCD_PINS_RS          4
212
-    #define LCD_PINS_ENABLE     17
213
-    #define LCD_PINS_D4         30
214
-    #define LCD_PINS_D5         29
215
-    #define LCD_PINS_D6         28
216
-    #define LCD_PINS_D7         27
221
+  #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards
217
 
222
 
218
-  #endif // !HAS_GRAPHICAL_LCD
223
+    #define LCD_PINS_RS    28
224
+    #define LCD_PINS_ENABLE 29
225
+    #define LCD_PINS_D4    10
226
+    #define LCD_PINS_D5    11
227
+    #define LCD_PINS_D6    16
228
+    #define LCD_PINS_D7    17
219
 
229
 
220
-  #if ENABLED(LCD_I2C_PANELOLU2)
230
+  #else
221
 
231
 
222
-    #if IS_MELZI
223
-      #define BTN_ENC           29
224
-      #define LCD_SDSS          30   // Panelolu2 SD card reader rather than the Melzi
225
-    #else
226
-      #define BTN_ENC           30
227
-    #endif
232
+    #define LCD_PINS_RS     4
233
+    #define LCD_PINS_ENABLE 17
234
+    #define LCD_PINS_D4    30
235
+    #define LCD_PINS_D5    29
236
+    #define LCD_PINS_D6    28
237
+    #define LCD_PINS_D7    27
228
 
238
 
229
-  #elif ENABLED(LCD_FOR_MELZI)
239
+  #endif
230
 
240
 
231
-    #define LCD_PINS_RS         17
232
-    #define LCD_PINS_ENABLE     16
233
-    #define LCD_PINS_D4         11
234
-    #define BTN_ENC             28
235
-    #define BTN_EN1             29
236
-    #define BTN_EN2             30
241
+  #if ENABLED(LCD_FOR_MELZI)
237
 
242
 
238
-    #define BOARD_ST7920_DELAY_1 DELAY_NS(0)
239
-    #define BOARD_ST7920_DELAY_2 DELAY_NS(188)
240
-    #define BOARD_ST7920_DELAY_3 DELAY_NS(0)
243
+    #define BTN_ENC        28
244
+    #define BTN_EN1        29
245
+    #define BTN_EN2        30
241
 
246
 
242
   #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards
247
   #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards
243
 
248
 
244
-    #define LCD_PINS_RS         28
245
-    #define LCD_PINS_ENABLE     29
246
-    #define LCD_PINS_D4         10
247
-    #define LCD_PINS_D5         11
248
-    #define LCD_PINS_D6         16
249
-    #define LCD_PINS_D7         17
250
-    #define ADC_KEYPAD_PIN       1
249
+    #define ADC_KEYPAD_PIN  1
250
+    #define BTN_EN1        -1
251
+    #define BTN_EN2        -1
251
 
252
 
252
-    #define BTN_EN1             -1
253
-    #define BTN_EN2             -1
253
+  #elif ENABLED(LCD_I2C_PANELOLU2)
254
 
254
 
255
-  #else  // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI && !ZONESTAR_LCD
255
+    #if IS_MELZI
256
+      #define BTN_ENC      29
257
+      #define LCD_SDSS     30   // Panelolu2 SD card reader rather than the Melzi
258
+    #else
259
+      #define BTN_ENC      30
260
+    #endif
261
+
262
+  #else // !LCD_FOR_MELZI && !ZONESTAR_LCD && !LCD_I2C_PANELOLU2
256
 
263
 
257
-    #define BTN_ENC             16
258
-    #define LCD_SDSS            28   // Smart Controller SD card reader rather than the Melzi
264
+    #define BTN_ENC        16
265
+    #define LCD_SDSS       28   // Smart Controller SD card reader rather than the Melzi
259
 
266
 
260
   #endif
267
   #endif
261
 
268
 
262
   #if ENABLED(NEWPANEL) && !defined(BTN_EN1)
269
   #if ENABLED(NEWPANEL) && !defined(BTN_EN1)
263
-    #define BTN_EN1             11
264
-    #define BTN_EN2             10
270
+    #define BTN_EN1        11
271
+    #define BTN_EN2        10
265
   #endif
272
   #endif
266
 
273
 
267
-  #define SD_DETECT_PIN         -1
268
-
269
 #endif // HAS_SPI_LCD
274
 #endif // HAS_SPI_LCD
270
 
275
 
271
 //
276
 //

+ 1
- 1
Marlin/src/sd/cardreader.cpp 查看文件

678
 //
678
 //
679
 void CardReader::selectFileByName(const char * const match) {
679
 void CardReader::selectFileByName(const char * const match) {
680
   #if ENABLED(SDSORT_CACHE_NAMES)
680
   #if ENABLED(SDSORT_CACHE_NAMES)
681
-    for (int nr = 0; nr < sort_count; nr++)
681
+    for (uint16_t nr = 0; nr < sort_count; nr++)
682
       if (strcasecmp(match, sortshort[nr]) == 0) {
682
       if (strcasecmp(match, sortshort[nr]) == 0) {
683
         strcpy(filename, sortshort[nr]);
683
         strcpy(filename, sortshort[nr]);
684
         strcpy(longFilename, sortnames[nr]);
684
         strcpy(longFilename, sortnames[nr]);

Loading…
取消
儲存