🔧 Up to 12 PWM fans

This commit is contained in:
Scott Lahteine 2023-12-21 15:25:48 -06:00
parent 19617b79db
commit 401ba6613b
2 changed files with 44 additions and 29 deletions

View file

@ -2473,11 +2473,7 @@
#define COOLER_MAX_TARGET (COOLER_MAXTEMP - (COOLER_OVERSHOOT)) #define COOLER_MAX_TARGET (COOLER_MAXTEMP - (COOLER_OVERSHOOT))
#endif #endif
#if HAS_HEATED_BED || HAS_TEMP_CHAMBER #if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_TEMP_CHAMBER || HAS_TEMP_PROBE || HAS_TEMP_COOLER || HAS_TEMP_BOARD || HAS_TEMP_SOC
#define BED_OR_CHAMBER 1
#endif
#if HAS_TEMP_HOTEND || BED_OR_CHAMBER || HAS_TEMP_PROBE || HAS_TEMP_COOLER || HAS_TEMP_BOARD || HAS_TEMP_SOC
#define HAS_TEMP_SENSOR 1 #define HAS_TEMP_SENSOR 1
#endif #endif
@ -2644,11 +2640,13 @@
#endif #endif
#endif #endif
// Print Cooling fans (limit) /**
* Up to 12 PWM fans
*/
#ifdef NUM_M106_FANS #ifdef NUM_M106_FANS
#define MAX_FANS NUM_M106_FANS #define MAX_FANS NUM_M106_FANS
#else #else
#define MAX_FANS 8 // Max supported fans #define MAX_FANS 12 // Max supported fans
#endif #endif
#define _IS_E_AUTO(N,F) (PIN_EXISTS(E##N##_AUTO_FAN) && E##N##_AUTO_FAN_PIN == FAN##F##_PIN) #define _IS_E_AUTO(N,F) (PIN_EXISTS(E##N##_AUTO_FAN) && E##N##_AUTO_FAN_PIN == FAN##F##_PIN)
@ -2683,21 +2681,30 @@
#if _HAS_FAN(7) #if _HAS_FAN(7)
#define HAS_FAN7 1 #define HAS_FAN7 1
#endif #endif
#undef _NOT_E_AUTO #if _HAS_FAN(8)
#define HAS_FAN8 1
#endif
#if _HAS_FAN(9)
#define HAS_FAN9 1
#endif
#if _HAS_FAN(10)
#define HAS_FAN10 1
#endif
#if _HAS_FAN(11)
#define HAS_FAN11 1
#endif
#undef _HAS_FAN #undef _HAS_FAN
#undef _IS_E_AUTO
#if BED_OR_CHAMBER || HAS_FAN0 #if HAS_FAN11
#define BED_OR_CHAMBER_OR_FAN 1 #define FAN_COUNT 12
#endif #elif HAS_FAN10
#define FAN_COUNT 11
/** #elif HAS_FAN9
* Up to 8 PWM fans #define FAN_COUNT 10
*/ #elif HAS_FAN8
#ifndef FAN_INVERTING #define FAN_COUNT 9
#define FAN_INVERTING false #elif HAS_FAN7
#endif
#if HAS_FAN7
#define FAN_COUNT 8 #define FAN_COUNT 8
#elif HAS_FAN6 #elif HAS_FAN6
#define FAN_COUNT 7 #define FAN_COUNT 7
@ -2721,6 +2728,10 @@
#define HAS_FAN 1 #define HAS_FAN 1
#endif #endif
#ifndef FAN_INVERTING
#define FAN_INVERTING false
#endif
#if PIN_EXISTS(FANMUX0) #if PIN_EXISTS(FANMUX0)
#define HAS_FANMUX 1 // Part Cooling fan multipliexer #define HAS_FANMUX 1 // Part Cooling fan multipliexer
#endif #endif

View file

@ -143,7 +143,7 @@
// Can also be overridden in Configuration_adv.h // Can also be overridden in Configuration_adv.h
// If you can afford it, try the 3-frame fan animation! // If you can afford it, try the 3-frame fan animation!
// Don't compile in the fan animation with no fan // Don't compile in the fan animation with no fan
#if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && BED_OR_CHAMBER) || ALL(STATUS_COMBINE_HEATERS, HAS_HEATED_CHAMBER)) #if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && (HAS_HEATED_BED || HAS_TEMP_CHAMBER)) || ALL(STATUS_COMBINE_HEATERS, HAS_HEATED_CHAMBER))
#undef STATUS_FAN_FRAMES #undef STATUS_FAN_FRAMES
#elif !STATUS_FAN_FRAMES #elif !STATUS_FAN_FRAMES
#define STATUS_FAN_FRAMES 2 #define STATUS_FAN_FRAMES 2
@ -200,18 +200,22 @@
#undef STATUS_LOGO_WIDTH #undef STATUS_LOGO_WIDTH
#endif #endif
#if !defined(STATUS_HEATERS_X) && ((HAS_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)) #ifndef STATUS_HEATERS_X
#define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2) #define _BED_OR_CHAMBER_OR_FAN (HAS_HEATED_BED || HAS_TEMP_CHAMBER || HAS_FAN)
#if STATUS_HOTEND1_WIDTH #if (HAS_HOTEND && STATUS_LOGO_WIDTH && _BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !_BED_OR_CHAMBER_OR_FAN)
#if HOTENDS > 2 #define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2)
#define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 6) #if STATUS_HOTEND1_WIDTH
#if HOTENDS > 2
#define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 6)
#else
#define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 4)
#endif
#else #else
#define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 4) #define STATUS_HEATERS_X _STATUS_HEATERS_X(1, STATUS_HEATERS_WIDTH, 4)
#endif #endif
#else
#define STATUS_HEATERS_X _STATUS_HEATERS_X(1, STATUS_HEATERS_WIDTH, 4)
#endif #endif
#endif #endif
#undef _BED_OR_CHAMBER_OR_FAN
#endif #endif
// //