Skip to content

Commit 5bdfd32

Browse files
authored
Merge pull request #1 from cnadler86/AvailableFramesPR
Available frames pr from espressif#723
2 parents 401ae56 + 7a94dce commit 5bdfd32

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

driver/cam_hal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,3 +535,8 @@ void cam_give_all(void) {
535535
cam_obj->frames[x].en = 1;
536536
}
537537
}
538+
539+
bool cam_get_available_frames(void)
540+
{
541+
return 0 < uxQueueMessagesWaiting(cam_obj->frame_buffer_queue);
542+
}

driver/esp_camera.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,3 +490,10 @@ void esp_camera_return_all(void) {
490490
cam_give_all();
491491
}
492492

493+
bool esp_camera_available_frames(void)
494+
{
495+
if (s_state == NULL) {
496+
return false;
497+
}
498+
return cam_get_available_frames();
499+
}

driver/include/esp_camera.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ esp_err_t esp_camera_load_from_nvs(const char *key);
240240
*/
241241
void esp_camera_return_all(void);
242242

243+
/**
244+
* @brief Check if there are available frames to be immediately acquired
245+
*/
246+
bool esp_camera_available_frames(void);
247+
243248

244249
#ifdef __cplusplus
245250
}

driver/private_include/cam_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ void cam_give(camera_fb_t *dma_buffer);
5757

5858
void cam_give_all(void);
5959

60+
bool cam_get_available_frames(void);
61+
6062
#ifdef __cplusplus
6163
}
6264
#endif

0 commit comments

Comments
 (0)