samples: cfb: support MONO01 pixel format

When the pixel format fails to set to MONO10, try to set it to MONO01.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
This commit is contained in:
TOKITA Hiroshi 2023-05-28 20:40:30 +09:00 committed by Carles Cufí
parent 038351ad26
commit cedcd2d94e
2 changed files with 8 additions and 4 deletions

View file

@ -26,8 +26,10 @@ int main(void)
}
if (display_set_pixel_format(dev, PIXEL_FORMAT_MONO10) != 0) {
printf("Failed to set required pixel format\n");
return 0;
if (display_set_pixel_format(dev, PIXEL_FORMAT_MONO01) != 0) {
printf("Failed to set required pixel format");
return 0;
}
}
printf("Initialized %s\n", dev->name);

View file

@ -21,8 +21,10 @@ int main(void)
}
if (display_set_pixel_format(display, PIXEL_FORMAT_MONO10) != 0) {
printk("Failed to set required pixel format\n");
return 0;
if (display_set_pixel_format(display, PIXEL_FORMAT_MONO01) != 0) {
printk("Failed to set required pixel format");
return 0;
}
}
if (display_blanking_off(display) != 0) {