Skip to content

Commit 1e2eb10

Browse files
committed
simplify the conditional tests for resolution modes
1 parent ec0ccd2 commit 1e2eb10

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ports/raspberrypi/common-hal/picodvi/Framebuffer.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ void common_hal_picodvi_framebuffer_construct(picodvi_framebuffer_obj_t *self,
143143

144144
bool color_framebuffer = color_depth >= 8;
145145
const struct dvi_timing *timing = NULL;
146-
if ((width == 640 && height == 240)) {
147-
timing = &dvi_timing_640x480p_60hz;
148-
} else if ((width == 800 && height == 240)) {
149-
timing = &dvi_timing_800x480p_60hz;
150-
} else if ((width == 640 && height == 480) ||
151-
(width == 320 && height == 240)) {
146+
if ((width == 640 && height == 480) ||
147+
(width == 320 && height == 240) ||
148+
(width == 640 && height == 240)
149+
) {
152150
timing = &dvi_timing_640x480p_60hz;
153151
} else if ((width == 800 && height == 480) ||
154-
(width == 400 && height == 240)) {
152+
(width == 400 && height == 240) ||
153+
(width == 800 && height == 240) ||
154+
) {
155155
timing = &dvi_timing_800x480p_60hz;
156156
} else {
157157
if (height != 480 && height != 240) {

0 commit comments

Comments
 (0)