Ver código fonte

Added #ifdef BARICUDA around the BariCUDA changes

Erik van der Zalm 11 anos atrás
pai
commit
bd2cd4903e
6 arquivos alterados com 53 adições e 32 exclusões
  1. 3
    0
      Marlin/Configuration.h
  2. 2
    0
      Marlin/Marlin.h
  3. 31
    29
      Marlin/Marlin_main.cpp
  4. 4
    0
      Marlin/pins.h
  5. 11
    3
      Marlin/planner.cpp
  6. 2
    0
      Marlin/planner.h

+ 3
- 0
Marlin/Configuration.h Ver arquivo

@@ -403,6 +403,9 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
403 403
 // SF send wrong arc g-codes when using Arc Point as fillet procedure
404 404
 //#define SF_ARC_FIX
405 405
 
406
+// Support for the BariCUDA Paste Extruder.
407
+//#define BARICUDA
408
+
406 409
 #include "Configuration_adv.h"
407 410
 #include "thermistortables.h"
408 411
 

+ 2
- 0
Marlin/Marlin.h Ver arquivo

@@ -186,8 +186,10 @@ extern float add_homeing[3];
186 186
 extern float min_pos[3];
187 187
 extern float max_pos[3];
188 188
 extern int fanSpeed;
189
+#ifdef BARICUDA
189 190
 extern int ValvePressure;
190 191
 extern int EtoPPressure;
192
+#endif
191 193
 
192 194
 #ifdef FWRETRACT
193 195
 extern bool autoretract_enabled;

+ 31
- 29
Marlin/Marlin_main.cpp Ver arquivo

