From a8fb6109e0ffc4e0cbdb6c3790702f180ff5ffe7 Mon Sep 17 00:00:00 2001 From: shuobatian Date: Mon, 5 Apr 2021 15:08:53 +0800 Subject: [PATCH] fix unused device frame error --- bsp/stm32/libraries/HAL_Drivers/drv_common.c | 2 +- bsp/stm32/libraries/HAL_Drivers/drv_common.h | 2 ++ components/libc/compilers/common/time.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_common.c b/bsp/stm32/libraries/HAL_Drivers/drv_common.c index f150d81fef..3ad0d961fa 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_common.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_common.c @@ -156,7 +156,7 @@ RT_WEAK void rt_hw_board_init() #endif /* Set the shell console output device */ -#ifdef RT_USING_CONSOLE +#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_common.h b/bsp/stm32/libraries/HAL_Drivers/drv_common.h index bffedddcd0..485f61df84 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_common.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_common.h @@ -13,7 +13,9 @@ #include #include +#ifdef RT_USING_DEVICE #include +#endif #ifdef __cplusplus extern "C" { diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index 99dab71eb4..05216d830b 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -227,8 +227,8 @@ int gettimeofday(struct timeval *tp, void *ignore) tp->tv_usec = 0; } #else - tv->tv_sec = 0; - tv->tv_usec = 0; + tp->tv_sec = 0; + tp->tv_usec = 0; #endif return time;