From 91d897dbbe7793727c33a4b5a9cec0f89ff35819 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Sat, 12 Sep 2015 15:23:42 +1000 Subject: [PATCH] iomux: Fix setting of invalid bits when masking in iomux fields Fixes regression from 2a939e97 Part of issue #45 --- core/include/esp/iomux_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/include/esp/iomux_regs.h b/core/include/esp/iomux_regs.h index 4ea3be2..2600da9 100644 --- a/core/include/esp/iomux_regs.h +++ b/core/include/esp/iomux_regs.h @@ -45,7 +45,7 @@ _Static_assert(sizeof(struct IOMUX_REGS) == 0x44, "IOMUX_REGS is the wrong size" #define IOMUX_PIN_FUNC_MASK 0x00001030 /* WARNING: Macro evaluates argument twice */ -#define IOMUX_FUNC(val) (VAL2FIELD(IOMUX_PIN_FUNC_LOW, val) | VAL2FIELD(IOMUX_PIN_FUNC_HIGH, val)) +#define IOMUX_FUNC(val) (VAL2FIELD_M(IOMUX_PIN_FUNC_LOW, val) | VAL2FIELD_M(IOMUX_PIN_FUNC_HIGH, val)) /* WARNING: Macro evaluates argument twice */ #define IOMUX_FUNC_VALUE(regbits) (FIELD2VAL(IOMUX_PIN_FUNC_LOW, regbits) | FIELD2VAL(IOMUX_PIN_FUNC_HIGH, regbits))