From ad197870d2d149952fcddc46f4b12a7ad23a740d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=BC=E6=B0=B4=E6=B5=81=E5=B9=B4?= <744709580@qq.com> Date: Tue, 21 Sep 2021 16:24:18 +0800 Subject: [PATCH] =?UTF-8?q?main.c=E5=A2=9E=E5=8A=A0=E7=A9=BA=E8=A1=8C?= =?UTF-8?q?=EF=BC=8C=E5=B0=86debug=E8=BE=93=E5=87=BA=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=88=B0board.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/Vango_V85xx/applications/main.c | 2 +- bsp/Vango_V85xx/drivers/board.h | 8 +++++++- bsp/Vango_V85xx/drivers/drv_spi.c | 9 +-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bsp/Vango_V85xx/applications/main.c b/bsp/Vango_V85xx/applications/main.c index 26035bde9d..c0926c341c 100644 --- a/bsp/Vango_V85xx/applications/main.c +++ b/bsp/Vango_V85xx/applications/main.c @@ -50,4 +50,4 @@ void assert_errhandler(uint8_t* file, uint32_t line) { } } -#endif \ No newline at end of file +#endif diff --git a/bsp/Vango_V85xx/drivers/board.h b/bsp/Vango_V85xx/drivers/board.h index 215ad0b194..e8e312d110 100644 --- a/bsp/Vango_V85xx/drivers/board.h +++ b/bsp/Vango_V85xx/drivers/board.h @@ -32,7 +32,13 @@ extern int __bss_end; #define HEAP_BEGIN ((void *)&__bss_end) #endif - #define HEAP_END V85XX_SRAM_END +/* #define DEBUG */ +#ifdef DEBUG +#define DEBUG_PRINTF(...) rt_kprintf(__VA_ARGS__) +#else +#define DEBUG_PRINTF(...) +#endif + #endif diff --git a/bsp/Vango_V85xx/drivers/drv_spi.c b/bsp/Vango_V85xx/drivers/drv_spi.c index 724e3cc400..ce0e5bd87d 100644 --- a/bsp/Vango_V85xx/drivers/drv_spi.c +++ b/bsp/Vango_V85xx/drivers/drv_spi.c @@ -22,13 +22,6 @@ #error "Please define at least one SPIx" #endif -/* #define DEBUG */ -#ifdef DEBUG -#define DEBUG_PRINTF(...) rt_kprintf(__VA_ARGS__) -#else -#define DEBUG_PRINTF(...) -#endif - /* private rt-thread spi ops function */ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configuration* configuration); static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* message); @@ -199,7 +192,7 @@ int v85xx_hw_spi_init(void) result = rt_spi_bus_register(&spi_bus0, "spi1", &v85xx_spi_ops); - #endif +#endif #ifdef RT_USING_SPI2 static struct rt_spi_bus spi_bus1;