Skip to content

Commit f0e3130

Browse files
committed
picodvi: Fall back to the default mode if preflight fails
1 parent 201bc69 commit f0e3130

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,14 @@ void picodvi_autoconstruct(void) {
8080

8181
if (rotation != 0 && rotation != 90 && rotation != 180 && rotation != 270) {
8282
// invalid rotation
83-
return;
83+
rotation = 0;
8484
}
8585

8686
if (!common_hal_picodvi_framebuffer_preflight(width, height, color_depth)) {
87-
// TODO: User configuration can fail without a self-explanatory message.
88-
// sadly, a print from here does NOT reach boot_out.txt, so no point in
89-
// spending code size to print a message. Setting aside a safe mode
90-
// message just for this purpose? maybe?
91-
return;
87+
// invalid configuration, set back to default
88+
width = 320;
89+
height = 240;
90+
color_depth = 16;
9291
}
9392

9493
// construct framebuffer and display

0 commit comments

Comments
 (0)