|
@@ -154,6 +154,8 @@
|
154
|
154
|
// M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
|
155
|
155
|
// M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
156
|
156
|
// M304 - Set bed PID parameters P I and D
|
|
157
|
+// M380 - Activate solenoid on active extruder
|
|
158
|
+// M381 - Disable all solenoids
|
157
|
159
|
// M400 - Finish all moves
|
158
|
160
|
// M401 - Lower z-probe if present
|
159
|
161
|
// M402 - Raise z-probe if present
|
|
@@ -529,32 +531,28 @@ void setup_homepin(void)
|
529
|
531
|
void setup_photpin()
|
530
|
532
|
{
|
531
|
533
|
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
|
532
|
|
- SET_OUTPUT(PHOTOGRAPH_PIN);
|
533
|
|
- WRITE(PHOTOGRAPH_PIN, LOW);
|
|
534
|
+ OUT_WRITE(PHOTOGRAPH_PIN, LOW);
|
534
|
535
|
#endif
|
535
|
536
|
}
|
536
|
537
|
|
537
|
538
|
void setup_powerhold()
|
538
|
539
|
{
|
539
|
540
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
540
|
|
- SET_OUTPUT(SUICIDE_PIN);
|
541
|
|
- WRITE(SUICIDE_PIN, HIGH);
|
|
541
|
+ OUT_WRITE(SUICIDE_PIN, HIGH);
|
542
|
542
|
#endif
|
543
|
543
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
544
|
|
- SET_OUTPUT(PS_ON_PIN);
|
545
|
|
- #if defined(PS_DEFAULT_OFF)
|
546
|
|
- WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
547
|
|
- #else
|
548
|
|
- WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
549
|
|
- #endif
|
|
544
|
+ #if defined(PS_DEFAULT_OFF)
|
|
545
|
+ OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
546
|
+ #else
|
|
547
|
+ OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
548
|
+ #endif
|
550
|
549
|
#endif
|
551
|
550
|
}
|
552
|
551
|
|
553
|
552
|
void suicide()
|
554
|
553
|
{
|
555
|
554
|
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
|
556
|
|
- SET_OUTPUT(SUICIDE_PIN);
|
557
|
|
- WRITE(SUICIDE_PIN, LOW);
|
|
555
|
+ OUT_WRITE(SUICIDE_PIN, LOW);
|
558
|
556
|
#endif
|
559
|
557
|
}
|
560
|
558
|
|
|
@@ -2723,15 +2721,13 @@ Sigma_Exit:
|
2723
|
2721
|
|
2724
|
2722
|
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
|
2725
|
2723
|
case 80: // M80 - Turn on Power Supply
|
2726
|
|
- SET_OUTPUT(PS_ON_PIN); //GND
|
2727
|
|
- WRITE(PS_ON_PIN, PS_ON_AWAKE);
|
|
2724
|
+ OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); // GND
|
2728
|
2725
|
|
2729
|
2726
|
// If you have a switch on suicide pin, this is useful
|
2730
|
2727
|
// if you want to start another print with suicide feature after
|
2731
|
2728
|
// a print without suicide...
|
2732
|
2729
|
#if defined SUICIDE_PIN && SUICIDE_PIN > -1
|
2733
|
|
- SET_OUTPUT(SUICIDE_PIN);
|
2734
|
|
- WRITE(SUICIDE_PIN, HIGH);
|
|
2730
|
+ OUT_WRITE(SUICIDE_PIN, HIGH);
|
2735
|
2731
|
#endif
|
2736
|
2732
|
|
2737
|
2733
|
#ifdef ULTIPANEL
|
|
@@ -2755,8 +2751,7 @@ Sigma_Exit:
|
2755
|
2751
|
st_synchronize();
|
2756
|
2752
|
suicide();
|
2757
|
2753
|
#elif defined(PS_ON_PIN) && PS_ON_PIN > -1
|
2758
|
|
- SET_OUTPUT(PS_ON_PIN);
|
2759
|
|
- WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
|
2754
|
+ OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP);
|
2760
|
2755
|
#endif
|
2761
|
2756
|
#ifdef ULTIPANEL
|
2762
|
2757
|
powersupply = false;
|
|
@@ -3118,7 +3113,7 @@ Sigma_Exit:
|
3118
|
3113
|
SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]);
|
3119
|
3114
|
#endif
|
3120
|
3115
|
}
|
3121
|
|
- SERIAL_ECHOLN("");
|
|
3116
|
+ SERIAL_EOL;
|
3122
|
3117
|
}break;
|
3123
|
3118
|
#endif
|
3124
|
3119
|
case 220: // M220 S<factor in percent>- set speed factor override percentage
|
|
@@ -3337,8 +3332,7 @@ Sigma_Exit:
|
3337
|
3332
|
{
|
3338
|
3333
|
#ifdef CHDK
|
3339
|
3334
|
|
3340
|
|
- SET_OUTPUT(CHDK);
|
3341
|
|
- WRITE(CHDK, HIGH);
|
|
3335
|
+ OUT_WRITE(CHDK, HIGH);
|
3342
|
3336
|
chdkHigh = millis();
|
3343
|
3337
|
chdkActive = true;
|
3344
|
3338
|
|
|
@@ -3497,6 +3491,17 @@ Sigma_Exit:
|
3497
|
3491
|
}
|
3498
|
3492
|
break;
|
3499
|
3493
|
#endif
|
|
3494
|
+
|
|
3495
|
+#ifdef EXT_SOLENOID
|
|
3496
|
+ case 380:
|
|
3497
|
+ enable_solenoid_on_active_extruder();
|
|
3498
|
+ break;
|
|
3499
|
+
|
|
3500
|
+ case 381:
|
|
3501
|
+ disable_all_solenoids();
|
|
3502
|
+ break;
|
|
3503
|
+#endif //EXT_SOLENOID
|
|
3504
|
+
|
3500
|
3505
|
case 400: // M400 finish all moves
|
3501
|
3506
|
{
|
3502
|
3507
|
st_synchronize();
|
|
@@ -3737,9 +3742,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
3737
|
3742
|
if(cnt==0)
|
3738
|
3743
|
{
|
3739
|
3744
|
#if BEEPER > 0
|
3740
|
|
- SET_OUTPUT(BEEPER);
|
3741
|
|
-
|
3742
|
|
- WRITE(BEEPER,HIGH);
|
|
3745
|
+ OUT_WRITE(BEEPER,HIGH);
|
3743
|
3746
|
delay(3);
|
3744
|
3747
|
WRITE(BEEPER,LOW);
|
3745
|
3748
|
delay(3);
|
|
@@ -4000,6 +4003,13 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
4000
|
4003
|
prepare_move();
|
4001
|
4004
|
}
|
4002
|
4005
|
}
|
|
4006
|
+
|
|
4007
|
+#ifdef EXT_SOLENOID
|
|
4008
|
+ st_synchronize();
|
|
4009
|
+ disable_all_solenoids();
|
|
4010
|
+ enable_solenoid_on_active_extruder();
|
|
4011
|
+#endif //EXT_SOLENOID
|
|
4012
|
+
|
4003
|
4013
|
#endif
|
4004
|
4014
|
SERIAL_ECHO_START;
|
4005
|
4015
|
SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
|
|
@@ -4707,7 +4717,6 @@ bool setTargetedHotend(int code){
|
4707
|
4717
|
return false;
|
4708
|
4718
|
}
|
4709
|
4719
|
|
4710
|
|
-
|
4711
|
4720
|
float calculate_volumetric_multiplier(float diameter) {
|
4712
|
4721
|
if (!volumetric_enabled || diameter == 0) return 1.0;
|
4713
|
4722
|
float d2 = diameter * 0.5;
|
|
@@ -4718,3 +4727,43 @@ void calculate_volumetric_multipliers() {
|
4718
|
4727
|
for (int i=0; i<EXTRUDERS; i++)
|
4719
|
4728
|
volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
|
4720
|
4729
|
}
|
|
4730
|
+
|
|
4731
|
+#ifdef EXT_SOLENOID
|
|
4732
|
+
|
|
4733
|
+void enable_solenoid(uint8_t num) {
|
|
4734
|
+ switch(num) {
|
|
4735
|
+ case 0:
|
|
4736
|
+ OUT_WRITE(SOL0_PIN, HIGH);
|
|
4737
|
+ break;
|
|
4738
|
+ #if defined(SOL1_PIN) && SOL1_PIN > -1
|
|
4739
|
+ case 1:
|
|
4740
|
+ OUT_WRITE(SOL1_PIN, HIGH);
|
|
4741
|
+ break;
|
|
4742
|
+ #endif
|
|
4743
|
+ #if defined(SOL2_PIN) && SOL2_PIN > -1
|
|
4744
|
+ case 2:
|
|
4745
|
+ OUT_WRITE(SOL2_PIN, HIGH);
|
|
4746
|
+ break;
|
|
4747
|
+ #endif
|
|
4748
|
+ #if defined(SOL3_PIN) && SOL3_PIN > -1
|
|
4749
|
+ case 3:
|
|
4750
|
+ OUT_WRITE(SOL3_PIN, HIGH);
|
|
4751
|
+ break;
|
|
4752
|
+ #endif
|
|
4753
|
+ default:
|
|
4754
|
+ SERIAL_ECHO_START;
|
|
4755
|
+ SERIAL_ECHOLNPGM(MSG_INVALID_SOLENOID);
|
|
4756
|
+ break;
|
|
4757
|
+ }
|
|
4758
|
+}
|
|
4759
|
+
|
|
4760
|
+void enable_solenoid_on_active_extruder() { enable_solenoid(active_extruder); }
|
|
4761
|
+
|
|
4762
|
+void disable_all_solenoids() {
|
|
4763
|
+ OUT_WRITE(SOL0_PIN, LOW);
|
|
4764
|
+ OUT_WRITE(SOL1_PIN, LOW);
|
|
4765
|
+ OUT_WRITE(SOL2_PIN, LOW);
|
|
4766
|
+ OUT_WRITE(SOL3_PIN, LOW);
|
|
4767
|
+}
|
|
4768
|
+
|
|
4769
|
+#endif //EXT_SOLENOID
|