From 4fd6f2ef53d832e5528ddd72c653a4e3bd32254a Mon Sep 17 00:00:00 2001 From: zylx Date: Wed, 12 Dec 2018 16:59:02 +0800 Subject: [examples][test]Perfect test function --- examples/test/hwtimer_test.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/test/hwtimer_test.c b/examples/test/hwtimer_test.c index 8f69c4ef87..428373dde0 100644 --- a/examples/test/hwtimer_test.c +++ b/examples/test/hwtimer_test.c @@ -8,7 +8,7 @@ static rt_err_t timer_timeout_cb(rt_device_t dev, rt_size_t size) { - rt_kprintf("HT %d\n", rt_tick_get()); + rt_kprintf("enter hardware timer isr\n"); return 0; } @@ -35,7 +35,7 @@ int hwtimer(void) return -1; } - rt_device_set_rx_indicate(dev, timer_timeout_cb); + /* 时间测量 */ /* 计数时钟设置(默认1Mhz或支持的最小计数频率) */ err = rt_device_control(dev, HWTIMER_CTRL_FREQ_SET, &freq); if (err != RT_EOK) @@ -69,12 +69,34 @@ int hwtimer(void) rt_device_read(dev, 0, &val, sizeof(val)); rt_kprintf("Read: Sec = %d, Usec = %d\n", val.sec, val.usec); + /* 定时执行回调函数 -- 单次模式 */ + /* 设置超时回调函数 */ + rt_device_set_rx_indicate(dev, timer_timeout_cb); + + /* 单次模式 */ + mode = HWTIMER_MODE_PERIOD; + err = rt_device_control(dev, HWTIMER_CTRL_MODE_SET, &mode); + + /* 设置定时器超时值并启动定时器 */ + val.sec = t; + val.usec = 0; + rt_kprintf("SetTime: Sec %d, Usec %d\n", val.sec, val.usec); + if (rt_device_write(dev, 0, &val, sizeof(val)) != sizeof(val)) + { + rt_kprintf("SetTime Fail\n"); + goto EXIT; + } + + /* 等待回调函数执行 */ + rt_thread_delay((t + 1)*RT_TICK_PER_SECOND); + EXIT: err = rt_device_close(dev); rt_kprintf("Close %s\n", TIMER); return err; } - -FINSH_FUNCTION_EXPORT(hwtimer, "Test hardware timer"); +#ifdef FINSH_USING_MSH +MSH_CMD_EXPORT(hwtimer, "Test hardware timer"); #endif +#endif /* RT_USING_HWTIMER */ -- cgit v1.3.1 From 57da7246d85f1a56f3ac6832cbaab575846cef1f Mon Sep 17 00:00:00 2001 From: HubretXie Date: Wed, 19 Dec 2018 20:12:15 +0800 Subject: 鍒濆鍖栧畯浣跨敤閿欒 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/pm/timer_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/pm/timer_app.c b/examples/pm/timer_app.c index 73faf52d0a..5c20d0f690 100644 --- a/examples/pm/timer_app.c +++ b/examples/pm/timer_app.c @@ -48,7 +48,7 @@ static int timer_app_init(void) return -1; } } -INIT_EXPORT_APP(timer_app_init); +INIT_APP_EXPORT(timer_app_init); #endif /* RT_USING_PM */ -- 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 'examples') 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 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 'examples') 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 6e89f70e92bfaef1a7a3740761d6dd03226ab4b1 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 28 Apr 2019 09:35:54 +0800 Subject: [examples] remove nanopb example codes --- examples/nanopb/SConscript | 13 -------- examples/nanopb/simple.c | 73 ------------------------------------------ examples/nanopb/simple.options | 1 - examples/nanopb/simple.pb.c | 18 ----------- examples/nanopb/simple.pb.h | 45 -------------------------- examples/nanopb/simple.proto | 10 ------ 6 files changed, 160 deletions(-) delete mode 100644 examples/nanopb/SConscript delete mode 100644 examples/nanopb/simple.c delete mode 100644 examples/nanopb/simple.options delete mode 100644 examples/nanopb/simple.pb.c delete mode 100644 examples/nanopb/simple.pb.h delete mode 100644 examples/nanopb/simple.proto (limited to 'examples') diff --git a/examples/nanopb/SConscript b/examples/nanopb/SConscript deleted file mode 100644 index 7c8bce9f26..0000000000 --- a/examples/nanopb/SConscript +++ /dev/null @@ -1,13 +0,0 @@ -Import('RTT_ROOT') -Import('rtconfig') -from building import * - -src = Split(''' -simple.c -simple.pb.c -''') -CPPPATH = [RTT_ROOT + '/examples/nanopb'] - -group = DefineGroup('Nanopb_test', src, depend = ['RT_USING_NANOPB'], CPPPATH = CPPPATH) - -Return('group') \ No newline at end of file diff --git a/examples/nanopb/simple.c b/examples/nanopb/simple.c deleted file mode 100644 index 2b793c014f..0000000000 --- a/examples/nanopb/simple.c +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include -#include -#include -#include "simple.pb.h" - -int nanopb_test() -{ - /* This is the buffer where we will store our message. */ - uint8_t buffer[128]; - size_t message_length; - bool status; - - /* Encode our message */ - { - /* Allocate space on the stack to store the message data. - * - * Nanopb generates simple struct definitions for all the messages. - * - check out the contents of simple.pb.h! */ - SimpleMessage message = SimpleMessage_init_zero; - - /* Create a stream that will write to our buffer. */ - pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); - - /* Fill in the lucky number */ - message.lucky_number = 13; - - /* Now we are ready to encode the message! */ - status = pb_encode(&stream, SimpleMessage_fields, &message); - message_length = stream.bytes_written; - - /* Then just check for any errors.. */ - if (!status) - { - rt_kprintf("Encoding failed: %s\n", PB_GET_ERROR(&stream)); - return 1; - } - } - - /* Now we could transmit the message over network, store it in a file or - * wrap it to a pigeon's leg. - */ - - /* But because we are lazy, we will just decode it immediately. */ - - { - /* Allocate space for the decoded message. */ - SimpleMessage message; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(buffer, message_length); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, SimpleMessage_fields, &message); - - /* Check for errors... */ - if (!status) - { - rt_kprintf("Decoding failed: %s\n", PB_GET_ERROR(&stream)); - return 1; - } - - /* Print the data contained in the message. */ - rt_kprintf("Your lucky number was %d!\n", message.lucky_number); - } - - return 0; -} - -#ifdef RT_USING_FINSH -#include -FINSH_FUNCTION_EXPORT(nanopb_test, nanopb encode/decode test.) -#endif diff --git a/examples/nanopb/simple.options b/examples/nanopb/simple.options deleted file mode 100644 index 90960d0d34..0000000000 --- a/examples/nanopb/simple.options +++ /dev/null @@ -1 +0,0 @@ -SimpleMessage.name max_size:16 \ No newline at end of file diff --git a/examples/nanopb/simple.pb.c b/examples/nanopb/simple.pb.c deleted file mode 100644 index eaf09e58da..0000000000 --- a/examples/nanopb/simple.pb.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.1 at Tue Mar 10 01:16:15 2015. */ - -#include "simple.pb.h" - -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t SimpleMessage_fields[3] = { - PB_FIELD( 1, INT32 , REQUIRED, STATIC , FIRST, SimpleMessage, lucky_number, lucky_number, 0), - PB_FIELD( 2, BYTES , REQUIRED, STATIC , OTHER, SimpleMessage, name, lucky_number, 0), - PB_LAST_FIELD -}; - - diff --git a/examples/nanopb/simple.pb.h b/examples/nanopb/simple.pb.h deleted file mode 100644 index 47521dee69..0000000000 --- a/examples/nanopb/simple.pb.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.1 at Tue Mar 10 01:16:15 2015. */ - -#ifndef PB_SIMPLE_PB_H_INCLUDED -#define PB_SIMPLE_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -/* Struct definitions */ -typedef PB_BYTES_ARRAY_T(16) SimpleMessage_name_t; - -typedef struct _SimpleMessage { - int32_t lucky_number; - SimpleMessage_name_t name; -} SimpleMessage; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define SimpleMessage_init_default {0, {0, {0}}} -#define SimpleMessage_init_zero {0, {0, {0}}} - -/* Field tags (for use in manual encoding/decoding) */ -#define SimpleMessage_lucky_number_tag 1 -#define SimpleMessage_name_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t SimpleMessage_fields[3]; - -/* Maximum encoded size of messages (where known) */ -#define SimpleMessage_size 29 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/examples/nanopb/simple.proto b/examples/nanopb/simple.proto deleted file mode 100644 index 1905d0e50b..0000000000 --- a/examples/nanopb/simple.proto +++ /dev/null @@ -1,10 +0,0 @@ -// A very simple protocol definition, consisting of only -// one message. - -message SimpleMessage { - required int32 lucky_number = 1; - required bytes name = 2; -} - - - -- cgit v1.3.1 From 623ddc62b2df57b94674d1a46bfa3ff58593bbcb Mon Sep 17 00:00:00 2001 From: EvalZero Date: Mon, 6 May 2019 19:57:22 +0800 Subject: [components][pm]adapt to the new power management interface --- bsp/es32f0334/drivers/drv_pm.c | 61 +++++++++--------------------------------- bsp/es32f0654/drivers/drv_pm.c | 61 +++++++++--------------------------------- examples/pm/timer_app.c | 2 +- 3 files changed, 25 insertions(+), 99 deletions(-) (limited to 'examples') diff --git a/bsp/es32f0334/drivers/drv_pm.c b/bsp/es32f0334/drivers/drv_pm.c index f9324d7208..1841ce2050 100644 --- a/bsp/es32f0334/drivers/drv_pm.c +++ b/bsp/es32f0334/drivers/drv_pm.c @@ -16,52 +16,26 @@ #ifdef RT_USING_PM -static void _drv_pm_enter(struct rt_pm *pm) +static void _drv_pm_enter(struct rt_pm *pm, uint8_t mode) { - rt_uint32_t mode; - - mode = pm->current_mode; - switch (mode) { - case PM_RUN_MODE_NORMAL: + case PM_SLEEP_MODE_NONE: break; - case PM_SLEEP_MODE_SLEEP: + case PM_SLEEP_MODE_IDLE: __WFI(); break; - case PM_SLEEP_MODE_TIMER: - pmu_stop2_enter(); - break; - - case PM_SLEEP_MODE_SHUTDOWN: - pmu_standby_enter(PMU_STANDBY_PORT_NONE); - break; - - default: - RT_ASSERT(0); - break; - } -} - -static void _drv_pm_exit(struct rt_pm *pm) -{ - rt_uint32_t mode; - - RT_ASSERT(pm != RT_NULL); - - mode = pm->current_mode; - - switch (mode) - { - case PM_RUN_MODE_NORMAL: + case PM_SLEEP_MODE_LIGHT: break; - case PM_SLEEP_MODE_SLEEP: + case PM_SLEEP_MODE_DEEP: + pmu_stop2_enter(); break; - case PM_SLEEP_MODE_TIMER: + case PM_SLEEP_MODE_STANDBY: + pmu_standby_enter(PMU_STANDBY_PORT_NONE); break; case PM_SLEEP_MODE_SHUTDOWN: @@ -73,32 +47,21 @@ static void _drv_pm_exit(struct rt_pm *pm) } } -#if PM_RUN_MODE_COUNT > 1 -static void _drv_pm_frequency_change(struct rt_pm *pm, rt_uint32_t frequency) -{ - return; -} -#endif - static int drv_hw_pm_init(void) { static const struct rt_pm_ops _ops = { _drv_pm_enter, - _drv_pm_exit, - -#if PM_RUN_MODE_COUNT > 1 - _drv_pm_frequency_change, -#endif + RT_NULL, RT_NULL, RT_NULL, RT_NULL }; - rt_uint8_t timer_mask; + rt_uint8_t timer_mask = 0; - /* initialize timer mask */ - timer_mask = 1UL << PM_SLEEP_MODE_TIMER; + /* initialize timer mask(no need tickless) */ + // timer_mask = 1UL << PM_SLEEP_MODE_DEEP; /* initialize system pm module */ rt_system_pm_init(&_ops, timer_mask, RT_NULL); diff --git a/bsp/es32f0654/drivers/drv_pm.c b/bsp/es32f0654/drivers/drv_pm.c index 256634b81d..926ffc05c0 100644 --- a/bsp/es32f0654/drivers/drv_pm.c +++ b/bsp/es32f0654/drivers/drv_pm.c @@ -16,52 +16,26 @@ #ifdef RT_USING_PM -static void _drv_pm_enter(struct rt_pm *pm) +static void _drv_pm_enter(struct rt_pm *pm, uint8_t mode) { - rt_uint32_t mode; - - mode = pm->current_mode; - switch (mode) { - case PM_RUN_MODE_NORMAL: + case PM_SLEEP_MODE_NONE: break; - case PM_SLEEP_MODE_SLEEP: + case PM_SLEEP_MODE_IDLE: __WFI(); break; - case PM_SLEEP_MODE_TIMER: - pmu_stop2_enter(); - break; - - case PM_SLEEP_MODE_SHUTDOWN: - pmu_standby_enter(PMU_STANDBY_PORT_NONE); - break; - - default: - RT_ASSERT(0); - break; - } -} - -static void _drv_pm_exit(struct rt_pm *pm) -{ - rt_uint32_t mode; - - RT_ASSERT(pm != RT_NULL); - - mode = pm->current_mode; - - switch (mode) - { - case PM_RUN_MODE_NORMAL: + case PM_SLEEP_MODE_LIGHT: break; - case PM_SLEEP_MODE_SLEEP: + case PM_SLEEP_MODE_DEEP: + pmu_stop2_enter(); break; - case PM_SLEEP_MODE_TIMER: + case PM_SLEEP_MODE_STANDBY: + pmu_standby_enter(PMU_STANDBY_PORT_NONE); break; case PM_SLEEP_MODE_SHUTDOWN: @@ -73,32 +47,21 @@ static void _drv_pm_exit(struct rt_pm *pm) } } -#if PM_RUN_MODE_COUNT > 1 -static void _drv_pm_frequency_change(struct rt_pm *pm, rt_uint32_t frequency) -{ - return; -} -#endif - static int drv_hw_pm_init(void) { static const struct rt_pm_ops _ops = { _drv_pm_enter, - _drv_pm_exit, - -#if PM_RUN_MODE_COUNT > 1 - _drv_pm_frequency_change, -#endif + RT_NULL, RT_NULL, RT_NULL, RT_NULL }; - rt_uint8_t timer_mask; + rt_uint8_t timer_mask = 0; - /* initialize timer mask */ - timer_mask = 1UL << PM_SLEEP_MODE_TIMER; + /* initialize timer mask(no need tickless) */ + timer_mask = 1UL << PM_SLEEP_MODE_DEEP; /* initialize system pm module */ rt_system_pm_init(&_ops, timer_mask, RT_NULL); diff --git a/examples/pm/timer_app.c b/examples/pm/timer_app.c index 5c20d0f690..66f4c8d4d2 100644 --- a/examples/pm/timer_app.c +++ b/examples/pm/timer_app.c @@ -39,7 +39,7 @@ static int timer_app_init(void) rt_timer_start(timer1); /* keep in timer mode */ - rt_pm_request(PM_SLEEP_MODE_TIMER); + rt_pm_request(PM_SLEEP_MODE_DEEP); return 0; } -- cgit v1.3.1 From d51e0783babc4ffa7286e8dadceb2b2be2129b33 Mon Sep 17 00:00:00 2001 From: EvalZero Date: Tue, 7 May 2019 21:03:48 +0800 Subject: [components][pm]fix some issues with low power components --- bsp/es32f0334/drivers/drv_pm.c | 1 + bsp/es32f0654/drivers/drv_pm.c | 1 + bsp/stm32/libraries/HAL_Drivers/drv_lptim.c | 2 +- bsp/stm32/libraries/HAL_Drivers/drv_lptim.h | 2 +- bsp/stm32/libraries/HAL_Drivers/drv_pm.c | 5 ++-- components/drivers/include/drivers/pm.h | 9 +++---- components/drivers/pm/pm.c | 41 +++++++++++++++-------------- examples/pm/timer_app.c | 1 + 8 files changed, 32 insertions(+), 30 deletions(-) (limited to 'examples') diff --git a/bsp/es32f0334/drivers/drv_pm.c b/bsp/es32f0334/drivers/drv_pm.c index 1841ce2050..22f2c43073 100644 --- a/bsp/es32f0334/drivers/drv_pm.c +++ b/bsp/es32f0334/drivers/drv_pm.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2019-04-08 wangyq the first version + * 2019-05-06 Zero-Free adapt to the new power management interface */ #include diff --git a/bsp/es32f0654/drivers/drv_pm.c b/bsp/es32f0654/drivers/drv_pm.c index 926ffc05c0..aa2f07ec68 100644 --- a/bsp/es32f0654/drivers/drv_pm.c +++ b/bsp/es32f0654/drivers/drv_pm.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2019-04-01 wangyq the first version + * 2019-05-06 Zero-Free adapt to the new power management interface */ #include diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_lptim.c b/bsp/stm32/libraries/HAL_Drivers/drv_lptim.c index 2360cdad78..64e602fa52 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_lptim.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_lptim.c @@ -5,7 +5,7 @@ * * Change Logs: * Date Author Notes - * 2017-08-01 tanek the first version + * 2019-05-06 Zero-Free first version */ #include diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_lptim.h b/bsp/stm32/libraries/HAL_Drivers/drv_lptim.h index 32853c9e73..0fd51b5eac 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_lptim.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_lptim.h @@ -5,7 +5,7 @@ * * Change Logs: * Date Author Notes - * 2012-08-21 heyuanjie87 the first version + * 2019-05-06 Zero-Free first version */ #ifndef __DRV_PMTIMER_H__ diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_pm.c b/bsp/stm32/libraries/HAL_Drivers/drv_pm.c index 66f00b3e02..84ddf6cd41 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_pm.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_pm.c @@ -5,8 +5,7 @@ * * Change Logs: * Date Author Notes - * 2018-07-31 tanek first version - * 2018-05-05 Zero-Free adapt to the new power management interface + * 2019-05-06 Zero-Free first version */ #include @@ -79,7 +78,7 @@ static uint8_t run_speed[PM_RUN_MODE_MAX][2] = {2, 3}, }; -static void run(struct rt_pm *pm, uint8_t mode, uint32_t frequency) +static void run(struct rt_pm *pm, uint8_t mode) { static uint8_t last_mode; static char *run_str[] = PM_RUN_MODE_NAMES; diff --git a/components/drivers/include/drivers/pm.h b/components/drivers/include/drivers/pm.h index 5cffd8d465..e35b21cd48 100644 --- a/components/drivers/include/drivers/pm.h +++ b/components/drivers/include/drivers/pm.h @@ -77,7 +77,7 @@ enum * device control flag to request or release power */ #define RT_PM_DEVICE_CTRL_REQUEST 0x01 -#define RT_PM_DEVICE_CTRL_RELEASE 0x02 +#define RT_PM_DEVICE_CTRL_RELEASE 0x00 struct rt_pm; @@ -87,7 +87,7 @@ struct rt_pm; struct rt_pm_ops { void (*sleep)(struct rt_pm *pm, uint8_t mode); - void (*run)(struct rt_pm *pm, uint8_t mode, uint32_t frequency); + void (*run)(struct rt_pm *pm, uint8_t mode); void (*timer_start)(struct rt_pm *pm, rt_uint32_t timeout); void (*timer_stop)(struct rt_pm *pm); rt_tick_t (*timer_get_tick)(struct rt_pm *pm); @@ -97,7 +97,7 @@ struct rt_device_pm_ops { int (*suspend)(const struct rt_device *device, uint8_t mode); void (*resume)(const struct rt_device *device, uint8_t mode); - int (*frequency_change)(const struct rt_device *device, uint8_t mode, uint32_t frequency); + int (*frequency_change)(const struct rt_device *device, uint8_t mode); }; struct rt_device_pm @@ -122,7 +122,6 @@ struct rt_pm rt_uint8_t device_pm_number; struct rt_device_pm *device_pm; - rt_uint32_t frequency; /* if the mode has timer, the corresponding bit is 1*/ rt_uint8_t timer_mask; rt_uint8_t flags; @@ -144,7 +143,7 @@ struct rt_pm_notify void rt_pm_request(uint8_t sleep_mode); void rt_pm_release(uint8_t sleep_mode); -int rt_pm_run_mode_set(uint8_t run_mode, uint32_t frequency); +int rt_pm_run_enter(uint8_t run_mode); void rt_pm_device_register(struct rt_device *device, const struct rt_device_pm_ops *ops); void rt_pm_device_unregister(struct rt_device *device); diff --git a/components/drivers/pm/pm.c b/components/drivers/pm/pm.c index c273754914..98a993b526 100644 --- a/components/drivers/pm/pm.c +++ b/components/drivers/pm/pm.c @@ -22,12 +22,12 @@ static struct rt_pm_notify _pm_notify; #define RT_PM_TICKLESS_THRESH (2) -RT_WEAK uint32_t rt_pm_enter_critical(void) +RT_WEAK uint32_t rt_pm_enter_critical(uint8_t sleep_mode) { return rt_hw_interrupt_disable(); } -RT_WEAK void rt_pm_exit_critical(uint32_t ctx) +RT_WEAK void rt_pm_exit_critical(uint32_t ctx, uint8_t sleep_mode) { rt_hw_interrupt_enable(ctx); } @@ -37,17 +37,19 @@ RT_WEAK void rt_pm_exit_critical(uint32_t ctx) */ static int _pm_device_suspend(uint8_t mode) { - int index; + int index, ret = RT_EOK; for (index = 0; index < _pm.device_pm_number; index++) { if (_pm.device_pm[index].ops->suspend != RT_NULL) { - return _pm.device_pm[index].ops->suspend(_pm.device_pm[index].device, mode); + ret = _pm.device_pm[index].ops->suspend(_pm.device_pm[index].device, mode); + if(ret != RT_EOK) + break; } } - return RT_EOK; + return ret; } /** @@ -69,7 +71,7 @@ static void _pm_device_resume(uint8_t mode) /** * This function will update the frequency of all registered devices */ -static void _pm_device_frequency_change(uint8_t mode, uint32_t frequency) +static void _pm_device_frequency_change(uint8_t mode) { rt_uint32_t index; @@ -77,7 +79,7 @@ static void _pm_device_frequency_change(uint8_t mode, uint32_t frequency) for (index = 0; index < _pm.device_pm_number; index ++) { if (_pm.device_pm[index].ops->frequency_change != RT_NULL) - _pm.device_pm[index].ops->frequency_change(_pm.device_pm[index].device, mode, frequency); + _pm.device_pm[index].ops->frequency_change(_pm.device_pm[index].device, mode); } } @@ -92,9 +94,9 @@ static void _pm_frequency_scaling(struct rt_pm *pm) { level = rt_hw_interrupt_disable(); /* change system runing mode */ - pm->ops->run(pm, pm->run_mode, pm->frequency); + pm->ops->run(pm, pm->run_mode); /* changer device frequency */ - _pm_device_frequency_change(pm->run_mode, pm->frequency); + _pm_device_frequency_change(pm->run_mode); pm->flags &= ~RT_PM_FREQUENCY_PENDING; rt_hw_interrupt_enable(level); } @@ -138,7 +140,7 @@ static void _pm_change_sleep_mode(struct rt_pm *pm, uint8_t mode) } else { - level = rt_pm_enter_critical(); + level = rt_pm_enter_critical(mode); /* Notify app will enter sleep mode */ if (_pm_notify.notify) @@ -151,7 +153,7 @@ static void _pm_change_sleep_mode(struct rt_pm *pm, uint8_t mode) _pm_device_resume(mode); if (_pm_notify.notify) _pm_notify.notify(RT_PM_EXIT_SLEEP, mode, _pm_notify.data); - rt_pm_exit_critical(level); + rt_pm_exit_critical(level, mode); return; } @@ -202,7 +204,7 @@ static void _pm_change_sleep_mode(struct rt_pm *pm, uint8_t mode) if (_pm_notify.notify) _pm_notify.notify(RT_PM_EXIT_SLEEP, mode, _pm_notify.data); - rt_pm_exit_critical(level); + rt_pm_exit_critical(level, mode); } } @@ -381,11 +383,11 @@ static rt_size_t _rt_pm_device_write(rt_device_t dev, { /* get request */ request = *(unsigned char *)buffer; - if (request == '1') + if (request == 0x01) { rt_pm_request(pos); } - else if (request == '0') + else if (request == 0x00) { rt_pm_release(pos); } @@ -416,7 +418,7 @@ static rt_err_t _rt_pm_device_control(rt_device_t dev, return RT_EOK; } -int rt_pm_run_mode_set(uint8_t mode, uint32_t frequency) +int rt_pm_run_enter(uint8_t mode) { rt_base_t level; struct rt_pm *pm; @@ -429,15 +431,14 @@ int rt_pm_run_mode_set(uint8_t mode, uint32_t frequency) if (mode < pm->run_mode) { /* change system runing mode */ - pm->ops->run(pm, mode, frequency); + pm->ops->run(pm, mode); /* changer device frequency */ - _pm_device_frequency_change(mode, frequency); + _pm_device_frequency_change(mode); } else { pm->flags |= RT_PM_FREQUENCY_PENDING; } - pm->frequency = frequency; pm->run_mode = mode; rt_hw_interrupt_enable(level); @@ -525,9 +526,9 @@ static void rt_pm_run_mode_switch(int argc, char **argv) mode = atoi(argv[1]); } - rt_pm_run_mode_set(mode, 0); + rt_pm_run_enter(mode); } -MSH_CMD_EXPORT_ALIAS(rt_pm_run_mode_switch, pm_run_set, switch power management run mode); +MSH_CMD_EXPORT_ALIAS(rt_pm_run_mode_switch, pm_run, switch power management run mode); static void rt_pm_dump_status(void) { diff --git a/examples/pm/timer_app.c b/examples/pm/timer_app.c index 66f4c8d4d2..b7ff675b39 100644 --- a/examples/pm/timer_app.c +++ b/examples/pm/timer_app.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2018-08-07 Tanek first implementation + * 2019-05-06 Zero-Free adapt to the new power management interface */ #include -- cgit v1.3.1 From b242b1e6f6bb5b40c60989a6096948819ed56748 Mon Sep 17 00:00:00 2001 From: EvalZero Date: Thu, 9 May 2019 20:55:35 +0800 Subject: [examples][pm]add wakeup application for pm. --- examples/pm/wakeup_app.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 examples/pm/wakeup_app.c (limited to 'examples') diff --git a/examples/pm/wakeup_app.c b/examples/pm/wakeup_app.c new file mode 100644 index 0000000000..0d4c42a997 --- /dev/null +++ b/examples/pm/wakeup_app.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-05-09 Zero-Free first implementation + */ + +#include +#include +#include + +#ifdef RT_USING_PM + +#define WAKEUP_EVENT_BUTTON (1 << 0) +#define PIN_LED_R GET_PIN(E, 7) +#define WAKEUP_PIN GET_PIN(C, 13) +#define WAKEUP_APP_THREAD_STACK_SIZE 1024 + +static rt_event_t wakeup_event; + +static void wakeup_callback(void *args) +{ + rt_event_send(wakeup_event, WAKEUP_EVENT_BUTTON); +} + +static void wakeup_init(void) +{ + rt_pin_mode(WAKEUP_PIN, PIN_MODE_INPUT_PULLUP); + rt_pin_attach_irq(WAKEUP_PIN, PIN_IRQ_MODE_FALLING, wakeup_callback, RT_NULL); + rt_pin_irq_enable(WAKEUP_PIN, 1); +} + +static void wakeup_app_entry(void *parameter) +{ + wakeup_init(); + rt_pm_request(PM_SLEEP_MODE_DEEP); + + while (1) + { + if (rt_event_recv(wakeup_event, + WAKEUP_EVENT_BUTTON, + RT_EVENT_FLAG_AND | RT_EVENT_FLAG_CLEAR, + RT_WAITING_FOREVER, RT_NULL) == RT_EOK) + { + rt_pm_request(PM_SLEEP_MODE_NONE); + + rt_pin_mode(PIN_LED_R, PIN_MODE_OUTPUT); + rt_pin_write(PIN_LED_R, 0); + rt_thread_delay(rt_tick_from_millisecond(500)); + rt_pin_write(PIN_LED_R, 1); + + rt_pm_release(PM_SLEEP_MODE_NONE); + } + } +} + +static int wakeup_app(void) +{ + rt_thread_t tid; + + wakeup_event = rt_event_create("wakup", RT_IPC_FLAG_FIFO); + RT_ASSERT(wakeup_event != RT_NULL); + + tid = rt_thread_create("wakeup_app", wakeup_app_entry, RT_NULL, + WAKEUP_APP_THREAD_STACK_SIZE, RT_MAIN_THREAD_PRIORITY, 20); + RT_ASSERT(tid != RT_NULL); + + rt_thread_startup(tid); + + return 0; +} +INIT_APP_EXPORT(wakeup_app); + +#endif -- cgit v1.3.1 From 20146636602204c2bf5084a62f22678aa9976f19 Mon Sep 17 00:00:00 2001 From: majianjia Date: Sun, 12 Apr 2020 23:56:43 +0100 Subject: Export file examples to MSH also: - change static buffer to dynamiclly allocated buffer. - replace Chinese comment to English comment in some files. - add apache-2 license --- examples/file/listdir.c | 48 ++++++++++++---- examples/file/readspeed.c | 39 ++++++++++--- examples/file/readwrite.c | 137 ++++++++++++++++++++++++++++++--------------- examples/file/seekdir.c | 19 +++---- examples/file/writespeed.c | 42 +++++++++++--- 5 files changed, 203 insertions(+), 82 deletions(-) (limited to 'examples') diff --git a/examples/file/listdir.c b/examples/file/listdir.c index cf91bc77d4..98419db873 100644 --- a/examples/file/listdir.c +++ b/examples/file/listdir.c @@ -1,22 +1,19 @@ /* - * File : listdir.c - * This file is part of RT-TestCase in RT-Thread RTOS - * COPYRIGHT (C) 2010, RT-Thread Development Team + * Copyright (c) 2006-2020, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2010-02-10 Bernard first version + * 2020-04-12 Jianjia Ma add msh cmd */ #include #include -static char fullpath[256]; void list_dir(const char* path) { + char * fullpath; DIR *dir; dir = opendir(path); @@ -25,6 +22,13 @@ void list_dir(const char* path) struct dirent* dirent; struct stat s; + fullpath = rt_malloc(256); + if (fullpath == RT_NULL) + { + rt_kprintf("no memory\n"); + return; + } + do { dirent = readdir(dir); @@ -35,7 +39,7 @@ void list_dir(const char* path) rt_sprintf(fullpath, "%s/%s", path, dirent->d_name); stat(fullpath, &s); - if ( s.st_mode & DFS_S_IFDIR ) + if ( s.st_mode & S_IFDIR ) { rt_kprintf("%s\t\t\n", dirent->d_name); } @@ -47,10 +51,34 @@ void list_dir(const char* path) closedir(dir); } - else rt_kprintf("open %s directory failed\n", path); + else + { + rt_kprintf("open %s directory failed\n", path); + } + + rt_free(fullpath); } #ifdef RT_USING_FINSH #include FINSH_FUNCTION_EXPORT(list_dir, list directory); -#endif + +#ifdef FINSH_USING_MSH +static void cmd_list_dir(int argc, char *argv[]) +{ + char* filename; + + if(argc == 2) + { + filename = argv[1]; + } + else + { + rt_kprintf("Usage: list_dir [file_path]\n"); + return; + } + list_dir(filename); +} +FINSH_FUNCTION_EXPORT_ALIAS(cmd_list_dir, __cmd_list_dir, list directory); +#endif /* FINSH_USING_MSH */ +#endif /* RT_USING_FINSH */ diff --git a/examples/file/readspeed.c b/examples/file/readspeed.c index 52f15b627b..e5073856b4 100644 --- a/examples/file/readspeed.c +++ b/examples/file/readspeed.c @@ -1,15 +1,12 @@ /* - * File : readspeed.c - * This file is part of RT-TestCase in RT-Thread RTOS - * COPYRIGHT (C) 2010, RT-Thread Development Team + * Copyright (c) 2006-2020, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2010-02-10 Bernard first version + * 2020-04-12 Jianjia Ma add msh cmd */ #include @@ -34,7 +31,6 @@ void readspeed(const char* filename, int block_size) { rt_kprintf("no memory\n"); close(fd); - return; } @@ -61,4 +57,31 @@ void readspeed(const char* filename, int block_size) #ifdef RT_USING_FINSH #include FINSH_FUNCTION_EXPORT(readspeed, perform file read test); -#endif + +#ifdef FINSH_USING_MSH +static void cmd_readspeed(int argc, char *argv[]) +{ + char* filename; + int block_size; + + if(argc == 3) + { + filename = argv[1]; + block_size = atoi(argv[2]); + } + else if(argc == 2) + { + filename = argv[1]; + block_size = 512; + } + else + { + rt_kprintf("Usage:\nreadspeed [file_path] [block_size]\n"); + rt_kprintf("readspeed [file_path] with default block size 512\n"); + return; + } + readspeed(filename, block_size); +} +FINSH_FUNCTION_EXPORT_ALIAS(cmd_readspeed, __cmd_readspeed, test file system read speed); +#endif /* FINSH_USING_MSH */ +#endif /* RT_USING_FINSH */ diff --git a/examples/file/readwrite.c b/examples/file/readwrite.c index 6f25249c61..5738323805 100644 --- a/examples/file/readwrite.c +++ b/examples/file/readwrite.c @@ -1,123 +1,168 @@ /* - * 浠g爜娓呭崟锛氭枃浠惰鍐欎緥瀛� + * Copyright (c) 2006-2020, RT-Thread Development Team * - * 杩欎釜渚嬪瓙婕旂ず浜嗗浣曡鍐欎竴涓枃浠讹紝鐗瑰埆鏄啓鐨勬椂鍊欏簲璇ュ浣曟搷浣溿�� + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2010-02-10 Bernard first version + * 2020-04-12 Jianjia Ma add msh cmd */ #include -#include /* 褰撻渶瑕佷娇鐢ㄦ枃浠舵搷浣滄椂锛岄渶瑕佸寘鍚繖涓ご鏂囦欢 */ - -#define TEST_FN "/test.dat" +#include -/* 娴嬭瘯鐢ㄧ殑鏁版嵁鍜岀紦鍐� */ -static char test_data[120], buffer[120]; +#define TEST_DATA_LEN 120 -/* 鏂囦欢璇诲啓娴嬭瘯 */ +/* file read write test */ void readwrite(const char* filename) { int fd; int index, length; + char* test_data; + char* buffer; + int block_size = TEST_DATA_LEN; - /* 鍙啓 & 鍒涘缓 鎵撳紑 */ - fd = open(TEST_FN, O_WRONLY | O_CREAT | O_TRUNC, 0); + /* open with write only & create */ + fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0); if (fd < 0) { rt_kprintf("open file for write failed\n"); return; } - /* 鍑嗗鍐欏叆鏁版嵁 */ - for (index = 0; index < sizeof(test_data); index ++) + test_data = rt_malloc(block_size); + if (test_data == RT_NULL) + { + rt_kprintf("no memory\n"); + close(fd); + return; + } + + buffer = rt_malloc(block_size); + if (buffer == RT_NULL) + { + rt_kprintf("no memory\n"); + close(fd); + rt_free(test_data); + return; + } + + /* prepare some data */ + for (index = 0; index < block_size; index ++) { test_data[index] = index + 27; } - /* 鍐欏叆鏁版嵁 */ - length = write(fd, test_data, sizeof(test_data)); - if (length != sizeof(test_data)) + /* write to file */ + length = write(fd, test_data, block_size); + if (length != block_size) { rt_kprintf("write data failed\n"); close(fd); - return; + goto __exit; } - /* 鍏抽棴鏂囦欢 */ + /* close file */ close(fd); - /* 鍙啓骞跺湪鏈熬娣诲姞鎵撳紑 */ - fd = open(TEST_FN, O_WRONLY | O_CREAT | O_APPEND, 0); + /* reopen the file with append to the end */ + fd = open(filename, O_WRONLY | O_CREAT | O_APPEND, 0); if (fd < 0) { rt_kprintf("open file for append write failed\n"); - return; + goto __exit;; } - length = write(fd, test_data, sizeof(test_data)); - if (length != sizeof(test_data)) + length = write(fd, test_data, block_size); + if (length != block_size) { rt_kprintf("append write data failed\n"); close(fd); - return; + goto __exit; } - /* 鍏抽棴鏂囦欢 */ + /* close the file */ close(fd); - /* 鍙鎵撳紑杩涜鏁版嵁鏍¢獙 */ - fd = open(TEST_FN, O_RDONLY, 0); + /* open the file for data validation. */ + fd = open(filename, O_RDONLY, 0); if (fd < 0) { rt_kprintf("check: open file for read failed\n"); - return; + goto __exit; } - /* 璇诲彇鏁版嵁(搴旇涓虹涓�娆″啓鍏ョ殑鏁版嵁) */ - length = read(fd, buffer, sizeof(buffer)); - if (length != sizeof(buffer)) + /* read the data (should be the data written by the first time ) */ + length = read(fd, buffer, block_size); + if (length != block_size) { rt_kprintf("check: read file failed\n"); close(fd); - return; + goto __exit; } - /* 妫�鏌ユ暟鎹槸鍚︽纭� */ - for (index = 0; index < sizeof(test_data); index ++) + /* validate */ + for (index = 0; index < block_size; index ++) { if (test_data[index] != buffer[index]) { rt_kprintf("check: check data failed at %d\n", index); close(fd); - return; + goto __exit; } } - /* 璇诲彇鏁版嵁(搴旇涓虹浜屾鍐欏叆鐨勬暟鎹�) */ - length = read(fd, buffer, sizeof(buffer)); - if (length != sizeof(buffer)) + /* read the data (should be the second time data) */ + length = read(fd, buffer, block_size); + if (length != block_size) { rt_kprintf("check: read file failed\n"); close(fd); - return; + goto __exit; } - /* 妫�鏌ユ暟鎹槸鍚︽纭� */ - for (index = 0; index < sizeof(test_data); index ++) + /* validate */ + for (index = 0; index < block_size; index ++) { if (test_data[index] != buffer[index]) { rt_kprintf("check: check data failed at %d\n", index); close(fd); - return; + goto __exit; } } - /* 妫�鏌ユ暟鎹畬姣曪紝鍏抽棴鏂囦欢 */ + /* close the file */ close(fd); - /* 鎵撳嵃缁撴灉 */ - rt_kprintf("read/write done.\n"); + /* print result */ + rt_kprintf("read/write test successful!\n"); + +__exit: + rt_free(test_data); + rt_free(buffer); } #ifdef RT_USING_FINSH #include -/* 杈撳嚭鍑芥暟鍒癴insh shell鍛戒护琛屼腑 */ +/* export to finsh */ FINSH_FUNCTION_EXPORT(readwrite, perform file read and write test); -#endif + +#ifdef FINSH_USING_MSH +static void cmd_readwrite(int argc, char *argv[]) +{ + char* filename; + + if(argc == 2) + { + filename = argv[1]; + } + else + { + rt_kprintf("Usage: readwrite [file_path]\n"); + return; + } + readwrite(filename); +} +FINSH_FUNCTION_EXPORT_ALIAS(cmd_readwrite, __cmd_readwrite, perform file read and write test); +#endif /* FINSH_USING_MSH */ +#endif /* RT_USING_FINSH */ diff --git a/examples/file/seekdir.c b/examples/file/seekdir.c index 1cf8b5fd78..d6a33426b4 100644 --- a/examples/file/seekdir.c +++ b/examples/file/seekdir.c @@ -1,15 +1,12 @@ /* - * File : seekdir.c - * This file is part of RT-TestCase in RT-Thread RTOS - * COPYRIGHT (C) 2011, RT-Thread Development Team + * Copyright (c) 2006-2020, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2011-06-02 Bernard first version + * 2020-04-12 Jianjia Ma add msh cmd */ #include @@ -17,7 +14,6 @@ void seekdir_test(void) { DIR * dirp; long save3 = 0; - long cur; int i = 0; struct dirent *dp; @@ -27,14 +23,14 @@ void seekdir_test(void) { rt_kprintf("direntry: %s\n", dp->d_name); - /* 保存第三个目录项的目录指针 */ + /* save the pointer of the third directory */ if (i++ == 3) { save3 = telldir(dirp); } } - /* 回到刚才保存的第三个目录项的目录指针 */ + /* get back to the third directory */ seekdir (dirp, save3); rt_kprintf("seek dientry to: %d\n", save3); for (dp = readdir(dirp); dp != RT_NULL; dp = readdir(dirp)) @@ -42,9 +38,12 @@ void seekdir_test(void) rt_kprintf("direntry: %s\n", dp->d_name); } - /* 关闭目录 */ + /* close the directory */ closedir (dirp); } +#ifdef RT_USING_FINSH #include FINSH_FUNCTION_EXPORT(seekdir_test, perform directory seek test); +MSH_CMD_EXPORT(seekdir_test, perform directory seek test); +#endif /* RT_USING_FINSH */ diff --git a/examples/file/writespeed.c b/examples/file/writespeed.c index ab6946888f..806a9674bc 100644 --- a/examples/file/writespeed.c +++ b/examples/file/writespeed.c @@ -1,15 +1,12 @@ /* - * File : writespeed.c - * This file is part of RT-TestCase in RT-Thread RTOS - * COPYRIGHT (C) 2010, RT-Thread Development Team + * Copyright (c) 2006-2020, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2010-02-10 Bernard first version + * 2020-04-12 Jianjia Ma add msh cmd */ #include #include @@ -32,7 +29,6 @@ void writespeed(const char* filename, int total_length, int block_size) { rt_kprintf("no memory\n"); close(fd); - return; } @@ -69,4 +65,34 @@ void writespeed(const char* filename, int total_length, int block_size) #ifdef RT_USING_FINSH #include FINSH_FUNCTION_EXPORT(writespeed, perform file write test); -#endif + +#ifdef FINSH_USING_MSH +static void cmd_writespeed(int argc, char *argv[]) +{ + char* filename; + int length; + int block_size; + + if(argc == 4) + { + filename = argv[1]; + length = atoi(argv[2]); + block_size = atoi(argv[3]); + } + else if(argc == 2) + { + filename = argv[1]; + block_size = 512; + length = 1024*1024; + } + else + { + rt_kprintf("Usage:\nwritespeed [file_path] [length] [block_size]\n"); + rt_kprintf("writespeed [file_path] with default length 1MB and block size 512\n"); + return; + } + writespeed(filename, length, block_size); +} +FINSH_FUNCTION_EXPORT_ALIAS(cmd_writespeed, __cmd_writespeed, test file system write speed); +#endif /* FINSH_USING_MSH */ +#endif /* RT_USING_FINSH */ -- cgit v1.3.1 From 8e57dcb723071b37e09a06decddc16569ae79a77 Mon Sep 17 00:00:00 2001 From: David Lin Date: Fri, 17 Apr 2020 18:39:04 +0800 Subject: Update tcpsendpacket.c --- examples/network/tcpsendpacket.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'examples') diff --git a/examples/network/tcpsendpacket.c b/examples/network/tcpsendpacket.c index 75134c19a2..462de6000d 100644 --- a/examples/network/tcpsendpacket.c +++ b/examples/network/tcpsendpacket.c @@ -1,7 +1,7 @@ #include -#include /* 为了解析主机名,需要包含netdb.h头文件 */ -#include /* 使用BSD socket,需要包含socket.h头文件 */ +#include /* 涓轰簡瑙f瀽涓绘満鍚嶏紝闇�瑕佸寘鍚玭etdb.h澶存枃浠� */ +#include /* 浣跨敤BSD socket锛岄渶瑕佸寘鍚玸ocket.h澶存枃浠� */ void tcp_senddata(const char *url, int port, int length) { @@ -10,45 +10,52 @@ void tcp_senddata(const char *url, int port, int length) struct sockaddr_in server_addr; rt_uint8_t *buffer_ptr; - /* 通过函数入口参数url获得host地址(如果是域名,会做域名解析) */ + /* 閫氳繃鍑芥暟鍏ュ彛鍙傛暟url鑾峰緱host鍦板潃锛堝鏋滄槸鍩熷悕锛屼細鍋氬煙鍚嶈В鏋愶級 */ host = gethostbyname(url); - /* 创建一个socket,类型是SOCKET_STREAM,TCP类型 */ + /* 鍒涘缓涓�涓猻ocket锛岀被鍨嬫槸SOCKET_STREAM锛孴CP绫诲瀷 */ if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { - /* 创建socket失败 */ + /* 鍒涘缓socket澶辫触 */ rt_kprintf("Socket error\n"); return; } - /* 申请内存 */ + /* 鐢宠鍐呭瓨 */ buffer_ptr = rt_malloc(length); - /* 构造发送数据 */ + if(RT_NULL == buffer_ptr) + { + /* 鐢宠鍐呭瓨澶辫触 */ + rt_kprintf("Not enough memory\n"); + return; + } + + /* 鏋勯�犲彂閫佹暟鎹� */ for (index = 0; index < length; index ++) buffer_ptr[index] = index & 0xff; timeout = 100; - /* 设置发送超时时间100ms */ + /* 璁剧疆鍙戦�佽秴鏃舵椂闂�100ms */ setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); - /* 初始化预连接的服务端地址 */ + /* 鍒濆鍖栭杩炴帴鐨勬湇鍔$鍦板潃 */ server_addr.sin_family = AF_INET; server_addr.sin_port = htons(port); server_addr.sin_addr = *((struct in_addr *)host->h_addr); rt_memset(&(server_addr.sin_zero), 0, sizeof(server_addr.sin_zero)); - /* 连接到服务端 */ + /* 杩炴帴鍒版湇鍔$ */ err = connect(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)); rt_kprintf("TCP thread connect error code: %d\n", err); while (1) { - /* 发送数据到sock连接 */ + /* 鍙戦�佹暟鎹埌sock杩炴帴 */ result = send(sock, buffer_ptr, length, MSG_DONTWAIT); - if (result < 0) //数据发送错误处理 + if (result < 0) //鏁版嵁鍙戦�侀敊璇鐞� { rt_kprintf("TCP thread send error: %d\n", result); closesocket(sock); - /* 关闭连接,重新创建连接 */ + /* 鍏抽棴杩炴帴锛岄噸鏂板垱寤鸿繛鎺� */ rt_thread_delay(10); if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) @@ -59,7 +66,7 @@ void tcp_senddata(const char *url, int port, int length) } else if (result == 0) { - /* 打印send函数返回值为0的警告信息 */ + /* 鎵撳嵃send鍑芥暟杩斿洖鍊间负0鐨勮鍛婁俊鎭� */ rt_kprintf("\n Send warning,send function return 0.\r\n"); } } @@ -67,7 +74,7 @@ void tcp_senddata(const char *url, int port, int length) #ifdef RT_USING_FINSH #include -/* 输出tcpclient函数到finsh shell中 */ +/* 杈撳嚭tcpclient鍑芥暟鍒癴insh shell涓� */ FINSH_FUNCTION_EXPORT(tcp_senddata, send a packet through tcp connection); #endif -- cgit v1.3.1 From 993835b5ed834e1ab49e637bcac22019b9bc461b Mon Sep 17 00:00:00 2001 From: David Lin Date: Fri, 17 Apr 2020 18:44:15 +0800 Subject: Update tcpsendpacket.c --- examples/network/tcpsendpacket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/network/tcpsendpacket.c b/examples/network/tcpsendpacket.c index 462de6000d..47bb562506 100644 --- a/examples/network/tcpsendpacket.c +++ b/examples/network/tcpsendpacket.c @@ -25,7 +25,7 @@ void tcp_senddata(const char *url, int port, int length) if(RT_NULL == buffer_ptr) { /* 鐢宠鍐呭瓨澶辫触 */ - rt_kprintf("Not enough memory\n"); + rt_kprintf("No memory\n"); return; } -- cgit v1.3.1 From 79e4fed9ffe67b6c744b454500753ce44f026af5 Mon Sep 17 00:00:00 2001 From: David Lin Date: Sat, 13 Jun 2020 10:52:54 +0800 Subject: Update udpclient.c This is 'udp client', not is 'tcp client', so tcpclient -> udpclient --- examples/network/udpclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/network/udpclient.c b/examples/network/udpclient.c index cd870cd758..449fb5af62 100644 --- a/examples/network/udpclient.c +++ b/examples/network/udpclient.c @@ -117,8 +117,8 @@ static void udpclient_test(int argc, char** argv) { if (started) { - LOG_I("The tcpclient has started!"); - LOG_I("Please stop tcpclient firstly, by: tcpclient --stop"); + LOG_I("The udpclient has started!"); + LOG_I("Please stop udpclient firstly, by: udpclient --stop"); return; } -- cgit v1.3.1 From c74e40dbe5d70ea9f53b7db8fff3e5701ee57351 Mon Sep 17 00:00:00 2001 From: David Lin Date: Sat, 13 Jun 2020 10:57:38 +0800 Subject: Update udpserver.c This is 'udp server', not is 'tcp client' tcpclient -> udpserver --- examples/network/udpserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/network/udpserver.c b/examples/network/udpserver.c index ed63363189..a249475e04 100644 --- a/examples/network/udpserver.c +++ b/examples/network/udpserver.c @@ -163,8 +163,8 @@ static void udpserver_test(int argc, char** argv) { if (started) { - LOG_I("The tcpclient has started!"); - LOG_I("Please stop tcpclient firstly, by: tcpclient --stop"); + LOG_I("The udpserver has started!"); + LOG_I("Please stop udpserver firstly, by: udpserver --stop"); return; } -- cgit v1.3.1 From e4f463ed13d2635cb39fa7bca3e01de4e92987e5 Mon Sep 17 00:00:00 2001 From: David Lin Date: Sat, 13 Jun 2020 11:01:24 +0800 Subject: Update tcpserver.c This is 'tcp server', not is 'tcp client' tcpclient -> tcpserver --- examples/network/tcpserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/network/tcpserver.c b/examples/network/tcpserver.c index c019ec132f..8c7382dcbb 100644 --- a/examples/network/tcpserver.c +++ b/examples/network/tcpserver.c @@ -229,8 +229,8 @@ static void tcpserver_test(int argc, char** argv) { if (started) { - LOG_I("The tcpclient has started!"); - LOG_I("Please stop tcpclient firstly, by: tcpclient --stop"); + LOG_I("The tcpserver has started!"); + LOG_I("Please stop tcpserver firstly, by: tcpserver --stop"); return; } -- cgit v1.3.1 From 105d8945f52fe8251b19d4fd78baa049b128624a Mon Sep 17 00:00:00 2001 From: David Lin Date: Fri, 17 Jul 2020 16:06:33 +0800 Subject: Update tcpclient.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 鎺ユ敹->鍙戦�� --- examples/network/tcpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/network/tcpclient.c b/examples/network/tcpclient.c index 2059d9f17f..cc67645868 100644 --- a/examples/network/tcpclient.c +++ b/examples/network/tcpclient.c @@ -129,7 +129,7 @@ static void tcpclient(void *arg) ret = send(sock, send_data, rt_strlen(send_data), 0); if (ret < 0) { - /* 鎺ユ敹澶辫触锛屽叧闂繖涓繛鎺� */ + /* 鍙戦�佸け璐ワ紝鍏抽棴杩欎釜杩炴帴 */ LOG_I("send error, close the socket."); goto __exit; } -- cgit v1.3.1 From f8a20ee43316214cedbda7f21e0ad5cc07f9397a Mon Sep 17 00:00:00 2001 From: David Lin Date: Wed, 14 Oct 2020 09:56:53 +0800 Subject: Update net_test.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 鐢宠鍐呭瓨澶辫触鏃讹紝鐩存帴return锛屾鍓嶄唬鐮乬oto _exit杩涜rt_free绌烘寚閽堬紝浼氶�犳垚鍐呭瓨娉勬紡 --- examples/test/net_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/test/net_test.c b/examples/test/net_test.c index 53bd2836fa..c3867ecf4f 100644 --- a/examples/test/net_test.c +++ b/examples/test/net_test.c @@ -70,7 +70,7 @@ void udpecho_socket_entry(void *parameter) { /* no memory yet */ rt_kprintf("no memory\n"); - goto _exit; + return; } /* create a UDP socket */ if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) @@ -183,7 +183,7 @@ void tcpecho_socket_entry(void *parameter) if (recv_data == RT_NULL) { rt_kprintf("no memory\n"); - goto _exit; + return; } /* create a TCP socket */ -- cgit v1.3.1 From 85e32ae58efb74e4e142d3255595182b0eee151c Mon Sep 17 00:00:00 2001 From: David Lin Date: Wed, 14 Oct 2020 11:59:20 +0800 Subject: Update udpclient.c tcpclient->udpclient --- examples/network/udpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/network/udpclient.c b/examples/network/udpclient.c index 449fb5af62..f8c42f3a12 100644 --- a/examples/network/udpclient.c +++ b/examples/network/udpclient.c @@ -89,7 +89,7 @@ static void usage(void) rt_kprintf(" -h Specify host address\n"); rt_kprintf(" -p Specify the host port number\n"); rt_kprintf(" --cnt Specify the send data count\n"); - rt_kprintf(" --stop Stop tcpclient program\n"); + rt_kprintf(" --stop Stop udpclient program\n"); rt_kprintf(" --help Print help information\n"); } -- cgit v1.3.1 From 6e6dfb000396606fd5b40554adea03dea4841883 Mon Sep 17 00:00:00 2001 From: David Lin Date: Sat, 17 Oct 2020 10:52:29 +0800 Subject: Update net_test.c Fixed pointer check, indentation --- examples/test/net_test.c | 441 +++++++++++++++++++++++++---------------------- 1 file changed, 238 insertions(+), 203 deletions(-) (limited to 'examples') diff --git a/examples/test/net_test.c b/examples/test/net_test.c index c3867ecf4f..553305f4d0 100644 --- a/examples/test/net_test.c +++ b/examples/test/net_test.c @@ -14,41 +14,51 @@ rt_thread_t udpecho_tid = RT_NULL; void udpecho_entry(void *parameter) { - struct netconn *conn; - struct netbuf *buf; - struct ip_addr *addr; - unsigned short port; + struct netconn *conn; + struct netbuf *buf; + struct ip_addr *addr; + unsigned short port; - conn = netconn_new(NETCONN_UDP); - netconn_bind(conn, IP_ADDR_ANY, 7); + conn = netconn_new(NETCONN_UDP); + if(conn == NULL) + { + rt_kprintf("no memory error\n"); + return; + } + netconn_bind(conn, IP_ADDR_ANY, 7); - while(1) - { + while(1) + { /* received data to buffer */ #if LWIP_VERSION_MINOR==3U - buf = netconn_recv(conn); + buf = netconn_recv(conn); #else - netconn_recv(conn, &buf); + netconn_recv(conn, &buf); #endif - - addr = netbuf_fromaddr(buf); - port = netbuf_fromport(buf); + if(buf == NULL) + { + break; + } + addr = netbuf_fromaddr(buf); + port = netbuf_fromport(buf); - /* send the data to buffer */ - netconn_connect(conn, addr, port); + /* send the data to buffer */ + netconn_connect(conn, addr, port); - /* reset address, and send to client */ + /* reset address, and send to client */ #if LWIP_VERSION_MINOR==3U - buf->addr = RT_NULL; + buf->addr = RT_NULL; #else - buf->addr = *IP_ADDR_ANY; + buf->addr = *IP_ADDR_ANY; #endif - netconn_send(conn, buf); + netconn_send(conn, buf); - /* release buffer */ - netbuf_delete(buf); - } + /* release buffer */ + netbuf_delete(buf); + } + + netconn_delete(conn); } /* * UDP socket echo server @@ -58,57 +68,57 @@ void udpecho_entry(void *parameter) rt_thread_t udpecho_socket_tid = RT_NULL; void udpecho_socket_entry(void *parameter) { - int sock; - int bytes_read; - char *recv_data; - rt_uint32_t addr_len; - struct sockaddr_in server_addr, client_addr; - - /* allocate the data buffer */ - recv_data = rt_malloc(UDP_SOCKET_BUFFER_SIZE); - if (recv_data == RT_NULL) - { - /* no memory yet */ - rt_kprintf("no memory\n"); - return; - } - /* create a UDP socket */ - if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) - { - rt_kprintf("create socket error\n"); - goto _exit; - } + int sock; + int bytes_read; + char *recv_data; + rt_uint32_t addr_len; + struct sockaddr_in server_addr, client_addr; - /* initialize server address */ - server_addr.sin_family = AF_INET; - server_addr.sin_port = htons(UDP_SOCKET_ECHO_PORT); - server_addr.sin_addr.s_addr = INADDR_ANY; - rt_memset(&(server_addr.sin_zero),0, sizeof(server_addr.sin_zero)); + /* allocate the data buffer */ + recv_data = rt_malloc(UDP_SOCKET_BUFFER_SIZE); + if (recv_data == RT_NULL) + { + /* no memory yet */ + rt_kprintf("no memory\n"); + return; + } + /* create a UDP socket */ + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + { + rt_kprintf("create socket error\n"); + goto _exit; + } - /* bind socket to server address */ - if (bind(sock,(struct sockaddr *)&server_addr, - sizeof(struct sockaddr)) == -1) - { - /* bind failed */ - rt_kprintf("bind error\n"); - goto _exit; - } + /* initialize server address */ + server_addr.sin_family = AF_INET; + server_addr.sin_port = htons(UDP_SOCKET_ECHO_PORT); + server_addr.sin_addr.s_addr = INADDR_ANY; + rt_memset(&(server_addr.sin_zero),0, sizeof(server_addr.sin_zero)); - addr_len = sizeof(struct sockaddr); - while (1) - { - /* try to receive from UDP socket */ - bytes_read = recvfrom(sock, recv_data, UDP_SOCKET_BUFFER_SIZE, 0, - (struct sockaddr *)&client_addr, &addr_len); + /* bind socket to server address */ + if (bind(sock,(struct sockaddr *)&server_addr, + sizeof(struct sockaddr)) == -1) + { + /* bind failed */ + rt_kprintf("bind error\n"); + goto _exit; + } - /* send back */ - sendto(sock, recv_data, bytes_read, 0, - (struct sockaddr *)&client_addr, addr_len); - } + addr_len = sizeof(struct sockaddr); + while (1) + { + /* try to receive from UDP socket */ + bytes_read = recvfrom(sock, recv_data, UDP_SOCKET_BUFFER_SIZE, 0, + (struct sockaddr *)&client_addr, &addr_len); + + /* send back */ + sendto(sock, recv_data, bytes_read, 0, + (struct sockaddr *)&client_addr, addr_len); + } _exit: - rt_free(recv_data); - return; + rt_free(recv_data); + return; } /* @@ -118,52 +128,62 @@ _exit: rt_thread_t tcpecho_tid = RT_NULL; void tcpecho_entry(void *parameter) { - struct netconn *conn, *newconn; - err_t err; + struct netconn *conn, *newconn; + err_t err; - /* Create a new connection identifier. */ - conn = netconn_new(NETCONN_TCP); + /* Create a new connection identifier. */ + conn = netconn_new(NETCONN_TCP); + if(conn == NULL) + { + rt_kprintf("no memory error\n"); + return; + } - /* Bind connection to well known port number 7. */ - netconn_bind(conn, NULL, TCP_ECHO_PORT); + /* Bind connection to well known port number 7. */ + netconn_bind(conn, NULL, TCP_ECHO_PORT); - /* Tell connection to go into listening mode. */ - netconn_listen(conn); + /* Tell connection to go into listening mode. */ + netconn_listen(conn); - while(1) - { - /* Grab new connection. */ + while(1) + { + /* Grab new connection. */ #if LWIP_VERSION_MINOR==3U - newconn = netconn_accept(conn); - if(newconn != NULL) + newconn = netconn_accept(conn); + if(newconn != NULL) #else - err = netconn_accept(conn, &newconn); - if(err == ERR_OK) + err = netconn_accept(conn, &newconn); + if(err == ERR_OK) #endif - /* Process the new connection. */ - { - struct netbuf *buf; - void *data; - u16_t len; + /* Process the new connection. */ + { + struct netbuf *buf; + void *data; + u16_t len; #if LWIP_VERSION_MINOR==3U - while((buf = netconn_recv(newconn)) != NULL) + while((buf = netconn_recv(newconn)) != NULL) #else - while((err = netconn_recv(newconn, &buf)) == ERR_OK) + while((err = netconn_recv(newconn, &buf)) == ERR_OK) #endif - { - do - { - netbuf_data(buf, &data, &len); - err = netconn_write(newconn, data, len, NETCONN_COPY); - if(err != ERR_OK){} - } - while(netbuf_next(buf) >= 0); - netbuf_delete(buf); - } - /* Close connection and discard connection identifier. */ - netconn_delete(newconn); - } - } + { + do + { + netbuf_data(buf, &data, &len); + err = netconn_write(newconn, data, len, NETCONN_COPY); + if(err != ERR_OK) + { + break; + } + }while(netbuf_next(buf) >= 0); + + netbuf_delete(buf); + } + /* Close connection and discard connection identifier. */ + netconn_delete(newconn); + } + } + + netconn_delete(conn); } /* @@ -174,84 +194,83 @@ void tcpecho_entry(void *parameter) rt_thread_t tcpecho_socket_tid = RT_NULL; void tcpecho_socket_entry(void *parameter) { - char *recv_data; - rt_uint32_t sin_size; - int sock = -1, connected, bytes_received; - struct sockaddr_in server_addr, client_addr; + char *recv_data; + rt_uint32_t sin_size; + int sock = -1, connected, bytes_received; + struct sockaddr_in server_addr, client_addr; - recv_data = rt_malloc(TCP_SOCKET_BUFFER_SIZE); - if (recv_data == RT_NULL) - { - rt_kprintf("no memory\n"); - return; - } + recv_data = rt_malloc(TCP_SOCKET_BUFFER_SIZE); + if (recv_data == RT_NULL) + { + rt_kprintf("no memory\n"); + return; + } - /* create a TCP socket */ - if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) - { - rt_kprintf("create socket error\n"); - goto _exit; - } + /* create a TCP socket */ + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) + { + rt_kprintf("create socket error\n"); + goto _exit; + } - /* initialize server address */ - server_addr.sin_family = AF_INET; - server_addr.sin_port = htons(TCP_SOCKET_ECHO_PORT); - server_addr.sin_addr.s_addr = INADDR_ANY; - rt_memset(&(server_addr.sin_zero),8, sizeof(server_addr.sin_zero)); + /* initialize server address */ + server_addr.sin_family = AF_INET; + server_addr.sin_port = htons(TCP_SOCKET_ECHO_PORT); + server_addr.sin_addr.s_addr = INADDR_ANY; + rt_memset(&(server_addr.sin_zero),8, sizeof(server_addr.sin_zero)); - /* bind to server address */ - if (bind(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) == -1) - { - rt_kprintf("bind address failed\n"); - goto _exit; - } + /* bind to server address */ + if (bind(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) == -1) + { + rt_kprintf("bind address failed\n"); + goto _exit; + } - /* listen */ - if (listen(sock, 5) == -1) - { - rt_kprintf("listen error\n"); - goto _exit; - } + /* listen */ + if (listen(sock, 5) == -1) + { + rt_kprintf("listen error\n"); + goto _exit; + } - sin_size = sizeof(struct sockaddr_in); - while(1) - { - /* accept client connected */ - connected = accept(sock, (struct sockaddr *)&client_addr, &sin_size); - if (connected > 0) - { - int timeout; + sin_size = sizeof(struct sockaddr_in); + while(1) + { + /* accept client connected */ + connected = accept(sock, (struct sockaddr *)&client_addr, &sin_size); + if (connected > 0) + { + int timeout; - /* set timeout option */ - timeout = 5000; /* 5second */ - setsockopt(connected, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); + /* set timeout option */ + timeout = 5000; /* 5second */ + setsockopt(connected, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); - /* handle this client */ - while (1) - { - /* receive data from this connection */ - bytes_received = recv(connected,recv_data, TCP_SOCKET_BUFFER_SIZE, 0); - if (bytes_received <= 0) - { - rt_kprintf("close client connection, errno: %d\n", - rt_get_errno()); - /* connection closed. */ - lwip_close(connected); - break; - } + /* handle this client */ + while (1) + { + /* receive data from this connection */ + bytes_received = recv(connected,recv_data, TCP_SOCKET_BUFFER_SIZE, 0); + if (bytes_received <= 0) + { + rt_kprintf("close client connection, errno: %d\n", rt_get_errno()); + /* connection closed. */ + lwip_close(connected); + break; + } - /* send data to client */ - send(connected, recv_data, bytes_received, 0); - } - } - } + /* send data to client */ + send(connected, recv_data, bytes_received, 0); + } + } + } _exit: - /* close socket */ - if (sock != -1) lwip_close(sock); - rt_free(recv_data); + /* close socket */ + if (sock != -1) lwip_close(sock); + rt_free(recv_data); - return ; + return; } /* @@ -261,40 +280,56 @@ _exit: /* network test utilities entry */ void net_test(void) { - /* start UDP echo server */ - if (udpecho_tid == RT_NULL) - { - udpecho_tid = rt_thread_create("uecho", - udpecho_entry, RT_NULL, - 512, RT_THREAD_PRIORITY_MAX/2, 5); - if (udpecho_tid != RT_NULL) - rt_thread_startup(udpecho_tid); - } - if (udpecho_socket_tid == RT_NULL) - { - udpecho_socket_tid = rt_thread_create("uecho_s", - udpecho_socket_entry, RT_NULL, - 512, RT_THREAD_PRIORITY_MAX/2 + 1, 5); - if (udpecho_socket_tid != RT_NULL) - rt_thread_startup(udpecho_socket_tid); - } + /* start UDP echo server */ + if (udpecho_tid == RT_NULL) + { + udpecho_tid = rt_thread_create("uecho", + udpecho_entry, + RT_NULL, + 512, + RT_THREAD_PRIORITY_MAX/2, 5); + if (udpecho_tid != RT_NULL) + { + rt_thread_startup(udpecho_tid); + } + } - if (tcpecho_tid == RT_NULL) - { - tcpecho_tid = rt_thread_create("techo", - tcpecho_entry, RT_NULL, - 512, RT_THREAD_PRIORITY_MAX/2 + 2, 5); - if (tcpecho_tid != RT_NULL) - rt_thread_startup(tcpecho_tid); - } - if (tcpecho_socket_tid == RT_NULL) - { - tcpecho_socket_tid = rt_thread_create("techo_s", - tcpecho_socket_entry, RT_NULL, - 512, RT_THREAD_PRIORITY_MAX/2 + 3, 5); - if (tcpecho_socket_tid != RT_NULL) - rt_thread_startup(tcpecho_socket_tid); - } + if (udpecho_socket_tid == RT_NULL) + { + udpecho_socket_tid = rt_thread_create("uecho_s", + udpecho_socket_entry, + RT_NULL, + 512, + RT_THREAD_PRIORITY_MAX/2 + 1, 5); + if (udpecho_socket_tid != RT_NULL) + { + rt_thread_startup(udpecho_socket_tid); + } + } + + if (tcpecho_tid == RT_NULL) + { + tcpecho_tid = rt_thread_create("techo", + tcpecho_entry, + RT_NULL, + 512, + RT_THREAD_PRIORITY_MAX/2 + 2, 5); + if (tcpecho_tid != RT_NULL) + { + rt_thread_startup(tcpecho_tid); + } + } + + if (tcpecho_socket_tid == RT_NULL) + { + tcpecho_socket_tid = rt_thread_create("techo_s", + tcpecho_socket_entry, + RT_NULL, + 512, + RT_THREAD_PRIORITY_MAX/2 + 3, 5); + if (tcpecho_socket_tid != RT_NULL) + { + rt_thread_startup(tcpecho_socket_tid); + } } FINSH_FUNCTION_EXPORT(net_test, network test); - -- cgit v1.3.1 From b0591443e3a9e69b86aced80a3dd0be682496c08 Mon Sep 17 00:00:00 2001 From: David Lin Date: Sat, 17 Oct 2020 11:26:27 +0800 Subject: Update writespeed.c Fixed indentation --- examples/file/writespeed.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'examples') diff --git a/examples/file/writespeed.c b/examples/file/writespeed.c index 806a9674bc..60dd900a68 100644 --- a/examples/file/writespeed.c +++ b/examples/file/writespeed.c @@ -32,31 +32,31 @@ void writespeed(const char* filename, int total_length, int block_size) return; } - /* prepare write data */ - for (index = 0; index < block_size; index++) - { - buff_ptr[index] = index; - } - index = 0; + /* prepare write data */ + for (index = 0; index < block_size; index++) + { + buff_ptr[index] = index; + } + index = 0; - /* get the beginning tick */ + /* get the beginning tick */ tick = rt_tick_get(); - while (index < total_length / block_size) - { - length = write(fd, buff_ptr, block_size); - if (length != block_size) - { - rt_kprintf("write failed\n"); - break; - } + while (index < total_length / block_size) + { + length = write(fd, buff_ptr, block_size); + if (length != block_size) + { + rt_kprintf("write failed\n"); + break; + } - index ++; - } + index ++; + } tick = rt_tick_get() - tick; - /* close file and release memory */ + /* close file and release memory */ close(fd); - rt_free(buff_ptr); + rt_free(buff_ptr); /* calculate write speed */ rt_kprintf("File write speed: %d byte/s\n", total_length / tick * RT_TICK_PER_SECOND); -- cgit v1.3.1 From adc5dab5b23c0b9d623142ad9252312476cd7717 Mon Sep 17 00:00:00 2001 From: David Lin Date: Sat, 17 Oct 2020 11:53:11 +0800 Subject: Update listdir.c 1.close dir before return; 2.fixed indentation. --- examples/file/listdir.c | 73 +++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 36 deletions(-) (limited to 'examples') diff --git a/examples/file/listdir.c b/examples/file/listdir.c index 98419db873..d8ea7af82a 100644 --- a/examples/file/listdir.c +++ b/examples/file/listdir.c @@ -14,49 +14,50 @@ void list_dir(const char* path) { char * fullpath; - DIR *dir; + DIR *dir; - dir = opendir(path); - if (dir != RT_NULL) - { - struct dirent* dirent; - struct stat s; + dir = opendir(path); + if (dir != RT_NULL) + { + struct dirent* dirent; + struct stat s; - fullpath = rt_malloc(256); - if (fullpath == RT_NULL) - { - rt_kprintf("no memory\n"); - return; - } + fullpath = rt_malloc(256); + if (fullpath == RT_NULL) + { + closedir(dir); + rt_kprintf("no memory\n"); + return; + } - do - { - dirent = readdir(dir); - if (dirent == RT_NULL) break; - rt_memset(&s, 0, sizeof(struct stat)); + do + { + dirent = readdir(dir); + if (dirent == RT_NULL) break; + rt_memset(&s, 0, sizeof(struct stat)); - /* build full path for each file */ - rt_sprintf(fullpath, "%s/%s", path, dirent->d_name); + /* build full path for each file */ + rt_sprintf(fullpath, "%s/%s", path, dirent->d_name); - stat(fullpath, &s); - if ( s.st_mode & S_IFDIR ) - { - rt_kprintf("%s\t\t\n", dirent->d_name); - } - else - { - rt_kprintf("%s\t\t%lu\n", dirent->d_name, s.st_size); - } - } while (dirent != RT_NULL); + stat(fullpath, &s); + if ( s.st_mode & S_IFDIR ) + { + rt_kprintf("%s\t\t\n", dirent->d_name); + } + else + { + rt_kprintf("%s\t\t%lu\n", dirent->d_name, s.st_size); + } + } while (dirent != RT_NULL); - closedir(dir); - } - else - { - rt_kprintf("open %s directory failed\n", path); - } + closedir(dir); + } + else + { + rt_kprintf("open %s directory failed\n", path); + } - rt_free(fullpath); + rt_free(fullpath); } #ifdef RT_USING_FINSH -- cgit v1.3.1