Bläddra i källkod

Make BARICUDA a feature

Scott Lahteine 7 år sedan
förälder
incheckning
b464887ea1

+ 0
- 16
Marlin/src/Marlin.cpp Visa fil

@@ -177,11 +177,6 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL
177 177
   float z_endstop_adj;
178 178
 #endif
179 179
 
180
-#if ENABLED(BARICUDA)
181
-  uint8_t baricuda_valve_pressure = 0,
182
-          baricuda_e_to_p_pressure = 0;
183
-#endif
184
-
185 180
 #if HAS_POWER_SWITCH
186 181
   bool powersupply_on =
187 182
     #if ENABLED(PS_DEFAULT_OFF)
@@ -374,17 +369,6 @@ bool pin_is_protected(const int8_t pin) {
374 369
   return false;
375 370
 }
376 371
 
377
-#if ENABLED(BARICUDA)
378
-  #if HAS_HEATER_1
379
-    #include "gcode/feature/baricuda/M126.h"
380
-    #include "gcode/feature/baricuda/M127.h"
381
-  #endif
382
-  #if HAS_HEATER_2
383
-    #include "gcode/feature/baricuda/M128.h"
384
-    #include "gcode/feature/baricuda/M129.h"
385
-  #endif
386
-#endif
387
-
388 372
 #if ENABLED(ULTIPANEL)
389 373
   #include "gcode/lcd/M145.h"
390 374
 #endif

+ 0
- 4
Marlin/src/Marlin.h Visa fil

@@ -207,10 +207,6 @@ extern volatile bool wait_for_heatup;
207 207
   #endif
208 208
 #endif
209 209
 
210
-#if ENABLED(BARICUDA)
211
-  extern uint8_t baricuda_valve_pressure, baricuda_e_to_p_pressure;
212
-#endif
213
-
214 210
 #if ENABLED(ADVANCED_PAUSE_FEATURE)
215 211
   extern AdvancedPauseMenuResponse advanced_pause_menu_response;
216 212
 #endif

Marlin/src/gcode/feature/baricuda/M127.h → Marlin/src/feature/baricuda.cpp Visa fil

@@ -20,11 +20,13 @@
20 20
  *
21 21
  */
22 22
 
23
-/**
24
- * M127: Heater 1 valve close
25
- */
26
-void gcode_M127() {
23
+#include "../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(BARICUDA)
26
+
27
+#include "baricuda.h"
27 28
 
28
-  baricuda_valve_pressure = 0;
29
+uint8_t baricuda_valve_pressure = 0,
30
+        baricuda_e_to_p_pressure = 0;
29 31
 
30
-}
32
+#endif // BARICUDA

Marlin/src/gcode/feature/baricuda/M126.h → Marlin/src/feature/baricuda.h Visa fil

@@ -20,11 +20,10 @@
20 20
  *
21 21
  */
22 22
 
23
-/**
24
- * M126: Heater 1 valve open
25
- */
26
-void gcode_M126() {
23
+#ifndef __BARICUDA_H__
24
+#define __BARICUDA_H__
27 25
 
28
-  baricuda_valve_pressure = parser.byteval('S', 255);
26
+extern uint8_t baricuda_valve_pressure,
27
+               baricuda_e_to_p_pressure;
29 28
 
30
-}
29
+#endif // __BARICUDA_H__

Marlin/src/gcode/feature/baricuda/M128.h → Marlin/src/gcode/feature/baricuda/M126-M129.cpp Visa fil

@@ -20,11 +20,39 @@
20 20
  *
21 21
  */
22 22
 
23
-/**
24
- * M128: Heater 2 valve open
25
- */
26
-void gcode_M128() {
23
+#include "../../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(BARICUDA)
26
+
27
+#include "../../gcode.h"
28
+#include "../../../feature/baricuda.h"
29
+
30
+#if HAS_HEATER_1
31
+
32
+  /**
33
+   * M126: Heater 1 valve open
34
+   */
35
+  void GcodeSuite::M126() { baricuda_valve_pressure = parser.byteval('S', 255); }
36
+
37
+  /**
38
+   * M127: Heater 1 valve close
39
+   */
40
+  void GcodeSuite::M127() { baricuda_valve_pressure = 0; }
41
+
42
+#endif // HAS_HEATER_1
43
+
44
+#if HAS_HEATER_2
45
+
46
+  /**
47
+   * M128: Heater 2 valve open
48
+   */
49
+  void GcodeSuite::M128() { baricuda_e_to_p_pressure = parser.byteval('S', 255); }
50
+
51
+  /**
52
+   * M129: Heater 2 valve close
53
+   */
54
+  void GcodeSuite::M129() { baricuda_e_to_p_pressure = 0; }
27 55
 
28
-  baricuda_e_to_p_pressure = parser.byteval('S', 255);
56
+#endif // HAS_HEATER_2
29 57
 
30
-}
58
+#endif // BARICUDA

+ 0
- 30
Marlin/src/gcode/feature/baricuda/M129.h Visa fil

@@ -1,30 +0,0 @@
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
-/**
24
- * M129: Heater 2 valve close
25
- */
26
-void gcode_M129() {
27
-
28
-  baricuda_e_to_p_pressure = 0;
29
-
30
-}

+ 6
- 18
Marlin/src/gcode/gcode.cpp Visa fil

@@ -131,10 +131,6 @@ extern void gcode_M118();
131 131
 extern void gcode_M119();
132 132
 extern void gcode_M120();
133 133
 extern void gcode_M121();
134
-extern void gcode_M126();
135
-extern void gcode_M127();
136
-extern void gcode_M128();
137
-extern void gcode_M129();
138 134
 extern void gcode_M145();
139 135
 extern void gcode_M149();
140 136
 extern void gcode_M150();
@@ -486,23 +482,15 @@ void GcodeSuite::process_next_command() {
486 482
       #if ENABLED(BARICUDA)
487 483
         // PWM for HEATER_1_PIN
488 484
         #if HAS_HEATER_1
489
-          case 126: // M126: valve open
490
-            gcode_M126();
491
-            break;
492
-          case 127: // M127: valve closed
493
-            gcode_M127();
494
-            break;
495
-        #endif // HAS_HEATER_1
485
+          case 126: M126(); break;  // M126: valve open
486
+          case 127: M127(); break;  // M127: valve closed
487
+        #endif
496 488
 
497 489
         // PWM for HEATER_2_PIN
498 490
         #if HAS_HEATER_2
499
-          case 128: // M128: valve open
500
-            gcode_M128();
501
-            break;
502
-          case 129: // M129: valve closed
503
-            gcode_M129();
504
-            break;
505
-        #endif // HAS_HEATER_2
491
+          case 128: M128(); break;  // M128: valve open
492
+          case 129: M129(); break;  // M129: valve closed
493
+        #endif
506 494
       #endif // BARICUDA
507 495
 
508 496
       #if HAS_POWER_SWITCH

+ 4
- 0
Marlin/src/module/planner.cpp Visa fil

@@ -76,6 +76,10 @@
76 76
   #include "../feature/filwidth.h"
77 77
 #endif
78 78
 
79
+#if ENABLED(BARICUDA)
80
+  #include "../feature/baricuda.h"
81
+#endif
82
+
79 83
 Planner planner;
80 84
 
81 85
   // public:

Laddar…
Avbryt
Spara