Skip to content

Commit 9191261

Browse files
LinusCDEfenollp
andauthored
Allow disabling the automatic use of our internal swtfb client by setting an env (#118)
* Check env when using Framebuffer::new() or Default trait to auto-select old way This should ensure that binaries built using this version are fixable without recompiling should issues with our current rm2fb client arise. * Fix compilation issue Sorry, but my pc has a billion toolchains and I'm not sure which one right now compiles correctly * Update src/framebuffer/core.rs --------- Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com>
1 parent 76ed003 commit 9191261

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/framebuffer/core.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ impl Framebuffer {
5050
let device = &*device::CURRENT_DEVICE;
5151
match device.model {
5252
Model::Gen1 => Framebuffer::device(device.get_framebuffer_path()),
53-
Model::Gen2 => Framebuffer::rm2fb(device.get_framebuffer_path()),
53+
Model::Gen2 => {
54+
// Auto-select old method still if env LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB is set affirmatively
55+
match std::env::var("LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB").ok() {
56+
Some("1") => Framebuffer::device(device.get_framebuffer_path()),
57+
_ => Framebuffer::rm2fb(device.get_framebuffer_path()),
58+
}
59+
}
5460
}
5561
}
5662

0 commit comments

Comments
 (0)