summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2024-01-21 17:39:50 +0800
committerMeco Man <[email protected]>2024-01-21 19:47:51 +0800
commitfa64b08064d8ae8e3065647f93f54c01b002985d (patch)
tree0968097886e62cfbefed96c343b272fd69cf7503
parentb87b4cbde5797dcea1b3150595ef2d85a2d8f7f8 (diff)
[bsp][pico] remove meaningless dependencies of board.h
-rw-r--r--bsp/raspberry-pico/board/board.c9
-rw-r--r--bsp/raspberry-pico/board/board.h8
-rw-r--r--bsp/raspberry-pico/drivers/drv_gpio.c2
-rw-r--r--bsp/raspberry-pico/drivers/drv_uart.c6
-rw-r--r--bsp/raspberry-pico/drivers/drv_uart.h8
5 files changed, 13 insertions, 20 deletions
diff --git a/bsp/raspberry-pico/board/board.c b/bsp/raspberry-pico/board/board.c
index 5dfd626dc2..2cf60a71e0 100644
--- a/bsp/raspberry-pico/board/board.c
+++ b/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)
diff --git a/bsp/raspberry-pico/board/board.h b/bsp/raspberry-pico/board/board.h
index 0663d89713..a5b954e787 100644
--- a/bsp/raspberry-pico/board/board.h
+++ b/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
diff --git a/bsp/raspberry-pico/drivers/drv_gpio.c b/bsp/raspberry-pico/drivers/drv_gpio.c
index 0100b50aa9..14b8d87b4c 100644
--- a/bsp/raspberry-pico/drivers/drv_gpio.c
+++ b/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)
{
diff --git a/bsp/raspberry-pico/drivers/drv_uart.c b/bsp/raspberry-pico/drivers/drv_uart.c
index 9d51dc05c2..5d8fc6a4a8 100644
--- a/bsp/raspberry-pico/drivers/drv_uart.c
+++ b/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
diff --git a/bsp/raspberry-pico/drivers/drv_uart.h b/bsp/raspberry-pico/drivers/drv_uart.h
index 79bae1f7cc..88bb40e3ac 100644
--- a/bsp/raspberry-pico/drivers/drv_uart.h
+++ b/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__ */