Browse Source

The safe_delay() is now globaly accessible

João Brázio 8 years ago
parent
commit
a8758619ec
4 changed files with 36 additions and 10 deletions
  1. 2
    0
      Marlin/Marlin.h
  2. 1
    1
      Marlin/Marlin_main.cpp
  3. 0
    9
      Marlin/ultralcd_implementation_hitachi_HD44780.h
  4. 33
    0
      Marlin/utility.cpp

+ 2
- 0
Marlin/Marlin.h View File

@@ -389,4 +389,6 @@ void calculate_volumetric_multipliers();
389 389
   #endif
390 390
 #endif
391 391
 
392
+void safe_delay(uint16_t del);
393
+
392 394
 #endif //MARLIN_H

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -946,7 +946,7 @@ void setup() {
946 946
   lcd_init();
947 947
   #if ENABLED(SHOW_BOOTSCREEN)
948 948
     #if ENABLED(DOGLCD)
949
-      delay(BOOTSCREEN_TIMEOUT);
949
+      safe_delay(BOOTSCREEN_TIMEOUT);
950 950
     #elif ENABLED(ULTRA_LCD)
951 951
       bootscreen();
952 952
       lcd_init();

+ 0
- 9
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -443,15 +443,6 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
443 443
     lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" ));  lcd.print('\x03');
444 444
   }
445 445
 
446
-  void safe_delay(uint16_t del){
447
-    while (del > 50) {
448
-      del -= 50;
449
-      delay(50);
450
-      thermalManager.manage_heater();
451
-    }
452
-    delay(del);
453
-  }
454
-
455 446
   void bootscreen() {
456 447
     byte top_left[8] = {
457 448
       B00000,

+ 33
- 0
Marlin/utility.cpp View File

@@ -0,0 +1,33 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 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
+
23
+#include "Marlin.h"
24
+#include "temperature.h"
25
+
26
+void safe_delay(uint16_t ms) {
27
+  while (ms > 50) {
28
+    ms -= 50;
29
+    delay(50);
30
+    thermalManager.manage_heater();
31
+  }
32
+  delay(ms);
33
+}

Loading…
Cancel
Save