From 4931510ad38aadb1769c9241bfad0c3d77ad687f Mon Sep 17 00:00:00 2001 From: Balz Guenat Date: Mon, 1 Jan 2018 23:47:51 +0100 Subject: backlight breathing overhaul (#2187) * add breathing to bananasplit * backlight breathing overhaul * fix the backlight_tick thing. * fix for vision_division backlight * fix a few keymaps and probably break breathing for some weirdly set-up boards. * remove BL_x keycodes because they made unreasonable assumptions * some fixes for BL keycodes * integer cie lightness scaling * use cie lightness for non-breathing backlight and make breathing able to reach true max brightness --- keyboards/bananasplit/config.h | 2 +- keyboards/bananasplit/keymaps/coloneljesus/config.h | 2 ++ keyboards/bananasplit/keymaps/coloneljesus/keymap.c | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'keyboards/bananasplit') diff --git a/keyboards/bananasplit/config.h b/keyboards/bananasplit/config.h index 4bb5b85e0..5649ab4aa 100644 --- a/keyboards/bananasplit/config.h +++ b/keyboards/bananasplit/config.h @@ -42,7 +42,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* number of backlight levels */ -#define BACKLIGHT_LEVELS 1 +#define BACKLIGHT_LEVELS 3 /* mapping backlight LEDs to correct Pin */ #define BACKLIGHT_PIN B7 diff --git a/keyboards/bananasplit/keymaps/coloneljesus/config.h b/keyboards/bananasplit/keymaps/coloneljesus/config.h index 5f2cd13fe..92a67f647 100644 --- a/keyboards/bananasplit/keymaps/coloneljesus/config.h +++ b/keyboards/bananasplit/keymaps/coloneljesus/config.h @@ -21,5 +21,7 @@ // place overrides here #define GRAVE_ESC_CTRL_OVERRIDE +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 8 #endif diff --git a/keyboards/bananasplit/keymaps/coloneljesus/keymap.c b/keyboards/bananasplit/keymaps/coloneljesus/keymap.c index ac7f1113a..b5889aa19 100644 --- a/keyboards/bananasplit/keymaps/coloneljesus/keymap.c +++ b/keyboards/bananasplit/keymaps/coloneljesus/keymap.c @@ -16,7 +16,7 @@ #include "bananasplit.h" enum custom_keycodes { - WIN_SWITCH_LAYOUT = SAFE_RANGE + WIN_SWITCH_LAYOUT = SAFE_RANGE, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ KC_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, KC_PGUP, KC_INS, KC_HOME, LCTL(KC_LEFT), LCTL(KC_RGHT), KC_END, _______, _______, _______, KC_PSCR, \ _______, KC_MUTE, KC_VOLD, KC_MPLY, KC_PGDN, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, \ - _______, _______, _______, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, _______, \ + _______, BL_STEP, BL_BRTG, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, RESET \ ), }; @@ -76,19 +76,19 @@ void matrix_scan_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + case WIN_SWITCH_LAYOUT: { // Sends Alt+Shift on both key down and key up. // Designed to switch between two keyboard layouts on Windows using a locking switch. // Does nothing if right shift is pressed for easy resync. - if (!(get_mods() & MOD_BIT(KC_RSFT))) { + if (!(get_mods() & MOD_BIT(KC_RSFT))) SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_LSHIFT)SS_UP(X_LALT)); - return false; - } - else - return false; + return false; } + + default: + return true; } - return true; } void led_set_user(uint8_t usb_led) { -- cgit v1.2.3-24-g4f1b