summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-09-13 10:33:38 +0700
committerGitHub <[email protected]>2019-09-13 10:33:38 +0700
commita00ea9a11d4817e4e15e22e35d11920170e08111 (patch)
treedfdf329f1686d035aeeebb86408b6222f9c5a564
parentd256f33bbaa28f75930e6e21f122a7031d59b666 (diff)
parentf830f6956eb4ab2791d889de612e1520c1e571fb (diff)
Merge pull request #148 from pigrew/stm32f070rbnucleo_port_assignment
Correct port assigned on the STM32F070 BSP
-rw-r--r--hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c b/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c
index 50f174b34..6ee73bcc2 100644
--- a/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c
+++ b/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c
@@ -29,13 +29,13 @@
#include "stm32f0xx.h"
#include "stm32f0xx_hal_conf.h"
-#define LED_PORT GPIOC
-#define LED_PIN GPIO_PIN_13
+#define LED_PORT GPIOA
+#define LED_PIN GPIO_PIN_5
#define LED_STATE_ON 1
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_5
-#define BUTTON_STATE_ACTIVE 1
+#define BUTTON_PORT GPIOC
+#define BUTTON_PIN GPIO_PIN_13
+#define BUTTON_STATE_ACTIVE 0
void board_init(void)
{
@@ -75,7 +75,7 @@ void board_init(void)
SystemCoreClockUpdate();
// LED
- __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Pin = LED_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
@@ -84,7 +84,7 @@ void board_init(void)
HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
// Button
- __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOC_CLK_ENABLE();
GPIO_InitStruct.Pin = BUTTON_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;