mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
ports/mimxrt: Cleanup csi driver for full offload.
This commit is contained in:
parent
57c6addc76
commit
cf2126ecdb
@ -183,6 +183,15 @@ int omv_csi_dma_memcpy(omv_csi_t *csi, void *dma, void *dst, void *src, int bpp,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void omv_csi_frame_callback(omv_csi_t *csi) {
|
||||||
|
// Release the current framebuffer.
|
||||||
|
framebuffer_release(csi->fb, FB_FLAG_FREE | FB_FLAG_CHECK_LAST);
|
||||||
|
CSI_REG_CR3(CSI) &= ~CSI_CR3_DMA_REQ_EN_RFF_MASK;
|
||||||
|
if (csi->frame_cb.fun) {
|
||||||
|
csi->frame_cb.fun(csi->frame_cb.arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void omv_csi_line_callback(omv_csi_t *csi, uint32_t addr) {
|
void omv_csi_line_callback(omv_csi_t *csi, uint32_t addr) {
|
||||||
framebuffer_t *fb = csi->fb;
|
framebuffer_t *fb = csi->fb;
|
||||||
|
|
||||||
@ -228,12 +237,7 @@ void omv_csi_line_callback(omv_csi_t *csi, uint32_t addr) {
|
|||||||
// match the current frame size. Since we don't have an end-of-frame
|
// match the current frame size. Since we don't have an end-of-frame
|
||||||
// interrupt on the MIMXRT, the frame ends when there's no more data.
|
// interrupt on the MIMXRT, the frame ends when there's no more data.
|
||||||
if (jpeg_end) {
|
if (jpeg_end) {
|
||||||
// Release the current framebuffer.
|
omv_csi_frame_callback(csi);
|
||||||
framebuffer_release(fb, FB_FLAG_FREE | FB_FLAG_CHECK_LAST);
|
|
||||||
CSI_REG_CR3(CSI) &= ~CSI_CR3_DMA_REQ_EN_RFF_MASK;
|
|
||||||
if (csi->frame_cb.fun) {
|
|
||||||
csi->frame_cb.fun(csi->frame_cb.arg);
|
|
||||||
}
|
|
||||||
csi->drop_frame = true;
|
csi->drop_frame = true;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -275,12 +279,7 @@ void omv_csi_line_callback(omv_csi_t *csi, uint32_t addr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (++buffer->offset == csi->resolution[csi->framesize][1]) {
|
if (++buffer->offset == csi->resolution[csi->framesize][1]) {
|
||||||
// Release the current framebuffer.
|
omv_csi_frame_callback(csi);
|
||||||
framebuffer_release(fb, FB_FLAG_FREE | FB_FLAG_CHECK_LAST);
|
|
||||||
CSI_REG_CR3(CSI) &= ~CSI_CR3_DMA_REQ_EN_RFF_MASK;
|
|
||||||
if (csi->frame_cb.fun) {
|
|
||||||
csi->frame_cb.fun(csi->frame_cb.arg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user