|
|
@@ -40,7 +40,7 @@
|
|
|
#define HMI_THREAD_TIMESLICE 10 //时间片
|
|
|
|
|
|
#define CONTROL_MOTOR_PRIORITY 7
|
|
|
-#define CONTROL_MOTOR_STACK_SIZE 2048
|
|
|
+#define CONTROL_MOTOR_STACK_SIZE 8192
|
|
|
#define CONTROL_MOTOR_TIMESLICE 5
|
|
|
|
|
|
static char msg_pool[512];
|
|
|
@@ -236,7 +236,9 @@ static int counter_sharpness_diff = 0; //清晰度累计插值 次数变化
|
|
|
|
|
|
void thread1_signal_handler(int sig)
|
|
|
{
|
|
|
- rt_timer_stop(timer_takephoto);
|
|
|
+ if(timer_takephoto){
|
|
|
+ rt_timer_stop(timer_takephoto);
|
|
|
+ }
|
|
|
LOG_I("[对焦] 清晰度值更新:%.2f", device_status.focus_value);
|
|
|
slide_para.pulse_period = mapSpeed(1); // 更新电机速度参数
|
|
|
maxIterations--;
|
|
|
@@ -362,7 +364,7 @@ void thread1_signal_handler(int sig)
|
|
|
slide_para.ydis = stepSize;
|
|
|
slide_para.en_slide = 6; // 触发移动
|
|
|
while (slide_para.en_slide != 0) {
|
|
|
- rt_thread_delay(500); // 等待移动完成
|
|
|
+ rt_thread_delay(50); // 等待移动完成
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -416,7 +418,7 @@ void thread2_signal_handler(int sig)
|
|
|
slide_para.ystep += 80;
|
|
|
slide_para.en_slide = 6; // 触发移动
|
|
|
while (slide_para.en_slide != 0) {
|
|
|
- rt_thread_delay(500); // 等待移动完成
|
|
|
+ rt_thread_delay(50); // 等待移动完成
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -505,6 +507,7 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
DTU_Write("%s",photo);
|
|
|
rt_free(photo);
|
|
|
device_status.autotakepic = 4;
|
|
|
+ rt_thread_delay(1000);
|
|
|
rt_timer_start(timer_takephoto);
|
|
|
}
|
|
|
}
|
|
|
@@ -532,6 +535,7 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
DTU_Write("%s",photo);
|
|
|
rt_free(photo);
|
|
|
device_status.autotakepic = 4;
|
|
|
+ rt_thread_delay(1000);
|
|
|
rt_timer_start(timer_takephoto);
|
|
|
}
|
|
|
if(device_status.autotakepic == 4)
|