diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
commit | 98b9909429aea0869f7a6f2f44ab386a4a3ff094 (patch) | |
tree | e1080a61bb89a75edc70818489f8044adf597c48 /keyboards/moonlander | |
parent | b610965fd6d851484025166fb255078b1c809261 (diff) | |
parent | fa3dd373b4925734d9843ae6014349069ffec353 (diff) | |
download | qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.tar.gz qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.zip |
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/moonlander')
-rw-r--r-- | keyboards/moonlander/config.h | 63 | ||||
-rw-r--r-- | keyboards/moonlander/keymaps/default/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/moonlander/keymaps/drashna/config.h | 7 | ||||
-rw-r--r-- | keyboards/moonlander/keymaps/drashna/keymap.c | 84 | ||||
-rw-r--r-- | keyboards/moonlander/keymaps/drashna/rules.mk | 10 | ||||
-rw-r--r-- | keyboards/moonlander/keymaps/via/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/moonlander/matrix.c | 4 | ||||
-rw-r--r-- | keyboards/moonlander/moonlander.c | 119 | ||||
-rw-r--r-- | keyboards/moonlander/readme.md | 2 | ||||
-rw-r--r-- | keyboards/moonlander/rules.mk | 8 |
10 files changed, 157 insertions, 144 deletions
diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h index f2e5088a34..9930e64063 100644 --- a/keyboards/moonlander/config.h +++ b/keyboards/moonlander/config.h @@ -77,8 +77,6 @@ //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION #define DRIVER_ADDR_1 0b1110100 #define DRIVER_ADDR_2 0b1110111 @@ -92,6 +90,66 @@ #define RGB_MATRIX_FRAMEBUFFER_EFFECTS #define RGB_MATRIX_KEYPRESSES #define RGB_DISABLE_WHEN_USB_SUSPENDED +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +# 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 + +// #define RGB_MATRIX_LED_PROCESS_LIMIT 5 +// #define RGB_MATRIX_LED_FLUSH_LIMIT 26 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 400 +#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL +#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED +#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX #define MUSIC_MAP @@ -101,7 +159,6 @@ # define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 16383 # define DYNAMIC_KEYMAP_LAYER_COUNT 8 #endif -#define VIA_QMK_RGBLIGHT_ENABLE #define AUDIO_PIN A5 #define AUDIO_PIN_ALT A4 diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c index 0cb7fa5d27..c0c2820307 100644 --- a/keyboards/moonlander/keymaps/default/keymap.c +++ b/keyboards/moonlander/keymaps/default/keymap.c @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [MDIA] = LAYOUT_moonlander( - LED_LEVEL,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + LED_LEVEL,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______, diff --git a/keyboards/moonlander/keymaps/drashna/config.h b/keyboards/moonlander/keymaps/drashna/config.h index e022722fec..153007eb09 100644 --- a/keyboards/moonlander/keymaps/drashna/config.h +++ b/keyboards/moonlander/keymaps/drashna/config.h @@ -18,5 +18,10 @@ #pragma once #define TAPPING_TERM_PER_KEY -#define WAIT_FOR_USB +// #define WAIT_FOR_USB // #define NO_USB_STARTUP_CHECK + +#define SECURE_UNLOCK_SEQUENCE \ + { \ + { 2, 1 }, { 2, 2 }, { 2, 3 }, { 2, 4 } \ + } diff --git a/keyboards/moonlander/keymaps/drashna/keymap.c b/keyboards/moonlander/keymaps/drashna/keymap.c index 257959c07f..ced94786ef 100644 --- a/keyboards/moonlander/keymaps/drashna/keymap.c +++ b/keyboards/moonlander/keymaps/drashna/keymap.c @@ -16,10 +16,6 @@ #include "drashna.h" -#ifndef UNICODE_ENABLE -# define UC(x) KC_NO -#endif - enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; // clang-format off @@ -32,10 +28,10 @@ enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; ) \ LAYOUT_moonlander_wrapper( \ KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ - KC_TAB, K01, K02, K03, K04, K05, TG_DBLO,TG_DBLO, K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, K11, K12, K13, K14, K15, TG_GAME,TG_GAME, K16, K17, K18, K19, K1A, RALT_T(K1B), \ + KC_TAB, K01, K02, K03, K04, K05, TG_DBLO, TG_DBLO, K06, K07, K08, K09, K0A, KC_BSLS, \ + KC_C1R3, K11, K12, K13, K14, K15, TG_GAME, TG_GAME, K16, K17, K18, K19, K1A, RALT_T(K1B), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A),KC_MRSF, \ - KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_NO, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ + KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, UC_CLUE, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_IRNY, \ KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT \ ) @@ -67,21 +63,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_GAMEPAD] = LAYOUT_moonlander_wrapper( - KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, HYPR(KC_Q), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_TRNS, TG_GAME, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, + KC_ESC, XXXXXXX, KC_1, KC_2, KC_3, KC_4, HYPR(KC_Q), _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_NO, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, TG_GAME, KC_I, KC_O, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_PSCR, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, - KC_V, KC_SPC, KC_H, KC_NO, KC_NO, KC_SWAP_NUM + KC_V, KC_SPC, KC_H, KC_NO, XXXXXXX,KC_SWAP_NUM ), [_DIABLO] = LAYOUT_moonlander_wrapper( - KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_G, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_L, KC_J, KC_F, KC_PSCR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_ESC, KC_V, KC_D, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_NO, + KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_G, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + XXXXXXX, XXXXXXX, KC_L, KC_J, KC_F, KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, KC_DIABLO_CLEAR, SFT_T(KC_SPACE), ALT_T(KC_Q), KC_PGDN, KC_DEL, KC_ENT ), + [_DIABLOII] = LAYOUT_moonlander_wrapper( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_GRV, XXXXXXX, _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_NO, + KC_TAB, KC_A, KC_T, KC_Q, KC_I, KC_M, TG(_DIABLOII), _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + KC_S, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + KC_LCTL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + XXXXXXX, XXXXXXX, KC_G, KC_F, KC_L, KC_V, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NO, + KC_G, KC_LSFT, KC_LCTL, KC_PGDN, KC_DEL, KC_ENT + ), [_LOWER] = LAYOUT_moonlander_wrapper( KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, @@ -102,12 +106,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJUST] = LAYOUT_moonlander_wrapper( - KC_MAKE, _________________FUNC_LEFT_________________, UC_MOD, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, EEP_RST, - _______, _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, RGB_IDL, - KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, - _______, _______, _______, _______, _______, _______ + QK_MAKE, KC_WIDE,KC_AUSSIE,KC_SCRIPT,KC_ZALGO,KC_NOMODE,_______, KC_NUKE,KC_NOMODE,KC_BLOCKS,KC_REGIONAL,_______,_______, QK_BOOT, + VRSN, _________________ADJUST_L1_________________, TG(_DIABLOII), _______, _________________ADJUST_R1_________________, EE_CLR, + KEYLOCK, _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, RGB_IDL, + UC_MOD, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, AUTO_CTN, + QK_RBT, _______, _______, _______, _______, _______ ), }; @@ -160,7 +164,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } #ifdef RGB_MATRIX_ENABLE -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { if (layer_state_is(_GAMEPAD)) { RGB_MATRIX_INDICATOR_SET_COLOR(11, 0x00, 0xFF, 0x00); // Q RGB_MATRIX_INDICATOR_SET_COLOR(16, 0x00, 0xFF, 0xFF); // W @@ -176,37 +180,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { RGB_MATRIX_INDICATOR_SET_COLOR(20, 0x7A, 0x00, 0xFF); // 3 } - if (userspace_config.rgb_layer_change) { - switch (get_highest_layer(layer_state|default_layer_state)) { - case _DEFAULT_LAYER_1: - rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_2: - rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_3: - rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_4: - rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _GAMEPAD: - rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DIABLO: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _RAISE: - rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - } - } + return true; } #endif diff --git a/keyboards/moonlander/keymaps/drashna/rules.mk b/keyboards/moonlander/keymaps/drashna/rules.mk index 0af16d6e17..feb91c774b 100644 --- a/keyboards/moonlander/keymaps/drashna/rules.mk +++ b/keyboards/moonlander/keymaps/drashna/rules.mk @@ -1,4 +1,6 @@ -TAP_DANCE_ENABLE = yes -BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite -UNICODE_ENABLE = yes -UNICODEMAP_ENABLE = no +TAP_DANCE_ENABLE = yes +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +UNICODE_ENABLE = yes +UNICODEMAP_ENABLE = no +AUTOCORRECTION_ENABLE = yes +CAPS_WORD_ENABLE = yes diff --git a/keyboards/moonlander/keymaps/via/keymap.c b/keyboards/moonlander/keymaps/via/keymap.c index 13a299b434..ab36b4fc33 100644 --- a/keyboards/moonlander/keymaps/via/keymap.c +++ b/keyboards/moonlander/keymaps/via/keymap.c @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [MDIA] = LAYOUT_moonlander( - USER01, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + USER01, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______, diff --git a/keyboards/moonlander/matrix.c b/keyboards/moonlander/matrix.c index 782f131a50..b6bac9515e 100644 --- a/keyboards/moonlander/matrix.c +++ b/keyboards/moonlander/matrix.c @@ -102,9 +102,9 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { print("trying to reset mcp23018\n"); mcp23018_init(); if (!mcp23018_initd) { - print("left side not responding\n"); + print("right side not responding\n"); } else { - print("left side attached\n"); + print("right side attached\n"); #ifdef RGB_MATRIX_ENABLE rgb_matrix_init(); #endif diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c index 8688b9efa4..e2e163f116 100644 --- a/keyboards/moonlander/moonlander.c +++ b/keyboards/moonlander/moonlander.c @@ -19,9 +19,6 @@ #include "moonlander.h" -#ifdef WEBUSB_ENABLE -# include "webusb.h" -#endif keyboard_config_t keyboard_config; @@ -83,50 +80,9 @@ void moonlander_led_task(void) { wait_ms(155); } #endif -#ifdef WEBUSB_ENABLE - else if (webusb_state.pairing == true) { - static uint8_t led_mask; - - ML_LED_1(false); - ML_LED_2(false); - ML_LED_3(false); - ML_LED_4(false); - ML_LED_5(false); - ML_LED_6(false); - - if (!led_mask) { - led_mask = 1; - } else { - led_mask++; - if (led_mask > 12) led_mask = 1; - } - switch (led_mask) { - case 1: - case 12: - ML_LED_1(true); - break; - case 2: - case 11: - ML_LED_2(true); - break; - case 3: - case 10: - ML_LED_3(true); - break; - case 4: - case 9: - ML_LED_4(true); - break; - case 5: - case 8: - ML_LED_5(true); - break; - case 6: - case 7: - ML_LED_6(true); - break; - } - wait_ms(150); +#if !defined(MOONLANDER_USER_LEDS) + else { + layer_state_set_kb(layer_state); } #endif } @@ -163,47 +119,62 @@ void keyboard_pre_init_kb(void) { layer_state_t layer_state_set_kb(layer_state_t state) { state = layer_state_set_user(state); if (is_launching || !keyboard_config.led_level) return state; - - ML_LED_1(false); - ML_LED_2(false); - ML_LED_3(false); - ML_LED_4(false); - ML_LED_5(false); - ML_LED_6(false); + bool LED_1 = false; + bool LED_2 = false; + bool LED_3 = false; + bool LED_4 = false; + bool LED_5 = false; +#if !defined(CAPS_LOCK_STATUS) + bool LED_6 = false; +#endif uint8_t layer = get_highest_layer(state); switch (layer) { case 1: - ML_LED_1(1); - ML_LED_4(1); + LED_1 = true; + LED_4 = true; break; case 2: - ML_LED_2(1); - ML_LED_5(1); + LED_2 = true; + LED_5 = true; break; case 3: - ML_LED_3(1); + LED_3 = true; +#if !defined(CAPS_LOCK_STATUS) + LED_6 = true; +#endif break; case 4: - ML_LED_4(1); + LED_4 = true; break; case 5: - ML_LED_5(1); + LED_5 = true; break; case 6: - ML_LED_6(1); +#if !defined(CAPS_LOCK_STATUS) + LED_6 = true; +#endif break; default: break; } + ML_LED_1(LED_1); + ML_LED_2(LED_2); + ML_LED_3(LED_3); + ML_LED_4(LED_4); + ML_LED_5(LED_5); +#if !defined(CAPS_LOCK_STATUS) + ML_LED_6(LED_6); +#endif + return state; } #endif #ifdef RGB_MATRIX_ENABLE // clang-format off -const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations * driver * | R location @@ -398,14 +369,19 @@ const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_moonlander( // clang-format on #endif -#ifdef ORYX_CONFIGURATOR +#ifdef CAPS_LOCK_STATUS +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + ML_LED_6(led_state.caps_lock); + } + return res; +} +#endif + bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { return false; } switch (keycode) { -#ifdef WEBUSB_ENABLE - case WEBUSB_PAIR: - if (!record->event.pressed && !webusb_state.pairing) layer_state_set_kb(layer_state); - break; -#endif #if !defined(MOONLANDER_USER_LEDS) case LED_LEVEL: if (record->event.pressed) { @@ -450,11 +426,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return false; #endif } - return process_record_user(keycode, record); + return true; } -#endif - void matrix_init_kb(void) { keyboard_config.raw = eeconfig_read_kb(); @@ -470,6 +444,7 @@ void matrix_init_kb(void) { rgb_matrix_set_flags(LED_FLAG_NONE); } #endif + matrix_init_user(); } void eeconfig_init_kb(void) { // EEPROM is getting reset! diff --git a/keyboards/moonlander/readme.md b/keyboards/moonlander/readme.md index 0ad2e4775c..bf80f05569 100644 --- a/keyboards/moonlander/readme.md +++ b/keyboards/moonlander/readme.md @@ -31,7 +31,7 @@ By default, the Indicator LEDs are used to indicate the layer state for the keyb ### Oryx Configuration -To enable the features from Oryx (ZSA's Configurator), either compile the the `default` keymap, or add `#define ORYX_CONFIGURATOR` to your `config.h` file. +To enable the features from Oryx (ZSA's Configurator), either compile the `default` keymap, or add `#define ORYX_CONFIGURATOR` to your `config.h` file. This enables the front Indicator LEDs, and the `TOGGLE_LAYER_COLOR` keycode. The `TOGGLE_LAYER_COLOR` keycode toggles the customized LED map configured on Oryx. diff --git a/keyboards/moonlander/rules.mk b/keyboards/moonlander/rules.mk index ed448ff434..72682d29b1 100644 --- a/keyboards/moonlander/rules.mk +++ b/keyboards/moonlander/rules.mk @@ -12,13 +12,11 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = yes # Audio output +AUDIO_DRIVER = dac_additive CUSTOM_MATRIX = lite SWAP_HANDS_ENABLE = yes RGB_MATRIX_ENABLE = yes @@ -28,3 +26,5 @@ EEPROM_DRIVER = i2c #project specific files SRC += matrix.c QUANTUM_LIB_SRC += i2c_master.c + +MOUSE_SHARED_EP = no |