瀏覽代碼

[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;
Bernard Xiong 10 年之前
父節點
當前提交
7962a5c46c

+ 2 - 2
bsp/beaglebone/rtconfig.h

@@ -122,8 +122,8 @@
 // </section>
 
 // <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" />
-//#define RT_USING_NEWLIB
+// <bool name="RT_USING_LIBC" description="Using C library" default="true" />
+#define RT_USING_LIBC
 // <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
 #define RT_USING_PTHREADS
 // </section>

+ 1 - 1
bsp/lpc408x/rtconfig.h

@@ -105,7 +105,7 @@
 
 // <section name="LIBC" description="C Runtime library setting" default="always" >
 // <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" />
 #define RT_USING_PTHREADS
 // </section>

+ 0 - 4
bsp/stm32f0x/drivers/usart.c

@@ -152,8 +152,6 @@ void USART1_IRQHandler(void)
     if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
     {
         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)
     {
@@ -186,8 +184,6 @@ void USART2_IRQHandler(void)
     if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
     {
         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)
     {

+ 1 - 1
bsp/stm32f20x/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F2xx/system_stm32f2xx.c

@@ -142,7 +142,7 @@
 
 
 /* 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
 
 /* SYSCLK = PLL_VCO / PLL_P */

+ 1 - 1
bsp/stm32f40x/Libraries/CMSIS/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c

@@ -146,7 +146,7 @@
 
 /************************* PLL Parameters *************************************/
 /* 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
 
 /* SYSCLK = PLL_VCO / PLL_P */

+ 0 - 6
bsp/stm32f40x/drivers/usart.c

@@ -177,8 +177,6 @@ void USART1_IRQHandler(void)
     if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
     {
         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)
     {
@@ -211,8 +209,6 @@ void USART2_IRQHandler(void)
     if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
     {
         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)
     {
@@ -245,8 +241,6 @@ void USART3_IRQHandler(void)
     if (USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
     {
         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)
     {

+ 4 - 0
bsp/x86/drivers/include/bsp.h

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

+ 4 - 0
bsp/x86/drivers/include/i386.h

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