Skip to content

Commit

Permalink
♻️ FAN_PIN => FAN0_PIN
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 8, 2024
1 parent 5e8c7b3 commit d0fbc94
Show file tree
Hide file tree
Showing 224 changed files with 372 additions and 373 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/HAL/AVR/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
/**
* Checks for SOFT PWM
*/
#if HAS_FAN0 && FAN_PIN == 9 && DISABLED(FAN_SOFT_PWM) && ENABLED(SPEAKER)
#error "FAN_PIN 9 Hardware PWM uses Timer 2 which conflicts with Arduino AVR Tone Timer (for SPEAKER)."
#if HAS_FAN0 && FAN0_PIN == 9 && DISABLED(FAN_SOFT_PWM) && ENABLED(SPEAKER)
#error "FAN0_PIN 9 Hardware PWM uses Timer 2 which conflicts with Arduino AVR Tone Timer (for SPEAKER)."
#error "Disable SPEAKER or enable FAN_SOFT_PWM."
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* Check for common serial pin conflicts
*/
#define _CHECK_SERIAL_PIN(N) (( \
BTN_EN1 == N || DOGLCD_CS == N || HEATER_BED_PIN == N || FAN_PIN == N || \
BTN_EN1 == N || DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \
SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N \
))
#define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ typedef uint16_t hal_timer_t;
#endif

#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE, MKS_ROBIN_E3D, MKS_ROBIN_E3)
// SKR Mini E3 boards use PA8 as FAN_PIN, so TIMER 1 is used for Fan PWM.
// SKR Mini E3 boards use PA8 as FAN0_PIN, so TIMER 1 is used for Fan PWM.
#ifdef STM32_HIGH_DENSITY
#define MF_TIMER_SERVO0 8 // tone.cpp uses Timer 4
#else
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2685,7 +2685,7 @@
&& _NOT_E_AUTO(6,F) \
&& _NOT_E_AUTO(7,F) \
&& F < MAX_FANS)
#if PIN_EXISTS(FAN)
#if PIN_EXISTS(FAN0)
#define HAS_FAN0 1
#endif
#if _HAS_FAN(1)
Expand Down
28 changes: 14 additions & 14 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2286,21 +2286,21 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
*/
#if HAS_AUTO_FAN
#if HAS_FAN0
#if PIN_EXISTS(E0_AUTO_FAN) && E0_AUTO_FAN_PIN == FAN_PIN
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
#elif PIN_EXISTS(E1_AUTO_FAN) && E1_AUTO_FAN_PIN == FAN_PIN
#error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
#elif PIN_EXISTS(E2_AUTO_FAN) && E2_AUTO_FAN_PIN == FAN_PIN
#error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
#elif PIN_EXISTS(E3_AUTO_FAN) && E3_AUTO_FAN_PIN == FAN_PIN
#error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
#if PIN_EXISTS(E0_AUTO_FAN) && E0_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PIN_EXISTS(E1_AUTO_FAN) && E1_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E1_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PIN_EXISTS(E2_AUTO_FAN) && E2_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E2_AUTO_FAN_PIN equal to FAN0_PIN."
#elif PIN_EXISTS(E3_AUTO_FAN) && E3_AUTO_FAN_PIN == FAN0_PIN
#error "You cannot set E3_AUTO_FAN_PIN equal to FAN0_PIN."
#endif
#endif
#endif

#if HAS_FAN0
#if CONTROLLER_FAN_PIN == FAN_PIN
#error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
#if CONTROLLER_FAN_PIN == FAN0_PIN
#error "You cannot set CONTROLLER_FAN_PIN equal to FAN0_PIN."
#elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM)
#error "FAN_SOFT_PWM is required for your board. Enable it to continue."
#endif
Expand Down Expand Up @@ -2342,8 +2342,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#if NEED_CASE_LIGHT_PIN
#if !PIN_EXISTS(CASE_LIGHT)
#error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN, CASE_LIGHT_USE_NEOPIXEL, or CASE_LIGHT_USE_RGB_LED."
#elif CASE_LIGHT_PIN == FAN_PIN
#error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing."
#elif CASE_LIGHT_PIN == FAN0_PIN
#error "CASE_LIGHT_PIN conflicts with FAN0_PIN. Resolve before continuing."
#endif
#endif

Expand Down Expand Up @@ -4100,8 +4100,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#error "SPINDLE_LASER_PWM_PIN conflicts with E6_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E7_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E7_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN."
#elif _PIN_CONFLICT(FAN0)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN0_PIN."
#elif _PIN_CONFLICT(FAN1)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
#elif _PIN_CONFLICT(FAN2)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2642,7 +2642,7 @@ void Temperature::init() {
#endif

