Skip to content
This repository was archived by the owner on Nov 18, 2023. It is now read-only.

Commit fd9c698

Browse files
ellenspthinkyhead
authored andcommitted
HW PWM sanity checks for SPINDLE_LASER_FREQUENCY (MarlinFirmware#18947)
1 parent da144dc commit fd9c698

File tree

11 files changed

+23
-19
lines changed

11 files changed

+23
-19
lines changed

Marlin/src/HAL/DUE/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
#endif
5353
#endif
5454

55-
#if ENABLED(FAST_PWM_FAN)
56-
#error "FAST_PWM_FAN is not yet implemented for this platform."
55+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
56+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on DUE."
5757
#endif
5858

5959
#if HAS_TMC_SW_SERIAL

Marlin/src/HAL/ESP32/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#error "EMERGENCY_PARSER is not yet implemented for ESP32. Disable EMERGENCY_PARSER to continue."
2626
#endif
2727

28-
#if ENABLED(FAST_PWM_FAN)
29-
#error "FAST_PWM_FAN is not yet implemented for this platform."
28+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
29+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on ESP32."
3030
#endif
3131

3232
#if HAS_TMC_SW_SERIAL

Marlin/src/HAL/LINUX/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
3131
#endif
3232

33-
#if ENABLED(FAST_PWM_FAN)
34-
#error "FAST_PWM_FAN is not yet implemented for this platform."
33+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
34+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on LINUX."
3535
#endif
3636

3737
#if HAS_TMC_SW_SERIAL

Marlin/src/HAL/LPC1768/fast_pwm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255
3535
LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size);
3636
}
3737

38-
#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM
38+
#endif // NEEDS_HARDWARE_PWM
3939
#endif // TARGET_LPC1768

Marlin/src/HAL/LPC1768/inc/SanityCheck.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
*/
6060
static_assert(!(NUM_SERVOS && ENABLED(FAST_PWM_FAN)), "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards.");
6161

62+
#if SPINDLE_LASER_FREQUENCY
63+
static_assert(!NUM_SERVOS, "BLTOUCH and Servos are incompatible with SPINDLE_LASER_FREQUENCY on LPC176x boards.");
64+
#endif
65+
6266
/**
6367
* Test LPC176x-specific configuration values for errors at compile-time.
6468
*/

Marlin/src/HAL/SAMD51/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
#error "SDIO_SUPPORT is not supported on SAMD51."
4848
#endif
4949

50-
#if ENABLED(FAST_PWM_FAN)
51-
#error "FAST_PWM_FAN is not yet implemented for this platform."
50+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
51+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on SAMD51."
5252
#endif

Marlin/src/HAL/STM32/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
2929
//#endif
3030

31-
#if ENABLED(FAST_PWM_FAN)
32-
#error "FAST_PWM_FAN is not yet implemented for this platform."
31+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
32+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32."
3333
#endif
3434

3535
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)

Marlin/src/HAL/STM32F1/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue."
3030
#endif
3131

32-
#if ENABLED(FAST_PWM_FAN)
33-
#error "FAST_PWM_FAN is not yet implemented for this platform."
32+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
33+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32F1."
3434
#endif
3535

3636
#if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL

Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#error "EMERGENCY_PARSER is not yet implemented for STM32F4/7. Disable EMERGENCY_PARSER to continue."
3333
#endif
3434

35-
#if ENABLED(FAST_PWM_FAN)
36-
#error "FAST_PWM_FAN is not yet implemented for this platform."
35+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
36+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32F4/F7."
3737
#endif
3838

3939
#if HAS_TMC_SW_SERIAL

Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#error "EMERGENCY_PARSER is not yet implemented for Teensy 3.1/3.2. Disable EMERGENCY_PARSER to continue."
3030
#endif
3131

32-
#if ENABLED(FAST_PWM_FAN)
33-
#error "FAST_PWM_FAN is not yet implemented for this platform."
32+
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
33+
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on Teensy 3.1/3.2."
3434
#endif
3535

3636
#if HAS_TMC_SW_SERIAL

0 commit comments

Comments
 (0)