Skip to content

Commit

Permalink
Allow disabling the automatic use of our internal swtfb client by set…
Browse files Browse the repository at this point in the history
…ting 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 <[email protected]>
  • Loading branch information
LinusCDE and fenollp authored Jul 26, 2024
1 parent 76ed003 commit 9191261
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/framebuffer/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ impl Framebuffer {
let device = &*device::CURRENT_DEVICE;
match device.model {
Model::Gen1 => Framebuffer::device(device.get_framebuffer_path()),
Model::Gen2 => Framebuffer::rm2fb(device.get_framebuffer_path()),
Model::Gen2 => {
// Auto-select old method still if env LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB is set affirmatively
match std::env::var("LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB").ok() {
Some("1") => Framebuffer::device(device.get_framebuffer_path()),
_ => Framebuffer::rm2fb(device.get_framebuffer_path()),
}
}
}
}

Expand Down

0 comments on commit 9191261

Please sign in to comment.