From 30d0818179fdb5c429419775cc8016a0f4c7e3f7 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Mon, 7 Oct 2019 11:57:40 -0500 Subject: [PATCH] drivers/gpio: use more clear expression for GPIO direction mask Define the mask in terms of the individual non-zero fields to isolate from future changes to the bit position. Signed-off-by: Peter Bigot --- include/drivers/gpio.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/drivers/gpio.h b/include/drivers/gpio.h index 0deeea9a9bf..98ce7b344c6 100644 --- a/include/drivers/gpio.h +++ b/include/drivers/gpio.h @@ -247,8 +247,7 @@ extern "C" { */ /** @cond INTERNAL_HIDDEN */ -#define GPIO_DIR_SHIFT 8 -#define GPIO_DIR_MASK (0x3U << GPIO_DIR_SHIFT) +#define GPIO_DIR_MASK (GPIO_INPUT | GPIO_OUTPUT) /** @endcond */ /** Legacy flag indicating pin is configured as input only.