Skip to content

Commit 9f88b3e

Browse files
committed
add fan curve support parity with Linux daemon
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)
1 parent 264b41a commit 9f88b3e

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Thelio Io Windows Driver (WORK IN PROGRESS)
22

33
- Install GIT LFS prior to cloning this repository
4-
- Install Rust from https://rustup.rs/
4+
- Install Rust from https://rustup.rs/ 1.53.0 or newer (ie `rustup toolchain install 1.55.0`)
55
- Install Chocolaty from https://chocolatey.org/install
66
- Launch an Administrator Command Prompt and run the following:
77
```

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.50.0
1+
1.53.0

src/main.rs

+13
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ fn driver() -> io::Result<()> {
9090
debug!("{} {} uses standard fan curve", sys_vendor, product_version);
9191
FanCurve::standard()
9292
},
93+
("System76", "thelio-major-r1") => {
94+
debug!("{} {} uses threadripper2 fan curve", sys_vendor, product_version);
95+
FanCurve::threadripper2()
96+
},
97+
("System76", "thelio-major-r2" | "thelio-major-r2.1" | "thelio-major-b1" | "thelio-major-b2"
98+
| "thelio-major-b3" | "thelio-mega-r1" | "thelio-mega-r1.1" ) => {
99+
debug!("{} {} uses hedt fan curve", sys_vendor, product_version);
100+
FanCurve::hedt()
101+
},
102+
("System76", "thelio-massive-b1") => {
103+
debug!("{} {} uses xeon fan curve", sys_vendor, product_version);
104+
FanCurve::xeon()
105+
},
93106
_ => return Err(io::Error::new(
94107
io::ErrorKind::Other,
95108
format!(

0 commit comments

Comments
 (0)