Преглед изворни кода

Fix some warnings, Melzi pins

Jason Smith пре 4 година
родитељ
комит
c305c2cc6b

+ 1
- 1
Marlin/src/feature/dac/stepper_dac.cpp Прегледај датотеку

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

+ 2
- 2
Marlin/src/module/planner.cpp Прегледај датотеку

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

+ 7
- 7
Marlin/src/module/temperature.cpp Прегледај датотеку

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

+ 23
- 0
Marlin/src/pins/mega/pins_CNCONTROLS_11.h Прегледај датотеку

@@ -1,4 +1,27 @@
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 25
  * CartesioV11 pin assignments
3 26
  */
4 27
 

+ 23
- 0
Marlin/src/pins/mega/pins_CNCONTROLS_12.h Прегледај датотеку

@@ -1,4 +1,27 @@
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 25
  * CartesioV12 pin assignments
3 26
  */
4 27
 

+ 24
- 1
Marlin/src/pins/mega/pins_CNCONTROLS_15.h Прегледај датотеку

@@ -1,4 +1,27 @@
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 25
  * CNControls V15 for HMS434 pin assignments
3 26
  */
4 27
 
@@ -64,7 +87,7 @@
64 87
 //
65 88
 // Fans
66 89
 //
67
-#define FAN0_PIN              8
90
+#define FAN_PIN               8
68 91
 #define ORIG_E0_AUTO_FAN_PIN 30
69 92
 #define ORIG_E1_AUTO_FAN_PIN 30
70 93
 #define ORIG_E2_AUTO_FAN_PIN 30

+ 3
- 1
Marlin/src/pins/ramps/pins_RAMPS.h Прегледај датотеку

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

+ 50
- 45
Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h Прегледај датотеку

@@ -156,9 +156,21 @@
156 156
 //
157 157
 #if HAS_SPI_LCD
158 158
 
159
+  #define SD_DETECT_PIN         -1
160
+
159 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 175
       #if IS_MELZI
164 176
         #define LCD_PINS_RS     30   // CS chip select /SS chip slave select
@@ -177,7 +189,7 @@
177 189
         #define LCD_PINS_D7     27
178 190
       #endif
179 191
 
180
-    #else // DOGM SPI LCD Support
192
+    #else
181 193
 
182 194
       #define DOGLCD_A0         30
183 195
 
@@ -201,71 +213,64 @@
201 213
     #endif
202 214
 
203 215
     // Uncomment screen orientation
204
-    #define LCD_SCREEN_ROT_0
216
+    //#define LCD_SCREEN_ROT_0
205 217
     //#define LCD_SCREEN_ROT_90
206 218
     //#define LCD_SCREEN_ROT_180
207 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 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 267
   #endif
261 268
 
262 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 272
   #endif
266 273
 
267
-  #define SD_DETECT_PIN         -1
268
-
269 274
 #endif // HAS_SPI_LCD
270 275
 
271 276
 //

+ 1
- 1
Marlin/src/sd/cardreader.cpp Прегледај датотеку

@@ -678,7 +678,7 @@ void CardReader::selectFileByIndex(const uint16_t nr) {
678 678
 //
679 679
 void CardReader::selectFileByName(const char * const match) {
680 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 682
       if (strcasecmp(match, sortshort[nr]) == 0) {
683 683
         strcpy(filename, sortshort[nr]);
684 684
         strcpy(longFilename, sortnames[nr]);

Loading…
Откажи
Сачувај