Merge pull request #1303 from kwagyeman/kwabena/fix_crop_init

Cropped not True if framesize is invalid
This commit is contained in:
Ibrahim Abd Elkader 2021-05-07 01:54:52 +02:00 committed by GitHub
commit 5f5deb341f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,6 +232,10 @@ static void dcmi_abort()
// Returns true if a crop is being applied to the frame buffer.
static bool cropped()
{
if (sensor.framesize == FRAMESIZE_INVALID) {
return false;
}
return MAIN_FB()->x // needs to be zero if not being cropped.
|| MAIN_FB()->y // needs to be zero if not being cropped.
|| (MAIN_FB()->u != resolution[sensor.framesize][0]) // should be equal to the resolution if not cropped.