diff options
| author | FuChao <[email protected]> | 2021-09-12 10:36:14 +0800 |
|---|---|---|
| committer | FuChao <[email protected]> | 2021-09-12 10:36:14 +0800 |
| commit | ea5d55e7de0ae597ddfcb26811d71f9ff7d3e57b (patch) | |
| tree | 5379b455e6ab572fb30e7990a1ee719cd82415b0 /bsp | |
| parent | 850815db622e12c8df3a25f823078a24c9876cbe (diff) | |
fix GPIO define
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/Vango_V85xx/drivers/drv_gpio.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bsp/Vango_V85xx/drivers/drv_gpio.h b/bsp/Vango_V85xx/drivers/drv_gpio.h index 11a386dcc8..ea700ae323 100644 --- a/bsp/Vango_V85xx/drivers/drv_gpio.h +++ b/bsp/Vango_V85xx/drivers/drv_gpio.h @@ -23,7 +23,7 @@ extern "C" { #define __V85XX_PORT(port) GPIO##port##_BASE -#define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__V85XX_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN) +#define GET_PIN(PORTx,PIN) (__V85XX_PORT(PORTx)==GPIOA_BASE) ? (rt_base_t)(0 + PIN):(rt_base_t)((16 * ( ((rt_base_t)__V85XX_PORT(PORTx) - (rt_base_t)GPIOB_BASE)/(0x0400UL) +1)) + PIN) #define PIN_NUM(port, no) (((((port) & 0xFu) << 4) | ((no) & 0xFu))) #define PIN_PORT(pin) ((uint8_t)(((pin) >> 4) & 0xFu)) |
