diff options
author | Damien George <damien.p.george@gmail.com> | 2015-08-03 00:05:16 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-08-03 00:14:48 +0100 |
commit | 0851751615580d02bd6f841e13651923f05fde59 (patch) | |
tree | 28b788def0d7a128b57512a923a84657d65d11be /stmhal/spi.c | |
parent | 6f1c00869c761ff84b21939a057d7752e0c01be9 (diff) |
stmhal: Factor GPIO clock enable logic into mp_hal_gpio_clock_enable.
Extracted GPIO clock enable logic into mp_hal_gpio_clock_enable
and called from anyplace which might need to use GPIO functions
on ports other than A-D.
Thanks to Dave Hylands for the patch.
Diffstat (limited to 'stmhal/spi.c')
-rw-r--r-- | stmhal/spi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/stmhal/spi.c b/stmhal/spi.c index 68ae239c9..c318d923c 100644 --- a/stmhal/spi.c +++ b/stmhal/spi.c @@ -179,6 +179,7 @@ void spi_init(SPI_HandleTypeDef *spi, bool enable_nss_pin) { } for (uint i = (enable_nss_pin ? 0 : 1); i < 4; i++) { + mp_hal_gpio_clock_enable(pins[i]->gpio); GPIO_InitStructure.Pin = pins[i]->pin_mask; HAL_GPIO_Init(pins[i]->gpio, &GPIO_InitStructure); } |