|
|
@@ -458,12 +458,22 @@ static void depth_of_field_fusion(void)
|
|
|
/* 完成对焦 */
|
|
|
static void auto_focus_done(void)
|
|
|
{
|
|
|
+ char *c0 = makeJson_Warn("auto_focus","auto_focus");
|
|
|
+ DTU_Write("%s",c0);
|
|
|
+ rt_free(c0);
|
|
|
LOG_I("[对焦] 完成! 最佳位置:%d 清晰度:%.2f", g_af.best_pos, g_af.best_sharpness);
|
|
|
/* 停止 timer_takephoto,避免景深融合期间产生新的清晰度更新 */
|
|
|
rt_timer_stop(timer_takephoto);
|
|
|
/* 标记景深融合开始,auto_focus_process 会忽略清晰度处理 */
|
|
|
g_af.fusion_active = true;
|
|
|
+ /* 等待清晰度更新 */
|
|
|
g_af.sharpness_updated = false;
|
|
|
+ rt_timer_start(timer_takephoto);
|
|
|
+ uint16_t wait_count = 0;
|
|
|
+ while (!g_af.sharpness_updated && wait_count < 200) {
|
|
|
+ rt_thread_delay(50);
|
|
|
+ wait_count++;
|
|
|
+ }
|
|
|
/* 执行景深融合 */
|
|
|
depth_of_field_fusion();
|
|
|
g_af.fusion_active = false;
|