Skip to content

framework_lib: Add ultra-low powerbutton brightness #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions framework_lib/src/chromium_ec/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ pub enum FpLedBrightnessLevel {
High = 0,
Medium = 1,
Low = 2,
UltraLow = 3,
}

#[repr(C, packed)]
Expand Down
2 changes: 2 additions & 0 deletions framework_lib/src/commandline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ pub enum FpBrightnessArg {
High,
Medium,
Low,
UltraLow,
}
impl From<FpBrightnessArg> for FpLedBrightnessLevel {
fn from(w: FpBrightnessArg) -> FpLedBrightnessLevel {
match w {
FpBrightnessArg::High => FpLedBrightnessLevel::High,
FpBrightnessArg::Medium => FpLedBrightnessLevel::Medium,
FpBrightnessArg::Low => FpLedBrightnessLevel::Low,
FpBrightnessArg::UltraLow => FpLedBrightnessLevel::UltraLow,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions framework_lib/src/commandline/uefi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ pub fn parse(args: &[String]) -> Cli {
Some(Some(FpBrightnessArg::Medium))
} else if fp_brightness_arg == "low" {
Some(Some(FpBrightnessArg::Low))
} else if fp_brightness_arg == "ultra-low" {
Some(Some(FpBrightnessArg::UltraLow))
} else {
println!("Invalid value for --fp-brightness: {}", fp_brightness_arg);
None
Expand Down