Skip to content

Commit

Permalink
🐛 修复编译错误
Browse files Browse the repository at this point in the history
Signed-off-by: DAVE <ro7enkranz@qq.com>
  • Loading branch information
SummerFalls committed Mar 29, 2022
1 parent a971c8c commit 7903659
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Src/io_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...) \
Expand Down

0 comments on commit 7903659

Please sign in to comment.