diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-25 16:02:54 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-25 16:02:54 +0200 |
commit | 6afdd9d74da250e47ac64d6690bd19d037045e99 (patch) | |
tree | 661f6cfb244c02bcd1fbfe8fb9b2bd9242a91394 /keyboards/work_louder | |
parent | 93a55e61b59d20f7cd842cce02e5b18a63a23612 (diff) | |
parent | 1bdf4cdc22ae57d111efb2f7d71e405e5c7b3f11 (diff) | |
download | qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.tar.gz qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.zip |
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/work_louder')
47 files changed, 873 insertions, 529 deletions
diff --git a/keyboards/work_louder/encoder_actions.c b/keyboards/work_louder/encoder_actions.c deleted file mode 100644 index b41a248a83..0000000000 --- a/keyboards/work_louder/encoder_actions.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * Copyright 2021 drashna jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "encoder_actions.h" - -#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE) - -# ifdef ENCODERS -static uint8_t encoder_state[ENCODERS] = {0}; -static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY; -static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY; -# endif - -void encoder_action_unregister(void) { -# ifdef ENCODERS - for (int index = 0; index < ENCODERS; ++index) { - if (encoder_state[index]) { - keyevent_t encoder_event = (keyevent_t) { - .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], - .pressed = false, - .time = (timer_read() | 1) - }; - encoder_state[index] = 0; - action_exec(encoder_event); - } - } -# endif -} - -void encoder_action_register(uint8_t index, bool clockwise) { -# ifdef ENCODERS - keyevent_t encoder_event = (keyevent_t) { - .key = clockwise ? encoder_cw[index] : encoder_ccw[index], - .pressed = true, - .time = (timer_read() | 1) - }; - encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); - action_exec(encoder_event); -# endif -} - -void matrix_scan_kb(void) { - encoder_action_unregister(); - matrix_scan_user(); -} - -bool encoder_update_kb(uint8_t index, bool clockwise) { - encoder_action_register(index, clockwise); - // don't return user actions, because they are in the keymap - // encoder_update_user(index, clockwise); - return true; -}; - -#endif diff --git a/keyboards/work_louder/encoder_actions.h b/keyboards/work_louder/encoder_actions.h deleted file mode 100644 index 2484af52ae..0000000000 --- a/keyboards/work_louder/encoder_actions.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "quantum.h" - -void encoder_action_unregister(void); - -void encoder_action_register(uint8_t index, bool clockwise); diff --git a/keyboards/work_louder/loop/config.h b/keyboards/work_louder/loop/config.h index b397ec2c1d..32856ecebf 100644 --- a/keyboards/work_louder/loop/config.h +++ b/keyboards/work_louder/loop/config.h @@ -19,15 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x574C -#define PRODUCT_ID 0x1DF8 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Work Louder -#define PRODUCT Loop Pad - /* key matrix size */ -#define MATRIX_ROWS 2 +#define MATRIX_ROWS 1 #define MATRIX_COLS 12 /* @@ -41,9 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #define MATRIX_ROW_PINS \ - { F5, NO_PIN } + { F5 } #define MATRIX_COL_PINS { B3, B2, B1, D6, D7, B4, B5, B6, C6, C7, F7, F6 } -#define UNUSED_PINS /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -60,7 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define BACKLIGHT_BREATHING #define RGBLIGHT_DI_PIN E6 -# define RGBLED_NUM 24 //# define RGBLIGHT_HUE_STEP 8 //# define RGBLIGHT_SAT_STEP 8 //# define RGBLIGHT_VAL_STEP 8 @@ -202,8 +193,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define ENCODERS_PAD_A { D0, D2, D5 } #define ENCODERS_PAD_B { D1, D3, D4 } - -#define ENCODERS 3 - -#define ENCODERS_CW_KEY { { 0, 1 }, { 2, 1 }, { 4, 1 } } -#define ENCODERS_CCW_KEY { { 1, 1 }, { 3, 1 }, { 5, 1 } } diff --git a/keyboards/work_louder/loop/info.json b/keyboards/work_louder/loop/info.json index 2190f53512..67b9d1f06d 100644 --- a/keyboards/work_louder/loop/info.json +++ b/keyboards/work_louder/loop/info.json @@ -1,7 +1,12 @@ { - "keyboard_name": "loop", - "url": "", + "keyboard_name": "Loop Pad", + "manufacturer": "Work Louder", + "url": "https://worklouder.cc/", "maintainer": "Work Louder", + "usb": { + "vid": "0x574C", + "pid": "0x1DF9" + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/work_louder/loop/keymaps/via/keymap.c b/keyboards/work_louder/loop/keymaps/via/keymap.c index 286c651361..5b35be9cf3 100644 --- a/keyboards/work_louder/loop/keymaps/via/keymap.c +++ b/keyboards/work_louder/loop/keymaps/via/keymap.c @@ -15,30 +15,28 @@ */ #include QMK_KEYBOARD_H -#define LAYOUT_via( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k00_a, k00_b, k01_a, k01_b, k02_a, k02_b \ -) { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k00_a, k00_b, k01_a, k01_b, k02_a, k02_b } \ -} - // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_via( - KC_MUTE, KC_MPLY, R_M_TOG, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, MO(1), - KC_VOLU, KC_VOLD, KC_MNXT, KC_MPRV, R_M_MOD, R_M_RMOD + [0] = LAYOUT( + KC_MUTE, KC_MPLY, R_M_TOG, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, MO(1) ), - [1] = LAYOUT_via( - QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, MO(2), _______, - _______, _______, _______, _______, RGB_MOD, RGB_RMOD + [1] = LAYOUT( + QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, MO(2), _______ ), - [2] = LAYOUT_via( - QK_BOOT, _______, R_M_TOG, R_M_MOD, R_M_HUI, R_M_HUD, R_M_SAI, R_M_SAD, R_M_VAI, R_M_VAD, _______, _______, - _______, _______, _______, _______, R_M_MOD, R_M_RMOD + [2] = LAYOUT( + QK_BOOT, _______, R_M_TOG, R_M_MOD, R_M_HUI, R_M_HUD, R_M_SAI, R_M_SAD, R_M_VAI, R_M_VAD, _______, _______ ), - [3] = LAYOUT_via( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______ + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; +// clang-format on + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_MPRV, KC_MNXT), ENCODER_CCW_CW(R_M_RMOD, R_M_MOD) }, + [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, +}; +#endif diff --git a/keyboards/work_louder/loop/keymaps/via/rules.mk b/keyboards/work_louder/loop/keymaps/via/rules.mk index 6098ef3ad8..1189f4ad19 100644 --- a/keyboards/work_louder/loop/keymaps/via/rules.mk +++ b/keyboards/work_louder/loop/keymaps/via/rules.mk @@ -1,4 +1,3 @@ VIA_ENABLE = yes LTO_ENABLE = yes - -SRC += encoder_actions.c +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/work_louder/loop/loop.c b/keyboards/work_louder/loop/loop.c index 5c0d108d19..6b4af7fcb6 100644 --- a/keyboards/work_louder/loop/loop.c +++ b/keyboards/work_louder/loop/loop.c @@ -16,7 +16,7 @@ #include "loop.h" -#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE) +#if defined(ENCODER_ENABLE) bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } if (index == 0) { diff --git a/keyboards/work_louder/loop/loop.h b/keyboards/work_louder/loop/loop.h index cfc58146d1..a7376881b3 100644 --- a/keyboards/work_louder/loop/loop.h +++ b/keyboards/work_louder/loop/loop.h @@ -17,7 +17,6 @@ #pragma once #include "quantum.h" -#include "encoder_actions.h" #include "rgb_functions.h" /* This is a shortcut to help you visually see your layout. diff --git a/keyboards/work_louder/loop/rev1/config.h b/keyboards/work_louder/loop/rev1/config.h new file mode 100644 index 0000000000..1bc02d08a6 --- /dev/null +++ b/keyboards/work_louder/loop/rev1/config.h @@ -0,0 +1,6 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +# define RGBLED_NUM 24 diff --git a/keyboards/work_louder/loop/rev1/info.json b/keyboards/work_louder/loop/rev1/info.json new file mode 100644 index 0000000000..90ac25f360 --- /dev/null +++ b/keyboards/work_louder/loop/rev1/info.json @@ -0,0 +1,5 @@ +{ + "usb": { + "device_version": "0.0.1" + } +} diff --git a/keyboards/work_louder/loop/rev1/rules.mk b/keyboards/work_louder/loop/rev1/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/work_louder/loop/rev1/rules.mk diff --git a/keyboards/work_louder/loop/rev3/config.h b/keyboards/work_louder/loop/rev3/config.h new file mode 100644 index 0000000000..5451d4466e --- /dev/null +++ b/keyboards/work_louder/loop/rev3/config.h @@ -0,0 +1,6 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define RGBLED_NUM 11 diff --git a/keyboards/work_louder/loop/rev3/info.json b/keyboards/work_louder/loop/rev3/info.json new file mode 100644 index 0000000000..b377cdff00 --- /dev/null +++ b/keyboards/work_louder/loop/rev3/info.json @@ -0,0 +1,5 @@ +{ + "usb": { + "device_version": "0.0.3" + } +} diff --git a/keyboards/work_louder/loop/rev3/rules.mk b/keyboards/work_louder/loop/rev3/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/work_louder/loop/rev3/rules.mk diff --git a/keyboards/work_louder/loop/rules.mk b/keyboards/work_louder/loop/rules.mk index 6414533ce0..ac0a513785 100644 --- a/keyboards/work_louder/loop/rules.mk +++ b/keyboards/work_louder/loop/rules.mk @@ -24,3 +24,5 @@ RGB_MATRIX_DRIVER = WS2812 LTO_ENABLE = yes SRC += rgb_functions.c + +DEFAULT_FOLDER = work_louder/loop/rev3 diff --git a/keyboards/work_louder/micro/config.h b/keyboards/work_louder/micro/config.h new file mode 100644 index 0000000000..a4d5ca2c93 --- /dev/null +++ b/keyboards/work_louder/micro/config.h @@ -0,0 +1,89 @@ +// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +#define RGB_DI_PIN D1 +#define DRIVER_LED_TOTAL 12 +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 +#define RGB_MATRIX_DISABLE_KEYCODES +#define RGB_DISABLE_WHEN_USB_SUSPENDED +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS + +#define RGBLIGHT_DI_PIN D2 +#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_GRADIENT + 9 +#define RGBLIGHT_DEFAULT_HUE 213 + +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +#define ENCODERS_PAD_A \ + { D4, B0 } +#define ENCODERS_PAD_B \ + { D6, B1 } + +#define WORK_LOUDER_LED_PIN_1 B7 +#define WORK_LOUDER_LED_PIN_2 B6 +#define WORK_LOUDER_LED_PIN_3 B5 diff --git a/keyboards/work_louder/micro/info.json b/keyboards/work_louder/micro/info.json new file mode 100644 index 0000000000..3905f226f8 --- /dev/null +++ b/keyboards/work_louder/micro/info.json @@ -0,0 +1,64 @@ +{ + "keyboard_name": "Micro Pad", + "manufacturer": "Work Louder", + "bootloader": "atmel-dfu", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": false, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true, + "rgblight": true, + "rgb_matrix": true + }, + "matrix_pins": { + "custom_lite": true, + "cols": ["B4", "C6", "C7", "E6"], + "rows": ["F1", "F4", "F5", "F6"] + }, + "processor": "atmega32u4", + "rgblight": { + "animations": { + "all": true + }, + "brightness_steps": 8, + "hue_steps": 8, + "led_count": 8, + "max_brightness": 255, + "saturation_steps": 8 + }, + "url": "https://worklouder.cc/", + "usb": { + "device_version": "1.0.0", + "pid": "0xE6E3", + "vid": "0x574C" + }, + "build": { + "lto": true + }, + "layouts": { + "LAYOUT": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1.25, "y": 0.25 }, + { "matrix": [0, 2], "x": 2.25, "y": 0.25 }, + { "matrix": [0, 3], "x": 3.5, "y": 0 }, + { "matrix": [1, 0], "x": 0.25, "y": 1.25 }, + { "matrix": [1, 1], "x": 1.25, "y": 1.25 }, + { "matrix": [1, 2], "x": 2.25, "y": 1.25 }, + { "matrix": [1, 3], "x": 3.25, "y": 1.25 }, + { "matrix": [2, 0], "x": 0.25, "y": 2.25 }, + { "matrix": [2, 1], "x": 1.25, "y": 2.25 }, + { "matrix": [2, 2], "x": 2.25, "y": 2.25 }, + { "matrix": [2, 3], "x": 3.25, "y": 2.25 }, + { "matrix": [3, 0], "x": 0, "y": 3.5 }, + { "matrix": [3, 1], "x": 1.25, "y": 3.25 }, + { "matrix": [3, 2], "x": 2.25, "y": 3.25 }, + { "matrix": [3, 3], "x": 3.5, "y": 3.5 } + ] + } + } +} diff --git a/keyboards/work_louder/micro/keymaps/default/keymap.c b/keyboards/work_louder/micro/keymaps/default/keymap.c new file mode 100644 index 0000000000..6b5541e017 --- /dev/null +++ b/keyboards/work_louder/micro/keymaps/default/keymap.c @@ -0,0 +1,91 @@ +// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +enum custom_keycodes { + LED_LEVEL = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( + KC_MPLY, KC_9, KC_0, KC_NO, + KC_5, KC_6, KC_7, KC_8, + KC_1, KC_2, KC_3, KC_4, + TO(1), KC_DOT, KC_COMM, LED_LEVEL + ), + LAYOUT( + KC_1, KC_2, KC_3, KC_4, + KC_5, KC_6, KC_7, KC_8, + KC_9, KC_0, KC_A, KC_B, + TO(2), KC_C, KC_D, KC_E + ), + LAYOUT( + KC_1, KC_2, KC_3, KC_4, + KC_5, KC_6, KC_7, KC_8, + KC_9, KC_0, KC_A, KC_B, + TO(3), KC_C, KC_D, KC_E + ), + LAYOUT( + KC_1, KC_2, KC_3, KC_4, + KC_5, KC_6, KC_7, KC_8, + KC_9, KC_0, KC_A, KC_B, + TO(0), KC_C, LED_LEVEL,KC_E + ), + +}; + +typedef union { + uint32_t raw; + struct { + uint8_t led_level : 3; + }; +} work_louder_config_t; + +work_louder_config_t work_louder_config; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LED_LEVEL: + if (record->event.pressed) { + work_louder_config.led_level++; + if (work_louder_config.led_level > 4) { + work_louder_config.led_level = 0; + } + work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4)); + eeconfig_update_user(work_louder_config.raw); + layer_state_set_kb(layer_state); + } + break; + } + return true; +} + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(C(KC_Z), C(KC_Y)) }, + { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, +}; +#endif + + +layer_state_t layer_state_set_user(layer_state_t state) { + layer_state_cmp(state, 1) ? work_louder_micro_led_1_on(): work_louder_micro_led_1_off(); + layer_state_cmp(state, 2) ? work_louder_micro_led_2_on(): work_louder_micro_led_2_off(); + layer_state_cmp(state, 3) ? work_louder_micro_led_3_on(): work_louder_micro_led_3_off(); + + return state; +} + +void eeconfig_init_user(void) { + work_louder_config.raw = 0; + work_louder_config.led_level = 1; + eeconfig_update_user(work_louder_config.raw); +} + +void matrix_init_user(void) { + work_louder_config.raw = eeconfig_read_user(); + work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4)); +} diff --git a/keyboards/work_louder/micro/keymaps/default/rules.mk b/keyboards/work_louder/micro/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/work_louder/micro/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/work_louder/micro/keymaps/via/keymap.c b/keyboards/work_louder/micro/keymaps/via/keymap.c new file mode 100644 index 0000000000..da910af6b2 --- /dev/null +++ b/keyboards/work_louder/micro/keymaps/via/keymap.c @@ -0,0 +1,92 @@ +// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( + KC_MPLY, KC_9, KC_0, KC_NO, + KC_5, KC_6, KC_7, KC_8, + KC_1, KC_2, KC_3, KC_4, + TO(1), KC_DOT, KC_COMM, USER09 + ), + LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + TO(2), _______, _______, _______ + + ), + LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + TO(3), _______, _______, _______ + ), + LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + TO(0), _______, _______, _______ + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(C(KC_Z), C(KC_Y)) }, + { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) } +}; +#endif + + +typedef union { + uint32_t raw; + struct { + uint8_t led_level : 3; + }; +} work_louder_config_t; + +work_louder_config_t work_louder_config; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { +#ifdef CONSOLE_ENABLE + uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); +#endif + + switch (keycode) { + case USER09: + if (record->event.pressed) { + work_louder_config.led_level++; + if (work_louder_config.led_level > 4) { + work_louder_config.led_level = 0; + } + work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4)); + eeconfig_update_user(work_louder_config.raw); + layer_state_set_kb(layer_state); + } + break; + } + return true; +} + + +layer_state_t layer_state_set_user(layer_state_t state) { + layer_state_cmp(state, 1) ? work_louder_micro_led_1_on(): work_louder_micro_led_1_off(); + layer_state_cmp(state, 2) ? work_louder_micro_led_2_on(): work_louder_micro_led_2_off(); + layer_state_cmp(state, 3) ? work_louder_micro_led_3_on(): work_louder_micro_led_3_off(); + + return state; +} + +void eeconfig_init_user(void) { + work_louder_config.raw = 0; + work_louder_config.led_level = 1; + eeconfig_update_user(work_louder_config.raw); +} + +void matrix_init_user(void) { + work_louder_config.raw = eeconfig_read_user(); + work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4)); +} diff --git a/keyboards/work_louder/micro/keymaps/via/rules.mk b/keyboards/work_louder/micro/keymaps/via/rules.mk new file mode 100644 index 0000000000..70cf4224c0 --- /dev/null +++ b/keyboards/work_louder/micro/keymaps/via/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/work_louder/micro/matrix.c b/keyboards/work_louder/micro/matrix.c new file mode 100644 index 0000000000..d2ae16ad9c --- /dev/null +++ b/keyboards/work_louder/micro/matrix.c @@ -0,0 +1,131 @@ +// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +/* + * scan matrix + */ +#include <stdint.h> +#include <stdbool.h> +#include <avr/io.h> +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include QMK_KEYBOARD_H + +/* matrix state(1:on, 0:off) */ +extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values +extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values + +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#define MATRIX_ROW_SHIFTER ((matrix_row_t)1) + +static inline void setPinOutput_writeLow(pin_t pin) { + ATOMIC_BLOCK_FORCEON { + setPinOutput(pin); + writePinLow(pin); + } +} + +static inline void setPinOutput_writeHigh(pin_t pin) { + ATOMIC_BLOCK_FORCEON { + setPinOutput(pin); + writePinHigh(pin); + } +} + +static inline void setPinInputHigh_atomic(pin_t pin) { + ATOMIC_BLOCK_FORCEON { + setPinInputHigh(pin); + } +} + +static inline uint8_t readMatrixPin(pin_t pin) { + if (pin != NO_PIN) { + return readPin(pin); + } else { + return 1; + } +} + +static bool select_row(uint8_t row) { + pin_t pin = row_pins[row]; + if (pin != NO_PIN) { + setPinOutput_writeLow(pin); + return true; + } + return false; +} + +static void unselect_row(uint8_t row) { + pin_t pin = row_pins[row]; + if (pin != NO_PIN) { + setPinInputHigh_atomic(pin); + } +} + +static void unselect_rows(void) { + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + unselect_row(x); + } +} + +__attribute__((weak)) void matrix_init_custom(void) { + unselect_rows(); + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + if (col_pins[x] != NO_PIN) { + setPinInputHigh_atomic(col_pins[x]); + } + } + setPinInputHigh_atomic(F7); + setPinInputHigh_atomic(F0); +} + +void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Start with a clear matrix row + matrix_row_t current_row_value = 0; + + if (!select_row(current_row)) { // Select row + return; // skip NO_PIN row + } + matrix_output_select_delay(); + + // For each col... + matrix_row_t row_shifter = MATRIX_ROW_SHIFTER; + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++, row_shifter <<= 1) { + uint8_t pin_state = 0; + if (current_row == 3 && col_index == 0) { + pin_state = !readMatrixPin(F7); + } else if (current_row == 3 && col_index == 3) { + pin_state = !readMatrixPin(F0); + } else { + pin_state = readMatrixPin(col_pins[col_index]); + } + // Populate the matrix row with the state of the col pin + current_row_value |= pin_state ? 0 : row_shifter; + } + + // Unselect row + unselect_row(current_row); + matrix_output_unselect_delay(current_row, current_row_value != 0); // wait for all Col signals to go HIGH + + // Update the matrix + current_matrix[current_row] = current_row_value; +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + static matrix_row_t temp_matrix[MATRIX_ROWS] = {0}; + + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + matrix_read_cols_on_row(temp_matrix, current_row); + } + + bool changed = memcmp(current_matrix, temp_matrix, sizeof(temp_matrix)) != 0; + if (changed) { + memcpy(current_matrix, temp_matrix, sizeof(temp_matrix)); + } + return changed; +} diff --git a/keyboards/work_louder/micro/micro.c b/keyboards/work_louder/micro/micro.c new file mode 100644 index 0000000000..80d3927417 --- /dev/null +++ b/keyboards/work_louder/micro/micro.c @@ -0,0 +1,170 @@ +// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#if defined(RGB_MATRIX_ENABLE) +// clang-format off +led_config_t g_led_config = { { + { NO_LED, 10, 11, NO_LED }, + { 9 , 8, 7, 6 }, + { 2, 3, 4, 5 }, + { NO_LED, 1, 0, NO_LED } + }, { + { 122, 64 }, { 103, 64 }, + { 84, 45 }, { 103, 45 }, { 133, 45 }, { 152, 45 }, + { 152, 26 }, { 122, 26 }, { 103, 26 }, { 84, 26 }, + { 103, 7 }, { 122, 7 } + }, + { + 4, 4, + 4, 4, 4, 4, + 4, 4, 4, 4, + 4, 4 + } +}; +// clang-format on +#endif + +#if defined(ENCODER_ENABLE) +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } else if (index == 1) { + if (clockwise) { + tap_code_delay(KC_WH_U, 10); + } else { + tap_code_delay(KC_WH_D, 10); + } + } + return true; +} +#endif + +void work_louder_micro_led_1_on(void) { + writePin(WORK_LOUDER_LED_PIN_1, true); +} +void work_louder_micro_led_2_on(void) { + writePin(WORK_LOUDER_LED_PIN_2, true); +} +void work_louder_micro_led_3_on(void) { + writePin(WORK_LOUDER_LED_PIN_3, true); +} + +void work_louder_micro_led_1_off(void) { + writePin(WORK_LOUDER_LED_PIN_1, false); +} +void work_louder_micro_led_2_off(void) { + writePin(WORK_LOUDER_LED_PIN_2, false); +} +void work_louder_micro_led_3_off(void) { + writePin(WORK_LOUDER_LED_PIN_3, false); +} + +void work_louder_micro_led_all_on(void) { + work_louder_micro_led_1_on(); + work_louder_micro_led_2_on(); + work_louder_micro_led_3_on(); +} + +void work_louder_micro_led_all_off(void) { + work_louder_micro_led_1_off(); + work_louder_micro_led_2_off(); + work_louder_micro_led_3_off(); +} + +void work_louder_micro_led_1_set(uint8_t n) { +#if WORK_LOUDER_LED_PIN_1 == B7 + OCR1C = n; +#else + n ? work_louder_micro_led_1_on() : work_louder_micro_led_1_off(); +#endif +} +void work_louder_micro_led_2_set(uint8_t n) { +#if WORK_LOUDER_LED_PIN_2 == B6 + OCR1B = n; +#else + n ? work_louder_micro_led_2_on() : work_louder_micro_led_2_off(); +#endif +} +void work_louder_micro_led_3_set(uint8_t n) { +#if WORK_LOUDER_LED_PIN_3 == B5 + OCR1A = n; +#else + n ? work_louder_micro_led_3_on() : work_louder_micro_led_3_off(); +#endif +} + +void work_louder_micro_led_all_set(uint8_t n) { + work_louder_micro_led_1_set(n); + work_louder_micro_led_2_set(n); + work_louder_micro_led_3_set(n); +} + +#ifdef DEFER_EXEC_ENABLE +uint32_t startup_animation(uint32_t trigger_time, void *cb_arg) { + static uint8_t index = 0; + + switch (index) { + case 0: + work_louder_micro_led_1_on(); + break; + case 1: + work_louder_micro_led_2_on(); + break; + case 2: + work_louder_micro_led_3_on(); + break; + case 3: + work_louder_micro_led_1_off(); + break; + case 4: + work_louder_micro_led_2_off(); + break; + case 5: + work_louder_micro_led_3_off(); + break; + default: + return 0; + } + index++; + return 100; +} +#endif + +void matrix_init_kb(void) { + + setPinOutput(WORK_LOUDER_LED_PIN_1); // left led + writePin(WORK_LOUDER_LED_PIN_1, false); + setPinOutput(WORK_LOUDER_LED_PIN_2); // middle led + writePin(WORK_LOUDER_LED_PIN_2, false); + setPinOutput(WORK_LOUDER_LED_PIN_3); // right led + writePin(WORK_LOUDER_LED_PIN_3, false); + +#ifdef DEFER_EXEC_ENABLE + defer_exec(500, startup_animation, NULL); +#else + wait_ms(500); + work_louder_micro_led_1_on(); + wait_ms(100); + work_louder_micro_led_2_on(); + wait_ms(100); + work_louder_micro_led_3_on(); + wait_ms(100); + work_louder_micro_led_1_off(); + wait_ms(100); + work_louder_micro_led_2_off(); + wait_ms(100); + work_louder_micro_led_3_off(); + wait_ms(200); +#endif + matrix_init_user(); + +} diff --git a/keyboards/work_louder/micro/micro.h b/keyboards/work_louder/micro/micro.h new file mode 100644 index 0000000000..715b09eb33 --- /dev/null +++ b/keyboards/work_louder/micro/micro.h @@ -0,0 +1,22 @@ +// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" + +extern void work_louder_micro_led_1_on(void); +extern void work_louder_micro_led_2_on(void); +extern void work_louder_micro_led_3_on(void); + +extern void work_louder_micro_led_1_off(void); +extern void work_louder_micro_led_2_off(void); +extern void work_louder_micro_led_3_off(void); + +extern void work_louder_micro_led_all_on(void); + +extern void work_louder_micro_led_all_off(void); + +extern void work_louder_micro_led_1_set(uint8_t n); +extern void work_louder_micro_led_2_set(uint8_t n); +extern void work_louder_micro_led_3_set(uint8_t n); + +extern void work_louder_micro_led_all_set(uint8_t n); diff --git a/keyboards/work_louder/micro/readme.md b/keyboards/work_louder/micro/readme.md new file mode 100644 index 0000000000..568980e57b --- /dev/null +++ b/keyboards/work_louder/micro/readme.md @@ -0,0 +1,26 @@ +# work_louder/micro + +![work_louder/micro](https://i.imgur.com/4Hdt41Gh.jpg) + +A 16 "key" macro pad, with dual encoders, per key RGB, RGB underglow and more + +* Keyboard Maintainer: [Drashna Jael're](https://github.com/Drashna Jael're) +* Hardware Supported: atmega32u4 based PCB +* Hardware Availability: [Work Louder shop](https://worklouder.cc/creator-micro/) + +Make example for this keyboard (after setting up your build environment): + + make work_louder/micro:default + +Flashing example for this keyboard: + + make work_louder/micro:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 2 ways: + +* **Bootmagic reset**: Hold down the horizontal encoder (top left) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead diff --git a/keyboards/work_louder/micro/rules.mk b/keyboards/work_louder/micro/rules.mk new file mode 100644 index 0000000000..757b87cfe4 --- /dev/null +++ b/keyboards/work_louder/micro/rules.mk @@ -0,0 +1,6 @@ +RGB_MATRIX_DRIVER = WS2812 + +SRC += rgb_functions.c \ + matrix.c + +DEFERRED_EXEC_ENABLE = yes diff --git a/keyboards/work_louder/nano/config.h b/keyboards/work_louder/nano/config.h index 4e03f0a897..7a7d03b8a3 100644 --- a/keyboards/work_louder/nano/config.h +++ b/keyboards/work_louder/nano/config.h @@ -19,16 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x574C -#define PRODUCT_ID 0xE6EF -#define DEVICE_VER 0x0001 -#define MANUFACTURER Work Louder -#define PRODUCT Nano Pad - /* key matrix size */ #define MATRIX_ROWS 1 -#define MATRIX_COLS 5 +#define MATRIX_COLS 3 /* * Keyboard Matrix Assignments @@ -43,7 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MATRIX_ROW_PINS \ { F7 } #define MATRIX_COL_PINS \ - { B5, B6, C6, NO_PIN, NO_PIN } + { B5, B6, C6 } /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -202,14 +195,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { D7 } #define ENCODERS_PAD_B \ { B4 } - -#define ENCODERS 1 - -#define ENCODERS_CW_KEY \ - { \ - { 3, 0 } \ - } -#define ENCODERS_CCW_KEY \ - { \ - { 4, 0 } \ - } diff --git a/keyboards/work_louder/nano/info.json b/keyboards/work_louder/nano/info.json index a80ef21d63..46b083d0ef 100644 --- a/keyboards/work_louder/nano/info.json +++ b/keyboards/work_louder/nano/info.json @@ -1,7 +1,13 @@ { - "keyboard_name": "nano", - "url": "", + "keyboard_name": "Nano Pad", + "manufacturer": "Work Louder", + "url": "https://worklouder.cc/", "maintainer": "Work Louder", + "usb": { + "vid": "0x574C", + "pid": "0xE6F0", + "device_version": "0.0.1" + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/work_louder/nano/keymaps/via/keymap.c b/keyboards/work_louder/nano/keymaps/via/keymap.c index 07451f52b2..84c5895d5e 100644 --- a/keyboards/work_louder/nano/keymaps/via/keymap.c +++ b/keyboards/work_louder/nano/keymaps/via/keymap.c @@ -15,31 +15,28 @@ */ #include QMK_KEYBOARD_H - -#define LAYOUT_via( \ - k00, k01, k02, \ - k00_a, k00_b \ -) { \ - { k00, k01, k02, k00_a, k00_b } \ -} - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base */ - [0] = LAYOUT_via( - KC_PSCR, MACRO00, MO(1), - KC_PGDN, KC_PGUP + [0] = LAYOUT( + TG(1), C(KC_C), C(KC_V) ), - [1] = LAYOUT_via( - QK_BOOT, MACRO01, _______, - _______, _______ + [1] = LAYOUT( + TG(1) , G(KC_C), G(KC_V) ), - [2] = LAYOUT_via( - _______, _______, _______, - _______, _______ + [2] = LAYOUT( + _______, _______, _______ ), - [3] = LAYOUT_via( - _______, _______, _______, - _______, _______ + [3] = LAYOUT( + _______, _______, _______ ) }; + + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(C(KC_Z), C(KC_Y)) }, + [1] = { ENCODER_CCW_CW(G(KC_Z), G(S(KC_Z))) }, + [2] = { ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______) } +}; +#endif diff --git a/keyboards/work_louder/nano/keymaps/via/rules.mk b/keyboards/work_louder/nano/keymaps/via/rules.mk index 6098ef3ad8..1189f4ad19 100644 --- a/keyboards/work_louder/nano/keymaps/via/rules.mk +++ b/keyboards/work_louder/nano/keymaps/via/rules.mk @@ -1,4 +1,3 @@ VIA_ENABLE = yes LTO_ENABLE = yes - -SRC += encoder_actions.c +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/work_louder/nano/nano.c b/keyboards/work_louder/nano/nano.c index 62d44ef133..96b633aa79 100644 --- a/keyboards/work_louder/nano/nano.c +++ b/keyboards/work_louder/nano/nano.c @@ -16,7 +16,7 @@ #include "nano.h" -#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE) +#if defined(ENCODER_ENABLE) bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } if (clockwise) { diff --git a/keyboards/work_louder/nano/nano.h b/keyboards/work_louder/nano/nano.h index 6230d75ab7..cc152b8ccc 100644 --- a/keyboards/work_louder/nano/nano.h +++ b/keyboards/work_louder/nano/nano.h @@ -17,7 +17,6 @@ #pragma once #include "quantum.h" -#include "encoder_actions.h" #include "rgb_functions.h" /* This is a shortcut to help you visually see your layout. diff --git a/keyboards/work_louder/rgb_functions.c b/keyboards/work_louder/rgb_functions.c index c9106b3976..d0cb93ccbc 100644 --- a/keyboards/work_louder/rgb_functions.c +++ b/keyboards/work_louder/rgb_functions.c @@ -18,159 +18,15 @@ #include "rgb_functions.h" #ifdef RGBLIGHT_ENABLE -# include "ws2812.h" -# include <avr/interrupt.h> -# include <avr/io.h> -# include <util/delay.h> +#undef RGB_DI_PIN +#define RGB_DI_PIN RGBLIGHT_DI_PIN -# define pinmask(pin) (_BV((pin)&0xF)) +#define ws2812_setleds ws2812_rgb_setleds -/* - * Forward declare internal functions - * - * The functions take a byte-array and send to the data output as WS2812 bitstream. - * The length is the number of bytes to send - three per LED. - */ - -static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi); - -/* - This routine writes an array of bytes with RGB values to the Dataout pin - using the fast 800kHz clockless WS2811/2812 protocol. -*/ - -// Timing in ns -# define w_zeropulse 350 -# define w_onepulse 900 -# define w_totalperiod 1250 - -// Fixed cycles used by the inner loop -# define w_fixedlow 2 -# define w_fixedhigh 4 -# define w_fixedtotal 8 - -// Insert NOPs to match the timing, if possible -# define w_zerocycles (((F_CPU / 1000) * w_zeropulse) / 1000000) -# define w_onecycles (((F_CPU / 1000) * w_onepulse + 500000) / 1000000) -# define w_totalcycles (((F_CPU / 1000) * w_totalperiod + 500000) / 1000000) - -// w1_nops - nops between rising edge and falling edge - low -# if w_zerocycles >= w_fixedlow -# define w1_nops (w_zerocycles - w_fixedlow) -# else -# define w1_nops 0 -# endif - -// w2_nops - nops between fe low and fe high -# if w_onecycles >= (w_fixedhigh + w1_nops) -# define w2_nops (w_onecycles - w_fixedhigh - w1_nops) -# else -# define w2_nops 0 -# endif - -// w3_nops - nops to complete loop -# if w_totalcycles >= (w_fixedtotal + w1_nops + w2_nops) -# define w3_nops (w_totalcycles - w_fixedtotal - w1_nops - w2_nops) -# else -# define w3_nops 0 -# endif - -// The only critical timing parameter is the minimum pulse length of the "0" -// Warn or throw error if this timing can not be met with current F_CPU settings. -# define w_lowtime ((w1_nops + w_fixedlow) * 1000000) / (F_CPU / 1000) -# if w_lowtime > 550 -# error "Light_ws2812: Sorry, the clock speed is too low. Did you set F_CPU correctly?" -# elif w_lowtime > 450 -# warning "Light_ws2812: The timing is critical and may only work on WS2812B, not on WS2812(S)." -# warning "Please consider a higher clockspeed, if possible" -# endif - -# define w_nop1 "nop \n\t" -# define w_nop2 "rjmp .+0 \n\t" -# define w_nop4 w_nop2 w_nop2 -# define w_nop8 w_nop4 w_nop4 -# define w_nop16 w_nop8 w_nop8 - -static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi) { - uint8_t curbyte, ctr, sreg_prev; - - sreg_prev = SREG; - cli(); - - while (datlen--) { - curbyte = (*data++); - - asm volatile(" ldi %0,8 \n\t" - "loop%=: \n\t" - " out %2,%3 \n\t" // '1' [01] '0' [01] - re -# if (w1_nops & 1) - w_nop1 -# endif -# if (w1_nops & 2) - w_nop2 -# endif -# if (w1_nops & 4) - w_nop4 -# endif -# if (w1_nops & 8) - w_nop8 -# endif -# if (w1_nops & 16) - w_nop16 -# endif - " sbrs %1,7 \n\t" // '1' [03] '0' [02] - " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low - " lsl %1 \n\t" // '1' [04] '0' [04] -# if (w2_nops & 1) - w_nop1 -# endif -# if (w2_nops & 2) - w_nop2 -# endif -# if (w2_nops & 4) - w_nop4 -# endif -# if (w2_nops & 8) - w_nop8 -# endif -# if (w2_nops & 16) - w_nop16 -# endif - " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high -# if (w3_nops & 1) - w_nop1 -# endif -# if (w3_nops & 2) - w_nop2 -# endif -# if (w3_nops & 4) - w_nop4 -# endif -# if (w3_nops & 8) - w_nop8 -# endif -# if (w3_nops & 16) - w_nop16 -# endif - - " dec %0 \n\t" // '1' [+2] '0' [+2] - " brne loop%=\n\t" // '1' [+3] '0' [+4] - : "=&d"(ctr) - : "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(RGBLIGHT_DI_PIN))), "r"(maskhi), "r"(masklo)); - } - - SREG = sreg_prev; -} +#include "ws2812.c" void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { - DDRx_ADDRESS(RGBLIGHT_DI_PIN) |= pinmask(RGBLIGHT_DI_PIN); - - uint8_t masklo = ~(pinmask(RGBLIGHT_DI_PIN)) & PORTx_ADDRESS(RGBLIGHT_DI_PIN); - uint8_t maskhi = pinmask(RGBLIGHT_DI_PIN) | PORTx_ADDRESS(RGBLIGHT_DI_PIN); - - ws2812_sendarray_mask((uint8_t *)start_led, num_leds * sizeof(LED_TYPE), masklo, maskhi); - - _delay_us(WS2812_TRST_US); + ws2812_setleds(start_led, num_leds); } #endif diff --git a/keyboards/work_louder/work_board/config.h b/keyboards/work_louder/work_board/config.h index 106184b7de..b22fba4693 100644 --- a/keyboards/work_louder/work_board/config.h +++ b/keyboards/work_louder/work_board/config.h @@ -19,13 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x574C -#define PRODUCT_ID 0xDCD0 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Work Louder -#define PRODUCT Work Board - /* key matrix size */ #define MATRIX_ROWS 4 #define MATRIX_COLS 13 @@ -44,13 +37,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { F0, F1, F4, F5 } #define MATRIX_COL_PINS \ { D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, F7, F6, E6 } -#define UNUSED_PINS /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW #define RGBLIGHT_DI_PIN D2 -#define RGBLED_NUM 26 //# define RGBLIGHT_HUE_STEP 8 //# define RGBLIGHT_SAT_STEP 8 //# define RGBLIGHT_VAL_STEP 8 @@ -132,6 +123,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define ENABLE_RGB_MATRIX_SOLID_SPLASH #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR // Sets the default mode, if none has been set +#define RGB_MATRIX_STARTUP_HUE 191 // Sets the default hue value, if none has been set + /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 @@ -190,17 +185,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define ENCODERS_PAD_B \ { B1 } -#define ENCODERS 1 - -#define ENCODERS_CW_KEY \ - { \ - { 12, 1 } \ - } -#define ENCODERS_CCW_KEY \ - { \ - { 12, 2 } \ - } - /* Bootmagic Lite key configuration */ //#define BOOTMAGIC_LITE_ROW 0 //#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/work_louder/work_board/info.json b/keyboards/work_louder/work_board/info.json index 7ee3f576e7..570e5c21db 100644 --- a/keyboards/work_louder/work_board/info.json +++ b/keyboards/work_louder/work_board/info.json @@ -1,7 +1,12 @@ { - "keyboard_name": "work board", - "url": "", + "keyboard_name": "Work Board", + "manufacturer": "Work Louder", + "url": "https://worklouder.cc/", "maintainer": "Work Louder", + "usb": { + "vid": "0x574C", + "pid": "0xDCD1" + }, "layouts": { "LAYOUT_2u_space": { "layout": [ diff --git a/keyboards/work_louder/work_board/keymaps/default/keymap.c b/keyboards/work_louder/work_board/keymaps/default/keymap.c index 59bb437d9d..3489274fea 100644 --- a/keyboards/work_louder/work_board/keymaps/default/keymap.c +++ b/keyboards/work_louder/work_board/keymaps/default/keymap.c @@ -18,19 +18,11 @@ enum planck_layers { _QWERTY, - _COLEMAK, - _DVORAK, _LOWER, _RAISE, _ADJUST }; -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, -}; - enum tap_dances { ENC_TAP, }; @@ -39,117 +31,33 @@ enum tap_dances { #define RAISE MO(_RAISE) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, TD(ENC_TAP), - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT( - KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, _______, - KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Esc | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT( - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, _______, - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , - KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - - -/* Adjust (Lower + Raise) - * v------------------------RGB CONTROL--------------------v - * ,-----------------------------------------------------------------------------------. - * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TermOn|TermOf| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT( - _______, QK_BOOT, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , _______, - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) - + [_QWERTY] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, TD(ENC_TAP), + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, + MO(3), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + [_ADJUST] = LAYOUT( + _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , R_M_TOG, + _______, _______, MU_MOD, R_M_TOG, R_M_MOD, R_M_HUI, R_M_HUD, R_M_SAI, R_M_SAD, R_M_VAI, R_M_VAD, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) }; @@ -181,27 +89,3 @@ qk_tap_dance_action_t tap_dance_actions[] = { layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - } - return true; -} diff --git a/keyboards/work_louder/work_board/keymaps/via/keymap.c b/keyboards/work_louder/work_board/keymaps/via/keymap.c index fff7248afa..d39c5f405d 100644 --- a/keyboards/work_louder/work_board/keymaps/via/keymap.c +++ b/keyboards/work_louder/work_board/keymaps/via/keymap.c @@ -30,50 +30,34 @@ enum tap_dances { #define LOWER FN_MO13 #define RAISE FN_MO23 -#define LAYOUT_via( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k0c_a, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k0c_b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k0c_a }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k0c_b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, ___ } \ -} - // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_via( + [_QWERTY] = LAYOUT( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, USER09, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_VOLU, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , KC_VOLD, - KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + MO(3), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - - [_LOWER] = LAYOUT_via( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_PGDN, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, KC_PGUP, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, + _______, _______, _______, MACRO_1, _______, MACRO_0, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - - [_RAISE] = LAYOUT_via( + [_RAISE] = LAYOUT( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_DOWN, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, KC_UP, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - - [_ADJUST] = LAYOUT_via( - _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , R_M_TOG, - _______, _______, MU_MOD, R_M_TOG, R_M_MOD, R_M_HUI, R_M_HUD, R_M_SAI, R_M_SAD, R_M_VAI, R_M_VAD, _______, R_M_HUI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, R_M_HUD, + [_ADJUST] = LAYOUT( + _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, R_M_TOG, + _______, _______, MU_MOD, R_M_TOG, R_M_MOD, _______, _______, _______, _______, R_M_SAI, R_M_HUI, R_M_MOD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, R_M_SAD, R_M_HUD, R_M_RMOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; -// clang-format on + void dance_enc_finished(qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { @@ -127,3 +111,12 @@ layer_state_t layer_state_set_user(layer_state_t state) { return state; } + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_QWERTY] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_LOWER] = { ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, + [_RAISE] = { ENCODER_CCW_CW(R_M_RMOD, R_M_MOD) }, + [_ADJUST] = { ENCODER_CCW_CW(R_M_HUI, R_M_HUD) }, +}; +#endif diff --git a/keyboards/work_louder/work_board/keymaps/via/rules.mk b/keyboards/work_louder/work_board/keymaps/via/rules.mk index 7964f4279c..bdad0201e1 100644 --- a/keyboards/work_louder/work_board/keymaps/via/rules.mk +++ b/keyboards/work_louder/work_board/keymaps/via/rules.mk @@ -1,4 +1,3 @@ VIA_ENABLE = yes TAP_DANCE_ENABLE = yes - -SRC += encoder_actions.c +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/work_louder/work_board/rev1/config.h b/keyboards/work_louder/work_board/rev1/config.h new file mode 100644 index 0000000000..b7d85d490d --- /dev/null +++ b/keyboards/work_louder/work_board/rev1/config.h @@ -0,0 +1,6 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +# define RGBLED_NUM 26 diff --git a/keyboards/work_louder/work_board/rev1/info.json b/keyboards/work_louder/work_board/rev1/info.json new file mode 100644 index 0000000000..90ac25f360 --- /dev/null +++ b/keyboards/work_louder/work_board/rev1/info.json @@ -0,0 +1,5 @@ +{ + "usb": { + "device_version": "0.0.1" + } +} diff --git a/keyboards/work_louder/work_board/rev1/rules.mk b/keyboards/work_louder/work_board/rev1/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/work_louder/work_board/rev1/rules.mk diff --git a/keyboards/work_louder/work_board/rev3/config.h b/keyboards/work_louder/work_board/rev3/config.h new file mode 100644 index 0000000000..8e3cd8bce8 --- /dev/null +++ b/keyboards/work_louder/work_board/rev3/config.h @@ -0,0 +1,6 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define RGBLED_NUM 19 diff --git a/keyboards/work_louder/work_board/rev3/info.json b/keyboards/work_louder/work_board/rev3/info.json new file mode 100644 index 0000000000..b377cdff00 --- /dev/null +++ b/keyboards/work_louder/work_board/rev3/info.json @@ -0,0 +1,5 @@ +{ + "usb": { + "device_version": "0.0.3" + } +} diff --git a/keyboards/work_louder/work_board/rev3/rules.mk b/keyboards/work_louder/work_board/rev3/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/work_louder/work_board/rev3/rules.mk diff --git a/keyboards/work_louder/work_board/rules.mk b/keyboards/work_louder/work_board/rules.mk index ddbd9618d0..b89d0adf1e 100644 --- a/keyboards/work_louder/work_board/rules.mk +++ b/keyboards/work_louder/work_board/rules.mk @@ -23,3 +23,5 @@ RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 SRC += rgb_functions.c + +DEFAULT_FOLDER = work_louder/work_board/rev3 diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c index d25ea0cdba..bd969f3009 100644 --- a/keyboards/work_louder/work_board/work_board.c +++ b/keyboards/work_louder/work_board/work_board.c @@ -16,7 +16,7 @@ #include "work_board.h" -#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE) +#if defined(ENCODER_ENABLE) bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; diff --git a/keyboards/work_louder/work_board/work_board.h b/keyboards/work_louder/work_board/work_board.h index f1bc74b704..284eecc430 100644 --- a/keyboards/work_louder/work_board/work_board.h +++ b/keyboards/work_louder/work_board/work_board.h @@ -17,7 +17,6 @@ #pragma once #include "quantum.h" -#include "encoder_actions.h" #include "rgb_functions.h" #define ___ KC_NO |