Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
car-controlserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenzhongjian
car-controlserver
Commits
cf45f9c5
Commit
cf45f9c5
authored
Jan 28, 2026
by
957dd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/add_bigcar0105' into 'master'
Feature/add bigcar0105 See merge request
!99
parents
ebad67eb
8ff9b0d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
160 additions
and
70 deletions
+160
-70
device_identity.c
app/device_identity/device_identity.c
+4
-0
device_identity.h
app/device_identity/device_identity.h
+1
-0
pthread_open.c
app/main/pthread_open.c
+1
-2
Makefile
build/Makefile
+27
-0
main
build/main
+0
-0
progress.marks
build/third_party/mosquitto/apps/CMakeFiles/progress.marks
+1
-1
progress.make
...osquitto_ctrl/CMakeFiles/mosquitto_ctrl.dir/progress.make
+2
-2
progress.make
...itto_passwd/CMakeFiles/mosquitto_passwd.dir/progress.make
+1
-1
progress.marks
...mosquitto/apps/mosquitto_passwd/CMakeFiles/progress.marks
+1
-1
progress.make
...itto/lib/CMakeFiles/libmosquitto_static.dir/progress.make
+6
-6
progress.marks
...d/third_party/mosquitto/plugins/CMakeFiles/progress.marks
+1
-1
progress.make
.../CMakeFiles/mosquitto_message_timestamp.dir/progress.make
+1
-1
progress.marks
...uitto/plugins/message-timestamp/CMakeFiles/progress.marks
+1
-1
progress.make
...arty/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make
+16
-16
car0105_control.c
drivers/devicecontrol/car0105_control.c
+0
-0
car0105_control.h
drivers/devicecontrol/car0105_control.h
+13
-0
devcontrol_common.c
drivers/devicecontrol/devcontrol_common.c
+25
-1
devcontrol_common.h
drivers/devicecontrol/devcontrol_common.h
+5
-0
pg0403_serial.c
drivers/devicecontrol/pg0403_serial.c
+27
-29
pg0403_serial.h
drivers/devicecontrol/pg0403_serial.h
+0
-7
device_init.c
drivers/gpio/device_init.c
+11
-0
gpio_control.c
drivers/gpio/gpio_control.c
+7
-1
fcsgdevintroduce.md
fcsgdevintroduce.md
+1
-0
common.h
include/common.h
+8
-0
No files found.
app/device_identity/device_identity.c
View file @
cf45f9c5
...
...
@@ -91,6 +91,7 @@ int hash_insert_init(HashTable_t *HashTable_t) {
insert
(
HashTable_t
,
"0102"
,
CAR_0102
);
insert
(
HashTable_t
,
"0103"
,
CAR_0103
);
insert
(
HashTable_t
,
"0104"
,
CAR_0104
);
insert
(
HashTable_t
,
"0105"
,
CAR_0105
);
insert
(
HashTable_t
,
"0201"
,
TANK_0201
);
insert
(
HashTable_t
,
"0202"
,
TANK_0202
);
insert
(
HashTable_t
,
"0203"
,
TANK_0203
);
...
...
@@ -116,6 +117,9 @@ int device_judg(CodeEnum_t code,char *sub_str) {
}
else
if
(
code
==
CAR_0104
)
{
device_init
(
DEVICE_CAR0104
);
my_zlog_info
(
"使用推土机,使用型号%s"
,
sub_str
);
}
if
(
code
==
CAR_0105
)
{
device_init
(
DEVICE_CAR0105
);
my_zlog_info
(
"使用人坐超大车,型号%s"
,
sub_str
);
}
else
if
(
code
==
TANK_0202
)
{
device_init
(
DEVICE_TANK0202
);
my_zlog_info
(
"使用型号%s"
,
sub_str
);
...
...
app/device_identity/device_identity.h
View file @
cf45f9c5
...
...
@@ -12,6 +12,7 @@ typedef enum {
CAR_0102
,
CAR_0103
,
CAR_0104
,
CAR_0105
,
TANK_0201
,
TANK_0202
,
TANK_0203
,
...
...
app/main/pthread_open.c
View file @
cf45f9c5
...
...
@@ -42,10 +42,9 @@ int thread_start_init(ThreadFunc thread_exit_time, ThreadFunc thread_mqtt_beat,
// 出现意外自动停止
void
*
thread_exit_time
(
void
*
arg
)
{
pg0403_serial_run
();
device_serial_exit_run
();
//串口设备的异常退出和接收运行
while
(
1
)
{
if
(
get_self_control_index
()
==
false
)
{
...
...
build/Makefile
View file @
cf45f9c5
...
...
@@ -617,6 +617,30 @@ drivers/devicecontrol/car0104_control.c.s:
$(MAKE)
$(MAKESILENT)
-f
CMakeFiles/main.dir/build.make CMakeFiles/main.dir/drivers/devicecontrol/car0104_control.c.s
.PHONY
:
drivers/devicecontrol/car0104_control.c.s
drivers/devicecontrol/car0105_control.o
:
drivers/devicecontrol/car0105_control.c.o
.PHONY
:
drivers/devicecontrol/car0105_control.o
# target to build an object file
drivers/devicecontrol/car0105_control.c.o
:
$(MAKE)
$(MAKESILENT)
-f
CMakeFiles/main.dir/build.make CMakeFiles/main.dir/drivers/devicecontrol/car0105_control.c.o
.PHONY
:
drivers/devicecontrol/car0105_control.c.o
drivers/devicecontrol/car0105_control.i
:
drivers/devicecontrol/car0105_control.c.i
.PHONY
:
drivers/devicecontrol/car0105_control.i
# target to preprocess a source file
drivers/devicecontrol/car0105_control.c.i
:
$(MAKE)
$(MAKESILENT)
-f
CMakeFiles/main.dir/build.make CMakeFiles/main.dir/drivers/devicecontrol/car0105_control.c.i
.PHONY
:
drivers/devicecontrol/car0105_control.c.i
drivers/devicecontrol/car0105_control.s
:
drivers/devicecontrol/car0105_control.c.s
.PHONY
:
drivers/devicecontrol/car0105_control.s
# target to generate assembly for a file
drivers/devicecontrol/car0105_control.c.s
:
$(MAKE)
$(MAKESILENT)
-f
CMakeFiles/main.dir/build.make CMakeFiles/main.dir/drivers/devicecontrol/car0105_control.c.s
.PHONY
:
drivers/devicecontrol/car0105_control.c.s
drivers/devicecontrol/devcontrol_common.o
:
drivers/devicecontrol/devcontrol_common.c.o
.PHONY
:
drivers/devicecontrol/devcontrol_common.o
...
...
@@ -2069,6 +2093,9 @@ help:
@
echo
"... drivers/devicecontrol/car0104_control.o"
@
echo
"... drivers/devicecontrol/car0104_control.i"
@
echo
"... drivers/devicecontrol/car0104_control.s"
@
echo
"... drivers/devicecontrol/car0105_control.o"
@
echo
"... drivers/devicecontrol/car0105_control.i"
@
echo
"... drivers/devicecontrol/car0105_control.s"
@
echo
"... drivers/devicecontrol/devcontrol_common.o"
@
echo
"... drivers/devicecontrol/devcontrol_common.i"
@
echo
"... drivers/devicecontrol/devcontrol_common.s"
...
...
build/main
View file @
cf45f9c5
No preview for this file type
build/third_party/mosquitto/apps/CMakeFiles/progress.marks
View file @
cf45f9c5
2
3
2
2
build/third_party/mosquitto/apps/mosquitto_ctrl/CMakeFiles/mosquitto_ctrl.dir/progress.make
View file @
cf45f9c5
CMAKE_PROGRESS_1
=
CMAKE_PROGRESS_2
=
81
CMAKE_PROGRESS_1
=
81
CMAKE_PROGRESS_2
=
CMAKE_PROGRESS_3
=
CMAKE_PROGRESS_4
=
82
CMAKE_PROGRESS_5
=
...
...
build/third_party/mosquitto/apps/mosquitto_passwd/CMakeFiles/mosquitto_passwd.dir/progress.make
View file @
cf45f9c5
CMAKE_PROGRESS_1
=
90
CMAKE_PROGRESS_1
=
CMAKE_PROGRESS_2
=
CMAKE_PROGRESS_3
=
91
CMAKE_PROGRESS_4
=
...
...
build/third_party/mosquitto/apps/mosquitto_passwd/CMakeFiles/progress.marks
View file @
cf45f9c5
3
2
build/third_party/mosquitto/lib/CMakeFiles/libmosquitto_static.dir/progress.make
View file @
cf45f9c5
...
...
@@ -8,8 +8,8 @@ CMAKE_PROGRESS_7 =
CMAKE_PROGRESS_8
=
CMAKE_PROGRESS_9
=
18
CMAKE_PROGRESS_10
=
CMAKE_PROGRESS_11
=
19
CMAKE_PROGRESS_12
=
CMAKE_PROGRESS_11
=
CMAKE_PROGRESS_12
=
19
CMAKE_PROGRESS_13
=
CMAKE_PROGRESS_14
=
20
CMAKE_PROGRESS_15
=
...
...
@@ -34,11 +34,11 @@ CMAKE_PROGRESS_33 =
CMAKE_PROGRESS_34
=
CMAKE_PROGRESS_35
=
27
CMAKE_PROGRESS_36
=
CMAKE_PROGRESS_37
=
28
CMAKE_PROGRESS_38
=
CMAKE_PROGRESS_37
=
CMAKE_PROGRESS_38
=
28
CMAKE_PROGRESS_39
=
CMAKE_PROGRESS_40
=
29
CMAKE_PROGRESS_41
=
CMAKE_PROGRESS_40
=
CMAKE_PROGRESS_41
=
29
CMAKE_PROGRESS_42
=
CMAKE_PROGRESS_43
=
30
CMAKE_PROGRESS_44
=
...
...
build/third_party/mosquitto/plugins/CMakeFiles/progress.marks
View file @
cf45f9c5
5
6
build/third_party/mosquitto/plugins/message-timestamp/CMakeFiles/mosquitto_message_timestamp.dir/progress.make
View file @
cf45f9c5
CMAKE_PROGRESS_1
=
CMAKE_PROGRESS_2
=
CMAKE_PROGRESS_2
=
90
build/third_party/mosquitto/plugins/message-timestamp/CMakeFiles/progress.marks
View file @
cf45f9c5
0
1
build/third_party/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make
View file @
cf45f9c5
...
...
@@ -12,17 +12,17 @@ CMAKE_PROGRESS_11 =
CMAKE_PROGRESS_12
=
CMAKE_PROGRESS_13
=
59
CMAKE_PROGRESS_14
=
CMAKE_PROGRESS_15
=
CMAKE_PROGRESS_16
=
60
CMAKE_PROGRESS_15
=
60
CMAKE_PROGRESS_16
=
CMAKE_PROGRESS_17
=
CMAKE_PROGRESS_18
=
CMAKE_PROGRESS_19
=
61
CMAKE_PROGRESS_18
=
61
CMAKE_PROGRESS_19
=
CMAKE_PROGRESS_20
=
CMAKE_PROGRESS_21
=
CMAKE_PROGRESS_22
=
62
CMAKE_PROGRESS_21
=
62
CMAKE_PROGRESS_22
=
CMAKE_PROGRESS_23
=
CMAKE_PROGRESS_24
=
CMAKE_PROGRESS_25
=
63
CMAKE_PROGRESS_24
=
63
CMAKE_PROGRESS_25
=
CMAKE_PROGRESS_26
=
CMAKE_PROGRESS_27
=
64
CMAKE_PROGRESS_28
=
...
...
@@ -41,14 +41,14 @@ CMAKE_PROGRESS_40 =
CMAKE_PROGRESS_41
=
CMAKE_PROGRESS_42
=
69
CMAKE_PROGRESS_43
=
CMAKE_PROGRESS_44
=
CMAKE_PROGRESS_45
=
70
CMAKE_PROGRESS_44
=
70
CMAKE_PROGRESS_45
=
CMAKE_PROGRESS_46
=
CMAKE_PROGRESS_47
=
CMAKE_PROGRESS_48
=
71
CMAKE_PROGRESS_47
=
71
CMAKE_PROGRESS_48
=
CMAKE_PROGRESS_49
=
CMAKE_PROGRESS_50
=
CMAKE_PROGRESS_51
=
72
CMAKE_PROGRESS_50
=
72
CMAKE_PROGRESS_51
=
CMAKE_PROGRESS_52
=
CMAKE_PROGRESS_53
=
73
CMAKE_PROGRESS_54
=
...
...
@@ -70,7 +70,7 @@ CMAKE_PROGRESS_69 =
CMAKE_PROGRESS_70
=
CMAKE_PROGRESS_71
=
79
CMAKE_PROGRESS_72
=
CMAKE_PROGRESS_73
=
CMAKE_PROGRESS_74
=
80
CMAKE_PROGRESS_73
=
80
CMAKE_PROGRESS_74
=
CMAKE_PROGRESS_75
=
drivers/devicecontrol/car0105_control.c
0 → 100644
View file @
cf45f9c5
This diff is collapsed.
Click to expand it.
drivers/devicecontrol/car0105_control.h
0 → 100644
View file @
cf45f9c5
#ifndef CAR0105_CONTROL_H
#define CAR0105_CONTROL_H
int
car0105_serial_run
();
void
car0105_control_change
(
unsigned
char
*
buf
);
void
car0105_serial_stop
();
#endif
\ No newline at end of file
drivers/devicecontrol/devcontrol_common.c
View file @
cf45f9c5
...
...
@@ -19,6 +19,10 @@ const device_didrive device_didrive_control_config_t[]={
.
device_id
=
DEVICE_CAR0104
,
.
device_didrive_control
=
car0104_change
},
{
.
device_id
=
DEVICE_CAR0105
,
.
device_didrive_control
=
car0105_control_change
},
{
.
device_id
=
DEVICE_TANK0202
,
.
device_didrive_control
=
tank0202_change
...
...
@@ -85,6 +89,14 @@ const device_abnormal_close_t devcontrol_config_t[]= {
.
gpio_pwm_pulled
=
pwm_all_default
},
{
.
device_id
=
DEVICE_CAR0105
,
.
device_abnormal_stop
=
car0105_serial_stop
,
.
device_close
=
NULL
,
// TANK0206没有单独的关闭函数
.
gpio_pin_pulled
=
pin_all_default
,
.
gpio_pwm_pulled
=
pwm_all_default
},
{
.
device_id
=
DEVICE_TANK0202
,
.
device_abnormal_stop
=
tank0202_middle
,
...
...
@@ -164,7 +176,7 @@ void device_stop(int device_id) {
}
if
(
!
config
)
{
my_zlog_error
(
"Error: Device gpio stop ID %d not found!"
,
device_id
);
my_zlog_error
(
"Error: Device gpio stop
is low
ID %d not found!"
,
device_id
);
return
;
}
...
...
@@ -217,3 +229,14 @@ void device_walk_control(int device_id,unsigned char *valt) {
config
->
device_didrive_control
(
valt
);
// 速度控制初始化
}
/*
* 串口设备启动
*/
void
device_serial_exit_run
(){
if
(
g_device_type
==
DEVICE_CAR0105
){
car0105_serial_run
();
}
else
if
(
g_device_type
==
DEVICE_PG_GPS0403
){
pg0403_serial_run
();
}
else
return
;
}
\ No newline at end of file
drivers/devicecontrol/devcontrol_common.h
View file @
cf45f9c5
...
...
@@ -7,6 +7,7 @@
#include "car0102_control.h"
#include "car0103_control.h"
#include "car0104_control.h"
#include "car0105_control.h"
#include "ptz0401_control.h"
#include "tank0202_control.h"
#include "tank0203_control.h"
...
...
@@ -22,6 +23,7 @@
#define DEVICE_CAR0102 102 //莽牛小车
#define DEVICE_CAR0103 103 //推土机
#define DEVICE_CAR0104 104 //挖机
#define DEVICE_CAR0105 105 //做人超大车
#define DEVICE_TANK0201 201 //废弃坦克
#define DEVICE_TANK0202 202 //
#define DEVICE_TANK0203 203 //M1A2美国坦克
...
...
@@ -64,4 +66,6 @@ void device_end_close(int device_id);
void
device_walk_control
(
int
device_id
,
unsigned
char
*
valt
);
void
device_serial_exit_run
();
#endif
\ No newline at end of file
drivers/devicecontrol/pg0403_serial.c
View file @
cf45f9c5
...
...
@@ -52,7 +52,7 @@ float run_kalman(Kalman1D *k, float measurement) {
// 辅助函数:将整数波特率转换为 termios 定义的 speed_t
speed_t
get_baud_rate
(
int
baud_rate
)
{
s
tatic
s
peed_t
get_baud_rate
(
int
baud_rate
)
{
switch
(
baud_rate
)
{
case
9600
:
return
B9600
;
case
19200
:
return
B19200
;
...
...
@@ -70,7 +70,7 @@ speed_t get_baud_rate(int baud_rate) {
* 打开串口
* 对应原 C++: bool SerialPort::open(speed_t baud_rate)
*/
int
serial_open
(
SerialPort
*
sp
,
const
char
*
port_name
,
int
baud_rate
)
{
static
int
serial_open
(
SerialPort
*
sp
,
const
char
*
port_name
,
int
baud_rate
)
{
if
(
sp
->
is_open
)
{
fprintf
(
stderr
,
"Warning: Port %s is already open.
\n
"
,
sp
->
port_name
);
return
1
;
// 视为成功
...
...
@@ -152,7 +152,7 @@ int serial_open(SerialPort *sp, const char *port_name, int baud_rate) {
* 发送数据
* C语言中通常使用 write
*/
int
serial_send
(
SerialPort
*
sp
,
uint8_t
*
data
,
int
len
)
{
static
int
serial_send
(
SerialPort
*
sp
,
uint8_t
*
data
,
int
len
)
{
if
(
!
sp
->
is_open
)
{
my_zlog_error
(
"Error: Port not open."
);
return
-
1
;
...
...
@@ -169,7 +169,7 @@ int serial_send(SerialPort *sp, uint8_t *data, int len) {
* 关闭串口
* 对应原 C++: void SerialPort::close()
*/
void
serial_close
(
SerialPort
*
sp
)
{
static
void
serial_close
(
SerialPort
*
sp
)
{
// 原代码中有 stopListening(); C语言中如果没有线程需要手动停止,这里省略
if
(
sp
->
is_open
)
{
...
...
@@ -181,7 +181,7 @@ void serial_close(SerialPort *sp) {
}
// 初始化结构体
void
serial_init
(
SerialPort
*
sp
)
{
static
void
serial_init
(
SerialPort
*
sp
)
{
sp
->
fd
=
-
1
;
sp
->
is_open
=
0
;
memset
(
sp
->
port_name
,
0
,
sizeof
(
sp
->
port_name
));
...
...
@@ -213,7 +213,7 @@ int pg0403_serial_init_send(){
* @param buffer: 接收数据的缓冲区
* @param len: 接收到的数据长度
*/
void
process_serial_data
(
const
uint8_t
*
buffer
,
int
len
)
{
static
void
process_serial_data
(
const
uint8_t
*
buffer
,
int
len
)
{
// 1. 基础长度检查
if
(
len
<
17
)
{
return
;
...
...
@@ -326,31 +326,29 @@ int pg0403_serial_run(){
uint8_t
rx_buffer
[
1024
];
int
total_bytes
=
0
;
if
(
g_device_type
==
DEVICE_PG_GPS0403
){
my_zlog_info
(
"设备为串口打开设备"
);
init_filters
();
if
(
pg0403_serial_init_send
()
==
0
){
my_zlog_info
(
"串口启动成功"
);
}
else
{
my_zlog_info
(
"串口启动失败"
);
pg0403_serial_init_close
();
return
-
1
;
}
}
else
return
-
1
;
while
(
1
){
static
int
send_mqtt_count
=
0
;
int
n
=
read
(
pg_serial
.
fd
,
rx_buffer
,
sizeof
(
rx_buffer
));
process_serial_data
(
rx_buffer
,
n
);
if
(
send_mqtt_count
>
50
){
pg0403_all_serial_send
();
send_mqtt_count
=
0
;
}
delay_ms
(
10
);
send_mqtt_count
++
;
}
init_filters
();
if
(
pg0403_serial_init_send
()
==
0
){
my_zlog_info
(
"串口启动成功"
);
}
else
{
my_zlog_info
(
"串口启动失败"
);
pg0403_serial_init_close
();
return
0
;
return
-
1
;
}
while
(
1
){
static
int
send_mqtt_count
=
0
;
int
n
=
read
(
pg_serial
.
fd
,
rx_buffer
,
sizeof
(
rx_buffer
));
process_serial_data
(
rx_buffer
,
n
);
if
(
send_mqtt_count
>
50
){
pg0403_all_serial_send
();
send_mqtt_count
=
0
;
}
delay_ms
(
10
);
send_mqtt_count
++
;
}
pg0403_serial_init_close
();
return
0
;
}
...
...
drivers/devicecontrol/pg0403_serial.h
View file @
cf45f9c5
...
...
@@ -10,13 +10,6 @@
#define KALMAN_R 0.01f
#define KALMAN_Q 0.01f
// 定义一个结构体表示串口,整洁
typedef
struct
{
int
fd
;
char
port_name
[
64
];
int
is_open
;
}
SerialPort
;
// 单个维度的卡尔曼状态
typedef
struct
{
float
estimate
;
// 当前的最优估计值
...
...
drivers/gpio/device_init.c
View file @
cf45f9c5
...
...
@@ -52,6 +52,17 @@ const deviceconfig_t device_configs[] = {
.
device_control_stop
=
car0104_stop
,
/* 补充速度控制函数 */
.
emergency_code
=
104
},
// car0105配置(根据您的需求补充)
{
.
device_id
=
DEVICE_CAR0105
,
.
device_name
=
"car0105"
,
.
gpio_pins
=
{
5
,
6
,
7
,
9
,
10
,
16
,
20
,
22
,
23
,
24
,
25
,
26
,
-
1
},
/* 补充GPIO引脚 */
.
gpio_pwms
=
{
27
,
-
1
},
.
gpio_inputs
=
{
-
1
},
.
device_pwm_init
=
physics_pwm_init
,
.
device_control_stop
=
car0101_middle_pwm
,
/* 补充速度控制函数 */
.
emergency_code
=
105
},
// tank0202配置(根据您的需求补充)
{
.
device_id
=
DEVICE_TANK0202
,
...
...
drivers/gpio/gpio_control.c
View file @
cf45f9c5
...
...
@@ -237,6 +237,12 @@ const gpiocontrol_t gpio_configs[] = {
.
device_pin_value
=
car0104_pin_value
,
.
device_pwm_value
=
public_pwm_value
},
{
.
device_id
=
DEVICE_CAR0105
,
.
category_id
=
LAND_CAR
,
.
device_pin_value
=
public_pin_value
,
.
device_pwm_value
=
public_pwm_value
},
{
.
device_id
=
DEVICE_TANK0202
,
.
category_id
=
MARINE_TANK
,
...
...
@@ -314,7 +320,7 @@ void device_gpio_control(int device_id,int pin,int val) {
}
if
(
!
gpio_control_config_t
)
{
my_zlog_error
(
"Error: Device gpio
stop
ID %d not found!"
,
device_id
);
my_zlog_error
(
"Error: Device gpio
control
ID %d not found!"
,
device_id
);
return
;
}
...
...
fcsgdevintroduce.md
View file @
cf45f9c5
...
...
@@ -30,6 +30,7 @@
-
car0102 为小车 最大速度为200
-
car0103 为挖机 最大速度为200,更据电池电压具体调速。原电池为7.6v,大概为140左右
-
car0104 为推土机 最大速度为200,更据电池电压具体调速。原电池为7.6v,大概为140左右
-
car0105 为超大车,改遥控器,很多都没有
-
ptz0401 为炮台,有限位。
-
0403 为定位设备
-
0501 为机械狗
...
...
include/common.h
View file @
cf45f9c5
...
...
@@ -47,4 +47,11 @@
#include "delay.h"
#include "mylog.h"
// 定义一个结构体表示串口,整洁
typedef
struct
{
int
fd
;
char
port_name
[
64
];
int
is_open
;
}
SerialPort
;
#endif // COMMON_H
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment