Sfoglia il codice sorgente

Improve FILAMENT_RUNOUT_SENSOR, FILRUNOUT_PIN

Scott Lahteine 8 anni fa
parent
commit
add0032820
4 ha cambiato i file con 26 aggiunte e 11 eliminazioni
  1. 12
    6
      Marlin/Marlin_main.cpp
  2. 11
    0
      Marlin/SanityCheck.h
  3. 1
    1
      Marlin/pins_CNCONTROLS_12.h
  4. 2
    4
      Marlin/pins_RAMPS_14.h

+ 12
- 6
Marlin/Marlin_main.cpp Vedi File

@@ -686,14 +686,16 @@ void setup_killpin() {
686 686
   #endif
687 687
 }
688 688
 
689
-void setup_filrunoutpin() {
690
-  #if HAS_FILRUNOUT
689
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
690
+
691
+  void setup_filrunoutpin() {
691 692
     pinMode(FILRUNOUT_PIN, INPUT);
692 693
     #if ENABLED(ENDSTOPPULLUP_FIL_RUNOUT)
693 694
       WRITE(FILRUNOUT_PIN, HIGH);
694 695
     #endif
695
-  #endif
696
-}
696
+  }
697
+
698
+#endif
697 699
 
698 700
 // Set home pin
699 701
 void setup_homepin(void) {
@@ -802,8 +804,12 @@ void setup() {
802 804
     MCUCR = 0x80;
803 805
   #endif
804 806
 
807
+  #if ENABLED(FILAMENT_RUNOUT_SENSOR)
808
+    setup_filrunoutpin();
809
+  #endif
810
+
805 811
   setup_killpin();
806
-  setup_filrunoutpin();
812
+
807 813
   setup_powerhold();
808 814
 
809 815
   #if HAS_STEPPER_RESET
@@ -8144,7 +8150,7 @@ void idle(
8144 8150
  */
8145 8151
 void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
8146 8152
 
8147
-  #if HAS_FILRUNOUT
8153
+  #if ENABLED(FILAMENT_RUNOUT_SENSOR)
8148 8154
     if (IS_SD_PRINTING && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))
8149 8155
       handle_filament_runout();
8150 8156
   #endif

+ 11
- 0
Marlin/SanityCheck.h Vedi File

@@ -125,6 +125,17 @@
125 125
 #endif
126 126
 
127 127
 /**
128
+ * Filament Runout needs a pin and SD Support
129
+ */
130
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
131
+  #if !HAS_FILRUNOUT
132
+    #error "FILAMENT_RUNOUT_SENSOR requires FILRUNOUT_PIN."
133
+  #elif DISABLED(SDSUPPORT)
134
+    #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT."
135
+  #endif
136
+#endif
137
+
138
+/**
128 139
  * Filament Change with Extruder Runout Prevention
129 140
  */
130 141
 #if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)

+ 1
- 1
Marlin/pins_CNCONTROLS_12.h Vedi File

@@ -67,7 +67,7 @@
67 67
 //common I/O
68 68
 
69 69
  //#define TEMP_CHAMBER_PIN        13  // ANALOG INPUT !!
70
- //#define FILAMENT_RUNOUT_SENSOR  18
70
+ #define FILRUNOUT_PIN             18
71 71
  //#define PWM_1_PIN               12
72 72
  //#define PWM_2_PIN               13 
73 73
  //#define SPARE_IO                17  

+ 2
- 4
Marlin/pins_RAMPS_14.h Vedi File

@@ -98,10 +98,8 @@
98 98
   #define Z_MIN_PROBE_PIN  32
99 99
 #endif
100 100
 
101
-#if ENABLED(FILAMENT_RUNOUT_SENSOR)
102
-  // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
103
-  #define FILRUNOUT_PIN     4
104
-#endif
101
+// define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
102
+#define FILRUNOUT_PIN       4
105 103
 
106 104
 #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB)
107 105
   #define FAN_PIN           9 // (Sprinter config)

Loading…
Annulla
Salva