Browse Source

Improve FILAMENT_RUNOUT_SENSOR, FILRUNOUT_PIN

Scott Lahteine 9 years ago
parent
commit
add0032820
4 changed files with 26 additions and 11 deletions
  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 View File

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

+ 11
- 0
Marlin/SanityCheck.h View File

125
 #endif
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
  * Filament Change with Extruder Runout Prevention
139
  * Filament Change with Extruder Runout Prevention
129
  */
140
  */
130
 #if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
141
 #if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)

+ 1
- 1
Marlin/pins_CNCONTROLS_12.h View File

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

+ 2
- 4
Marlin/pins_RAMPS_14.h View File

98
   #define Z_MIN_PROBE_PIN  32
98
   #define Z_MIN_PROBE_PIN  32
99
 #endif
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
 #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB)
104
 #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB)
107
   #define FAN_PIN           9 // (Sprinter config)
105
   #define FAN_PIN           9 // (Sprinter config)

Loading…
Cancel
Save