Skip to content

Commit

Permalink
add fan curve support parity with Linux daemon
Browse files Browse the repository at this point in the history
fan curves and model strings current as-of:
  https://github.com/pop-os/system76-power/blob/79b02d/src/fan.rs

also add note about rust 1.53 or newer to README.md and bump ./rust-toolchain to same (note: 1.55 is current release!)

This is due to the use of "or patterns" inside a match. This was
stabilized in rust 1.53: rust-lang/rust#79278

(and, I believe, is being used in the Linux daemon)
  • Loading branch information
draeath committed Sep 10, 2021
1 parent 264b41a commit 9f88b3e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Thelio Io Windows Driver (WORK IN PROGRESS)

- Install GIT LFS prior to cloning this repository
- Install Rust from https://rustup.rs/
- Install Rust from https://rustup.rs/ 1.53.0 or newer (ie `rustup toolchain install 1.55.0`)
- Install Chocolaty from https://chocolatey.org/install
- Launch an Administrator Command Prompt and run the following:
```
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.50.0
1.53.0
13 changes: 13 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ fn driver() -> io::Result<()> {
debug!("{} {} uses standard fan curve", sys_vendor, product_version);
FanCurve::standard()
},
("System76", "thelio-major-r1") => {
debug!("{} {} uses threadripper2 fan curve", sys_vendor, product_version);
FanCurve::threadripper2()
},
("System76", "thelio-major-r2" | "thelio-major-r2.1" | "thelio-major-b1" | "thelio-major-b2"
| "thelio-major-b3" | "thelio-mega-r1" | "thelio-mega-r1.1" ) => {
debug!("{} {} uses hedt fan curve", sys_vendor, product_version);
FanCurve::hedt()
},
("System76", "thelio-massive-b1") => {
debug!("{} {} uses xeon fan curve", sys_vendor, product_version);
FanCurve::xeon()
},
_ => return Err(io::Error::new(
io::ErrorKind::Other,
format!(
Expand Down

0 comments on commit 9f88b3e

Please sign in to comment.