소스 검색

fix unused device frame error

shuobatian 4 년 전
부모
커밋
a8fb6109e0
3개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      bsp/stm32/libraries/HAL_Drivers/drv_common.c
  2. 2 0
      bsp/stm32/libraries/HAL_Drivers/drv_common.h
  3. 2 2
      components/libc/compilers/common/time.c

+ 1 - 1
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
 

+ 2 - 0
bsp/stm32/libraries/HAL_Drivers/drv_common.h

@@ -13,7 +13,9 @@
 
 #include <rtthread.h>
 #include <rthw.h>
+#ifdef RT_USING_DEVICE
 #include <rtdevice.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {

+ 2 - 2
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;