@@ -172,8 +172,10 @@ float extruder_offset[2][EXTRUDERS] = {
172 172
 #endif
173 173
 uint8_t active_extruder = 0;
174 174
 int fanSpeed=0;
175
+#ifdef BARICUDA
175 176
 int ValvePressure=0;
176 177
 int EtoPPressure=0;
178
+#endif
177 179
 
178 180
 #ifdef FWRETRACT
179 181
   bool autoretract_enabled=true;
@@ -1174,37 +1176,37 @@ void process_commands()
1174 1176
         fanSpeed = 0;
1175 1177
         break;
1176 1178
     #endif //FAN_PIN
1177
-
1179
+    #ifdef BARICUDA
1178 1180
 	// PWM for HEATER_1_PIN
1179
-    #if HEATER_1_PIN > -1
1180
-      case 126: //M126 valve open
1181
-        if (code_seen('S')){
1182
-           ValvePressure=constrain(code_value(),0,255);
1183
-        }
1184
-        else {
1185
-          ValvePressure=255;			
1186
-        }
1187
-        break;
1188
-      case 127: //M127 valve closed
1189
-        ValvePressure = 0;
1190
-        break;
1191
-    #endif //HEATER_1_PIN
1192
-
1193
-	// PWM for HEATER_2_PIN
1194
-    #if HEATER_2_PIN > -1
1195
-      case 128: //M128 valve open
1196
-        if (code_seen('S')){
1197
-           EtoPPressure=constrain(code_value(),0,255);
1198
-        }
1199
-        else {
1200
-          EtoPPressure=255;			
1201
-        }
1202
-        break;
1203
-      case 129: //M129 valve closed
1204
-        EtoPPressure = 0;
1205
-        break;
1206
-    #endif //HEATER_2_PIN
1181
+      #if HEATER_1_PIN > -1
1182
+        case 126: //M126 valve open
1183
+          if (code_seen('S')){
1184
+             ValvePressure=constrain(code_value(),0,255);
1185
+          }
1186
+          else {
1187
+            ValvePressure=255;			
1188
+          }
1189
+          break;
1190
+        case 127: //M127 valve closed
1191
+          ValvePressure = 0;
1192
+          break;
1193
+      #endif //HEATER_1_PIN
1207 1194
 
1195
+  	// PWM for HEATER_2_PIN
1196
+      #if HEATER_2_PIN > -1
1197
+        case 128: //M128 valve open
1198
+          if (code_seen('S')){
1199
+             EtoPPressure=constrain(code_value(),0,255);
1200
+          }
1201
+          else {
1202
+            EtoPPressure=255;			
1203
+          }
1204
+          break;
1205
+        case 129: //M129 valve closed
1206
+          EtoPPressure = 0;
1207
+          break;
1208
+      #endif //HEATER_2_PIN
1209
+    #endif
1208 1210
 
1209 1211
     #if (PS_ON_PIN > -1)
1210 1212
       case 80: // M80 - ATX Power On

+ 4
- 0
Marlin/pins.h Ver arquivo

@@ -1474,7 +1474,11 @@
1474 1474
 #define HEATER_1_PIN 7
1475 1475
 #define TEMP_1_PIN 1
1476 1476
 
1477
+#ifdef BARICUDA
1477 1478
 #define HEATER_2_PIN 6
1479
+#else
1480
+#define HEATER_2_PIN -1
1481
+#endif
1478 1482
 #define TEMP_2_PIN -1
1479 1483
 
1480 1484
 #define E0_STEP_PIN         34

+ 11
- 3
Marlin/planner.cpp Ver arquivo

@@ -439,18 +439,22 @@ void check_axes_activity()
439 439
   unsigned char z_active = 0;
440 440
   unsigned char e_active = 0;
441 441
   unsigned char tail_fan_speed = fanSpeed;
442
+  #ifdef BARICUDA
442 443
   unsigned char valve_pressure = 0;
443 444
   unsigned char e_to_p_pressure = 0;
444 445
   unsigned char tail_valve_pressure = 0;
445 446
   unsigned char tail_e_to_p_pressure = 0;
447
+  #endif
446 448
   block_t *block;
447 449
 
448 450
   if(block_buffer_tail != block_buffer_head)
449 451
   {
450 452
     uint8_t block_index = block_buffer_tail;
451 453
     tail_fan_speed = block_buffer[block_index].fan_speed;
454
+    #ifdef BARICUDA
452 455
     tail_valve_pressure = block_buffer[block_index].valve_pressure;
453 456
     tail_e_to_p_pressure = block_buffer[block_index].e_to_p_pressure;
457
+    #endif
454 458
     while(block_index != block_buffer_head)
455 459
     {
456 460
       block = &block_buffer[block_index];
@@ -493,7 +497,8 @@ void check_axes_activity()
493 497
   getHighESpeed();
494 498
 #endif
495 499
 
496
-#if HEATER_1_PIN > -1
500
+#ifdef BARICUDA
501
+  #if HEATER_1_PIN > -1
497 502
     if (ValvePressure != 0){
498 503
       analogWrite(HEATER_1_PIN,ValvePressure); // If buffer is empty use current valve pressure
499 504
     }
@@ -505,9 +510,9 @@ void check_axes_activity()
505 510
     if (ValvePressure != 0 && tail_valve_pressure !=0) { 
506 511
       analogWrite(HEATER_1_PIN,tail_valve_pressure);
507 512
     }
508
-#endif
513
+  #endif
509 514
 
510
-#if HEATER_2_PIN > -1
515
+  #if HEATER_2_PIN > -1
511 516
     if (EtoPPressure != 0){
512 517
       analogWrite(HEATER_2_PIN,EtoPPressure); // If buffer is empty use current EtoP pressure
513 518
     }
@@ -519,6 +524,7 @@ void check_axes_activity()
519 524
     if (EtoPPressure != 0 && tail_e_to_p_pressure !=0) { 
520 525
       analogWrite(HEATER_2_PIN,tail_e_to_p_pressure);
521 526
     }
527
+  #endif
522 528
 #endif
523 529
 }
524 530
 
@@ -593,8 +599,10 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
593 599
   }
594 600
 
595 601
   block->fan_speed = fanSpeed;
602
+  #ifdef BARICUDA
596 603
   block->valve_pressure = ValvePressure;
597 604
   block->e_to_p_pressure = EtoPPressure;
605
+  #endif
598 606
 
599 607
   // Compute direction bits for this block 
600 608
   block->direction_bits = 0;

+ 2
- 0
Marlin/planner.h Ver arquivo

@@ -60,8 +60,10 @@ typedef struct {
60 60
   unsigned long final_rate;                          // The minimal rate at exit
61 61
   unsigned long acceleration_st;                     // acceleration steps/sec^2
62 62
   unsigned long fan_speed;
63
+  #ifdef BARICUDA
63 64
   unsigned long valve_pressure;
64 65
   unsigned long e_to_p_pressure;
66
+  #endif
65 67
   volatile char busy;
66 68
 } block_t;
67 69
 

Carregando…
Cancelar
Salvar