Skip to content
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

Timber Wolf - updated via keymap, reduced eeprom writing from backlight code #9876

Merged
merged 6 commits into from
Jul 30, 2020
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
2 changes: 1 addition & 1 deletion keyboards/metamechs/timberwolf/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

/* Backlighting code used for caps lock indicator */
#define BACKLIGHT_PIN C6
#define BACKLIGHT_LEVELS 9
#define BACKLIGHT_LEVELS 16

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
// #define LOCKING_SUPPORT_ENABLE
Expand Down
10 changes: 5 additions & 5 deletions keyboards/metamechs/timberwolf/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base */
[0] = LAYOUT_all(
KC_MUTE,KC_ESC ,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_INS ,KC_HOME,KC_PGUP,
RESET ,KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC,KC_DEL ,KC_END ,KC_PGDN,
BL_INC ,KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS ,KC_PSCR,KC_SLCK,
BL_DEC ,KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT ,KC_DEL ,KC_INS ,
KC_F13 ,KC_LSFT,KC_NUBS,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,MO(1) ,KC_UP ,KC_UP ,KC_PENT,
KC_F13 ,KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC,KC_DEL ,KC_END ,KC_PGDN,
KC_F14 ,KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS ,KC_DEL ,KC_PSCR,
KC_F15 ,KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT ,KC_DEL ,KC_PENT,
KC_F16 ,KC_LSFT,KC_NUBS,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,MO(1) ,KC_UP ,KC_UP ,KC_PENT,
MO(1) ,KC_LCTL,KC_LGUI,KC_LALT ,KC_SPC ,KC_RALT,KC_RGUI,KC_RCTL,KC_LEFT,KC_LEFT,KC_DOWN,KC_RGHT,KC_PENT
),
[1] = LAYOUT_all(
Expand All @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______,_______,_______,_______,_______,_______,_______
_______,_______,_______,_______ ,_______ ,_______,_______,_______,_______,_______,_______,_______,_______
),
[2] = LAYOUT_all(
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______,_______,_______,
Expand Down
10 changes: 4 additions & 6 deletions keyboards/metamechs/timberwolf/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes # Enable encoder support
LTO_ENABLE = yes

BACKLIGHT_DRIVER = pwm
BACKLIGHT_DRIVER = pwm
14 changes: 8 additions & 6 deletions keyboards/metamechs/timberwolf/timberwolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@

bool led_update_kb(led_t led_state) {
bool runDefault = led_update_user(led_state);
if (led_state.caps_lock) {
backlight_enable();
} else {
backlight_disable();
}
if(runDefault) {
if (led_state.caps_lock) {
backlight_level_noeeprom(get_backlight_level());
} else {
backlight_set(0);
}
}
return runDefault;
}
}