From b5172e3afab515b1f93cd09c51b4c6c1b5174dc7 Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 20 Aug 2016 18:19:03 +0200 Subject: Rename file following upstream folder rename. --- keyboards/ergodox/keymaps/bepo/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 keyboards/ergodox/keymaps/bepo/Makefile (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/bepo/Makefile b/keyboards/ergodox/keymaps/bepo/Makefile new file mode 100644 index 000000000..b673c5ce5 --- /dev/null +++ b/keyboards/ergodox/keymaps/bepo/Makefile @@ -0,0 +1,9 @@ +# Having a file like this allows you to override Makefile definitions +# for your own particular keymap + +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +COMMAND_ENABLE = no # Commands for debug and configuration + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3 From 67dfde765f5bc192aad8a7a7586b10a661ae52d1 Mon Sep 17 00:00:00 2001 From: Didier Chagniot Date: Fri, 9 Sep 2016 21:42:35 +0200 Subject: typing with it --- keyboards/ergodox/keymaps/dvorak_emacs/keymap.c | 165 ++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100755 keyboards/ergodox/keymaps/dvorak_emacs/keymap.c (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c b/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c new file mode 100755 index 000000000..4cb11a56f --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c @@ -0,0 +1,165 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" + +/****************************************************************************************** + * DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/) + * Layer 1: auxiliary keys + * Layer 2: full qwerty layout + *****************************************************************************************/ + +// LAYERS +#define BASE 0 // dvorak layout (default) +#define AUX 1 // auxiliary keys + +// MACROS +/* #define OBRACE 0 // key { or shift */ +/* #define CBRACE 1 // key } or shift */ +/* #define OBRACK 2 // key [ or left alt */ +/* #define CBRACK 3 // key ] or left alt */ +/* #define CAPS 4 // caps lock */ + +// LEDS +#define USB_LED_NUM_LOCK 0 +#define USB_LED_CAPS_LOCK 1 +#define USB_LED_SCROLL_LOCK 2 +#define USB_LED_COMPOSE 3 +#define USB_LED_KANA 4 + +// TIMERS +#define KEY_TAP_FAST 85 +#define KEY_TAP_SLOW 95 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Base layer + * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = / + | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ~ |" / ' |, / < |. / > | P | Y | [ | | ] | F | G | C | H | L | / / ? | + * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| + * | Tab | A | O | E |U/LSft| I/L1 |------| |------| D/L1|R/RSft| T | N | S | - / _ | + * |--------+------+------+------+------+------| LGUI | | LGUI |------+------+------+------+------+--------| + * | {/LSft |; / : | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | ~L1 | | ~L1 | | | \ / || | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | HOME | END | | LEFT | RIGHT| + * ,------|------|------| |------+--------+------. + * | BSPC | DEL | PGUP | | UP | SPACE |RETURN| + * | / | / |------| |------| / | / | + * | LCTL | LALT |PGDWN | | DOWN | LALT | LCTL | + * `--------------------' `----------------------' + * + */ +[BASE] = KEYMAP( + // left hand + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TILD, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, KC_LBRACKET, + KC_TAB, KC_A, KC_O, KC_E, SFT_T(KC_U), LT(AUX, KC_I), + SFT_T(KC_LBRC), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LGUI, + KC_NO, KC_NO, KC_NO, KC_NO, MO(AUX), + KC_HOME, KC_END, + KC_PGUP, + CTL_T(KC_BSPC), ALT_T(KC_DEL), KC_PGDN, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_RBRACKET, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, + LT(AUX, KC_D), SFT_T(KC_H), KC_T, KC_N, KC_S, KC_MINUS, + KC_LGUI, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_RBRC), + MO(AUX), KC_NO, KC_NO, KC_BSLASH, KC_NO, + KC_LEFT, KC_RIGHT, + KC_UP, + KC_DOWN, ALT_T(KC_ENT), CTL_T(KC_SPC) + ), +/* Keymap 1: Aux layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | VolUp | | | | | | SLEEP | PWR | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | VolDn | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | * | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | F5 | F6 | F7 | F8 | TRANS|------| |------|TRANS | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------| + * | TRANS | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | / | TRANS | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS| | TRANS| . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | TRANS| TRANS| | TRANS| TRANS| + * ,------|------|------| |------+------+------. + * | | | TRANS| | TRANS| | | + * |TRANS |TRANS |------| |------| TRANS| TRANS| + * | | | TRANS| | TRANS| | | + * `--------------------' `--------------------' + */ +[AUX] = KEYMAP( + // left hand + KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP, + KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, KC_NO, KC_NO, + KC_NO , KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, + KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, + LCTL(KC_S), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), KC_TRNS, + KC_TRNS , KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_PWR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_NO, + KC_TRNS, KC_4, KC_5, KC_6, KC_PPLS, KC_NO, + KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_PEQL, KC_NO, + KC_TRNS , KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(AUX) // FN1 - Momentary Layer 1 (Aux) +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } +} -- cgit v1.2.3 From 83b6dd0cd6f055d99d3a11690ccc81b908a0aa4c Mon Sep 17 00:00:00 2001 From: Didier Chagniot Date: Sat, 10 Sep 2016 00:20:21 +0200 Subject: readme.md updated --- keyboards/ergodox/keymaps/dvorak_emacs/readme.md | 70 ++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 keyboards/ergodox/keymaps/dvorak_emacs/readme.md (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/dvorak_emacs/readme.md b/keyboards/ergodox/keymaps/dvorak_emacs/readme.md new file mode 100644 index 000000000..0578f1e25 --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_emacs/readme.md @@ -0,0 +1,70 @@ +# Ergodox Dvorak Layout with emacs binding in mind + * Control & Alt key on the thumbs (activated if pressed with another key). + * In the same way, "I" and "R" are the shift modifier if pressed with another key. + * "I" and "D" set the layer 1 for the auxiliary keys if pressed with another key. + * Software layout set to english. + +## Keymap Layers + - L0: dvorak with some customizations (see layout below) + - L1: auxiliary keys (includes function keys, numpad...) + + +### Keymap 0: Base layer +Keys with double values (like U/LSft) correspond to the 'tapped' key and the 'held' key, respectively + +

+
+,--------------------------------------------------.           ,--------------------------------------------------.
+ |        |   1  |   2  |   3  |   4  |   5  |  Esc |           |  Esc |   6  |   7  |   8  |   9  |   0  |   =    |
+ |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ |   ~    |  '   |   ,  |   .  |   P  |   Y  |   [  |           |   ]  |   F  |   G  |   C  |   H  |   L  |   /    |
+ |--------+------+------+------+------+------|   {  |           |   }  |------+------+------+------+------+--------|
+ |  Tab   |   A  |   O  |   E  |U/LSft| I/L1 |------|           |------|  D/L1|R/RSft|   T  |   N  |   S  |   -    |
+ |--------+------+------+------+------+------| LGUI |           | LGUI |------+------+------+------+------+--------|
+ | {/LSft |   ;  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | }/RSft |
+ `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+   |      |      |      |      | ~L1  |                                       | ~L1  |      |      |   \  |        |
+   `----------------------------------'                                       `----------------------------------'
+                                        ,-------------.       ,-------------.
+                                        | HOME |  END |       | LEFT | RIGHT|
+                                 ,------|------|------|       |------+--------+------.
+                                 | BSPC |  DEL | PGUP |       |  UP  | SPACE  |RETURN|
+                                 |  /   |  /   |------|       |------|   /    |  /   |
+                                 | LCTL | LALT |PGDWN |       | DOWN | LALT   | LCTL |
+                                 `--------------------'       `----------------------'
+
+
+ +### Keymap 1: Aux layer + +

+
+,--------------------------------------------------.           ,--------------------------------------------------.
+|  VolUp |      |      |      |      |      | SLEEP            | PWR  |      |      |      |      |      |        |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+|  VolDn |  F1  |  F2  |  F3  |  F4  |      |      |           |      |      |   7  |   8  |   9  |   *  |        |
+|--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+|        |  F5  |  F6  |  F7  |  F8  | TRANS|------|           |------|TRANS |   4  |   5  |   6  |   +  |        |
+|--------+------+------+------+------+------|      |           |PSCR  |------+------+------+------+------+--------|
+|  TRANS |  F9  |  F10 |  F11 |  F12 |      |      |           |      |      |   1  |   2  |   3  |   /  |  TRANS |
+`--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+  |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS|                                       | TRANS|    . |   0  |   =  |      |
+  `----------------------------------'                                       `----------------------------------'
+                                       ,-------------.       ,-------------.
+                                       | TRANS| TRANS|       | TRANS| TRANS|
+                                ,------|------|------|       |------+------+------.
+                                |      |      | TRANS|       | TRANS|      |      |
+                                |TRANS |TRANS |------|       |------| TRANS| TRANS|
+                                |      |      | TRANS|       | TRANS|      |      |
+                                `--------------------'       `--------------------'
+
+
+ + + +## Generation of .hex file +> In the "qmk_firmware/keyboards/ergodox" directory. + +> Execute "make dvorak_emacs". Then the hex file "ergodox_ez_dvorak_emacs.hex" is in the root directory : "qmk_firmware". + +> Flash with `teensy_loader` binary -- cgit v1.2.3 From b8679bbe045a2285d6ab6bbc420121b26f516b9a Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 5 Oct 2016 20:41:33 -0400 Subject: RGBW lights --- keyboards/ergodox/config.h | 2 ++ keyboards/ergodox/keymaps/jack/Makefile | 5 +++++ keyboards/ergodox/keymaps/jack/config.h | 14 ++++++++++++++ keyboards/ergodox/keymaps/jack/keymap.c | 4 ++-- quantum/rgblight.c | 18 +++++++++++++++--- quantum/rgblight.h | 1 + 6 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 keyboards/ergodox/keymaps/jack/Makefile create mode 100644 keyboards/ergodox/keymaps/jack/config.h (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h index edc60caae..049c707a5 100644 --- a/keyboards/ergodox/config.h +++ b/keyboards/ergodox/config.h @@ -1,6 +1,8 @@ #ifndef KEYBOARDS_ERGODOX_CONFIG_H_ #define KEYBOARDS_ERGODOX_CONFIG_H_ +#include "config_common.h" + #define MOUSEKEY_DELAY 100 #define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_MAX_SPEED 3 diff --git a/keyboards/ergodox/keymaps/jack/Makefile b/keyboards/ergodox/keymaps/jack/Makefile new file mode 100644 index 000000000..1e5761278 --- /dev/null +++ b/keyboards/ergodox/keymaps/jack/Makefile @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/ergodox/keymaps/jack/config.h b/keyboards/ergodox/keymaps/jack/config.h new file mode 100644 index 000000000..01ccfb3a2 --- /dev/null +++ b/keyboards/ergodox/keymaps/jack/config.h @@ -0,0 +1,14 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D7 +// #define RGBLIGHT_TIMER +#define RGBLED_NUM 20 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c index dda253fa4..1dd5a7618 100644 --- a/keyboards/ergodox/keymaps/jack/keymap.c +++ b/keyboards/ergodox/keymaps/jack/keymap.c @@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_ENT, MO(1), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, - KC_NO, KC_NO, + RGB_TOG, RGB_HUI, KC_PGUP, KC_PGDN, KC_SPC,KC_SPC ), @@ -90,7 +90,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // Runs just one time when the keyboard initializes. void matrix_init_user(void) { - + }; // Runs constantly in the background, in a loop. diff --git a/quantum/rgblight.c b/quantum/rgblight.c index f82e3ec55..801ca1d0d 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -50,7 +50,11 @@ const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20}; rgblight_config_t rgblight_config; rgblight_config_t inmem_config; -struct cRGB led[RGBLED_NUM]; +#ifdef RGBW + struct cRGBW led[RGBLED_NUM]; +#else + struct cRGB led[RGBLED_NUM]; +#endif uint8_t rgblight_inited = 0; @@ -334,14 +338,22 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { void rgblight_set(void) { if (rgblight_config.enable) { - ws2812_setleds(led, RGBLED_NUM); + #ifdef RGBW + ws2812_setleds_rgbw(led, RGBLED_NUM); + #else + ws2812_setleds(led, RGBLED_NUM); + #endif } else { for (uint8_t i = 0; i < RGBLED_NUM; i++) { led[i].r = 0; led[i].g = 0; led[i].b = 0; } - ws2812_setleds(led, RGBLED_NUM); + #ifdef RGBW + ws2812_setleds_rgbw(led, RGBLED_NUM); + #else + ws2812_setleds(led, RGBLED_NUM); + #endif } } diff --git a/quantum/rgblight.h b/quantum/rgblight.h index def26c428..2a712d8be 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -1,6 +1,7 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H +#define RGBW 1 #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) #define RGBLIGHT_MODES 23 -- cgit v1.2.3 From 5f91fb413624781ac79db641549b9e08753c04b5 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 16 Oct 2016 16:03:33 -0400 Subject: working with power limit --- build_keyboard.mk | 6 ++ keyboards/ergodox/keymaps/jack/config.h | 2 +- keyboards/ergodox/keymaps/jack/keymap.c | 4 +- quantum/keymap.h | 4 + quantum/light_ws2812.c | 137 +++++++++++++++++++++++++++++++- quantum/light_ws2812.h | 7 ++ quantum/quantum.c | 3 + quantum/quantum.h | 4 + 8 files changed, 163 insertions(+), 4 deletions(-) (limited to 'keyboards/ergodox') diff --git a/build_keyboard.mk b/build_keyboard.mk index 03a69b146..cd9f44c7b 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -169,6 +169,12 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c endif +ifeq ($(strip $(PRINTING_ENABLE)), yes) + OPT_DEFS += -DPRINTING_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c + SRC += $(TMK_DIR)/protocol/serial_uart.c +endif + ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) OPT_DEFS += $(SERIAL_DEFS) diff --git a/keyboards/ergodox/keymaps/jack/config.h b/keyboards/ergodox/keymaps/jack/config.h index 01ccfb3a2..f0932084a 100644 --- a/keyboards/ergodox/keymaps/jack/config.h +++ b/keyboards/ergodox/keymaps/jack/config.h @@ -6,7 +6,7 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D7 // #define RGBLIGHT_TIMER -#define RGBLED_NUM 20 // Number of LEDs +#define RGBLED_NUM 15 // Number of LEDs #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/ergodox/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c index 1dd5a7618..fabd27a61 100644 --- a/keyboards/ergodox/keymaps/jack/keymap.c +++ b/keyboards/ergodox/keymaps/jack/keymap.c @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_ENT, MO(1), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, RGB_TOG, RGB_HUI, - KC_PGUP, + RGB_MOD, KC_PGDN, KC_SPC,KC_SPC ), [SYMB] = KEYMAP( @@ -90,7 +90,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // Runs just one time when the keyboard initializes. void matrix_init_user(void) { - + }; // Runs constantly in the background, in a loop. diff --git a/quantum/keymap.h b/quantum/keymap.h index 98ddfd0c5..41aa11622 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -174,6 +174,10 @@ enum quantum_keycodes { // Right shift, close paren KC_RSPC, + // Printing + PRINT_ON, + PRINT_OFF, + // always leave at the end SAFE_RANGE }; diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c index 401845e85..d38dac4c6 100755 --- a/quantum/light_ws2812.c +++ b/quantum/light_ws2812.c @@ -16,6 +16,122 @@ #include #include "debug.h" +#define RGBW_BB_TWI 1 + +#ifdef RGBW_BB_TWI + +// Port for the I2C +#define I2C_DDR DDRD +#define I2C_PIN PIND +#define I2C_PORT PORTD + +// Pins to be used in the bit banging +#define I2C_CLK 0 +#define I2C_DAT 1 + +#define I2C_DATA_HI()\ +I2C_DDR &= ~ (1 << I2C_DAT);\ +I2C_PORT |= (1 << I2C_DAT); +#define I2C_DATA_LO()\ +I2C_DDR |= (1 << I2C_DAT);\ +I2C_PORT &= ~ (1 << I2C_DAT); + +#define I2C_CLOCK_HI()\ +I2C_DDR &= ~ (1 << I2C_CLK);\ +I2C_PORT |= (1 << I2C_CLK); +#define I2C_CLOCK_LO()\ +I2C_DDR |= (1 << I2C_CLK);\ +I2C_PORT &= ~ (1 << I2C_CLK); + +#define I2C_DELAY 1 + +void I2C_WriteBit(unsigned char c) +{ + if (c > 0) + { + I2C_DATA_HI(); + } + else + { + I2C_DATA_LO(); + } + + I2C_CLOCK_HI(); + _delay_us(I2C_DELAY); + + I2C_CLOCK_LO(); + _delay_us(I2C_DELAY); + + if (c > 0) + { + I2C_DATA_LO(); + } + + _delay_us(I2C_DELAY); +} + +// Inits bitbanging port, must be called before using the functions below +// +void I2C_Init() +{ + I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); + + I2C_CLOCK_HI(); + I2C_DATA_HI(); + + _delay_us(I2C_DELAY); +} + +// Send a START Condition +// +void I2C_Start() +{ + // set both to high at the same time + I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); + _delay_us(I2C_DELAY); + + I2C_DATA_LO(); + _delay_us(I2C_DELAY); + + I2C_CLOCK_LO(); + _delay_us(I2C_DELAY); +} + +// Send a STOP Condition +// +void I2C_Stop() +{ + I2C_CLOCK_HI(); + _delay_us(I2C_DELAY); + + I2C_DATA_HI(); + _delay_us(I2C_DELAY); +} + +// write a byte to the I2C slave device +// +unsigned char I2C_Write(unsigned char c) +{ + for (char i = 0; i < 8; i++) + { + I2C_WriteBit(c & 128); + + c <<= 1; + } + + + I2C_WriteBit(0); + _delay_us(I2C_DELAY); + _delay_us(I2C_DELAY); + + // _delay_us(I2C_DELAY); + //return I2C_ReadBit(); + return 0; +} + + +#endif + // Setleds for standard RGB void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds) { @@ -41,6 +157,25 @@ void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds) _SFR_IO8((RGB_DI_PIN >> 4) + 1) |= _BV(RGB_DI_PIN & 0xF); ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(RGB_DI_PIN & 0xF)); + + #ifdef RGBW_BB_TWI + cli(); + TWCR = 0; + I2C_Init(); + I2C_Start(); + I2C_Write(0x84); + uint16_t datlen = leds<<2; + uint8_t curbyte; + uint8_t * data = (uint8_t*)ledarray; + while (datlen--) { + curbyte=*data++; + I2C_Write(curbyte % 0x10); + } + I2C_Stop(); + sei(); + #endif + + _delay_us(80); } @@ -123,7 +258,7 @@ void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi) cli(); while (datlen--) { - curbyte=*data++; + curbyte=(*data++) % 0x10; asm volatile( " ldi %0,8 \n\t" diff --git a/quantum/light_ws2812.h b/quantum/light_ws2812.h index 54eef22d9..576c3bc48 100755 --- a/quantum/light_ws2812.h +++ b/quantum/light_ws2812.h @@ -16,6 +16,13 @@ #include #include //#include "ws2812_config.h" +#include "i2cmaster.h" + +#define LIGHT_I2C 1 +#define LIGHT_I2C_ADDR 0x84 +#define LIGHT_I2C_ADDR_WRITE ( (LIGHT_I2C_ADDR<<1) | I2C_WRITE ) +#define LIGHT_I2C_ADDR_READ ( (LIGHT_I2C_ADDR<<1) | I2C_READ ) + /* * Structure of the LED array diff --git a/quantum/quantum.c b/quantum/quantum.c index a16bd5443..5fa5e66b3 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -128,6 +128,9 @@ bool process_record_quantum(keyrecord_t *record) { #endif #ifdef UCIS_ENABLE process_ucis(keycode, record) && + #endif + #ifdef PRINTING_ENABLE + process_printer(keycode, record) && #endif true)) { return false; diff --git a/quantum/quantum.h b/quantum/quantum.h index 0c6046649..06a2e049d 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -59,6 +59,10 @@ extern uint32_t default_layer_state; #include "process_tap_dance.h" +#ifdef PRINTING_ENABLE + #include "process_printer.h" +#endif + #define SEND_STRING(str) send_string(PSTR(str)) void send_string(const char *str); -- cgit v1.2.3 From 1d766c596e8e457db3f5d7cdba1d3323d98439f9 Mon Sep 17 00:00:00 2001 From: Jonathan Arnett Date: Sun, 6 Nov 2016 13:48:20 -0500 Subject: Removed the control action when holding z or / --- keyboards/ergodox/keymaps/j3rn/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/j3rn/keymap.c b/keyboards/ergodox/keymaps/j3rn/keymap.c index d913ea4a5..2069f26ae 100644 --- a/keyboards/ergodox/keymaps/j3rn/keymap.c +++ b/keyboards/ergodox/keymaps/j3rn/keymap.c @@ -16,7 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L | ; | ' | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | ~L1 | Alt |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' @@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), MO(SYMB), KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, ALT_T(KC_APP), KC_HOME, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, MO(SYMB), KC_PGUP, CTL_T(KC_ESC), -- cgit v1.2.3 From 34bf8558cdfa3baa46db704299ef66b79b2d0a15 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 13 Nov 2016 00:56:46 -0500 Subject: update sethbc ergodox keymap --- keyboards/ergodox/keymaps/sethbc/Makefile | 11 ----------- keyboards/ergodox/keymaps/sethbc/keymap.c | 2 +- keyboards/ergodox/keymaps/sethbc/readme.md | 3 ++- 3 files changed, 3 insertions(+), 13 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/sethbc/Makefile b/keyboards/ergodox/keymaps/sethbc/Makefile index 8c4ff8784..457a3d01d 100644 --- a/keyboards/ergodox/keymaps/sethbc/Makefile +++ b/keyboards/ergodox/keymaps/sethbc/Makefile @@ -1,14 +1,3 @@ -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDox EZ -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = yes # Unicode - ifndef QUANTUM_DIR include ../../../../Makefile endif diff --git a/keyboards/ergodox/keymaps/sethbc/keymap.c b/keyboards/ergodox/keymaps/sethbc/keymap.c index 6846c4d52..8816ad63b 100644 --- a/keyboards/ergodox/keymaps/sethbc/keymap.c +++ b/keyboards/ergodox/keymaps/sethbc/keymap.c @@ -15,7 +15,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT, KC_LCTL, KC_LALT, KC_HOME, - KC_SPC, KC_BSPC, KC_END, + KC_BSPC, KC_DEL, KC_END, // right hand MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, diff --git a/keyboards/ergodox/keymaps/sethbc/readme.md b/keyboards/ergodox/keymaps/sethbc/readme.md index 510b2f99c..57b5d0ec7 100644 --- a/keyboards/ergodox/keymaps/sethbc/readme.md +++ b/keyboards/ergodox/keymaps/sethbc/readme.md @@ -1,3 +1,4 @@ # sethbc's Ergodox EZ keymap -Largely based on the Ergodox Infinity default keymap +Largely based on the Ergodox Infinity default keymap, but layer locking has been +removed in favor of momentary layer activation -- cgit v1.2.3 From 162f603b1c36c63aa170170998b361a86413767f Mon Sep 17 00:00:00 2001 From: Hans Ellegård Date: Sat, 29 Oct 2016 20:31:12 +0200 Subject: Added keymap "videck", an ErgoDox keymap for Vi(m) users. --- keyboards/ergodox/keymaps/videck/Makefile | 19 ++ keyboards/ergodox/keymaps/videck/config.h | 13 + keyboards/ergodox/keymaps/videck/keymap.c | 179 +++++++++++ keyboards/ergodox/keymaps/videck/readme.md | 24 ++ keyboards/ergodox/keymaps/videck/videck.json | 443 +++++++++++++++++++++++++++ keyboards/ergodox/keymaps/videck/videck.png | Bin 0 -> 106851 bytes 6 files changed, 678 insertions(+) create mode 100644 keyboards/ergodox/keymaps/videck/Makefile create mode 100644 keyboards/ergodox/keymaps/videck/config.h create mode 100644 keyboards/ergodox/keymaps/videck/keymap.c create mode 100644 keyboards/ergodox/keymaps/videck/readme.md create mode 100644 keyboards/ergodox/keymaps/videck/videck.json create mode 100644 keyboards/ergodox/keymaps/videck/videck.png (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/videck/Makefile b/keyboards/ergodox/keymaps/videck/Makefile new file mode 100644 index 000000000..5c7d21f2c --- /dev/null +++ b/keyboards/ergodox/keymaps/videck/Makefile @@ -0,0 +1,19 @@ +AUDIO_ENABLE:=no +BACKLIGHT_ENABLE:=no +BLUETOOTH_ENABLE:=no +BOOTMAGIC_ENABLE:=no +COMMAND_ENABLE:=no +CONSOLE_ENABLE:=no +EXTRAKEY_ENABLE:=yes +MIDI_ENABLE:=no +MOUSEKEY_ENABLE:=yes +NKRO_ENABLE:=no +RGBLIGHT_ENABLE:=no +SLEEP_LED_ENABLE:=no +TAP_DANCE_ENABLE:=yes +UNICODEMAP_ENABLE:=no +UNICODE_ENABLE:=no + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/ergodox/keymaps/videck/config.h b/keyboards/ergodox/keymaps/videck/config.h new file mode 100644 index 000000000..d89aabe77 --- /dev/null +++ b/keyboards/ergodox/keymaps/videck/config.h @@ -0,0 +1,13 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifndef NO_DEBUG + #define NO_DEBUG +#endif +#ifndef NO_PRINT + #define NO_PRINT +#endif + +#endif diff --git a/keyboards/ergodox/keymaps/videck/keymap.c b/keyboards/ergodox/keymaps/videck/keymap.c new file mode 100644 index 000000000..7bd6274e9 --- /dev/null +++ b/keyboards/ergodox/keymaps/videck/keymap.c @@ -0,0 +1,179 @@ +#include + +#include "ergodox.h" +#include "action_layer.h" + +enum { + BASE = 0, // Default layer + ARROWS = 1, // Arrows and Fx keys layer + MOUSE = 2, // Mouse movement and buttons layer + PARENS = 3, // Parenthesis easy access layer + + TD_L = 0, // Tap dance index for left shift + TD_R = 1 // Tap dance index for right shift +}; + +// See the videck.png image for a visualization of the layout. +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = KEYMAP( + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, + KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_END, + MO(PARENS), KC_A, KC_S, KC_D, KC_F, KC_G, + TD(TD_L), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, + KC_LCTL, KC_LALT, KC_VOLD, KC_VOLU, KC_MUTE, + KC_ESC, KC_LGUI, + TG(MOUSE), + KC_SPC, KC_TAB, TG(ARROWS), + // right hand + KC_PGUP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_PGDN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(TD_R), + KC_LBRC, KC_RBRC, KC_EQL, KC_RALT, KC_RCTL, + KC_APP, KC_ESC, + KC_INS, + KC_SLCK, KC_ENT, KC_SPC + ), + [ARROWS] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + [MOUSE] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_BTN3, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_NO, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + [PARENS] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_NO, + KC_TRNS, KC_TRNS, KC_NO, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +typedef void (*videck_tap_dance_trigger_t) (const uint16_t kc); + +typedef struct +{ + uint16_t kc1; + uint16_t kc2; + videck_tap_dance_trigger_t trigger; +} videck_tap_dance_tuple_t; + +static void videck_tap_dance_finished (qk_tap_dance_state_t *state, void *user_data) { + videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data; + + if (state->count == 1) { + register_code16 (tuple->kc1); + } else if (state->count == 2) { + register_code16 (tuple->kc2); + } +} + +static void videck_tap_dance_reset (qk_tap_dance_state_t *state, void *user_data) { + videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data; + + if (state->count == 1) { + unregister_code16 (tuple->kc1); + } else if (state->count == 2) { + unregister_code16 (tuple->kc2); + tuple->trigger(tuple->kc2); + } +} + +static bool caps_lock_is_on; + +// Toggles caps lock status. +static void videck_caps_trigger (const uint16_t kc) { + caps_lock_is_on ^= true; +} + +#define ACTION_TAP_DANCE_DOUBLE_TRIGGER(kc1, kc2, double_trigger) { \ + .fn = { NULL, videck_tap_dance_finished, videck_tap_dance_reset }, \ + .user_data = (void *)&((videck_tap_dance_tuple_t) { kc1, kc2, double_trigger }), \ + } + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_L] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_LSFT, KC_CAPS, videck_caps_trigger), + [TD_R] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_RSFT, KC_CAPS, videck_caps_trigger) +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + ergodox_led_all_set(LED_BRIGHTNESS_LO); + caps_lock_is_on = false; +}; + +static void indicate_using_led(const uint8_t led, const bool enabled) { + if (enabled) { + ergodox_right_led_on(led); + } else { + ergodox_right_led_off(led); + } +} + +static inline void indicate_caps_lock_state(const bool enabled) { + indicate_using_led(1, enabled); +} + +static inline void indicate_arrows_layer_state(const bool enabled) { + indicate_using_led(2, enabled); +} + +static inline void indicate_mouse_layer_state(const bool enabled) { + indicate_using_led(3, enabled); +} + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + // Check if we have shift locked. + indicate_caps_lock_state(caps_lock_is_on); + indicate_arrows_layer_state(IS_LAYER_ON(ARROWS)); + indicate_mouse_layer_state(IS_LAYER_ON(MOUSE)); +}; diff --git a/keyboards/ergodox/keymaps/videck/readme.md b/keyboards/ergodox/keymaps/videck/readme.md new file mode 100644 index 000000000..759e81bac --- /dev/null +++ b/keyboards/ergodox/keymaps/videck/readme.md @@ -0,0 +1,24 @@ +ViDeck keymap for ErgoDox +========================= + +This is a QWERTY layout based on the US layout, where Vi functionality has been +especially considered. + +# Features +* Mouse movements using the Vi movement keys. +* Vi movement keys doubling as arrow keys. +* Shift lock using double tap. +* A coder's modifier key for easy input of parenthesis. +* Acess to the escape key using either thumb. +* Reasonably accessible Scroll Lock key (useful if you, like me, want to switch + to a non-US layout once in a while in X). + +# Missing keys +* Caps Lock (shift lock is used instead). +* Pause/Break. +* Print Screen. + +# LEDs +* Shift lock is indicated using first LED. +* Arrow keys layer is indicated using second LED. +* Mouse keys layer is indicated using third LED. diff --git a/keyboards/ergodox/keymaps/videck/videck.json b/keyboards/ergodox/keymaps/videck/videck.json new file mode 100644 index 000000000..7068cf548 --- /dev/null +++ b/keyboards/ergodox/keymaps/videck/videck.json @@ -0,0 +1,443 @@ +[ + { + "backcolor": "#333333", + "background": { + "name": "PBT Black", + "style": "background-image: url('/bg/plastic/pbt-black.png');" + }, + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Red" + }, + [ + { + "x": 3.5, + "c": "#323232", + "t": "#ffffff\n\n\n#ac97d8" + }, + "#\n3\n\nF3", + { + "x": 10.5 + }, + "*\n8\n\nF8" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "@\n2\n\nF2", + { + "x": 1 + }, + "$\n4\n\nF4", + { + "x": 8.5 + }, + "&\n7\n\nF7", + { + "x": 1, + "t": "#ffffff\n\n\n#ac97d8\n\n\n\n#555454" + }, + "(\n9\n\nF9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#ffffff\n\n\n#ac97d8" + }, + "%\n5\n\nF5", + { + "t": "#ffffff" + }, + "home", + { + "x": 4.5 + }, + "pgup", + { + "t": "#ffffff\n\n\n#ac97d8" + }, + "^\n6\n\nF6" + ], + [ + { + "y": -0.875, + "t": "#ffffff", + "w": 1.5 + }, + "~\n`", + { + "t": "#ffffff\n\n\n#ac97d8" + }, + "!\n1\n\nF1", + { + "x": 14.5 + }, + ")\n0\n\nF10", + { + "w": 1.5 + }, + "_\n-\n\nF11" + ], + [ + { + "y": -0.375, + "x": 3.5, + "t": "#ffffff" + }, + "E", + { + "x": 10.5 + }, + "I" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "W", + { + "x": 1 + }, + "R", + { + "x": 8.5 + }, + "U", + { + "x": 1, + "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615" + }, + "O\n\n\n\n\n\n\n\n\n{" + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#ffffff" + }, + "T", + { + "h": 1.5 + }, + "end", + { + "x": 4.5, + "h": 1.5 + }, + "pgdn", + "Y" + ], + [ + { + "y": -0.875, + "w": 1.5 + }, + "+\n=", + "Q", + { + "x": 14.5, + "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615" + }, + "P\n\n\n\n\n\n\n\n\n}", + { + "t": "#ffffff\n\n\n#ac97d8", + "w": 1.5 + }, + "|\n\\\n\nF12" + ], + [ + { + "y": -0.375, + "x": 3.5, + "t": "#ffffff" + }, + "D", + { + "x": 10.5, + "t": "#ffffff\n\n#5eb1e7\n#ac97d8" + }, + "K\n\n\n" + ], + [ + { + "y": -0.875, + "x": 2.5, + "t": "#ffffff" + }, + "S", + { + "x": 1, + "n": true + }, + "F", + { + "x": 8.5, + "t": "#ffffff\n\n#5eb1e7\n#ac97d8", + "n": true + }, + "J\n\n\n", + { + "x": 1, + "t": "#ffffff\n\n#5eb1e7\n#ac97d8\n\n\n\n\n\n#f8d615" + }, + "L\n\n\n\n\n\n\n\n\n(" + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#ffffff" + }, + "G", + { + "x": 6.5, + "t": "#ffffff\n\n#5eb1e7\n#ac97d8" + }, + "H\n\n\n" + ], + [ + { + "y": -0.875, + "t": "#f8d615", + "a": 6, + "w": 1.5 + }, + "( ) [ ] { }", + { + "t": "#ffffff", + "a": 4 + }, + "A", + { + "x": 14.5, + "t": "#ffffff\n\n\n\n\n\n\n#60605b\n\n#f8d615" + }, + ":\n;\n\n\n\n\n\nÖ\n\n)", + { + "t": "#ffffff\n\n\n\n\n\n\n#60605b", + "w": 1.5 + }, + "\"\n'\n\n\n\n\n\nÄ" + ], + [ + { + "y": -0.625, + "x": 6.5, + "t": "#ffffff", + "h": 1.5 + }, + "", + { + "x": 4.5, + "h": 1.5 + }, + "" + ], + [ + { + "y": -0.75, + "x": 3.5 + }, + "C", + { + "x": 10.5 + }, + "<\n," + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "X", + { + "x": 1 + }, + "V", + { + "x": 8.5 + }, + "M", + { + "x": 1, + "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615" + }, + ">\n.\n\n\n\n\n\n\n\n[" + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#ffffff" + }, + "B", + { + "x": 6.5 + }, + "N" + ], + [ + { + "y": -0.875, + "t": "#ffffff\n\n#f67f00", + "a": 6, + "fa": [ + 5 + ], + "w": 1.5 + }, + "⇑\n\n2-tap
locks", + { + "t": "#ffffff", + "a": 4, + "f": 3 + }, + "Z", + { + "x": 14.5, + "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615", + "f": 3 + }, + "?\n/\n\n\n\n\n\n\n\n]", + { + "t": "#ffffff\n\n#f67f00", + "a": 6, + "f": 3, + "w": 1.5 + }, + "⇑\n\n2-tap
locks" + ], + [ + { + "y": -0.375, + "x": 3.5, + "t": "#ffffff", + "a": 4 + }, + "\n", + { + "x": 10.5, + "f": 3 + }, + "}\n]" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "\n", + { + "x": 1 + }, + "\n", + { + "x": 8.5, + "t": "#ffffff\n\n\n\n\n\n\n#60605b", + "f": 3 + }, + "{\n[\n\n\n\n\n\nÅ", + { + "x": 1, + "t": "#ffffff", + "f": 3 + }, + "+\n=" + ], + [ + { + "y": -0.75, + "x": 0.5, + "f": 3 + }, + "ctrl", + { + "f": 3 + }, + "alt", + { + "x": 14.5, + "f": 3 + }, + "altgr", + { + "f": 3 + }, + "ctrl" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7", + "f": 3 + }, + "esc\n\n\n\n\n\n\n\n\n\nM", + { + "t": "#ffffff", + "f": 7 + }, + "" + ], + [ + { + "t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7", + "f": 3, + "h": 2 + }, + "space\n\n\n\n\n\n\n\n\n\nL", + { + "h": 2 + }, + "\n\n\n\n\n\n\n\n\n\nR", + { + "t": "#5eb1e7" + }, + "" + ], + [ + { + "x": 2, + "t": "#ac97d8" + }, + "" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3, + "t": "#ffffff" + }, + "", + "esc" + ], + [ + { + "x": -3 + }, + "ins", + { + "h": 2 + }, + "", + { + "h": 2 + }, + "space" + ], + [ + { + "x": -3 + }, + "scroll
lock" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/videck/videck.png b/keyboards/ergodox/keymaps/videck/videck.png new file mode 100644 index 000000000..c99323f53 Binary files /dev/null and b/keyboards/ergodox/keymaps/videck/videck.png differ -- cgit v1.2.3 From e9f748751808de2f1e85cf7fb670d78773bd5e76 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 13 Nov 2016 23:02:38 -0500 Subject: mostly working --- keyboards/ergodox/ez/ez.c | 10 +++- keyboards/ergodox/ez/matrix.c | 2 +- keyboards/ergodox/keymaps/jack/Makefile | 1 + keyboards/ergodox/keymaps/jack/config.h | 4 +- quantum/light_ws2812.c | 21 ++++--- quantum/light_ws2812.h | 14 ++++- quantum/quantum.c | 1 + quantum/rgblight.c | 101 ++++++++++++++++---------------- quantum/rgblight.h | 10 ++-- tmk_core/protocol/lufa/lufa.c | 33 ++++++++++- 10 files changed, 125 insertions(+), 72 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/ez/ez.c b/keyboards/ergodox/ez/ez.c index ddb8ff0cf..039e4c6bb 100644 --- a/keyboards/ergodox/ez/ez.c +++ b/keyboards/ergodox/ez/ez.c @@ -16,10 +16,10 @@ void matrix_init_kb(void) { // unused pins - C7, D4, D5, D7, E6 // set as input with internal pull-ip enabled DDRC &= ~(1<<7); - DDRD &= ~(1<<7 | 1<<5 | 1<<4); + DDRD &= ~(1<<5 | 1<<4); DDRE &= ~(1<<6); PORTC |= (1<<7); - PORTD |= (1<<7 | 1<<5 | 1<<4); + PORTD |= (1<<5 | 1<<4); PORTE |= (1<<6); ergodox_blink_all_leds(); @@ -51,6 +51,10 @@ uint8_t init_mcp23018(void) { mcp23018_status = 0x20; // I2C subsystem + + uint8_t sreg_prev; + sreg_prev=SREG; + cli(); if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) i2c_initialized++; @@ -79,6 +83,8 @@ uint8_t init_mcp23018(void) { out: i2c_stop(); + SREG=sreg_prev; + return mcp23018_status; } diff --git a/keyboards/ergodox/ez/matrix.c b/keyboards/ergodox/ez/matrix.c index a19bab90b..43f515259 100644 --- a/keyboards/ergodox/ez/matrix.c +++ b/keyboards/ergodox/ez/matrix.c @@ -121,7 +121,7 @@ void matrix_init(void) matrix_scan_count = 0; #endif - matrix_init_kb(); + matrix_init_quantum(); } diff --git a/keyboards/ergodox/keymaps/jack/Makefile b/keyboards/ergodox/keymaps/jack/Makefile index 1e5761278..7c257af50 100644 --- a/keyboards/ergodox/keymaps/jack/Makefile +++ b/keyboards/ergodox/keymaps/jack/Makefile @@ -1,4 +1,5 @@ RGBLIGHT_ENABLE = yes +MIDI_ENABLE = yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/ergodox/keymaps/jack/config.h b/keyboards/ergodox/keymaps/jack/config.h index 1781563b8..5bf109c18 100644 --- a/keyboards/ergodox/keymaps/jack/config.h +++ b/keyboards/ergodox/keymaps/jack/config.h @@ -5,10 +5,12 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D7 -// #define RGBLIGHT_TIMER +#define RGBLIGHT_TIMER #define RGBLED_NUM 15 // Number of LEDs #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 255 #define RGBLIGHT_VAL_STEP 12 +#define RGB_MIDI + #endif \ No newline at end of file diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c index 497543339..6edbc0f2b 100755 --- a/quantum/light_ws2812.c +++ b/quantum/light_ws2812.c @@ -133,13 +133,13 @@ unsigned char I2C_Write(unsigned char c) #endif // Setleds for standard RGB -void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds) +void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { // ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin)); ws2812_setleds_pin(ledarray,leds, _BV(RGB_DI_PIN & 0xF)); } -void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask) +void inline ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask) { // ws2812_DDRREG |= pinmask; // Enable DDR // new universal format (DDR) @@ -150,12 +150,15 @@ void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pin } // Setleds for SK6812RGBW -void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds) +void inline ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t leds) { #ifdef RGBW_BB_TWI + uint8_t sreg_prev, twcr_prev; + sreg_prev=SREG; + twcr_prev=TWCR; cli(); - TWCR = 0; + TWCR &= ~(1<> 8) & 0xff; - OCR3AL = RGBLED_TIMER_TOP & 0xff; - SREG = sreg; + // static uint8_t rgblight_timer_is_init = 0; + // if (rgblight_timer_is_init) { + // return; + // } + // rgblight_timer_is_init = 1; + // /* Timer 3 setup */ + // TCCR3B = _BV(WGM32) // CTC mode OCR3A as TOP + // | _BV(CS30); // Clock selelct: clk/1 + // /* Set TOP value */ + // uint8_t sreg = SREG; + // cli(); + // OCR3AH = (RGBLED_TIMER_TOP >> 8) & 0xff; + // OCR3AL = RGBLED_TIMER_TOP & 0xff; + // SREG = sreg; + + rgblight_timer_enabled = true; } void rgblight_timer_enable(void) { - TIMSK3 |= _BV(OCIE3A); + rgblight_timer_enabled = true; dprintf("TIMER3 enabled.\n"); } void rgblight_timer_disable(void) { - TIMSK3 &= ~_BV(OCIE3A); + rgblight_timer_enabled = false; dprintf("TIMER3 disabled.\n"); } void rgblight_timer_toggle(void) { - TIMSK3 ^= _BV(OCIE3A); + rgblight_timer_enabled ^= rgblight_timer_enabled; dprintf("TIMER3 toggled.\n"); } -ISR(TIMER3_COMPA_vect) { - // mode = 1, static light, do nothing here - if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { - // mode = 2 to 5, breathing mode - rgblight_effect_breathing(rgblight_config.mode - 2); - } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 8) { - // mode = 6 to 8, rainbow mood mod - rgblight_effect_rainbow_mood(rgblight_config.mode - 6); - } else if (rgblight_config.mode >= 9 && rgblight_config.mode <= 14) { - // mode = 9 to 14, rainbow swirl mode - rgblight_effect_rainbow_swirl(rgblight_config.mode - 9); - } else if (rgblight_config.mode >= 15 && rgblight_config.mode <= 20) { - // mode = 15 to 20, snake mode - rgblight_effect_snake(rgblight_config.mode - 15); - } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { - // mode = 21 to 23, knight mode - rgblight_effect_knight(rgblight_config.mode - 21); +void rgblight_task(void) { + if (rgblight_timer_enabled) { + // mode = 1, static light, do nothing here + if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { + // mode = 2 to 5, breathing mode + rgblight_effect_breathing(rgblight_config.mode - 2); + } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 8) { + // mode = 6 to 8, rainbow mood mod + rgblight_effect_rainbow_mood(rgblight_config.mode - 6); + } else if (rgblight_config.mode >= 9 && rgblight_config.mode <= 14) { + // mode = 9 to 14, rainbow swirl mode + rgblight_effect_rainbow_swirl(rgblight_config.mode - 9); + } else if (rgblight_config.mode >= 15 && rgblight_config.mode <= 20) { + // mode = 15 to 20, snake mode + rgblight_effect_snake(rgblight_config.mode - 15); + } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { + // mode = 21 to 23, knight mode + rgblight_effect_knight(rgblight_config.mode - 21); + } } } @@ -461,7 +462,7 @@ void rgblight_effect_rainbow_swirl(uint8_t interval) { last_timer = timer_read(); for (i = 0; i < RGBLED_NUM; i++) { hue = (360 / RGBLED_NUM * i + current_hue) % 360; - sethsv(hue, rgblight_config.sat, rgblight_config.val, &led[i]); + sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); } rgblight_set(); @@ -498,7 +499,7 @@ void rgblight_effect_snake(uint8_t interval) { k = k + RGBLED_NUM; } if (i == k) { - sethsv(rgblight_config.hue, rgblight_config.sat, (uint8_t)(rgblight_config.val*(RGBLIGHT_EFFECT_SNAKE_LENGTH-j)/RGBLIGHT_EFFECT_SNAKE_LENGTH), &led[i]); + sethsv(rgblight_config.hue, rgblight_config.sat, (uint8_t)(rgblight_config.val*(RGBLIGHT_EFFECT_SNAKE_LENGTH-j)/RGBLIGHT_EFFECT_SNAKE_LENGTH), (LED_TYPE *)&led[i]); } } } @@ -518,7 +519,7 @@ void rgblight_effect_knight(uint8_t interval) { static uint16_t last_timer = 0; uint8_t i, j, cur; int8_t k; - struct cRGB preled[RGBLED_NUM]; + LED_TYPE preled[RGBLED_NUM]; static int8_t increment = -1; if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) { return; @@ -537,7 +538,7 @@ void rgblight_effect_knight(uint8_t interval) { k = RGBLED_NUM - 1; } if (i == k) { - sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&preled[i]); } } } diff --git a/quantum/rgblight.h b/quantum/rgblight.h index efc685f31..d16ba24e5 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -1,8 +1,6 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#define RGBW 1 - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) #define RGBLIGHT_MODES 23 #else @@ -35,6 +33,7 @@ #endif #define RGBLED_TIMER_TOP F_CPU/(256*64) +// #define RGBLED_TIMER_TOP 0xFF10 #include #include @@ -79,10 +78,13 @@ void eeconfig_update_rgblight(uint32_t val); void eeconfig_update_rgblight_default(void); void eeconfig_debug_rgblight(void); -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1); -void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1); +void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); +void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); + +void rgblight_task(void); + void rgblight_timer_init(void); void rgblight_timer_enable(void); void rgblight_timer_disable(void); diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 01c0e45b0..fe466f604 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -71,6 +71,10 @@ #include "virtser.h" #endif +#ifdef RGB_MIDI + #include "rgblight.h" +#endif + uint8_t keyboard_idle = 0; /* 0: Boot Protocol, 1: Report Protocol(default) */ uint8_t keyboard_protocol = 1; @@ -1045,6 +1049,10 @@ int main(void) #endif keyboard_task(); +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + #ifdef VIRTSER_ENABLE virtser_task(); CDC_Device_USBTask(&cdc_device); @@ -1077,15 +1085,34 @@ void fallthrough_callback(MidiDevice * device, #endif } +#ifdef RGB_MIDI + rgblight_config_t rgblight_config; +#endif + void cc_callback(MidiDevice * device, uint8_t chan, uint8_t num, uint8_t val) { //sending it back on the next channel - midi_send_cc(device, (chan + 1) % 16, num, val); + // midi_send_cc(device, (chan + 1) % 16, num, val); + #ifdef RGB_MIDI + rgblight_config.raw = eeconfig_read_rgblight(); + switch (num) { + case 14: + rgblight_config.hue = val * 360 / 127; + break; + case 15: + rgblight_config.sat = val << 1; + break; + case 16: + rgblight_config.val = val << 1; + break; + } + rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + #endif } void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data) { - for (int i = 0; i < length; i++) - midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); + // for (int i = 0; i < length; i++) + // midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); } #endif -- cgit v1.2.3 From 4da698fda3b7e08d7baa6849243716fb8765679a Mon Sep 17 00:00:00 2001 From: Seebs Date: Wed, 16 Nov 2016 15:44:26 -0600 Subject: dvorak/plover keyboard layout Plover's steno support likes quasi-qwerty, and gaming likes qwerty, and I like dvorak, so... what if I could have it all? Signed-off-by: seebs --- keyboards/ergodox/keymaps/dvorak_plover/README.md | 14 ++ keyboards/ergodox/keymaps/dvorak_plover/keymap.c | 230 ++++++++++++++++++++++ 2 files changed, 244 insertions(+) create mode 100644 keyboards/ergodox/keymaps/dvorak_plover/README.md create mode 100644 keyboards/ergodox/keymaps/dvorak_plover/keymap.c (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/dvorak_plover/README.md b/keyboards/ergodox/keymaps/dvorak_plover/README.md new file mode 100644 index 000000000..c8287b019 --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_plover/README.md @@ -0,0 +1,14 @@ +Dvorak support, plover support, gaming support + +I'm used to the Kinesis, so originally I was just going to patch up +the thumb keys to be more familiar. But the ergodox is really well +suited to NKRO support in Plover, so I added a layer for that, and +then I remembered that dvorak can be really annoying for video +games (try to reach WASD), so I added a layer for that. + +The result is probably a bit idiosyncratic, but it works for me. + +(I also don't have any press/hold distinction keys, because that +confuses my fuzzy little brain.) + +Contributed by seebs (seebs@seebs.net) diff --git a/keyboards/ergodox/keymaps/dvorak_plover/keymap.c b/keyboards/ergodox/keymaps/dvorak_plover/keymap.c new file mode 100644 index 000000000..d0505609d --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_plover/keymap.c @@ -0,0 +1,230 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define PLVR 2 // media keys +#define QWRT 3 // qwerty layer for gaming + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | \ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | ' | , | . | P | Y | L1 | | L2 | F | G | C | R | L | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LGui | A | O | E | U | I |------| |------| D | H | T | N | S | - | + * |--------+------+------+------+------+------| Esc | | L3 |------+------+------+------+------+--------| + * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Lalt | Grv | | Left | Right| | Up | Down | [ | ] | RAlt | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | LCtrl| Alt | | LGui | RCtrl | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * |Backsp|Delete|------| |------| Enter |Space | + * | ace| | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, MO(SYMB), + KC_LGUI, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ESC, + KC_LALT, KC_GRV, KC_ESC, KC_LEFT,KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC,KC_DEL,KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + TG(PLVR), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + TG(QWRT),KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_RALT, + KC_LGUI, KC_RCTL, + KC_PGUP, + KC_PGDN,KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | KP7 | KP8 | KP9 | KP* | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | KP4 | KP5 | KP6 | KP+ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | KP1 | KP2 | KP3 | KP/ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | KP. | KP0 | KP= | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_P7, KC_P8, KC_P9, KC_PAST, KC_F12, + KC_DOWN, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_TRNS, + KC_TRNS,KC_PDOT, KC_P0, KC_PEQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | 1 | 2 | 3 | 4 | 5 | | | L2 | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | c | v |------| |------| n | m | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( // layout: layer 2: Steno for Plover + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_FN4, KC_NO, + KC_NO, + KC_C, KC_V, KC_NO, + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + TG(2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M +), +/* Keymap 3: qwerty-ish + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LGui | A | S | D | F | G |------| |------| H | J | K | L | ; | LGui | + * |--------+------+------+------+------+------| Spc | | L3 |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Lalt | Grv | '" | Left | Right| | Up | Down | [ | ] | RAlt | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | LCtrl| LAlt | | LGui | RCtrl | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * |Backsp|Delete|------| |------| Enter |Space | + * | ace| | End | | PgDn | | | + * `--------------------' `----------------------' + */ +[QWRT] = KEYMAP( // layer 3: qwerty for gaming + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPACE, + KC_LALT, KC_GRV, KC_QUOT, KC_LEFT,KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC,KC_DEL,KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + TG(QWRT), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_RALT, + KC_LGUI, KC_RCTL, + KC_PGUP, + KC_PGDN,KC_ENT, KC_SPC + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + default: + // none + break; + } + +}; -- cgit v1.2.3 From 3774a7fcdab5544fc787f4c200be05fcd417e31f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 17 Nov 2016 17:42:14 -0500 Subject: rgb light through midi --- keyboards/amj60/config.h | 2 +- keyboards/clueboard/rev1/config.h | 2 +- keyboards/clueboard/rev2/config.h | 2 +- keyboards/cluecard/config.h | 2 +- keyboards/cluecard/keymaps/rgb_effects/config.h | 2 +- keyboards/cluepad/config.h | 2 +- keyboards/ergodox/keymaps/jack/config.h | 3 +- keyboards/gh60/keymaps/robotmaxtron/config.h | 2 +- keyboards/handwired/minorca/keymaps/rgb/config.h | 2 +- keyboards/jd40/config.h | 2 +- keyboards/kc60/keymaps/ws2812/config.h | 2 +- keyboards/lets_split/config.h | 2 +- keyboards/lets_split/keymaps/i2c/config.h | 2 +- keyboards/lets_split/keymaps/serial/config.h | 2 +- keyboards/phantom/config.h | 2 +- keyboards/planck/keymaps/experimental/config.h | 2 +- keyboards/planck/keymaps/yang/config.h | 2 +- keyboards/preonic/config.h | 2 +- keyboards/preonic/keymaps/kinesis/config.h | 2 +- keyboards/satan/config.h | 2 +- keyboards/tada68/config.h | 2 +- quantum/light_ws2812.c | 2 - quantum/rgblight.c | 10 +-- quantum/rgblight.h | 2 +- readme.md | 4 +- tmk_core/protocol/lufa/lufa.c | 96 ++++++++++++++++++++++++ 26 files changed, 126 insertions(+), 31 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/amj60/config.h b/keyboards/amj60/config.h index d98e0e9f2..7c06f9a6c 100644 --- a/keyboards/amj60/config.h +++ b/keyboards/amj60/config.h @@ -67,7 +67,7 @@ along with this program. If not, see . */ #define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/clueboard/rev1/config.h b/keyboards/clueboard/rev1/config.h index 8c9497232..f40876ffb 100644 --- a/keyboards/clueboard/rev1/config.h +++ b/keyboards/clueboard/rev1/config.h @@ -26,7 +26,7 @@ /* Underlight configuration */ #define RGB_DI_PIN B2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h index 15ca4ece8..8435fd02b 100644 --- a/keyboards/clueboard/rev2/config.h +++ b/keyboards/clueboard/rev2/config.h @@ -30,7 +30,7 @@ /* Underlight configuration */ #define RGB_DI_PIN D7 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/cluecard/config.h b/keyboards/cluecard/config.h index 765347b13..6520eb557 100644 --- a/keyboards/cluecard/config.h +++ b/keyboards/cluecard/config.h @@ -140,7 +140,7 @@ along with this program. If not, see . /* Underlight configuration */ #define RGB_DI_PIN E6 -//#define RGBLIGHT_TIMER +//#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 4 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/cluecard/keymaps/rgb_effects/config.h b/keyboards/cluecard/keymaps/rgb_effects/config.h index e88847df4..c6c9342c8 100644 --- a/keyboards/cluecard/keymaps/rgb_effects/config.h +++ b/keyboards/cluecard/keymaps/rgb_effects/config.h @@ -4,7 +4,7 @@ #include "../../config.h" // place overrides here -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 diff --git a/keyboards/cluepad/config.h b/keyboards/cluepad/config.h index bae05fade..bd64dfd27 100644 --- a/keyboards/cluepad/config.h +++ b/keyboards/cluepad/config.h @@ -70,7 +70,7 @@ along with this program. If not, see . /* Underlight configuration */ #define RGB_DI_PIN F6 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 4 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/ergodox/keymaps/jack/config.h b/keyboards/ergodox/keymaps/jack/config.h index 5bf109c18..5c1165226 100644 --- a/keyboards/ergodox/keymaps/jack/config.h +++ b/keyboards/ergodox/keymaps/jack/config.h @@ -5,12 +5,13 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D7 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 15 // Number of LEDs #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 255 #define RGBLIGHT_VAL_STEP 12 #define RGB_MIDI +#define RGBW_BB_TWI #endif \ No newline at end of file diff --git a/keyboards/gh60/keymaps/robotmaxtron/config.h b/keyboards/gh60/keymaps/robotmaxtron/config.h index 6a29e6b8c..bcd753461 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/config.h +++ b/keyboards/gh60/keymaps/robotmaxtron/config.h @@ -182,7 +182,7 @@ along with this program. If not, see . #define ws2812_pin PF4 */ #define RGB_DI_PIN F4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 diff --git a/keyboards/handwired/minorca/keymaps/rgb/config.h b/keyboards/handwired/minorca/keymaps/rgb/config.h index deaac2e26..43b3c5911 100644 --- a/keyboards/handwired/minorca/keymaps/rgb/config.h +++ b/keyboards/handwired/minorca/keymaps/rgb/config.h @@ -11,7 +11,7 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D5 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 13 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/jd40/config.h b/keyboards/jd40/config.h index e2594f4b3..047be5707 100644 --- a/keyboards/jd40/config.h +++ b/keyboards/jd40/config.h @@ -70,7 +70,7 @@ along with this program. If not, see . ) #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 // Number of LEDs #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 diff --git a/keyboards/kc60/keymaps/ws2812/config.h b/keyboards/kc60/keymaps/ws2812/config.h index 2f39ea8e5..43abf6228 100644 --- a/keyboards/kc60/keymaps/ws2812/config.h +++ b/keyboards/kc60/keymaps/ws2812/config.h @@ -2,7 +2,7 @@ /* WS2812B RGB Underglow LED */ #define RGB_DI_PIN F5 // Based on wiring depicted in ws2812_wiring.jpg -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 // Number of LEDs. Change this to match your use case. #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index f4d900acc..b0ad522fc 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -75,7 +75,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/lets_split/keymaps/i2c/config.h b/keyboards/lets_split/keymaps/i2c/config.h index 2671fabf6..72e5ae66b 100644 --- a/keyboards/lets_split/keymaps/i2c/config.h +++ b/keyboards/lets_split/keymaps/i2c/config.h @@ -75,7 +75,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/lets_split/keymaps/serial/config.h b/keyboards/lets_split/keymaps/serial/config.h index f4d900acc..b0ad522fc 100644 --- a/keyboards/lets_split/keymaps/serial/config.h +++ b/keyboards/lets_split/keymaps/serial/config.h @@ -75,7 +75,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h index 983a1d73f..71a33498b 100644 --- a/keyboards/phantom/config.h +++ b/keyboards/phantom/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* Underlight configuration */ #define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 20 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h index 52acd1905..cc093bee4 100644 --- a/keyboards/planck/keymaps/experimental/config.h +++ b/keyboards/planck/keymaps/experimental/config.h @@ -9,7 +9,7 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN B1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/planck/keymaps/yang/config.h b/keyboards/planck/keymaps/yang/config.h index feb5a1190..4ed19d76f 100644 --- a/keyboards/planck/keymaps/yang/config.h +++ b/keyboards/planck/keymaps/yang/config.h @@ -5,7 +5,7 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h index 3fb978c2f..f88acf211 100644 --- a/keyboards/preonic/config.h +++ b/keyboards/preonic/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/preonic/keymaps/kinesis/config.h b/keyboards/preonic/keymaps/kinesis/config.h index 086baa84f..e6099ceb8 100644 --- a/keyboards/preonic/keymaps/kinesis/config.h +++ b/keyboards/preonic/keymaps/kinesis/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/satan/config.h b/keyboards/satan/config.h index 7e9f91cc8..eb357b39e 100644 --- a/keyboards/satan/config.h +++ b/keyboards/satan/config.h @@ -67,7 +67,7 @@ along with this program. If not, see . */ #define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/tada68/config.h b/keyboards/tada68/config.h index 5d8757936..19cf9c9b3 100644 --- a/keyboards/tada68/config.h +++ b/keyboards/tada68/config.h @@ -67,7 +67,7 @@ along with this program. If not, see . */ /*#define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 2 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c index aac058f53..a883b1388 100755 --- a/quantum/light_ws2812.c +++ b/quantum/light_ws2812.c @@ -16,8 +16,6 @@ #include #include "debug.h" -#define RGBW_BB_TWI 1 - #ifdef RGBW_BB_TWI // Port for the I2C diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 1901010bf..6b58f6654 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -174,7 +174,7 @@ void rgblight_init(void) { } eeconfig_debug_rgblight(); // display current eeprom values - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_init(); // setup the timer #endif @@ -221,7 +221,7 @@ void rgblight_mode(uint8_t mode) { eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight mode: %u\n", rgblight_config.mode); if (rgblight_config.mode == 1) { - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_disable(); #endif } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { @@ -231,7 +231,7 @@ void rgblight_mode(uint8_t mode) { // MODE 15-20, snake // MODE 21-23, knight - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_enable(); #endif } @@ -245,7 +245,7 @@ void rgblight_toggle(void) { if (rgblight_config.enable) { rgblight_mode(rgblight_config.mode); } else { - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_disable(); #endif _delay_ms(50); @@ -371,7 +371,7 @@ void rgblight_set(void) { } } -#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) +#ifdef RGBLIGHT_ANIMATIONS // Animation timer -- AVR Timer3 void rgblight_timer_init(void) { diff --git a/quantum/rgblight.h b/quantum/rgblight.h index d16ba24e5..330c2fe1b 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -1,7 +1,7 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) +#ifdef RGBLIGHT_ANIMATIONS #define RGBLIGHT_MODES 23 #else #define RGBLIGHT_MODES 1 diff --git a/readme.md b/readme.md index d5a259ccb..2364b5301 100644 --- a/readme.md +++ b/readme.md @@ -1135,12 +1135,12 @@ For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring RGBLIGHT_ENABLE = yes -In order to use the underglow timer functions, you need to have `#define RGBLIGHT_TIMER` in your `config.h`, and have audio disabled (`AUDIO_ENABLE = no` in your Makefile). +In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`. Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default: #define RGB_DI_PIN F4 // The pin your RGB strip is wired to - #define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) + #define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio) #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index b628cde37..7eb9be601 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -51,6 +51,7 @@ #include "descriptor.h" #include "lufa.h" +#include "quantum.h" #ifdef NKRO_ENABLE #include "keycode_config.h" @@ -1111,9 +1112,104 @@ void cc_callback(MidiDevice * device, #endif } +void send_dword(uint32_t number) { + uint16_t word = (number >> 16); + send_word(word); + send_word(number & 0xFFFFUL); +} + +void send_word(uint16_t number) { + uint8_t byte = number >> 8; + send_byte(byte); + send_byte(number & 0xFF); +} + +void send_byte(uint8_t number) { + uint8_t nibble = number >> 4; + send_nibble(nibble); + send_nibble(number & 0xF); +} + +void send_nibble(uint8_t number) { + switch (number) { + case 0: + register_code(KC_0); + unregister_code(KC_0); + break; + case 1 ... 9: + register_code(KC_1 + (number - 1)); + unregister_code(KC_1 + (number - 1)); + break; + case 0xA ... 0xF: + register_code(KC_A + (number - 0xA)); + unregister_code(KC_A + (number - 0xA)); + break; + } +} + +uint8_t midi_buffer[16] = {0}; + void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data) { // for (int i = 0; i < length; i++) // midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); + // if (start == 0x27) { + // SEND_STRING("\n"); + // send_word(start); + // SEND_STRING(": "); + for (uint8_t place = 0; place < length; place++) { + // send_byte(*data); + midi_buffer[start + place] = *data; + if (*data == 0xF7) + sysex_buffer_callback(start + place, &midi_buffer); + // SEND_STRING(" "); + data++; + } + // } + +} + +void sysex_buffer_callback(uint8_t length, uint8_t * data) { + uint8_t * pointer_copy = data; + + if (*data++ != 0xF0) + return + data++; + data++; + data++; + data++; + + switch (*data++) { + case 0x27: ; // RGB LED functions + switch (*data++) + case 0x00: ; // Update HSV + uint32_t part1 = *data++; + uint32_t part2 = *data++; + uint32_t part3 = *data++; + uint32_t part4 = *data++; + uint32_t part5 = *data++; + uint32_t chunk = ((part1 & 0x1FUL) << 28) | (part2 << 21) | (part3 << 14) | (part4 << 7) | part5; + // SEND_STRING("\nCHUNK: "); + // send_dword(chunk); + rgblight_sethsv(((chunk >> 16) & 0xFFFF) % 360, (chunk >> 8) & 0xFF, chunk & 0xFF); + // SEND_STRING("\nHUE: "); + // send_word(((chunk >> 16) & 0xFFFF) % 360); + // SEND_STRING("\nSAT: "); + // send_word((chunk >> 8) & 0xFF); + // SEND_STRING("\nVAL: "); + // send_word(chunk & 0xFF); + break; + case 0x01: ; // Update RGB + break; + break; + } + + // SEND_STRING("\nDATA:\n"); + // while (*pointer_copy != 0xF7) { + // send_byte(*pointer_copy++); + // SEND_STRING(" "); + // } + } + #endif -- cgit v1.2.3 From 9bbc9a7ce024edb4d80ce65d43c82456e3714928 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Thu, 17 Nov 2016 19:47:08 -0500 Subject: Initial Erez Experimental keymap tweaks --- keyboards/ergodox/keymaps/erez_experimental/Makefile | 2 ++ keyboards/ergodox/keymaps/erez_experimental/config.h | 11 +++++++++++ keyboards/ergodox/keymaps/erez_experimental/keymap.c | 12 ++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/erez_experimental/Makefile b/keyboards/ergodox/keymaps/erez_experimental/Makefile index b673c5ce5..dbe89d141 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/Makefile +++ b/keyboards/ergodox/keymaps/erez_experimental/Makefile @@ -3,6 +3,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend COMMAND_ENABLE = no # Commands for debug and configuration +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/ergodox/keymaps/erez_experimental/config.h b/keyboards/ergodox/keymaps/erez_experimental/config.h index e5d7fe188..fbd12ab79 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/config.h +++ b/keyboards/ergodox/keymaps/erez_experimental/config.h @@ -8,5 +8,16 @@ #undef LEADER_TIMEOUT #define LEADER_TIMEOUT 300 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 15 // Number of LEDs +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 255 +#define RGBLIGHT_VAL_STEP 12 + +#define RGB_MIDI +#define RGBW_BB_TWI #endif diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c index 4804959d6..b867d3601 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c @@ -67,9 +67,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | | | | + * |VAI |VAD |HUI | |SAI |TOG |MOD | * | | |------| |------| | | - * | | | | | | | | + * | | |HUD | |SAD | | | * `--------------------' `--------------------' */ // SYMBOLS @@ -81,8 +81,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,LCTL(KC_PGUP), LCTL(KC_PGDN), KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, + RGB_HUI, + RGB_VAI,RGB_VAD,RGB_HUD, // right hand KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, @@ -90,8 +90,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_PIPE, KC_AT, KC_EQL, KC_PERC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS + RGB_SAI, + RGB_SAD, RGB_TOG, RGB_MOD ), /* Keymap 2: Media and mouse keys * -- cgit v1.2.3 From 285c5a91f23e972d9c579184283443111186329d Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Thu, 17 Nov 2016 20:56:36 -0500 Subject: Groundwork for dedicated color keycodes --- .../ergodox/keymaps/erez_experimental/keymap.c | 24 +++++++++++++++++++++- quantum/rgblight.c | 7 +++++++ quantum/rgblight.h | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c index b867d3601..4a23c7ac5 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c @@ -7,6 +7,12 @@ #define SYMB 1 // symbols #define MDIA 2 // media keys +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + RGB_FF00BB // always start with RGB_ +}; + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * @@ -75,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // SYMBOLS [SYMB] = KEYMAP( // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + RGB_FF00BB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, @@ -152,6 +158,22 @@ void matrix_init_user(void) { }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case RGB_FF00BB: + if (record->event.pressed) { + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0xff,0x00,0xbb); + } + return false; + break; + } + return true; +} + LEADER_EXTERNS(); // Runs constantly in the background, in a loop. diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 6b58f6654..00620da58 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -253,6 +253,13 @@ void rgblight_toggle(void) { } } +void rgblight_enable(void) { + rgblight_config.enable = 1; + eeconfig_update_rgblight(rgblight_config.raw); + xprintf("rgblight enable: rgblight_config.enable = %u\n", rgblight_config.enable); + rgblight_mode(rgblight_config.mode); +} + void rgblight_increase_hue(void) { uint16_t hue; diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 330c2fe1b..a3673348e 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -61,6 +61,7 @@ void rgblight_init(void); void rgblight_increase(void); void rgblight_decrease(void); void rgblight_toggle(void); +void rgblight_enable(void); void rgblight_step(void); void rgblight_mode(uint8_t mode); void rgblight_set(void); -- cgit v1.2.3 From 161bd5596b5d8199f2e56246a27ccbdb8c80bb36 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 18 Nov 2016 22:22:24 -0500 Subject: midi back and forth --- keyboards/ergodox/keymaps/jack/keymap.c | 7 +++- tmk_core/protocol/lufa/lufa.c | 62 ++++++++++++++++++++++++--------- tmk_core/protocol/lufa/lufa.h | 1 + 3 files changed, 52 insertions(+), 18 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c index 8721b9644..eb41f1212 100644 --- a/keyboards/ergodox/keymaps/jack/keymap.c +++ b/keyboards/ergodox/keymaps/jack/keymap.c @@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MO(1), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, RGB_TOG, RGB_HUI, RGB_MOD, - KC_PGDN, KC_SPC,KC_SPC + M(2), KC_SPC,KC_SPC ), [SYMB] = KEYMAP( // left hand @@ -89,6 +89,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) eeconfig_init(); } break; + case 2: + if (record->event.pressed) { // For resetting EEPROM + send_unicode_midi(0x0CA0); + } + break; } return MACRO_NONE; }; diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 7eb9be601..ae9cc2f96 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -1161,7 +1161,7 @@ void sysex_callback(MidiDevice * device, // send_byte(*data); midi_buffer[start + place] = *data; if (*data == 0xF7) - sysex_buffer_callback(start + place, &midi_buffer); + sysex_buffer_callback(device, start + place, &midi_buffer); // SEND_STRING(" "); data++; } @@ -1169,7 +1169,24 @@ void sysex_callback(MidiDevice * device, } -void sysex_buffer_callback(uint8_t length, uint8_t * data) { +uint32_t decode_4byte_chunk(uint8_t * data) { + uint32_t part1 = *data++; + uint32_t part2 = *data++; + uint32_t part3 = *data++; + uint32_t part4 = *data++; + uint32_t part5 = *data++; + return ((part1 & 0x1FUL) << 28) | (part2 << 21) | (part3 << 14) | (part4 << 7) | part5; +} + +void encode_4byte_chunk(uint32_t data, uint8_t * pointer) { + *pointer++ = (data >> 28) & 0x7F; + *pointer++ = (data >> 21) & 0x7F; + *pointer++ = (data >> 14) & 0x7F; + *pointer++ = (data >> 7) & 0x7F; + *pointer++ = (data) & 0x7F; +} + +void sysex_buffer_callback(MidiDevice * device, uint8_t length, uint8_t * data) { uint8_t * pointer_copy = data; if (*data++ != 0xF0) @@ -1180,28 +1197,31 @@ void sysex_buffer_callback(uint8_t length, uint8_t * data) { data++; switch (*data++) { + case 0x13: ; // Get info from keyboard + switch (*data++) { + case 0x00: ; // Get layer state + // send_dword(layer_state); + uint8_t chunk[5]; + encode_4byte_chunk(layer_state | default_layer_state, &chunk); + + uint8_t array[] = {0xF0, 0x00, 0x00, 0x00, 0x00, chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], 0xF7}; + midi_send_array(&midi_device, 11, &array); + // midi_send_data(device, 3, 0x00, layer_state >> 24 & 0x7f, layer_state >> 16 & 0x7f); + // midi_send_data(device, 6, layer_state >> 8 & 0x7f, layer_state & 0x7f, 0xF7); + break; + } + #ifdef RGBLIGHT_ENABLE case 0x27: ; // RGB LED functions - switch (*data++) + switch (*data++) { case 0x00: ; // Update HSV - uint32_t part1 = *data++; - uint32_t part2 = *data++; - uint32_t part3 = *data++; - uint32_t part4 = *data++; - uint32_t part5 = *data++; - uint32_t chunk = ((part1 & 0x1FUL) << 28) | (part2 << 21) | (part3 << 14) | (part4 << 7) | part5; - // SEND_STRING("\nCHUNK: "); - // send_dword(chunk); + uint32_t chunk = decode_4byte_chunk(data); rgblight_sethsv(((chunk >> 16) & 0xFFFF) % 360, (chunk >> 8) & 0xFF, chunk & 0xFF); - // SEND_STRING("\nHUE: "); - // send_word(((chunk >> 16) & 0xFFFF) % 360); - // SEND_STRING("\nSAT: "); - // send_word((chunk >> 8) & 0xFF); - // SEND_STRING("\nVAL: "); - // send_word(chunk & 0xFF); break; case 0x01: ; // Update RGB break; + } break; + #endif } // SEND_STRING("\nDATA:\n"); @@ -1212,4 +1232,12 @@ void sysex_buffer_callback(uint8_t length, uint8_t * data) { } +void send_unicode_midi(uint32_t unicode) { + uint8_t chunk[5]; + encode_4byte_chunk(unicode, &chunk); + + uint8_t array[] = {0xF0, 0x00, 0x00, 0x00, 0x05, chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], 0xF7}; + midi_send_array(&midi_device, 11, &array); +} + #endif diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index aad08d640..3fec797b6 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h @@ -70,6 +70,7 @@ typedef struct { #ifdef MIDI_ENABLE void MIDI_Task(void); MidiDevice midi_device; +void send_unicode_midi(uint32_t unicode); #endif // #if LUFA_VERSION_INTEGER < 0x120730 -- cgit v1.2.3 From 7f5e71d79fb5ca70139c42b83c158738217c1c8a Mon Sep 17 00:00:00 2001 From: samgalson@gmail.com Date: Sat, 19 Nov 2016 14:21:12 +0000 Subject: adds galson keymap --- keyboards/ergodox/keymaps/galson/Makefile | 2 + keyboards/ergodox/keymaps/galson/keymap.c | 183 +++++++++++++++++++++++++++++ keyboards/ergodox/keymaps/galson/readme.md | 11 ++ 3 files changed, 196 insertions(+) create mode 100644 keyboards/ergodox/keymaps/galson/Makefile create mode 100644 keyboards/ergodox/keymaps/galson/keymap.c create mode 100644 keyboards/ergodox/keymaps/galson/readme.md (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/galson/Makefile b/keyboards/ergodox/keymaps/galson/Makefile new file mode 100644 index 000000000..f008f5079 --- /dev/null +++ b/keyboards/ergodox/keymaps/galson/Makefile @@ -0,0 +1,2 @@ +COMMAND_ENABLE = no # Commands for debug and configuration + diff --git a/keyboards/ergodox/keymaps/galson/keymap.c b/keyboards/ergodox/keymaps/galson/keymap.c new file mode 100644 index 000000000..0d3e7560d --- /dev/null +++ b/keyboards/ergodox/keymaps/galson/keymap.c @@ -0,0 +1,183 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | + | 1 | 2 | 3 | 4 | 5 | rclk | | lclk | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | = | Q | W | E | R |cmd/T |shift | |shift |cmd/Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| + * | " | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | + * |--------+------+------+------+------+------| ctrl | | ctrl |------+------+------+------+------+--------| + * | { | Z | X | C | V | B | [ | | ] | N | M | , | . | / | } | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | _ | ` | $ | Left | Right| | Up | Down | : | * | ! | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | < | | | | & | > | + * ,------|------|------| |------+--------+------. + * | | | # | | @ | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | % | | ESC | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_PLUS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_BTN2, + KC_EQL, KC_Q, KC_W, KC_E, KC_R, GUI_T(KC_T), KC_LSPO, + KC_DQUO, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LCBR, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_LBRC), + KC_UNDS, KC_GRV, KC_DLR, KC_LEFT,KC_RGHT, + KC_LABK, KC_PIPE, + KC_HASH, + KC_SPC, KC_BSPC,KC_PERC, + // right hand + KC_BTN1, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_RSPC, GUI_T(KC_Y), KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_QUOT, + CTL_T(KC_RBRC), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RCBR, + KC_UP, KC_DOWN,KC_COLN,KC_ASTR, KC_EXLM, + KC_AMPR, KC_RABK, + KC_AT, + KC_ESC, KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/galson/readme.md b/keyboards/ergodox/keymaps/galson/readme.md new file mode 100644 index 000000000..ebc916725 --- /dev/null +++ b/keyboards/ergodox/keymaps/galson/readme.md @@ -0,0 +1,11 @@ +# Galson keymap + + +Sep 26, 2016. + +This is an ergonomic layout for programming for those with typing-related injuries. Key features: + +- As many symbol keys as possible are accessible without shifting. These should be accessed by moving the entire hand and pressing with a strong finger. +- Arrow keys and left and right mouse clicks for mouse-free navigation when combined with head mouse or eyetracker. +- Modifier keys are dual role and relocated to positions convenient for the index finger. +- Positions are more convenient when the keyboard is vertically mounted (as it should be!) \ No newline at end of file -- cgit v1.2.3 From c86bbf474e7709749dfd5e09fa5defd5e6baaaa3 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 20 Nov 2016 19:28:10 +0200 Subject: Always initialze the Infinity Ergodox backlight Otherwise it will stay lit. The set_led functionality is also disabled since it doesn't work properly for slaves. --- keyboards/ergodox/infinity/infinity.c | 6 ++++-- keyboards/ergodox/infinity/led.c | 25 +------------------------ 2 files changed, 5 insertions(+), 26 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c index c5793385f..02db67eaf 100644 --- a/keyboards/ergodox/infinity/infinity.c +++ b/keyboards/ergodox/infinity/infinity.c @@ -38,7 +38,6 @@ void init_serial_link_hal(void) { // Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced // Which will reduce the brightness range #define PRESCALAR_DEFINE 0 -#ifdef VISUALIZER_ENABLE void lcd_backlight_hal_init(void) { // Setup Backlight SIM->SCGC6 |= SIM_SCGC6_FTM0; @@ -76,7 +75,6 @@ void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { CHANNEL_GREEN.CnV = g; CHANNEL_BLUE.CnV = b; } -#endif __attribute__ ((weak)) void matrix_init_user(void) { @@ -92,6 +90,10 @@ void matrix_init_kb(void) { // runs once when the firmware starts up matrix_init_user(); + // The backlight always has to be initialized, otherwise it will stay lit +#ifndef VISUALIZER_ENABLE + lcd_backlight_hal_init(); +#endif } void matrix_scan_kb(void) { diff --git a/keyboards/ergodox/infinity/led.c b/keyboards/ergodox/infinity/led.c index 77195bb35..8175c1c5c 100644 --- a/keyboards/ergodox/infinity/led.c +++ b/keyboards/ergodox/infinity/led.c @@ -21,29 +21,6 @@ along with this program. If not, see . void led_set(uint8_t usb_led) { -// The LCD backlight functionality conflicts with this simple -// red backlight -#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE) - // PTC1: LCD Backlight Red(0:on/1:off) - GPIOC->PDDR |= (1<<1); - PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - if (usb_led & (1<PCOR |= (1<<1); - } else { - GPIOC->PSOR |= (1<<1); - } -#elif !defined(LCD_BACKLIGHT_ENABLE) + //TODO: Add led emulation if there's no customized visualization (void)usb_led; - GPIOC->PDDR |= (1<<1); - PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - GPIOC->PSOR |= (1<<1); - GPIOC->PDDR |= (1<<2); - PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - GPIOC->PSOR |= (1<<2); - GPIOC->PDDR |= (1<<3); - PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - GPIOC->PSOR |= (1<<3); -#else - (void)usb_led; -#endif } -- cgit v1.2.3 From 6f24344be78985be5eb2f6e75f1dee546f539646 Mon Sep 17 00:00:00 2001 From: Didier Chagniot Date: Sun, 20 Nov 2016 20:51:05 +0100 Subject: typo fix --- keyboards/ergodox/keymaps/dvorak_emacs/keymap.c | 2 +- keyboards/ergodox/keymaps/dvorak_emacs/readme.md | 36 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c b/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c index 4cb11a56f..d33c6e527 100755 --- a/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c +++ b/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Base layer * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively * - * ,--------------------------------------------------. ,--------------------------------------------------. + * ,--------------------------------------------------. ,--------------------------------------------------. * | | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = / + | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | ~ |" / ' |, / < |. / > | P | Y | [ | | ] | F | G | C | H | L | / / ? | diff --git a/keyboards/ergodox/keymaps/dvorak_emacs/readme.md b/keyboards/ergodox/keymaps/dvorak_emacs/readme.md index 0578f1e25..a3fc34afe 100644 --- a/keyboards/ergodox/keymaps/dvorak_emacs/readme.md +++ b/keyboards/ergodox/keymaps/dvorak_emacs/readme.md @@ -1,6 +1,6 @@ # Ergodox Dvorak Layout with emacs binding in mind * Control & Alt key on the thumbs (activated if pressed with another key). - * In the same way, "I" and "R" are the shift modifier if pressed with another key. + * In the same way, "U" and "R" are the shift modifier if pressed with another key. * "I" and "D" set the layer 1 for the auxiliary keys if pressed with another key. * Software layout set to english. @@ -15,23 +15,23 @@ Keys with double values (like U/LSft) correspond to the 'tapped' key and the 'he

 
 ,--------------------------------------------------.           ,--------------------------------------------------.
- |        |   1  |   2  |   3  |   4  |   5  |  Esc |           |  Esc |   6  |   7  |   8  |   9  |   0  |   =    |
- |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
- |   ~    |  '   |   ,  |   .  |   P  |   Y  |   [  |           |   ]  |   F  |   G  |   C  |   H  |   L  |   /    |
- |--------+------+------+------+------+------|   {  |           |   }  |------+------+------+------+------+--------|
- |  Tab   |   A  |   O  |   E  |U/LSft| I/L1 |------|           |------|  D/L1|R/RSft|   T  |   N  |   S  |   -    |
- |--------+------+------+------+------+------| LGUI |           | LGUI |------+------+------+------+------+--------|
- | {/LSft |   ;  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | }/RSft |
- `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
-   |      |      |      |      | ~L1  |                                       | ~L1  |      |      |   \  |        |
-   `----------------------------------'                                       `----------------------------------'
-                                        ,-------------.       ,-------------.
-                                        | HOME |  END |       | LEFT | RIGHT|
-                                 ,------|------|------|       |------+--------+------.
-                                 | BSPC |  DEL | PGUP |       |  UP  | SPACE  |RETURN|
-                                 |  /   |  /   |------|       |------|   /    |  /   |
-                                 | LCTL | LALT |PGDWN |       | DOWN | LALT   | LCTL |
-                                 `--------------------'       `----------------------'
+|        |   1  |   2  |   3  |   4  |   5  |  Esc |           |  Esc |   6  |   7  |   8  |   9  |   0  |   =    |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+|   ~    |  '   |   ,  |   .  |   P  |   Y  |   [  |           |   ]  |   F  |   G  |   C  |   H  |   L  |   /    |
+|--------+------+------+------+------+------|   {  |           |   }  |------+------+------+------+------+--------|
+|  Tab   |   A  |   O  |   E  |U/LSft| I/L1 |------|           |------|  D/L1|R/RSft|   T  |   N  |   S  |   -    |
+|--------+------+------+------+------+------| LGUI |           | LGUI |------+------+------+------+------+--------|
+| {/LSft |   ;  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | }/RSft |
+`--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+  |      |      |      |      | ~L1  |                                       | ~L1  |      |      |   \  |      |
+  `----------------------------------'                                       `----------------------------------'
+                                       ,-------------.       ,-------------.
+                                       | HOME |  END |       | LEFT | RIGHT|
+                                ,------|------|------|       |------+--------+------.
+                                | BSPC |  DEL | PGUP |       |  UP  | SPACE  |RETURN|
+                                |  /   |  /   |------|       |------|   /    |  /   |
+                                | LCTL | LALT |PGDWN |       | DOWN | LALT   | LCTL |
+                                `--------------------'       `----------------------'
 
 
-- cgit v1.2.3 From 06a2677b7eedbf58532fa1a673ba1277e756174d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 21 Nov 2016 20:17:32 -0500 Subject: fix infinity --- keyboards/ergodox/config.h | 2 -- keyboards/ergodox/ez/config.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h index 049c707a5..edc60caae 100644 --- a/keyboards/ergodox/config.h +++ b/keyboards/ergodox/config.h @@ -1,8 +1,6 @@ #ifndef KEYBOARDS_ERGODOX_CONFIG_H_ #define KEYBOARDS_ERGODOX_CONFIG_H_ -#include "config_common.h" - #define MOUSEKEY_DELAY 100 #define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_MAX_SPEED 3 diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 084a044ee..67a856e51 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -21,6 +21,8 @@ along with this program. If not, see . #include "../config.h" +#include "config_common.h" + /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x1307 -- cgit v1.2.3 From cefa8468fb5f28bd67a0c02d371a4aef0964e20c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 23 Nov 2016 20:16:38 -0500 Subject: travis pls --- keyboards/ergodox/infinity/rules.mk | 2 ++ keyboards/ergodox/keymaps/jack/Makefile | 4 +-- quantum/quantum.c | 9 ++++-- quantum/quantum.h | 2 ++ tmk_core/protocol/lufa/lufa.c | 49 ++------------------------------- tmk_core/protocol/lufa/lufa.h | 42 +++++++++++++++++++++++++++- 6 files changed, 56 insertions(+), 52 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk index ccb735a48..473a6dfec 100644 --- a/keyboards/ergodox/infinity/rules.mk +++ b/keyboards/ergodox/infinity/rules.mk @@ -63,6 +63,8 @@ VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile LCD_ENABLE ?= yes LED_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes +MIDI_ENABLE = no +RGBLIGHT_ENABLE = no ifndef QUANTUM_DIR include ../../../Makefile diff --git a/keyboards/ergodox/keymaps/jack/Makefile b/keyboards/ergodox/keymaps/jack/Makefile index 7c257af50..3ca69bb92 100644 --- a/keyboards/ergodox/keymaps/jack/Makefile +++ b/keyboards/ergodox/keymaps/jack/Makefile @@ -1,5 +1,5 @@ -RGBLIGHT_ENABLE = yes -MIDI_ENABLE = yes +RGBLIGHT_ENABLE ?= yes +MIDI_ENABLE ?= yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/quantum/quantum.c b/quantum/quantum.c index f9f1ef22d..8372a7adc 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -847,8 +847,13 @@ void send_nibble(uint8_t number) { } } - - +void send_unicode_midi(uint32_t unicode) { + #ifdef MIDI_ENABLE + uint8_t chunk[4]; + dword_to_bytes(unicode, chunk); + MT_SEND_DATA(DT_UNICODE, chunk, 5); + #endif +} __attribute__ ((weak)) void led_set_user(uint8_t usb_led) { diff --git a/quantum/quantum.h b/quantum/quantum.h index 3d35f11fa..316da15b9 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -119,4 +119,6 @@ void send_nibble(uint8_t number); void led_set_user(uint8_t usb_led); void led_set_kb(uint8_t usb_led); +void send_unicode_midi(uint32_t unicode); + #endif diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index c3234b8ce..eae3e8f29 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -72,7 +72,7 @@ #include "virtser.h" #endif -#ifdef RGB_MIDI +#if (defined(RGB_MIDI) | defined(RGBLIGHT_ANIMATIONS)) & defined(RGBLIGHT_ENABLE) #include "rgblight.h" #endif @@ -1156,35 +1156,6 @@ uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index) { return ((uint32_t)bytes[index + 0] << 24) | ((uint32_t)bytes[index + 1] << 16) | ((uint32_t)bytes[index + 2] << 8) | (uint32_t)bytes[index + 3]; } -enum MESSAGE_TYPE { - MT_GET_DATA = 0x10, // Get data from keyboard - MT_GET_DATA_ACK = 0x11, // returned data to process (ACK) - MT_SET_DATA = 0x20, // Set data on keyboard - MT_SET_DATA_ACK = 0x21, // returned data to confirm (ACK) - MT_SEND_DATA = 0x30, // Sending data/action from keyboard - MT_SEND_DATA_ACK = 0x31, // returned data/action confirmation (ACK) - MT_EXE_ACTION = 0x40, // executing actions on keyboard - MT_EXE_ACTION_ACK =0x41, // return confirmation/value (ACK) - MT_TYPE_ERROR = 0x80 // type not recofgnised (ACK) -}; - -enum DATA_TYPE { - DT_NONE = 0x00, - DT_HANDSHAKE, - DT_DEFAULT_LAYER, - DT_CURRENT_LAYER, - DT_KEYMAP_OPTIONS, - DT_BACKLIGHT, - DT_RGBLIGHT, - DT_UNICODE, - DT_DEBUG, - DT_AUDIO, - DT_QUANTUM_ACTION, - DT_KEYBOARD_ACTION, - DT_USER_ACTION, - -}; - void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint8_t length) { // SEND_STRING("\nTX: "); // for (uint8_t i = 0; i < length; i++) { @@ -1213,15 +1184,6 @@ void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, // } } -#define MT_GET_DATA(data_type, data, length) send_bytes_sysex(MT_GET_DATA, data_type, data, length) -#define MT_GET_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_GET_DATA_ACK, data_type, data, length) -#define MT_SET_DATA(data_type, data, length) send_bytes_sysex(MT_SET_DATA, data_type, data, length) -#define MT_SET_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_SET_DATA_ACK, data_type, data, length) -#define MT_SEND_DATA(data_type, data, length) send_bytes_sysex(MT_SEND_DATA, data_type, data, length) -#define MT_SEND_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_SEND_DATA_ACK, data_type, data, length) -#define MT_EXE_ACTION(data_type, data, length) send_bytes_sysex(MT_EXE_ACTION, data_type, data, length) -#define MT_EXE_ACTION_ACK(data_type, data, length) send_bytes_sysex(MT_EXE_ACTION_ACK, data_type, data, length) - __attribute__ ((weak)) bool sysex_process_quantum(uint8_t length, uint8_t * data) { return sysex_process_keyboard(length, data); @@ -1312,7 +1274,7 @@ void sysex_buffer_callback(MidiDevice * device, uint8_t length, uint8_t * data) dword_to_bytes(eeconfig_read_rgblight(), rgblight_bytes); MT_GET_DATA_ACK(DT_RGBLIGHT, rgblight_bytes, 4); #else - MT_GET_DATA_ACK(DT_RGBLIGHT, NULL, 0) + MT_GET_DATA_ACK(DT_RGBLIGHT, NULL, 0); #endif break; } @@ -1360,11 +1322,4 @@ void sysex_buffer_callback(MidiDevice * device, uint8_t length, uint8_t * data) } -void send_unicode_midi(uint32_t unicode) { - uint8_t chunk[4]; - dword_to_bytes(unicode, chunk); - MT_SEND_DATA(DT_UNICODE, chunk, 5); -} - - #endif diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index 99b089f42..0962dda8d 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h @@ -74,8 +74,9 @@ typedef struct { void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data); void sysex_buffer_callback(MidiDevice * device, uint8_t length, uint8_t * data); - void send_unicode_midi(uint32_t unicode); void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint8_t length); + void dword_to_bytes(uint32_t dword, uint8_t * bytes); + uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index); __attribute__ ((weak)) bool sysex_process_quantum(uint8_t length, uint8_t * data); @@ -86,6 +87,45 @@ typedef struct { __attribute__ ((weak)) bool sysex_process_user(uint8_t length, uint8_t * data); + enum MESSAGE_TYPE { + MT_GET_DATA = 0x10, // Get data from keyboard + MT_GET_DATA_ACK = 0x11, // returned data to process (ACK) + MT_SET_DATA = 0x20, // Set data on keyboard + MT_SET_DATA_ACK = 0x21, // returned data to confirm (ACK) + MT_SEND_DATA = 0x30, // Sending data/action from keyboard + MT_SEND_DATA_ACK = 0x31, // returned data/action confirmation (ACK) + MT_EXE_ACTION = 0x40, // executing actions on keyboard + MT_EXE_ACTION_ACK =0x41, // return confirmation/value (ACK) + MT_TYPE_ERROR = 0x80 // type not recofgnised (ACK) + }; + + enum DATA_TYPE { + DT_NONE = 0x00, + DT_HANDSHAKE, + DT_DEFAULT_LAYER, + DT_CURRENT_LAYER, + DT_KEYMAP_OPTIONS, + DT_BACKLIGHT, + DT_RGBLIGHT, + DT_UNICODE, + DT_DEBUG, + DT_AUDIO, + DT_QUANTUM_ACTION, + DT_KEYBOARD_ACTION, + DT_USER_ACTION, + + }; + + + #define MT_GET_DATA(data_type, data, length) send_bytes_sysex(MT_GET_DATA, data_type, data, length) + #define MT_GET_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_GET_DATA_ACK, data_type, data, length) + #define MT_SET_DATA(data_type, data, length) send_bytes_sysex(MT_SET_DATA, data_type, data, length) + #define MT_SET_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_SET_DATA_ACK, data_type, data, length) + #define MT_SEND_DATA(data_type, data, length) send_bytes_sysex(MT_SEND_DATA, data_type, data, length) + #define MT_SEND_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_SEND_DATA_ACK, data_type, data, length) + #define MT_EXE_ACTION(data_type, data, length) send_bytes_sysex(MT_EXE_ACTION, data_type, data, length) + #define MT_EXE_ACTION_ACK(data_type, data, length) send_bytes_sysex(MT_EXE_ACTION_ACK, data_type, data, length) + #endif // #if LUFA_VERSION_INTEGER < 0x120730 -- cgit v1.2.3 From f25596b8dc2f15f620c07164d871023d9284618c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 23 Nov 2016 21:28:12 -0500 Subject: rgblight fixes --- keyboards/ergodox/keymaps/erez_experimental/Makefile | 4 ++-- keyboards/ergodox/keymaps/erez_experimental/keymap.c | 8 +++++--- tmk_core/protocol/lufa/lufa.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/erez_experimental/Makefile b/keyboards/ergodox/keymaps/erez_experimental/Makefile index dbe89d141..51a0c74c5 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/Makefile +++ b/keyboards/ergodox/keymaps/erez_experimental/Makefile @@ -3,8 +3,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend COMMAND_ENABLE = no # Commands for debug and configuration -RGBLIGHT_ENABLE = yes -MIDI_ENABLE = yes +RGBLIGHT_ENABLE ?= yes +MIDI_ENABLE ?= yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c index 4a23c7ac5..0c0e3c4e3 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c @@ -164,9 +164,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // dynamically generate these. case RGB_FF00BB: if (record->event.pressed) { - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0xff,0x00,0xbb); + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0xff,0x00,0xbb); + #endif } return false; break; diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index eae3e8f29..aa2e781c8 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -1055,7 +1055,7 @@ int main(void) // MIDI_Task(); #endif -#ifdef RGBLIGHT_ANIMATIONS +#if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE) rgblight_task(); #endif -- cgit v1.2.3 From 7edac212c8ed8442bf4207e70dc8194631b2bf27 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 26 Nov 2016 15:37:46 -0500 Subject: separated into api files/folder --- build_keyboard.mk | 8 ++ common.mk | 1 + keyboards/ergodox/keymaps/jack/keymap.c | 2 +- keyboards/ergodox/rules.mk | 1 - keyboards/planck/rules.mk | 1 + keyboards/preonic/keymaps/default/Makefile | 22 ---- keyboards/preonic/rules.mk | 3 +- quantum/api.c | 178 +++++++++++++++++++++++++ quantum/api.h | 59 +++++++++ quantum/api/api_sysex.c | 29 +++++ quantum/api/api_sysex.h | 10 ++ quantum/quantum.c | 6 +- quantum/quantum.h | 2 +- tmk_core/protocol/lufa/lufa.c | 203 +---------------------------- tmk_core/protocol/lufa/lufa.h | 61 +-------- 15 files changed, 303 insertions(+), 283 deletions(-) create mode 100644 quantum/api.c create mode 100644 quantum/api.h create mode 100644 quantum/api/api_sysex.c create mode 100644 quantum/api/api_sysex.h (limited to 'keyboards/ergodox') diff --git a/build_keyboard.mk b/build_keyboard.mk index 42f8f8ac7..c1e554003 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -131,6 +131,14 @@ ifndef CUSTOM_MATRIX SRC += $(QUANTUM_DIR)/matrix.c endif +ifeq ($(strip $(API_SYSEX_ENABLE)), yes) + OPT_DEFS += -DAPI_SYSEX_ENABLE + SRC += $(QUANTUM_DIR)/api/api_sysex.c + OPT_DEFS += -DAPI_ENABLE + SRC += $(QUANTUM_DIR)/api.c + MIDI_ENABLE=yes +endif + ifeq ($(strip $(MIDI_ENABLE)), yes) OPT_DEFS += -DMIDI_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c diff --git a/common.mk b/common.mk index 18751cd5a..c4b9394a2 100644 --- a/common.mk +++ b/common.mk @@ -23,4 +23,5 @@ COMMON_VPATH += $(QUANTUM_PATH) COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras COMMON_VPATH += $(QUANTUM_PATH)/audio COMMON_VPATH += $(QUANTUM_PATH)/process_keycode +COMMON_VPATH += $(QUANTUM_PATH)/api COMMON_VPATH += $(SERIAL_PATH) \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c index eb41f1212..9cb80c59d 100644 --- a/keyboards/ergodox/keymaps/jack/keymap.c +++ b/keyboards/ergodox/keymaps/jack/keymap.c @@ -91,7 +91,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case 2: if (record->event.pressed) { // For resetting EEPROM - send_unicode_midi(0x0CA0); + api_send_unicode(0x0CA0); } break; } diff --git a/keyboards/ergodox/rules.mk b/keyboards/ergodox/rules.mk index add64ec76..2e501e81b 100644 --- a/keyboards/ergodox/rules.mk +++ b/keyboards/ergodox/rules.mk @@ -24,6 +24,5 @@ COMMAND_ENABLE ?= yes # Commands for debug and configuration CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -MIDI_ENABLE ?= no # MIDI controls UNICODE_ENABLE ?= yes # Unicode ONEHAND_ENABLE ?= yes # Allow swapping hands of keyboard diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk index 25db53a31..ccee97271 100644 --- a/keyboards/planck/rules.mk +++ b/keyboards/planck/rules.mk @@ -62,6 +62,7 @@ AUDIO_ENABLE ?= no # Audio output on port C6 UNICODE_ENABLE ?= no # Unicode BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +API_SYSEX_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/preonic/keymaps/default/Makefile b/keyboards/preonic/keymaps/default/Makefile index 581e08cd0..3d4659ceb 100644 --- a/keyboards/preonic/keymaps/default/Makefile +++ b/keyboards/preonic/keymaps/default/Makefile @@ -1,25 +1,3 @@ - - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - ifndef QUANTUM_DIR include ../../../../Makefile endif \ No newline at end of file diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk index d0f3a3a1c..c4ce2aacc 100644 --- a/keyboards/preonic/rules.mk +++ b/keyboards/preonic/rules.mk @@ -53,7 +53,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) CONSOLE_ENABLE ?= no # Console for debug(+400) COMMAND_ENABLE ?= yes # Commands for debug and configuration @@ -64,6 +64,7 @@ AUDIO_ENABLE ?= no # Audio output on port C6 UNICODE_ENABLE ?= no # Unicode BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +API_SYSEX_ENABLE ?= yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/quantum/api.c b/quantum/api.c new file mode 100644 index 000000000..4ca3b9676 --- /dev/null +++ b/quantum/api.c @@ -0,0 +1,178 @@ +#include "api.h" +#include "quantum.h" + +void dword_to_bytes(uint32_t dword, uint8_t * bytes) { + bytes[0] = (dword >> 24) & 0xFF; + bytes[1] = (dword >> 16) & 0xFF; + bytes[2] = (dword >> 8) & 0xFF; + bytes[3] = (dword >> 0) & 0xFF; +} + +uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index) { + return ((uint32_t)bytes[index + 0] << 24) | ((uint32_t)bytes[index + 1] << 16) | ((uint32_t)bytes[index + 2] << 8) | (uint32_t)bytes[index + 3]; +} + +__attribute__ ((weak)) +bool process_api_quantum(uint8_t length, uint8_t * data) { + return process_api_keyboard(length, data); +} + +__attribute__ ((weak)) +bool process_api_keyboard(uint8_t length, uint8_t * data) { + return process_api_user(length, data); +} + +__attribute__ ((weak)) +bool process_api_user(uint8_t length, uint8_t * data) { + return true; +} + +void process_api(uint16_t length, uint8_t * data) { + // SEND_STRING("\nRX: "); + // for (uint8_t i = 0; i < length; i++) { + // send_byte(data[i]); + // SEND_STRING(" "); + // } + if (!process_api_quantum(length, data)) + return; + + switch (data[0]) { + case MT_SET_DATA: + switch (data[1]) { + case DT_DEFAULT_LAYER: { + eeconfig_update_default_layer(data[2]); + default_layer_set((uint32_t)(data[2])); + break; + } + case DT_KEYMAP_OPTIONS: { + eeconfig_update_keymap(data[2]); + break; + } + case DT_RGBLIGHT: { + #ifdef RGBLIGHT_ENABLE + uint32_t rgblight = bytes_to_dword(data, 2); + rgblight_update_dword(rgblight); + #endif + break; + } + } + case MT_GET_DATA: + switch (data[1]) { + case DT_HANDSHAKE: { + MT_GET_DATA_ACK(DT_HANDSHAKE, NULL, 0); + break; + } + case DT_DEBUG: { + uint8_t debug_bytes[1] = { eeprom_read_byte(EECONFIG_DEBUG) }; + MT_GET_DATA_ACK(DT_DEBUG, debug_bytes, 1); + break; + } + case DT_DEFAULT_LAYER: { + uint8_t default_bytes[1] = { eeprom_read_byte(EECONFIG_DEFAULT_LAYER) }; + MT_GET_DATA_ACK(DT_DEFAULT_LAYER, default_bytes, 1); + break; + } + case DT_CURRENT_LAYER: { + uint8_t layer_state_bytes[4]; + dword_to_bytes(layer_state, layer_state_bytes); + MT_GET_DATA_ACK(DT_CURRENT_LAYER, layer_state_bytes, 4); + break; + } + case DT_AUDIO: { + #ifdef AUDIO_ENABLE + uint8_t audio_bytes[1] = { eeprom_read_byte(EECONFIG_AUDIO) }; + MT_GET_DATA_ACK(DT_AUDIO, audio_bytes, 1); + #else + MT_GET_DATA_ACK(DT_AUDIO, NULL, 0); + #endif + break; + } + case DT_BACKLIGHT: { + #ifdef BACKLIGHT_ENABLE + uint8_t backlight_bytes[1] = { eeprom_read_byte(EECONFIG_BACKLIGHT) }; + MT_GET_DATA_ACK(DT_BACKLIGHT, backlight_bytes, 1); + #else + MT_GET_DATA_ACK(DT_BACKLIGHT, NULL, 0); + #endif + break; + } + case DT_RGBLIGHT: { + #ifdef RGBLIGHT_ENABLE + uint8_t rgblight_bytes[4]; + dword_to_bytes(eeconfig_read_rgblight(), rgblight_bytes); + MT_GET_DATA_ACK(DT_RGBLIGHT, rgblight_bytes, 4); + #else + MT_GET_DATA_ACK(DT_RGBLIGHT, NULL, 0); + #endif + break; + } + case DT_KEYMAP_OPTIONS: { + uint8_t keymap_bytes[1] = { eeconfig_read_keymap() }; + MT_GET_DATA_ACK(DT_KEYMAP_OPTIONS, keymap_bytes, 1); + break; + } + case DT_KEYMAP_SIZE: { + uint8_t keymap_size[2] = {MATRIX_ROWS, MATRIX_COLS}; + MT_GET_DATA_ACK(DT_KEYMAP_SIZE, keymap_size, 2); + break; + } + case DT_KEYMAP: { + uint8_t keymap_data[MATRIX_ROWS * MATRIX_COLS * 4 + 3]; + keymap_data[0] = data[2]; + keymap_data[1] = MATRIX_ROWS; + keymap_data[2] = MATRIX_COLS; + for (int i = 0; i < MATRIX_ROWS; i++) { + for (int j = 0; j < MATRIX_COLS; j++) { + keymap_data[3 + (i*MATRIX_COLS*2) + (j*2)] = pgm_read_word(&keymaps[data[2]][i][j]) >> 8; + keymap_data[3 + (i*MATRIX_COLS*2) + (j*2) + 1] = pgm_read_word(&keymaps[data[2]][i][j]) & 0xFF; + } + } + MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, MATRIX_ROWS * MATRIX_COLS * 4 + 3); + // uint8_t keymap_data[5]; + // keymap_data[0] = data[2]; + // keymap_data[1] = data[3]; + // keymap_data[2] = data[4]; + // keymap_data[3] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) >> 8; + // keymap_data[4] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) & 0xFF; + + // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, 5); + break; + } + default: + break; + } + break; + case MT_SET_DATA_ACK: + case MT_GET_DATA_ACK: + break; + case MT_SEND_DATA: + break; + case MT_SEND_DATA_ACK: + break; + case MT_EXE_ACTION: + break; + case MT_EXE_ACTION_ACK: + break; + case MT_TYPE_ERROR: + break; + default: ; // command not recognised + SEND_BYTES(MT_TYPE_ERROR, DT_NONE, data, length); + break; + + // #ifdef RGBLIGHT_ENABLE + // case 0x27: ; // RGB LED functions + // switch (*data++) { + // case 0x00: ; // Update HSV + // rgblight_sethsv((data[0] << 8 | data[1]) % 360, data[2], data[3]); + // break; + // case 0x01: ; // Update RGB + // break; + // case 0x02: ; // Update mode + // rgblight_mode(data[0]); + // break; + // } + // break; + // #endif + } + +} \ No newline at end of file diff --git a/quantum/api.h b/quantum/api.h new file mode 100644 index 000000000..00dcdb895 --- /dev/null +++ b/quantum/api.h @@ -0,0 +1,59 @@ +#ifndef _API_H_ +#define _API_H_ + +#include "lufa.h" + +enum MESSAGE_TYPE { + MT_GET_DATA = 0x10, // Get data from keyboard + MT_GET_DATA_ACK = 0x11, // returned data to process (ACK) + MT_SET_DATA = 0x20, // Set data on keyboard + MT_SET_DATA_ACK = 0x21, // returned data to confirm (ACK) + MT_SEND_DATA = 0x30, // Sending data/action from keyboard + MT_SEND_DATA_ACK = 0x31, // returned data/action confirmation (ACK) + MT_EXE_ACTION = 0x40, // executing actions on keyboard + MT_EXE_ACTION_ACK =0x41, // return confirmation/value (ACK) + MT_TYPE_ERROR = 0x80 // type not recofgnised (ACK) +}; + +enum DATA_TYPE { + DT_NONE = 0x00, + DT_HANDSHAKE, + DT_DEFAULT_LAYER, + DT_CURRENT_LAYER, + DT_KEYMAP_OPTIONS, + DT_BACKLIGHT, + DT_RGBLIGHT, + DT_UNICODE, + DT_DEBUG, + DT_AUDIO, + DT_QUANTUM_ACTION, + DT_KEYBOARD_ACTION, + DT_USER_ACTION, + DT_KEYMAP_SIZE, + DT_KEYMAP +}; + +void dword_to_bytes(uint32_t dword, uint8_t * bytes); +uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index); + +#define MT_GET_DATA(data_type, data, length) SEND_BYTES(MT_GET_DATA, data_type, data, length) +#define MT_GET_DATA_ACK(data_type, data, length) SEND_BYTES(MT_GET_DATA_ACK, data_type, data, length) +#define MT_SET_DATA(data_type, data, length) SEND_BYTES(MT_SET_DATA, data_type, data, length) +#define MT_SET_DATA_ACK(data_type, data, length) SEND_BYTES(MT_SET_DATA_ACK, data_type, data, length) +#define MT_SEND_DATA(data_type, data, length) SEND_BYTES(MT_SEND_DATA, data_type, data, length) +#define MT_SEND_DATA_ACK(data_type, data, length) SEND_BYTES(MT_SEND_DATA_ACK, data_type, data, length) +#define MT_EXE_ACTION(data_type, data, length) SEND_BYTES(MT_EXE_ACTION, data_type, data, length) +#define MT_EXE_ACTION_ACK(data_type, data, length) SEND_BYTES(MT_EXE_ACTION_ACK, data_type, data, length) + +void process_api(uint16_t length, uint8_t * data); + +__attribute__ ((weak)) +bool process_api_quantum(uint8_t length, uint8_t * data); + +__attribute__ ((weak)) +bool process_api_keyboard(uint8_t length, uint8_t * data); + +__attribute__ ((weak)) +bool process_api_user(uint8_t length, uint8_t * data); + +#endif \ No newline at end of file diff --git a/quantum/api/api_sysex.c b/quantum/api/api_sysex.c new file mode 100644 index 000000000..a4a554e76 --- /dev/null +++ b/quantum/api/api_sysex.c @@ -0,0 +1,29 @@ +#include "api_sysex.h" + +void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint16_t length) { + // SEND_STRING("\nTX: "); + // for (uint8_t i = 0; i < length; i++) { + // send_byte(bytes[i]); + // SEND_STRING(" "); + // } + uint8_t * precode = malloc(sizeof(uint8_t) * (length + 2)); + precode[0] = message_type; + precode[1] = data_type; + memcpy(precode + 2, bytes, length); + uint8_t * encoded = malloc(sizeof(uint8_t) * (sysex_encoded_length(length + 2))); + uint16_t encoded_length = sysex_encode(encoded, precode, length + 2); + uint8_t * array = malloc(sizeof(uint8_t) * (encoded_length + 5)); + array[0] = 0xF0; + array[1] = 0x00; + array[2] = 0x00; + array[3] = 0x00; + array[encoded_length + 4] = 0xF7; + memcpy(array + 4, encoded, encoded_length); + midi_send_array(&midi_device, encoded_length + 5, array); + + // SEND_STRING("\nTD: "); + // for (uint8_t i = 0; i < encoded_length + 5; i++) { + // send_byte(array[i]); + // SEND_STRING(" "); + // } +} \ No newline at end of file diff --git a/quantum/api/api_sysex.h b/quantum/api/api_sysex.h new file mode 100644 index 000000000..b947b60e5 --- /dev/null +++ b/quantum/api/api_sysex.h @@ -0,0 +1,10 @@ +#ifndef _API_SYSEX_H_ +#define _API_SYSEX_H_ + +#include "api.h" + +void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint16_t length); + +#define SEND_BYTES(mt, dt, b, l) send_bytes_sysex(mt, dt, b, l) + +#endif \ No newline at end of file diff --git a/quantum/quantum.c b/quantum/quantum.c index 8372a7adc..f653564a6 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -847,12 +847,12 @@ void send_nibble(uint8_t number) { } } -void send_unicode_midi(uint32_t unicode) { - #ifdef MIDI_ENABLE +void api_send_unicode(uint32_t unicode) { +#ifdef API_ENABLE uint8_t chunk[4]; dword_to_bytes(unicode, chunk); MT_SEND_DATA(DT_UNICODE, chunk, 5); - #endif +#endif } __attribute__ ((weak)) diff --git a/quantum/quantum.h b/quantum/quantum.h index 316da15b9..e6adf974a 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -119,6 +119,6 @@ void send_nibble(uint8_t number); void led_set_user(uint8_t usb_led); void led_set_kb(uint8_t usb_led); -void send_unicode_midi(uint32_t unicode); +void api_send_unicode(uint32_t unicode); #endif diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index aa2e781c8..39d4824b6 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -1091,37 +1091,17 @@ void fallthrough_callback(MidiDevice * device, #endif } -#ifdef RGB_MIDI - rgblight_config_t rgblight_config; -#endif void cc_callback(MidiDevice * device, uint8_t chan, uint8_t num, uint8_t val) { //sending it back on the next channel // midi_send_cc(device, (chan + 1) % 16, num, val); - #ifdef RGB_MIDI - rgblight_config.raw = eeconfig_read_rgblight(); - switch (num) { - case 14: - rgblight_config.hue = val * 360 / 127; - break; - case 15: - rgblight_config.sat = val << 1; - break; - case 16: - rgblight_config.val = val << 1; - break; - } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); - #endif } uint8_t midi_buffer[MIDI_SYSEX_BUFFER] = {0}; void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data) { - // for (int i = 0; i < length; i++) - // midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); - // if (start == 0x27) { + #ifdef API_SYSEX_ENABLE // SEND_STRING("\n"); // send_word(start); // SEND_STRING(": "); @@ -1136,190 +1116,13 @@ void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t // } uint8_t * decoded = malloc(sizeof(uint8_t) * (sysex_decoded_length(start + place - 4))); uint16_t decode_length = sysex_decode(decoded, midi_buffer + 4, start + place - 4); - sysex_buffer_callback(device, decode_length, decoded); + process_api(decode_length, decoded); } // SEND_STRING(" "); data++; } - // } - -} - -void dword_to_bytes(uint32_t dword, uint8_t * bytes) { - bytes[0] = (dword >> 24) & 0xFF; - bytes[1] = (dword >> 16) & 0xFF; - bytes[2] = (dword >> 8) & 0xFF; - bytes[3] = (dword >> 0) & 0xFF; -} - -uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index) { - return ((uint32_t)bytes[index + 0] << 24) | ((uint32_t)bytes[index + 1] << 16) | ((uint32_t)bytes[index + 2] << 8) | (uint32_t)bytes[index + 3]; -} - -void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint8_t length) { - // SEND_STRING("\nTX: "); - // for (uint8_t i = 0; i < length; i++) { - // send_byte(bytes[i]); - // SEND_STRING(" "); - // } - uint8_t * precode = malloc(sizeof(uint8_t) * (length + 2)); - precode[0] = message_type; - precode[1] = data_type; - memcpy(precode + 2, bytes, length); - uint8_t * encoded = malloc(sizeof(uint8_t) * (sysex_encoded_length(length + 2))); - uint16_t encoded_length = sysex_encode(encoded, precode, length + 2); - uint8_t * array = malloc(sizeof(uint8_t) * (encoded_length + 5)); - array[0] = 0xF0; - array[1] = 0x00; - array[2] = 0x00; - array[3] = 0x00; - array[encoded_length + 4] = 0xF7; - memcpy(array + 4, encoded, encoded_length); - midi_send_array(&midi_device, encoded_length + 5, array); - - // SEND_STRING("\nTD: "); - // for (uint8_t i = 0; i < encoded_length + 5; i++) { - // send_byte(array[i]); - // SEND_STRING(" "); - // } -} - -__attribute__ ((weak)) -bool sysex_process_quantum(uint8_t length, uint8_t * data) { - return sysex_process_keyboard(length, data); -} - -__attribute__ ((weak)) -bool sysex_process_keyboard(uint8_t length, uint8_t * data) { - return sysex_process_user(length, data); -} - -__attribute__ ((weak)) -bool sysex_process_user(uint8_t length, uint8_t * data) { - return true; + #endif } -void sysex_buffer_callback(MidiDevice * device, uint8_t length, uint8_t * data) { - // SEND_STRING("\nRX: "); - // for (uint8_t i = 0; i < length; i++) { - // send_byte(data[i]); - // SEND_STRING(" "); - // } - if (!sysex_process_quantum(length, data)) - return; - - switch (data[0]) { - case MT_SET_DATA: - switch (data[1]) { - case DT_DEFAULT_LAYER: { - eeconfig_update_default_layer(data[2]); - default_layer_set((uint32_t)(data[2])); - break; - } - case DT_KEYMAP_OPTIONS: { - eeconfig_update_keymap(data[2]); - break; - } - case DT_RGBLIGHT: { - #ifdef RGBLIGHT_ENABLE - uint32_t rgblight = bytes_to_dword(data, 2); - rgblight_update_dword(rgblight); - #endif - break; - } - } - case MT_GET_DATA: - switch (data[1]) { - case DT_HANDSHAKE: { - MT_GET_DATA_ACK(DT_HANDSHAKE, NULL, 0); - break; - } - case DT_DEBUG: { - uint8_t debug_bytes[1] = { eeprom_read_byte(EECONFIG_DEBUG) }; - MT_GET_DATA_ACK(DT_DEBUG, debug_bytes, 1); - break; - } - case DT_DEFAULT_LAYER: { - uint8_t default_bytes[1] = { eeprom_read_byte(EECONFIG_DEFAULT_LAYER) }; - MT_GET_DATA_ACK(DT_DEFAULT_LAYER, default_bytes, 1); - break; - } - case DT_CURRENT_LAYER: { - uint8_t layer_state_bytes[4]; - dword_to_bytes(layer_state, layer_state_bytes); - MT_GET_DATA_ACK(DT_CURRENT_LAYER, layer_state_bytes, 4); - break; - } - case DT_AUDIO: { - #ifdef AUDIO_ENABLE - uint8_t audio_bytes[1] = { eeprom_read_byte(EECONFIG_AUDIO) }; - MT_GET_DATA_ACK(DT_AUDIO, audio_bytes, 1); - #else - MT_GET_DATA_ACK(DT_AUDIO, NULL, 0); - #endif - break; - } - case DT_BACKLIGHT: { - #ifdef BACKLIGHT_ENABLE - uint8_t backlight_bytes[1] = { eeprom_read_byte(EECONFIG_BACKLIGHT) }; - MT_GET_DATA_ACK(DT_BACKLIGHT, backlight_bytes, 1); - #else - MT_GET_DATA_ACK(DT_BACKLIGHT, NULL, 0); - #endif - break; - } - case DT_RGBLIGHT: { - #ifdef RGBLIGHT_ENABLE - uint8_t rgblight_bytes[4]; - dword_to_bytes(eeconfig_read_rgblight(), rgblight_bytes); - MT_GET_DATA_ACK(DT_RGBLIGHT, rgblight_bytes, 4); - #else - MT_GET_DATA_ACK(DT_RGBLIGHT, NULL, 0); - #endif - break; - } - case DT_KEYMAP_OPTIONS: { - uint8_t keymap_bytes[1] = { eeconfig_read_keymap() }; - MT_GET_DATA_ACK(DT_KEYMAP_OPTIONS, keymap_bytes, 1); - break; - } - default: - break; - } - break; - case MT_SET_DATA_ACK: - case MT_GET_DATA_ACK: - break; - case MT_SEND_DATA: - break; - case MT_SEND_DATA_ACK: - break; - case MT_EXE_ACTION: - break; - case MT_EXE_ACTION_ACK: - break; - case MT_TYPE_ERROR: - break; - default: ; // command not recognised - send_bytes_sysex(MT_TYPE_ERROR, DT_NONE, data, length); - break; - - // #ifdef RGBLIGHT_ENABLE - // case 0x27: ; // RGB LED functions - // switch (*data++) { - // case 0x00: ; // Update HSV - // rgblight_sethsv((data[0] << 8 | data[1]) % 360, data[2], data[3]); - // break; - // case 0x01: ; // Update RGB - // break; - // case 0x02: ; // Update mode - // rgblight_mode(data[0]); - // break; - // } - // break; - // #endif - } - -} #endif diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index 0962dda8d..b11854101 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h @@ -68,64 +68,17 @@ typedef struct { } __attribute__ ((packed)) report_extra_t; #ifdef MIDI_ENABLE - #define MIDI_SYSEX_BUFFER 16 void MIDI_Task(void); MidiDevice midi_device; + #define MIDI_SYSEX_BUFFER 32 +#endif - void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data); - void sysex_buffer_callback(MidiDevice * device, uint8_t length, uint8_t * data); - void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint8_t length); - void dword_to_bytes(uint32_t dword, uint8_t * bytes); - uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index); - - __attribute__ ((weak)) - bool sysex_process_quantum(uint8_t length, uint8_t * data); - - __attribute__ ((weak)) - bool sysex_process_keyboard(uint8_t length, uint8_t * data); - - __attribute__ ((weak)) - bool sysex_process_user(uint8_t length, uint8_t * data); - - enum MESSAGE_TYPE { - MT_GET_DATA = 0x10, // Get data from keyboard - MT_GET_DATA_ACK = 0x11, // returned data to process (ACK) - MT_SET_DATA = 0x20, // Set data on keyboard - MT_SET_DATA_ACK = 0x21, // returned data to confirm (ACK) - MT_SEND_DATA = 0x30, // Sending data/action from keyboard - MT_SEND_DATA_ACK = 0x31, // returned data/action confirmation (ACK) - MT_EXE_ACTION = 0x40, // executing actions on keyboard - MT_EXE_ACTION_ACK =0x41, // return confirmation/value (ACK) - MT_TYPE_ERROR = 0x80 // type not recofgnised (ACK) - }; - - enum DATA_TYPE { - DT_NONE = 0x00, - DT_HANDSHAKE, - DT_DEFAULT_LAYER, - DT_CURRENT_LAYER, - DT_KEYMAP_OPTIONS, - DT_BACKLIGHT, - DT_RGBLIGHT, - DT_UNICODE, - DT_DEBUG, - DT_AUDIO, - DT_QUANTUM_ACTION, - DT_KEYBOARD_ACTION, - DT_USER_ACTION, - - }; - - - #define MT_GET_DATA(data_type, data, length) send_bytes_sysex(MT_GET_DATA, data_type, data, length) - #define MT_GET_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_GET_DATA_ACK, data_type, data, length) - #define MT_SET_DATA(data_type, data, length) send_bytes_sysex(MT_SET_DATA, data_type, data, length) - #define MT_SET_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_SET_DATA_ACK, data_type, data, length) - #define MT_SEND_DATA(data_type, data, length) send_bytes_sysex(MT_SEND_DATA, data_type, data, length) - #define MT_SEND_DATA_ACK(data_type, data, length) send_bytes_sysex(MT_SEND_DATA_ACK, data_type, data, length) - #define MT_EXE_ACTION(data_type, data, length) send_bytes_sysex(MT_EXE_ACTION, data_type, data, length) - #define MT_EXE_ACTION_ACK(data_type, data, length) send_bytes_sysex(MT_EXE_ACTION_ACK, data_type, data, length) +#ifdef API_ENABLE + #include "api.h" +#endif +#ifdef API_SYSEX_ENABLE + #include "api_sysex.h" #endif // #if LUFA_VERSION_INTEGER < 0x120730 -- cgit v1.2.3 From e26a80508f2247d27e431a7415df1ff3405f598a Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 28 Nov 2016 11:20:00 +0100 Subject: Reorganize the numeric keypad layer more like a traditional numeric keypad. --- keyboards/ergodox/keymaps/bepo/bepo.png | Bin 80838 -> 80249 bytes keyboards/ergodox/keymaps/bepo/keymap.c | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/bepo/bepo.png b/keyboards/ergodox/keymaps/bepo/bepo.png index bde2e2cfa..54992f5ae 100644 Binary files a/keyboards/ergodox/keymaps/bepo/bepo.png and b/keyboards/ergodox/keymaps/bepo/bepo.png differ diff --git a/keyboards/ergodox/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c index ae8047ab5..c1a8ae21d 100644 --- a/keyboards/ergodox/keymaps/bepo/keymap.c +++ b/keyboards/ergodox/keymaps/bepo/keymap.c @@ -201,18 +201,18 @@ KC_TRNS, KC_TRNS, KC_NO), /* Keymap 5: numeric layer, sends keypad codes * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | + | - | / | * | | + * | | | | | | | | | | | NumLo| / | * | - | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | 7 | 8 | 9 | | | + * | | | | | | | | | | | 7 | 8 | 9 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | 4 | 5 | 6 | | | + * | | | | | | |------| |------| | 4 | 5 | 6 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | | | + * | | | | | | | | | | | 1 | 2 | 3 | Enter| | * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | | | | | | | | | | | | | 0 | 00 | . | | | + * | | | | | | | | | | | | | 0 | 00 | . | Enter| | * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' * | | | | | | | | - * | | |------| |------| | Enter| + * | | |------| |------| | | * | | | | | | | | * `--------------------' `--------------------' */ @@ -227,14 +227,14 @@ KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, // Right hand - KC_NO, KC_NO, KC_KP_PLUS, KC_KP_MINUS, KC_KP_SLASH, KC_KP_ASTERISK, KC_NO, - KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_NO, KC_NO, - KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_NO, KC_NO, - KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_NO, KC_NO, - KC_KP_0, M(KP_00), KC_KP_COMMA, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO, + KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_NO, + KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_NO, + KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_NO, + KC_KP_0, M(KP_00), KC_KP_COMMA, KC_KP_ENTER, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_KP_ENTER) +KC_TRNS, KC_TRNS, KC_TRNS) }; const uint16_t PROGMEM fn_actions[] = { -- cgit v1.2.3 From 3f1fca2eb8078cdfbf576d6d4168de8e6ae1c2f6 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 28 Nov 2016 11:21:23 +0100 Subject: Adjust comment. --- keyboards/ergodox/keymaps/bepo/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/bepo/readme.md b/keyboards/ergodox/keymaps/bepo/readme.md index 207b67571..51a506985 100644 --- a/keyboards/ergodox/keymaps/bepo/readme.md +++ b/keyboards/ergodox/keymaps/bepo/readme.md @@ -23,7 +23,7 @@ La touche "Tab" est placée comme sur la TypeMatrix 2020. Meilleure symétrie et accessibilité que la TypeMatrix 2030 : les touches "W" et "%" ont dû être déplacées du côté gauche en raison du nombre de touches de l'ErgoDox, mais l'auriculaire droit ne gère maintenant que deux colonnes de touches au lieu de trois. La touche "Ê" redevient accessible sur la même rangée que les autres lettres, comme sur un clavier classique en disposition bépo. Les lettres, chiffres et symboles sont tous regroupés sur 4 lignes et 6 colonnes pour chaque main, et la première rangée de lettres à la main gauche conserve une identité visuelle "BÉPO". -Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long). +Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite et d'effectuer des actions souris avec uniquement la main gauche. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long). Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0". -- cgit v1.2.3 From 2d0ada01902a0103dc4f4f54a416f0666c641b5b Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Mon, 28 Nov 2016 07:55:02 -0500 Subject: Pulls LED config into common config for EZ --- keyboards/ergodox/ez/config.h | 11 +++++++++++ keyboards/ergodox/keymaps/erez_experimental/config.h | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 67a856e51..0b7e8b2ee 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -45,6 +45,17 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 +/* ws2812 RGB LED */ +#define RGB_DI_PIN D7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 15 // Number of LEDs +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 255 +#define RGBLIGHT_VAL_STEP 12 + +#define RGB_MIDI +#define RGBW_BB_TWI + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/ergodox/keymaps/erez_experimental/config.h b/keyboards/ergodox/keymaps/erez_experimental/config.h index fbd12ab79..4da18c65a 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/config.h +++ b/keyboards/ergodox/keymaps/erez_experimental/config.h @@ -9,15 +9,5 @@ #undef LEADER_TIMEOUT #define LEADER_TIMEOUT 300 -/* ws2812 RGB LED */ -#define RGB_DI_PIN D7 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 15 // Number of LEDs -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 255 -#define RGBLIGHT_VAL_STEP 12 - -#define RGB_MIDI -#define RGBW_BB_TWI #endif -- cgit v1.2.3 From 9caf866618840ca38f4ceb1166ad679174c752c3 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Mon, 28 Nov 2016 07:59:01 -0500 Subject: Tweaks EZ Makefile --- keyboards/ergodox/ez/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/ez/Makefile b/keyboards/ergodox/ez/Makefile index 191c6bb66..9b6121e2c 100644 --- a/keyboards/ergodox/ez/Makefile +++ b/keyboards/ergodox/ez/Makefile @@ -1,3 +1,8 @@ +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +COMMAND_ENABLE = no # Commands for debug and configuration +RGBLIGHT_ENABLE ?= yes +MIDI_ENABLE ?= yes + ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif \ No newline at end of file +endif -- cgit v1.2.3 From d2b6438e391743544d437ca8c2998de6ab631894 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 28 Nov 2016 14:10:31 +0100 Subject: A little cleanup, add some comments, change others. --- keyboards/ergodox/keymaps/bepo/keymap.c | 42 +++++++++++++-------------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c index c1a8ae21d..8f068e238 100644 --- a/keyboards/ergodox/keymaps/bepo/keymap.c +++ b/keyboards/ergodox/keymaps/bepo/keymap.c @@ -1,19 +1,19 @@ #include "ergodox.h" -#include "debug.h" -#include "action_layer.h" #include "keymap_bepo.h" -#define BASE 0 // default layer -#define QWER 1 // qwerty compat layer -#define SQWER 2 // shifted qwerty compat layer -#define AQWER 3 // alted qwerty compat layer -#define FNAV 4 // function / navigation keys -#define NUM 5 // numeric keypad keys +// keymaps +#define BASE 0 // default layer, for bepo compatible systems +#define QWER 1 // bepo to qwerty base compat layer, for qwerty systems +#define SQWER 2 // bepo with shift key to qwerty compat layer +#define AQWER 3 // bepo with altgr key to qwerty compat layer +#define FNAV 4 // function / navigation / mouse layer +#define NUM 5 // numeric keypad layer -#define KP_00 0 +// macros +#define KP_00 0 // keypad "double 0" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base layer +/* Keymap 0: default layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | @@ -50,7 +50,7 @@ KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, DF(QWER), DF(BASE), MO(NUM), MO(FNAV), KC_RSHIFT, KC_ENTER), -/* Keymap 1: QWERTY system compatibility layer +/* Keymap 1: bepo to qwerty base compat layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | @@ -87,7 +87,7 @@ KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, DF(QWER), DF(BASE), MO(NUM), MO(FNAV), MO(SQWER), KC_ENTER), -/* Keymap 2: QWERTY shifted system compatibility layer +/* Keymap 2: bepo with shift key to qwerty compat layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = | @@ -124,7 +124,7 @@ S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -/* Keymap 3: QWERTY alted system compatibility layer +/* Keymap 3: bepo with altgr key to qwerty compat layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | @@ -161,7 +161,7 @@ KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, KC_TRNS, KC_TRNS, MO(NUM), MO(FNAV), MO(SQWER), KC_ENTER), -/* Keymap 4: function / navigation layer +/* Keymap 4: function / navigation / mouse layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | | @@ -198,7 +198,7 @@ KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO), -/* Keymap 5: numeric layer, sends keypad codes +/* Keymap 5: numeric keypad layer, sends keypad codes * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | NumLo| / | * | - | | @@ -237,12 +237,10 @@ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { + // keypad "double 0" case KP_00: if (record->event.pressed) { return MACRO( T(KP_0), D(KP_0), END ); @@ -253,11 +251,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { -}; -- cgit v1.2.3 From 84735836e309fe9e2c45ed991a58820ae2bb9123 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Mon, 28 Nov 2016 08:13:32 -0500 Subject: Tweaks position of TOG not to conflict with MO --- keyboards/ergodox/keymaps/erez_experimental/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c index 0c0e3c4e3..2963c40e3 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c @@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | |NxtTab|PrvTab| | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | | | | | | + * | | | |TOG | * ,------|------|------| |------+------+------. * |VAI |VAD |HUI | |SAI |TOG |MOD | * | | |------| |------| | | @@ -95,9 +95,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_AMPR, KC_UNDS, KC_MINS, CM_SCLN, KC_PLUS, KC_TRNS, KC_TRNS, KC_PIPE, KC_AT, KC_EQL, KC_PERC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, + RGB_TOG, KC_TRNS, RGB_SAI, - RGB_SAD, RGB_TOG, RGB_MOD + RGB_SAD, KC_TRNS, RGB_MOD ), /* Keymap 2: Media and mouse keys * -- cgit v1.2.3 From f02eccbb29ee6a8cf421895dcef2e55a76c1bdcb Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 28 Nov 2016 14:16:42 +0100 Subject: Change layer names (cosmetic change) and reorder them so that the "shift" layer can be accessed from the "alt" layer when in QWERTY compat mode. --- keyboards/ergodox/keymaps/bepo/keymap.c | 124 ++++++++++++++++---------------- 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c index 8f068e238..c19ab0d48 100644 --- a/keyboards/ergodox/keymaps/bepo/keymap.c +++ b/keyboards/ergodox/keymaps/bepo/keymap.c @@ -2,12 +2,12 @@ #include "keymap_bepo.h" // keymaps -#define BASE 0 // default layer, for bepo compatible systems -#define QWER 1 // bepo to qwerty base compat layer, for qwerty systems -#define SQWER 2 // bepo with shift key to qwerty compat layer -#define AQWER 3 // bepo with altgr key to qwerty compat layer +#define BEPO 0 // default layer, for bepo compatible systems +#define QW_B 1 // bepo to qwerty base compat layer, for qwerty systems +#define QW_A 2 // bepo with altgr key to qwerty compat layer +#define QW_S 3 // bepo with shift key to qwerty compat layer #define FNAV 4 // function / navigation / mouse layer -#define NUM 5 // numeric keypad layer +#define NUMK 5 // numeric keypad layer // macros #define KP_00 0 // keypad "double 0" @@ -26,20 +26,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | L_Num| | | + * | | |L_NumK| |L_NumK| | | * | Space|LShift|------| |------|RShift|Enter | * | | |L_FNav| |L_FNav| | | * `--------------------' `--------------------' */ -[BASE] = KEYMAP( +[BEPO] = KEYMAP( // Left hand BP_DOLLAR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL, BP_PERCENT, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_BSPC, BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMMA, BP_ECRC, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TAB, KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - DF(BASE), DF(QWER), - MO(NUM), + DF(BEPO), DF(QW_B), + MO(NUMK), KC_SPC, KC_LSHIFT, MO(FNAV), // Right hand KC_SLCK, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL, @@ -47,8 +47,8 @@ KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -DF(QWER), DF(BASE), -MO(NUM), +DF(QW_B), DF(BEPO), +MO(NUMK), MO(FNAV), KC_RSHIFT, KC_ENTER), /* Keymap 1: bepo to qwerty base compat layer * @@ -63,31 +63,68 @@ MO(FNAV), KC_RSHIFT, KC_ENTER), * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | L_Num| | | + * | | |L_NumK| |L_NumK| | | * | Space|LShift|------| |------|RShift|Enter | * | | |L_FNav| |L_FNav| | | * `--------------------' `--------------------' */ -[QWER] = KEYMAP( +[QW_B] = KEYMAP( // Left hand KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LPRN, KC_RPRN, KC_DEL, KC_PERCENT, KC_B, KC_E, KC_P, KC_O, KC_E, KC_BSPC, KC_W, KC_A, KC_U, KC_I, KC_E, KC_COMMA, KC_E, KC_A, KC_Y, KC_X, KC_DOT, KC_K, KC_TAB, KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - DF(BASE), DF(QWER), - MO(NUM), - KC_SPC, MO(SQWER), MO(FNAV), + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_SPC, MO(QW_S), KC_TRNS, +// Right hand + KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, + KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, + KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, + MO(QW_A), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, MO(QW_S), KC_ENTER), +/* Keymap 2: bepo with altgr key to qwerty compat layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | |L_NumK| |L_NumK| | | + * | _ |LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[QW_A] = KEYMAP( +// Left hand +KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL, +KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC, +KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA, +KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB, +KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_UNDS, MO(QW_S), KC_TRNS, // Right hand KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, - MO(AQWER), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -DF(QWER), DF(BASE), -MO(NUM), -MO(FNAV), MO(SQWER), KC_ENTER), -/* Keymap 2: bepo with shift key to qwerty compat layer + KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, MO(QW_S), KC_ENTER), +/* Keymap 3: bepo with shift key to qwerty compat layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = | @@ -100,12 +137,12 @@ MO(FNAV), MO(SQWER), KC_ENTER), * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | L_Num| | | + * | | |L_NumK| |L_NumK| | | * | Space|LShift|------| |------|RShift|Enter | * | | |L_FNav| |L_FNav| | | * `--------------------' `--------------------' */ -[SQWER] = KEYMAP( +[QW_S] = KEYMAP( // Left hand KC_HASH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, @@ -124,43 +161,6 @@ S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -/* Keymap 3: bepo with altgr key to qwerty compat layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | L_Num| | | - * | _ |LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[AQWER] = KEYMAP( -// Left hand -KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL, -KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC, -KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA, -KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB, -KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - KC_TRNS, KC_TRNS, - MO(NUM), - KC_UNDS, MO(SQWER), MO(FNAV), -// Right hand - KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, - KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, - KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, - KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_TRNS, KC_TRNS, -MO(NUM), -MO(FNAV), MO(SQWER), KC_ENTER), /* Keymap 4: function / navigation / mouse layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -216,7 +216,7 @@ KC_TRNS, KC_TRNS, KC_NO), * | | | | | | | | * `--------------------' `--------------------' */ -[NUM] = KEYMAP( +[NUMK] = KEYMAP( // Left hand KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, @@ -234,7 +234,7 @@ KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, M(KP_00), KC_KP_COMMA, KC_KP_ENTER, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS) +KC_TRNS, KC_TRNS, KC_NO) }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -- cgit v1.2.3 From 5a2501d90fb9d2ea1a60d42dfd664d899865e6b5 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 28 Nov 2016 16:38:03 +0100 Subject: Add the AZERTY compatibility layer. --- keyboards/ergodox/keymaps/bepo/keymap.c | 125 +++++++++++++++++++++++++++++-- keyboards/ergodox/keymaps/bepo/readme.md | 4 +- 2 files changed, 122 insertions(+), 7 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c index c19ab0d48..05250ee6a 100644 --- a/keyboards/ergodox/keymaps/bepo/keymap.c +++ b/keyboards/ergodox/keymaps/bepo/keymap.c @@ -1,13 +1,17 @@ #include "ergodox.h" #include "keymap_bepo.h" +#include "keymap_french.h" // keymaps #define BEPO 0 // default layer, for bepo compatible systems #define QW_B 1 // bepo to qwerty base compat layer, for qwerty systems #define QW_A 2 // bepo with altgr key to qwerty compat layer #define QW_S 3 // bepo with shift key to qwerty compat layer -#define FNAV 4 // function / navigation / mouse layer -#define NUMK 5 // numeric keypad layer +#define AZ_B 4 // bepo to azerty base compat layer, for azerty systems +#define AZ_A 5 // bepo with altgr key to azerty compat layer +#define AZ_S 6 // bepo with shift key to azerty compat layer +#define FNAV 7 // function / navigation / mouse layer +#define NUMK 8 // numeric keypad layer // macros #define KP_00 0 // keypad "double 0" @@ -47,7 +51,7 @@ KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -DF(QW_B), DF(BEPO), +DF(AZ_B), DF(BEPO), MO(NUMK), MO(FNAV), KC_RSHIFT, KC_ENTER), /* Keymap 1: bepo to qwerty base compat layer @@ -161,7 +165,118 @@ S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -/* Keymap 4: function / navigation / mouse layer +/* Keymap 4: bepo to azerty base compat layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | b |e_acut| p | o |e_grav|Backsp| |CapsLo| ^ | v | d | l | j | z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | w | a | u | i | e | , |------| |------| c | t | s | r | n | m | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | e |a_grav| y | x | . | k | | | | ' | q | g | h | f | c_cedil| + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | |L_NumK| |L_NumK| | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[AZ_B] = KEYMAP( +// Left hand +FR_DLR, FR_QUOT, FR_LESS, FR_GRTR, FR_LPRN, FR_RPRN, KC_DEL, +FR_PERC, KC_B, FR_EACU, KC_P, KC_O, FR_EGRV, KC_BSPC, +FR_W, FR_A, KC_U, KC_I, KC_E, FR_COMM, +KC_E, FR_AGRV, KC_Y, KC_X, FR_DOT, KC_K, KC_TAB, +KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_SPC, MO(AZ_S), KC_TRNS, +// Right hand + KC_SLCK, FR_AT, FR_PLUS, FR_MINS, FR_SLSH, FR_ASTR, FR_EQL, + KC_CAPSLOCK, KC_LBRC, KC_V, KC_D, KC_L, KC_J, FR_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, FR_M, + KC_NUMLOCK, FR_APOS, FR_Q, KC_G, KC_H, KC_F, FR_CCED, + MO(AZ_A), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, MO(AZ_S), KC_ENTER), +/* Keymap 5: bepo with altgr key to azerty compat layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | w | a |u_grav| trem | € | , |------| |------| c | t | s | r | n | m | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | / | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | |L_NumK| |L_NumK| | | + * | _ |LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[AZ_A] = KEYMAP( +// Left hand +FR_DLR, FR_QUOT, FR_LESS, FR_GRTR, FR_LBRC, FR_RBRC, KC_DEL, +FR_PERC, FR_PIPE, FR_EACU, FR_AMP, KC_O, FR_EGRV, KC_BSPC, +FR_W, FR_A, FR_UGRV, S(KC_LBRC), FR_EURO, FR_COMM, +FR_SLSH, FR_BSLS, FR_LCBR, FR_RCBR, FR_DOT, FR_TILD, KC_TAB, +KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, + KC_TRNS, KC_TRNS, + KC_TRNS, + FR_UNDS, MO(AZ_S), KC_TRNS, +// Right hand + KC_SLCK, FR_AT, FR_PLUS, FR_MINS, FR_SLSH, FR_ASTR, FR_EQL, + KC_CAPSLOCK, KC_LBRC, KC_V, KC_D, KC_L, KC_J, FR_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, FR_M, + KC_NUMLOCK, FR_APOS, FR_Q, KC_G, KC_H, KC_F, FR_CCED, + KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, MO(AZ_S), KC_ENTER), +/* Keymap 6: bepo with shift key to azerty compat layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | ° | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ` | B | E | P | O | E |Backsp| |CapsLo| ! | V | D | L | J | Z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | W | A | U | I | E | ; |------| |------| C | T | S | R | N | M | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | |L_NumK| |L_NumK| | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[AZ_S] = KEYMAP( +// Left hand +FR_HASH, FR_1, FR_2, FR_3, FR_4, FR_5, KC_TRNS, +FR_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, +S(FR_W), S(FR_A), S(KC_U), S(KC_I), S(KC_E), FR_SCLN, +S(KC_E), S(FR_A), S(KC_Y), S(KC_X), FR_COLN, S(KC_K), S(KC_TAB), +S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT), + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, +// Right hand + KC_TRNS, FR_6, FR_7, FR_8, FR_9, FR_0, FR_OVRR, + KC_TRNS, FR_EXLM, S(KC_V), S(KC_D), S(KC_L), S(KC_J), S(FR_Z), + S(KC_C), S(KC_T), S(KC_S), S(KC_R), S(KC_N), S(FR_M), + KC_TRNS, FR_QUES, S(FR_Q), S(KC_G), S(KC_H), S(KC_F), S(KC_C), + S(KC_RALT), S(KC_RCTL), S(KC_RGUI), KC_TRNS, KC_TRNS, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, KC_TRNS, KC_TRNS), +/* Keymap 7: function / navigation / mouse layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | | @@ -198,7 +313,7 @@ KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO), -/* Keymap 5: numeric keypad layer, sends keypad codes +/* Keymap 8: numeric keypad layer, sends keypad codes * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | NumLo| / | * | - | | diff --git a/keyboards/ergodox/keymaps/bepo/readme.md b/keyboards/ergodox/keymaps/bepo/readme.md index 51a506985..2959ac829 100644 --- a/keyboards/ergodox/keymaps/bepo/readme.md +++ b/keyboards/ergodox/keymaps/bepo/readme.md @@ -27,8 +27,8 @@ Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0". -Touche permettant de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle. +Touche permettant de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle et pour des accès BIOS ou console en QWERTY. -TODO : couche de compatibilité pour utiliser la disposition BÉPO sur un système configuré pour un clavier AZERTY. +Touche permettant de basculer en mode BEPO sur un système configuré pour un clavier AZERTY. Cette compatibilité n'est pas parfaite (pas de gestion des caractères non présents sur le clavier AZERTY, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle et pour faire du bureau à distance vers un système Windows sans BEPO. > Olivier Smedts -- cgit v1.2.3 From 06f18e95d4670a055ca349da7d653e0bcb37d83a Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 29 Nov 2016 00:06:12 -0500 Subject: enable api sysex for ez --- keyboards/ergodox/ez/rules.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/ez/rules.mk b/keyboards/ergodox/ez/rules.mk index a9715beb8..f570061fe 100644 --- a/keyboards/ergodox/ez/rules.mk +++ b/keyboards/ergodox/ez/rules.mk @@ -72,6 +72,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 # SLEEP_LED_ENABLE = no +API_SYSEX_ENABLE ?= yes ifndef QUANTUM_DIR include ../../../Makefile -- cgit v1.2.3 From d0cefef946660865dae80877886fcce610920a27 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 29 Nov 2016 00:09:56 -0500 Subject: enable rgblight by default for ez --- keyboards/ergodox/ez/config.h | 11 +++++++++++ keyboards/ergodox/ez/rules.mk | 1 + 2 files changed, 12 insertions(+) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 67a856e51..c2750a321 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -41,6 +41,17 @@ along with this program. If not, see . #define LED_BRIGHTNESS_LO 15 #define LED_BRIGHTNESS_HI 255 +/* ws2812 RGB LED */ +#define RGB_DI_PIN D7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 15 // Number of LEDs +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 255 +#define RGBLIGHT_VAL_STEP 12 + +#define RGB_MIDI +#define RGBW_BB_TWI + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/ergodox/ez/rules.mk b/keyboards/ergodox/ez/rules.mk index f570061fe..893cfa7a8 100644 --- a/keyboards/ergodox/ez/rules.mk +++ b/keyboards/ergodox/ez/rules.mk @@ -73,6 +73,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 SLEEP_LED_ENABLE = no API_SYSEX_ENABLE ?= yes +RGBLIGHT_ENABLE ?= yes ifndef QUANTUM_DIR include ../../../Makefile -- cgit v1.2.3 From f946d830f98da0161753d37da9659caa7469cf4f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 29 Nov 2016 00:11:11 -0500 Subject: guess i didnt pull --- keyboards/ergodox/ez/config.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index f3e1020bd..c2750a321 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -56,17 +56,6 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 -/* ws2812 RGB LED */ -#define RGB_DI_PIN D7 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 15 // Number of LEDs -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 255 -#define RGBLIGHT_VAL_STEP 12 - -#define RGB_MIDI -#define RGBW_BB_TWI - /* * Feature disable options * These options are also useful to firmware size reduction. -- cgit v1.2.3 From 4094544d41450617bc21ab58646603b8964eae0e Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Tue, 29 Nov 2016 09:23:16 -0500 Subject: Test layout for ErgoDox EZ manufacturing robot --- .../ergodox/keymaps/robot_test_layout/keymap.c | 130 +++++++++++++++++++++ .../ergodox/keymaps/robot_test_layout/readme.md | 5 + quantum/rgblight.c | 6 + quantum/rgblight.h | 2 + 4 files changed, 143 insertions(+) create mode 100644 keyboards/ergodox/keymaps/robot_test_layout/keymap.c create mode 100644 keyboards/ergodox/keymaps/robot_test_layout/readme.md (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/robot_test_layout/keymap.c b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c new file mode 100644 index 000000000..0363eedc2 --- /dev/null +++ b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c @@ -0,0 +1,130 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + RGB_FF0000, + RGB_00FF00, + RGB_0000FF, + RGB_FFFFFF, + RGB_TOGGLE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = KEYMAP( + RGB_TOGGLE,RGB_FF0000,RGB_00FF00,RGB_0000FF,RGB_FFFFFF,RGB_TOGGLE,KC_6, + KC_A,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_E,KC_A,KC_A,KC_S,KC_D,KC_F,KC_G,KC_A,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_L,KC_Z,KC_QUOTE,KC_N,KC_U,KC_C,KC_E,KC_8,KC_9,KC_Y,KC_COMMA,KC_6,KC_7,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINUS,KC_J,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_BSLASH,KC_H,KC_J,KC_K,KC_L,KC_J,KC_K,KC_Z,KC_N,KC_M,KC_COMMA,KC_DOT,KC_E,KC_QUOTE,KC_8,KC_7,KC_LBRACKET,KC_RBRACKET,KC_H,KC_9,KC_7,KC_8,KC_7,KC_6,KC_9), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(1) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + } + return MACRO_NONE; +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case RGB_FF0000: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + EZ_RGB(0xff0000); + register_code(KC_A); unregister_code(KC_A); + #endif + } + return false; + break; + case RGB_00FF00: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + EZ_RGB(0x00ff00); + register_code(KC_B); unregister_code(KC_B); + #endif + } + return false; + break; + case RGB_0000FF: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + EZ_RGB(0x0000ff); + register_code(KC_C); unregister_code(KC_C); + #endif + } + return false; + break; + case RGB_FFFFFF: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + EZ_RGB(0xffffff); + register_code(KC_D); unregister_code(KC_D); + #endif + } + return false; + break; + case RGB_TOGGLE: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_toggle(); + register_code(KC_F); unregister_code(KC_F); + #endif + } + return false; + break; + } + return true; +} + +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + case 4: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + break; + case 5: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + break; + case 6: + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; + case 7: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; + default: + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/robot_test_layout/readme.md b/keyboards/ergodox/keymaps/robot_test_layout/readme.md new file mode 100644 index 000000000..45dc2aa76 --- /dev/null +++ b/keyboards/ergodox/keymaps/robot_test_layout/readme.md @@ -0,0 +1,5 @@ +# Robot test layout + +Use this layout if you like to pretend you're [Norman](https://www.youtube.com/watch?v=-sbxFBay-tg), the ErgoDox EZ manufacturing robot. + +It's really meant just for internal use, but we're posting it on GitHub anyway, because hurray to open source. :) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index bb03d6e91..625971e0f 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -425,6 +425,12 @@ void rgblight_timer_toggle(void) { dprintf("TIMER3 toggled.\n"); } +void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b) { + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(r, g, b); +} + void rgblight_task(void) { if (rgblight_timer_enabled) { // mode = 1, static light, do nothing here diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 28a410e48..aa1d026e0 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -84,6 +84,8 @@ void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); +#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) +void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); void rgblight_task(void); -- cgit v1.2.3 From 66b13a66e93c50ba6258fcde548ab946fd8db683 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Wed, 30 Nov 2016 22:22:57 -0500 Subject: Better layout --- .../ergodox/keymaps/robot_test_layout/keymap.c | 121 ++++++++++++--------- 1 file changed, 71 insertions(+), 50 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/robot_test_layout/keymap.c b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c index 0363eedc2..480be177f 100644 --- a/keyboards/ergodox/keymaps/robot_test_layout/keymap.c +++ b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c @@ -9,16 +9,42 @@ enum custom_keycodes { RGB_00FF00, RGB_0000FF, RGB_FFFFFF, - RGB_TOGGLE + RGB_TOGGLE, + LED1, + LED2, + LED3 }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( - RGB_TOGGLE,RGB_FF0000,RGB_00FF00,RGB_0000FF,RGB_FFFFFF,RGB_TOGGLE,KC_6, - KC_A,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_E,KC_A,KC_A,KC_S,KC_D,KC_F,KC_G,KC_A,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_L,KC_Z,KC_QUOTE,KC_N,KC_U,KC_C,KC_E,KC_8,KC_9,KC_Y,KC_COMMA,KC_6,KC_7,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINUS,KC_J,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_BSLASH,KC_H,KC_J,KC_K,KC_L,KC_J,KC_K,KC_Z,KC_N,KC_M,KC_COMMA,KC_DOT,KC_E,KC_QUOTE,KC_8,KC_7,KC_LBRACKET,KC_RBRACKET,KC_H,KC_9,KC_7,KC_8,KC_7,KC_6,KC_9), + RGB_TOGGLE, RGB_FF0000, RGB_00FF00, RGB_0000FF, RGB_FFFFFF, KC_5, KC_LPRN, + KC_GRAVE, KC_A, KC_B, KC_C, KC_D, KC_E, KC_EXLM, + KC_HASH, KC_J, KC_K, KC_L, KC_M, KC_N, + KC_AMPR, KC_T, KC_U, KC_V, KC_W, KC_X, KC_DLR, + KC_PIPE, KC_R, KC_PLUS, KC_LCBR, KC_RCBR, + + KC_F, KC_G, + KC_H, + KC_P, KC_O, KC_I, + + + + // RIGHT HAND + KC_RPRN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_AT, KC_F, KC_G, KC_H, KC_I, KC_COLN, KC_BSLS, + KC_O, KC_P, KC_Q, KC_R, KC_S, KC_QUOT, + LSFT(KC_COMM), KC_Y, KC_Z, KC_COMM, KC_DOT, KC_SLSH, KC_ASTR, + KC_A, KC_B, KC_C, KC_D, KC_PIPE, + + LED1, KC_E, + LED2, + LED3, KC_J, KC_K + ) }; + + const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_TAP_TOGGLE(1) }; @@ -35,7 +61,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; - +bool status_led1_on = false, status_led2_on = false, status_led3_on = false; bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // dynamically generate these. @@ -43,7 +69,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { #ifdef RGBLIGHT_ENABLE EZ_RGB(0xff0000); - register_code(KC_A); unregister_code(KC_A); + register_code(KC_1); unregister_code(KC_1); #endif } return false; @@ -52,7 +78,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { #ifdef RGBLIGHT_ENABLE EZ_RGB(0x00ff00); - register_code(KC_B); unregister_code(KC_B); + register_code(KC_2); unregister_code(KC_2); #endif } return false; @@ -61,7 +87,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { #ifdef RGBLIGHT_ENABLE EZ_RGB(0x0000ff); - register_code(KC_C); unregister_code(KC_C); + register_code(KC_3); unregister_code(KC_3); #endif } return false; @@ -70,7 +96,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { #ifdef RGBLIGHT_ENABLE EZ_RGB(0xffffff); - register_code(KC_D); unregister_code(KC_D); + register_code(KC_4); unregister_code(KC_4); #endif } return false; @@ -79,52 +105,47 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { #ifdef RGBLIGHT_ENABLE rgblight_toggle(); - register_code(KC_F); unregister_code(KC_F); + register_code(KC_EQL); unregister_code(KC_EQL); #endif } return false; break; + case LED1: + if (record->event.pressed) { + if(status_led1_on) { + ergodox_right_led_1_off(); + status_led1_on = false; + } else { + ergodox_right_led_1_on(); + status_led1_on = true; + } + } + return false; + break; + case LED2: + if (record->event.pressed) { + if(status_led2_on) { + ergodox_right_led_2_off(); + status_led2_on = false; + } else { + ergodox_right_led_2_on(); + status_led2_on = true; + } + } + return false; + break; + case LED3: + if (record->event.pressed) { + if(status_led3_on) { + ergodox_right_led_3_off(); + status_led3_on = false; + } else { + ergodox_right_led_3_on(); + status_led3_on = true; + } + } + return false; + break; } return true; } - -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - case 4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case 5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - case 6: - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - case 7: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - default: - break; - } - -}; -- cgit v1.2.3 From 5d43a2aecf2fcb9ed9a25ddc0924c66e544bcdf8 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Fri, 2 Dec 2016 12:53:18 -0500 Subject: Kristian's keymap --- keyboards/ergodox/keymaps/kristian/keymap.c | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 keyboards/ergodox/keymaps/kristian/keymap.c (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/kristian/keymap.c b/keyboards/ergodox/keymaps/kristian/keymap.c new file mode 100644 index 000000000..223859091 --- /dev/null +++ b/keyboards/ergodox/keymaps/kristian/keymap.c @@ -0,0 +1,79 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "version.h" +#include "keymap_fr_ch.h" +#include "keymap_french.h" +#include "keymap_german.h" +#include "keymap_german_ch.h" +#include "keymap_nordic.h" +#include "keymap_norwegian.h" +#include "keymap_spanish.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +[0] = KEYMAP(NO_LESS,KC_1,KC_2,KC_3,KC_4,KC_5,KC_BSPACE,KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,SFT_T(NO_QUOT),CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,SFT_T(KC_EQUAL),MO(1),CTL_T(KC_GRAVE),KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_CAPSLOCK,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_6,KC_7,KC_8,KC_9,KC_0,NO_PLUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,NO_AM,KC_H,KC_J,KC_K,KC_L,LT(2,NO_OSLH),NO_AE,SFT_T(KC_RBRC),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),SFT_T(NO_QUOT),KC_DOWN,KC_UP,NO_LPRN,NO_RPRN,MO(1),NO_QUOT,CTL_T(KC_ESCAPE),NO_APOS,KC_LALT,KC_LGUI,KC_ENTER), + +[1] = KEYMAP(M(0),KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_TRANSPARENT,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_7,KC_8,KC_9,KC_TRANSPARENT,KC_TRANSPARENT,KC_F12,KC_4,KC_5,KC_6,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_0,KC_1,KC_2,KC_3,NO_LBRC,NO_RBRC,KC_LSHIFT,KC_COMMA,KC_DOT,LSFT(NO_LBRC),LSFT(NO_RBRC),KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LALT,KC_LGUI,KC_ENTER), + +[2] = KEYMAP(KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LALT,KC_LGUI,KC_MS_BTN1,KC_MS_BTN2,KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_SPACE,KC_LGUI,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PREV_TRACK,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_NEXT_TRACK,KC_TRANSPARENT,KC_TRANSPARENT,KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_ESCAPE,KC_MS_WH_UP,KC_MS_WH_DOWN,KC_MS_ACCEL0,KC_MS_ACCEL1), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(1) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + } + return MACRO_NONE; +}; + +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + case 4: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + break; + case 5: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + break; + case 6: + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; + case 7: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; + default: + break; + } + +}; -- cgit v1.2.3 From aa70aa3962f0c148916412eb40924e108b6b5c07 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Fri, 2 Dec 2016 13:03:39 -0500 Subject: Tweaks Kristian's layout again --- keyboards/ergodox/keymaps/kristian/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/kristian/keymap.c b/keyboards/ergodox/keymaps/kristian/keymap.c index 223859091..e7e424325 100644 --- a/keyboards/ergodox/keymaps/kristian/keymap.c +++ b/keyboards/ergodox/keymaps/kristian/keymap.c @@ -13,7 +13,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP(NO_LESS,KC_1,KC_2,KC_3,KC_4,KC_5,KC_BSPACE,KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,SFT_T(NO_QUOT),CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,SFT_T(KC_EQUAL),MO(1),CTL_T(KC_GRAVE),KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_CAPSLOCK,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_6,KC_7,KC_8,KC_9,KC_0,NO_PLUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,NO_AM,KC_H,KC_J,KC_K,KC_L,LT(2,NO_OSLH),NO_AE,SFT_T(KC_RBRC),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),SFT_T(NO_QUOT),KC_DOWN,KC_UP,NO_LPRN,NO_RPRN,MO(1),NO_QUOT,CTL_T(KC_ESCAPE),NO_APOS,KC_LALT,KC_LGUI,KC_ENTER), +[0] = KEYMAP(NO_LESS,KC_1,KC_2,KC_3,KC_4,KC_5,KC_BSPACE,KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,SFT_T(NO_APOS),CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,SFT_T(KC_EQUAL),MO(1),CTL_T(KC_GRAVE),KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_CAPSLOCK,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_6,KC_7,KC_8,KC_9,KC_0,NO_PLUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,NO_AM,KC_H,KC_J,KC_K,KC_L,LT(2,NO_OSLH),NO_AE,SFT_T(KC_RBRC),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),SFT_T(NO_APOS),KC_DOWN,KC_UP,NO_LPRN,NO_RPRN,MO(1),NO_QUOT,CTL_T(KC_ESCAPE),NO_APOS,KC_LALT,KC_LGUI,KC_ENTER), [1] = KEYMAP(M(0),KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_TRANSPARENT,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_7,KC_8,KC_9,KC_TRANSPARENT,KC_TRANSPARENT,KC_F12,KC_4,KC_5,KC_6,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_0,KC_1,KC_2,KC_3,NO_LBRC,NO_RBRC,KC_LSHIFT,KC_COMMA,KC_DOT,LSFT(NO_LBRC),LSFT(NO_RBRC),KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LALT,KC_LGUI,KC_ENTER), -- cgit v1.2.3 From a05b6a72d9da9fa6056046c9f600957f43b3c8df Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Mon, 5 Dec 2016 20:34:24 -0500 Subject: Adjusts config for better mousekey support --- keyboards/ergodox/config.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h index edc60caae..994a8c643 100644 --- a/keyboards/ergodox/config.h +++ b/keyboards/ergodox/config.h @@ -1,10 +1,11 @@ #ifndef KEYBOARDS_ERGODOX_CONFIG_H_ #define KEYBOARDS_ERGODOX_CONFIG_H_ -#define MOUSEKEY_DELAY 100 #define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_MAX_SPEED 3 -#define MOUSEKEY_TIME_TO_MAX 10 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 5 +#define MOUSEKEY_MAX_SPEED 2 +#define MOUSEKEY_WHEEL_DELAY 0 #define TAPPING_TOGGLE 1 -- cgit v1.2.3 From 82922a4937dc9683a2364f750a67b80b63767ab5 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Mon, 5 Dec 2016 20:35:03 -0500 Subject: A new default layout that supports Shine --- keyboards/ergodox/keymaps/default/keymap.c | 84 +++++++++++++++------- .../ergodox/keymaps/erez_experimental/keymap.c | 2 +- 2 files changed, 59 insertions(+), 27 deletions(-) (limited to 'keyboards/ergodox') diff --git a/keyboards/ergodox/keymaps/default/keymap.c b/keyboards/ergodox/keymaps/default/keymap.c index 2f399bd18..4eff28085 100644 --- a/keyboards/ergodox/keymaps/default/keymap.c +++ b/keyboards/ergodox/keymaps/default/keymap.c @@ -7,7 +7,12 @@ #define SYMB 1 // symbols #define MDIA 2 // media keys -#define EPRM M(1) // Macro 1: Reset EEPROM +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + RGB_SLD +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -17,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * | BkSp | A | S | D | F | G |------| |------| H |J/Alt | K | L |; / L2|' / Cmd | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -44,56 +49,56 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_HOME, KC_SPC,KC_BSPC,KC_END, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, ALT_T(KC_J), KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT ), /* Keymap 1: Symbol Layer * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | EPRM | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EPRM | | | | | | | . | 0 | = | | + * `-----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | | | | | | + * |Animat| | |Toggle|Solid | * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | + * |Bright|Bright| | | |Hue- |Hue+ | + * |ness- |ness+ |------| |------| | | * | | | | | | | | * `--------------------' `--------------------' */ // SYMBOLS [SYMB] = KEYMAP( // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, + RGB_MOD,KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, + RGB_VAD,RGB_VAI,KC_TRNS, // right hand KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, + RGB_TOG, RGB_SLD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS + KC_TRNS, RGB_HUD, RGB_HUI ), /* Keymap 2: Media and mouse keys * @@ -160,6 +165,33 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c index 2963c40e3..13b8240ce 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c @@ -73,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-------------. ,-------------. * | | | |TOG | * ,------|------|------| |------+------+------. - * |VAI |VAD |HUI | |SAI |TOG |MOD | + * |VAI |VAD |HUI | |SAI | |MOD | * | | |------| |------| | | * | | |HUD | |SAD | | | * `--------------------' `--------------------' -- cgit v1.2.3