From 8bad6e11e2efadc5ef0c1b846fcad92cb056b160 Mon Sep 17 00:00:00 2001 From: BigTreeTech <38851044+bigtreetech@users.noreply.github.com> Date: Thu, 12 Mar 2020 05:42:28 +0800 Subject: [PATCH] Fix STM32 _WRITE macro parameter (#17121) --- Marlin/src/HAL/HAL_STM32/fastio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/HAL_STM32/fastio.h b/Marlin/src/HAL/HAL_STM32/fastio.h index fa94d4703c..c17901fa99 100644 --- a/Marlin/src/HAL/HAL_STM32/fastio.h +++ b/Marlin/src/HAL/HAL_STM32/fastio.h @@ -55,7 +55,7 @@ void FastIO_init(); // Must be called before using fast io macros else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(STM_PIN(digitalPin[IO])) ; \ }while(0) #else - #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + (V ? 0 : 16))) + #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + ((V) ? 0 : 16))) #endif #define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(STM_PIN(digitalPin[IO]))))