Skip to content

Commit 4aaf463

Browse files
JarmouniAkartben
authored andcommitted
drivers: display: sdl: clear display only for supported pixel formats
Clear display only when display pixel format is actually supported since buffer size depends on it. Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
1 parent abde419 commit 4aaf463

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/display/display_sdl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ static int sdl_display_clear(const struct device *dev)
504504
size = config->width * config->height * 2U;
505505
break;
506506
default:
507-
LOG_ERR("Pixel format not supported");
507+
__ASSERT_MSG_INFO("Pixel format not supported");
508+
return -EINVAL;
508509
}
509510
LOG_DBG("size: %zu, bgcolor: %hhu", size, bgcolor);
510511
memset(disp_data->buf, bgcolor, size);

0 commit comments

Comments
 (0)