[target][stm32f4-discovery] update to use platform/stm32f4xx

This commit is contained in:
Brian Swetland
2015-06-30 23:03:02 -07:00
parent 174c3889a8
commit 1c3205eab1
2 changed files with 20 additions and 23 deletions

View File

@@ -26,9 +26,9 @@
#include <target.h>
#include <compiler.h>
#include <dev/gpio.h>
#include <stm32f2xx_usart.h>
#include <stm32f2xx_rcc.h>
#include <stm32f2xx_gpio.h>
#include <stm32f4xx_usart.h>
#include <stm32f4xx_rcc.h>
#include <stm32f4xx_gpio.h>
#include <platform/stm32.h>
#include <platform/gpio.h>
#include <target/debugconfig.h>
@@ -38,12 +38,10 @@ void target_early_init(void)
{
#ifdef DEBUG_UART
#if DEBUG_UART == 2
gpio_config(GPIO_USART2_TX, GPIO_STM32_AF | \
GPIO_STM32_AFn(GPIO_AF_USART2) | \
GPIO_PULLUP);
gpio_config(GPIO_USART2_RX, GPIO_STM32_AF | \
GPIO_STM32_AFn(GPIO_AF_USART2) | \
GPIO_PULLUP);
gpio_config(GPIO_USART2_TX, GPIO_STM32_AF |
GPIO_STM32_AFn(GPIO_AF_USART2) | GPIO_PULLUP);
gpio_config(GPIO_USART2_RX, GPIO_STM32_AF |
GPIO_STM32_AFn(GPIO_AF_USART2) | GPIO_PULLUP);
#endif // DEBUG_UART == 2
#else
#warn DEBUG_UART only supports USART2!!!
@@ -70,18 +68,17 @@ void target_init(void)
void target_set_debug_led(unsigned int led, bool on)
{
switch (led) {
case 0:
gpio_set(GPIO_LED0, on);
break;
case 1:
gpio_set(GPIO_LED1, on);
break;
case 2:
gpio_set(GPIO_LED2, on);
break;
case 3:
gpio_set(GPIO_LED3, on);
break;
case 0:
gpio_set(GPIO_LED0, on);
break;
case 1:
gpio_set(GPIO_LED1, on);
break;
case 2:
gpio_set(GPIO_LED2, on);
break;
case 3:
gpio_set(GPIO_LED3, on);
break;
}
}

View File

@@ -4,7 +4,7 @@ MODULE := $(LOCAL_DIR)
STM32_CHIP := stm32f407
PLATFORM := stm32f2xx
PLATFORM := stm32f4xx
GLOBAL_DEFINES += \
ENABLE_UART2=1 \