Przeglądaj źródła

🩺 Assert FAN_SOFT_PWM where required (#23383)

Scott Lahteine 2 lat temu
rodzic
commit
88a6e5b691
No account linked to committer's email address

+ 6
- 2
Marlin/src/inc/SanityCheck.h Wyświetl plik

2008
   #endif
2008
   #endif
2009
 #endif
2009
 #endif
2010
 
2010
 
2011
-#if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
2012
-  #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
2011
+#if HAS_FAN0
2012
+  #if CONTROLLER_FAN_PIN == FAN_PIN
2013
+    #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
2014
+  #elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM)
2015
+    #error "FAN_SOFT_PWM is required. Enable it to continue."
2016
+  #endif
2013
 #endif
2017
 #endif
2014
 
2018
 
2015
 #if ENABLED(USE_CONTROLLER_FAN)
2019
 #if ENABLED(USE_CONTROLLER_FAN)

+ 1
- 1
Marlin/src/pins/mega/pins_MEGACONTROLLER.h Wyświetl plik

121
   #define CONTROLLER_FAN_PIN            FAN2_PIN
121
   #define CONTROLLER_FAN_PIN            FAN2_PIN
122
 #endif
122
 #endif
123
 
123
 
124
-#define FAN_SOFT_PWM
124
+#define FAN_SOFT_PWM_REQUIRED
125
 
125
 
126
 //
126
 //
127
 // Misc. Functions
127
 // Misc. Functions

+ 1
- 1
Marlin/src/pins/stm32f1/pins_BEAST.h Wyświetl plik

93
   #define FAN_PIN                           PB10
93
   #define FAN_PIN                           PB10
94
 #endif
94
 #endif
95
 
95
 
96
-#define FAN_SOFT_PWM
96
+#define FAN_SOFT_PWM_REQUIRED
97
 
97
 
98
 //
98
 //
99
 // Temperature Sensors
99
 // Temperature Sensors

+ 1
- 1
Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h Wyświetl plik

113
 #define HEATER_BED_PIN                      PC9   // HOT BED
113
 #define HEATER_BED_PIN                      PC9   // HOT BED
114
 
114
 
115
 #define FAN_PIN                             PC6   // FAN
115
 #define FAN_PIN                             PC6   // FAN
116
-#define FAN_SOFT_PWM
116
+#define FAN_SOFT_PWM_REQUIRED
117
 
117
 
118
 #define CONTROLLER_FAN_PIN                  PC7
118
 #define CONTROLLER_FAN_PIN                  PC7
119
 
119
 

+ 1
- 1
Marlin/src/pins/stm32f1/pins_CHITU3D.h Wyświetl plik

87
   #define FAN_PIN                           PG14  // MAIN BOARD FAN
87
   #define FAN_PIN                           PG14  // MAIN BOARD FAN
88
 #endif
88
 #endif
89
 
89
 
90
-#define FAN_SOFT_PWM
90
+#define FAN_SOFT_PWM_REQUIRED
91
 
91
 
92
 //
92
 //
93
 // Temperature Sensors
93
 // Temperature Sensors

+ 1
- 3
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h Wyświetl plik

143
 #ifndef FAN_PIN
143
 #ifndef FAN_PIN
144
   #define FAN_PIN                           PA0   // FAN
144
   #define FAN_PIN                           PA0   // FAN
145
 #endif
145
 #endif
146
-#if PIN_EXISTS(FAN)
147
-  #define FAN_SOFT_PWM
148
-#endif
146
+#define FAN_SOFT_PWM_REQUIRED
149
 
147
 
150
 //
148
 //
151
 // SD Card
149
 // SD Card

+ 1
- 1
Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h Wyświetl plik

144
 #define HEATER_BED_PIN                      PA1   // HOT BED
144
 #define HEATER_BED_PIN                      PA1   // HOT BED
145
 
145
 
146
 #define FAN_PIN                             PA2   // FAN
146
 #define FAN_PIN                             PA2   // FAN
147
-#define FAN_SOFT_PWM
147
+#define FAN_SOFT_PWM_REQUIRED
148
 
148
 
149
 //
149
 //
150
 // SD Card
150
 // SD Card

+ 1
- 1
Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h Wyświetl plik

97
 // Heaters / Fans
97
 // Heaters / Fans
98
 //
98
 //
99
 
99
 
100
-#define FAN_SOFT_PWM
100
+#define FAN_SOFT_PWM_REQUIRED
101
 
101
 
102
 //
102
 //
103
 // SD Card
103
 // SD Card

+ 4
- 3
Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h Wyświetl plik

38
 //#define DISABLE_DEBUG
38
 //#define DISABLE_DEBUG
39
 #define DISABLE_JTAG
39
 #define DISABLE_JTAG
40
 //#define ENABLE_SPI3
40
 //#define ENABLE_SPI3
41
-#define FLASH_EEPROM_EMULATION
42
-#define FAN_SOFT_PWM
43
 
41
 
44
-#if ENABLED(FLASH_EEPROM_EMULATION)
42
+#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
43
+  #define FLASH_EEPROM_EMULATION
45
   #define EEPROM_PAGE_SIZE     (0x800U)           // 2KB
44
   #define EEPROM_PAGE_SIZE     (0x800U)           // 2KB
46
   #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
45
   #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
47
   #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE)
46
   #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE)
118
   #endif
117
   #endif
119
 #endif
118
 #endif
120
 
119
 
120
+#define FAN_SOFT_PWM_REQUIRED
121
+
121
 //
122
 //
122
 // Misc. Functions
123
 // Misc. Functions
123
 //
124
 //

+ 6
- 4
Marlin/src/pins/stm32f1/pins_FLY_MINI.h Wyświetl plik

30
 //
30
 //
31
 // Flash EEPROM Emulation
31
 // Flash EEPROM Emulation
32
 //
32
 //
33
-#define FLASH_EEPROM_EMULATION
34
-#define EEPROM_PAGE_SIZE     0x800 // 2KB
35
-#define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space
36
-#define MARLIN_EEPROM_SIZE   EEPROM_PAGE_SIZE
33
+#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
34
+  #define FLASH_EEPROM_EMULATION
35
+  #define EEPROM_PAGE_SIZE     0x800 // 2KB
36
+  #define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space
37
+  #define MARLIN_EEPROM_SIZE   EEPROM_PAGE_SIZE
38
+#endif
37
 
39
 
38
 //
40
 //
39
 // Servos
41
 // Servos

+ 12
- 6
Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h Wyświetl plik

90
 
90
 
91
 #define FAN_PIN                             PA15  // pin 77 (4cm Fan)
91
 #define FAN_PIN                             PA15  // pin 77 (4cm Fan)
92
 #ifdef MAPLE_STM32F1
92
 #ifdef MAPLE_STM32F1
93
-  #define FAN_SOFT_PWM                            // Required to avoid issues with heating or STLink
94
-  #define FAN_MIN_PWM                         35  // Fan will not start in 1-30 range
95
-  #define FAN_MAX_PWM                        255
93
+  #define FAN_SOFT_PWM_REQUIRED
94
+  #if ENABLED(FAN_SOFT_PWM) && FAN_MIN_PWM < 35   // Required to avoid issues with heating or STLink
95
+    #error "FAN_MIN_PWM must be 35 or higher."    // Fan will not start in 1-30 range
96
+  #endif
97
+#elif ENABLED(FAST_PWM_FAN)
98
+  #if FAST_PWM_FAN_FREQUENCY != 31400             // Default 1000 is noisy, max 65K (uint16)
99
+    #error "FAST_PWM_FAN_FREQUENCY must be set to 31400."
100
+  #endif
101
+  #if FAN_MIN_PWM < 5
102
+    #error "FAN_MIN_PWM must be 5 or higher."
103
+  #endif
96
 #else
104
 #else
97
-  #define FAST_PWM_FAN                            // STM32 Variant allow TIMER2 Hardware PWM
98
-  #define FAN_MIN_PWM                          5
99
-  #define FAN_MAX_PWM                        255
105
+  #error "FAST_PWM_FAN required to allow TIMER2 Hardware PWM."
100
 #endif
106
 #endif
101
 
107
 
102
 //#define BEEPER_PIN                        PD13  // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor
108
 //#define BEEPER_PIN                        PD13  // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor

+ 1
- 1
Marlin/src/pins/stm32f1/pins_STM3R_MINI.h Wyświetl plik

91
 #endif
91
 #endif
92
 #define FAN1_PIN                            PD13
92
 #define FAN1_PIN                            PD13
93
 
93
 
94
-#define FAN_SOFT_PWM
94
+#define FAN_SOFT_PWM_REQUIRED
95
 
95
 
96
 //
96
 //
97
 // Temperature Sensors
97
 // Temperature Sensors

+ 3
- 1
Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h Wyświetl plik

45
 //
45
 //
46
 // EEPROM
46
 // EEPROM
47
 //
47
 //
48
-#define FLASH_EEPROM_EMULATION
48
+#if NO_EEPROM_SELECTED
49
+  #define FLASH_EEPROM_EMULATION
50
+#endif
49
 #if ENABLED(FLASH_EEPROM_EMULATION)
51
 #if ENABLED(FLASH_EEPROM_EMULATION)
50
   // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h)
52
   // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h)
51
   #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE)
53
   #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE)

+ 4
- 2
Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h Wyświetl plik

29
 
29
 
30
 #define BOARD_INFO_NAME      "Artillery Ruby"
30
 #define BOARD_INFO_NAME      "Artillery Ruby"
31
 
31
 
32
-#define FLASH_EEPROM_EMULATION
33
-//#define I2C_EEPROM
32
+#if NO_EEPROM_SELECTED
33
+  #define FLASH_EEPROM_EMULATION
34
+  //#define I2C_EEPROM
35
+#endif
34
 //#define E2END                            0xFFF  // 4KB
36
 //#define E2END                            0xFFF  // 4KB
35
 
37
 
36
 #define HAL_TIMER_RATE                     F_CPU
38
 #define HAL_TIMER_RATE                     F_CPU

+ 1
- 1
Marlin/src/pins/stm32f4/pins_INDEX_REV03.h Wyświetl plik

119
 #define FAN2_PIN                            PE4
119
 #define FAN2_PIN                            PE4
120
 #define FAN3_PIN                            PE5
120
 #define FAN3_PIN                            PE5
121
 
121
 
122
-#define FAN_SOFT_PWM
122
+#define FAN_SOFT_PWM_REQUIRED
123
 
123
 
124
 // Neopixel Rings
124
 // Neopixel Rings
125
 #define NEOPIXEL_PIN                        PC7
125
 #define NEOPIXEL_PIN                        PC7

+ 1
- 1
Marlin/src/pins/stm32f4/pins_RUMBA32_common.h Wyświetl plik

35
 
35
 
36
 // Use soft PWM for fans - PWM is not working properly when paired with STM32 Arduino Core v1.7.0
36
 // Use soft PWM for fans - PWM is not working properly when paired with STM32 Arduino Core v1.7.0
37
 // This can be removed when Core version is updated and PWM behaviour is fixed.
37
 // This can be removed when Core version is updated and PWM behaviour is fixed.
38
-#define FAN_SOFT_PWM
38
+#define FAN_SOFT_PWM_REQUIRED
39
 
39
 
40
 //
40
 //
41
 // Configure Timers
41
 // Configure Timers

+ 1
- 1
buildroot/tests/STM32F103RET6_creality Wyświetl plik

30
 restore_configs
30
 restore_configs
31
 opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1
31
 opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1
32
 opt_disable NOZZLE_TO_PROBE_OFFSET
32
 opt_disable NOZZLE_TO_PROBE_OFFSET
33
-opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN \
33
+opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN FAN_SOFT_PWM \
34
            PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE
34
            PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE
35
 exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3"
35
 exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3"
36
 
36
 

+ 1
- 1
buildroot/tests/STM32F103RE_btt_USB Wyświetl plik

15
 
15
 
16
 restore_configs
16
 restore_configs
17
 opt_set MOTHERBOARD BOARD_BTT_SKR_CR6 SERIAL_PORT -1 SERIAL_PORT_2 2 TEMP_SENSOR_BED 1
17
 opt_set MOTHERBOARD BOARD_BTT_SKR_CR6 SERIAL_PORT -1 SERIAL_PORT_2 2 TEMP_SENSOR_BED 1
18
-opt_enable CR10_STOCKDISPLAY \
18
+opt_enable CR10_STOCKDISPLAY FAN_SOFT_PWM \
19
            NOZZLE_AS_PROBE Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN Z_SAFE_HOMING \
19
            NOZZLE_AS_PROBE Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN Z_SAFE_HOMING \
20
            PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE \
20
            PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE \
21
            PROBING_HEATERS_OFF PREHEAT_BEFORE_PROBING
21
            PROBING_HEATERS_OFF PREHEAT_BEFORE_PROBING

+ 3
- 2
buildroot/tests/rumba32 Wyświetl plik

11
 opt_set MOTHERBOARD BOARD_RUMBA32_V1_0 SERIAL_PORT -1 \
11
 opt_set MOTHERBOARD BOARD_RUMBA32_V1_0 SERIAL_PORT -1 \
12
         TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130
12
         TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130
13
 opt_disable PIDTEMP
13
 opt_disable PIDTEMP
14
-opt_enable PIDTEMPBED
14
+opt_enable PIDTEMPBED FAN_SOFT_PWM
15
 opt_disable THERMAL_PROTECTION_BED
15
 opt_disable THERMAL_PROTECTION_BED
16
 exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection disabled" "$3"
16
 exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection disabled" "$3"
17
 
17
 
19
 restore_configs
19
 restore_configs
20
 opt_set MOTHERBOARD BOARD_RUMBA32_V1_1 SERIAL_PORT -1 \
20
 opt_set MOTHERBOARD BOARD_RUMBA32_V1_1 SERIAL_PORT -1 \
21
         TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208
21
         TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208
22
-opt_enable PIDTEMPBED EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
22
+opt_enable PIDTEMPBED FAN_SOFT_PWM EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
23
 exec_test $1 $2 "RUMBA32 V1.1 with TMC2130, TMC2208, PID Bed, EEPROM settings, and graphic LCD controller" "$3"
23
 exec_test $1 $2 "RUMBA32 V1.1 with TMC2130, TMC2208, PID Bed, EEPROM settings, and graphic LCD controller" "$3"
24
 
24
 
25
 # Build examples
25
 # Build examples
26
 restore_configs
26
 restore_configs
27
 opt_set MOTHERBOARD BOARD_RUMBA32_MKS SERIAL_PORT -1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208
27
 opt_set MOTHERBOARD BOARD_RUMBA32_MKS SERIAL_PORT -1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208
28
+opt_enable FAN_SOFT_PWM
28
 exec_test $1 $2 "RUMBA32 MKS Default Config with Mixed TMC Drivers" "$3"
29
 exec_test $1 $2 "RUMBA32 MKS Default Config with Mixed TMC Drivers" "$3"
29
 
30
 
30
 # cleanup
31
 # cleanup

Ładowanie…
Anuluj
Zapisz