From c16d3de633ef1ef1a92b1a3d377de44a46f93865 Mon Sep 17 00:00:00 2001 From: yangfasheng Date: Wed, 9 Jan 2019 17:40:32 +0800 Subject: update dfs.c dfs_file.c dfs_file.h Signed-off-by: yangfasheng --- components/dfs/include/dfs_file.h | 1 + 1 file changed, 1 insertion(+) (limited to 'components/dfs/include') diff --git a/components/dfs/include/dfs_file.h b/components/dfs/include/dfs_file.h index 7ef681a247..aaff3f6e9c 100644 --- a/components/dfs/include/dfs_file.h +++ b/components/dfs/include/dfs_file.h @@ -44,6 +44,7 @@ struct dfs_fd char *path; /* Name (below mount point) */ int ref_count; /* Descriptor reference count */ + struct dfs_filesystem *fs; const struct dfs_file_ops *fops; uint32_t flags; /* Descriptor flags */ -- cgit v1.3.1 From 0d7ba79219f939ad0dc55eb70872e11c950b0da8 Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 6 Mar 2019 17:07:15 +0800 Subject: Remove the DBG_COLOR and DBG_ENABLE definition. --- bsp/CME_M7/rtconfig.h | 1 + bsp/allwinner_tina/.config | 1 + bsp/allwinner_tina/drivers/drv_gpio.c | 3 --- bsp/allwinner_tina/drivers/drv_sdio.c | 3 +-- bsp/allwinner_tina/drivers/spi/drv_spi.c | 2 -- bsp/allwinner_tina/drivers/spi/drv_spi_flash.c | 2 -- bsp/allwinner_tina/rtconfig.h | 1 + bsp/amebaz/.config | 1 + bsp/amebaz/drivers/wlan/drv_wifi.c | 2 -- bsp/amebaz/rtconfig.h | 1 + bsp/apollo2/rtconfig.h | 1 + bsp/asm9260t/.config | 1 + bsp/asm9260t/rtconfig.h | 1 + bsp/at91sam9260/.config | 1 + bsp/at91sam9260/rtconfig.h | 1 + bsp/at91sam9g45/.config | 1 + bsp/at91sam9g45/rtconfig.h | 1 + bsp/beaglebone/.config | 1 + bsp/beaglebone/rtconfig.h | 1 + bsp/ck802/.config | 1 + bsp/ck802/rtconfig.h | 1 + bsp/dm365/.config | 1 + bsp/dm365/rtconfig.h | 1 + bsp/efm32/rtconfig.h | 1 + bsp/es32f0334/.config | 1 + bsp/es32f0334/rtconfig.h | 1 + bsp/es32f0654/.config | 1 + bsp/es32f0654/rtconfig.h | 1 + bsp/fh8620/rtconfig.h | 1 + bsp/frdm-k64f/rtconfig.h | 1 + bsp/gd32303e-eval/.config | 1 + bsp/gd32303e-eval/rtconfig.h | 1 + bsp/gd32450z-eval/.config | 1 + bsp/gd32450z-eval/rtconfig.h | 1 + bsp/gkipc/.config | 1 + bsp/gkipc/rtconfig.h | 1 + bsp/hifive1/.config | 1 + bsp/hifive1/rtconfig.h | 1 + bsp/imx6sx/cortex-a9/.config | 1 + bsp/imx6sx/cortex-a9/rtconfig.h | 1 + bsp/imx6ul/rtconfig.h | 1 + bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c | 2 -- .../Libraries/imxrt1050/drivers/drv_eth_fire.c | 2 -- .../imxrt1050/drivers/drv_flexspi_hyper.c | 4 +-- .../Libraries/imxrt1050/drivers/drv_flexspi_nor.c | 5 ++-- bsp/imxrt/imxrt1050-ArchMix/.config | 1 + bsp/imxrt/imxrt1050-ArchMix/rtconfig.h | 1 + bsp/imxrt/imxrt1050-evk/.config | 1 + bsp/imxrt/imxrt1050-evk/rtconfig.h | 1 + bsp/k210/.config | 1 + bsp/k210/rtconfig.h | 1 + bsp/lm4f232/rtconfig.h | 1 + bsp/lpc176x/rtconfig.h | 1 + bsp/lpc178x/rtconfig.h | 1 + bsp/lpc2148/rtconfig.h | 1 + bsp/lpc408x/.config | 1 + bsp/lpc408x/rtconfig.h | 1 + bsp/lpc43xx/M0/rtconfig.h | 1 + bsp/lpc43xx/M4/rtconfig.h | 1 + bsp/lpc5410x/rtconfig.h | 1 + bsp/lpc54114-lite/.config | 1 + bsp/lpc54114-lite/rtconfig.h | 1 + bsp/lpc54608-LPCXpresso/.config | 1 + bsp/lpc54608-LPCXpresso/rtconfig.h | 1 + bsp/ls1bdev/rtconfig.h | 1 + bsp/ls1cdev/.config | 1 + bsp/ls1cdev/rtconfig.h | 1 + bsp/m16c62p/rtconfig.h | 1 + bsp/mb9bf568r/rtconfig.h | 1 + bsp/mb9bf618s/rtconfig.h | 1 + bsp/mini4020/rtconfig.h | 1 + bsp/nios_ii/rtconfig.h | 1 + bsp/nrf51822/rtconfig.h | 1 + bsp/nuvoton_m05x/.config | 1 + bsp/nuvoton_m05x/rtconfig.h | 1 + bsp/nuvoton_m451/rtconfig.h | 1 + bsp/nuvoton_m487/.config | 1 + bsp/nuvoton_m487/rtconfig.h | 1 + bsp/nuvoton_nuc472/rtconfig.h | 1 + bsp/pic32ethernet/rtconfig.h | 1 + bsp/qemu-vexpress-a9/.config | 30 +--------------------- bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c | 2 -- bsp/qemu-vexpress-a9/drivers/drv_keyboard.c | 7 ++--- bsp/qemu-vexpress-a9/drivers/drv_mouse.c | 8 +++--- bsp/qemu-vexpress-a9/drivers/drv_sdio.c | 14 +++++----- bsp/qemu-vexpress-a9/rtconfig.h | 7 +---- bsp/qemu-vexpress-gemini/.config | 1 + bsp/qemu-vexpress-gemini/rtconfig.h | 1 + bsp/raspi2/.config | 1 + bsp/raspi2/rtconfig.h | 1 + bsp/realview-a8/rtconfig.h | 1 + bsp/rv32m1_vega/ri5cy/.config | 1 + bsp/rv32m1_vega/ri5cy/rtconfig.h | 1 + bsp/rx/rtconfig.h | 1 + bsp/samd21/rtconfig.h | 1 + bsp/sep6200/rtconfig.h | 2 +- bsp/simulator/.config | 1 + bsp/simulator/rtconfig.h | 1 + bsp/stm32/libraries/HAL_Drivers/drv_log.h | 3 --- bsp/stm32/libraries/templates/stm32f0xx/.config | 1 + bsp/stm32/libraries/templates/stm32f0xx/rtconfig.h | 1 + bsp/stm32/libraries/templates/stm32f10x/.config | 1 + bsp/stm32/libraries/templates/stm32f10x/rtconfig.h | 1 + bsp/stm32/libraries/templates/stm32f4xx/.config | 1 + bsp/stm32/libraries/templates/stm32f4xx/rtconfig.h | 1 + bsp/stm32/libraries/templates/stm32f7xx/.config | 1 + bsp/stm32/libraries/templates/stm32f7xx/rtconfig.h | 1 + bsp/stm32/libraries/templates/stm32l4xx/.config | 1 + bsp/stm32/libraries/templates/stm32l4xx/rtconfig.h | 1 + bsp/stm32/stm32f091-st-nucleo/.config | 1 + bsp/stm32/stm32f091-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32f103-atk-nano/.config | 1 + bsp/stm32/stm32f103-atk-nano/rtconfig.h | 1 + bsp/stm32/stm32f103-dofly-lyc8/.config | 1 + bsp/stm32/stm32f103-dofly-lyc8/rtconfig.h | 1 + bsp/stm32/stm32f103-fire-arbitrary/.config | 1 + .../board/ports/sdcard_port.c | 3 --- bsp/stm32/stm32f103-fire-arbitrary/rtconfig.h | 1 + bsp/stm32/stm32f103-hw100k-ibox/.config | 1 + bsp/stm32/stm32f103-hw100k-ibox/rtconfig.h | 1 + bsp/stm32/stm32f107-uc-eval/.config | 1 + bsp/stm32/stm32f107-uc-eval/rtconfig.h | 1 + bsp/stm32/stm32f405-smdz-breadfruit/.config | 1 + bsp/stm32/stm32f405-smdz-breadfruit/rtconfig.h | 1 + bsp/stm32/stm32f407-atk-explorer/.config | 1 + .../board/ports/sdcard_port.c | 3 --- bsp/stm32/stm32f407-atk-explorer/rtconfig.h | 1 + bsp/stm32/stm32f407-st-discovery/.config | 1 + bsp/stm32/stm32f407-st-discovery/rtconfig.h | 1 + bsp/stm32/stm32f411-st-nucleo/.config | 1 + bsp/stm32/stm32f411-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32f429-armfly-v6/.config | 1 + .../stm32f429-armfly-v6/board/ports/sdcard_port.c | 3 --- bsp/stm32/stm32f429-armfly-v6/rtconfig.h | 1 + bsp/stm32/stm32f429-atk-apollo/.config | 1 + .../stm32f429-atk-apollo/board/ports/sdcard_port.c | 3 --- bsp/stm32/stm32f429-atk-apollo/rtconfig.h | 1 + bsp/stm32/stm32f429-fire-challenger/.config | 1 + .../board/ports/sdcard_port.c | 3 --- bsp/stm32/stm32f429-fire-challenger/rtconfig.h | 1 + bsp/stm32/stm32f446-st-nucleo/.config | 1 + bsp/stm32/stm32f446-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32f746-st-disco/.config | 1 + .../stm32f746-st-disco/board/ports/sdcard_port.c | 3 --- bsp/stm32/stm32f746-st-disco/rtconfig.h | 1 + bsp/stm32/stm32f767-atk-apollo/.config | 1 + .../stm32f767-atk-apollo/board/ports/sdcard_port.c | 3 --- bsp/stm32/stm32f767-atk-apollo/rtconfig.h | 1 + bsp/stm32/stm32f767-fire-challenger/.config | 1 + .../board/ports/sdcard_port.c | 4 +-- bsp/stm32/stm32f767-fire-challenger/rtconfig.h | 1 + bsp/stm32/stm32f767-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32g071-st-nucleo/.config | 1 + bsp/stm32/stm32g071-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32l053-st-nucleo/.config | 1 + bsp/stm32/stm32l053-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32l432-st-nucleo/.config | 1 + bsp/stm32/stm32l432-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32l475-atk-pandora/.config | 1 + .../board/ports/sdcard_port.c | 4 +-- bsp/stm32/stm32l475-atk-pandora/rtconfig.h | 1 + bsp/stm32/stm32l476-st-nucleo/.config | 1 + bsp/stm32/stm32l476-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32l496-ali-developer/.config | 1 + .../board/ports/sdcard_port.c | 4 +-- bsp/stm32/stm32l496-ali-developer/rtconfig.h | 1 + bsp/stm32f0x/rtconfig.h | 1 + bsp/stm32f107/.config | 1 + bsp/stm32f107/rtconfig.h | 1 + bsp/stm32f10x-HAL/.config | 1 + bsp/stm32f10x-HAL/rtconfig.h | 1 + bsp/stm32f10x/.config | 1 + bsp/stm32f10x/rtconfig.h | 1 + bsp/stm32f20x/.config | 1 + bsp/stm32f20x/rtconfig.h | 1 + bsp/stm32f40x/.config | 1 + bsp/stm32f40x/rtconfig.h | 1 + bsp/stm32f429-apollo/.config | 1 + bsp/stm32f429-apollo/drivers/audio/drv_mic.c | 2 -- bsp/stm32f429-apollo/drivers/audio/drv_sound.c | 2 -- bsp/stm32f429-apollo/rtconfig.h | 1 + bsp/stm32f429-disco/.config | 1 + bsp/stm32f429-disco/rtconfig.h | 1 + bsp/stm32f4xx-HAL/.config | 1 + bsp/stm32f4xx-HAL/rtconfig.h | 1 + bsp/stm32f7-disco/.config | 1 + bsp/stm32f7-disco/rtconfig.h | 1 + bsp/stm32h743-nucleo/.config | 1 + bsp/stm32h743-nucleo/rtconfig.h | 1 + bsp/stm32l475-iot-disco/rtconfig.h | 1 + bsp/stm32l476-nucleo/.config | 1 + bsp/stm32l476-nucleo/rtconfig.h | 1 + bsp/swm320-lq100/.config | 1 + bsp/swm320-lq100/rtconfig.h | 1 + bsp/synopsys/emsk_em9d/.config | 1 + bsp/synopsys/emsk_em9d/rtconfig.h | 1 + bsp/tm4c129x/.config | 1 + bsp/tm4c129x/rtconfig.h | 1 + bsp/tms320f28379d/.config | 1 + bsp/tms320f28379d/rtconfig.h | 1 + bsp/upd70f3454/rtconfig.h | 1 + bsp/x1000/.config | 1 + bsp/x1000/drivers/mmc/drv_mmc.c | 8 ++---- bsp/x1000/rtconfig.h | 1 + bsp/x86/rtconfig.h | 1 + bsp/xplorer4330/M0/rtconfig.h | 1 + bsp/xplorer4330/M4/rtconfig.h | 1 + bsp/zynq7000/rtconfig.h | 1 + components/dfs/include/dfs_private.h | 4 +-- components/drivers/misc/adc.c | 2 -- components/drivers/sdio/block_dev.c | 4 +-- components/drivers/sdio/mmc.c | 2 -- components/drivers/sdio/mmcsd_core.c | 2 -- components/drivers/sdio/sd.c | 2 -- components/drivers/sdio/sdio.c | 2 -- components/drivers/sensors/sensor.c | 2 -- components/drivers/sensors/sensor_cmd.c | 2 -- components/drivers/serial/serial.c | 4 +-- components/drivers/wlan/wlan_cfg.c | 2 -- components/drivers/wlan/wlan_dev.c | 2 -- components/drivers/wlan/wlan_lwip.c | 2 -- components/drivers/wlan/wlan_mgnt.c | 3 +-- components/drivers/wlan/wlan_prot.c | 2 -- components/drivers/wlan/wlan_workqueue.c | 2 -- components/libc/libdl/dlelf.c | 2 -- components/libc/libdl/dlmodule.c | 2 -- components/lwp/lwp.c | 2 -- components/lwp/lwp_mem.c | 2 -- components/lwp/lwp_syscall.c | 2 -- components/net/at/include/at_log.h | 3 --- components/net/sal_socket/src/sal_socket.c | 4 +-- components/utilities/Kconfig | 6 ----- components/utilities/ulog/ulog_def.h | 2 +- components/utilities/utest/utest.c | 4 --- components/utilities/utest/utest_log.h | 4 --- examples/network/tcpclient.c | 2 -- examples/network/tcpserver.c | 2 -- examples/network/udpclient.c | 2 -- examples/network/udpserver.c | 2 -- include/rtdbg.h | 16 ++++++++---- src/Kconfig | 4 +++ src/signal.c | 4 +-- 242 files changed, 223 insertions(+), 202 deletions(-) (limited to 'components/dfs/include') diff --git a/bsp/CME_M7/rtconfig.h b/bsp/CME_M7/rtconfig.h index 886c28cb9e..f65f6f7600 100644 --- a/bsp/CME_M7/rtconfig.h +++ b/bsp/CME_M7/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK /* Using Hook */ diff --git a/bsp/allwinner_tina/.config b/bsp/allwinner_tina/.config index de547c5a34..2c39e4435e 100644 --- a/bsp/allwinner_tina/.config +++ b/bsp/allwinner_tina/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/allwinner_tina/drivers/drv_gpio.c b/bsp/allwinner_tina/drivers/drv_gpio.c index 2c3b6e1865..e8d82a3fae 100644 --- a/bsp/allwinner_tina/drivers/drv_gpio.c +++ b/bsp/allwinner_tina/drivers/drv_gpio.c @@ -27,13 +27,10 @@ #include "drv_gpio.h" #include "interrupt.h" -#define DBG_ENABLE #define DBG_SECTION_NAME "GPIO" #define DBG_LEVEL DBG_WARNING -#define DBG_COLOR #include - #define readl(addr) (*(volatile unsigned int *)(addr)) #define writel(value,addr) (*(volatile unsigned int *)(addr) = (value)) diff --git a/bsp/allwinner_tina/drivers/drv_sdio.c b/bsp/allwinner_tina/drivers/drv_sdio.c index 12cb437f42..c1b4bcc41c 100644 --- a/bsp/allwinner_tina/drivers/drv_sdio.c +++ b/bsp/allwinner_tina/drivers/drv_sdio.c @@ -32,13 +32,12 @@ #include "drv_gpio.h" #include "drv_clock.h" -#define DBG_ENABLE + #define DBG_SECTION_NAME "MMC" // #define DBG_LEVEL DBG_LOG // #define DBG_LEVEL DBG_INFO #define DBG_LEVEL DBG_WARNING // #define DBG_LEVEL DBG_ERROR -#define DBG_COLOR #include #ifdef RT_USING_SDIO diff --git a/bsp/allwinner_tina/drivers/spi/drv_spi.c b/bsp/allwinner_tina/drivers/spi/drv_spi.c index 6e76cbec3e..a271c2e7d9 100644 --- a/bsp/allwinner_tina/drivers/spi/drv_spi.c +++ b/bsp/allwinner_tina/drivers/spi/drv_spi.c @@ -35,14 +35,12 @@ //#define DEBUG -#define DBG_ENABLE #define DBG_SECTION_NAME "SPI" #ifdef DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_WARNING #endif /* DEBUG */ -#define DBG_COLOR #include #ifdef RT_USING_SPI diff --git a/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c b/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c index 6dc1b1b334..0b01200ee8 100644 --- a/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c +++ b/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c @@ -26,10 +26,8 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "FLASH" #define DBG_LEVEL DBG_LOG -#define DBG_COLOR #include #define SPI_FLASH_DEVICE_NAME "spi00" diff --git a/bsp/allwinner_tina/rtconfig.h b/bsp/allwinner_tina/rtconfig.h index 25a1302b1a..b9221509b4 100644 --- a/bsp/allwinner_tina/rtconfig.h +++ b/bsp/allwinner_tina/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/amebaz/.config b/bsp/amebaz/.config index 9412058c8e..ceaafae7a1 100644 --- a/bsp/amebaz/.config +++ b/bsp/amebaz/.config @@ -21,6 +21,7 @@ CONFIG_RT_USING_TIMER_SOFT=y CONFIG_RT_TIMER_THREAD_PRIO=4 CONFIG_RT_TIMER_THREAD_STACK_SIZE=1024 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/amebaz/drivers/wlan/drv_wifi.c b/bsp/amebaz/drivers/wlan/drv_wifi.c index 7e62ed1acf..753952df43 100644 --- a/bsp/amebaz/drivers/wlan/drv_wifi.c +++ b/bsp/amebaz/drivers/wlan/drv_wifi.c @@ -28,10 +28,8 @@ #include "drv_wlan.h" #include "drv_wifi.h" -#define DBG_ENABLE #define DBG_LEVEL DBG_INFO #define DBG_SECTION_NAME "WIFI" -#define DBG_COLOR #include #define MAX_ADDR_LEN (6) diff --git a/bsp/amebaz/rtconfig.h b/bsp/amebaz/rtconfig.h index 92bac2d294..f018b43d9d 100644 --- a/bsp/amebaz/rtconfig.h +++ b/bsp/amebaz/rtconfig.h @@ -19,6 +19,7 @@ #define RT_TIMER_THREAD_PRIO 4 #define RT_TIMER_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/apollo2/rtconfig.h b/bsp/apollo2/rtconfig.h index dfa458bc4e..d8ac639c86 100644 --- a/bsp/apollo2/rtconfig.h +++ b/bsp/apollo2/rtconfig.h @@ -11,6 +11,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 500 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/asm9260t/.config b/bsp/asm9260t/.config index e634c994c8..04964a8375 100644 --- a/bsp/asm9260t/.config +++ b/bsp/asm9260t/.config @@ -11,6 +11,7 @@ CONFIG_RT_ALIGN_SIZE=4 CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 # CONFIG_RT_DEBUG_THREAD is not set diff --git a/bsp/asm9260t/rtconfig.h b/bsp/asm9260t/rtconfig.h index bf1f76fefb..8ca5daa565 100644 --- a/bsp/asm9260t/rtconfig.h +++ b/bsp/asm9260t/rtconfig.h @@ -11,6 +11,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 /* RT_DEBUG_THREAD is not set */ diff --git a/bsp/at91sam9260/.config b/bsp/at91sam9260/.config index a19ac15d3d..c669ac5fe1 100644 --- a/bsp/at91sam9260/.config +++ b/bsp/at91sam9260/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/at91sam9260/rtconfig.h b/bsp/at91sam9260/rtconfig.h index 816054c3e1..0c6e595e5e 100755 --- a/bsp/at91sam9260/rtconfig.h +++ b/bsp/at91sam9260/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/at91sam9g45/.config b/bsp/at91sam9g45/.config index 5f3ae78673..b0599d74f7 100644 --- a/bsp/at91sam9g45/.config +++ b/bsp/at91sam9g45/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/at91sam9g45/rtconfig.h b/bsp/at91sam9g45/rtconfig.h index 5d638ce1c9..755f9bbfc2 100644 --- a/bsp/at91sam9g45/rtconfig.h +++ b/bsp/at91sam9g45/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/beaglebone/.config b/bsp/beaglebone/.config index 409e89d18e..784324cf75 100644 --- a/bsp/beaglebone/.config +++ b/bsp/beaglebone/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/beaglebone/rtconfig.h b/bsp/beaglebone/rtconfig.h index c49528049d..00460b5566 100644 --- a/bsp/beaglebone/rtconfig.h +++ b/bsp/beaglebone/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/ck802/.config b/bsp/ck802/.config index e91f93fd0e..3bd8636aae 100644 --- a/bsp/ck802/.config +++ b/bsp/ck802/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/ck802/rtconfig.h b/bsp/ck802/rtconfig.h index 076d48e534..4e3b217f93 100644 --- a/bsp/ck802/rtconfig.h +++ b/bsp/ck802/rtconfig.h @@ -12,6 +12,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/dm365/.config b/bsp/dm365/.config index 6974ff8ae0..761ecf2cf1 100644 --- a/bsp/dm365/.config +++ b/bsp/dm365/.config @@ -21,6 +21,7 @@ CONFIG_RT_USING_TIMER_SOFT=y CONFIG_RT_TIMER_THREAD_PRIO=8 CONFIG_RT_TIMER_THREAD_STACK_SIZE=512 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/dm365/rtconfig.h b/bsp/dm365/rtconfig.h index 4f3698f124..5fc198c0cf 100644 --- a/bsp/dm365/rtconfig.h +++ b/bsp/dm365/rtconfig.h @@ -21,6 +21,7 @@ #define RT_TIMER_THREAD_PRIO 8 #define RT_TIMER_THREAD_STACK_SIZE 512 #define RT_DEBUG +#define RT_DEBUG_COLOR /* RT_DEBUG_INIT_CONFIG is not set */ /* RT_DEBUG_THREAD_CONFIG is not set */ /* RT_DEBUG_SCHEDULER_CONFIG is not set */ diff --git a/bsp/efm32/rtconfig.h b/bsp/efm32/rtconfig.h index 882e36f396..4ee9bf1a8e 100644 --- a/bsp/efm32/rtconfig.h +++ b/bsp/efm32/rtconfig.h @@ -35,6 +35,7 @@ /* SECTION: RT_DEBUG */ #define RT_DEBUG +#define RT_DEBUG_COLOR //#define RT_DEBUG_MEM (1) //#define RT_DEBUG_SCHEDULER (1) //#define RT_DEBUG_IPC (1) diff --git a/bsp/es32f0334/.config b/bsp/es32f0334/.config index 885ad72c98..aeccdd7e22 100644 --- a/bsp/es32f0334/.config +++ b/bsp/es32f0334/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/es32f0334/rtconfig.h b/bsp/es32f0334/rtconfig.h index 09c7493ada..8435637828 100644 --- a/bsp/es32f0334/rtconfig.h +++ b/bsp/es32f0334/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/es32f0654/.config b/bsp/es32f0654/.config index 5cb6e5853b..ced622f5ff 100644 --- a/bsp/es32f0654/.config +++ b/bsp/es32f0654/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/es32f0654/rtconfig.h b/bsp/es32f0654/rtconfig.h index 9500598676..77e177cc25 100644 --- a/bsp/es32f0654/rtconfig.h +++ b/bsp/es32f0654/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/fh8620/rtconfig.h b/bsp/fh8620/rtconfig.h index 01a2d2d45c..ea210a4703 100644 --- a/bsp/fh8620/rtconfig.h +++ b/bsp/fh8620/rtconfig.h @@ -24,6 +24,7 @@ #define RT_USING_CPU_FFS //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/bsp/frdm-k64f/rtconfig.h b/bsp/frdm-k64f/rtconfig.h index 8d0ad639ce..6338b39edb 100644 --- a/bsp/frdm-k64f/rtconfig.h +++ b/bsp/frdm-k64f/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/gd32303e-eval/.config b/bsp/gd32303e-eval/.config index b61d310f03..40cac74cf7 100644 --- a/bsp/gd32303e-eval/.config +++ b/bsp/gd32303e-eval/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/gd32303e-eval/rtconfig.h b/bsp/gd32303e-eval/rtconfig.h index 479ad99af5..77e9056395 100644 --- a/bsp/gd32303e-eval/rtconfig.h +++ b/bsp/gd32303e-eval/rtconfig.h @@ -12,6 +12,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/gd32450z-eval/.config b/bsp/gd32450z-eval/.config index e2f00a07fc..a8b61c6b69 100644 --- a/bsp/gd32450z-eval/.config +++ b/bsp/gd32450z-eval/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/gd32450z-eval/rtconfig.h b/bsp/gd32450z-eval/rtconfig.h index 500aab6290..42601f4ca9 100644 --- a/bsp/gd32450z-eval/rtconfig.h +++ b/bsp/gd32450z-eval/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/gkipc/.config b/bsp/gkipc/.config index 975b82b5b2..9ef3dadbde 100644 --- a/bsp/gkipc/.config +++ b/bsp/gkipc/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_256=y CONFIG_RT_THREAD_PRIORITY_MAX=256 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/gkipc/rtconfig.h b/bsp/gkipc/rtconfig.h index 2c0233cf29..82262adfd5 100644 --- a/bsp/gkipc/rtconfig.h +++ b/bsp/gkipc/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 256 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/hifive1/.config b/bsp/hifive1/.config index 9f66767320..af1e58a0e4 100644 --- a/bsp/hifive1/.config +++ b/bsp/hifive1/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/hifive1/rtconfig.h b/bsp/hifive1/rtconfig.h index 1d96bfc3db..8f4bb37892 100644 --- a/bsp/hifive1/rtconfig.h +++ b/bsp/hifive1/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/imx6sx/cortex-a9/.config b/bsp/imx6sx/cortex-a9/.config index ce2e256f2c..a43422d533 100644 --- a/bsp/imx6sx/cortex-a9/.config +++ b/bsp/imx6sx/cortex-a9/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/imx6sx/cortex-a9/rtconfig.h b/bsp/imx6sx/cortex-a9/rtconfig.h index 30de937b05..f11ddac2a1 100644 --- a/bsp/imx6sx/cortex-a9/rtconfig.h +++ b/bsp/imx6sx/cortex-a9/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/imx6ul/rtconfig.h b/bsp/imx6ul/rtconfig.h index ee3857dcb8..2b034ac76b 100644 --- a/bsp/imx6ul/rtconfig.h +++ b/bsp/imx6ul/rtconfig.h @@ -20,6 +20,7 @@ #define IDLE_THREAD_STACK_SIZE 512 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_DEBUG_SCHEDULER 1 // diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c index 54666a7b1c..f68373b535 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c @@ -46,9 +46,7 @@ //#define ETH_RX_DUMP //#define ETH_TX_DUMP -#define DBG_ENABLE #define DBG_SECTION_NAME "ETH" -#define DBG_COLOR #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c index 30b9e13306..1cae69ba17 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c @@ -37,9 +37,7 @@ //#define ETH_RX_DUMP //#define ETH_TX_DUMP -#define DBG_ENABLE #define DBG_SECTION_NAME "ETH" -#define DBG_COLOR #define DBG_LEVEL DBG_LOG #include diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c index aa851f7b39..5ca326070c 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c @@ -14,10 +14,8 @@ #include #include "drv_flexspi.h" -#define DBG_ENABLE -#define DBG_SECTION_NAME "[Hyper]" +#define DBG_SECTION_NAME "Hyper" #define DBG_LEVEL DBG_LOG -#define DBG_COLOR #include #define FLEXSPI_CLOCK kCLOCK_FlexSpi diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c index c48e43c2e0..4e9e738b6c 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c @@ -12,10 +12,9 @@ #include "board.h" #include #include "drv_flexspi.h" -#define DBG_ENABLE -#define DBG_SECTION_NAME "[FLEXSPI]" + +#define DBG_SECTION_NAME "FLEXSPI" #define DBG_LEVEL DBG_LOG -#define DBG_COLOR #include #define FLEXSPI_CLOCK kCLOCK_FlexSpi diff --git a/bsp/imxrt/imxrt1050-ArchMix/.config b/bsp/imxrt/imxrt1050-ArchMix/.config index 43dcdd1b75..35624f7169 100644 --- a/bsp/imxrt/imxrt1050-ArchMix/.config +++ b/bsp/imxrt/imxrt1050-ArchMix/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/imxrt/imxrt1050-ArchMix/rtconfig.h b/bsp/imxrt/imxrt1050-ArchMix/rtconfig.h index 67e3f4632b..7f82bba585 100644 --- a/bsp/imxrt/imxrt1050-ArchMix/rtconfig.h +++ b/bsp/imxrt/imxrt1050-ArchMix/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/imxrt/imxrt1050-evk/.config b/bsp/imxrt/imxrt1050-evk/.config index e49cad6287..f89d1573ec 100644 --- a/bsp/imxrt/imxrt1050-evk/.config +++ b/bsp/imxrt/imxrt1050-evk/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/imxrt/imxrt1050-evk/rtconfig.h b/bsp/imxrt/imxrt1050-evk/rtconfig.h index 156ef1f258..d84cda40ad 100644 --- a/bsp/imxrt/imxrt1050-evk/rtconfig.h +++ b/bsp/imxrt/imxrt1050-evk/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/k210/.config b/bsp/k210/.config index 65164c210d..dca21c52c8 100644 --- a/bsp/k210/.config +++ b/bsp/k210/.config @@ -22,6 +22,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_DEBUG_INIT_CONFIG=y CONFIG_RT_DEBUG_INIT=1 # CONFIG_RT_DEBUG_THREAD_CONFIG is not set diff --git a/bsp/k210/rtconfig.h b/bsp/k210/rtconfig.h index 94844cbf88..97e0236108 100644 --- a/bsp/k210/rtconfig.h +++ b/bsp/k210/rtconfig.h @@ -22,6 +22,7 @@ #define IDLE_THREAD_STACK_SIZE 1024 /* RT_USING_TIMER_SOFT is not set */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_DEBUG_INIT_CONFIG #define RT_DEBUG_INIT 1 /* RT_DEBUG_THREAD_CONFIG is not set */ diff --git a/bsp/lm4f232/rtconfig.h b/bsp/lm4f232/rtconfig.h index 75a826ff4f..52844dc578 100644 --- a/bsp/lm4f232/rtconfig.h +++ b/bsp/lm4f232/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/lpc176x/rtconfig.h b/bsp/lpc176x/rtconfig.h index 726b887047..629d7da08f 100644 --- a/bsp/lpc176x/rtconfig.h +++ b/bsp/lpc176x/rtconfig.h @@ -17,6 +17,7 @@ #define RT_TICK_PER_SECOND 100 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/bsp/lpc178x/rtconfig.h b/bsp/lpc178x/rtconfig.h index 13f7759b0b..25f99888f7 100644 --- a/bsp/lpc178x/rtconfig.h +++ b/bsp/lpc178x/rtconfig.h @@ -18,6 +18,7 @@ #define RT_TICK_PER_SECOND 100 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/bsp/lpc2148/rtconfig.h b/bsp/lpc2148/rtconfig.h index 6343ce5ce6..70a6ef0325 100644 --- a/bsp/lpc2148/rtconfig.h +++ b/bsp/lpc2148/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* #define RT_THREAD_DEBUG */ #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/lpc408x/.config b/bsp/lpc408x/.config index eed04f9c32..fca755e768 100644 --- a/bsp/lpc408x/.config +++ b/bsp/lpc408x/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/lpc408x/rtconfig.h b/bsp/lpc408x/rtconfig.h index 0d5469786f..2b046180b4 100644 --- a/bsp/lpc408x/rtconfig.h +++ b/bsp/lpc408x/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/lpc43xx/M0/rtconfig.h b/bsp/lpc43xx/M0/rtconfig.h index 90531287dd..a4aef7f151 100644 --- a/bsp/lpc43xx/M0/rtconfig.h +++ b/bsp/lpc43xx/M0/rtconfig.h @@ -22,6 +22,7 @@ //#define RT_USING_MODULE //
#define RT_DEBUG +#define RT_DEBUG_COLOR // #define RT_DEBUG_INIT 0 //#define RT_DEBUG_SCHEDULER 1 diff --git a/bsp/lpc43xx/M4/rtconfig.h b/bsp/lpc43xx/M4/rtconfig.h index 0b30998cc0..5e41344165 100644 --- a/bsp/lpc43xx/M4/rtconfig.h +++ b/bsp/lpc43xx/M4/rtconfig.h @@ -22,6 +22,7 @@ //#define RT_USING_MODULE //
#define RT_DEBUG +#define RT_DEBUG_COLOR // #define RT_DEBUG_INIT 0 // diff --git a/bsp/lpc5410x/rtconfig.h b/bsp/lpc5410x/rtconfig.h index c054bfabba..387f1e75e6 100644 --- a/bsp/lpc5410x/rtconfig.h +++ b/bsp/lpc5410x/rtconfig.h @@ -18,6 +18,7 @@ #define RT_TICK_PER_SECOND 100 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/bsp/lpc54114-lite/.config b/bsp/lpc54114-lite/.config index 4fae2a9de6..acdb890f05 100644 --- a/bsp/lpc54114-lite/.config +++ b/bsp/lpc54114-lite/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/lpc54114-lite/rtconfig.h b/bsp/lpc54114-lite/rtconfig.h index 4fc1054b7b..2d833b3e4d 100644 --- a/bsp/lpc54114-lite/rtconfig.h +++ b/bsp/lpc54114-lite/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/lpc54608-LPCXpresso/.config b/bsp/lpc54608-LPCXpresso/.config index 85046e050d..f793185bda 100644 --- a/bsp/lpc54608-LPCXpresso/.config +++ b/bsp/lpc54608-LPCXpresso/.config @@ -21,6 +21,7 @@ CONFIG_RT_USING_TIMER_SOFT=y CONFIG_RT_TIMER_THREAD_PRIO=4 CONFIG_RT_TIMER_THREAD_STACK_SIZE=512 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/lpc54608-LPCXpresso/rtconfig.h b/bsp/lpc54608-LPCXpresso/rtconfig.h index 46855f7713..987439e331 100644 --- a/bsp/lpc54608-LPCXpresso/rtconfig.h +++ b/bsp/lpc54608-LPCXpresso/rtconfig.h @@ -19,6 +19,7 @@ #define RT_TIMER_THREAD_PRIO 4 #define RT_TIMER_THREAD_STACK_SIZE 512 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/ls1bdev/rtconfig.h b/bsp/ls1bdev/rtconfig.h index 67bba7fc68..4135268111 100644 --- a/bsp/ls1bdev/rtconfig.h +++ b/bsp/ls1bdev/rtconfig.h @@ -17,6 +17,7 @@ #define RT_TICK_PER_SECOND 100 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/bsp/ls1cdev/.config b/bsp/ls1cdev/.config index 30d3540c58..dd1327ddc8 100644 --- a/bsp/ls1cdev/.config +++ b/bsp/ls1cdev/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/ls1cdev/rtconfig.h b/bsp/ls1cdev/rtconfig.h index 7e140a731c..98ac15d730 100644 --- a/bsp/ls1cdev/rtconfig.h +++ b/bsp/ls1cdev/rtconfig.h @@ -19,6 +19,7 @@ #define IDLE_THREAD_STACK_SIZE 1024 /* RT_USING_TIMER_SOFT is not set */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* RT_DEBUG_INIT_CONFIG is not set */ /* RT_DEBUG_THREAD_CONFIG is not set */ /* RT_DEBUG_SCHEDULER_CONFIG is not set */ diff --git a/bsp/m16c62p/rtconfig.h b/bsp/m16c62p/rtconfig.h index 978fe7af50..adcf67e748 100644 --- a/bsp/m16c62p/rtconfig.h +++ b/bsp/m16c62p/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR ///#define SCHEDULER_DEBUG #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/mb9bf568r/rtconfig.h b/bsp/mb9bf568r/rtconfig.h index dc4c61b148..1982028ce7 100644 --- a/bsp/mb9bf568r/rtconfig.h +++ b/bsp/mb9bf568r/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK /* Using Hook */ diff --git a/bsp/mb9bf618s/rtconfig.h b/bsp/mb9bf618s/rtconfig.h index 85c8719d36..1b647a7a30 100644 --- a/bsp/mb9bf618s/rtconfig.h +++ b/bsp/mb9bf618s/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK /* Using Hook */ diff --git a/bsp/mini4020/rtconfig.h b/bsp/mini4020/rtconfig.h index bef31bc1a7..c35134731b 100644 --- a/bsp/mini4020/rtconfig.h +++ b/bsp/mini4020/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* #define RT_THREAD_DEBUG */ #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/nios_ii/rtconfig.h b/bsp/nios_ii/rtconfig.h index 700907e986..fcd3799846 100644 --- a/bsp/nios_ii/rtconfig.h +++ b/bsp/nios_ii/rtconfig.h @@ -21,6 +21,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR //#define THREAD_DEBUG //#define SCHEDULER_DEBUG //#define IRQ_DEBUG diff --git a/bsp/nrf51822/rtconfig.h b/bsp/nrf51822/rtconfig.h index b41bbdadfa..ee7cb6b2f4 100644 --- a/bsp/nrf51822/rtconfig.h +++ b/bsp/nrf51822/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR //#define RT_DEBUG_INIT 1 #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/nuvoton_m05x/.config b/bsp/nuvoton_m05x/.config index 07830e5c36..e86503da27 100644 --- a/bsp/nuvoton_m05x/.config +++ b/bsp/nuvoton_m05x/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/nuvoton_m05x/rtconfig.h b/bsp/nuvoton_m05x/rtconfig.h index db3cc679c8..618084a0af 100644 --- a/bsp/nuvoton_m05x/rtconfig.h +++ b/bsp/nuvoton_m05x/rtconfig.h @@ -19,6 +19,7 @@ #define IDLE_THREAD_STACK_SIZE 256 /* RT_USING_TIMER_SOFT is not set */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* RT_DEBUG_INIT_CONFIG is not set */ /* RT_DEBUG_THREAD_CONFIG is not set */ /* RT_DEBUG_SCHEDULER_CONFIG is not set */ diff --git a/bsp/nuvoton_m451/rtconfig.h b/bsp/nuvoton_m451/rtconfig.h index cb4868725c..b47eb84c59 100644 --- a/bsp/nuvoton_m451/rtconfig.h +++ b/bsp/nuvoton_m451/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_DEBUG_INIT 1 #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/nuvoton_m487/.config b/bsp/nuvoton_m487/.config index 2e12793338..6fc68de8e5 100644 --- a/bsp/nuvoton_m487/.config +++ b/bsp/nuvoton_m487/.config @@ -20,6 +20,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/nuvoton_m487/rtconfig.h b/bsp/nuvoton_m487/rtconfig.h index 7f151fe1de..0fa34764be 100644 --- a/bsp/nuvoton_m487/rtconfig.h +++ b/bsp/nuvoton_m487/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/nuvoton_nuc472/rtconfig.h b/bsp/nuvoton_nuc472/rtconfig.h index 9d1268a7ff..af9eacbef5 100644 --- a/bsp/nuvoton_nuc472/rtconfig.h +++ b/bsp/nuvoton_nuc472/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_THREAD_DEBUG #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/pic32ethernet/rtconfig.h b/bsp/pic32ethernet/rtconfig.h index 6bd11bfe2e..5d329788bc 100644 --- a/bsp/pic32ethernet/rtconfig.h +++ b/bsp/pic32ethernet/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR //#define THREAD_DEBUG #define SCHEDULER_DEBUG //#define IRQ_DEBUG diff --git a/bsp/qemu-vexpress-a9/.config b/bsp/qemu-vexpress-a9/.config index f1ea781e66..c8814d366a 100644 --- a/bsp/qemu-vexpress-a9/.config +++ b/bsp/qemu-vexpress-a9/.config @@ -24,6 +24,7 @@ CONFIG_RT_USING_TIMER_SOFT=y CONFIG_RT_TIMER_THREAD_PRIO=4 CONFIG_RT_TIMER_THREAD_STACK_SIZE=1024 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set @@ -457,35 +458,6 @@ CONFIG_RT_USING_LWP=y # CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set # CONFIG_PKG_USING_HELLO is not set # CONFIG_PKG_USING_VI is not set - -# -# Privated Packages of RealThread -# -# CONFIG_PKG_USING_CODEC is not set -# CONFIG_PKG_USING_PLAYER is not set -# CONFIG_PKG_USING_PERSIMMON_SRC is not set -# CONFIG_PKG_USING_JS_PERSIMMON is not set -# CONFIG_PKG_USING_JERRYSCRIPT_WIN32 is not set - -# -# Network Utilities -# -# CONFIG_PKG_USING_MDNS is not set -# CONFIG_PKG_USING_UPNP is not set -# CONFIG_PKG_USING_WICED is not set -# CONFIG_PKG_USING_CLOUDSDK is not set -# CONFIG_PKG_USING_COREMARK is not set -# CONFIG_PKG_USING_POWER_MANAGER is not set -# CONFIG_PKG_USING_RT_OTA is not set -# CONFIG_PKG_USING_RDBD_SRC is not set -# CONFIG_PKG_USING_RTINSIGHT is not set -# CONFIG_PKG_USING_SMARTCONFIG is not set -# CONFIG_PKG_USING_RTX is not set -# CONFIG_RT_USING_TESTCASE is not set -# CONFIG_PKG_USING_NGHTTP2 is not set -# CONFIG_PKG_USING_AVS is not set -# CONFIG_PKG_USING_STS is not set -# CONFIG_PKG_USING_DLMS is not set CONFIG_SOC_VEXPRESS_A9=y CONFIG_RT_USING_UART0=y CONFIG_RT_USING_UART1=y diff --git a/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c b/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c index 55ac034ab9..68f8f09c10 100644 --- a/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c +++ b/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c @@ -28,13 +28,11 @@ #include "drv_ac97.h" #include "realview.h" -#define DBG_ENABLE #define DBG_SECTION_NAME "PL041" // #define DBG_LEVEL DBG_LOG // #define DBG_LEVEL DBG_INFO #define DBG_LEVEL DBG_WARNING // #define DBG_LEVEL DBG_ERROR -#define DBG_COLOR #include #define FRAME_PERIOD_US (50) diff --git a/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c b/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c index 7b1a49db55..4948f46117 100644 --- a/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c +++ b/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c @@ -6,10 +6,7 @@ #include "interrupt.h" #include "drv_keyboard.h" -#define DBG_LEVEL DBG_LOG -// #define DBG_ENABLE -#define DBG_COLOR - +#define DBG_LEVEL DBG_INFO #include "rtdbg.h" #define KEYBOARD_ADDRESS (0x10006000) @@ -442,7 +439,7 @@ int rt_hw_keyboard_init(void) pdat = rt_malloc(sizeof(struct keyboard_pl050_pdata_t)); if(!pdat) { - LOG_E("malloc memory", id); + LOG_E("malloc memory failed"); return RT_ERROR; } rt_memset(pdat, 0, sizeof(struct keyboard_pl050_pdata_t)); diff --git a/bsp/qemu-vexpress-a9/drivers/drv_mouse.c b/bsp/qemu-vexpress-a9/drivers/drv_mouse.c index 5fc1434166..852cc56129 100644 --- a/bsp/qemu-vexpress-a9/drivers/drv_mouse.c +++ b/bsp/qemu-vexpress-a9/drivers/drv_mouse.c @@ -7,10 +7,8 @@ #include "drv_mouse.h" #include "drv_clcd.h" -#define DBG_LEVEL DBG_LOG -// #define DBG_ENABLE -#define DBG_COLOR - +#define DBG_SECTION_NAME "drv.mouse" +#define DBG_LEVEL DBG_INFO #include "rtdbg.h" #define MOUSE_ADDRESS (0x10007000) @@ -246,7 +244,7 @@ int rt_hw_mouse_init(void) pdat = rt_malloc(sizeof(struct mouse_pl050_pdata_t)); if(!pdat) { - LOG_E("malloc memory", id); + LOG_E("malloc memory failed"); return RT_ERROR; } rt_memset(pdat, 0, sizeof(struct mouse_pl050_pdata_t)); diff --git a/bsp/qemu-vexpress-a9/drivers/drv_sdio.c b/bsp/qemu-vexpress-a9/drivers/drv_sdio.c index 5f2470f83d..c031011e51 100644 --- a/bsp/qemu-vexpress-a9/drivers/drv_sdio.c +++ b/bsp/qemu-vexpress-a9/drivers/drv_sdio.c @@ -77,10 +77,8 @@ #define PL180_CLR_DAT_END (1 << 8) #define PL180_CLR_DAT_BLK_END (1 << 10) -#define DBG_LEVEL DBG_LOG -// #define DBG_ENABLE -#define DBG_COLOR - +#define DBG_SECTION_NAME "drv.sdio" +#define DBG_LEVEL DBG_INFO #include "rtdbg.h" struct sdhci_pl180_pdata_t @@ -344,10 +342,10 @@ static void mmc_request_send(struct rt_mmcsd_host *host, struct rt_mmcsd_req *re req->cmd->err = sdhci_pl180_transfer(sdhci, &cmd, RT_NULL); } - LOG_I("cmdarg:%d", cmd.cmdarg); - LOG_I("cmdidx:%d", cmd.cmdidx); + LOG_D("cmdarg:%d", cmd.cmdarg); + LOG_D("cmdidx:%d", cmd.cmdidx); - LOG_I("[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x", cmd.response[0], cmd.response[1], cmd.response[2], cmd.response[3]); + LOG_D("[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x", cmd.response[0], cmd.response[1], cmd.response[2], cmd.response[3]); req->cmd->resp[3] = cmd.response[3]; req->cmd->resp[2] = cmd.response[2]; req->cmd->resp[1] = cmd.response[1]; @@ -381,7 +379,7 @@ static void mmc_set_iocfg(struct rt_mmcsd_host *host, struct rt_mmcsd_io_cfg *io sdhci_pl180_setclock(sdhci, io_cfg->clock); sdhci_pl180_setwidth(sdhci, io_cfg->bus_width); - LOG_I("clock:%d bus_width:%d", io_cfg->clock, io_cfg->bus_width); + LOG_D("clock:%d bus_width:%d", io_cfg->clock, io_cfg->bus_width); } static const struct rt_mmcsd_host_ops ops = diff --git a/bsp/qemu-vexpress-a9/rtconfig.h b/bsp/qemu-vexpress-a9/rtconfig.h index 2007a21f44..b6c3399da3 100644 --- a/bsp/qemu-vexpress-a9/rtconfig.h +++ b/bsp/qemu-vexpress-a9/rtconfig.h @@ -22,6 +22,7 @@ #define RT_TIMER_THREAD_PRIO 4 #define RT_TIMER_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ @@ -254,12 +255,6 @@ /* samples: kernel and components samples */ - -/* Privated Packages of RealThread */ - - -/* Network Utilities */ - #define SOC_VEXPRESS_A9 #define RT_USING_UART0 #define RT_USING_UART1 diff --git a/bsp/qemu-vexpress-gemini/.config b/bsp/qemu-vexpress-gemini/.config index 425f9a1eae..b7610b6c5e 100644 --- a/bsp/qemu-vexpress-gemini/.config +++ b/bsp/qemu-vexpress-gemini/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=512 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/qemu-vexpress-gemini/rtconfig.h b/bsp/qemu-vexpress-gemini/rtconfig.h index 7218fedca1..acb00aadda 100644 --- a/bsp/qemu-vexpress-gemini/rtconfig.h +++ b/bsp/qemu-vexpress-gemini/rtconfig.h @@ -19,6 +19,7 @@ #define IDLE_THREAD_STACK_SIZE 512 /* RT_USING_TIMER_SOFT is not set */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* RT_DEBUG_INIT_CONFIG is not set */ /* RT_DEBUG_THREAD_CONFIG is not set */ /* RT_DEBUG_SCHEDULER_CONFIG is not set */ diff --git a/bsp/raspi2/.config b/bsp/raspi2/.config index 7db26a7cb1..5821005c0c 100644 --- a/bsp/raspi2/.config +++ b/bsp/raspi2/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/raspi2/rtconfig.h b/bsp/raspi2/rtconfig.h index d0b692f9ab..b2e6349ad0 100644 --- a/bsp/raspi2/rtconfig.h +++ b/bsp/raspi2/rtconfig.h @@ -19,6 +19,7 @@ #define IDLE_THREAD_STACK_SIZE 256 /* RT_USING_TIMER_SOFT is not set */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* RT_DEBUG_INIT_CONFIG is not set */ /* RT_DEBUG_THREAD_CONFIG is not set */ /* RT_DEBUG_SCHEDULER_CONFIG is not set */ diff --git a/bsp/realview-a8/rtconfig.h b/bsp/realview-a8/rtconfig.h index d06e81a0e1..68d28bcd93 100644 --- a/bsp/realview-a8/rtconfig.h +++ b/bsp/realview-a8/rtconfig.h @@ -20,6 +20,7 @@ #define IDLE_THREAD_STACK_SIZE 512 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/bsp/rv32m1_vega/ri5cy/.config b/bsp/rv32m1_vega/ri5cy/.config index d62e37947a..5bb6a992e5 100644 --- a/bsp/rv32m1_vega/ri5cy/.config +++ b/bsp/rv32m1_vega/ri5cy/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/rv32m1_vega/ri5cy/rtconfig.h b/bsp/rv32m1_vega/ri5cy/rtconfig.h index ff78ea65a1..82fecbb22f 100644 --- a/bsp/rv32m1_vega/ri5cy/rtconfig.h +++ b/bsp/rv32m1_vega/ri5cy/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/rx/rtconfig.h b/bsp/rx/rtconfig.h index 364204696f..6f055dce1a 100644 --- a/bsp/rx/rtconfig.h +++ b/bsp/rx/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_THREAD_DEBUG #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/samd21/rtconfig.h b/bsp/samd21/rtconfig.h index c22a5496e7..99fe288e3a 100644 --- a/bsp/samd21/rtconfig.h +++ b/bsp/samd21/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR //#define RT_DEBUG_INIT 1 #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/sep6200/rtconfig.h b/bsp/sep6200/rtconfig.h index e2ca52cc5c..c078a6b5a2 100644 --- a/bsp/sep6200/rtconfig.h +++ b/bsp/sep6200/rtconfig.h @@ -2,7 +2,6 @@ #ifndef __RTTHREAD_CFG_H__ #define __RTTHREAD_CFG_H__ -#define RT_DEBUG /* #define RT_DEBUG_IRQ 1 */ /* #define RT_DEBUG_TIMER 1 */ @@ -29,6 +28,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* #define RT_THREAD_DEBUG */ #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/simulator/.config b/bsp/simulator/.config index dbb69fd390..479f5658d1 100644 --- a/bsp/simulator/.config +++ b/bsp/simulator/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/simulator/rtconfig.h b/bsp/simulator/rtconfig.h index 4955172df7..22f9d2a5b4 100755 --- a/bsp/simulator/rtconfig.h +++ b/bsp/simulator/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_log.h b/bsp/stm32/libraries/HAL_Drivers/drv_log.h index f7461223d7..69328b368a 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_log.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_log.h @@ -12,9 +12,6 @@ * NOTE: DO NOT include this file on the header file. */ -#define DBG_ENABLE -#define DBG_COLOR - #ifndef LOG_TAG #define DBG_SECTION_NAME "drv" #else diff --git a/bsp/stm32/libraries/templates/stm32f0xx/.config b/bsp/stm32/libraries/templates/stm32f0xx/.config index 95ba89c2b8..71e677bd8d 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/.config +++ b/bsp/stm32/libraries/templates/stm32f0xx/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/libraries/templates/stm32f0xx/rtconfig.h b/bsp/stm32/libraries/templates/stm32f0xx/rtconfig.h index 0026ccb4a8..0ed9946b4d 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/rtconfig.h +++ b/bsp/stm32/libraries/templates/stm32f0xx/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/libraries/templates/stm32f10x/.config b/bsp/stm32/libraries/templates/stm32f10x/.config index 4d9fc24b34..a7356cd424 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/.config +++ b/bsp/stm32/libraries/templates/stm32f10x/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/libraries/templates/stm32f10x/rtconfig.h b/bsp/stm32/libraries/templates/stm32f10x/rtconfig.h index 63450a8a21..b49535ef9c 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/rtconfig.h +++ b/bsp/stm32/libraries/templates/stm32f10x/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/libraries/templates/stm32f4xx/.config b/bsp/stm32/libraries/templates/stm32f4xx/.config index 973b093b5b..e685a4fdcf 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/.config +++ b/bsp/stm32/libraries/templates/stm32f4xx/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.h b/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.h index 8e6b709a8a..eef0a9fe47 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.h +++ b/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/libraries/templates/stm32f7xx/.config b/bsp/stm32/libraries/templates/stm32f7xx/.config index a594f088db..da5d2099bf 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/.config +++ b/bsp/stm32/libraries/templates/stm32f7xx/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/libraries/templates/stm32f7xx/rtconfig.h b/bsp/stm32/libraries/templates/stm32f7xx/rtconfig.h index 50eb442ed8..019e9ccb3a 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/rtconfig.h +++ b/bsp/stm32/libraries/templates/stm32f7xx/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/libraries/templates/stm32l4xx/.config b/bsp/stm32/libraries/templates/stm32l4xx/.config index e29aecd0c8..7349adcc55 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/.config +++ b/bsp/stm32/libraries/templates/stm32l4xx/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.h b/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.h index 6ae4a7ba8a..b6055004ae 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.h +++ b/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f091-st-nucleo/.config b/bsp/stm32/stm32f091-st-nucleo/.config index 0fced6c38b..4fad5a0bb3 100644 --- a/bsp/stm32/stm32f091-st-nucleo/.config +++ b/bsp/stm32/stm32f091-st-nucleo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f091-st-nucleo/rtconfig.h b/bsp/stm32/stm32f091-st-nucleo/rtconfig.h index dc6298a719..791373ea2e 100644 --- a/bsp/stm32/stm32f091-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32f091-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f103-atk-nano/.config b/bsp/stm32/stm32f103-atk-nano/.config index 7a4eec1ff9..52ed83da63 100644 --- a/bsp/stm32/stm32f103-atk-nano/.config +++ b/bsp/stm32/stm32f103-atk-nano/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f103-atk-nano/rtconfig.h b/bsp/stm32/stm32f103-atk-nano/rtconfig.h index 816034b45d..619439d3f5 100644 --- a/bsp/stm32/stm32f103-atk-nano/rtconfig.h +++ b/bsp/stm32/stm32f103-atk-nano/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f103-dofly-lyc8/.config b/bsp/stm32/stm32f103-dofly-lyc8/.config index 7f97f2603f..959d611b80 100644 --- a/bsp/stm32/stm32f103-dofly-lyc8/.config +++ b/bsp/stm32/stm32f103-dofly-lyc8/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f103-dofly-lyc8/rtconfig.h b/bsp/stm32/stm32f103-dofly-lyc8/rtconfig.h index 92eee96813..92e59c0759 100644 --- a/bsp/stm32/stm32f103-dofly-lyc8/rtconfig.h +++ b/bsp/stm32/stm32f103-dofly-lyc8/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f103-fire-arbitrary/.config b/bsp/stm32/stm32f103-fire-arbitrary/.config index 0938feaf7e..9674152dba 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/.config +++ b/bsp/stm32/stm32f103-fire-arbitrary/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c b/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c index 16c7a9e454..45c8a6d74d 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c @@ -16,10 +16,7 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "app.card" -#define DBG_COLOR - #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.h b/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.h index 5a2ac1c53c..4f5b34280a 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.h +++ b/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f103-hw100k-ibox/.config b/bsp/stm32/stm32f103-hw100k-ibox/.config index d13b95269e..e7e202aecb 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/.config +++ b/bsp/stm32/stm32f103-hw100k-ibox/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f103-hw100k-ibox/rtconfig.h b/bsp/stm32/stm32f103-hw100k-ibox/rtconfig.h index 322d2776eb..6ea22eea76 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/rtconfig.h +++ b/bsp/stm32/stm32f103-hw100k-ibox/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f107-uc-eval/.config b/bsp/stm32/stm32f107-uc-eval/.config index 9e3c8a7fcc..e116d9221b 100644 --- a/bsp/stm32/stm32f107-uc-eval/.config +++ b/bsp/stm32/stm32f107-uc-eval/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f107-uc-eval/rtconfig.h b/bsp/stm32/stm32f107-uc-eval/rtconfig.h index afc9a75ace..016619dcab 100644 --- a/bsp/stm32/stm32f107-uc-eval/rtconfig.h +++ b/bsp/stm32/stm32f107-uc-eval/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f405-smdz-breadfruit/.config b/bsp/stm32/stm32f405-smdz-breadfruit/.config index fe5e73f6c0..a93ce77cd2 100644 --- a/bsp/stm32/stm32f405-smdz-breadfruit/.config +++ b/bsp/stm32/stm32f405-smdz-breadfruit/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f405-smdz-breadfruit/rtconfig.h b/bsp/stm32/stm32f405-smdz-breadfruit/rtconfig.h index 1129acefb6..0e41735873 100644 --- a/bsp/stm32/stm32f405-smdz-breadfruit/rtconfig.h +++ b/bsp/stm32/stm32f405-smdz-breadfruit/rtconfig.h @@ -21,6 +21,7 @@ #define IDLE_THREAD_STACK_SIZE 256 /* RT_USING_TIMER_SOFT is not set */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* RT_DEBUG_INIT_CONFIG is not set */ /* RT_DEBUG_THREAD_CONFIG is not set */ /* RT_DEBUG_SCHEDULER_CONFIG is not set */ diff --git a/bsp/stm32/stm32f407-atk-explorer/.config b/bsp/stm32/stm32f407-atk-explorer/.config index 177d468704..52b162451a 100644 --- a/bsp/stm32/stm32f407-atk-explorer/.config +++ b/bsp/stm32/stm32f407-atk-explorer/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c index 3026357b5c..625cec463d 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c @@ -16,10 +16,7 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "app.card" -#define DBG_COLOR - #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f407-atk-explorer/rtconfig.h b/bsp/stm32/stm32f407-atk-explorer/rtconfig.h index d35ad8f997..ce6e3b4c2c 100644 --- a/bsp/stm32/stm32f407-atk-explorer/rtconfig.h +++ b/bsp/stm32/stm32f407-atk-explorer/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f407-st-discovery/.config b/bsp/stm32/stm32f407-st-discovery/.config index 855a959166..456c95097d 100644 --- a/bsp/stm32/stm32f407-st-discovery/.config +++ b/bsp/stm32/stm32f407-st-discovery/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f407-st-discovery/rtconfig.h b/bsp/stm32/stm32f407-st-discovery/rtconfig.h index 41e6ddedbd..c25a065336 100644 --- a/bsp/stm32/stm32f407-st-discovery/rtconfig.h +++ b/bsp/stm32/stm32f407-st-discovery/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f411-st-nucleo/.config b/bsp/stm32/stm32f411-st-nucleo/.config index ca166c9644..ba35dd2786 100644 --- a/bsp/stm32/stm32f411-st-nucleo/.config +++ b/bsp/stm32/stm32f411-st-nucleo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f411-st-nucleo/rtconfig.h b/bsp/stm32/stm32f411-st-nucleo/rtconfig.h index 94d5708a91..4c8e05dd2e 100644 --- a/bsp/stm32/stm32f411-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32f411-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f429-armfly-v6/.config b/bsp/stm32/stm32f429-armfly-v6/.config index 3169a6cb0f..5864f2d8c2 100644 --- a/bsp/stm32/stm32f429-armfly-v6/.config +++ b/bsp/stm32/stm32f429-armfly-v6/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c index 617379fd4e..0eb7035ddf 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c @@ -16,10 +16,7 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "app.card" -#define DBG_COLOR - #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f429-armfly-v6/rtconfig.h b/bsp/stm32/stm32f429-armfly-v6/rtconfig.h index 7d6c12513e..f396b058ea 100644 --- a/bsp/stm32/stm32f429-armfly-v6/rtconfig.h +++ b/bsp/stm32/stm32f429-armfly-v6/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f429-atk-apollo/.config b/bsp/stm32/stm32f429-atk-apollo/.config index 90c7572d90..71b42e506b 100644 --- a/bsp/stm32/stm32f429-atk-apollo/.config +++ b/bsp/stm32/stm32f429-atk-apollo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c index 3026357b5c..625cec463d 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c @@ -16,10 +16,7 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "app.card" -#define DBG_COLOR - #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f429-atk-apollo/rtconfig.h b/bsp/stm32/stm32f429-atk-apollo/rtconfig.h index bcf153da33..21f47999d0 100644 --- a/bsp/stm32/stm32f429-atk-apollo/rtconfig.h +++ b/bsp/stm32/stm32f429-atk-apollo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f429-fire-challenger/.config b/bsp/stm32/stm32f429-fire-challenger/.config index ddd5f2950f..55d2ccfb56 100644 --- a/bsp/stm32/stm32f429-fire-challenger/.config +++ b/bsp/stm32/stm32f429-fire-challenger/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c index 0a84162150..c7200001e3 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c @@ -17,10 +17,7 @@ #include #include "drv_gpio.h" -#define DBG_ENABLE #define DBG_SECTION_NAME "app.card" -#define DBG_COLOR - #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f429-fire-challenger/rtconfig.h b/bsp/stm32/stm32f429-fire-challenger/rtconfig.h index 7e366cf856..f411466331 100644 --- a/bsp/stm32/stm32f429-fire-challenger/rtconfig.h +++ b/bsp/stm32/stm32f429-fire-challenger/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f446-st-nucleo/.config b/bsp/stm32/stm32f446-st-nucleo/.config index 1e648651f4..916cefa8d2 100644 --- a/bsp/stm32/stm32f446-st-nucleo/.config +++ b/bsp/stm32/stm32f446-st-nucleo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f446-st-nucleo/rtconfig.h b/bsp/stm32/stm32f446-st-nucleo/rtconfig.h index 6f058fe597..b32a8e953d 100644 --- a/bsp/stm32/stm32f446-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32f446-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f746-st-disco/.config b/bsp/stm32/stm32f746-st-disco/.config index 1f7a54ed9f..b0cc2489cf 100644 --- a/bsp/stm32/stm32f746-st-disco/.config +++ b/bsp/stm32/stm32f746-st-disco/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c b/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c index 90cfd4d1a4..143576eb12 100644 --- a/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c @@ -16,10 +16,7 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "app.card" -#define DBG_COLOR - #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f746-st-disco/rtconfig.h b/bsp/stm32/stm32f746-st-disco/rtconfig.h index cdea6fd74f..d7084fdc3a 100644 --- a/bsp/stm32/stm32f746-st-disco/rtconfig.h +++ b/bsp/stm32/stm32f746-st-disco/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f767-atk-apollo/.config b/bsp/stm32/stm32f767-atk-apollo/.config index 46bbff3a82..18940f0bd4 100644 --- a/bsp/stm32/stm32f767-atk-apollo/.config +++ b/bsp/stm32/stm32f767-atk-apollo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c b/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c index 3026357b5c..625cec463d 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c @@ -16,10 +16,7 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "app.card" -#define DBG_COLOR - #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f767-atk-apollo/rtconfig.h b/bsp/stm32/stm32f767-atk-apollo/rtconfig.h index 23599ade59..40b4703fd7 100644 --- a/bsp/stm32/stm32f767-atk-apollo/rtconfig.h +++ b/bsp/stm32/stm32f767-atk-apollo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f767-fire-challenger/.config b/bsp/stm32/stm32f767-fire-challenger/.config index ef2f4a0c70..4f6f6f6468 100644 --- a/bsp/stm32/stm32f767-fire-challenger/.config +++ b/bsp/stm32/stm32f767-fire-challenger/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c b/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c index 035d3357d1..b8db33d0d2 100644 --- a/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c @@ -17,10 +17,8 @@ #include #include "drv_gpio.h" -// #define DBG_ENABLE -#define DBG_SECTION_NAME "app.card" -#define DBG_COLOR +#define DBG_SECTION_NAME "app.card" #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32f767-fire-challenger/rtconfig.h b/bsp/stm32/stm32f767-fire-challenger/rtconfig.h index 16f05af945..405e99cef1 100644 --- a/bsp/stm32/stm32f767-fire-challenger/rtconfig.h +++ b/bsp/stm32/stm32f767-fire-challenger/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32f767-st-nucleo/rtconfig.h b/bsp/stm32/stm32f767-st-nucleo/rtconfig.h index 44fac63085..949da7906c 100644 --- a/bsp/stm32/stm32f767-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32f767-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32g071-st-nucleo/.config b/bsp/stm32/stm32g071-st-nucleo/.config index 1e6c3689a0..4bea393c68 100644 --- a/bsp/stm32/stm32g071-st-nucleo/.config +++ b/bsp/stm32/stm32g071-st-nucleo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32g071-st-nucleo/rtconfig.h b/bsp/stm32/stm32g071-st-nucleo/rtconfig.h index 1a407f8e83..aa14175609 100644 --- a/bsp/stm32/stm32g071-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32g071-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32l053-st-nucleo/.config b/bsp/stm32/stm32l053-st-nucleo/.config index 40e3129afa..be3b800004 100644 --- a/bsp/stm32/stm32l053-st-nucleo/.config +++ b/bsp/stm32/stm32l053-st-nucleo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32l053-st-nucleo/rtconfig.h b/bsp/stm32/stm32l053-st-nucleo/rtconfig.h index 89f211e824..7f3a0e5416 100644 --- a/bsp/stm32/stm32l053-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32l053-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32l432-st-nucleo/.config b/bsp/stm32/stm32l432-st-nucleo/.config index 7b2e09bad1..43dd91cc60 100644 --- a/bsp/stm32/stm32l432-st-nucleo/.config +++ b/bsp/stm32/stm32l432-st-nucleo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32l432-st-nucleo/rtconfig.h b/bsp/stm32/stm32l432-st-nucleo/rtconfig.h index 2aa2734e2b..58c4cba2fe 100644 --- a/bsp/stm32/stm32l432-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32l432-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32l475-atk-pandora/.config b/bsp/stm32/stm32l475-atk-pandora/.config index 630083f09c..06d83718ce 100644 --- a/bsp/stm32/stm32l475-atk-pandora/.config +++ b/bsp/stm32/stm32l475-atk-pandora/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c index 9d40589756..11c66f34b7 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c @@ -18,10 +18,8 @@ #include "drv_spi.h" #include "spi_msd.h" -#define DBG_ENABLE -#define DBG_SECTION_NAME "app.card" -#define DBG_COLOR +#define DBG_SECTION_NAME "app.card" #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32l475-atk-pandora/rtconfig.h b/bsp/stm32/stm32l475-atk-pandora/rtconfig.h index f138878738..d0c5e24f0e 100644 --- a/bsp/stm32/stm32l475-atk-pandora/rtconfig.h +++ b/bsp/stm32/stm32l475-atk-pandora/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32l476-st-nucleo/.config b/bsp/stm32/stm32l476-st-nucleo/.config index 427cb9a3a7..0731ce4782 100644 --- a/bsp/stm32/stm32l476-st-nucleo/.config +++ b/bsp/stm32/stm32l476-st-nucleo/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32l476-st-nucleo/rtconfig.h b/bsp/stm32/stm32l476-st-nucleo/rtconfig.h index ac2fd6a542..afeaf369c0 100644 --- a/bsp/stm32/stm32l476-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32l476-st-nucleo/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32/stm32l496-ali-developer/.config b/bsp/stm32/stm32l496-ali-developer/.config index 53adaf801c..0324c80f42 100644 --- a/bsp/stm32/stm32l496-ali-developer/.config +++ b/bsp/stm32/stm32l496-ali-developer/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c b/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c index 2ffcef8fda..54b5af7ed6 100644 --- a/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c @@ -16,10 +16,8 @@ #include #include -#define DBG_ENABLE -#define DBG_SECTION_NAME "app.card" -#define DBG_COLOR +#define DBG_SECTION_NAME "app.card" #define DBG_LEVEL DBG_INFO #include diff --git a/bsp/stm32/stm32l496-ali-developer/rtconfig.h b/bsp/stm32/stm32l496-ali-developer/rtconfig.h index 05e86e250b..d6ce5027bc 100644 --- a/bsp/stm32/stm32l496-ali-developer/rtconfig.h +++ b/bsp/stm32/stm32l496-ali-developer/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32f0x/rtconfig.h b/bsp/stm32f0x/rtconfig.h index 0a71690b53..6a7aeb1fdf 100644 --- a/bsp/stm32f0x/rtconfig.h +++ b/bsp/stm32f0x/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_DEBUG_INIT 1 #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/stm32f107/.config b/bsp/stm32f107/.config index b8e5092cf1..616acba058 100644 --- a/bsp/stm32f107/.config +++ b/bsp/stm32f107/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32f107/rtconfig.h b/bsp/stm32f107/rtconfig.h index b05fca7ed4..e7e9c9e5ea 100644 --- a/bsp/stm32f107/rtconfig.h +++ b/bsp/stm32f107/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32f10x-HAL/.config b/bsp/stm32f10x-HAL/.config index 39706cd496..8c6e8d4a8f 100644 --- a/bsp/stm32f10x-HAL/.config +++ b/bsp/stm32f10x-HAL/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/stm32f10x-HAL/rtconfig.h b/bsp/stm32f10x-HAL/rtconfig.h index 84514b603c..1eb6845129 100644 --- a/bsp/stm32f10x-HAL/rtconfig.h +++ b/bsp/stm32f10x-HAL/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/stm32f10x/.config b/bsp/stm32f10x/.config index 7b1a9477ab..35ebac08b4 100644 --- a/bsp/stm32f10x/.config +++ b/bsp/stm32f10x/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/stm32f10x/rtconfig.h b/bsp/stm32f10x/rtconfig.h index e1d38b4667..ea1542aea2 100644 --- a/bsp/stm32f10x/rtconfig.h +++ b/bsp/stm32f10x/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/stm32f20x/.config b/bsp/stm32f20x/.config index d7b8a922cc..3e08e1f717 100644 --- a/bsp/stm32f20x/.config +++ b/bsp/stm32f20x/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/stm32f20x/rtconfig.h b/bsp/stm32f20x/rtconfig.h index 04df5cb236..e976eac230 100644 --- a/bsp/stm32f20x/rtconfig.h +++ b/bsp/stm32f20x/rtconfig.h @@ -12,6 +12,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/stm32f40x/.config b/bsp/stm32f40x/.config index a6a47ac6f3..e6a7bd72cb 100644 --- a/bsp/stm32f40x/.config +++ b/bsp/stm32f40x/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32f40x/rtconfig.h b/bsp/stm32f40x/rtconfig.h index c855f42fad..1c7a4076f6 100644 --- a/bsp/stm32f40x/rtconfig.h +++ b/bsp/stm32f40x/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32f429-apollo/.config b/bsp/stm32f429-apollo/.config index 604b56e5b2..459d9c92a3 100644 --- a/bsp/stm32f429-apollo/.config +++ b/bsp/stm32f429-apollo/.config @@ -20,6 +20,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32f429-apollo/drivers/audio/drv_mic.c b/bsp/stm32f429-apollo/drivers/audio/drv_mic.c index 873f37e9b7..3dab97c60a 100644 --- a/bsp/stm32f429-apollo/drivers/audio/drv_mic.c +++ b/bsp/stm32f429-apollo/drivers/audio/drv_mic.c @@ -18,9 +18,7 @@ #include "drv_wm8978.h" #include -#define DBG_ENABLE #define DBG_LEVEL DBG_INFO -#define DBG_COLOR #define DBG_SECTION_NAME "MIC" #include diff --git a/bsp/stm32f429-apollo/drivers/audio/drv_sound.c b/bsp/stm32f429-apollo/drivers/audio/drv_sound.c index 43bbadf412..5bebc01470 100644 --- a/bsp/stm32f429-apollo/drivers/audio/drv_sound.c +++ b/bsp/stm32f429-apollo/drivers/audio/drv_sound.c @@ -19,9 +19,7 @@ #include "drv_wm8978.h" #include -#define DBG_ENABLE #define DBG_LEVEL DBG_LOG -#define DBG_COLOR #define DBG_SECTION_NAME "Sound" #include diff --git a/bsp/stm32f429-apollo/rtconfig.h b/bsp/stm32f429-apollo/rtconfig.h index 9c28c2c959..439bf623aa 100644 --- a/bsp/stm32f429-apollo/rtconfig.h +++ b/bsp/stm32f429-apollo/rtconfig.h @@ -18,6 +18,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32f429-disco/.config b/bsp/stm32f429-disco/.config index 1a51abcea1..07c1d6a272 100644 --- a/bsp/stm32f429-disco/.config +++ b/bsp/stm32f429-disco/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32f429-disco/rtconfig.h b/bsp/stm32f429-disco/rtconfig.h index 91dd49c872..9175876eeb 100644 --- a/bsp/stm32f429-disco/rtconfig.h +++ b/bsp/stm32f429-disco/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/stm32f4xx-HAL/.config b/bsp/stm32f4xx-HAL/.config index 210efe60dc..50d617be17 100644 --- a/bsp/stm32f4xx-HAL/.config +++ b/bsp/stm32f4xx-HAL/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/stm32f4xx-HAL/rtconfig.h b/bsp/stm32f4xx-HAL/rtconfig.h index e490ee1f31..0c5877724d 100644 --- a/bsp/stm32f4xx-HAL/rtconfig.h +++ b/bsp/stm32f4xx-HAL/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/stm32f7-disco/.config b/bsp/stm32f7-disco/.config index 9cdfcfa368..2d9db8e75d 100644 --- a/bsp/stm32f7-disco/.config +++ b/bsp/stm32f7-disco/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/stm32f7-disco/rtconfig.h b/bsp/stm32f7-disco/rtconfig.h index 5d0a04aad7..98eb060314 100644 --- a/bsp/stm32f7-disco/rtconfig.h +++ b/bsp/stm32f7-disco/rtconfig.h @@ -12,6 +12,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/stm32h743-nucleo/.config b/bsp/stm32h743-nucleo/.config index 1576a11eff..30867d5aab 100644 --- a/bsp/stm32h743-nucleo/.config +++ b/bsp/stm32h743-nucleo/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32h743-nucleo/rtconfig.h b/bsp/stm32h743-nucleo/rtconfig.h index 7f092e5fa7..4e9e91ff6d 100644 --- a/bsp/stm32h743-nucleo/rtconfig.h +++ b/bsp/stm32h743-nucleo/rtconfig.h @@ -19,6 +19,7 @@ #define IDLE_THREAD_STACK_SIZE 256 /* RT_USING_TIMER_SOFT is not set */ #define RT_DEBUG +#define RT_DEBUG_COLOR /* RT_DEBUG_INIT_CONFIG is not set */ /* RT_DEBUG_THREAD_CONFIG is not set */ /* RT_DEBUG_SCHEDULER_CONFIG is not set */ diff --git a/bsp/stm32l475-iot-disco/rtconfig.h b/bsp/stm32l475-iot-disco/rtconfig.h index f7b00767d2..4cc0d9da9a 100644 --- a/bsp/stm32l475-iot-disco/rtconfig.h +++ b/bsp/stm32l475-iot-disco/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK /* Using Hook */ diff --git a/bsp/stm32l476-nucleo/.config b/bsp/stm32l476-nucleo/.config index 529d8c5fb0..943036d2f2 100644 --- a/bsp/stm32l476-nucleo/.config +++ b/bsp/stm32l476-nucleo/.config @@ -19,6 +19,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/stm32l476-nucleo/rtconfig.h b/bsp/stm32l476-nucleo/rtconfig.h index d1e5fd2e41..a18d036962 100644 --- a/bsp/stm32l476-nucleo/rtconfig.h +++ b/bsp/stm32l476-nucleo/rtconfig.h @@ -16,6 +16,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/swm320-lq100/.config b/bsp/swm320-lq100/.config index 4eb8c0a38e..6e380259b4 100644 --- a/bsp/swm320-lq100/.config +++ b/bsp/swm320-lq100/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/swm320-lq100/rtconfig.h b/bsp/swm320-lq100/rtconfig.h index 13645d862c..f62b9f87e9 100644 --- a/bsp/swm320-lq100/rtconfig.h +++ b/bsp/swm320-lq100/rtconfig.h @@ -17,6 +17,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/synopsys/emsk_em9d/.config b/bsp/synopsys/emsk_em9d/.config index 55759f136a..4e5baa1877 100644 --- a/bsp/synopsys/emsk_em9d/.config +++ b/bsp/synopsys/emsk_em9d/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/synopsys/emsk_em9d/rtconfig.h b/bsp/synopsys/emsk_em9d/rtconfig.h index 865e753ae5..d2fab1109a 100644 --- a/bsp/synopsys/emsk_em9d/rtconfig.h +++ b/bsp/synopsys/emsk_em9d/rtconfig.h @@ -20,6 +20,7 @@ #define IDLE_THREAD_STACK_SIZE 512 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/bsp/tm4c129x/.config b/bsp/tm4c129x/.config index d12272fbf8..1c373715d4 100644 --- a/bsp/tm4c129x/.config +++ b/bsp/tm4c129x/.config @@ -23,6 +23,7 @@ CONFIG_RT_USING_TIMER_SOFT=y CONFIG_RT_TIMER_THREAD_PRIO=4 CONFIG_RT_TIMER_THREAD_STACK_SIZE=512 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/tm4c129x/rtconfig.h b/bsp/tm4c129x/rtconfig.h index f6eef5ad5f..6a7a5c804f 100644 --- a/bsp/tm4c129x/rtconfig.h +++ b/bsp/tm4c129x/rtconfig.h @@ -20,6 +20,7 @@ #define RT_TIMER_THREAD_PRIO 4 #define RT_TIMER_THREAD_STACK_SIZE 512 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/tms320f28379d/.config b/bsp/tms320f28379d/.config index d62b1e40c8..4d68f71848 100644 --- a/bsp/tms320f28379d/.config +++ b/bsp/tms320f28379d/.config @@ -21,6 +21,7 @@ CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=256 # CONFIG_RT_USING_TIMER_SOFT is not set CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y # CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_THREAD_CONFIG is not set # CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set diff --git a/bsp/tms320f28379d/rtconfig.h b/bsp/tms320f28379d/rtconfig.h index b037295813..139789a5b2 100644 --- a/bsp/tms320f28379d/rtconfig.h +++ b/bsp/tms320f28379d/rtconfig.h @@ -19,6 +19,7 @@ #define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 256 #define RT_DEBUG +#define RT_DEBUG_COLOR /* Inter-Thread communication */ diff --git a/bsp/upd70f3454/rtconfig.h b/bsp/upd70f3454/rtconfig.h index 37188b43c8..894bc5beff 100644 --- a/bsp/upd70f3454/rtconfig.h +++ b/bsp/upd70f3454/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR ///#define SCHEDULER_DEBUG #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/x1000/.config b/bsp/x1000/.config index 9ac579ccd9..9a5600a15e 100644 --- a/bsp/x1000/.config +++ b/bsp/x1000/.config @@ -14,6 +14,7 @@ CONFIG_RT_THREAD_PRIORITY_32=y CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=1000 CONFIG_RT_DEBUG=y +CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_USING_OVERFLOW_CHECK=y CONFIG_RT_DEBUG_INIT=0 CONFIG_RT_DEBUG_THREAD=0 diff --git a/bsp/x1000/drivers/mmc/drv_mmc.c b/bsp/x1000/drivers/mmc/drv_mmc.c index c2fa538fbc..d2b0016f4b 100644 --- a/bsp/x1000/drivers/mmc/drv_mmc.c +++ b/bsp/x1000/drivers/mmc/drv_mmc.c @@ -33,12 +33,8 @@ #define DMA_ALIGN (32U) #define PIO_THRESHOLD 64 /* use pio mode if data length < PIO_THRESHOLD */ -#define DEBUG_ENABLE -#define DEBUG_SECTION_NAME "SDIO" -#define DEBUG_LEVEL DBG_INFO -// #define DEBUG_LEVEL DBG_LOG -#define DEBUG_COLOR - +#define DBG_SECTION_NAME "SDIO" +#define DBG_LEVEL DBG_INFO #include /* diff --git a/bsp/x1000/rtconfig.h b/bsp/x1000/rtconfig.h index 6babbd0b15..e7c3e5feda 100644 --- a/bsp/x1000/rtconfig.h +++ b/bsp/x1000/rtconfig.h @@ -14,6 +14,7 @@ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 1000 #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_USING_OVERFLOW_CHECK #define RT_DEBUG_INIT 0 #define RT_DEBUG_THREAD 0 diff --git a/bsp/x86/rtconfig.h b/bsp/x86/rtconfig.h index 2878f811d0..c4cdac1fdc 100644 --- a/bsp/x86/rtconfig.h +++ b/bsp/x86/rtconfig.h @@ -17,6 +17,7 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG +#define RT_DEBUG_COLOR #define RT_DEBUG_MODULE 0 #define RT_USING_OVERFLOW_CHECK diff --git a/bsp/xplorer4330/M0/rtconfig.h b/bsp/xplorer4330/M0/rtconfig.h index ee849028f2..19c70eb642 100644 --- a/bsp/xplorer4330/M0/rtconfig.h +++ b/bsp/xplorer4330/M0/rtconfig.h @@ -22,6 +22,7 @@ //#define RT_USING_MODULE //
#define RT_DEBUG +#define RT_DEBUG_COLOR // #define RT_DEBUG_INIT 0 // diff --git a/bsp/xplorer4330/M4/rtconfig.h b/bsp/xplorer4330/M4/rtconfig.h index ee849028f2..19c70eb642 100644 --- a/bsp/xplorer4330/M4/rtconfig.h +++ b/bsp/xplorer4330/M4/rtconfig.h @@ -22,6 +22,7 @@ //#define RT_USING_MODULE //
#define RT_DEBUG +#define RT_DEBUG_COLOR // #define RT_DEBUG_INIT 0 // diff --git a/bsp/zynq7000/rtconfig.h b/bsp/zynq7000/rtconfig.h index ca304c6ac9..b09fc1ab26 100644 --- a/bsp/zynq7000/rtconfig.h +++ b/bsp/zynq7000/rtconfig.h @@ -20,6 +20,7 @@ #define IDLE_THREAD_STACK_SIZE 512 //
#define RT_DEBUG +#define RT_DEBUG_COLOR // // #define RT_THREAD_DEBUG // diff --git a/components/dfs/include/dfs_private.h b/components/dfs/include/dfs_private.h index e20680d9df..bfc71b3b35 100644 --- a/components/dfs/include/dfs_private.h +++ b/components/dfs/include/dfs_private.h @@ -12,10 +12,8 @@ #include -// #define DBG_ENABLE #define DBG_SECTION_NAME "DFS" -#define DBG_COLOR -#define DBG_LEVEL DBG_LOG +#define DBG_LEVEL DBG_INFO #include #define NO_WORKING_DIR "system does not support working directory\n" diff --git a/components/drivers/misc/adc.c b/components/drivers/misc/adc.c index 83e789a6e4..b2fd9ba430 100644 --- a/components/drivers/misc/adc.c +++ b/components/drivers/misc/adc.c @@ -15,10 +15,8 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "adc" #define DBG_LEVEL DBG_INFO -#define DBG_COLOR #include static rt_size_t _adc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index 23be319fc6..dcfbc0ca7b 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -13,14 +13,12 @@ #include -#define DBG_ENABLE #define DBG_SECTION_NAME "SDIO" #ifdef RT_SDIO_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif /* RT_SDIO_DEBUG */ -#define DBG_COLOR #include static rt_list_t blk_devices = RT_LIST_OBJECT_INIT(blk_devices); @@ -369,7 +367,7 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) return err; } - LOG_I("probe mmcsd block device!"); + LOG_D("probe mmcsd block device!"); /* get the first sector to read partition table */ sector = (rt_uint8_t *)rt_malloc(SECTOR_SIZE); diff --git a/components/drivers/sdio/mmc.c b/components/drivers/sdio/mmc.c index bbf0ff838c..5f9259ef52 100644 --- a/components/drivers/sdio/mmc.c +++ b/components/drivers/sdio/mmc.c @@ -11,14 +11,12 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "SDIO" #ifdef RT_SDIO_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif /* RT_SDIO_DEBUG */ -#define DBG_COLOR #include static const rt_uint32_t tran_unit[] = diff --git a/components/drivers/sdio/mmcsd_core.c b/components/drivers/sdio/mmcsd_core.c index 2206960a69..160defa645 100644 --- a/components/drivers/sdio/mmcsd_core.c +++ b/components/drivers/sdio/mmcsd_core.c @@ -14,14 +14,12 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "SDIO" #ifdef RT_SDIO_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif /* RT_SDIO_DEBUG */ -#define DBG_COLOR #include #ifndef RT_MMCSD_STACK_SIZE diff --git a/components/drivers/sdio/sd.c b/components/drivers/sdio/sd.c index 69a4561fb0..f4e925507c 100644 --- a/components/drivers/sdio/sd.c +++ b/components/drivers/sdio/sd.c @@ -11,14 +11,12 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "SDIO" #ifdef RT_SDIO_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif /* RT_SDIO_DEBUG */ -#define DBG_COLOR #include static const rt_uint32_t tran_unit[] = diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c index 6045c4ade8..b0516704fd 100644 --- a/components/drivers/sdio/sdio.c +++ b/components/drivers/sdio/sdio.c @@ -12,14 +12,12 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "SDIO" #ifdef RT_SDIO_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif /* RT_SDIO_DEBUG */ -#define DBG_COLOR #include #ifndef RT_SDIO_STACK_SIZE diff --git a/components/drivers/sensors/sensor.c b/components/drivers/sensors/sensor.c index 0c21f04b6f..99f366ddac 100644 --- a/components/drivers/sensors/sensor.c +++ b/components/drivers/sensors/sensor.c @@ -10,10 +10,8 @@ #include "sensor.h" -#define DBG_ENABLE #define DBG_LEVEL DBG_INFO #define DBG_SECTION_NAME "sensor" -#define DBG_COLOR #include #include diff --git a/components/drivers/sensors/sensor_cmd.c b/components/drivers/sensors/sensor_cmd.c index b6dd471988..07487c8866 100644 --- a/components/drivers/sensors/sensor_cmd.c +++ b/components/drivers/sensors/sensor_cmd.c @@ -10,10 +10,8 @@ #include "sensor.h" -#define DBG_ENABLE #define DBG_LEVEL DBG_INFO #define DBG_SECTION_NAME "sensor.cmd" -#define DBG_COLOR #include #include diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 094c403656..13bf54e721 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -28,10 +28,8 @@ #include #include -// #define DEBUG_ENABLE -#define DEBUG_LEVEL DBG_LOG +#define DBG_LEVEL DBG_INFO #define DBG_SECTION_NAME "UART" -#define DEBUG_COLOR #include #ifdef RT_USING_POSIX diff --git a/components/drivers/wlan/wlan_cfg.c b/components/drivers/wlan/wlan_cfg.c index 27da9bc24e..00e9dbc83e 100644 --- a/components/drivers/wlan/wlan_cfg.c +++ b/components/drivers/wlan/wlan_cfg.c @@ -11,14 +11,12 @@ #include #include -#define DBG_ENABLE #ifdef RT_WLAN_CFG_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif #define DBG_SECTION_NAME "WLAN.cfg" -#define DBG_COLOR #include #define WLAN_CFG_LOCK() (rt_mutex_take(&cfg_mutex, RT_WAITING_FOREVER)) diff --git a/components/drivers/wlan/wlan_dev.c b/components/drivers/wlan/wlan_dev.c index eac1d0f975..3f4adf35ad 100644 --- a/components/drivers/wlan/wlan_dev.c +++ b/components/drivers/wlan/wlan_dev.c @@ -13,14 +13,12 @@ #include #include -#define DBG_ENABLE #ifdef RT_WLAN_DEV_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif #define DBG_SECTION_NAME "WLAN.dev" -#define DBG_COLOR #include #ifndef RT_DEVICE diff --git a/components/drivers/wlan/wlan_lwip.c b/components/drivers/wlan/wlan_lwip.c index 2f8bcefd0d..052c2afd2e 100644 --- a/components/drivers/wlan/wlan_lwip.c +++ b/components/drivers/wlan/wlan_lwip.c @@ -21,14 +21,12 @@ #include #endif -#define DBG_ENABLE #ifdef RT_WLAN_LWIP_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif #define DBG_SECTION_NAME "WLAN.lwip" -#define DBG_COLOR #include #ifndef IPADDR_STRLEN_MAX diff --git a/components/drivers/wlan/wlan_mgnt.c b/components/drivers/wlan/wlan_mgnt.c index ac0731d06c..ced5bfa1c2 100644 --- a/components/drivers/wlan/wlan_mgnt.c +++ b/components/drivers/wlan/wlan_mgnt.c @@ -16,14 +16,13 @@ #include #include -#define DBG_ENABLE + #ifdef RT_WLAN_MGNT_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif #define DBG_SECTION_NAME "WLAN.mgnt" -#define DBG_COLOR #include #ifndef RT_WLAN_DEVICE diff --git a/components/drivers/wlan/wlan_prot.c b/components/drivers/wlan/wlan_prot.c index ec5e419bc4..48adbc48f3 100644 --- a/components/drivers/wlan/wlan_prot.c +++ b/components/drivers/wlan/wlan_prot.c @@ -13,14 +13,12 @@ #include #include -#define DBG_ENABLE #ifdef RT_WLAN_PROT_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif #define DBG_SECTION_NAME "WLAN.prot" -#define DBG_COLOR #include #if RT_WLAN_PROT_NAME_LEN < 4 diff --git a/components/drivers/wlan/wlan_workqueue.c b/components/drivers/wlan/wlan_workqueue.c index f65ac95d08..23823afae0 100644 --- a/components/drivers/wlan/wlan_workqueue.c +++ b/components/drivers/wlan/wlan_workqueue.c @@ -13,10 +13,8 @@ #include #include -#define DBG_ENABLE #define DBG_LEVEL DBG_INFO #define DBG_SECTION_NAME "WLAN.work" -#define DBG_COLOR #include struct rt_wlan_work diff --git a/components/libc/libdl/dlelf.c b/components/libc/libdl/dlelf.c index 6d83424b80..4557ee3458 100644 --- a/components/libc/libdl/dlelf.c +++ b/components/libc/libdl/dlelf.c @@ -12,9 +12,7 @@ #include "dlelf.h" #define DBG_SECTION_NAME "DLMD" -#define DBG_ENABLE // enable debug macro #define DBG_LEVEL DBG_INFO -#define DBG_COLOR #include // must after of DEBUG_ENABLE or some other options rt_err_t dlmodule_load_shared_object(struct rt_dlmodule* module, void *module_ptr) diff --git a/components/libc/libdl/dlmodule.c b/components/libc/libdl/dlmodule.c index 61ffbfc772..0029c01728 100644 --- a/components/libc/libdl/dlmodule.c +++ b/components/libc/libdl/dlmodule.c @@ -17,9 +17,7 @@ #include #define DBG_SECTION_NAME "DLMD" -#define DBG_ENABLE // enable debug macro #define DBG_LEVEL DBG_INFO -#define DBG_COLOR #include // must after of DEBUG_ENABLE or some other options static struct rt_module_symtab *_rt_module_symtab_begin = RT_NULL; diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index 84d6515ac6..e1ba26f21c 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -19,9 +19,7 @@ #include "lwp.h" -#define DBG_ENABLE #define DBG_SECTION_NAME "LWP" -#define DBG_COLOR #define DBG_LEVEL DBG_WARNING #include diff --git a/components/lwp/lwp_mem.c b/components/lwp/lwp_mem.c index ebc878494a..e733166934 100644 --- a/components/lwp/lwp_mem.c +++ b/components/lwp/lwp_mem.c @@ -11,9 +11,7 @@ #include #include -#define DBG_ENABLE #define DBG_SECTION_NAME "LWPMEM" -#define DBG_COLOR #define DBG_LEVEL DBG_WARNING #include diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index 5d4bbf6d91..723786f1cd 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -24,9 +24,7 @@ #define SYSCALL_NET(f) ((void*)sys_notimpl) #endif -#define DBG_ENABLE #define DBG_SECTION_NAME "LWP_CALL" -#define DBG_COLOR #define DBG_LEVEL DBG_WARNING #include diff --git a/components/net/at/include/at_log.h b/components/net/at/include/at_log.h index 278763d30e..fe8766ba95 100644 --- a/components/net/at/include/at_log.h +++ b/components/net/at/include/at_log.h @@ -12,9 +12,6 @@ * NOTE: DO NOT include this file on the header file. */ -#define DBG_ENABLE -#define DBG_COLOR - #ifndef LOG_TAG #define DBG_SECTION_NAME "at" #else diff --git a/components/net/sal_socket/src/sal_socket.c b/components/net/sal_socket/src/sal_socket.c index dba8e66254..771a56f061 100644 --- a/components/net/sal_socket/src/sal_socket.c +++ b/components/net/sal_socket/src/sal_socket.c @@ -19,10 +19,8 @@ #endif #include -#define DBG_ENABLE -#define DBG_SECTION_NAME "SAL_SOC" +#define DBG_SECTION_NAME "SAL_SKT" #define DBG_LEVEL DBG_INFO -#define DBG_COLOR #include #define SOCKET_TABLE_STEP_LEN 4 diff --git a/components/utilities/Kconfig b/components/utilities/Kconfig index 1175006a58..504a56691d 100644 --- a/components/utilities/Kconfig +++ b/components/utilities/Kconfig @@ -222,12 +222,6 @@ config RT_USING_ULOG select ULOG_OUTPUT_TIME select ULOG_USING_FILTER default n - - config ULOG_SW_VERSION_NUM - hex - default 0x00101 - help - sfotware module version number endif config RT_USING_UTEST diff --git a/components/utilities/ulog/ulog_def.h b/components/utilities/ulog/ulog_def.h index e7c033f71c..40b39de972 100644 --- a/components/utilities/ulog/ulog_def.h +++ b/components/utilities/ulog/ulog_def.h @@ -47,7 +47,7 @@ extern "C" { #define DBG_INFO LOG_LVL_INFO #define DBG_LOG LOG_LVL_DBG #define dbg_log(level, ...) \ - if ((level) <= DBG_LEVEL) \ + if ((level) <= LOG_LVL) \ { \ ulog_output(level, LOG_TAG, RT_FALSE, __VA_ARGS__);\ } diff --git a/components/utilities/utest/utest.c b/components/utilities/utest/utest.c index f7348b3be4..7bc2c93656 100644 --- a/components/utilities/utest/utest.c +++ b/components/utilities/utest/utest.c @@ -17,17 +17,13 @@ #undef DBG_SECTION_NAME #undef DBG_LEVEL -#undef DBG_COLOR -#undef DBG_ENABLE -#define DBG_ENABLE #define DBG_SECTION_NAME "utest" #ifdef UTEST_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif -#define DBG_COLOR #include #if RT_CONSOLEBUF_SIZE < 256 diff --git a/components/utilities/utest/utest_log.h b/components/utilities/utest/utest_log.h index 9f38d3f9c8..c4bd25a80b 100644 --- a/components/utilities/utest/utest_log.h +++ b/components/utilities/utest/utest_log.h @@ -17,17 +17,13 @@ #undef DBG_SECTION_NAME #undef DBG_LEVEL -#undef DBG_COLOR -#undef DBG_ENABLE -#define DBG_ENABLE #define DBG_SECTION_NAME "testcase" #ifdef UTEST_DEBUG #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO #endif -#define DBG_COLOR #include #define UTEST_LOG_ALL (1u) diff --git a/examples/network/tcpclient.c b/examples/network/tcpclient.c index d4c96f893a..be50711e94 100644 --- a/examples/network/tcpclient.c +++ b/examples/network/tcpclient.c @@ -12,14 +12,12 @@ #define DEBUG_TCP_CLIENT -#define DBG_ENABLE #define DBG_SECTION_NAME "TCP" #ifdef DEBUG_TCP_CLIENT #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO /* DBG_ERROR */ #endif -#define DBG_COLOR #include #define BUFSZ 1024 diff --git a/examples/network/tcpserver.c b/examples/network/tcpserver.c index 264b6f7c83..0837495366 100644 --- a/examples/network/tcpserver.c +++ b/examples/network/tcpserver.c @@ -12,14 +12,12 @@ #define DEBUG_TCP_SERVER -#define DBG_ENABLE #define DBG_SECTION_NAME "TCP" #ifdef DEBUG_TCP_SERVER #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO /* DBG_ERROR */ #endif -#define DBG_COLOR #include #define BUFSZ (1024) diff --git a/examples/network/udpclient.c b/examples/network/udpclient.c index 40542b9fa1..d43b46a446 100644 --- a/examples/network/udpclient.c +++ b/examples/network/udpclient.c @@ -5,14 +5,12 @@ #define DEBUG_UDP_CLIENT -#define DBG_ENABLE #define DBG_SECTION_NAME "UDP" #ifdef DEBUG_UDP_CLIENT #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO /* DBG_ERROR */ #endif -#define DBG_COLOR #include static int started = 0; diff --git a/examples/network/udpserver.c b/examples/network/udpserver.c index c40a1972b4..40dd754673 100644 --- a/examples/network/udpserver.c +++ b/examples/network/udpserver.c @@ -12,14 +12,12 @@ #define DEBUG_UDP_SERVER -#define DBG_ENABLE #define DBG_SECTION_NAME "UDP" #ifdef DEBUG_UDP_SERVER #define DBG_LEVEL DBG_LOG #else #define DBG_LEVEL DBG_INFO /* DBG_ERROR */ #endif -#define DBG_COLOR #include #define BUFSZ 1024 diff --git a/include/rtdbg.h b/include/rtdbg.h index 9036a0cd66..97845321e7 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -19,16 +19,12 @@ * header file. * * #define DBG_SECTION_NAME "MOD" - * #define DBG_ENABLE // enable debug macro * #define DBG_LEVEL DBG_INFO - * #include // must after of DEBUG_ENABLE or some other options + * #include // must after of DBG_LEVEL, DBG_SECTION_NAME or other options * * Then in your C/C++ file, you can use LOG_X macro to print out logs: * LOG_D("this is a debug log!"); * LOG_E("this is a error log!"); - * - * If you want to use different color for different kinds log, you can - * #define DBG_COLOR */ #ifndef RT_DBG_H__ @@ -36,6 +32,16 @@ #include +/* the debug log will force enable when RT_DEBUG macro is defined */ +#if defined(RT_DEBUG) && !defined(DBG_ENABLE) +#define DBG_ENABLE +#endif + +/* it will force output color log when RT_DEBUG_COLOR macro is defined */ +#if defined(RT_DEBUG_COLOR) && !defined(DBG_COLOR) +#define DBG_COLOR +#endif + #if defined(RT_USING_ULOG) && defined(DBG_ENABLE) /* using ulog compatible with rtdbg */ #include diff --git a/src/Kconfig b/src/Kconfig index 2fdcfd4982..fbfae65882 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -113,6 +113,10 @@ menuconfig RT_DEBUG if RT_DEBUG +config RT_DEBUG_COLOR + bool "Enable color debugging log" + default y + config RT_DEBUG_INIT_CONFIG bool "Enable debugging of components initialization" default n diff --git a/src/signal.c b/src/signal.c index 05632b2c4a..c9d6c20805 100644 --- a/src/signal.c +++ b/src/signal.c @@ -22,10 +22,8 @@ #define RT_SIG_INFO_MAX 32 #endif -// #define DBG_ENABLE #define DBG_SECTION_NAME "SIGN" -#define DBG_COLOR -#define DBG_LEVEL DBG_LOG +#define DBG_LEVEL DBG_INFO #include #define sig_mask(sig_no) (1u << sig_no) -- cgit v1.3.1 From e71ec65549db94a88fac1ba7a1f110d8667fd528 Mon Sep 17 00:00:00 2001 From: tangyuxin <462747508@qq.com> Date: Wed, 3 Apr 2019 18:09:52 +0800 Subject: [components][dfs]格式化代码 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/filesystems/devfs/devfs.c | 20 ++-- components/dfs/filesystems/elmfat/dfs_elm.c | 46 +++++---- components/dfs/filesystems/nfs/dfs_nfs.c | 102 ++++++++++--------- components/dfs/filesystems/ramfs/dfs_ramfs.c | 18 ++-- components/dfs/filesystems/ramfs/dfs_ramfs.h | 4 +- components/dfs/filesystems/romfs/dfs_romfs.c | 4 +- components/dfs/filesystems/romfs/dfs_romfs.h | 4 +- components/dfs/filesystems/romfs/romfs.c | 8 +- components/dfs/filesystems/skeleton/skeleton.c | 20 ++-- components/dfs/filesystems/uffs/dfs_uffs.c | 134 ++++++++++++------------- components/dfs/filesystems/uffs/dfs_uffs.h | 2 +- components/dfs/include/dfs.h | 2 +- components/dfs/include/dfs_fs.h | 10 +- components/dfs/include/dfs_posix.h | 2 +- components/dfs/include/dfs_private.h | 4 +- components/dfs/src/dfs.c | 12 +-- components/dfs/src/dfs_file.c | 30 +++--- components/dfs/src/dfs_fs.c | 42 ++++---- components/dfs/src/dfs_posix.c | 16 +-- components/dfs/src/poll.c | 2 +- components/dfs/src/select.c | 4 +- 21 files changed, 248 insertions(+), 238 deletions(-) (limited to 'components/dfs/include') diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c index 3080312874..936b074ce1 100644 --- a/components/dfs/filesystems/devfs/devfs.c +++ b/components/dfs/filesystems/devfs/devfs.c @@ -97,7 +97,7 @@ int dfs_device_fs_close(struct dfs_fd *file) root_dirent = (struct device_dirent *)file->data; RT_ASSERT(root_dirent != RT_NULL); - + /* release dirent */ rt_free(root_dirent); return RT_EOK; @@ -133,7 +133,7 @@ int dfs_device_fs_open(struct dfs_fd *file) struct rt_object_information *information; struct device_dirent *root_dirent; rt_uint32_t count = 0; - + /* lock scheduler */ rt_enter_critical(); @@ -145,8 +145,8 @@ int dfs_device_fs_open(struct dfs_fd *file) count ++; } - root_dirent = (struct device_dirent *)rt_malloc(sizeof(struct device_dirent) + - count * sizeof(rt_device_t)); + root_dirent = (struct device_dirent *)rt_malloc(sizeof(struct device_dirent) + + count * sizeof(rt_device_t)); if (root_dirent != RT_NULL) { root_dirent->devices = (rt_device_t *)(root_dirent + 1); @@ -165,7 +165,7 @@ int dfs_device_fs_open(struct dfs_fd *file) /* set data */ file->data = root_dirent; - + return RT_EOK; } @@ -178,7 +178,7 @@ int dfs_device_fs_open(struct dfs_fd *file) { /* use device fops */ file->fops = device->fops; - file->data = (void*)device; + file->data = (void *)device; /* use fops */ if (file->fops->open) @@ -214,7 +214,7 @@ int dfs_device_fs_stat(struct dfs_filesystem *fs, const char *path, struct stat st->st_dev = 0; st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH | - S_IWUSR | S_IWGRP | S_IWOTH; + S_IWUSR | S_IWGRP | S_IWOTH; st->st_mode &= ~S_IFREG; st->st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH; @@ -233,7 +233,7 @@ int dfs_device_fs_stat(struct dfs_filesystem *fs, const char *path, struct stat st->st_dev = 0; st->st_mode = S_IRUSR | S_IRGRP | S_IROTH | - S_IWUSR | S_IWGRP | S_IWOTH; + S_IWUSR | S_IWGRP | S_IWOTH; if (dev_id->type == RT_Device_Class_Char) st->st_mode |= S_IFCHR; @@ -293,7 +293,7 @@ static int dfs_device_fs_poll(struct dfs_fd *fd, struct rt_pollreq *req) return mask; } -static const struct dfs_file_ops _device_fops = +static const struct dfs_file_ops _device_fops = { dfs_device_fs_open, dfs_device_fs_close, @@ -306,7 +306,7 @@ static const struct dfs_file_ops _device_fops = dfs_device_fs_poll, }; -static const struct dfs_filesystem_ops _device_fs = +static const struct dfs_filesystem_ops _device_fs = { "devfs", DFS_FS_FLAG_DEFAULT, diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c index 582333a714..a45c15aa03 100644 --- a/components/dfs/filesystems/elmfat/dfs_elm.c +++ b/components/dfs/filesystems/elmfat/dfs_elm.c @@ -101,7 +101,7 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d FRESULT result; int index; struct rt_device_blk_geometry geometry; - char logic_nbr[2] = {'0',':'}; + char logic_nbr[2] = {'0', ':'}; /* get an empty position */ index = get_disk(RT_NULL); @@ -129,7 +129,7 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d } /* mount fatfs, always 0 logic driver */ - result = f_mount(fat, (const TCHAR*)logic_nbr, 1); + result = f_mount(fat, (const TCHAR *)logic_nbr, 1); if (result == FR_OK) { char drive[8]; @@ -139,7 +139,7 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d dir = (DIR *)rt_malloc(sizeof(DIR)); if (dir == RT_NULL) { - f_mount(RT_NULL, (const TCHAR*)logic_nbr, 1); + f_mount(RT_NULL, (const TCHAR *)logic_nbr, 1); disk[index] = RT_NULL; rt_free(fat); return -ENOMEM; @@ -157,7 +157,7 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d } __err: - f_mount(RT_NULL, (const TCHAR*)logic_nbr, 1); + f_mount(RT_NULL, (const TCHAR *)logic_nbr, 1); disk[index] = RT_NULL; rt_free(fat); return elm_result_to_dfs(result); @@ -168,7 +168,7 @@ int dfs_elm_unmount(struct dfs_filesystem *fs) FATFS *fat; FRESULT result; int index; - char logic_nbr[2] = {'0',':'}; + char logic_nbr[2] = {'0', ':'}; fat = (FATFS *)fs->data; @@ -180,7 +180,7 @@ int dfs_elm_unmount(struct dfs_filesystem *fs) return -ENOENT; logic_nbr[0] = '0' + index; - result = f_mount(RT_NULL, logic_nbr, (BYTE)1); + result = f_mount(RT_NULL, logic_nbr, (BYTE)1); if (result != FR_OK) return elm_result_to_dfs(result); @@ -200,10 +200,11 @@ int dfs_elm_mkfs(rt_device_t dev_id) int flag; FRESULT result; int index; - char logic_nbr[2] = {'0',':'}; - + char logic_nbr[2] = {'0', ':'}; + work = rt_malloc(_MAX_SS); - if(RT_NULL == work) { + if (RT_NULL == work) + { return -ENOMEM; } @@ -265,14 +266,15 @@ int dfs_elm_mkfs(rt_device_t dev_id) /* [IN] Size of the allocation unit */ /* [-] Working buffer */ /* [IN] Size of working buffer */ - result = f_mkfs(logic_nbr, FM_ANY|FM_SFD, 0, work, _MAX_SS); - rt_free(work); work = RT_NULL; + result = f_mkfs(logic_nbr, FM_ANY | FM_SFD, 0, work, _MAX_SS); + rt_free(work); + work = RT_NULL; /* check flag status, we need clear the temp driver stored in disk[] */ if (flag == FSM_STATUS_USE_TEMP_DRIVER) { rt_free(fat); - f_mount(RT_NULL, logic_nbr,(BYTE)index); + f_mount(RT_NULL, logic_nbr, (BYTE)index); disk[index] = RT_NULL; /* close device */ rt_device_close(dev_id); @@ -778,7 +780,7 @@ int dfs_elm_stat(struct dfs_filesystem *fs, const char *path, struct stat *st) return elm_result_to_dfs(result); } -static const struct dfs_file_ops dfs_elm_fops = +static const struct dfs_file_ops dfs_elm_fops = { dfs_elm_open, dfs_elm_close, @@ -834,7 +836,7 @@ DSTATUS disk_status(BYTE drv) } /* Read Sector(s) */ -DRESULT disk_read (BYTE drv, BYTE* buff, DWORD sector, UINT count) +DRESULT disk_read(BYTE drv, BYTE *buff, DWORD sector, UINT count) { rt_size_t result; rt_device_t device = disk[drv]; @@ -849,7 +851,7 @@ DRESULT disk_read (BYTE drv, BYTE* buff, DWORD sector, UINT count) } /* Write Sector(s) */ -DRESULT disk_write (BYTE drv, const BYTE* buff, DWORD sector, UINT count) +DRESULT disk_write(BYTE drv, const BYTE *buff, DWORD sector, UINT count) { rt_size_t result; rt_device_t device = disk[drv]; @@ -916,7 +918,7 @@ DWORD get_fattime(void) { DWORD fat_time = 0; -#ifdef RT_USING_LIBC +#ifdef RT_USING_LIBC time_t now; struct tm *p_tm; struct tm tm_now; @@ -933,12 +935,12 @@ DWORD get_fattime(void) /* unlock scheduler. */ rt_exit_critical(); - fat_time = (DWORD)(tm_now.tm_year - 80) << 25 | - (DWORD)(tm_now.tm_mon + 1) << 21 | - (DWORD)tm_now.tm_mday << 16 | - (DWORD)tm_now.tm_hour << 11 | - (DWORD)tm_now.tm_min << 5 | - (DWORD)tm_now.tm_sec / 2 ; + fat_time = (DWORD)(tm_now.tm_year - 80) << 25 | + (DWORD)(tm_now.tm_mon + 1) << 21 | + (DWORD)tm_now.tm_mday << 16 | + (DWORD)tm_now.tm_hour << 11 | + (DWORD)tm_now.tm_min << 5 | + (DWORD)tm_now.tm_sec / 2 ; #endif /* RT_USING_LIBC */ return fat_time; diff --git a/components/dfs/filesystems/nfs/dfs_nfs.c b/components/dfs/filesystems/nfs/dfs_nfs.c index ea055b73c1..f365314564 100644 --- a/components/dfs/filesystems/nfs/dfs_nfs.c +++ b/components/dfs/filesystems/nfs/dfs_nfs.c @@ -6,7 +6,7 @@ * Change Logs: * Date Author Notes */ - + #include #include #include @@ -65,9 +65,9 @@ typedef struct nfs_dir nfs_dir; nfs_dir *nfs_opendir(nfs_filesystem *nfs, const char *path); -static int nfs_parse_host_export(const char *host_export, +static int nfs_parse_host_export(const char *host_export, char *host, - size_t host_len, + size_t host_len, char *export, size_t export_len) { @@ -99,7 +99,7 @@ static int nfs_parse_host_export(const char *host_export, /* copy export path */ for (index = host_len; index < host_len + export_len; index ++) { - if (host_export[index] == 0) + if (host_export[index] == 0) { export[index - host_len] = '\0'; @@ -133,11 +133,11 @@ static nfs_fh3 *get_handle(nfs_filesystem *nfs, const char *name) char *path; char *init; - init = path = rt_malloc(strlen(name)+1); + init = path = rt_malloc(strlen(name) + 1); if (init == NULL) return NULL; - memcpy(init, name, strlen(name)+1); + memcpy(init, name, strlen(name) + 1); handle = rt_malloc(sizeof(nfs_fh3)); if (handle == NULL) @@ -202,10 +202,10 @@ static nfs_fh3 *get_dir_handle(nfs_filesystem *nfs, const char *name) char *path; char *init; - init = path = rt_malloc(strlen(name)+1); + init = path = rt_malloc(strlen(name) + 1); if (init == NULL) return NULL; - memcpy(init, name, strlen(name)+1); + memcpy(init, name, strlen(name) + 1); handle = rt_malloc(sizeof(nfs_fh3)); if (handle == NULL) @@ -274,7 +274,7 @@ static size_t nfs_get_filesize(nfs_filesystem *nfs, nfs_fh3 *handle) memset(&res, '\0', sizeof(res)); - if ((nfsproc3_getattr_3(args, &res, nfs->nfs_client)!=RPC_SUCCESS) || + if ((nfsproc3_getattr_3(args, &res, nfs->nfs_client) != RPC_SUCCESS) || res.status != NFS3_OK) { rt_kprintf("GetAttr failed: %d\n", res.status); @@ -285,7 +285,7 @@ static size_t nfs_get_filesize(nfs_filesystem *nfs, nfs_fh3 *handle) info = &res.GETATTR3res_u.resok.obj_attributes; size = info->size; xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res); - + return size; } @@ -319,7 +319,7 @@ rt_bool_t nfs_is_directory(nfs_filesystem *nfs, const char *name) return RT_FALSE; } - info=&res.GETATTR3res_u.resok.obj_attributes; + info = &res.GETATTR3res_u.resok.obj_attributes; if (info->type == NFS3DIR) result = RT_TRUE; @@ -327,7 +327,7 @@ rt_bool_t nfs_is_directory(nfs_filesystem *nfs, const char *name) xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle); rt_free(handle); - + return result; } @@ -427,7 +427,7 @@ int nfs_mkdir(nfs_filesystem *nfs, const char *name, mode_t mode) xdr_free((xdrproc_t)xdr_MKDIR3res, (char *)&res); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle); rt_free(handle); - + return ret; } @@ -441,13 +441,13 @@ int nfs_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *data) memset(nfs, 0, sizeof(nfs_filesystem)); if (nfs_parse_host_export((const char *)data, nfs->host, HOST_LENGTH, - nfs->export, EXPORT_PATH_LENGTH) < 0) + nfs->export, EXPORT_PATH_LENGTH) < 0) { rt_kprintf("host or export path error\n"); goto __return; } - nfs->mount_client=clnt_create((char *)nfs->host, MOUNT_PROGRAM, MOUNT_V3, "udp"); + nfs->mount_client = clnt_create((char *)nfs->host, MOUNT_PROGRAM, MOUNT_V3, "udp"); if (nfs->mount_client == NULL) { rt_kprintf("create mount client failed\n"); @@ -465,7 +465,7 @@ int nfs_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *data) rt_kprintf("nfs mount failed\n"); goto __return; } - nfs->nfs_client=clnt_create((char *)nfs->host, NFS_PROGRAM, NFS_V3, "udp"); + nfs->nfs_client = clnt_create((char *)nfs->host, NFS_PROGRAM, NFS_V3, "udp"); if (nfs->nfs_client == NULL) { rt_kprintf("creat nfs client failed\n"); @@ -555,7 +555,7 @@ int nfs_read(struct dfs_fd *file, void *buf, size_t count) { READ3args args; READ3res res; - ssize_t bytes, total=0; + ssize_t bytes, total = 0; nfs_file *fd; nfs_filesystem *nfs; @@ -564,8 +564,8 @@ int nfs_read(struct dfs_fd *file, void *buf, size_t count) RT_ASSERT(file->data != NULL); - struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data)); - nfs = (struct nfs_filesystem *)(dfs_nfs->data); + struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem *)(file->data)); + nfs = (struct nfs_filesystem *)(dfs_nfs->data); fd = (nfs_file *)(nfs->data); RT_ASSERT(fd != NULL); @@ -577,7 +577,8 @@ int nfs_read(struct dfs_fd *file, void *buf, size_t count) return 0; args.file = fd->handle; - do { + do + { args.offset = fd->offset; args.count = count > DFS_NFS_MAX_MTU ? DFS_NFS_MAX_MTU : count; count -= args.count; @@ -612,7 +613,8 @@ int nfs_read(struct dfs_fd *file, void *buf, size_t count) } } xdr_free((xdrproc_t)xdr_READ3res, (char *)&res); - } while(count > 0); + } + while (count > 0); xdr_free((xdrproc_t)xdr_READ3res, (char *)&res); @@ -623,7 +625,7 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count) { WRITE3args args; WRITE3res res; - ssize_t bytes, total=0; + ssize_t bytes, total = 0; nfs_file *fd; nfs_filesystem *nfs; @@ -631,8 +633,8 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count) return -EISDIR; RT_ASSERT(file->data != NULL); - struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data)); - nfs = (struct nfs_filesystem *)(dfs_nfs->data); + struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem *)(file->data)); + nfs = (struct nfs_filesystem *)(dfs_nfs->data); fd = (nfs_file *)(nfs->data); RT_ASSERT(fd != NULL); @@ -642,11 +644,12 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count) args.file = fd->handle; args.stable = FILE_SYNC; - do { + do + { args.offset = fd->offset; memset(&res, 0, sizeof(res)); - args.data.data_val=(void *)buf; + args.data.data_val = (void *)buf; args.count = count > DFS_NFS_MAX_MTU ? DFS_NFS_MAX_MTU : count; args.data.data_len = args.count; count -= args.count; @@ -676,7 +679,8 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count) file->size = fd->size; } xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res); - } while (count > 0); + } + while (count > 0); xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res); @@ -692,8 +696,8 @@ int nfs_lseek(struct dfs_fd *file, off_t offset) return -EISDIR; RT_ASSERT(file->data != NULL); - struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data)); - nfs = (struct nfs_filesystem *)(dfs_nfs->data); + struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem *)(file->data)); + nfs = (struct nfs_filesystem *)(dfs_nfs->data); fd = (nfs_file *)(nfs->data); RT_ASSERT(fd != NULL); @@ -711,8 +715,8 @@ int nfs_close(struct dfs_fd *file) { nfs_filesystem *nfs; RT_ASSERT(file->data != NULL); - struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data)); - nfs = (struct nfs_filesystem *)(dfs_nfs->data); + struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem *)(file->data)); + nfs = (struct nfs_filesystem *)(dfs_nfs->data); if (file->type == FT_DIRECTORY) { @@ -741,14 +745,14 @@ int nfs_open(struct dfs_fd *file) { nfs_filesystem *nfs; RT_ASSERT(file->data != NULL); - struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data)); - nfs = (struct nfs_filesystem *)(dfs_nfs->data); + struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem *)(file->data)); + nfs = (struct nfs_filesystem *)(dfs_nfs->data); if (file->flags & O_DIRECTORY) { nfs_dir *dir; - + if (file->flags & O_CREAT) { if (nfs_mkdir(nfs, file->path, 0755) < 0) @@ -930,7 +934,7 @@ char *nfs_readdir(nfs_filesystem *nfs, nfs_dir *dir) return NULL; dir->cookie = dir->entry->cookie; - strncpy(name, dir->entry->name, NAME_MAX-1); + strncpy(name, dir->entry->name, NAME_MAX - 1); dir->entry = dir->entry->nextentry; name[NAME_MAX - 1] = '\0'; @@ -1013,7 +1017,7 @@ int nfs_unlink(struct dfs_filesystem *fs, const char *path) xdr_free((xdrproc_t)xdr_RMDIR3res, (char *)&res); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle); - rt_free(handle); + rt_free(handle); } return ret; @@ -1083,8 +1087,8 @@ int nfs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count) RT_ASSERT(file->data != NULL); - struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data)); - nfs = (struct nfs_filesystem *)(dfs_nfs->data); + struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem *)(file->data)); + nfs = (struct nfs_filesystem *)(dfs_nfs->data); dir = (nfs_dir *)(nfs->data); RT_ASSERT(dir != NULL); @@ -1118,18 +1122,18 @@ int nfs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count) static const struct dfs_file_ops nfs_fops = { - nfs_open, - nfs_close, - nfs_ioctl, - nfs_read, - nfs_write, - NULL, /* flush */ - nfs_lseek, - nfs_getdents, - NULL, /* poll */ + nfs_open, + nfs_close, + nfs_ioctl, + nfs_read, + nfs_write, + NULL, /* flush */ + nfs_lseek, + nfs_getdents, + NULL, /* poll */ }; -static const struct dfs_filesystem_ops _nfs = +static const struct dfs_filesystem_ops _nfs = { "nfs", DFS_FS_FLAG_DEFAULT, @@ -1138,7 +1142,7 @@ static const struct dfs_filesystem_ops _nfs = nfs_unmount, NULL, /* mkfs */ NULL, /* statfs */ - nfs_unlink, + nfs_unlink, nfs_stat, nfs_rename, }; diff --git a/components/dfs/filesystems/ramfs/dfs_ramfs.c b/components/dfs/filesystems/ramfs/dfs_ramfs.c index e851c7ef78..aa85081e1e 100644 --- a/components/dfs/filesystems/ramfs/dfs_ramfs.c +++ b/components/dfs/filesystems/ramfs/dfs_ramfs.c @@ -21,14 +21,14 @@ int dfs_ramfs_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *data) { - struct dfs_ramfs* ramfs; + struct dfs_ramfs *ramfs; if (data == NULL) return -EIO; ramfs = (struct dfs_ramfs *)data; fs->data = ramfs; - + return RT_EOK; } @@ -48,8 +48,8 @@ int dfs_ramfs_statfs(struct dfs_filesystem *fs, struct statfs *buf) RT_ASSERT(buf != NULL); buf->f_bsize = 512; - buf->f_blocks = ramfs->memheap.pool_size/512; - buf->f_bfree = ramfs->memheap.available_size/512; + buf->f_blocks = ramfs->memheap.pool_size / 512; + buf->f_bfree = ramfs->memheap.available_size / 512; return RT_EOK; } @@ -119,7 +119,7 @@ int dfs_ramfs_write(struct dfs_fd *fd, const void *buf, size_t count) struct ramfs_dirent *dirent; struct dfs_ramfs *ramfs; - dirent = (struct ramfs_dirent*)fd->data; + dirent = (struct ramfs_dirent *)fd->data; RT_ASSERT(dirent != NULL); ramfs = dirent->fs; @@ -260,7 +260,7 @@ int dfs_ramfs_open(struct dfs_fd *file) file->size = dirent->size; if (file->flags & O_APPEND) file->pos = file->size; - else + else file->pos = 0; return 0; @@ -381,7 +381,7 @@ int dfs_ramfs_rename(struct dfs_filesystem *fs, return RT_EOK; } -static const struct dfs_file_ops _ram_fops = +static const struct dfs_file_ops _ram_fops = { dfs_ramfs_open, dfs_ramfs_close, @@ -418,7 +418,7 @@ int dfs_ramfs_init(void) } INIT_COMPONENT_EXPORT(dfs_ramfs_init); -struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size) +struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size) { struct dfs_ramfs *ramfs; rt_uint8_t *data_ptr; @@ -435,7 +435,7 @@ struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size) if (result != RT_EOK) return NULL; /* detach this memheap object from the system */ - rt_object_detach((rt_object_t)&(ramfs->memheap)); + rt_object_detach((rt_object_t) & (ramfs->memheap)); /* initialize ramfs object */ ramfs->magic = RAMFS_MAGIC; diff --git a/components/dfs/filesystems/ramfs/dfs_ramfs.h b/components/dfs/filesystems/ramfs/dfs_ramfs.h index 9419784db9..4975ecb332 100644 --- a/components/dfs/filesystems/ramfs/dfs_ramfs.h +++ b/components/dfs/filesystems/ramfs/dfs_ramfs.h @@ -24,7 +24,7 @@ struct ramfs_dirent struct dfs_ramfs *fs; /* file system ref */ char name[RAMFS_NAME_MAX]; /* dirent name */ - rt_uint8_t* data; + rt_uint8_t *data; rt_size_t size; /* file size */ }; @@ -41,7 +41,7 @@ struct dfs_ramfs }; int dfs_ramfs_init(void); -struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t* pool, rt_size_t size); +struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size); #endif diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c index a953ac72d5..dcc34e5830 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/filesystems/romfs/dfs_romfs.c @@ -105,7 +105,7 @@ struct romfs_dirent *dfs_romfs_lookup(struct romfs_dirent *root_dirent, const ch if (dirent[index].type == ROMFS_DIRENT_DIR) { /* enter directory */ - dirent = (struct romfs_dirent*)dirent[index].data; + dirent = (struct romfs_dirent *)dirent[index].data; found = 1; break; } @@ -226,7 +226,7 @@ int dfs_romfs_stat(struct dfs_filesystem *fs, const char *path, struct stat *st) st->st_dev = 0; st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH | - S_IWUSR | S_IWGRP | S_IWOTH; + S_IWUSR | S_IWGRP | S_IWOTH; if (dirent->type == ROMFS_DIRENT_DIR) { diff --git a/components/dfs/filesystems/romfs/dfs_romfs.h b/components/dfs/filesystems/romfs/dfs_romfs.h index efb6d44caf..ba6a3d7dfa 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.h +++ b/components/dfs/filesystems/romfs/dfs_romfs.h @@ -13,8 +13,8 @@ #include -#define ROMFS_DIRENT_FILE 0x00 -#define ROMFS_DIRENT_DIR 0x01 +#define ROMFS_DIRENT_FILE 0x00 +#define ROMFS_DIRENT_DIR 0x01 struct romfs_dirent { diff --git a/components/dfs/filesystems/romfs/romfs.c b/components/dfs/filesystems/romfs/romfs.c index 1ea9f21d8e..cfce09a095 100644 --- a/components/dfs/filesystems/romfs/romfs.c +++ b/components/dfs/filesystems/romfs/romfs.c @@ -12,7 +12,7 @@ const static unsigned char _dummy_dummy_txt[] = { - 0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x20,0x66,0x69,0x6c,0x65,0x21,0x0d,0x0a, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a, }; const static struct romfs_dirent _dummy[] = @@ -22,17 +22,17 @@ const static struct romfs_dirent _dummy[] = const static unsigned char _dummy_txt[] = { - 0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x20,0x66,0x69,0x6c,0x65,0x21,0x0d,0x0a, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a, }; RT_WEAK const struct romfs_dirent _root_dirent[] = { - {ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t *)_dummy, sizeof(_dummy)/sizeof(_dummy[0])}, + {ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t *)_dummy, sizeof(_dummy) / sizeof(_dummy[0])}, {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_txt, sizeof(_dummy_txt)}, }; RT_WEAK const struct romfs_dirent romfs_root = { - ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_root_dirent, sizeof(_root_dirent)/sizeof(_root_dirent[0]) + ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_root_dirent, sizeof(_root_dirent) / sizeof(_root_dirent[0]) }; diff --git a/components/dfs/filesystems/skeleton/skeleton.c b/components/dfs/filesystems/skeleton/skeleton.c index 30f0d4f629..0c20513e82 100644 --- a/components/dfs/filesystems/skeleton/skeleton.c +++ b/components/dfs/filesystems/skeleton/skeleton.c @@ -14,52 +14,52 @@ #include "dfs_skt_fs.h" -int dfs_skt_mount(struct dfs_filesystem* fs, unsigned long rwflag, const void* data) +int dfs_skt_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *data) { return RT_EOK; } -int dfs_skt_unmount(struct dfs_filesystem* fs) +int dfs_skt_unmount(struct dfs_filesystem *fs) { return RT_EOK; } -int dfs_skt_ioctl(struct dfs_fd* file, int cmd, void* args) +int dfs_skt_ioctl(struct dfs_fd *file, int cmd, void *args) { return -RT_EIO; } -int dfs_skt_read(struct dfs_fd* file, void *buf, rt_size_t count) +int dfs_skt_read(struct dfs_fd *file, void *buf, rt_size_t count) { return count; } -int dfs_skt_lseek(struct dfs_fd* file, rt_off_t offset) +int dfs_skt_lseek(struct dfs_fd *file, rt_off_t offset) { return -RT_EIO; } -int dfs_skt_close(struct dfs_fd* file) +int dfs_skt_close(struct dfs_fd *file) { return RT_EOK; } -int dfs_skt_open(struct dfs_fd* file) +int dfs_skt_open(struct dfs_fd *file) { return RT_EOK; } -int dfs_skt_stat(struct dfs_filesystem* fs, const char *path, struct stat *st) +int dfs_skt_stat(struct dfs_filesystem *fs, const char *path, struct stat *st) { return RT_EOK; } -int dfs_skt_getdents(struct dfs_fd* file, struct dirent* dirp, rt_uint32_t count) +int dfs_skt_getdents(struct dfs_fd *file, struct dirent *dirp, rt_uint32_t count) { return count * sizeof(struct dirent); } -static const struct dfs_file_ops _skt_fops = +static const struct dfs_file_ops _skt_fops = { dfs_skt_open, dfs_skt_close, diff --git a/components/dfs/filesystems/uffs/dfs_uffs.c b/components/dfs/filesystems/uffs/dfs_uffs.c index b875d1eb00..c89102f3e3 100644 --- a/components/dfs/filesystems/uffs/dfs_uffs.c +++ b/components/dfs/filesystems/uffs/dfs_uffs.c @@ -33,12 +33,12 @@ struct _nand_dev { - struct rt_mtd_nand_device * dev; + struct rt_mtd_nand_device *dev; struct uffs_StorageAttrSt storage; uffs_Device uffs_dev; uffs_MountTable mount_table; char mount_path[UFFS_MOUNT_PATH_MAX]; - void * data; /* when uffs use static buf, it will save ptr here */ + void *data; /* when uffs use static buf, it will save ptr here */ }; /* make sure the following struct var had been initilased to 0! */ static struct _nand_dev nand_part[UFFS_DEVICE_MAX] = {0}; @@ -109,11 +109,11 @@ static URET _device_release(uffs_Device *dev) } static int init_uffs_fs( - struct _nand_dev * nand_part) + struct _nand_dev *nand_part) { - uffs_MountTable * mtb; - struct rt_mtd_nand_device * nand; - struct uffs_StorageAttrSt * flash_storage; + uffs_MountTable *mtb; + struct rt_mtd_nand_device *nand; + struct uffs_StorageAttrSt *flash_storage; mtb = &nand_part->mount_table; nand = nand_part->dev; @@ -123,7 +123,7 @@ static int init_uffs_fs( uffs_setup_storage(flash_storage, nand); /* register mount table */ - if(mtb->dev) + if (mtb->dev) { /* set memory allocator for uffs */ #if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 @@ -141,15 +141,15 @@ static int init_uffs_fs( } static int dfs_uffs_mount( - struct dfs_filesystem* fs, + struct dfs_filesystem *fs, unsigned long rwflag, - const void* data) + const void *data) { rt_base_t index; - uffs_MountTable * mount_part; - struct rt_mtd_nand_device * dev; - - RT_ASSERT(rt_strlen(fs->path) < (UFFS_MOUNT_PATH_MAX-1)); + uffs_MountTable *mount_part; + struct rt_mtd_nand_device *dev; + + RT_ASSERT(rt_strlen(fs->path) < (UFFS_MOUNT_PATH_MAX - 1)); dev = RT_MTD_NAND_DEVICE(fs->dev_id); /*1. find a empty entry in partition table */ @@ -184,7 +184,7 @@ static int dfs_uffs_mount( return 0; } -static int dfs_uffs_unmount(struct dfs_filesystem* fs) +static int dfs_uffs_unmount(struct dfs_filesystem *fs) { rt_base_t index; int result; @@ -210,7 +210,7 @@ static int dfs_uffs_mkfs(rt_device_t dev_id) { rt_base_t index; rt_uint32_t block; - struct rt_mtd_nand_device * mtd; + struct rt_mtd_nand_device *mtd; /*1. find the device index */ for (index = 0; index < UFFS_DEVICE_MAX; index++) @@ -249,11 +249,11 @@ static int dfs_uffs_mkfs(rt_device_t dev_id) return RT_EOK; } -static int dfs_uffs_statfs(struct dfs_filesystem* fs, - struct statfs *buf) +static int dfs_uffs_statfs(struct dfs_filesystem *fs, + struct statfs *buf) { rt_base_t index; - struct rt_mtd_nand_device * mtd = RT_MTD_NAND_DEVICE(fs->dev_id); + struct rt_mtd_nand_device *mtd = RT_MTD_NAND_DEVICE(fs->dev_id); RT_ASSERT(mtd != RT_NULL); @@ -265,24 +265,24 @@ static int dfs_uffs_statfs(struct dfs_filesystem* fs, } if (index == UFFS_DEVICE_MAX) return -ENOENT; - - buf->f_bsize = mtd->page_size*mtd->pages_per_block; + + buf->f_bsize = mtd->page_size * mtd->pages_per_block; buf->f_blocks = (mtd->block_end - mtd->block_start + 1); - buf->f_bfree = uffs_GetDeviceFree(&nand_part[index].uffs_dev)/buf->f_bsize ; - + buf->f_bfree = uffs_GetDeviceFree(&nand_part[index].uffs_dev) / buf->f_bsize ; + return 0; } -static int dfs_uffs_open(struct dfs_fd* file) +static int dfs_uffs_open(struct dfs_fd *file) { int fd; int oflag, mode; - char * file_path; + char *file_path; oflag = file->flags; if (oflag & O_DIRECTORY) /* operations about dir */ { - uffs_DIR * dir; + uffs_DIR *dir; if (oflag & O_CREAT) /* create a dir*/ { @@ -291,8 +291,8 @@ static int dfs_uffs_open(struct dfs_fd* file) } /* open dir */ file_path = rt_malloc(FILE_PATH_MAX); - if(file_path == RT_NULL) - return -ENOMEM; + if (file_path == RT_NULL) + return -ENOMEM; if (file->path[0] == '/' && !(file->path[1] == 0)) rt_snprintf(file_path, FILE_PATH_MAX, "%s/", file->path); @@ -306,7 +306,7 @@ static int dfs_uffs_open(struct dfs_fd* file) if (dir == RT_NULL) { - rt_free(file_path); + rt_free(file_path); return uffs_result_to_dfs(uffs_get_error()); } /* save this pointer,will used by dfs_uffs_getdents*/ @@ -349,7 +349,7 @@ static int dfs_uffs_open(struct dfs_fd* file) return 0; } -static int dfs_uffs_close(struct dfs_fd* file) +static int dfs_uffs_close(struct dfs_fd *file) { int oflag; int fd; @@ -372,12 +372,12 @@ static int dfs_uffs_close(struct dfs_fd* file) return uffs_result_to_dfs(uffs_get_error()); } -static int dfs_uffs_ioctl(struct dfs_fd * file, int cmd, void* args) +static int dfs_uffs_ioctl(struct dfs_fd *file, int cmd, void *args) { return -ENOSYS; } -static int dfs_uffs_read(struct dfs_fd * file, void* buf, size_t len) +static int dfs_uffs_read(struct dfs_fd *file, void *buf, size_t len) { int fd; int char_read; @@ -392,9 +392,9 @@ static int dfs_uffs_read(struct dfs_fd * file, void* buf, size_t len) return char_read; } -static int dfs_uffs_write(struct dfs_fd* file, - const void* buf, - size_t len) +static int dfs_uffs_write(struct dfs_fd *file, + const void *buf, + size_t len) { int fd; int char_write; @@ -410,7 +410,7 @@ static int dfs_uffs_write(struct dfs_fd* file, return char_write; } -static int dfs_uffs_flush(struct dfs_fd* file) +static int dfs_uffs_flush(struct dfs_fd *file) { int fd; int result; @@ -418,7 +418,7 @@ static int dfs_uffs_flush(struct dfs_fd* file) fd = (int)(file->data); result = uffs_flush(fd); - if (result < 0 ) + if (result < 0) return uffs_result_to_dfs(uffs_get_error()); return 0; } @@ -427,18 +427,18 @@ int uffs_seekdir(uffs_DIR *dir, long offset) { int i = 0; - while(i < offset) - { + while (i < offset) + { if (uffs_readdir(dir) == RT_NULL) return -1; i++; - } + } return 0; } -static int dfs_uffs_seek(struct dfs_fd* file, - rt_off_t offset) +static int dfs_uffs_seek(struct dfs_fd *file, + rt_off_t offset) { int result; @@ -446,17 +446,17 @@ static int dfs_uffs_seek(struct dfs_fd* file, if (file->type == FT_DIRECTORY) { uffs_rewinddir((uffs_DIR *)(file->data)); - result = uffs_seekdir((uffs_DIR *)(file->data), offset/sizeof(struct dirent)); + result = uffs_seekdir((uffs_DIR *)(file->data), offset / sizeof(struct dirent)); if (result >= 0) { - file->pos = offset; + file->pos = offset; return offset; } } else if (file->type == FT_REGULAR) { result = uffs_seek((int)(file->data), offset, USEEK_SET); - if (result >= 0) + if (result >= 0) return offset; } @@ -465,19 +465,19 @@ static int dfs_uffs_seek(struct dfs_fd* file, /* return the size of struct dirent*/ static int dfs_uffs_getdents( - struct dfs_fd* file, - struct dirent* dirp, + struct dfs_fd *file, + struct dirent *dirp, uint32_t count) { rt_uint32_t index; - char * file_path; - struct dirent* d; - uffs_DIR* dir; - struct uffs_dirent * uffs_d; - - dir = (uffs_DIR*)(file->data); + char *file_path; + struct dirent *d; + uffs_DIR *dir; + struct uffs_dirent *uffs_d; + + dir = (uffs_DIR *)(file->data); RT_ASSERT(dir != RT_NULL); - + /* round count, count is always 1 */ count = (count / sizeof(struct dirent)) * sizeof(struct dirent); if (count == 0) return -EINVAL; @@ -486,13 +486,13 @@ static int dfs_uffs_getdents( file_path = rt_malloc(FILE_PATH_MAX); if (file_path == RT_NULL) return -ENOMEM; - + index = 0; /* usually, the while loop should only be looped only once! */ while (1) { struct uffs_stat s; - + d = dirp + index; uffs_d = uffs_readdir(dir); @@ -507,8 +507,8 @@ static int dfs_uffs_getdents( else rt_strncpy(file_path, uffs_d->d_name, FILE_PATH_MAX); - uffs_stat(file_path, &s); - switch(s.st_mode & US_IFMT) /* file type mark */ + uffs_stat(file_path, &s); + switch (s.st_mode & US_IFMT) /* file type mark */ { case US_IFREG: /* directory */ d->d_type = DT_REG; @@ -533,10 +533,10 @@ static int dfs_uffs_getdents( if (index * sizeof(struct dirent) >= count) break; } - + /* free file name buf */ rt_free(file_path); - + if (index == 0) return uffs_result_to_dfs(uffs_get_error()); @@ -545,7 +545,7 @@ static int dfs_uffs_getdents( return index * sizeof(struct dirent); } -static int dfs_uffs_unlink(struct dfs_filesystem* fs, const char* path) +static int dfs_uffs_unlink(struct dfs_filesystem *fs, const char *path) { int result; struct uffs_stat s; @@ -556,7 +556,7 @@ static int dfs_uffs_unlink(struct dfs_filesystem* fs, const char* path) return uffs_result_to_dfs(uffs_get_error()); } - switch(s.st_mode & US_IFMT) + switch (s.st_mode & US_IFMT) { case US_IFREG: result = uffs_remove(path); @@ -575,12 +575,12 @@ static int dfs_uffs_unlink(struct dfs_filesystem* fs, const char* path) } static int dfs_uffs_rename( - struct dfs_filesystem* fs, - const char* oldpath, - const char* newpath) + struct dfs_filesystem *fs, + const char *oldpath, + const char *newpath) { int result; - + result = uffs_rename(oldpath, newpath); if (result < 0) return uffs_result_to_dfs(uffs_get_error()); @@ -588,7 +588,7 @@ static int dfs_uffs_rename( return 0; } -static int dfs_uffs_stat(struct dfs_filesystem* fs, const char *path, struct stat *st) +static int dfs_uffs_stat(struct dfs_filesystem *fs, const char *path, struct stat *st) { int result; struct uffs_stat s; @@ -607,7 +607,7 @@ static int dfs_uffs_stat(struct dfs_filesystem* fs, const char *path, struct sta return 0; } -static const struct dfs_file_ops dfs_uffs_fops = +static const struct dfs_file_ops dfs_uffs_fops = { dfs_uffs_open, dfs_uffs_close, diff --git a/components/dfs/filesystems/uffs/dfs_uffs.h b/components/dfs/filesystems/uffs/dfs_uffs.h index 615d29036d..72f0ee9240 100644 --- a/components/dfs/filesystems/uffs/dfs_uffs.h +++ b/components/dfs/filesystems/uffs/dfs_uffs.h @@ -83,7 +83,7 @@ extern const uffs_FlashOps nand_ops; extern void uffs_setup_storage( struct uffs_StorageAttrSt *attr, - struct rt_mtd_nand_device * nand); + struct rt_mtd_nand_device *nand); extern int dfs_uffs_init(void); #endif /* DFS_UFFS_H_ */ diff --git a/components/dfs/include/dfs.h b/components/dfs/include/dfs.h index 7fdcb1cfda..eb32a4b411 100644 --- a/components/dfs/include/dfs.h +++ b/components/dfs/include/dfs.h @@ -102,7 +102,7 @@ struct dfs_fd *fd_get(int fd); void fd_put(struct dfs_fd *fd); int fd_is_open(const char *pathname); -struct dfs_fdtable* dfs_fdtable_get(void); +struct dfs_fdtable *dfs_fdtable_get(void); #ifdef __cplusplus } diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h index 711771a137..d3a00fc542 100644 --- a/components/dfs/include/dfs_fs.h +++ b/components/dfs/include/dfs_fs.h @@ -7,7 +7,7 @@ * Date Author Notes * 2005-02-22 Bernard The first version. */ - + #ifndef __DFS_FS_H__ #define __DFS_FS_H__ @@ -60,7 +60,7 @@ struct dfs_partition uint8_t type; /* file system type */ off_t offset; /* partition start offset */ size_t size; /* partition size */ - rt_sem_t lock; + rt_sem_t lock; }; /* mount table */ @@ -75,11 +75,11 @@ struct dfs_mount_tbl int dfs_register(const struct dfs_filesystem_ops *ops); struct dfs_filesystem *dfs_filesystem_lookup(const char *path); -const char* dfs_filesystem_get_mounted_path(struct rt_device* device); +const char *dfs_filesystem_get_mounted_path(struct rt_device *device); int dfs_filesystem_get_partition(struct dfs_partition *part, - uint8_t *buf, - uint32_t pindex); + uint8_t *buf, + uint32_t pindex); int dfs_mount(const char *device_name, const char *path, diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h index bc8ff1c698..9fd76debe2 100644 --- a/components/dfs/include/dfs_posix.h +++ b/components/dfs/include/dfs_posix.h @@ -36,7 +36,7 @@ struct dirent *readdir(DIR *d); long telldir(DIR *d); void seekdir(DIR *d, off_t offset); void rewinddir(DIR *d); -int closedir(DIR* d); +int closedir(DIR *d); /* file api*/ int open(const char *file, int flags, ...); diff --git a/components/dfs/include/dfs_private.h b/components/dfs/include/dfs_private.h index bfc71b3b35..77dbe8562d 100644 --- a/components/dfs/include/dfs_private.h +++ b/components/dfs/include/dfs_private.h @@ -12,8 +12,8 @@ #include -#define DBG_SECTION_NAME "DFS" -#define DBG_LEVEL DBG_INFO +#define DBG_SECTION_NAME "DFS" +#define DBG_LEVEL DBG_INFO #include #define NO_WORKING_DIR "system does not support working directory\n" diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 6d52129b06..5bddb96930 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -139,7 +139,7 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd) /* increase the number of FD with 4 step length */ cnt = fdt->maxfd + 4; - cnt = cnt > DFS_FD_MAX? DFS_FD_MAX : cnt; + cnt = cnt > DFS_FD_MAX ? DFS_FD_MAX : cnt; fds = rt_realloc(fdt->fds, cnt * sizeof(struct dfs_fd *)); if (fds == NULL) goto __exit; /* return fdt->maxfd */ @@ -189,7 +189,7 @@ int fd_new(void) if (idx == fdt->maxfd) { idx = -(1 + DFS_FD_OFFSET); - LOG_E( "DFS fd new is failed! Could not found an empty fd entry."); + LOG_E("DFS fd new is failed! Could not found an empty fd entry."); goto __result; } @@ -400,7 +400,7 @@ char *dfs_normalize_path(const char *directory, const char *filename) /* join path and file name */ rt_snprintf(fullpath, strlen(directory) + strlen(filename) + 2, - "%s/%s", directory, filename); + "%s/%s", directory, filename); } else { @@ -499,7 +499,7 @@ RTM_EXPORT(dfs_normalize_path); /** * This function will get the file descriptor table of current process. */ -struct dfs_fdtable* dfs_fdtable_get(void) +struct dfs_fdtable *dfs_fdtable_get(void) { struct dfs_fdtable *fdt; #ifdef RT_USING_LWP @@ -523,12 +523,12 @@ int list_fd(void) { int index; struct dfs_fdtable *fd_table; - + fd_table = dfs_fdtable_get(); if (!fd_table) return -1; rt_enter_critical(); - + rt_kprintf("fd type ref magic path\n"); rt_kprintf("-- ------ --- ----- ------\n"); for (index = 0; index < (int)fd_table->maxfd; index ++) diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index b4f115ffc2..81cab2ed79 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -2,7 +2,7 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2005-02-22 Bernard The first version. @@ -543,7 +543,8 @@ void ls(const char *pathname) rt_kprintf("BAD file: %s\n", dirent.d_name); rt_free(fullpath); } - }while(length > 0); + } + while (length > 0); dfs_file_close(&fd); } @@ -565,7 +566,7 @@ void rm(const char *filename) } FINSH_FUNCTION_EXPORT(rm, remove files or directories); -void cat(const char* filename) +void cat(const char *filename) { uint32_t length; char buffer[81]; @@ -580,12 +581,13 @@ void cat(const char* filename) do { memset(buffer, 0, sizeof(buffer)); - length = dfs_file_read(&fd, buffer, sizeof(buffer)-1 ); + length = dfs_file_read(&fd, buffer, sizeof(buffer) - 1); if (length > 0) { rt_kprintf("%s", buffer); } - }while (length > 0); + } + while (length > 0); dfs_file_close(&fd); } @@ -638,7 +640,8 @@ static void copyfile(const char *src, const char *dst) break; } } - } while (read_bytes > 0); + } + while (read_bytes > 0); dfs_file_close(&src_fd); dfs_file_close(&fd); @@ -646,7 +649,7 @@ static void copyfile(const char *src, const char *dst) } extern int mkdir(const char *path, mode_t mode); -static void copydir(const char * src, const char * dst) +static void copydir(const char *src, const char *dst) { struct dirent dirent; struct stat stat; @@ -665,8 +668,8 @@ static void copydir(const char * src, const char * dst) length = dfs_file_getdents(&cpfd, &dirent, sizeof(struct dirent)); if (length > 0) { - char * src_entry_full = NULL; - char * dst_entry_full = NULL; + char *src_entry_full = NULL; + char *dst_entry_full = NULL; if (strcmp(dirent.d_name, "..") == 0 || strcmp(dirent.d_name, ".") == 0) continue; @@ -703,14 +706,15 @@ static void copydir(const char * src, const char * dst) rt_free(src_entry_full); rt_free(dst_entry_full); } - }while(length > 0); + } + while (length > 0); dfs_file_close(&cpfd); } static const char *_get_path_lastname(const char *path) { - char * ptr; + char *ptr; if ((ptr = strrchr(path, '/')) == NULL) return path; @@ -767,7 +771,7 @@ void copy(const char *src, const char *dst) { if (flag & FLAG_DST_IS_DIR) { - char * fdst; + char *fdst; fdst = dfs_normalize_path(dst, _get_path_lastname(src)); if (fdst == NULL) { @@ -786,7 +790,7 @@ void copy(const char *src, const char *dst) { if (flag & FLAG_DST_IS_DIR) { - char * fdst; + char *fdst; fdst = dfs_normalize_path(dst, _get_path_lastname(src)); if (fdst == NULL) { diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index a183e7f124..774d008ce6 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -38,7 +38,7 @@ int dfs_register(const struct dfs_filesystem_ops *ops) dfs_lock(); /* check if this filesystem was already registered */ for (iter = &filesystem_operation_table[0]; - iter < &filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX]; iter ++) + iter < &filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX]; iter ++) { /* find out an empty filesystem type entry */ if (*iter == NULL) @@ -120,9 +120,9 @@ struct dfs_filesystem *dfs_filesystem_lookup(const char *path) * * @return the mounted path or NULL if none device mounted. */ -const char* dfs_filesystem_get_mounted_path(struct rt_device* device) +const char *dfs_filesystem_get_mounted_path(struct rt_device *device) { - const char* path = NULL; + const char *path = NULL; struct dfs_filesystem *iter; dfs_lock(); @@ -154,8 +154,8 @@ const char* dfs_filesystem_get_mounted_path(struct rt_device* device) * @return RT_EOK on successful or -RT_ERROR on failed. */ int dfs_filesystem_get_partition(struct dfs_partition *part, - uint8_t *buf, - uint32_t pindex) + uint8_t *buf, + uint32_t pindex) { #define DPT_ADDRESS 0x1be /* device partition offset in Boot Sector */ #define DPT_ITEM_SIZE 16 /* partition item size */ @@ -173,28 +173,28 @@ int dfs_filesystem_get_partition(struct dfs_partition *part, return -EIO; /* get partition type */ - type = *(dpt+4); + type = *(dpt + 4); if (type == 0) return -EIO; /* set partition information * size is the number of 512-Byte */ part->type = type; - part->offset = *(dpt+8) | *(dpt+9)<<8 | *(dpt+10)<<16 | *(dpt+11)<<24; - part->size = *(dpt+12) | *(dpt+13)<<8 | *(dpt+14)<<16 | *(dpt+15)<<24; + part->offset = *(dpt + 8) | *(dpt + 9) << 8 | *(dpt + 10) << 16 | *(dpt + 11) << 24; + part->size = *(dpt + 12) | *(dpt + 13) << 8 | *(dpt + 14) << 16 | *(dpt + 15) << 24; rt_kprintf("found part[%d], begin: %d, size: ", - pindex, part->offset*512); - if ((part->size>>11) == 0) - rt_kprintf("%d%s",part->size>>1,"KB\n"); /* KB */ + pindex, part->offset * 512); + if ((part->size >> 11) == 0) + rt_kprintf("%d%s", part->size >> 1, "KB\n"); /* KB */ else { unsigned int part_size; part_size = part->size >> 11; /* MB */ - if ((part_size>>10) == 0) - rt_kprintf("%d.%d%s",part_size,(part->size>>1)&0x3FF,"MB\n"); + if ((part_size >> 10) == 0) + rt_kprintf("%d.%d%s", part_size, (part->size >> 1) & 0x3FF, "MB\n"); else - rt_kprintf("%d.%d%s",part_size>>10,part_size&0x3FF,"GB\n"); + rt_kprintf("%d.%d%s", part_size >> 10, part_size & 0x3FF, "GB\n"); } return RT_EOK; @@ -240,7 +240,7 @@ int dfs_mount(const char *device_name, dfs_lock(); for (ops = &filesystem_operation_table[0]; - ops < &filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX]; ops++) + ops < &filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX]; ops++) if ((*ops != NULL) && (strcmp((*ops)->name, filesystemtype) == 0)) break; @@ -503,13 +503,13 @@ int dfs_mount_table(void) if (mount_table[index].path == NULL) break; if (dfs_mount(mount_table[index].device_name, - mount_table[index].path, - mount_table[index].filesystemtype, - mount_table[index].rwflag, - mount_table[index].data) != 0) + mount_table[index].path, + mount_table[index].filesystemtype, + mount_table[index].rwflag, + mount_table[index].data) != 0) { rt_kprintf("mount fs[%s] on %s failed.\n", mount_table[index].filesystemtype, - mount_table[index].path); + mount_table[index].path); return -RT_ERROR; } @@ -555,7 +555,7 @@ int df(const char *path) } rt_kprintf("disk free: %d.%d %s [ %d block, %d bytes per block ]\n", - (unsigned long)cap, minor, unit_str[unit_index], buffer.f_bfree, buffer.f_bsize); + (unsigned long)cap, minor, unit_str[unit_index], buffer.f_bfree, buffer.f_bsize); return 0; } FINSH_FUNCTION_EXPORT(df, get disk free); diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index f47a60ee5d..6d643e2d4a 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -423,11 +423,11 @@ int fcntl(int fildes, int cmd, ...) d = fd_get(fildes); if (d) { - void* arg; + void *arg; va_list ap; va_start(ap, cmd); - arg = va_arg(ap, void*); + arg = va_arg(ap, void *); va_end(ap); ret = dfs_file_ioctl(d, cmd, arg); @@ -459,11 +459,11 @@ RTM_EXPORT(fcntl); */ int ioctl(int fildes, int cmd, ...) { - void* arg; + void *arg; va_list ap; va_start(ap, cmd); - arg = va_arg(ap, void*); + arg = va_arg(ap, void *); va_end(ap); /* we use fcntl for this API. */ @@ -645,8 +645,8 @@ struct dirent *readdir(DIR *d) if (d->num) { - struct dirent* dirent_ptr; - dirent_ptr = (struct dirent*)&d->buf[d->cur]; + struct dirent *dirent_ptr; + dirent_ptr = (struct dirent *)&d->buf[d->cur]; d->cur += dirent_ptr->d_reclen; } @@ -654,7 +654,7 @@ struct dirent *readdir(DIR *d) { /* get a new entry */ result = dfs_file_getdents(fd, - (struct dirent*)d->buf, + (struct dirent *)d->buf, sizeof(d->buf) - 1); if (result <= 0) { @@ -670,7 +670,7 @@ struct dirent *readdir(DIR *d) fd_put(fd); - return (struct dirent *)(d->buf+d->cur); + return (struct dirent *)(d->buf + d->cur); } RTM_EXPORT(readdir); diff --git a/components/dfs/src/poll.c b/components/dfs/src/poll.c index 6f83762082..aee157eed5 100644 --- a/components/dfs/src/poll.c +++ b/components/dfs/src/poll.c @@ -132,7 +132,7 @@ static int do_pollfd(struct pollfd *pollfd, rt_pollreq_t *req) mask = POLLMASK_DEFAULT; if (f->fops->poll) { - req->_key = pollfd->events | POLLERR| POLLHUP; + req->_key = pollfd->events | POLLERR | POLLHUP; mask = f->fops->poll(f, req); } diff --git a/components/dfs/src/select.c b/components/dfs/src/select.c index b9a444fe44..b20f7cf656 100644 --- a/components/dfs/src/select.c +++ b/components/dfs/src/select.c @@ -18,12 +18,12 @@ static void fdszero(fd_set *set, int nfds) { fd_mask *m; int n; - + /* The 'sizeof(fd_set)' of the system space may differ from user space, so the actual size of the 'fd_set' is determined here with the parameter 'nfds' */ - m = (fd_mask*)set; + m = (fd_mask *)set; for (n = 0; n < nfds; n += (sizeof(fd_mask) * 8)) { rt_memset(m, 0, sizeof(fd_mask)); -- cgit v1.3.1 From fa4d4ab7cf774ccb701d01a6fd1371ce8d9474e9 Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 12 Apr 2019 10:18:57 +0800 Subject: Update all of debug log definition to DBG_TAG and DBG_LVL. --- bsp/allwinner_tina/drivers/drv_gpio.c | 4 ++-- bsp/allwinner_tina/drivers/drv_sdio.c | 10 +++++----- bsp/allwinner_tina/drivers/spi/drv_spi.c | 6 +++--- bsp/allwinner_tina/drivers/spi/drv_spi_flash.c | 4 ++-- bsp/amebaz/drivers/wlan/drv_wifi.c | 4 ++-- bsp/imxrt/Libraries/imxrt1021/drivers/drv_eth.c | 7 +++---- bsp/imxrt/Libraries/imxrt1021/drivers/drv_flexspi_nor.c | 4 ++-- bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c | 4 ++-- bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c | 4 ++-- bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c | 4 ++-- bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c | 4 ++-- bsp/k210/driver/drv_gpio.c | 4 ++-- bsp/k210/driver/drv_lcd.c | 6 ++---- bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c | 10 +++++----- bsp/qemu-vexpress-a9/drivers/drv_keyboard.c | 2 +- bsp/qemu-vexpress-a9/drivers/drv_mouse.c | 4 ++-- bsp/qemu-vexpress-a9/drivers/drv_sdio.c | 4 ++-- bsp/stm32/libraries/HAL_Drivers/drv_log.h | 8 ++++---- bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c | 4 ++-- bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c | 4 ++-- bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c | 4 ++-- bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c | 4 ++-- bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c | 4 ++-- bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c | 4 ++-- bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c | 4 ++-- bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c | 5 ++--- bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c | 5 ++--- bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c | 5 ++--- bsp/stm32f429-apollo/drivers/audio/drv_mic.c | 4 ++-- bsp/stm32f429-apollo/drivers/audio/drv_sound.c | 4 ++-- bsp/w60x/drivers/drv_wifi.c | 6 ++---- bsp/x1000/drivers/mmc/drv_mmc.c | 4 ++-- components/dfs/include/dfs_private.h | 4 ++-- components/drivers/misc/adc.c | 4 ++-- components/drivers/sdio/block_dev.c | 6 +++--- components/drivers/sdio/mmc.c | 6 +++--- components/drivers/sdio/mmcsd_core.c | 6 +++--- components/drivers/sdio/sd.c | 6 +++--- components/drivers/sdio/sdio.c | 6 +++--- components/drivers/sensors/sensor.c | 4 ++-- components/drivers/sensors/sensor_cmd.c | 4 ++-- components/drivers/serial/serial.c | 4 ++-- components/drivers/wlan/wlan_cfg.c | 8 ++++---- components/drivers/wlan/wlan_dev.c | 8 ++++---- components/drivers/wlan/wlan_lwip.c | 8 ++++---- components/drivers/wlan/wlan_mgnt.c | 9 ++++----- components/drivers/wlan/wlan_prot.c | 8 ++++---- components/drivers/wlan/wlan_workqueue.c | 4 ++-- components/libc/libdl/dlelf.c | 4 ++-- components/libc/libdl/dlmodule.c | 4 ++-- components/lwp/lwp.c | 4 ++-- components/lwp/lwp_mem.c | 4 ++-- components/lwp/lwp_syscall.c | 4 ++-- components/net/at/include/at_log.h | 8 ++++---- components/net/sal_socket/src/sal_socket.c | 4 ++-- components/utilities/ulog/ulog_def.h | 8 ++++++-- components/utilities/utest/utest.c | 10 +++++----- components/utilities/utest/utest_log.h | 10 +++++----- examples/network/tcpclient.c | 6 +++--- examples/network/tcpserver.c | 6 +++--- examples/network/udpclient.c | 6 +++--- examples/network/udpserver.c | 6 +++--- src/signal.c | 4 ++-- 63 files changed, 166 insertions(+), 171 deletions(-) (limited to 'components/dfs/include') diff --git a/bsp/allwinner_tina/drivers/drv_gpio.c b/bsp/allwinner_tina/drivers/drv_gpio.c index e8d82a3fae..b121842b30 100644 --- a/bsp/allwinner_tina/drivers/drv_gpio.c +++ b/bsp/allwinner_tina/drivers/drv_gpio.c @@ -27,8 +27,8 @@ #include "drv_gpio.h" #include "interrupt.h" -#define DBG_SECTION_NAME "GPIO" -#define DBG_LEVEL DBG_WARNING +#define DBG_TAG "GPIO" +#define DBG_LVL DBG_WARNING #include #define readl(addr) (*(volatile unsigned int *)(addr)) diff --git a/bsp/allwinner_tina/drivers/drv_sdio.c b/bsp/allwinner_tina/drivers/drv_sdio.c index c1b4bcc41c..11b5a63d02 100644 --- a/bsp/allwinner_tina/drivers/drv_sdio.c +++ b/bsp/allwinner_tina/drivers/drv_sdio.c @@ -33,11 +33,11 @@ #include "drv_clock.h" -#define DBG_SECTION_NAME "MMC" -// #define DBG_LEVEL DBG_LOG -// #define DBG_LEVEL DBG_INFO -#define DBG_LEVEL DBG_WARNING -// #define DBG_LEVEL DBG_ERROR +#define DBG_TAG "MMC" +// #define DBG_LVL DBG_LOG +// #define DBG_LVL DBG_INFO +#define DBG_LVL DBG_WARNING +// #define DBG_LVL DBG_ERROR #include #ifdef RT_USING_SDIO diff --git a/bsp/allwinner_tina/drivers/spi/drv_spi.c b/bsp/allwinner_tina/drivers/spi/drv_spi.c index a271c2e7d9..506b0cae99 100644 --- a/bsp/allwinner_tina/drivers/spi/drv_spi.c +++ b/bsp/allwinner_tina/drivers/spi/drv_spi.c @@ -35,11 +35,11 @@ //#define DEBUG -#define DBG_SECTION_NAME "SPI" +#define DBG_TAG "SPI" #ifdef DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_WARNING +#define DBG_LVL DBG_WARNING #endif /* DEBUG */ #include diff --git a/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c b/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c index 0b01200ee8..e507859928 100644 --- a/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c +++ b/bsp/allwinner_tina/drivers/spi/drv_spi_flash.c @@ -26,8 +26,8 @@ #include #include -#define DBG_SECTION_NAME "FLASH" -#define DBG_LEVEL DBG_LOG +#define DBG_TAG "FLASH" +#define DBG_LVL DBG_LOG #include #define SPI_FLASH_DEVICE_NAME "spi00" diff --git a/bsp/amebaz/drivers/wlan/drv_wifi.c b/bsp/amebaz/drivers/wlan/drv_wifi.c index 753952df43..12865bfc3b 100644 --- a/bsp/amebaz/drivers/wlan/drv_wifi.c +++ b/bsp/amebaz/drivers/wlan/drv_wifi.c @@ -28,8 +28,8 @@ #include "drv_wlan.h" #include "drv_wifi.h" -#define DBG_LEVEL DBG_INFO -#define DBG_SECTION_NAME "WIFI" +#define DBG_LVL DBG_INFO +#define DBG_TAG "WIFI" #include #define MAX_ADDR_LEN (6) diff --git a/bsp/imxrt/Libraries/imxrt1021/drivers/drv_eth.c b/bsp/imxrt/Libraries/imxrt1021/drivers/drv_eth.c index 24b8e51736..15aa05e838 100644 --- a/bsp/imxrt/Libraries/imxrt1021/drivers/drv_eth.c +++ b/bsp/imxrt/Libraries/imxrt1021/drivers/drv_eth.c @@ -40,10 +40,9 @@ //#define ETH_RX_DUMP //#define ETH_TX_DUMP -#define DBG_ENABLE -#define DBG_SECTION_NAME "ETH" -#define DBG_COLOR -#define DBG_LEVEL DBG_INFO + +#define DBG_TAG "ETH" +#define DBG_LVL DBG_INFO #include #define MAX_ADDR_LEN 6 diff --git a/bsp/imxrt/Libraries/imxrt1021/drivers/drv_flexspi_nor.c b/bsp/imxrt/Libraries/imxrt1021/drivers/drv_flexspi_nor.c index 0e49ae01fb..fc69e65375 100644 --- a/bsp/imxrt/Libraries/imxrt1021/drivers/drv_flexspi_nor.c +++ b/bsp/imxrt/Libraries/imxrt1021/drivers/drv_flexspi_nor.c @@ -14,8 +14,8 @@ #include #include "drv_flexspi.h" -#define DBG_SECTION_NAME "FLEXSPI" -#define DBG_LEVEL DBG_LOG +#define DBG_TAG "FLEXSPI" +#define DBG_LVL DBG_LOG #include #define FLEXSPI_CLOCK kCLOCK_FlexSpi diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c index efc5cb9ca9..cc591b944a 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth.c @@ -46,8 +46,8 @@ //#define ETH_RX_DUMP //#define ETH_TX_DUMP -#define DBG_SECTION_NAME "ETH" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "ETH" +#define DBG_LVL DBG_INFO #include #define MAX_ADDR_LEN 6 diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c index 1cae69ba17..ef6008ca78 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_eth_fire.c @@ -37,8 +37,8 @@ //#define ETH_RX_DUMP //#define ETH_TX_DUMP -#define DBG_SECTION_NAME "ETH" -#define DBG_LEVEL DBG_LOG +#define DBG_TAG "ETH" +#define DBG_LVL DBG_LOG #include #define MAX_ADDR_LEN 6 diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c index 5ca326070c..5e0192f8ba 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_hyper.c @@ -14,8 +14,8 @@ #include #include "drv_flexspi.h" -#define DBG_SECTION_NAME "Hyper" -#define DBG_LEVEL DBG_LOG +#define DBG_TAG "Hyper" +#define DBG_LVL DBG_LOG #include #define FLEXSPI_CLOCK kCLOCK_FlexSpi diff --git a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c index 4e9e738b6c..05b4e32331 100644 --- a/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c +++ b/bsp/imxrt/Libraries/imxrt1050/drivers/drv_flexspi_nor.c @@ -13,8 +13,8 @@ #include #include "drv_flexspi.h" -#define DBG_SECTION_NAME "FLEXSPI" -#define DBG_LEVEL DBG_LOG +#define DBG_TAG "FLEXSPI" +#define DBG_LVL DBG_LOG #include #define FLEXSPI_CLOCK kCLOCK_FlexSpi diff --git a/bsp/k210/driver/drv_gpio.c b/bsp/k210/driver/drv_gpio.c index 25ee6f68b0..4efce0e827 100644 --- a/bsp/k210/driver/drv_gpio.c +++ b/bsp/k210/driver/drv_gpio.c @@ -20,8 +20,8 @@ #include #define DBG_ENABLE -#define DBG_SECTION_NAME "PIN" -#define DBG_LEVEL DBG_WARNING +#define DBG_TAG "PIN" +#define DBG_LVL DBG_WARNING #define DBG_COLOR #include diff --git a/bsp/k210/driver/drv_lcd.c b/bsp/k210/driver/drv_lcd.c index cd7d11bbb5..2719391154 100644 --- a/bsp/k210/driver/drv_lcd.c +++ b/bsp/k210/driver/drv_lcd.c @@ -21,10 +21,8 @@ #include #include -#define DBG_ENABLE -#define DBG_SECTION_NAME "LCD" -#define DBG_LEVEL DBG_WARNING -#define DBG_COLOR +#define DBG_TAG "LCD" +#define DBG_LVL DBG_WARNING #include #define NO_OPERATION 0x00 diff --git a/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c b/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c index 68f8f09c10..51cf3710ef 100644 --- a/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c +++ b/bsp/qemu-vexpress-a9/drivers/audio/drv_pl041.c @@ -28,11 +28,11 @@ #include "drv_ac97.h" #include "realview.h" -#define DBG_SECTION_NAME "PL041" -// #define DBG_LEVEL DBG_LOG -// #define DBG_LEVEL DBG_INFO -#define DBG_LEVEL DBG_WARNING -// #define DBG_LEVEL DBG_ERROR +#define DBG_TAG "PL041" +// #define DBG_LVL DBG_LOG +// #define DBG_LVL DBG_INFO +#define DBG_LVL DBG_WARNING +// #define DBG_LVL DBG_ERROR #include #define FRAME_PERIOD_US (50) diff --git a/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c b/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c index 4948f46117..246e053a60 100644 --- a/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c +++ b/bsp/qemu-vexpress-a9/drivers/drv_keyboard.c @@ -6,7 +6,7 @@ #include "interrupt.h" #include "drv_keyboard.h" -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #include "rtdbg.h" #define KEYBOARD_ADDRESS (0x10006000) diff --git a/bsp/qemu-vexpress-a9/drivers/drv_mouse.c b/bsp/qemu-vexpress-a9/drivers/drv_mouse.c index 852cc56129..07e3ed16f6 100644 --- a/bsp/qemu-vexpress-a9/drivers/drv_mouse.c +++ b/bsp/qemu-vexpress-a9/drivers/drv_mouse.c @@ -7,8 +7,8 @@ #include "drv_mouse.h" #include "drv_clcd.h" -#define DBG_SECTION_NAME "drv.mouse" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "drv.mouse" +#define DBG_LVL DBG_INFO #include "rtdbg.h" #define MOUSE_ADDRESS (0x10007000) diff --git a/bsp/qemu-vexpress-a9/drivers/drv_sdio.c b/bsp/qemu-vexpress-a9/drivers/drv_sdio.c index c031011e51..17c6b11f57 100644 --- a/bsp/qemu-vexpress-a9/drivers/drv_sdio.c +++ b/bsp/qemu-vexpress-a9/drivers/drv_sdio.c @@ -77,8 +77,8 @@ #define PL180_CLR_DAT_END (1 << 8) #define PL180_CLR_DAT_BLK_END (1 << 10) -#define DBG_SECTION_NAME "drv.sdio" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "drv.sdio" +#define DBG_LVL DBG_INFO #include "rtdbg.h" struct sdhci_pl180_pdata_t diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_log.h b/bsp/stm32/libraries/HAL_Drivers/drv_log.h index 69328b368a..7e0bfee5b4 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_log.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_log.h @@ -13,15 +13,15 @@ */ #ifndef LOG_TAG -#define DBG_SECTION_NAME "drv" +#define DBG_TAG "drv" #else -#define DBG_SECTION_NAME LOG_TAG +#define DBG_TAG LOG_TAG #endif /* LOG_TAG */ #ifdef DRV_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif /* DRV_DEBUG */ #include diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c b/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c index 45c8a6d74d..bf5f3e10a7 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c @@ -16,8 +16,8 @@ #include #include -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c index 625cec463d..0a9c36fd42 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/sdcard_port.c @@ -16,8 +16,8 @@ #include #include -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c index 0eb7035ddf..b46537d311 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c @@ -16,8 +16,8 @@ #include #include -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c index 625cec463d..0a9c36fd42 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c @@ -16,8 +16,8 @@ #include #include -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c index c7200001e3..d7b740ae47 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c @@ -17,8 +17,8 @@ #include #include "drv_gpio.h" -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include #define WIFI_RESET_PIN GET_PIN(G, 9) diff --git a/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c b/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c index 143576eb12..0797f9326c 100644 --- a/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c @@ -16,8 +16,8 @@ #include #include -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c b/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c index 625cec463d..0a9c36fd42 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c @@ -16,8 +16,8 @@ #include #include -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c b/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c index b8db33d0d2..615ad6e06e 100644 --- a/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f767-fire-challenger/board/ports/sdcard_port.c @@ -17,9 +17,8 @@ #include #include "drv_gpio.h" - -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include #define WIFI_RESET_PIN GET_PIN(G, 9) diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c index 11c66f34b7..e1af109455 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c @@ -18,9 +18,8 @@ #include "drv_spi.h" #include "spi_msd.h" - -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c b/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c index 54b5af7ed6..8a2c1cade7 100644 --- a/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c @@ -16,9 +16,8 @@ #include #include - -#define DBG_SECTION_NAME "app.card" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "app.card" +#define DBG_LVL DBG_INFO #include void sd_mount(void *parameter) diff --git a/bsp/stm32f429-apollo/drivers/audio/drv_mic.c b/bsp/stm32f429-apollo/drivers/audio/drv_mic.c index 3dab97c60a..745fb53869 100644 --- a/bsp/stm32f429-apollo/drivers/audio/drv_mic.c +++ b/bsp/stm32f429-apollo/drivers/audio/drv_mic.c @@ -18,8 +18,8 @@ #include "drv_wm8978.h" #include -#define DBG_LEVEL DBG_INFO -#define DBG_SECTION_NAME "MIC" +#define DBG_TAG "MIC" +#define DBG_LVL DBG_INFO #include struct micphone_device diff --git a/bsp/stm32f429-apollo/drivers/audio/drv_sound.c b/bsp/stm32f429-apollo/drivers/audio/drv_sound.c index 5bebc01470..b35be5af61 100644 --- a/bsp/stm32f429-apollo/drivers/audio/drv_sound.c +++ b/bsp/stm32f429-apollo/drivers/audio/drv_sound.c @@ -19,8 +19,8 @@ #include "drv_wm8978.h" #include -#define DBG_LEVEL DBG_LOG -#define DBG_SECTION_NAME "Sound" +#define DBG_TAG "Sound" +#define DBG_LVL DBG_LOG #include /** diff --git a/bsp/w60x/drivers/drv_wifi.c b/bsp/w60x/drivers/drv_wifi.c index b7bc9eb459..2ae441b420 100644 --- a/bsp/w60x/drivers/drv_wifi.c +++ b/bsp/w60x/drivers/drv_wifi.c @@ -14,10 +14,8 @@ #include "wm_wifi.h" #include "drv_wifi.h" -#define DBG_ENABLE -#define DBG_LEVEL DBG_INFO -#define DBG_SECTION_NAME "WIFI" -#define DBG_COLOR +#define DBG_TAG "WIFI" +#define DBG_LVL DBG_INFO #include #include "wm_ram_config.h" diff --git a/bsp/x1000/drivers/mmc/drv_mmc.c b/bsp/x1000/drivers/mmc/drv_mmc.c index d2b0016f4b..8e6e86c942 100644 --- a/bsp/x1000/drivers/mmc/drv_mmc.c +++ b/bsp/x1000/drivers/mmc/drv_mmc.c @@ -33,8 +33,8 @@ #define DMA_ALIGN (32U) #define PIO_THRESHOLD 64 /* use pio mode if data length < PIO_THRESHOLD */ -#define DBG_SECTION_NAME "SDIO" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "SDIO" +#define DBG_LVL DBG_INFO #include /* diff --git a/components/dfs/include/dfs_private.h b/components/dfs/include/dfs_private.h index 77dbe8562d..fccd260ac0 100644 --- a/components/dfs/include/dfs_private.h +++ b/components/dfs/include/dfs_private.h @@ -12,8 +12,8 @@ #include -#define DBG_SECTION_NAME "DFS" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "DFS" +#define DBG_LVL DBG_INFO #include #define NO_WORKING_DIR "system does not support working directory\n" diff --git a/components/drivers/misc/adc.c b/components/drivers/misc/adc.c index fec4f736e0..2d26beb243 100644 --- a/components/drivers/misc/adc.c +++ b/components/drivers/misc/adc.c @@ -15,8 +15,8 @@ #include #include -#define DBG_SECTION_NAME "adc" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "adc" +#define DBG_LVL DBG_INFO #include static rt_size_t _adc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index dcfbc0ca7b..cac4fc5036 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -13,11 +13,11 @@ #include -#define DBG_SECTION_NAME "SDIO" +#define DBG_TAG "SDIO" #ifdef RT_SDIO_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif /* RT_SDIO_DEBUG */ #include diff --git a/components/drivers/sdio/mmc.c b/components/drivers/sdio/mmc.c index 5f9259ef52..5c7ddcb258 100644 --- a/components/drivers/sdio/mmc.c +++ b/components/drivers/sdio/mmc.c @@ -11,11 +11,11 @@ #include #include -#define DBG_SECTION_NAME "SDIO" +#define DBG_TAG "SDIO" #ifdef RT_SDIO_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif /* RT_SDIO_DEBUG */ #include diff --git a/components/drivers/sdio/mmcsd_core.c b/components/drivers/sdio/mmcsd_core.c index 160defa645..8131a33133 100644 --- a/components/drivers/sdio/mmcsd_core.c +++ b/components/drivers/sdio/mmcsd_core.c @@ -14,11 +14,11 @@ #include #include -#define DBG_SECTION_NAME "SDIO" +#define DBG_TAG "SDIO" #ifdef RT_SDIO_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif /* RT_SDIO_DEBUG */ #include diff --git a/components/drivers/sdio/sd.c b/components/drivers/sdio/sd.c index f4e925507c..3e7ad1cd16 100644 --- a/components/drivers/sdio/sd.c +++ b/components/drivers/sdio/sd.c @@ -11,11 +11,11 @@ #include #include -#define DBG_SECTION_NAME "SDIO" +#define DBG_TAG "SDIO" #ifdef RT_SDIO_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif /* RT_SDIO_DEBUG */ #include diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c index b0516704fd..f31f5b81a8 100644 --- a/components/drivers/sdio/sdio.c +++ b/components/drivers/sdio/sdio.c @@ -12,11 +12,11 @@ #include #include -#define DBG_SECTION_NAME "SDIO" +#define DBG_TAG "SDIO" #ifdef RT_SDIO_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif /* RT_SDIO_DEBUG */ #include diff --git a/components/drivers/sensors/sensor.c b/components/drivers/sensors/sensor.c index ec1ad98fb6..c86f96c14d 100644 --- a/components/drivers/sensors/sensor.c +++ b/components/drivers/sensors/sensor.c @@ -10,8 +10,8 @@ #include "sensor.h" -#define DBG_LEVEL DBG_INFO -#define DBG_SECTION_NAME "sensor" +#define DBG_TAG "sensor" +#define DBG_LVL DBG_INFO #include #include diff --git a/components/drivers/sensors/sensor_cmd.c b/components/drivers/sensors/sensor_cmd.c index 4658a42722..3369ee376a 100644 --- a/components/drivers/sensors/sensor_cmd.c +++ b/components/drivers/sensors/sensor_cmd.c @@ -10,8 +10,8 @@ #include "sensor.h" -#define DBG_LEVEL DBG_INFO -#define DBG_SECTION_NAME "sensor.cmd" +#define DBG_TAG "sensor.cmd" +#define DBG_LVL DBG_INFO #include #include diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 13bf54e721..d4cf35414c 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -28,8 +28,8 @@ #include #include -#define DBG_LEVEL DBG_INFO -#define DBG_SECTION_NAME "UART" +#define DBG_TAG "UART" +#define DBG_LVL DBG_INFO #include #ifdef RT_USING_POSIX diff --git a/components/drivers/wlan/wlan_cfg.c b/components/drivers/wlan/wlan_cfg.c index 00e9dbc83e..43fed8e6e8 100644 --- a/components/drivers/wlan/wlan_cfg.c +++ b/components/drivers/wlan/wlan_cfg.c @@ -11,12 +11,12 @@ #include #include +#define DBG_TAG "WLAN.cfg" #ifdef RT_WLAN_CFG_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO -#endif -#define DBG_SECTION_NAME "WLAN.cfg" +#define DBG_LVL DBG_INFO +#endif /* RT_WLAN_CFG_DEBUG */ #include #define WLAN_CFG_LOCK() (rt_mutex_take(&cfg_mutex, RT_WAITING_FOREVER)) diff --git a/components/drivers/wlan/wlan_dev.c b/components/drivers/wlan/wlan_dev.c index 3f4adf35ad..82fa4e73e7 100644 --- a/components/drivers/wlan/wlan_dev.c +++ b/components/drivers/wlan/wlan_dev.c @@ -13,12 +13,12 @@ #include #include +#define DBG_TAG "WLAN.dev" #ifdef RT_WLAN_DEV_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO -#endif -#define DBG_SECTION_NAME "WLAN.dev" +#define DBG_LVL DBG_INFO +#endif /* RT_WLAN_DEV_DEBUG */ #include #ifndef RT_DEVICE diff --git a/components/drivers/wlan/wlan_lwip.c b/components/drivers/wlan/wlan_lwip.c index 052c2afd2e..84b448c68f 100644 --- a/components/drivers/wlan/wlan_lwip.c +++ b/components/drivers/wlan/wlan_lwip.c @@ -21,12 +21,12 @@ #include #endif +#define DBG_TAG "WLAN.lwip" #ifdef RT_WLAN_LWIP_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO -#endif -#define DBG_SECTION_NAME "WLAN.lwip" +#define DBG_LVL DBG_INFO +#endif /* RT_WLAN_LWIP_DEBUG */ #include #ifndef IPADDR_STRLEN_MAX diff --git a/components/drivers/wlan/wlan_mgnt.c b/components/drivers/wlan/wlan_mgnt.c index ced5bfa1c2..91a77e43d0 100644 --- a/components/drivers/wlan/wlan_mgnt.c +++ b/components/drivers/wlan/wlan_mgnt.c @@ -16,13 +16,12 @@ #include #include - +#define DBG_TAG "WLAN.mgnt" #ifdef RT_WLAN_MGNT_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO -#endif -#define DBG_SECTION_NAME "WLAN.mgnt" +#define DBG_LVL DBG_INFO +#endif /* RT_WLAN_MGNT_DEBUG */ #include #ifndef RT_WLAN_DEVICE diff --git a/components/drivers/wlan/wlan_prot.c b/components/drivers/wlan/wlan_prot.c index 48adbc48f3..0402962e01 100644 --- a/components/drivers/wlan/wlan_prot.c +++ b/components/drivers/wlan/wlan_prot.c @@ -13,12 +13,12 @@ #include #include +#define DBG_TAG "WLAN.prot" #ifdef RT_WLAN_PROT_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO -#endif -#define DBG_SECTION_NAME "WLAN.prot" +#define DBG_LVL DBG_INFO +#endif /* RT_WLAN_PROT_DEBUG */ #include #if RT_WLAN_PROT_NAME_LEN < 4 diff --git a/components/drivers/wlan/wlan_workqueue.c b/components/drivers/wlan/wlan_workqueue.c index 23823afae0..ec21243d60 100644 --- a/components/drivers/wlan/wlan_workqueue.c +++ b/components/drivers/wlan/wlan_workqueue.c @@ -13,8 +13,8 @@ #include #include -#define DBG_LEVEL DBG_INFO -#define DBG_SECTION_NAME "WLAN.work" +#define DBG_TAG "WLAN.work" +#define DBG_LVL DBG_INFO #include struct rt_wlan_work diff --git a/components/libc/libdl/dlelf.c b/components/libc/libdl/dlelf.c index 4557ee3458..1265ffcb07 100644 --- a/components/libc/libdl/dlelf.c +++ b/components/libc/libdl/dlelf.c @@ -11,8 +11,8 @@ #include "dlmodule.h" #include "dlelf.h" -#define DBG_SECTION_NAME "DLMD" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "DLMD" +#define DBG_LVL DBG_INFO #include // must after of DEBUG_ENABLE or some other options rt_err_t dlmodule_load_shared_object(struct rt_dlmodule* module, void *module_ptr) diff --git a/components/libc/libdl/dlmodule.c b/components/libc/libdl/dlmodule.c index 14cbfe4cfb..dbebfc8961 100644 --- a/components/libc/libdl/dlmodule.c +++ b/components/libc/libdl/dlmodule.c @@ -16,8 +16,8 @@ #include -#define DBG_SECTION_NAME "DLMD" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "DLMD" +#define DBG_LVL DBG_INFO #include // must after of DEBUG_ENABLE or some other options static struct rt_module_symtab *_rt_module_symtab_begin = RT_NULL; diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index e1ba26f21c..7881fcc68f 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -19,8 +19,8 @@ #include "lwp.h" -#define DBG_SECTION_NAME "LWP" -#define DBG_LEVEL DBG_WARNING +#define DBG_TAG "LWP" +#define DBG_LVL DBG_WARNING #include extern void lwp_user_entry(void *args, const void *text, void *data); diff --git a/components/lwp/lwp_mem.c b/components/lwp/lwp_mem.c index e733166934..63fd5c89e1 100644 --- a/components/lwp/lwp_mem.c +++ b/components/lwp/lwp_mem.c @@ -11,8 +11,8 @@ #include #include -#define DBG_SECTION_NAME "LWPMEM" -#define DBG_LEVEL DBG_WARNING +#define DBG_TAG "LWPMEM" +#define DBG_LVL DBG_WARNING #include // todo: remove repleat code diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index 723786f1cd..be95c5fb89 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -24,8 +24,8 @@ #define SYSCALL_NET(f) ((void*)sys_notimpl) #endif -#define DBG_SECTION_NAME "LWP_CALL" -#define DBG_LEVEL DBG_WARNING +#define DBG_TAG "LWP_CALL" +#define DBG_LVL DBG_WARNING #include static void __exit_files(rt_thread_t tid) diff --git a/components/net/at/include/at_log.h b/components/net/at/include/at_log.h index fe8766ba95..9e133561f7 100644 --- a/components/net/at/include/at_log.h +++ b/components/net/at/include/at_log.h @@ -13,15 +13,15 @@ */ #ifndef LOG_TAG -#define DBG_SECTION_NAME "at" +#define DBG_TAG "at" #else -#define DBG_SECTION_NAME LOG_TAG +#define DBG_TAG LOG_TAG #endif /* LOG_TAG */ #ifdef AT_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif /* AT_DEBUG */ #include diff --git a/components/net/sal_socket/src/sal_socket.c b/components/net/sal_socket/src/sal_socket.c index 771a56f061..8d699b63e7 100644 --- a/components/net/sal_socket/src/sal_socket.c +++ b/components/net/sal_socket/src/sal_socket.c @@ -19,8 +19,8 @@ #endif #include -#define DBG_SECTION_NAME "SAL_SKT" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "SAL_SKT" +#define DBG_LVL DBG_INFO #include #define SOCKET_TABLE_STEP_LEN 4 diff --git a/components/utilities/ulog/ulog_def.h b/components/utilities/ulog/ulog_def.h index 40b39de972..de5e82fcc5 100644 --- a/components/utilities/ulog/ulog_def.h +++ b/components/utilities/ulog/ulog_def.h @@ -54,7 +54,9 @@ extern "C" { #if !defined(LOG_TAG) /* compatible for rtdbg */ - #if defined(DBG_SECTION_NAME) + #if defined(DBG_TAG) + #define LOG_TAG DBG_TAG + #elif defined(DBG_SECTION_NAME) #define LOG_TAG DBG_SECTION_NAME #else #define LOG_TAG "NO_TAG" @@ -63,7 +65,9 @@ extern "C" { #if !defined(LOG_LVL) /* compatible for rtdbg */ - #if defined(DBG_LEVEL) + #if defined(DBG_LVL) + #define LOG_LVL DBG_LVL + #elif defined(DBG_LEVEL) #define LOG_LVL DBG_LEVEL #else #define LOG_LVL LOG_LVL_DBG diff --git a/components/utilities/utest/utest.c b/components/utilities/utest/utest.c index 99775ab09f..f59f97bb64 100644 --- a/components/utilities/utest/utest.c +++ b/components/utilities/utest/utest.c @@ -15,14 +15,14 @@ #include "utest.h" #include -#undef DBG_SECTION_NAME -#undef DBG_LEVEL +#undef DBG_TAG +#undef DBG_LVL -#define DBG_SECTION_NAME "utest" +#define DBG_TAG "utest" #ifdef UTEST_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif #include diff --git a/components/utilities/utest/utest_log.h b/components/utilities/utest/utest_log.h index c4bd25a80b..0403268351 100644 --- a/components/utilities/utest/utest_log.h +++ b/components/utilities/utest/utest_log.h @@ -15,14 +15,14 @@ #define UTEST_DEBUG -#undef DBG_SECTION_NAME -#undef DBG_LEVEL +#undef DBG_TAG +#undef DBG_LVL -#define DBG_SECTION_NAME "testcase" +#define DBG_TAG "testcase" #ifdef UTEST_DEBUG -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO +#define DBG_LVL DBG_INFO #endif #include diff --git a/examples/network/tcpclient.c b/examples/network/tcpclient.c index be50711e94..2059d9f17f 100644 --- a/examples/network/tcpclient.c +++ b/examples/network/tcpclient.c @@ -12,11 +12,11 @@ #define DEBUG_TCP_CLIENT -#define DBG_SECTION_NAME "TCP" +#define DBG_TAG "TCP" #ifdef DEBUG_TCP_CLIENT -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO /* DBG_ERROR */ +#define DBG_LVL DBG_INFO /* DBG_ERROR */ #endif #include diff --git a/examples/network/tcpserver.c b/examples/network/tcpserver.c index 0837495366..c019ec132f 100644 --- a/examples/network/tcpserver.c +++ b/examples/network/tcpserver.c @@ -12,11 +12,11 @@ #define DEBUG_TCP_SERVER -#define DBG_SECTION_NAME "TCP" +#define DBG_TAG "TCP" #ifdef DEBUG_TCP_SERVER -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO /* DBG_ERROR */ +#define DBG_LVL DBG_INFO /* DBG_ERROR */ #endif #include diff --git a/examples/network/udpclient.c b/examples/network/udpclient.c index d43b46a446..cd870cd758 100644 --- a/examples/network/udpclient.c +++ b/examples/network/udpclient.c @@ -5,11 +5,11 @@ #define DEBUG_UDP_CLIENT -#define DBG_SECTION_NAME "UDP" +#define DBG_TAG "UDP" #ifdef DEBUG_UDP_CLIENT -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO /* DBG_ERROR */ +#define DBG_LVL DBG_INFO /* DBG_ERROR */ #endif #include diff --git a/examples/network/udpserver.c b/examples/network/udpserver.c index 40dd754673..ed63363189 100644 --- a/examples/network/udpserver.c +++ b/examples/network/udpserver.c @@ -12,11 +12,11 @@ #define DEBUG_UDP_SERVER -#define DBG_SECTION_NAME "UDP" +#define DBG_TAG "UDP" #ifdef DEBUG_UDP_SERVER -#define DBG_LEVEL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LEVEL DBG_INFO /* DBG_ERROR */ +#define DBG_LVL DBG_INFO /* DBG_ERROR */ #endif #include diff --git a/src/signal.c b/src/signal.c index 2d68562535..06c2055d26 100644 --- a/src/signal.c +++ b/src/signal.c @@ -22,8 +22,8 @@ #define RT_SIG_INFO_MAX 32 #endif -#define DBG_SECTION_NAME "SIGN" -#define DBG_LEVEL DBG_INFO +#define DBG_TAG "SIGN" +#define DBG_LVL DBG_INFO #include #define sig_mask(sig_no) (1u << sig_no) -- cgit v1.3.1 From 60f2ae4d3cee0cbf200a89df21a3949c92125cf4 Mon Sep 17 00:00:00 2001 From: zhangjun <2281979437@qq.com> Date: Thu, 26 Sep 2019 10:22:33 +0800 Subject: [components][dfs]添加ftruncate接口 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/filesystems/elmfat/dfs_elm.c | 25 ++++++++++++++++ components/dfs/include/dfs_file.h | 4 +++ components/dfs/include/dfs_posix.h | 1 + components/dfs/src/dfs_file.c | 29 ++++++++++++++++++ components/dfs/src/dfs_posix.c | 46 +++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+) (limited to 'components/dfs/include') diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c index 3825fd9108..b6d2c2388a 100644 --- a/components/dfs/filesystems/elmfat/dfs_elm.c +++ b/components/dfs/filesystems/elmfat/dfs_elm.c @@ -478,6 +478,31 @@ int dfs_elm_close(struct dfs_fd *file) int dfs_elm_ioctl(struct dfs_fd *file, int cmd, void *args) { + switch (cmd) + { + case RT_FIOFTRUNCATE: + { + FIL *fd; + FSIZE_t fptr, length; + FRESULT result = FR_OK; + fd = (FIL *)(file->data); + RT_ASSERT(fd != RT_NULL); + + /* save file read/write point */ + fptr = fd->fptr; + length = *(off_t*)args; + if (length <= fd->obj.objsize) + { + fd->fptr = length; + result = f_truncate(fd); + }else{ + result = f_lseek(fd, length); + } + /* restore file read/write point */ + fd->fptr = fptr; + return elm_result_to_dfs(result); + } + } return -ENOSYS; } diff --git a/components/dfs/include/dfs_file.h b/components/dfs/include/dfs_file.h index aaff3f6e9c..2dfacd653e 100644 --- a/components/dfs/include/dfs_file.h +++ b/components/dfs/include/dfs_file.h @@ -66,6 +66,10 @@ int dfs_file_lseek(struct dfs_fd *fd, off_t offset); int dfs_file_stat(const char *path, struct stat *buf); int dfs_file_rename(const char *oldpath, const char *newpath); +int dfs_file_ftruncate(struct dfs_fd *fd, off_t length); + +/* 0x5254 is just a magic number to make these relatively unique ("RT") */ +#define RT_FIOFTRUNCATE 0x52540000U #ifdef __cplusplus } diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h index 9fd76debe2..87d5f0771e 100644 --- a/components/dfs/include/dfs_posix.h +++ b/components/dfs/include/dfs_posix.h @@ -58,6 +58,7 @@ int fstat(int fildes, struct stat *buf); int fsync(int fildes); int fcntl(int fildes, int cmd, ...); int ioctl(int fildes, int cmd, ...); +int ftruncate(int fd, off_t length); /* directory api*/ int rmdir(const char *path); diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index 5f090a7f6b..1063a278ab 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -482,6 +482,35 @@ __exit: return result; } +/** + * this function is will cause the regular file referenced by fd + * to be truncated to a size of precisely length bytes. + * + * @param fd the file descriptor. + * @param length the length to be truncated. + * + * @return the status of truncated. + */ +int dfs_file_ftruncate(struct dfs_fd *fd, off_t length) +{ + int result; + + /* fd is null or not a regular file system fd, or length is invalid */ + if (fd == NULL || fd->type != FT_REGULAR || length < 0) + return -EINVAL; + + if (fd->fops->ioctl == NULL) + return -ENOSYS; + + result = fd->fops->ioctl(fd, RT_FIOFTRUNCATE, (void*)&length); + + /* update current size */ + if (result == 0) + fd->size = length; + + return result; +} + #ifdef RT_USING_FINSH #include diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 69fe56a84e..fc603df437 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -471,6 +471,52 @@ int ioctl(int fildes, int cmd, ...) } RTM_EXPORT(ioctl); +/** + * + * this function is a POSIX compliant version, which cause the regular file + * referenced by fd to be truncated to a size of precisely length bytes. + * @param fd the file descriptor. + * @param length the length to be truncated. + * + * @return Upon successful completion, ftruncate() shall return 0; + * otherwise, -1 shall be returned and errno set to indicate the error. + */ +int ftruncate(int fd, off_t length) +{ + int result; + struct dfs_fd *d; + + d = fd_get(fd); + if (d == NULL) + { + rt_set_errno(-EBADF); + + return -1; + } + + if (length < 0) + { + fd_put(d); + rt_set_errno(-EINVAL); + + return -1; + } + result = dfs_file_ftruncate(d, length); + if (result < 0) + { + fd_put(d); + rt_set_errno(result); + + return -1; + } + + /* release the ref-count of fd */ + fd_put(d); + + return 0; +} +RTM_EXPORT(ftruncate); + /** * this function is a POSIX compliant version, which will return the * information about a mounted file system. -- cgit v1.3.1 From aafed7b43455d6e2d66d5e36e8f3d849b677e195 Mon Sep 17 00:00:00 2001 From: hichard Date: Sat, 16 Nov 2019 11:16:48 +0800 Subject: 1.修复sd卡热插拔内存泄露的bug 2.dfs增加函数,配合实现sd卡热插拔自动挂载卸载文件系统 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/include/dfs_fs.h | 1 + components/dfs/src/dfs_fs.c | 39 ++++++++++++++++++++++++++++++++++++- components/dfs/src/poll.c | 3 +++ components/dfs/src/select.c | 3 +++ components/drivers/sdio/block_dev.c | 7 ++++--- 5 files changed, 49 insertions(+), 4 deletions(-) (limited to 'components/dfs/include') diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h index d3a00fc542..58a9e5cf55 100644 --- a/components/dfs/include/dfs_fs.h +++ b/components/dfs/include/dfs_fs.h @@ -90,6 +90,7 @@ int dfs_unmount(const char *specialfile); int dfs_mkfs(const char *fs_name, const char *device_name); int dfs_statfs(const char *path, struct statfs *buffer); +int dfs_mount_device(rt_device_t dev); #ifdef __cplusplus } diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index 04d862e85d..164beed719 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -508,7 +508,7 @@ int dfs_mount_table(void) mount_table[index].rwflag, mount_table[index].data) != 0) { - rt_kprintf("mount fs[%s] on %s failed.\n", mount_table[index].filesystemtype, + LOG_E("mount fs[%s] on %s failed.\n", mount_table[index].filesystemtype, mount_table[index].path); return -RT_ERROR; } @@ -518,6 +518,43 @@ int dfs_mount_table(void) return 0; } INIT_ENV_EXPORT(dfs_mount_table); + +int dfs_mount_device(rt_device_t dev) +{ + int index = 0; + + if(dev == RT_NULL) { + rt_kprintf("the device is NULL to be mounted.\n"); + return -RT_ERROR; + } + + while (1) + { + if (mount_table[index].path == NULL) break; + + if(strcmp(mount_table[index].device_name, dev->parent.name) == 0) { + if (dfs_mount(mount_table[index].device_name, + mount_table[index].path, + mount_table[index].filesystemtype, + mount_table[index].rwflag, + mount_table[index].data) != 0) + { + LOG_E("mount fs[%s] device[%s] to %s failed.\n", mount_table[index].filesystemtype, dev->parent.name, + mount_table[index].path); + return -RT_ERROR; + } else { + LOG_D("mount fs[%s] device[%s] to %s ok.\n", mount_table[index].filesystemtype, dev->parent.name, + mount_table[index].path); + return RT_EOK; + } + } + + index ++; + } + + rt_kprintf("can't find device:%s to be mounted.\n", dev->parent.name); + return -RT_ERROR; +} #endif #ifdef RT_USING_FINSH diff --git a/components/dfs/src/poll.c b/components/dfs/src/poll.c index 473b1579d2..3f304549f7 100644 --- a/components/dfs/src/poll.c +++ b/components/dfs/src/poll.c @@ -19,6 +19,8 @@ #include #include +#ifdef RT_USING_POSIX + struct rt_poll_node; struct rt_poll_table @@ -214,3 +216,4 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) return num; } +#endif diff --git a/components/dfs/src/select.c b/components/dfs/src/select.c index b20f7cf656..181855bc74 100644 --- a/components/dfs/src/select.c +++ b/components/dfs/src/select.c @@ -14,6 +14,8 @@ #include #include +#ifdef RT_USING_POSIX + static void fdszero(fd_set *set, int nfds) { fd_mask *m; @@ -178,3 +180,4 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struc return ret; } +#endif diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index cac4fc5036..5db0f38c08 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -472,7 +472,7 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) } #ifdef RT_USING_DFS_MNTTABLE - if (0) // if (blk_dev) + if (blk_dev) { LOG_I("try to mount file system!"); /* try to mount file system on this block device */ @@ -507,9 +507,10 @@ void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card) const char * mounted_path = dfs_filesystem_get_mounted_path(&(blk_dev->dev)); if (mounted_path) { - dfs_unmount(mounted_path); + dfs_unmount(mounted_path); + LOG_D("unmount file system %s for device %s.\r\n", mounted_path, blk_dev->dev.parent.name); } - + rt_sem_delete(blk_dev->part.lock); rt_device_unregister(&blk_dev->dev); rt_list_remove(&blk_dev->list); rt_free(blk_dev); -- cgit v1.3.1 From 1c68bd9d3cef3e6a935e520de57cb0acfc2c0a5e Mon Sep 17 00:00:00 2001 From: Cliff Chen Date: Mon, 16 Mar 2020 10:22:37 +0800 Subject: Support msc mode automatic switching Signed-off-by: Cliff Chen --- components/dfs/include/dfs_fs.h | 1 + components/dfs/src/dfs_fs.c | 48 +++++++++++++++++++++++ components/drivers/usb/usbdevice/class/mstorage.c | 13 +++++- 3 files changed, 61 insertions(+), 1 deletion(-) (limited to 'components/dfs/include') diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h index 58a9e5cf55..a35a513044 100644 --- a/components/dfs/include/dfs_fs.h +++ b/components/dfs/include/dfs_fs.h @@ -91,6 +91,7 @@ int dfs_unmount(const char *specialfile); int dfs_mkfs(const char *fs_name, const char *device_name); int dfs_statfs(const char *path, struct statfs *buffer); int dfs_mount_device(rt_device_t dev); +int dfs_unmount_device(rt_device_t dev); #ifdef __cplusplus } diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index 164beed719..476e47fc06 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -555,6 +555,54 @@ int dfs_mount_device(rt_device_t dev) rt_kprintf("can't find device:%s to be mounted.\n", dev->parent.name); return -RT_ERROR; } + +int dfs_unmount_device(rt_device_t dev) +{ + struct dfs_filesystem *iter; + struct dfs_filesystem *fs = NULL; + + /* lock filesystem */ + dfs_lock(); + + for (iter = &filesystem_table[0]; + iter < &filesystem_table[DFS_FILESYSTEMS_MAX]; iter++) + { + /* check if the PATH is mounted */ + if ((iter->dev_id->parent.name != NULL) + && (strcmp(iter->dev_id->parent.name, dev->parent.name) == 0)) + { + fs = iter; + break; + } + } + + if (fs == NULL || + fs->ops->unmount == NULL || + fs->ops->unmount(fs) < 0) + { + goto err1; + } + + /* close device, but do not check the status of device */ + if (fs->dev_id != NULL) + rt_device_close(fs->dev_id); + + if (fs->path != NULL) + rt_free(fs->path); + + /* clear this filesystem table entry */ + memset(fs, 0, sizeof(struct dfs_filesystem)); + + dfs_unlock(); + + return 0; + +err1: + dfs_unlock(); + + return -1; +} + #endif #ifdef RT_USING_FINSH diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c index 6a6e92415b..43fb25afe4 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.c +++ b/components/drivers/usb/usbdevice/class/mstorage.c @@ -16,6 +16,10 @@ #include "drivers/usb_device.h" #include "mstorage.h" +#ifdef RT_USING_DFS_MNTTABLE +#include "dfs_fs.h" +#endif + #ifdef RT_USB_DEVICE_MSTORAGE enum STAT @@ -955,7 +959,7 @@ static rt_err_t _function_enable(ufunction_t func) struct mstorage *data; RT_ASSERT(func != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("Mass storage function enabled\n")); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; data->disk = rt_device_find(RT_USB_MSTORAGE_DISK_NAME); if(data->disk == RT_NULL) @@ -964,6 +968,10 @@ static rt_err_t _function_enable(ufunction_t func) return -RT_ERROR; } +#ifdef RT_USING_DFS_MNTTABLE + dfs_unmount_device(data->disk); +#endif + if(rt_device_open(data->disk, RT_DEVICE_OFLAG_RDWR) != RT_EOK) { rt_kprintf("disk open error\n"); @@ -1029,6 +1037,9 @@ static rt_err_t _function_disable(ufunction_t func) if(data->disk != RT_NULL) { rt_device_close(data->disk); +#ifdef RT_USING_DFS_MNTTABLE + dfs_mount_device(data->disk); +#endif data->disk = RT_NULL; } -- cgit v1.3.1 From 50dc41468ef69b6b79979772f9689d8d3099df30 Mon Sep 17 00:00:00 2001 From: tangyuxin <462747508@qq.com> Date: Sat, 26 Sep 2020 09:55:58 +0800 Subject: [add] DFS file system supports device types --- components/dfs/filesystems/devfs/devfs.c | 2 ++ components/dfs/include/dfs.h | 1 + components/dfs/src/dfs.c | 1 + 3 files changed, 4 insertions(+) (limited to 'components/dfs/include') diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c index 936b074ce1..7637074dbb 100644 --- a/components/dfs/filesystems/devfs/devfs.c +++ b/components/dfs/filesystems/devfs/devfs.c @@ -186,6 +186,7 @@ int dfs_device_fs_open(struct dfs_fd *file) result = file->fops->open(file); if (result == RT_EOK || result == -RT_ENOSYS) { + file->type = FT_DEVICE; return 0; } } @@ -197,6 +198,7 @@ int dfs_device_fs_open(struct dfs_fd *file) if (result == RT_EOK || result == -RT_ENOSYS) { file->data = device; + file->type = FT_DEVICE; return RT_EOK; } } diff --git a/components/dfs/include/dfs.h b/components/dfs/include/dfs.h index eb32a4b411..1158df93cb 100644 --- a/components/dfs/include/dfs.h +++ b/components/dfs/include/dfs.h @@ -55,6 +55,7 @@ #define FT_SOCKET 1 /* socket file */ #define FT_DIRECTORY 2 /* directory */ #define FT_USER 3 /* user defined */ +#define FT_DEVICE 4 /* device */ /* File flags */ #define DFS_F_OPEN 0x01000000 diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index b20de13988..7ace0bc160 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -542,6 +542,7 @@ int list_fd(void) else if (fd->type == FT_REGULAR) rt_kprintf("%-7.7s ", "file"); else if (fd->type == FT_SOCKET) rt_kprintf("%-7.7s ", "socket"); else if (fd->type == FT_USER) rt_kprintf("%-7.7s ", "user"); + else if (fd->type == FT_DEVICE) rt_kprintf("%-7.7s ", "device"); else rt_kprintf("%-8.8s ", "unknown"); rt_kprintf("%3d ", fd->ref_count); rt_kprintf("%04x ", fd->magic); -- cgit v1.3.1