@@ -155,7 +155,13 @@ void CameraControlTask::execute()
155155
156156 // handle taking and storing photos
157157 if (sfr::camera::take_photo == true && sfr::camera::powered == true ) {
158- if (!adaCam.takePicture ()) {
158+ // extra 200ms delay between commanding photo and triggering capture
159+ if (sfr::camera::start_progress < 8 ) {
160+ sfr::camera::start_progress++;
161+ #ifdef VERBOSE
162+ Serial.println (" Photo triggered, delaying additional 100ms" );
163+ #endif
164+ } else if (!adaCam.takePicture ()) {
159165#ifdef VERBOSE
160166 Serial.println (" Failed to snap!" );
161167#endif
@@ -206,7 +212,21 @@ void CameraControlTask::execute()
206212#ifdef VERBOSE
207213 Serial.println (" Done writing file" );
208214#endif
209- sfr::camera::power_setting = (uint8_t )sensor_power_mode_type::off;
215+ if (sfr::camera::images_written == 1 ) {
216+ if (!adaCam.resumeVideo ()) {
217+ #ifdef VERBOSE
218+ Serial.println (" Failed to resume ODS frame!" );
219+ #endif
220+ sfr::camera::power_setting = (uint8_t )sensor_power_mode_type::off;
221+ } else {
222+ sfr::camera::take_photo = true ;
223+ #ifdef VERBOSE
224+ Serial.println (" Triggering second activation of optical sensor" );
225+ #endif
226+ }
227+ } else {
228+ sfr::camera::power_setting = (uint8_t )sensor_power_mode_type::off;
229+ }
210230 }
211231 }
212232 }
@@ -244,6 +264,7 @@ void CameraControlTask::camera_shutdown()
244264 pinMode (constants::camera::tx, OUTPUT);
245265 Pins::setPinState (constants::camera::rx, LOW);
246266 Pins::setPinState (constants::camera::tx, LOW);
267+ sfr::camera::start_progress = 0 ;
247268
248269 // if SD.begin succeeds but camera is never able to snap, reduce SD card power consumption
249270 File file = SD.open (" -" , FILE_WRITE);
0 commit comments