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
4fc025e7
Commit
4fc025e7
authored
Oct 20, 2025
by
957dd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/self_control' into 'master'
优化了一些bug See merge request
!77
parents
cfddd0e7
338b64fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
main.c
app/main/main.c
+4
-1
main
build/main
+0
-0
self_devicecontrol.c
drivers/selfcontrol/self_devicecontrol.c
+5
-3
No files found.
app/main/main.c
View file @
4fc025e7
#include "main.h"
int
main
(){
if
(
mylog_init
()
!=
0
){
my_zlog_error
(
"日志初始化失败,错误代码:%d"
,
mylog_init
());
return
-
1
;
...
...
@@ -59,6 +61,6 @@ int main(){
self_control_thread_close
();
//销毁自控的线程
my_log_close
();
//关闭日志
my_zlog_info
(
"程序关闭成功"
);
return
0
;
return
0
;
}
\ No newline at end of file
build/main
View file @
4fc025e7
No preview for this file type
drivers/selfcontrol/self_devicecontrol.c
View file @
4fc025e7
...
...
@@ -110,14 +110,14 @@ void self_device_control_task(){
}
static
bool
g_selfcontrol_task_index_s
=
true
;
/*
* @brief 自控线程
*/
void
self_device_control_task_function
(){
my_zlog_info
(
"自控线程池循环开始"
);
static
int
s_status
=
0
;
while
(
1
){
while
(
g_selfcontrol_task_index_s
){
if
(
g_self_device_control_switch_index
==
true
){
self_device_control_task
();
s_status
=
1
;
...
...
@@ -129,6 +129,7 @@ void self_device_control_task_function(){
delay_ms
(
100
);
}
}
free_device_tasks_memory
();
my_zlog_info
(
"自控线程池循环终止"
);
return
;
}
...
...
@@ -164,8 +165,9 @@ bool get_self_control_index(){
void
self_control_thread_close
(){
if
(
get_self_control_index
()
==
true
){
my_zlog_info
(
"Destroy the thread of the automatic control device"
);
free_device_tasks_memory
()
;
g_selfcontrol_task_index_s
=
false
;
thread_pool_destroy
(
g_self_devicecontrol_task_t
);
return
;
}
my_zlog_info
(
"The thread of the automatic control device is not opened"
);
}
...
...
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