#if HAS_FAN0
INIT_FAN_PIN(FAN_PIN);
INIT_FAN_PIN(FAN0_PIN);
#endif
#if HAS_FAN1
INIT_FAN_PIN(FAN1_PIN);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_E4D.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
// Heaters / Fans
//
#define HEATER_0_PIN 2
#define FAN_PIN 0
#define FAN0_PIN 0
#define HEATER_BED_PIN 15

//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_ENWI_ESPNP.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

// General use mosfets, useful for things like pumps and solenoids
// Shift register pins 128, 129, 130 and 131 are broken out and can be used
#define FAN_PIN 132
#define FAN0_PIN 132
#define FAN1_PIN 134
#define FAN2_PIN 135
#define FAN3_PIN 136
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
// Heaters / Fans
//
#define HEATER_0_PIN 2
#define FAN_PIN 13
#define FAN0_PIN 13
#define HEATER_BED_PIN 4

// SPI
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_ESPA_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
// Heaters / Fans
//
#define HEATER_0_PIN 2
#define FAN_PIN 13
#define FAN0_PIN 13
#define HEATER_BED_PIN 4

//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_MKS_TINYBEE.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
//
#define HEATER_0_PIN 145
#define HEATER_1_PIN 146
#define FAN_PIN 147
#define FAN0_PIN 147
#define FAN1_PIN 148
#define HEATER_BED_PIN 144

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_MRR_ESPE.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
// Heaters / Fans
//
#define HEATER_0_PIN 145 // 2
#define FAN_PIN 146 // 15
#define FAN0_PIN 146 // 15
#define HEATER_BED_PIN 144 // 4

#define CONTROLLER_FAN_PIN 147
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_PANDA_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
//
#define HEATER_0_PIN 108
#define HEATER_BED_PIN 109
#define FAN_PIN 118 // FAN0
#define FAN0_PIN 118 // FAN0
#define FAN1_PIN 119 // FAN1

#ifndef E0_AUTO_FAN_PIN
Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/pins/linux/pins_RAMPS_LINUX.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,21 @@
#define HEATER_0_PIN MOSFET_A_PIN

#if FET_ORDER_EFB // Hotend, Fan, Bed
#define FAN_PIN MOSFET_B_PIN
#define FAN0_PIN MOSFET_B_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#elif FET_ORDER_EEF // Hotend, Hotend, Fan
#define HEATER_1_PIN MOSFET_B_PIN
#define FAN_PIN MOSFET_C_PIN
#define FAN0_PIN MOSFET_C_PIN
#elif FET_ORDER_EEB // Hotend, Hotend, Bed
#define HEATER_1_PIN MOSFET_B_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#elif FET_ORDER_EFF // Hotend, Fan, Fan
#define FAN_PIN MOSFET_B_PIN
#define FAN0_PIN MOSFET_B_PIN
#define FAN1_PIN MOSFET_C_PIN
#elif FET_ORDER_SF // Spindle, Fan
#define FAN_PIN MOSFET_C_PIN
#define FAN0_PIN MOSFET_C_PIN
#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
#define FAN_PIN MOSFET_B_PIN
#define FAN0_PIN MOSFET_B_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
#define FAN1_PIN MOSFET_D_PIN
Expand All @@ -184,8 +184,8 @@
#endif
#endif

#ifndef FAN_PIN
#define FAN_PIN 4 // IO pin. Buffer needed
#ifndef FAN0_PIN
#define FAN0_PIN 4 // IO pin. Buffer needed
#endif

//
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
// EFB
#define HEATER_0_PIN P2_04
#define HEATER_BED_PIN P2_05
#ifndef FAN_PIN
#define FAN_PIN P2_07
#ifndef FAN0_PIN
#define FAN0_PIN P2_07
#endif
#define FAN1_PIN P0_26

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
//
#define HEATER_0_PIN P2_07
#define HEATER_BED_PIN P2_05
#ifndef FAN_PIN
#define FAN_PIN P2_04
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif

//
Expand Down Expand Up @@ -170,7 +170,7 @@
* PWM1.4 P1_23 <none>
* PWM1.4 P2_3 E0_STEP_PIN
* PWM1.5 P1_24 X_MIN_PIN
* PWM1.5 P2_4 FAN_PIN
* PWM1.5 P2_4 FAN0_PIN
* PWM1.6 P1_26 Y_MIN_PIN
* PWM1.6 P2_5 HEATER_BED_PIN
*/
6 changes: 3 additions & 3 deletions Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
//
#define HEATER_0_PIN P2_07
#define HEATER_BED_PIN P2_05
#ifndef FAN_PIN
#define FAN_PIN P2_04
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif

