Explorar el Código

[bsp][pico] remove meaningless dependencies of board.h

Meco Man hace 1 año
padre
commit
fa64b08064

+ 5 - 4
bsp/raspberry-pico/board/board.c

@@ -11,12 +11,13 @@
 
 #include <rthw.h>
 #include <rtthread.h>
-
 #include <stdio.h>
-
 #include "board.h"
-#include "hardware/structs/systick.h"
-#include "pico/bootrom.h"
+#include <pico/bootrom.h>
+#include <pico/stdlib.h>
+#include <hardware/clocks.h>
+#include <hardware/structs/systick.h>
+#include <drv_uart.h>
 
 #define PLL_SYS_KHZ (133 * 1000)
 

+ 0 - 8
bsp/raspberry-pico/board/board.h

@@ -11,12 +11,6 @@
 #ifndef __BOARD_H__
 #define __BOARD_H__
 
-#include "pico/stdlib.h"
-#include "hardware/pll.h"
-#include "hardware/clocks.h"
-#include "hardware/structs/pll.h"
-#include "hardware/structs/clocks.h"
-
 #define PICO_SRAM_SIZE         256
 #define PICO_SRAM_END          (0x20000000 + PICO_SRAM_SIZE * 1024)
 
@@ -24,6 +18,4 @@ extern int __bss_end__;
 #define HEAP_BEGIN      (&__bss_end__)
 #define HEAP_END        ((void *)PICO_SRAM_END)
 
-int rt_hw_uart_init(void);
-
 #endif

+ 2 - 0
bsp/raspberry-pico/drivers/drv_gpio.c

@@ -9,6 +9,8 @@
  */
 
 #include "drv_gpio.h"
+#include <hardware/gpio.h>
+#include <hardware/platform_defs.h>
 
 static void pico_pin_mode(struct rt_device *dev, rt_base_t pin, rt_uint8_t mode)
 {

+ 2 - 4
bsp/raspberry-pico/drivers/drv_uart.c

@@ -8,11 +8,9 @@
  * 2023-09-26     1ridic       Integrate with RT-Thread driver framework.
  */
 
-#include <rthw.h>
-#include <rtthread.h>
 #include <rtdevice.h>
-#include "board.h"
-#include "drv_uart.h"
+#include <drv_uart.h>
+#include <hardware/gpio.h>
 
 #ifdef RT_USING_SERIAL
 

+ 4 - 4
bsp/raspberry-pico/drivers/drv_uart.h

@@ -9,14 +9,14 @@
  * 2023-09-26     1ridic         Integrate with RT-Thread driver framework.
  */
 
-#ifndef __USART_H__
-#define __USART_H__
+#ifndef __DRV_UART_H__
+#define __DRV_UART_H__
 
 #include <rthw.h>
 #include <rtthread.h>
 
 #ifdef RT_USING_SERIAL
 int rt_hw_uart_init(void);
-#endif
+#endif /* RT_USING_SERIAL */
 
-#endif
+#endif /* __DRV_UART_H__ */