mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
ports/stm32: Reset vbuffer state when dropping frames.
When dropping a frame the current vbuffer state was Not reset, which caused the following frame(s) to be corrupted, probably also overwriting the next vbuffer. This bug is what caused transposed high-resolution frames to be corrupted. If the DMA is not keeping up you should simply just see slower FPS or no frames at all but definitely never corrupted frames, since they're dropped.
This commit is contained in:
parent
c21472a1cd
commit
64b2708754
@ -405,6 +405,12 @@ void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi) {
|
||||
sensor.first_line = false;
|
||||
if (sensor.drop_frame) {
|
||||
sensor.drop_frame = false;
|
||||
// If the frame was dropped, the buffer will not change, so its state
|
||||
// must be reset.
|
||||
vbuffer_t *buffer = framebuffer_get_tail(FB_PEEK);
|
||||
if (buffer) {
|
||||
buffer->reset_state = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user