Skip to content

Commit d3334c8

Browse files
committed
identify boards by prefix instead of exact board name
1 parent c2a725f commit d3334c8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rog_fan_curve/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,18 @@ impl Board {
305305
Self::from_name(name.trim())
306306
}
307307

308+
/// Identifies the board using prefixes that have been reported as working
308309
pub fn from_name(name: &str) -> Option<Self> {
310+
for prefix in &["GA401I", "GA401Q"] {
311+
if name.starts_with(prefix) {
312+
return Some(Board::Ga401)
313+
}
314+
}
315+
None
316+
}
317+
318+
/// Identifies the board using exact names that have been reported as working
319+
pub fn from_name_strict(name: &str) -> Option<Self> {
309320
match name {
310321
"GA401IV" => Some(Board::Ga401),
311322
"GA401IU" => Some(Board::Ga401),

0 commit comments

Comments
 (0)