diff --git a/src/stm32/platform.c b/src/stm32/platform.c index 84528aa2..4dd6137e 100644 --- a/src/stm32/platform.c +++ b/src/stm32/platform.c @@ -49,11 +49,7 @@ static void uart_init(void); int platform_init(void) { -#ifndef LIGHT rcc_clock_setup_in_hse_8mhz_out_72mhz(); -#else - rcc_clock_setup_in_hsi_out_48mhz(); -#endif /* Enable peripherals */ rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); @@ -63,10 +59,6 @@ int platform_init(void) rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPDEN); /* Setup GPIO ports */ -#ifdef LIGHT - rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); - AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON; -#endif gpio_clear(USB_PU_PORT, USB_PU_PIN); gpio_set_mode(USB_PU_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, USB_PU_PIN); @@ -93,9 +85,8 @@ int platform_init(void) #ifdef INCLUDE_UART_INTERFACE uart_init(); #endif -#ifndef LIGHT SCB_VTOR = 0x2000; // Relocate interrupt vector table here -#endif + cdcacm_init(); jtag_scan(); diff --git a/src/stm32/platform.h b/src/stm32/platform.h index d23d42b4..69dc3b46 100644 --- a/src/stm32/platform.h +++ b/src/stm32/platform.h @@ -53,38 +53,23 @@ */ /* Hardware definitions... */ -#ifndef LIGHT -# define JTAG_PORT GPIOA -# define TDI_PIN GPIO3 -# define TMS_PIN GPIO4 -# define TCK_PIN GPIO5 -# define TDO_PIN GPIO6 +#define JTAG_PORT GPIOA +#define TDI_PIN GPIO3 +#define TMS_PIN GPIO4 +#define TCK_PIN GPIO5 +#define TDO_PIN GPIO6 -# define SWDP_PORT JTAG_PORT -# define SWDIO_PIN TMS_PIN -# define SWCLK_PIN TCK_PIN +#define SWDP_PORT JTAG_PORT +#define SWDIO_PIN TMS_PIN +#define SWCLK_PIN TCK_PIN -# define USB_PU_PORT GPIOA -# define USB_PU_PIN GPIO8 +#define USB_PU_PORT GPIOA +#define USB_PU_PIN GPIO8 -# define LED_PORT GPIOB -# define LED_RUN GPIO2 -# define LED_IDLE GPIO10 -# define LED_ERROR GPIO11 -#else -# define JTAG_PORT GPIOA -# define TDI_PIN GPIO3 -# define TMS_PIN GPIO2 -# define TCK_PIN GPIO7 -# define TDO_PIN GPIO6 - -# define SWDP_PORT JTAG_PORT -# define SWDIO_PIN TMS_PIN -# define SWCLK_PIN TCK_PIN - -# define USB_PU_PORT GPIOA -# define USB_PU_PIN GPIO15 -#endif +#define LED_PORT GPIOB +#define LED_RUN GPIO2 +#define LED_IDLE GPIO10 +#define LED_ERROR GPIO11 #define DEBUG(...)