Skip to content

Commit aa23b64

Browse files
committed
STM32F4xx - Align STM_PIN_DATA macro on ARCH_MAX too
1 parent ee624a2 commit aa23b64

File tree

1 file changed

+1
-1
lines changed
  • hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX

1 file changed

+1
-1
lines changed

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/PinNames.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern "C" {
3737
#endif
3838

3939
// See stm32f4xx_hal_gpio.h and stm32f4xx_hal_gpio_ex.h for values of MODE, PUPD and AFNUM
40-
#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM) << 7) | ((PUPD) << 4) | ((MODE) << 0)))
40+
#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM & 0x0F) << 7) | ((PUPD & 0x07) << 4) | ((MODE & 0x0F) << 0)))
4141
#define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((INVERTED & 0x01) << 16) | ((CHANNEL & 0x1F) << 11) | ((AFNUM & 0x0F) << 7) | ((PUPD & 0x07) << 4) | ((MODE & 0x0F) << 0)))
4242
#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F)
4343
#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07)

0 commit comments

Comments
 (0)