🐛 修复编译错误

Signed-off-by: DAVE <ro7enkranz@qq.com>
This commit is contained in:
DAVE 2022-03-29 18:07:14 +08:00
parent a971c8ccc5
commit 7903659044
1 changed files with 9 additions and 4 deletions

View File

@ -3,10 +3,15 @@
#define GPIO_NOAF (0u)
#define _PIN_INIT(_PORT, _PIN, _MODE, _PULL, _SPEED, _AF) \
HAL_GPIO_Init(GPIO##_PORT, \
(GPIO_InitTypeDef[]) { \
{.Pin = GPIO_PIN_##_PIN, .Mode = GPIO_##_MODE, .Pull = GPIO_##_PULL, .Speed = GPIO_##_SPEED, .Alternate = GPIO_##_AF}
})
HAL_GPIO_Init(GPIO##_PORT, (GPIO_InitTypeDef[]) \
{{ \
.Pin = GPIO_PIN_##_PIN, \
.Mode = GPIO_##_MODE, \
.Pull = GPIO_##_PULL, \
.Speed = GPIO_##_SPEED, \
.Alternate = GPIO_##_AF \
}})
#define _PIN_HI(_PORT, _PIN, ...) GPIO##_PORT->BSRR = (1u << _PIN)
#define _PIN_LOW(_PORT, _PIN, ...) GPIO##_PORT->BSRR = (0x10000u << _PIN)
#define _PIN_TOGGLE(_PORT, _PIN, ...) \