diff --git a/Marlin/src/HAL/HAL_STM32/fastio_STM32.h b/Marlin/src/HAL/HAL_STM32/fastio_STM32.h index d575e9cf40..bd2edb4495 100644 --- a/Marlin/src/HAL/HAL_STM32/fastio_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/fastio_STM32.h @@ -80,7 +80,7 @@ void FastIO_init(); // Must be called before using fast io macros #define IS_INPUT(IO) #define IS_OUTPUT(IO) -#define HAS_TIMER(IO) +#define HAS_TIMER(IO) digitalPinHasPWM(IO) #define PWM_PIN(P) HAS_TIMER(P) #define USEABLE_HARDWARE_PWM(P) PWM_PIN(P) diff --git a/Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h b/Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h index 5ad6227e25..bac5bdabca 100644 --- a/Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h +++ b/Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h @@ -50,9 +50,9 @@ #define IS_INPUT(IO) #define IS_OUTPUT(IO) -#define HAS_TIMER(IO) +#define HAS_TIMER(IO) true -#define PWM_PIN(P) true +#define PWM_PIN(P) HAS_TIMER(P) #define USEABLE_HARDWARE_PWM(P) PWM_PIN(P) // digitalRead/Write wrappers diff --git a/Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h b/Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h index 1a19e1c3f6..50b071ff30 100644 --- a/Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h +++ b/Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h @@ -49,9 +49,9 @@ #define IS_INPUT(IO) #define IS_OUTPUT(IO) -#define HAS_TIMER(IO) +#define HAS_TIMER(IO) true -#define PWM_PIN(P) true +#define PWM_PIN(P) HAS_TIMER(P) #define USEABLE_HARDWARE_PWM(P) PWM_PIN(P) // digitalRead/Write wrappers