//
Expand Down Expand Up @@ -147,7 +147,7 @@
* PWM1.4 P1_23 <none>
* PWM1.4 P2_3 E0_STEP_PIN
* PWM1.5 P1_24 X_MIN_PIN
* PWM1.5 P2_4 FAN_PIN
* PWM1.5 P2_4 FAN0_PIN
* PWM1.6 P1_26 Y_MIN_PIN
* PWM1.6 P2_5 HEATER_BED_PIN
*/
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
#define HEATER_1_PIN P2_04
#endif
#endif
#ifndef FAN_PIN
#define FAN_PIN P2_03
#ifndef FAN0_PIN
#define FAN0_PIN P2_03
#endif
#ifndef HEATER_BED_PIN
#define HEATER_BED_PIN P2_05
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1768/pins_EMOTRONIC.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
#define HEATER_0_PIN P2_06 // (H2: 10A shared)
#define HEATER_1_PIN P2_07 // (H3: 10A shared)

#define FAN_PIN P2_11 // (FAN0: 1A)
#define FAN0_PIN P2_11 // (FAN0: 1A)
#define FAN1_PIN P2_13 // (FAN1: 1A)

//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
//
#define HEATER_BED_PIN P1_19 // Not a PWM pin, software PWM required
#define HEATER_0_PIN P3_26 // PWM1[3]
#define FAN_PIN P3_25 // Part cooling fan - connected to PWM1[2]
#define FAN0_PIN P3_25 // Part cooling fan - connected to PWM1[2]
#define E0_AUTO_FAN_PIN P0_27 // Extruder cooling fan

//
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
#define HEATER_BED_PIN P2_05
#define HEATER_0_PIN P2_07
#define HEATER_1_PIN P2_06
#ifndef FAN_PIN
#define FAN_PIN P2_04
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif

//
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@
#define HEATER_1_PIN P2_06
#endif
#endif
#ifndef FAN_PIN
#define FAN_PIN P2_04
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif

//
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@
#endif
#endif

#ifndef FAN_PIN
#ifndef FAN0_PIN
#if ANY(FET_ORDER_EFB, FET_ORDER_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
#define FAN_PIN MOSFET_B_PIN
#define FAN0_PIN MOSFET_B_PIN
#elif ANY(FET_ORDER_EEF, FET_ORDER_SF) // Hotend, Hotend, Fan or Spindle, Fan
#define FAN_PIN MOSFET_C_PIN
#define FAN0_PIN MOSFET_C_PIN
#elif FET_ORDER_EEB // Hotend, Hotend, Bed
#define FAN_PIN P1_18 // (4) IO pin. Buffer needed
#define FAN0_PIN P1_18 // (4) IO pin. Buffer needed
#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
#define FAN_PIN MOSFET_B_PIN
#define FAN0_PIN MOSFET_B_PIN
#endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
#define HEATER_BED2_PIN P2_04
#define HEATER_0_PIN P2_07
#define HEATER_1_PIN P2_06
#ifndef FAN_PIN
#define FAN_PIN P1_24
#ifndef FAN0_PIN
#define FAN0_PIN P1_24
#endif
#define FAN1_PIN P1_26

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
#define HEATER_BED_PIN P2_07
#define HEATER_0_PIN P2_04
#define HEATER_1_PIN P2_05
#ifndef FAN_PIN
#define FAN_PIN P0_26
#ifndef FAN0_PIN
#define FAN0_PIN P0_26
#endif
#define FAN1_PIN P1_22

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
//
#define HEATER_BED_PIN P2_07
#define HEATER_0_PIN P2_05
#ifndef FAN_PIN
#define FAN_PIN P0_26
#ifndef FAN0_PIN
#define FAN0_PIN P0_26
#endif
#define FAN1_PIN P1_25

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
#define HEATER_0_PIN P2_03 // EXTRUDER 0
#define HEATER_1_PIN P2_04 // EXTRUDER 1
#define HEATER_BED_PIN P2_05 // BED
#define FAN_PIN P2_01
#define FAN0_PIN P2_01
#define FAN1_PIN P2_02

#ifndef CONTROLLER_FAN_PIN
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
//
#define HEATER_BED_PIN P2_05
#define HEATER_0_PIN P2_07 // FET 1
#ifndef FAN_PIN
#define FAN_PIN P2_06 // FET 3
#ifndef FAN0_PIN
#define FAN0_PIN P2_06 // FET 3
#endif

//
Expand Down Expand Up @@ -127,7 +127,7 @@
#define SPINDLE_LASER_ENA_PIN P2_07 // FET 1
#undef HEATER_BED_PIN
#define SPINDLE_LASER_PWM_PIN P2_05 // Bed FET
#undef FAN_PIN
#undef FAN0_PIN
#define SPINDLE_DIR_PIN P2_06 // FET 3
#endif

Expand Down
Loading

0 comments on commit d0fbc94

Please sign in to comment.