Commit 4fc025e7 authored by 957dd's avatar 957dd

Merge branch 'feature/self_control' into 'master'

优化了一些bug See merge request !77
parents cfddd0e7 338b64fe
#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
No preview for this file type
......@@ -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");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment