From 6c057974e0afe068950049d98633bbfee3321956 Mon Sep 17 00:00:00 2001 From: xudx Date: Wed, 13 Nov 2024 15:23:09 +0800 Subject: [PATCH] [FIXED] something wrong --- CMakeLists.txt | 2 ++ drv/drv_can.c | 14 -------------- drv/drv_can.h | 16 +++++++++++++++- drv/drv_tcp.h | 2 ++ test/test.c | 1 + test/test.h | 2 ++ 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a95b8e..979d485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,8 @@ set(DRV_SOURCE ${PROJECT_SOURCE_DIR}/drv/drv_do.c # UART驱动源文件 ${PROJECT_SOURCE_DIR}/drv/drv_uart.c + # CAN驱动源文件 + ${PROJECT_SOURCE_DIR}/drv/drv_can.c # TCP驱动源文件 ${PROJECT_SOURCE_DIR}/drv/drv_tcp.c ) diff --git a/drv/drv_can.c b/drv/drv_can.c index d420a5f..fce1c04 100644 --- a/drv/drv_can.c +++ b/drv/drv_can.c @@ -1,18 +1,4 @@ #include "drv_can.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /*PPSIX 终端控制定义*/ -#include "drv_can.h" /* * @description : 字符串按格式输出 diff --git a/drv/drv_can.h b/drv/drv_can.h index d507fd9..bf7a1cc 100644 --- a/drv/drv_can.h +++ b/drv/drv_can.h @@ -1,11 +1,25 @@ #ifndef __DRV_CAN_H_ #define __DRV_CAN_H_ +#define _DEFAULT_SOURCE + #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /*PPSIX 终端控制定义*/ #define CAN_MODE 0 #define CAN_FD_MODE 1 -#define _DEFAULT_SOURCE /*CAN口参数结构体 */ typedef struct diff --git a/drv/drv_tcp.h b/drv/drv_tcp.h index 84c30ab..c1e422d 100644 --- a/drv/drv_tcp.h +++ b/drv/drv_tcp.h @@ -1,6 +1,8 @@ #ifndef __DRV_TCP_H_ #define __DRV_TCP_H_ +#define _DEFAULT_SOURCE + #include #include #include diff --git a/test/test.c b/test/test.c index 592ccc4..5e472c5 100644 --- a/test/test.c +++ b/test/test.c @@ -6,6 +6,7 @@ #include "drv_di.h" #include "drv_do.h" #include "drv_uart.h" +#include "drv_can.h" #include "drv_tcp.h" void runTest() diff --git a/test/test.h b/test/test.h index b42cd7d..f13465e 100644 --- a/test/test.h +++ b/test/test.h @@ -1,6 +1,8 @@ #ifndef __TEST_H_ #define __TEST_H_ +#define _DEFAULT_SOURCE + void runTest(); void testDI(); void testDO();