diff options
Diffstat (limited to 'keyboards/planck/ez')
-rw-r--r-- | keyboards/planck/ez/chconf.h | 29 | ||||
-rw-r--r-- | keyboards/planck/ez/config.h | 11 | ||||
-rw-r--r-- | keyboards/planck/ez/ez.c | 119 | ||||
-rw-r--r-- | keyboards/planck/ez/ez.h | 22 | ||||
-rw-r--r-- | keyboards/planck/ez/glow/keymaps/glow/config.h | 7 | ||||
-rw-r--r-- | keyboards/planck/ez/glow/keymaps/glow/keymap.c | 348 | ||||
-rw-r--r-- | keyboards/planck/ez/glow/keymaps/glow/readme.md | 2 | ||||
-rw-r--r-- | keyboards/planck/ez/glow/keymaps/glow/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/planck/ez/post_config.h | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | keyboards/planck/ez/rules.mk | 7 |
10 files changed, 491 insertions, 65 deletions
diff --git a/keyboards/planck/ez/chconf.h b/keyboards/planck/ez/chconf.h new file mode 100644 index 0000000000..e1243f23ec --- /dev/null +++ b/keyboards/planck/ez/chconf.h @@ -0,0 +1,29 @@ +/* Copyright 2020 QMK + * + * 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 2 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/>. + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/planck/rev6/chconf.h -r platforms/chibios/QMK_PROTON_C/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 + +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next <chconf.h> + diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h index c9ed9e59ba..4b47e2fe2f 100644 --- a/keyboards/planck/ez/config.h +++ b/keyboards/planck/ez/config.h @@ -50,6 +50,7 @@ #define AUDIO_PIN A5 #define AUDIO_PIN_ALT A4 #define AUDIO_PIN_ALT_AS_NEGATIVE +#define AUDIO_INIT_DELAY /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ // #define DEBOUNCE 6 @@ -96,16 +97,6 @@ //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -// #define WS2812_LED_N 2 -// #define RGBLED_NUM WS2812_LED_N -// #define WS2812_TIM_N 2 -// #define WS2812_TIM_CH 2 -// #define PORT_WS2812 GPIOA -// #define PIN_WS2812 1 -// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) -//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP -//#define WS2812_EXTERNAL_PULLUP - #define DRIVER_ADDR_1 0b1010000 #define DRIVER_COUNT 1 diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index 25dfe9adfb..93a17be293 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -106,6 +106,10 @@ led_config_t g_led_config = { { 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1 } }; +void keyboard_post_init_kb(void) { + rgb_matrix_enable_noeeprom(); + keyboard_post_init_user(); +} #endif /* Left B9 Right B8 */ @@ -204,60 +208,30 @@ void keyboard_pre_init_kb(void) { } // read kb settings from eeprom keyboard_config.raw = eeconfig_read_kb(); -#if defined(RGB_MATRIX_ENABLE) && defined(ORYX_CONFIGURATOR) - if (keyboard_config.rgb_matrix_enable) { - rgb_matrix_set_flags(LED_FLAG_ALL); - } else { - rgb_matrix_set_flags(LED_FLAG_NONE); - } -#endif led_initialize_hardware(); keyboard_pre_init_user(); } -#if defined(RGB_MATRIX_ENABLE) && defined(ORYX_CONFIGURATOR) -void keyboard_post_init_kb(void) { - rgb_matrix_enable_noeeprom(); - keyboard_post_init_user(); -} -#endif - void eeconfig_init_kb(void) { // EEPROM is getting reset! keyboard_config.raw = 0; - keyboard_config.rgb_matrix_enable = true; keyboard_config.led_level = 4; eeconfig_update_kb(keyboard_config.raw); eeconfig_init_user(); } - -#ifdef ORYX_CONFIGURATOR - -#ifndef PLANCK_EZ_USER_LEDS - -#ifndef PLANCK_EZ_LED_LOWER -# define PLANCK_EZ_LED_LOWER 3 -#endif -#ifndef PLANCK_EZ_LED_RAISE -# define PLANCK_EZ_LED_RAISE 4 -#endif -#ifndef PLANCK_EZ_LED_ADJUST -# define PLANCK_EZ_LED_ADJUST 6 -#endif - layer_state_t layer_state_set_kb(layer_state_t state) { planck_ez_left_led_off(); planck_ez_right_led_off(); state = layer_state_set_user(state); uint8_t layer = get_highest_layer(state); switch (layer) { - case PLANCK_EZ_LED_LOWER: + case 1: planck_ez_left_led_on(); break; - case PLANCK_EZ_LED_RAISE: + case 2: planck_ez_right_led_on(); break; - case PLANCK_EZ_LED_ADJUST: + case 3: planck_ez_right_led_on(); planck_ez_left_led_on(); break; @@ -266,7 +240,6 @@ layer_state_t layer_state_set_kb(layer_state_t state) { } return state; } -#endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -296,24 +269,21 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { switch (rgb_matrix_get_flags()) { case LED_FLAG_ALL: { rgb_matrix_set_flags(LED_FLAG_NONE); - keyboard_config.rgb_matrix_enable = false; rgb_matrix_set_color_all(0, 0, 0); } break; default: { rgb_matrix_set_flags(LED_FLAG_ALL); - keyboard_config.rgb_matrix_enable = true; } break; } - eeconfig_update_kb(keyboard_config.raw); } return false; #endif } return process_record_user(keycode, record); } -#endif + #ifdef AUDIO_ENABLE bool music_mask_kb(uint16_t keycode) { @@ -331,6 +301,77 @@ bool music_mask_kb(uint16_t keycode) { } #endif +#ifdef ORYX_ENABLE +static uint16_t loops = 0; +static bool is_on = false; +#endif + +#ifdef DYNAMIC_MACRO_ENABLE +static bool is_dynamic_recording = false; +static uint16_t dynamic_loop_timer; + +void dynamic_macro_record_start_user(void) { + is_dynamic_recording = true; + dynamic_loop_timer = timer_read(); + planck_ez_left_led_on(); +} + +void dynamic_macro_record_end_user(int8_t direction) { + is_dynamic_recording = false; + layer_state_set_kb(layer_state); +} +#endif + +void matrix_scan_kb(void) { +#ifdef ORYX_ENABLE + if(rawhid_state.pairing == true) { + if(loops == 0) { + //lights off + } + if(loops % PAIRING_BLINK_STEPS == 0) { + if(is_on) { + planck_ez_left_led_on(); + planck_ez_right_led_off(); + } + else { + planck_ez_left_led_off(); + planck_ez_right_led_on(); + } + is_on ^= 1; + } + if(loops > PAIRING_BLINK_END * 2) { + rawhid_state.pairing = false; + loops = 0; + planck_ez_left_led_off(); + planck_ez_right_led_off(); + } + loops++; + } + else if(loops > 0) { + loops = 0; + planck_ez_left_led_off(); + planck_ez_right_led_off(); + } +#endif +#ifdef DYNAMIC_MACRO_ENABLE + if (is_dynamic_recording) { + if (timer_elapsed(dynamic_loop_timer) > 1) + { + static uint8_t counter; + counter++; + if (counter > 100) { + planck_ez_left_led_on(); + } else { + planck_ez_left_led_off(); + + } + dynamic_loop_timer = timer_read(); + } + } +#endif + matrix_scan_user(); +} + #ifdef SWAP_HANDS_ENABLE __attribute__ ((weak)) const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { @@ -338,7 +379,7 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, - + {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, diff --git a/keyboards/planck/ez/ez.h b/keyboards/planck/ez/ez.h index 19cc26eea3..7243477cbf 100644 --- a/keyboards/planck/ez/ez.h +++ b/keyboards/planck/ez/ez.h @@ -47,14 +47,14 @@ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ ) \ { \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k3a, k3b, k36 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k37, k38, k39, k33, k34, k35 } \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k3a, k3b, KC_NO }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k37, k38, k39, k33, k34, k35 } \ } #define LAYOUT_planck_mit LAYOUT_planck_1x2uC @@ -73,16 +73,12 @@ enum planck_ez_keycodes { EZ_SAFE_RANGE, }; -#ifndef WEBUSB_ENABLE -# define WEBUSB_PAIR KC_NO -#endif - typedef union { uint32_t raw; struct { uint8_t led_level :3; bool disable_layer_led :1; - bool rgb_matrix_enable :1; + bool placeholder :1; }; } keyboard_config_t; diff --git a/keyboards/planck/ez/glow/keymaps/glow/config.h b/keyboards/planck/ez/glow/keymaps/glow/config.h new file mode 100644 index 0000000000..501d118632 --- /dev/null +++ b/keyboards/planck/ez/glow/keymaps/glow/config.h @@ -0,0 +1,7 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(DVORAK_SOUND) +#endif + +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 5 diff --git a/keyboards/planck/ez/glow/keymaps/glow/keymap.c b/keyboards/planck/ez/glow/keymaps/glow/keymap.c new file mode 100644 index 0000000000..fb150a8901 --- /dev/null +++ b/keyboards/planck/ez/glow/keymaps/glow/keymap.c @@ -0,0 +1,348 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 2 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 QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | 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_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | 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_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | 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_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, 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 , + BACKLIT, 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_planck_grid( + 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_planck_grid( + 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 +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, 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, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +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) { + print("mode just switched to qwerty and this is a huge string\n"); + 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; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/ez/glow/keymaps/glow/readme.md b/keyboards/planck/ez/glow/keymaps/glow/readme.md new file mode 100644 index 0000000000..de9680b498 --- /dev/null +++ b/keyboards/planck/ez/glow/keymaps/glow/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/ez/glow/keymaps/glow/rules.mk b/keyboards/planck/ez/glow/keymaps/glow/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/ez/glow/keymaps/glow/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/ez/post_config.h b/keyboards/planck/ez/post_config.h new file mode 100644 index 0000000000..52d84d8218 --- /dev/null +++ b/keyboards/planck/ez/post_config.h @@ -0,0 +1,10 @@ +#ifdef AUDIO_ENABLE +#ifndef STARTUP_SONG +# define STARTUP_SONG SONG(E__NOTE(_DS5), E__NOTE(_D5), E__NOTE(_AS4), Q__NOTE(_F5)) +#endif + +#ifndef GOODBYE_SONG +# define GOODBYE_SONG SONG(E__NOTE(_D5), E__NOTE(_F5), E__NOTE(_C5), Q__NOTE(_AS4)) +#endif +#endif + diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk index 47f140585b..d493550fa8 100644..100755 --- a/keyboards/planck/ez/rules.mk +++ b/keyboards/planck/ez/rules.mk @@ -10,8 +10,8 @@ BOOTLOADER = stm32-dfu BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite 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 +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configurationv NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = yes # Audio output @@ -21,7 +21,8 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. ENCODER_ENABLE = yes RGB_MATRIX_DRIVER = IS31FL3737 -LAYOUTS = ortho_4x12 planck_mit +MOUSE_SHARED_EP = no + LAYOUTS_HAS_RGB = no RGB_MATRIX_SUPPORTED = yes |