tested all the stm32f4 board, work great

This commit is contained in:
hathach
2019-09-11 17:37:23 +07:00
parent 8a2b228c3f
commit de659be83e
7 changed files with 24 additions and 17 deletions

View File

@@ -106,12 +106,10 @@ void board_init(void)
// Notify runtime of frequency change.
SystemCoreClockUpdate();
__HAL_RCC_GPIOA_CLK_ENABLE(); // button, USB D+/D-
__HAL_RCC_GPIOD_CLK_ENABLE(); // LED
GPIO_InitTypeDef GPIO_InitStruct;
// LED
__HAL_RCC_GPIOD_CLK_ENABLE();
GPIO_InitStruct.Pin = LED_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
@@ -121,6 +119,7 @@ void board_init(void)
board_led_write(false);
// Button
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = BUTTON_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
@@ -132,6 +131,7 @@ void board_init(void)
/* Configure USB FS GPIOs */
/* Configure USB D+ D- Pins */
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;