Removed #if LIGHT for unfinished hardware.

This commit is contained in:
Gareth McMullin 2011-12-18 16:43:02 +13:00
parent c7c31d2502
commit 8061205260
2 changed files with 15 additions and 39 deletions

View File

@ -49,11 +49,7 @@ static void uart_init(void);
int platform_init(void) int platform_init(void)
{ {
#ifndef LIGHT
rcc_clock_setup_in_hse_8mhz_out_72mhz(); rcc_clock_setup_in_hse_8mhz_out_72mhz();
#else
rcc_clock_setup_in_hsi_out_48mhz();
#endif
/* Enable peripherals */ /* Enable peripherals */
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); 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); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPDEN);
/* Setup GPIO ports */ /* 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_clear(USB_PU_PORT, USB_PU_PIN);
gpio_set_mode(USB_PU_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, gpio_set_mode(USB_PU_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT,
USB_PU_PIN); USB_PU_PIN);
@ -93,9 +85,8 @@ int platform_init(void)
#ifdef INCLUDE_UART_INTERFACE #ifdef INCLUDE_UART_INTERFACE
uart_init(); uart_init();
#endif #endif
#ifndef LIGHT
SCB_VTOR = 0x2000; // Relocate interrupt vector table here SCB_VTOR = 0x2000; // Relocate interrupt vector table here
#endif
cdcacm_init(); cdcacm_init();
jtag_scan(); jtag_scan();

View File

@ -53,38 +53,23 @@
*/ */
/* Hardware definitions... */ /* Hardware definitions... */
#ifndef LIGHT #define JTAG_PORT GPIOA
# define JTAG_PORT GPIOA #define TDI_PIN GPIO3
# define TDI_PIN GPIO3 #define TMS_PIN GPIO4
# define TMS_PIN GPIO4 #define TCK_PIN GPIO5
# define TCK_PIN GPIO5 #define TDO_PIN GPIO6
# define TDO_PIN GPIO6
# define SWDP_PORT JTAG_PORT #define SWDP_PORT JTAG_PORT
# define SWDIO_PIN TMS_PIN #define SWDIO_PIN TMS_PIN
# define SWCLK_PIN TCK_PIN #define SWCLK_PIN TCK_PIN
# define USB_PU_PORT GPIOA #define USB_PU_PORT GPIOA
# define USB_PU_PIN GPIO8 #define USB_PU_PIN GPIO8
# define LED_PORT GPIOB #define LED_PORT GPIOB
# define LED_RUN GPIO2 #define LED_RUN GPIO2
# define LED_IDLE GPIO10 #define LED_IDLE GPIO10
# define LED_ERROR GPIO11 #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 DEBUG(...) #define DEBUG(...)