|
@@ -1561,68 +1561,8 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
}else{
|
|
}else{
|
|
|
photo_led_sec = 900;
|
|
photo_led_sec = 900;
|
|
|
}
|
|
}
|
|
|
- /*对焦拍照*/
|
|
|
|
|
- if(device_status.autotakepic==1)
|
|
|
|
|
- {
|
|
|
|
|
- DTU_Write("autotakephoto");
|
|
|
|
|
- HMI_WRITE("sysTest.auto_flag.txt=\"Autotest\"");
|
|
|
|
|
- //打开步进电机驱动器电源
|
|
|
|
|
- ctr_lamp(ON, 1);
|
|
|
|
|
- //打开补光灯
|
|
|
|
|
- ctr_led(ON);
|
|
|
|
|
- //电机向下运动
|
|
|
|
|
- ctr_Motor_Driver(1, 1, 1000000,1000);
|
|
|
|
|
- rt_thread_delay(1000);
|
|
|
|
|
- LOG_I("电机到达下方!!!");
|
|
|
|
|
- Hk_Take_io();
|
|
|
|
|
- rt_thread_delay(1000);
|
|
|
|
|
- LOG_I("电机开始向上!!!");
|
|
|
|
|
- rt_pin_write(Motor_EN, 1);
|
|
|
|
|
- rt_pin_write(Motor_DIR, 0);
|
|
|
|
|
- beep_set(1000000, 200000); //2kzh - 50%
|
|
|
|
|
- while(rt_pin_read(LIMIT_UP)==1)
|
|
|
|
|
- {
|
|
|
|
|
- HMI_WRITE("sysTest.result.txt=\"对焦拍照触发次数:%d\"",photo_setup);
|
|
|
|
|
- HMI_WRITE("sysTest.auto_flag.txt=\"AutoTeststart\"");
|
|
|
|
|
- rt_pin_write(Motor_EN, 0);
|
|
|
|
|
- beep_set(0, 0);//驱动器失能
|
|
|
|
|
- Hk_Take_io(); //触发拍照
|
|
|
|
|
- rt_thread_mdelay(200); //10ms
|
|
|
|
|
- rt_pin_write(Motor_EN, 1);
|
|
|
|
|
- beep_set(1000000, 200000); //驱动器使能
|
|
|
|
|
- rt_thread_mdelay(100); //10ms
|
|
|
|
|
- beep_set(0, 0); //驱动器失能
|
|
|
|
|
- rt_pin_write(Motor_EN, 0);
|
|
|
|
|
- if(photo_setup>300) //限制最大拍照数量
|
|
|
|
|
- {
|
|
|
|
|
- ctr_led(OFF);
|
|
|
|
|
- device_status.autotakepic=0;
|
|
|
|
|
- rt_pin_write(Motor_EN, 0); //驱动器失能
|
|
|
|
|
- beep_set(1000000, 0); //2kzh - 50%
|
|
|
|
|
- HMI_WRITE("sysTest.switchAutopic.val=%d",0);
|
|
|
|
|
- HMI_WRITE("sysTest.auto_flag.txt=\"\"");
|
|
|
|
|
- ctr_lamp(OFF, 1);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- photo_setup++;
|
|
|
|
|
- LOG_I("对焦拍照:%d",photo_setup);
|
|
|
|
|
- }
|
|
|
|
|
- DTU_Write("takephotodone");
|
|
|
|
|
- ctr_led(OFF);
|
|
|
|
|
- rt_pin_write(Motor_EN, 0); //驱动器失能
|
|
|
|
|
- beep_set(1000000, 0); //2kzh - 50%
|
|
|
|
|
- HMI_WRITE("sysTest.switchAutopic.val=%d",0);
|
|
|
|
|
- device_status.autotakepic=0;
|
|
|
|
|
- photo_setup = 0;
|
|
|
|
|
- HMI_WRITE("sysTest.auto_flag.txt=\"\"");
|
|
|
|
|
- HMI_WRITE("sysTest.switchAutopic.val=%d",0);
|
|
|
|
|
- //关闭步进电机驱动器电源
|
|
|
|
|
- ctr_lamp(OFF, 1);
|
|
|
|
|
- //重置运行标志位
|
|
|
|
|
- device_status.run_sta = 0;
|
|
|
|
|
- ef_set_env_blob("run_sta", &device_status.run_sta, sizeof(device_status.run_sta));
|
|
|
|
|
- }
|
|
|
|
|
- else if (device_status.autotakepic==10) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (device_status.autotakepic==10) {
|
|
|
//hwtimer2_pwm3_output(1,500000,1,0);
|
|
//hwtimer2_pwm3_output(1,500000,1,0);
|
|
|
ctr_Motor86_move(13000,50,1);
|
|
ctr_Motor86_move(13000,50,1);
|
|
|
device_status.autotakepic = 0;
|
|
device_status.autotakepic = 0;
|