mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
common/csi: Add support for non-blocking flag.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
parent
72410dfc8c
commit
3270272e11
@ -1621,16 +1621,14 @@ __weak int omv_csi_copy_line(omv_csi_t *csi, void *dma, uint8_t *src, uint8_t *d
|
|||||||
}
|
}
|
||||||
|
|
||||||
__weak int omv_csi_snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) {
|
__weak int omv_csi_snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) {
|
||||||
|
int ret = OMV_CSI_ERROR_CTL_UNSUPPORTED;
|
||||||
|
|
||||||
// Call the sensor specific function.
|
// Call the sensor specific function.
|
||||||
if (csi->snapshot == NULL) {
|
if (csi->snapshot) {
|
||||||
return OMV_CSI_ERROR_CTL_UNSUPPORTED;
|
ret = csi->snapshot(csi, image, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (csi->snapshot(csi, image, flags) != 0) {
|
return ret;
|
||||||
return OMV_CSI_ERROR_CTL_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *omv_csi_strerror(int error) {
|
const char *omv_csi_strerror(int error) {
|
||||||
@ -1656,6 +1654,7 @@ const char *omv_csi_strerror(int error) {
|
|||||||
"Frame buffer error.",
|
"Frame buffer error.",
|
||||||
"Frame buffer overflow, try reducing the frame size.",
|
"Frame buffer overflow, try reducing the frame size.",
|
||||||
"JPEG frame buffer overflow.",
|
"JPEG frame buffer overflow.",
|
||||||
|
"The requested operation would block.",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Sensor errors are negative.
|
// Sensor errors are negative.
|
||||||
|
|||||||
@ -195,6 +195,7 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OMV_CSI_CAPTURE_FLAGS_UPDATE = (1 << 0),
|
OMV_CSI_CAPTURE_FLAGS_UPDATE = (1 << 0),
|
||||||
|
OMV_CSI_CAPTURE_FLAGS_NBLOCK = (1 << 1),
|
||||||
} omv_csi_capture_flags_t;
|
} omv_csi_capture_flags_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -258,6 +259,7 @@ typedef enum {
|
|||||||
OMV_CSI_ERROR_FRAMEBUFFER_ERROR = -18,
|
OMV_CSI_ERROR_FRAMEBUFFER_ERROR = -18,
|
||||||
OMV_CSI_ERROR_FRAMEBUFFER_OVERFLOW = -19,
|
OMV_CSI_ERROR_FRAMEBUFFER_OVERFLOW = -19,
|
||||||
OMV_CSI_ERROR_JPEG_OVERFLOW = -20,
|
OMV_CSI_ERROR_JPEG_OVERFLOW = -20,
|
||||||
|
OMV_CSI_ERROR_WOULD_BLOCK = -21,
|
||||||
} omv_csi_error_t;
|
} omv_csi_error_t;
|
||||||
|
|
||||||
#if (OMV_GENX320_ENABLE == 1)
|
#if (OMV_GENX320_ENABLE == 1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user