[BSP] Update bsp code

1. Use RT_USING_LIBC instead of RT_USING_NEWLIB in the beagonebone.
2. Enable LIBC in default in LPC4088.
3. Remove the unnecessary interrupt clean in STM32 UART;
4. Use HSE_VALUE to calculate PLL_M in STM32F2/F4;
This commit is contained in:
Bernard Xiong
2015-05-05 10:13:52 +08:00
parent 677d5323e8
commit 7962a5c46c
8 changed files with 13 additions and 15 deletions

View File

@@ -122,8 +122,8 @@
// </section> // </section>
// <section name="LIBC" description="C Runtime library setting" default="always" > // <section name="LIBC" description="C Runtime library setting" default="always" >
// <bool name="RT_USING_NEWLIB" description="Using newlib library, only available under GNU GCC" default="true" /> // <bool name="RT_USING_LIBC" description="Using C library" default="true" />
//#define RT_USING_NEWLIB #define RT_USING_LIBC
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" /> // <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
#define RT_USING_PTHREADS #define RT_USING_PTHREADS
// </section> // </section>

View File

@@ -105,7 +105,7 @@
// <section name="LIBC" description="C Runtime library setting" default="always" > // <section name="LIBC" description="C Runtime library setting" default="always" >
// <bool name="RT_USING_LIBC" description="Using C library" default="true" /> // <bool name="RT_USING_LIBC" description="Using C library" default="true" />
// #define RT_USING_LIBC #define RT_USING_LIBC
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" /> // <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
#define RT_USING_PTHREADS #define RT_USING_PTHREADS
// </section> // </section>

View File

@@ -152,8 +152,6 @@ void USART1_IRQHandler(void)
if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET) if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{ {
rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_RX_IND); rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_RX_IND);
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
} }
if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET)
{ {
@@ -186,8 +184,6 @@ void USART2_IRQHandler(void)
if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET) if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{ {
rt_hw_serial_isr(&serial2, RT_SERIAL_EVENT_RX_IND); rt_hw_serial_isr(&serial2, RT_SERIAL_EVENT_RX_IND);
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
} }
if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET)
{ {

View File

@@ -142,7 +142,7 @@
/* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */ /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */
#define PLL_M 25 #define PLL_M (HSE_VALUE / 1000000)
#define PLL_N 240 #define PLL_N 240
/* SYSCLK = PLL_VCO / PLL_P */ /* SYSCLK = PLL_VCO / PLL_P */

View File

@@ -146,7 +146,7 @@
/************************* PLL Parameters *************************************/ /************************* PLL Parameters *************************************/
/* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */ /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */
#define PLL_M 25 #define PLL_M (HSE_VALUE / 1000000)
#define PLL_N 336 #define PLL_N 336
/* SYSCLK = PLL_VCO / PLL_P */ /* SYSCLK = PLL_VCO / PLL_P */

View File

@@ -177,8 +177,6 @@ void USART1_IRQHandler(void)
if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{ {
rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_RX_IND); rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_RX_IND);
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
} }
if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET)
{ {
@@ -211,8 +209,6 @@ void USART2_IRQHandler(void)
if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{ {
rt_hw_serial_isr(&serial2, RT_SERIAL_EVENT_RX_IND); rt_hw_serial_isr(&serial2, RT_SERIAL_EVENT_RX_IND);
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
} }
if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET)
{ {
@@ -245,8 +241,6 @@ void USART3_IRQHandler(void)
if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{ {
rt_hw_serial_isr(&serial3, RT_SERIAL_EVENT_RX_IND); rt_hw_serial_isr(&serial3, RT_SERIAL_EVENT_RX_IND);
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
} }
if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET) if (USART_GetITStatus(uart->uart_device, USART_IT_TC) != RESET)
{ {

View File

@@ -16,6 +16,10 @@
#include <i386.h> #include <i386.h>
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************/ /*******************************************************************/
/* Timer Register */ /* Timer Register */
/*******************************************************************/ /*******************************************************************/

View File

@@ -105,4 +105,8 @@ struct Pseudodesc {
#define STS_IG32 0xe // 32-bit Interrupt Gate #define STS_IG32 0xe // 32-bit Interrupt Gate
#define STS_TG32 0xf // 32-bit Trap Gate #define STS_TG32 0xf // 32-bit Trap Gate
#ifdef __cplusplus
}
#endif
#endif #endif