diff options
| author | hathach <[email protected]> | 2013-09-13 23:32:07 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-09-13 23:32:07 +0700 |
| commit | 0d279facbbb326b07e5dd84c3baabfa841d132f9 (patch) | |
| tree | 1c20fd9a1cd834b8bcd530a7eca3d72d01c63f33 /demos | |
| parent | 67453b89f03e43408bf165f610aa62a63c000f1c (diff) | |
fix cmsis rtx tick configuration
everything should work
TODO: remove static for variable error in control xfer subtask
Diffstat (limited to 'demos')
| -rw-r--r-- | demos/bsp/boards/board.c | 2 | ||||
| -rw-r--r-- | demos/bsp/boards/embedded_artists/board_ea4357.c | 4 | ||||
| -rw-r--r-- | demos/bsp/boards/hitex/board_hitex4350.c | 1 | ||||
| -rw-r--r-- | demos/bsp/boards/keil/board_mcb4300.c | 1 | ||||
| -rw-r--r-- | demos/bsp/boards/microbuilder/board_lpc4357usb.c | 1 | ||||
| -rw-r--r-- | demos/bsp/boards/ngx/board_ngx4330.c | 41 |
6 files changed, 24 insertions, 26 deletions
diff --git a/demos/bsp/boards/board.c b/demos/bsp/boards/board.c index e3c336cde..31186c35a 100644 --- a/demos/bsp/boards/board.c +++ b/demos/bsp/boards/board.c @@ -38,7 +38,7 @@ #include "board.h" -#if TUSB_CFG_OS == TUSB_OS_NONE +#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c volatile uint32_t system_ticks = 0; void SysTick_Handler (void) diff --git a/demos/bsp/boards/embedded_artists/board_ea4357.c b/demos/bsp/boards/embedded_artists/board_ea4357.c index f2835bd6a..a415c793c 100644 --- a/demos/bsp/boards/embedded_artists/board_ea4357.c +++ b/demos/bsp/boards/embedded_artists/board_ea4357.c @@ -48,9 +48,11 @@ void board_init(void) { - SystemInit(); CGU_Init(); + +//#if TUSB_CFG_OS != TUSB_OS_CMSIS_RTX // TODO may move to main.c SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 1 msec tick timer +//#endif // USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357 scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7); // USB0 VBus Power diff --git a/demos/bsp/boards/hitex/board_hitex4350.c b/demos/bsp/boards/hitex/board_hitex4350.c index 2ba54e46c..5422fad4c 100644 --- a/demos/bsp/boards/hitex/board_hitex4350.c +++ b/demos/bsp/boards/hitex/board_hitex4350.c @@ -53,7 +53,6 @@ //--------------------------------------------------------------------+ void board_init(void) { - SystemInit(); CGU_Init(); SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 1 msec tick timer diff --git a/demos/bsp/boards/keil/board_mcb4300.c b/demos/bsp/boards/keil/board_mcb4300.c index 57ce2591c..773dab4c5 100644 --- a/demos/bsp/boards/keil/board_mcb4300.c +++ b/demos/bsp/boards/keil/board_mcb4300.c @@ -72,7 +72,6 @@ const static struct { //--------------------------------------------------------------------+ void board_init(void) { - SystemInit(); CGU_Init(); SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 1 msec tick timer diff --git a/demos/bsp/boards/microbuilder/board_lpc4357usb.c b/demos/bsp/boards/microbuilder/board_lpc4357usb.c index 83f9c8b16..c8bcab8ef 100644 --- a/demos/bsp/boards/microbuilder/board_lpc4357usb.c +++ b/demos/bsp/boards/microbuilder/board_lpc4357usb.c @@ -53,7 +53,6 @@ void board_init(void) { - SystemInit(); CGU_Init(); /* Setup the systick time for 1ms ticks */ diff --git a/demos/bsp/boards/ngx/board_ngx4330.c b/demos/bsp/boards/ngx/board_ngx4330.c index 620393d21..a09cc10fb 100644 --- a/demos/bsp/boards/ngx/board_ngx4330.c +++ b/demos/bsp/boards/ngx/board_ngx4330.c @@ -48,36 +48,35 @@ const static struct { void board_init(void) { - SystemInit(); CGU_Init(); - SysTick_Config( CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)/CFG_TICKS_PER_SECOND ); /* 1 ms Timer */ + SysTick_Config( CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)/CFG_TICKS_PER_SECOND ); /* 1 ms Timer */ - //------------- USB Bus power HOST ONLY-------------// - scu_pinmux(0x1, 7, MD_PUP | MD_EZI, FUNC4); // P1_7 USB0_PWR_EN, USB0 VBus function Xplorer + //------------- USB Bus power HOST ONLY-------------// + scu_pinmux(0x1, 7, MD_PUP | MD_EZI, FUNC4); // P1_7 USB0_PWR_EN, USB0 VBus function Xplorer - scu_pinmux(0x2, 6, MD_PUP | MD_EZI, FUNC4); // P2_6 is configured as GPIO5[6] for USB1_PWR_EN - GPIO_SetDir (5, BIT_(6), 1); // GPIO5[6] is output - GPIO_SetValue (5, BIT_(6)); // GPIO5[6] output high + scu_pinmux(0x2, 6, MD_PUP | MD_EZI, FUNC4); // P2_6 is configured as GPIO5[6] for USB1_PWR_EN + GPIO_SetDir (5, BIT_(6), 1); // GPIO5[6] is output + GPIO_SetValue (5, BIT_(6)); // GPIO5[6] output high - // Leds Init - for (uint8_t i=0; i<BOARD_MAX_LEDS; i++) - { - scu_pinmux(leds[i].port, leds[i].pin, MD_PUP|MD_EZI|MD_ZI, FUNC0); - GPIO_SetDir(leds[i].port, BIT_(leds[i].pin), 1); // output - } + // Leds Init + for (uint8_t i=0; i<BOARD_MAX_LEDS; i++) + { + scu_pinmux(leds[i].port, leds[i].pin, MD_PUP|MD_EZI|MD_ZI, FUNC0); + GPIO_SetDir(leds[i].port, BIT_(leds[i].pin), 1); // output + } #if CFG_UART_ENABLE - //------------- UART init -------------// - UART_CFG_Type UARTConfigStruct; + //------------- UART init -------------// + UART_CFG_Type UARTConfigStruct; - scu_pinmux(0x6 ,4, MD_PDN|MD_EZI, FUNC2); // UART0_TXD - scu_pinmux(0x6 ,5, MD_PDN|MD_EZI, FUNC2); // UART0_RXD + scu_pinmux(0x6 ,4, MD_PDN|MD_EZI, FUNC2); // UART0_TXD + scu_pinmux(0x6 ,5, MD_PDN|MD_EZI, FUNC2); // UART0_RXD - UART_ConfigStructInit(&UARTConfigStruct); // default: baud = 9600, 8 bit data, 1 stop bit, no parity - UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE; // Re-configure baudrate + UART_ConfigStructInit(&UARTConfigStruct); // default: baud = 9600, 8 bit data, 1 stop bit, no parity + UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE; // Re-configure baudrate - UART_Init((LPC_USARTn_Type*) LPC_USART0, &UARTConfigStruct); // Initialize UART port - UART_TxCmd((LPC_USARTn_Type*) LPC_USART0, ENABLE); // Enable UART + UART_Init((LPC_USARTn_Type*) LPC_USART0, &UARTConfigStruct); // Initialize UART port + UART_TxCmd((LPC_USARTn_Type*) LPC_USART0, ENABLE); // Enable UART #endif } |
