@@ -155,7 +155,13 @@ void CameraControlTask::execute()
155
155
156
156
// handle taking and storing photos
157
157
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 ()) {
159
165
#ifdef VERBOSE
160
166
Serial.println (" Failed to snap!" );
161
167
#endif
@@ -206,7 +212,21 @@ void CameraControlTask::execute()
206
212
#ifdef VERBOSE
207
213
Serial.println (" Done writing file" );
208
214
#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
+ }
210
230
}
211
231
}
212
232
}
@@ -244,6 +264,7 @@ void CameraControlTask::camera_shutdown()
244
264
pinMode (constants::camera::tx, OUTPUT);
245
265
Pins::setPinState (constants::camera::rx, LOW);
246
266
Pins::setPinState (constants::camera::tx, LOW);
267
+ sfr::camera::start_progress = 0 ;
247
268
248
269
// if SD.begin succeeds but camera is never able to snap, reduce SD card power consumption
249
270
File file = SD.open (" -" , FILE_WRITE);
0 commit comments