diff --git a/Marlin/src/HAL/GD32_MFL/fastio.h b/Marlin/src/HAL/GD32_MFL/fastio.h index 8185be73a4..35bd2b1ef7 100644 --- a/Marlin/src/HAL/GD32_MFL/fastio.h +++ b/Marlin/src/HAL/GD32_MFL/fastio.h @@ -27,9 +27,12 @@ #include #include -static inline void fast_write_pin_wrapper(pin_size_t IO, bool V) { - if (V) gpio::fast_set_pin(getPortFromPin(IO), getPinInPort(IO)); - else gpio::fast_clear_pin(getPortFromPin(IO), getPinInPort(IO)); +template +static inline void fast_write_pin_wrapper(pin_size_t IO, T V) { + auto port = getPortFromPin(IO); + auto pin = getPinInPort(IO); + if (static_cast(V)) gpio::fast_set_pin(port, pin); + else gpio::fast_clear_pin(port, pin); } static inline bool fast_read_pin_wrapper(pin_size_t IO) {