Init device correctly for LED control

This commit is contained in:
Luke
2020-06-30 09:58:44 +12:00
parent b751ceb29e
commit 20b82b1f24
9 changed files with 37 additions and 27 deletions

View File

@@ -142,10 +142,7 @@ impl LaptopBase {
.unwrap_or_else(|err| warn!("LedBrightDown: {}", err));
}
FnKeys::AuraNext => {
if let Ok(idx) = self
.supported_modes
.binary_search(&config.current_mode.into())
{
if let Ok(idx) = self.supported_modes.binary_search(&config.current_mode) {
let idx_next = if idx < self.supported_modes.len() - 1 {
idx + 1
} else {
@@ -162,10 +159,7 @@ impl LaptopBase {
}
}
FnKeys::AuraPrevious => {
if let Ok(idx) = self
.supported_modes
.binary_search(&config.current_mode.into())
{
if let Ok(idx) = self.supported_modes.binary_search(&config.current_mode) {
let idx_next = if idx > 0 {
idx - 1
} else {