mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #2052 from kwagyeman/kwabena/fix_servicing_tiny_usb
ports/mimxrt: Service TinyUSB while waiting for sensor frames.
This commit is contained in:
commit
e4c0846c55
@ -335,7 +335,7 @@ int sensor_snapshot(sensor_t *sensor, image_t *image, uint32_t flags) {
|
|||||||
vbuffer_t *buffer = framebuffer_get_head(FB_NO_FLAGS);
|
vbuffer_t *buffer = framebuffer_get_head(FB_NO_FLAGS);
|
||||||
// Wait for the DMA to finish the transfer.
|
// Wait for the DMA to finish the transfer.
|
||||||
for (mp_uint_t ticks = mp_hal_ticks_ms(); buffer == NULL;) {
|
for (mp_uint_t ticks = mp_hal_ticks_ms(); buffer == NULL;) {
|
||||||
buffer = framebuffer_get_head(FB_NO_FLAGS);
|
MICROPY_EVENT_POLL_HOOK
|
||||||
if ((mp_hal_ticks_ms() - ticks) > 3000) {
|
if ((mp_hal_ticks_ms() - ticks) > 3000) {
|
||||||
sensor_abort();
|
sensor_abort();
|
||||||
|
|
||||||
@ -347,6 +347,7 @@ int sensor_snapshot(sensor_t *sensor, image_t *image, uint32_t flags) {
|
|||||||
|
|
||||||
return SENSOR_ERROR_CAPTURE_TIMEOUT;
|
return SENSOR_ERROR_CAPTURE_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
buffer = framebuffer_get_head(FB_NO_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We're done receiving data.
|
// We're done receiving data.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user