Use the common pattern for auto fan pins

Now that pins.h is guaranteed included after configs.
This commit is contained in:
Scott Lahteine 2020-04-16 03:24:41 -05:00
parent 3a9f8a00bf
commit 03020dd31e
33 changed files with 245 additions and 132 deletions

View file

@ -425,6 +425,8 @@
#define E3_AUTO_FAN_PIN -1
#define E4_AUTO_FAN_PIN -1
#define E5_AUTO_FAN_PIN -1
#define E6_AUTO_FAN_PIN -1
#define E7_AUTO_FAN_PIN -1
#define CHAMBER_AUTO_FAN_PIN -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50

View file

@ -489,6 +489,10 @@
#error "Z_QUAD_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h."
#elif defined(DUGS_UI_MOVE_DIS_OPTION)
#error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION. Please update Configuration_adv.h."
#elif defined(ORIG_E0_AUTO_FAN_PIN) || defined(ORIG_E1_AUTO_FAN_PIN) || defined(ORIG_E2_AUTO_FAN_PIN) || defined(ORIG_E3_AUTO_FAN_PIN) || defined(ORIG_E4_AUTO_FAN_PIN) || defined(ORIG_E5_AUTO_FAN_PIN) || defined(ORIG_E6_AUTO_FAN_PIN) || defined(ORIG_E7_AUTO_FAN_PIN)
#error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN. Make sure your pins are up to date."
#elif defined(ORIG_CHAMBER_AUTO_FAN_PIN)
#error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN. Make sure your pins are up to date."
#endif
/**

View file

@ -110,10 +110,15 @@
// Auto fans
//
#define AUTO_FAN_PIN P2_04 // FET 4
#define ORIG_E0_AUTO_FAN_PIN AUTO_FAN_PIN
#define ORIG_E1_AUTO_FAN_PIN AUTO_FAN_PIN
#define ORIG_E2_AUTO_FAN_PIN AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
//
// Misc. Functions

View file

@ -139,9 +139,15 @@
#else
#define AUTO_FAN_PIN P1_22 // FET 3
#endif
#define ORIG_E0_AUTO_FAN_PIN AUTO_FAN_PIN
#define ORIG_E1_AUTO_FAN_PIN AUTO_FAN_PIN
#define ORIG_E2_AUTO_FAN_PIN AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
//
// Misc. Functions

View file

@ -131,9 +131,15 @@
// Auto fans
//
#define AUTO_FAN_PIN P1_22 // FET 3
#define ORIG_E0_AUTO_FAN_PIN AUTO_FAN_PIN
#define ORIG_E1_AUTO_FAN_PIN AUTO_FAN_PIN
#define ORIG_E2_AUTO_FAN_PIN AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
//
// SD Card

View file

@ -95,10 +95,22 @@
//#define FAN_PIN 7 // common PWM pin for all tools
#endif
#define ORIG_E0_AUTO_FAN_PIN 7
#define ORIG_E1_AUTO_FAN_PIN 7
#define ORIG_E2_AUTO_FAN_PIN 7
#define ORIG_E3_AUTO_FAN_PIN 7
//
// Auto fans
//
#define AUTO_FAN_PIN 7
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
//
// Misc. Functions

View file

@ -95,10 +95,22 @@
#define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools
#endif
#define ORIG_E0_AUTO_FAN_PIN 7
#define ORIG_E1_AUTO_FAN_PIN 7
#define ORIG_E2_AUTO_FAN_PIN 7
#define ORIG_E3_AUTO_FAN_PIN 7
//
// Auto fans
//
#define AUTO_FAN_PIN 7
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
//
// Misc. Functions

View file

@ -88,11 +88,26 @@
// Fans
//
#define FAN_PIN 8
#define ORIG_E0_AUTO_FAN_PIN 30
#define ORIG_E1_AUTO_FAN_PIN 30
#define ORIG_E2_AUTO_FAN_PIN 30
#define ORIG_E3_AUTO_FAN_PIN 30
//#define ORIG_CHAMBER_AUTO_FAN_PIN 10
//
// Auto fans
//
#define AUTO_FAN_PIN 30
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef CHAMBER_AUTO_FAN_PIN
//#define CHAMBER_AUTO_FAN_PIN 10
#endif
//
// Misc. Functions

View file

@ -61,7 +61,10 @@
#define HEATER_0_PIN 7
#define ORIG_E0_AUTO_FAN_PIN 3 // Use this by NOT overriding E0_AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 3
#endif
#define CONTROLLER_FAN_PIN 2
#define TEMP_0_PIN 7 // Analog Input

View file

@ -1051,73 +1051,6 @@
#define NUM_SERVO_PLUGS 4
#endif
//
// Assign auto fan pins if needed
//
#ifndef E0_AUTO_FAN_PIN
#ifdef ORIG_E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN
#else
#define E0_AUTO_FAN_PIN -1
#endif
#endif
#ifndef E1_AUTO_FAN_PIN
#ifdef ORIG_E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN
#else
#define E1_AUTO_FAN_PIN -1
#endif
#endif
#ifndef E2_AUTO_FAN_PIN
#ifdef ORIG_E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN
#else
#define E2_AUTO_FAN_PIN -1
#endif
#endif
#ifndef E3_AUTO_FAN_PIN
#ifdef ORIG_E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN
#else
#define E3_AUTO_FAN_PIN -1
#endif
#endif
#ifndef E4_AUTO_FAN_PIN
#ifdef ORIG_E4_AUTO_FAN_PIN
#define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN
#else
#define E4_AUTO_FAN_PIN -1
#endif
#endif
#ifndef E5_AUTO_FAN_PIN
#ifdef ORIG_E5_AUTO_FAN_PIN
#define E5_AUTO_FAN_PIN ORIG_E5_AUTO_FAN_PIN
#else
#define E5_AUTO_FAN_PIN -1
#endif
#endif
#ifndef E6_AUTO_FAN_PIN
#ifdef ORIG_E6_AUTO_FAN_PIN
#define E6_AUTO_FAN_PIN ORIG_E6_AUTO_FAN_PIN
#else
#define E6_AUTO_FAN_PIN -1
#endif
#endif
#ifndef E7_AUTO_FAN_PIN
#ifdef ORIG_E7_AUTO_FAN_PIN
#define E7_AUTO_FAN_PIN ORIG_E7_AUTO_FAN_PIN
#else
#define E7_AUTO_FAN_PIN -1
#endif
#endif
#ifndef CHAMBER_AUTO_FAN_PIN
#ifdef ORIG_CHAMBER_AUTO_FAN_PIN
#define CHAMBER_AUTO_FAN_PIN ORIG_CHAMBER_AUTO_FAN_PIN
#else
#define CHAMBER_AUTO_FAN_PIN -1
#endif
#endif
//
// Assign endstop pins for boards with only 3 connectors
//

View file

@ -118,11 +118,22 @@
#define CONTROLLER_FAN_PIN 4 // Pin used for the fan to cool motherboard (-1 to disable)
#endif
// Fans/Water Pump to cool the hotend cool side.
#define ORIG_E0_AUTO_FAN_PIN 5
#define ORIG_E1_AUTO_FAN_PIN 5
#define ORIG_E2_AUTO_FAN_PIN 5
#define ORIG_E3_AUTO_FAN_PIN 5
//
// Auto fans
//
#define AUTO_FAN_PIN 5
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
//
// LCD / Controller

View file

@ -42,10 +42,18 @@
//
// Auto fans
//
#define ORIG_E0_AUTO_FAN_PIN 11
#define ORIG_E1_AUTO_FAN_PIN 6
#define ORIG_E2_AUTO_FAN_PIN 6
#define ORIG_E3_AUTO_FAN_PIN 6
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 11
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN 6
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN 6
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN 6
#endif
//
// M3/M4/M5 - Spindle/Laser Control

View file

@ -32,7 +32,9 @@
#define Z_STOP_PIN 15
#define FIL_RUNOUT_PIN 39
#define ORIG_E0_AUTO_FAN_PIN 7
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 7
#endif
//
// Import RAMPS 1.4 pins

View file

@ -30,7 +30,9 @@
#define FAN_PIN 8
#define FAN1_PIN -1
#define ORIG_E0_AUTO_FAN_PIN 7
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 7
#endif
#ifndef TEMP_0_PIN
#if TEMP_SENSOR_0 == -1

View file

@ -28,9 +28,12 @@
#define BOARD_INFO_NAME "Anycubic RAMPS 1.3"
#define IS_RAMPS_EFB
#define RAMPS_D9_PIN 44
#define FAN2_PIN 9
#define ORIG_E0_AUTO_FAN_PIN 9
#define RAMPS_D9_PIN 44
#define FAN2_PIN 9
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 9
#endif
#include "pins_RAMPS_13.h"

View file

@ -83,7 +83,10 @@
#define FAN1_PIN TG_FAN1_PIN
#endif
#define FAN2_PIN TG_FAN2_PIN
#define ORIG_E0_AUTO_FAN_PIN TG_FAN2_PIN // Used in Anycubic Kossel example config
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN TG_FAN2_PIN // Used in Anycubic Kossel example config
#endif
#include "pins_RAMPS.h"

View file

@ -98,7 +98,9 @@
#define FAN_PIN 7
#endif
#define ORIG_E0_AUTO_FAN_PIN 77
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 77
#endif
//
// Misc. Functions

View file

@ -38,8 +38,16 @@
#undef FAN_PIN
#define FAN_PIN 5 // Using the pin for the controller fan since controller fan is always on.
#define CONTROLLER_FAN_PIN 8
#define ORIG_E0_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan
#define ORIG_E1_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan (same pin for both extruders since it's the same fan)
//
// Auto fans
//
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan (same pin for both extruders since it's the same fan)
#endif
//
// LCDs and Controllers

View file

@ -39,10 +39,21 @@
#define ZRIB_V20_D29_PIN 29
#define ZRIB_V20_D37_PIN 37
#define ORIG_E0_AUTO_FAN_PIN ZRIB_V20_D6_PIN
#define ORIG_E1_AUTO_FAN_PIN ZRIB_V20_D6_PIN
#define ORIG_E2_AUTO_FAN_PIN ZRIB_V20_D6_PIN
#define ORIG_E3_AUTO_FAN_PIN ZRIB_V20_D6_PIN
//
// Auto fans
//
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN ZRIB_V20_D6_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN ZRIB_V20_D6_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN ZRIB_V20_D6_PIN
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN ZRIB_V20_D6_PIN
#endif
#ifndef FILWIDTH_PIN
#define FILWIDTH_PIN 11 // Analog Input

View file

@ -93,11 +93,26 @@
// Fans
//
//#define FAN0_PIN 8
#define ORIG_E0_AUTO_FAN_PIN 30
#define ORIG_E1_AUTO_FAN_PIN 30
#define ORIG_E2_AUTO_FAN_PIN 30
#define ORIG_E3_AUTO_FAN_PIN 30
#define ORIG_CHAMBER_AUTO_FAN_PIN 10
//
// Auto fans
//
#define AUTO_FAN_PIN 30
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN AUTO_FAN_PIN
#endif
#ifndef CHAMBER_AUTO_FAN_PIN
#define CHAMBER_AUTO_FAN_PIN 10
#endif
//
// SD card

View file

@ -240,8 +240,6 @@
#elif ENABLED(MKS_MINI_12864)
#define ORIG_BEEPER_PIN 62
#define DOGLCD_A0 52
#define DOGLCD_CS 50

View file

@ -389,6 +389,31 @@
// Heaters, Fans, Temp Sensors
//
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN -1
#endif
#ifndef E1_AUTO_FAN_PIN
#define E1_AUTO_FAN_PIN -1
#endif
#ifndef E2_AUTO_FAN_PIN
#define E2_AUTO_FAN_PIN -1
#endif
#ifndef E3_AUTO_FAN_PIN
#define E3_AUTO_FAN_PIN -1
#endif
#ifndef E4_AUTO_FAN_PIN
#define E4_AUTO_FAN_PIN -1
#endif
#ifndef E5_AUTO_FAN_PIN
#define E5_AUTO_FAN_PIN -1
#endif
#ifndef E6_AUTO_FAN_PIN
#define E6_AUTO_FAN_PIN -1
#endif
#ifndef E7_AUTO_FAN_PIN
#define E7_AUTO_FAN_PIN -1
#endif
#define _H0_PINS
#define _H1_PINS
#define _H2_PINS

View file

@ -110,10 +110,13 @@
// These are FAN PWM pins on EXT0..EXT2 connectors.
//
//#define FAN_PIN PB9 // EXT0 port
#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#define FAN1_PIN PB8 // EXT1 port
#define FAN2_PIN PB7 // EXT2 port
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#endif
//
// Temperature Sensors
//

View file

@ -110,10 +110,13 @@
// These are FAN PWM pins on EXT0..EXT2 connectors.
//
//#define FAN_PIN PB9 // EXT0 port
#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#define FAN1_PIN PB8 // EXT1 port
#define FAN2_PIN PB7 // EXT2 port
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#endif
//
// Temperature Sensors
//

View file

@ -110,10 +110,13 @@
// These are FAN PWM pins on EXT0..EXT2 connectors.
//
//#define FAN_PIN PB9 // EXT0 port
#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#define FAN1_PIN PB8 // EXT1 port
#define FAN2_PIN PB7 // EXT2 port
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#endif
//
// Temperature Sensors
//

View file

@ -112,7 +112,10 @@
//#define FAN_PIN PB9 // EXT0 port
#define FAN1_PIN PB8 // EXT1 port
#define FAN2_PIN PB7 // EXT2 port
#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan
#endif
//
// Temperature Sensors

View file

@ -126,7 +126,9 @@
#define FAN1_PIN PC7
#define FAN2_PIN PC8
#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN // Use this by NOT overriding E0_AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PC7
#endif
//
// Misc. Functions

View file

@ -115,7 +115,9 @@
#define FAN1_PIN PF6
#define FAN2_PIN PF7
#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN // Use this by NOT overriding E0_AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PF6
#endif
//
// LED / Lighting

View file

@ -107,12 +107,14 @@
#define HEATER_BED_PIN PA2
#ifndef FAN_PIN
// #define FAN_PIN PC15
//#define FAN_PIN PC15
#endif
#define FAN1_PIN PC15
#define FAN2_PIN PA0
#define ORIG_E0_AUTO_FAN_PIN PC15 // Use this by NOT overriding E0_AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PC15 // FAN1_PIN
#endif
//
// Prusa i3 MK2 Multi Material Multiplexer Support

View file

@ -166,9 +166,12 @@
#define FAN_PIN 57 // PC4 E1_FAN PWM pin, Part cooling fan FET
#define FAN1_PIN 58 // PC5 E2_FAN PWM pin, Extruder fan FET
#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN
#define FAN2_PIN 59 // PE8 E3_FAN PWM pin, Controller fan FET
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 58 // FAN1_PIN
#endif
//
// Misc functions
//

View file

@ -135,7 +135,9 @@
#define FAN1_PIN PB5 // PA0
#define FAN2_PIN PB4 // PA1
#define ORIG_E0_AUTO_FAN_PIN PD13 // Use this by NOT overriding E0_AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PD13
#endif
//
// Misc. Functions

View file

@ -99,7 +99,9 @@
#endif
#define FAN1_PIN 32 // "FAN2"
#define ORIG_E0_AUTO_FAN_PIN 32 // Use this by NOT overriding E0_AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 32
#endif
//
// Servos

View file

@ -127,7 +127,9 @@
#define FAN1_PIN PA0
#define FAN2_PIN PA1
#define ORIG_E0_AUTO_FAN_PIN PA1 // Use this by NOT overriding E0_AUTO_FAN_PIN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PA1
#endif
//
// Misc. Functions