Skip to content

Commit

Permalink
Merge pull request #15 from MvEerd/LED_FN
Browse files Browse the repository at this point in the history
Fix brightness/animation_speed and Add LED functions to FN layer
  • Loading branch information
ah- authored Mar 6, 2018
2 parents cdd05cb + bfaa15f commit 5dd7438
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const FN_M: Action = LayerMomentary(1);
const LED_M: Action = LayerMomentary(2);
const BT_T: Action = LayerToggle(3);
const __: Action = Transparent;
const LedNT: Action = LedNextTheme;
const LedNB: Action = LedNextBrightness;
const LedNAS: Action = LedNextAnimationSpeed;


pub const BASE: Layout = layout![
Escape N1 N2 N3 N4 N5 N6 N7 N8 N9 N0 Minus Equal BSpace
Expand All @@ -35,15 +39,15 @@ pub const BASE: Layout = layout![
];

pub const FN: Layout = layout![
Grave F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 __
__ __ Up __ __ __ __ __ Up Scrolllock Pause Home End PScreen
__ Left Down Right __ __ __ Left Down Right PgUp PgDown No __
__ __ __ __ __ __ __ __ __ Insert Delete No No __
__ __ __ No No __ No No No No __ __ __ __
Grave F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 __
__ __ Up __ LedOn LedNAS LedNB LedNT Up Scrolllock Pause Home End PScreen
__ Left Down Right __ __ __ Left Down Right PgUp PgDown No __
__ __ __ __ __ __ __ __ __ Insert Delete No No __
__ __ __ No No __ No No No No __ __ __ __
];

pub const LED: Layout = layout![
LedOff LedOn LedNextTheme LedNextAnimationSpeed LedNextBrightness __ __ __ __ __ __ __ __ __
LedOff LedOn LedNT LedNAS LedNB __ __ __ __ __ __ __ __ __
__ LedTheme(0) LedTheme(1) LedTheme(2) LedTheme(14) LedTheme(17) LedTheme(18) __ __ __ __ __ __ __
__ __ __ __ __ __ __ __ __ __ __ __ No __
__ __ __ __ __ __ __ __ __ __ __ __ __ __
Expand All @@ -55,5 +59,5 @@ pub const BT: Layout = layout![
BtBroadcast BtSaveHost(0) BtSaveHost(1) BtSaveHost(2) BtSaveHost(3) __ __ __ __ __ __ __ __ __
BtCompatibilityMode(true) BtDeleteHost(0) BtDeleteHost(1) BtDeleteHost(2) BtDeleteHost(3) __ __ __ __ __ __ __ No __
BtCompatibilityMode(false) __ __ __ __ __ __ __ __ __ __ __ __ __
LedNextTheme BtHostListQuery __ No No __ No No No No __ __ __ __
LedNT BtHostListQuery __ No No __ No No No No __ __ __ __
];
4 changes: 2 additions & 2 deletions src/led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ impl<'a> Led<'a> {
}

pub fn next_brightness(&mut self) -> nb::Result<(), !> {
self.serial.send(MsgType::Led, LedOp::ConfigCmd as u8, &[0, 1, 0])
self.serial.send(MsgType::Led, LedOp::ConfigCmd as u8, &[0, 0, 1])
}

pub fn next_animation_speed(&mut self) -> nb::Result<(), !> {
self.serial.send(MsgType::Led, LedOp::ConfigCmd as u8, &[0, 0, 1])
self.serial.send(MsgType::Led, LedOp::ConfigCmd as u8, &[0, 1, 0])
}

pub fn set_theme(&mut self, theme: u8) -> nb::Result<(), !> {
Expand Down

0 comments on commit 5dd7438

Please sign in to comment.