From b8f08d936d25ff081cfdd5dfbf8ed156dca2bba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arda=20K=C4=B1l=C4=B1=C3=A7da=C4=9F=C4=B1?= Date: Tue, 19 Dec 2017 17:24:39 +0300 Subject: [PATCH 001/556] Added Ardakilic keymap for Tada68 (#2174) * Added Ardakilic keymap more key fixes * power key instead of eject --- keyboards/tada68/keymaps/ardakilic/keymap.c | 57 ++++++++++++++++++++ keyboards/tada68/keymaps/ardakilic/readme.md | 15 ++++++ keyboards/tada68/keymaps/ardakilic/rules.mk | 21 ++++++++ 3 files changed, 93 insertions(+) create mode 100755 keyboards/tada68/keymaps/ardakilic/keymap.c create mode 100755 keyboards/tada68/keymaps/ardakilic/readme.md create mode 100644 keyboards/tada68/keymaps/ardakilic/rules.mk diff --git a/keyboards/tada68/keymaps/ardakilic/keymap.c b/keyboards/tada68/keymaps/ardakilic/keymap.c new file mode 100755 index 000000000..8e23aeccf --- /dev/null +++ b/keyboards/tada68/keymaps/ardakilic/keymap.c @@ -0,0 +1,57 @@ +#include "tada68.h" + +//KC_NONUS_BSLASH (\|) is equivalent to ["é] key in Turkish keyboards. +//KC_GRV (~ `) is equivalent to [<>|] key in Turkish keyboards. +//I've put grave to bottom, and nonUS backslash to top to make it more similar to Turkish layout. ["é] key is more above than [<>|] key. +//Default top right button was KC_GRV (~ `) (Grave key) even if it looks like Tilde key. + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |PWR | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |\ | | + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|~ ` | + * |----------------------------------------------------------------| + * |Ctrl|Alt |CMD | Space |CMD |FN |Alt|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = KEYMAP_ANSI( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,KC_POWER, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS,KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,KC_NONUS_BSLASH, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,KC_UP,KC_GRV, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RGUI,MO(_FL),KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | | | | | | | | PP|PLA|PN | | | |End | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |MUT|VU-|VU+| | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ +[_FL] = KEYMAP_ANSI( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS , \ + _______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_HOME, \ + _______,_______,_______,_______,_______,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,KC_MUTE,KC_VOLD,KC_VOLU,_______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______,_______,_______), +}; diff --git a/keyboards/tada68/keymaps/ardakilic/readme.md b/keyboards/tada68/keymaps/ardakilic/readme.md new file mode 100755 index 000000000..f81c400ce --- /dev/null +++ b/keyboards/tada68/keymaps/ardakilic/readme.md @@ -0,0 +1,15 @@ +# Ardakilic's TADA68 layout + +This layout aims to use Ansi keyboard for my needs in ease, especially to work on macOS, and to have a layout more similar to Apple keyboards. + +This layout aims to have a similar layout to Apple keyboards while using ISO layouts with the ANSI keymap. The layout is directly considered using Turkish Qwerty keyboards. + +The changes that were applied over default layout: + +* Make Win/cmd keys right next to space bar just like Apple keyboards. +* Adding a power (`KC_POWER`) key, so the lock screen shortcut works. +* Re-use the page up and page down keys to make ["é] (`KC_NONUS_BSLASH`) and [<>|] (`KC_GRAVE`) keys more accessible. +* Optimize the function layer, by removing the mouse movement combinations and adding additional media keys. +* Swap the positions of volume up and volume down and mute buttons on function layer, so these keys are actually with the same order as Apple keyboard layout. + +I'm re-purposing page up and page down keys in this layout, because in macOS alt/option + arrow keys, in Windows and Linux, space bar/shift spacebar combinations already cover their work, and is more accessible if you'd ask me. diff --git a/keyboards/tada68/keymaps/ardakilic/rules.mk b/keyboards/tada68/keymaps/ardakilic/rules.mk new file mode 100644 index 000000000..2a7ff2779 --- /dev/null +++ b/keyboards/tada68/keymaps/ardakilic/rules.mk @@ -0,0 +1,21 @@ +# 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 = 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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From b3bcafcc4bf1314632af822db9ddb1783ebb97cf Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 19 Dec 2017 19:41:51 +1100 Subject: [PATCH 002/556] Unsign key argument in add_key_to_report --- tmk_core/common/report.c | 4 ++-- tmk_core/common/report.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c index 74c6d3fdd..4b25f4428 100644 --- a/tmk_core/common/report.c +++ b/tmk_core/common/report.c @@ -176,7 +176,7 @@ void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code) } #endif -void add_key_to_report(report_keyboard_t* keyboard_report, int8_t key) +void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key) { #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { @@ -204,4 +204,4 @@ void clear_keys_from_report(report_keyboard_t* keyboard_report) for (int8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) { keyboard_report->raw[i] = 0; } -} \ No newline at end of file +} diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 899fc524c..a0811f9a3 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -184,7 +184,7 @@ void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code); void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code); #endif -void add_key_to_report(report_keyboard_t* keyboard_report, int8_t key); +void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key); void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key); void clear_keys_from_report(report_keyboard_t* keyboard_report); From 9dd3e08fdd7e84f77692d5d611fb4ac67d6d82ba Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 19 Dec 2017 07:50:58 -0800 Subject: [PATCH 003/556] Octagon V2 Refactor (#2170) * rename octagon_v2 directory to octagon directory * Move octagon_v2 files to v2 sub-directory * Edit readme files * setup header files for building multiple versions of the Duck Octagon. * Changes as per Jack's PR 2170 comments --- .../{octagon_v2 => octagon}/keymaps/default/keymap.c | 2 +- .../{octagon_v2 => octagon}/keymaps/default/readme.md | 0 keyboards/octagon/octagon.c | 1 + keyboards/octagon/octagon.h | 10 ++++++++++ keyboards/octagon/readme.md | 9 +++++++++ keyboards/octagon/rules.mk | 1 + keyboards/{octagon_v2 => octagon/v2}/config.h | 0 keyboards/{octagon_v2 => octagon/v2}/indicator_leds.c | 0 keyboards/{octagon_v2 => octagon/v2}/indicator_leds.h | 0 keyboards/{octagon_v2 => octagon/v2}/matrix.c | 0 keyboards/{octagon_v2 => octagon/v2}/readme.md | 4 ++-- keyboards/{octagon_v2 => octagon/v2}/rules.mk | 0 keyboards/{octagon_v2/octagon_v2.c => octagon/v2/v2.c} | 2 +- keyboards/{octagon_v2/octagon_v2.h => octagon/v2/v2.h} | 6 +++--- 14 files changed, 28 insertions(+), 7 deletions(-) rename keyboards/{octagon_v2 => octagon}/keymaps/default/keymap.c (99%) rename keyboards/{octagon_v2 => octagon}/keymaps/default/readme.md (100%) create mode 100644 keyboards/octagon/octagon.c create mode 100644 keyboards/octagon/octagon.h create mode 100644 keyboards/octagon/readme.md create mode 100644 keyboards/octagon/rules.mk rename keyboards/{octagon_v2 => octagon/v2}/config.h (100%) rename keyboards/{octagon_v2 => octagon/v2}/indicator_leds.c (100%) rename keyboards/{octagon_v2 => octagon/v2}/indicator_leds.h (100%) rename keyboards/{octagon_v2 => octagon/v2}/matrix.c (100%) rename keyboards/{octagon_v2 => octagon/v2}/readme.md (97%) rename keyboards/{octagon_v2 => octagon/v2}/rules.mk (100%) rename keyboards/{octagon_v2/octagon_v2.c => octagon/v2/v2.c} (99%) rename keyboards/{octagon_v2/octagon_v2.h => octagon/v2/v2.h} (96%) diff --git a/keyboards/octagon_v2/keymaps/default/keymap.c b/keyboards/octagon/keymaps/default/keymap.c similarity index 99% rename from keyboards/octagon_v2/keymaps/default/keymap.c rename to keyboards/octagon/keymaps/default/keymap.c index 123da6069..5fd2d0aeb 100644 --- a/keyboards/octagon_v2/keymaps/default/keymap.c +++ b/keyboards/octagon/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "octagon_v2.h" +#include "octagon.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* layer 0: qwerty */ diff --git a/keyboards/octagon_v2/keymaps/default/readme.md b/keyboards/octagon/keymaps/default/readme.md similarity index 100% rename from keyboards/octagon_v2/keymaps/default/readme.md rename to keyboards/octagon/keymaps/default/readme.md diff --git a/keyboards/octagon/octagon.c b/keyboards/octagon/octagon.c new file mode 100644 index 000000000..6eb9e73b2 --- /dev/null +++ b/keyboards/octagon/octagon.c @@ -0,0 +1 @@ +#include "octagon.h" diff --git a/keyboards/octagon/octagon.h b/keyboards/octagon/octagon.h new file mode 100644 index 000000000..d48a715bb --- /dev/null +++ b/keyboards/octagon/octagon.h @@ -0,0 +1,10 @@ +#ifndef OCTAGON_H +#define OCTAGON_H + +#include "quantum.h" + +#ifdef KEYBOARD_octagon_v2 + #include "v2.h" +#endif + +#endif diff --git a/keyboards/octagon/readme.md b/keyboards/octagon/readme.md new file mode 100644 index 000000000..bf937a3f6 --- /dev/null +++ b/keyboards/octagon/readme.md @@ -0,0 +1,9 @@ +# Duck Octagon + +Non official firmware for custom Korean keyboard with 75% key layout made by Duck. + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +Make example for this keyboard (after setting up your build environment): + + make octagon/v2:default diff --git a/keyboards/octagon/rules.mk b/keyboards/octagon/rules.mk new file mode 100644 index 000000000..ce04362e6 --- /dev/null +++ b/keyboards/octagon/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = octagon/v2 \ No newline at end of file diff --git a/keyboards/octagon_v2/config.h b/keyboards/octagon/v2/config.h similarity index 100% rename from keyboards/octagon_v2/config.h rename to keyboards/octagon/v2/config.h diff --git a/keyboards/octagon_v2/indicator_leds.c b/keyboards/octagon/v2/indicator_leds.c similarity index 100% rename from keyboards/octagon_v2/indicator_leds.c rename to keyboards/octagon/v2/indicator_leds.c diff --git a/keyboards/octagon_v2/indicator_leds.h b/keyboards/octagon/v2/indicator_leds.h similarity index 100% rename from keyboards/octagon_v2/indicator_leds.h rename to keyboards/octagon/v2/indicator_leds.h diff --git a/keyboards/octagon_v2/matrix.c b/keyboards/octagon/v2/matrix.c similarity index 100% rename from keyboards/octagon_v2/matrix.c rename to keyboards/octagon/v2/matrix.c diff --git a/keyboards/octagon_v2/readme.md b/keyboards/octagon/v2/readme.md similarity index 97% rename from keyboards/octagon_v2/readme.md rename to keyboards/octagon/v2/readme.md index 37783c84c..125f09f9c 100644 --- a/keyboards/octagon_v2/readme.md +++ b/keyboards/octagon/v2/readme.md @@ -9,7 +9,7 @@ Hardware Availability: Wait until GB of the next revision Make example for this keyboard (after setting up your build environment): - make octagon_v2:default + make octagon/v2:default See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. @@ -25,4 +25,4 @@ The Duck Octagon V2 PCB consists of: ## Notes Thanks to Ralf Schmitt for previous implementations in his [TMK fork](https://github.com/xauser/tmk_keyboard/tree/xauser/) and few helping words. -Based heavily on Rasmus Schults [Duck Lightsaver QMK Port](https://github.com/qmk/qmk_firmware/tree/master/keyboards/lightsaver) \ No newline at end of file +Based heavily on Rasmus Schults [Duck Lightsaver QMK Port](https://github.com/qmk/qmk_firmware/tree/master/keyboards/lightsaver) diff --git a/keyboards/octagon_v2/rules.mk b/keyboards/octagon/v2/rules.mk similarity index 100% rename from keyboards/octagon_v2/rules.mk rename to keyboards/octagon/v2/rules.mk diff --git a/keyboards/octagon_v2/octagon_v2.c b/keyboards/octagon/v2/v2.c similarity index 99% rename from keyboards/octagon_v2/octagon_v2.c rename to keyboards/octagon/v2/v2.c index 05c12c527..52653b37e 100644 --- a/keyboards/octagon_v2/octagon_v2.c +++ b/keyboards/octagon/v2/v2.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "octagon_v2.h" +#include "v2.h" #include "indicator_leds.h" enum BACKLIGHT_AREAS { diff --git a/keyboards/octagon_v2/octagon_v2.h b/keyboards/octagon/v2/v2.h similarity index 96% rename from keyboards/octagon_v2/octagon_v2.h rename to keyboards/octagon/v2/v2.h index 64d2d0169..7ad9f3826 100644 --- a/keyboards/octagon_v2/octagon_v2.h +++ b/keyboards/octagon/v2/v2.h @@ -13,10 +13,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef OCTAGON_V2_H -#define OCTAGON_V2_H +#ifndef V2_H +#define V2_H -#include "quantum.h" +#include "../octagon.h" #define KEYMAP( \ K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ From 8910f9b87e211a43812f0488890e53fa89b60e40 Mon Sep 17 00:00:00 2001 From: Jason Rosenman Date: Tue, 19 Dec 2017 10:11:58 -0500 Subject: [PATCH 004/556] Marked util/atmega32a_program.py as executable so that programming script works. --- util/atmega32a_program.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 util/atmega32a_program.py diff --git a/util/atmega32a_program.py b/util/atmega32a_program.py old mode 100644 new mode 100755 From 818042b2c3820f4ca5ae25d5de82851ca8405f06 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Mon, 18 Dec 2017 14:57:35 -0800 Subject: [PATCH 005/556] k_type: add belak keymap --- keyboards/k_type/keymaps/belak/keymap.c | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 keyboards/k_type/keymaps/belak/keymap.c diff --git a/keyboards/k_type/keymaps/belak/keymap.c b/keyboards/k_type/keymaps/belak/keymap.c new file mode 100644 index 000000000..6bddeb13e --- /dev/null +++ b/keyboards/k_type/keymaps/belak/keymap.c @@ -0,0 +1,37 @@ +#include "k_type.h" + +#define _______ KC_TRNS + +#define _QW 0 +#define _L1 1 + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [_L1] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPRV, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), +}; + +const uint16_t fn_actions[] = { + +}; + +// 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) { + +}; From d8f0faabdad2e2bc80d2258bda80e6b9e9918b63 Mon Sep 17 00:00:00 2001 From: Hugo Gayosso Date: Wed, 20 Dec 2017 11:33:34 -0500 Subject: [PATCH 006/556] Fixed typo --- docs/custom_quantum_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index 3df1d73a2..e7a45e0bf 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -36,7 +36,7 @@ enum my_keycodes { ## Programming the Behavior of Any Keycode -When you want to override the behavior of an existing key, or define the behavior for a new key, you should use the `process_record_kb()` and `process_record_user()` functions. These are called by QMK during key processing before the actual key event is handled. If these functions return `true` QMK will process the keycodes as usual. That can be handy for extending the functionality of a key rather than replacing it. If these functions return `false` QMK will skip the normal key handling, and it will be up you to send any key up or down events that are required. +When you want to override the behavior of an existing key, or define the behavior for a new key, you should use the `process_record_kb()` and `process_record_user()` functions. These are called by QMK during key processing before the actual key event is handled. If these functions return `true` QMK will process the keycodes as usual. That can be handy for extending the functionality of a key rather than replacing it. If these functions return `false` QMK will skip the normal key handling, and it will be up to you to send any key up or down events that are required. These function are called every time a key is pressed or released. From a1fa70f94ddddcd6b51914a89cee7218ae1281ce Mon Sep 17 00:00:00 2001 From: "U-LANDSRAAD\\drashna" Date: Tue, 19 Dec 2017 10:06:22 -0800 Subject: [PATCH 007/556] Add toggle option to AutoShift --- keyboards/ergodox_ez/keymaps/drashna/keymap.c | 2 +- quantum/process_keycode/process_auto_shift.c | 13 +++++++++++++ quantum/quantum_keycodes.h | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 8743ae282..81231242d 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -294,7 +294,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, - KC_NO, KC_NO, + KC_ASTG, KC_NO, KC_NO, KC_PGDOWN, KC_DELETE, KC_ENTER ), diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index d096cde56..e2e6b02e0 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c @@ -34,6 +34,8 @@ uint16_t autoshift_time = 0; uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT; uint16_t autoshift_lastkey = KC_NO; +bool autoshift_enabled = true; + void autoshift_timer_report(void) { char display[8]; @@ -84,6 +86,15 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { autoshift_timer_report(); return false; + case KC_ASTG: + if (autoshift_enabled) { + autoshift_enabled = false; + autoshift_flush(); + } + else { + autoshift_enabled = true; + } + #ifndef NO_AUTO_SHIFT_ALPHA case KC_A: case KC_B: @@ -137,6 +148,8 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { case KC_DOT: case KC_SLSH: #endif + if (!autoshift_enabled) return true; + autoshift_flush(); any_mod_pressed = get_mods() & ( diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 453774d85..b0e555f2e 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -121,10 +121,13 @@ enum quantum_keycodes { KC_LEAD, #endif +#ifdef AUTO_SHIFT_ENABLE // Auto Shift setup KC_ASUP, KC_ASDN, KC_ASRP, + KC_ASTG, +#endif // AUTO_SHIFT_ENABLE // Audio on/off/toggle AU_ON, From 4f484bc1c990793f019deb54448ad534389cc938 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Tue, 19 Dec 2017 10:37:25 -0800 Subject: [PATCH 008/556] Add on/off/toggle keycodes for Auto Shift --- docs/feature_auto_shift.md | 3 ++ keyboards/ergodox_ez/keymaps/drashna/keymap.c | 2 +- quantum/process_keycode/process_auto_shift.c | 43 ++++++++++++++----- quantum/process_keycode/process_auto_shift.h | 5 +++ quantum/quantum_keycodes.h | 4 +- 5 files changed, 44 insertions(+), 13 deletions(-) diff --git a/docs/feature_auto_shift.md b/docs/feature_auto_shift.md index 273045976..f6c248744 100644 --- a/docs/feature_auto_shift.md +++ b/docs/feature_auto_shift.md @@ -110,6 +110,9 @@ Map three keys temporarily in your keymap: | KC_ASDN | Lower the Auto Shift timeout variable (down) | | KC_ASUP | Raise the Auto Shift timeout variable (up) | | KC_ASRP | Report your current Auto Shift timeout value | +| KC_ASON | Turns on the Auto Shift Function | +| KC_ASOFF | Turns off the Auto Shift Function | +| KC_ASTG | Toggles the statn of the Auto Shift feature | Compile and upload your new firmware. diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 81231242d..8743ae282 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -294,7 +294,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, - KC_ASTG, KC_NO, + KC_NO, KC_NO, KC_NO, KC_PGDOWN, KC_DELETE, KC_ENTER ), diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index e2e6b02e0..fcce91849 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c @@ -34,8 +34,6 @@ uint16_t autoshift_time = 0; uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT; uint16_t autoshift_lastkey = KC_NO; -bool autoshift_enabled = true; - void autoshift_timer_report(void) { char display[8]; @@ -69,6 +67,30 @@ void autoshift_flush(void) { } } +bool autoshift_enabled = true; + +void autoshift_enable(void) { + autoshift_enabled = true; +} +void autoshift_disable(void) { + autoshift_enabled = false; + autoshift_flush(); +} + +void autoshift_toggle(void) { + if (autoshift_enabled) { + autoshift_enabled = false; + autoshift_flush(); + } + else { + autoshift_enabled = true; + } +} + +bool autoshift_state(void) { + return autoshift_enabled; +} + bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { static uint8_t any_mod_pressed; @@ -87,13 +109,14 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { return false; case KC_ASTG: - if (autoshift_enabled) { - autoshift_enabled = false; - autoshift_flush(); - } - else { - autoshift_enabled = true; - } + autoshift_toggle(); + return false; + case KC_ASON: + autoshift_enable(); + return false; + case KC_ASOFF: + autoshift_disable(); + return false; #ifndef NO_AUTO_SHIFT_ALPHA case KC_A: @@ -148,9 +171,9 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { case KC_DOT: case KC_SLSH: #endif - if (!autoshift_enabled) return true; autoshift_flush(); + if (!autoshift_enabled) return true; any_mod_pressed = get_mods() & ( MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)| diff --git a/quantum/process_keycode/process_auto_shift.h b/quantum/process_keycode/process_auto_shift.h index a0361346b..a4abf0414 100644 --- a/quantum/process_keycode/process_auto_shift.h +++ b/quantum/process_keycode/process_auto_shift.h @@ -25,4 +25,9 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record); +void autoshift_enable(void); +void autoshift_disable(void); +void autoshift_toggle(void); +bool autoshift_state(void); + #endif diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index b0e555f2e..65bf9e141 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -121,13 +121,13 @@ enum quantum_keycodes { KC_LEAD, #endif -#ifdef AUTO_SHIFT_ENABLE // Auto Shift setup KC_ASUP, KC_ASDN, KC_ASRP, KC_ASTG, -#endif // AUTO_SHIFT_ENABLE + KC_ASON, + KC_ASOFF, // Audio on/off/toggle AU_ON, From a8eaf0b666905a5b1ecee580b2fe4c89756ec09a Mon Sep 17 00:00:00 2001 From: Nicolas Guelpa Date: Wed, 20 Dec 2017 14:41:41 -0500 Subject: [PATCH 009/556] Adding pok3r like layout to the let's split (#2135) * adding new layout for the planck that helps when coming from the pok3r * Fixing the function layer * Update readme.md * Update keymap.c Making some small adjustments * Update keymap.c switching GUI and Esc * Update keymap.c * adding mod tap on left and right shift * adding mod tap on left and right shift * poker keymap for lets split * fixing the FN layer * removing unused file --- keyboards/lets_split/keymaps/poker/config.h | 37 +++ keyboards/lets_split/keymaps/poker/keymap.c | 241 ++++++++++++++++++++ keyboards/lets_split/keymaps/poker/rules.mk | 3 + keyboards/planck/keymaps/pok3r/config.h | 2 +- keyboards/planck/keymaps/pok3r/keymap.c | 30 +-- 5 files changed, 297 insertions(+), 16 deletions(-) create mode 100644 keyboards/lets_split/keymaps/poker/config.h create mode 100644 keyboards/lets_split/keymaps/poker/keymap.c create mode 100644 keyboards/lets_split/keymaps/poker/rules.mk diff --git a/keyboards/lets_split/keymaps/poker/config.h b/keyboards/lets_split/keymaps/poker/config.h new file mode 100644 index 000000000..5a6261c4f --- /dev/null +++ b/keyboards/lets_split/keymaps/poker/config.h @@ -0,0 +1,37 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#endif diff --git a/keyboards/lets_split/keymaps/poker/keymap.c b/keyboards/lets_split/keymaps/poker/keymap.c new file mode 100644 index 000000000..bac3f3c4c --- /dev/null +++ b/keyboards/lets_split/keymaps/poker/keymap.c @@ -0,0 +1,241 @@ +#include "lets_split.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _FN 5 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + FN, + ADJUST +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Esc |Space |Raise | Left | Up | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + FN , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + SFT_T(KC_ESC) , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), \ + KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_ESC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Esc |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = KEYMAP( \ + KC_TAB , KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + FN , KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + SFT_T(KC_ESC) , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), \ + KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_ESC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Esc |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = KEYMAP( \ + KC_TAB , KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + FN , KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + SFT_T(KC_ESC) , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MT(MOD_RSFT, KC_ENT), \ + KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_ESC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | Esc | | Prev | Play | Next | | |Pg Up | Up |Pg Dn |Prt Sc| Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Vol- | Mute | Vol+ | | Home | Left | Down |Right | End | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | Esc | | | Esc | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_FN] = KEYMAP( \ + KC_ESC , _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_DEL, \ + _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_ESC , _______, _______, KC_ESC , KC_HOME, KC_PGUP, KC_PGDN, KC_END \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | Caps | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , \ + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + KC_CAPS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, KC_CAPS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FN: + if (record->event.pressed) { + layer_on(_FN); + } else { + layer_off(_FN); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/lets_split/keymaps/poker/rules.mk b/keyboards/lets_split/keymaps/poker/rules.mk new file mode 100644 index 000000000..457a3d01d --- /dev/null +++ b/keyboards/lets_split/keymaps/poker/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/pok3r/config.h b/keyboards/planck/keymaps/pok3r/config.h index b406e2fed..003fd259c 100644 --- a/keyboards/planck/keymaps/pok3r/config.h +++ b/keyboards/planck/keymaps/pok3r/config.h @@ -25,7 +25,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: diff --git a/keyboards/planck/keymaps/pok3r/keymap.c b/keyboards/planck/keymaps/pok3r/keymap.c index b5848a9b6..245e918d5 100644 --- a/keyboards/planck/keymaps/pok3r/keymap.c +++ b/keyboards/planck/keymaps/pok3r/keymap.c @@ -56,10 +56,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {FUNCTION,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {KC_LCTL, KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} + {KC_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {FUNCTION , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {SFT_T(KC_ESC) , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT)}, + {KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} }, /* Colemak @@ -74,10 +74,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {FUNCTION,KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {KC_LCTL, KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_TAB , KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {FUNCTION , KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {SFT_T(KC_ESC) , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT)}, + {KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Dvorak @@ -92,10 +92,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_DVORAK] = { - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {FUNCTION,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {KC_LCTL, KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_TAB , KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {FUNCTION , KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {SFT_T(KC_ESC) , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MT(MOD_RSFT, KC_ENT)}, + {KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower @@ -159,7 +159,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Caps |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * | Caps |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | Caps | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' @@ -167,7 +167,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = { {_______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL }, {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, - {KC_CAPS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {KC_CAPS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, KC_CAPS}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, @@ -214,7 +214,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { set_single_persistent_default_layer(_DVORAK); } - return false; + return false; break; case LOWER: if (record->event.pressed) { From 5ffec5d9b09333173d85abb228f38225388938ca Mon Sep 17 00:00:00 2001 From: "U-LANDSRAAD\\drashna" Date: Wed, 20 Dec 2017 16:06:50 -0800 Subject: [PATCH 010/556] Disable MIDI on preonic to fix firmware compilation errors --- keyboards/preonic/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk index 60087e978..d5b21388a 100644 --- a/keyboards/preonic/rules.mk +++ b/keyboards/preonic/rules.mk @@ -61,7 +61,7 @@ CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # 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 = yes # MIDI controls +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 From c68597d9ad983c7d8f2b857f795037f2a441522d Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 20 Dec 2017 16:54:07 -0800 Subject: [PATCH 011/556] Octagon V1 Support (Port) (#2184) * Preliminary commit for Octagon V1 support This is essentially a cp -R v2 v1 with a few things changed to get it to compile and build. * The Octagon V1 supports up to 84 keys as opposed to the V2 which supports up to 86. This commit changes the keymap to match it. * Temporary default keymap just to get things to compile * Update readme file * Fix switch matrix * Fix underglow lighting option * Fix keymap to take care of shifted columns * Fix keymap formatting * Remove un-needed files left over from rasmusx * Make Octagon V1 have its own keymap directory with default keymap * Make Octagon V2 have its own keymap directory with default keymap * Cleanups and readme edits --- keyboards/octagon/octagon.h | 4 + keyboards/octagon/readme.md | 2 + keyboards/octagon/v1/config.h | 54 ++++ keyboards/octagon/v1/keymaps/default/keymap.c | 39 +++ .../octagon/v1/keymaps/default/readme.md | 8 + keyboards/octagon/v1/matrix.c | 236 ++++++++++++++++++ keyboards/octagon/v1/readme.md | 28 +++ keyboards/octagon/v1/rules.mk | 72 ++++++ keyboards/octagon/v1/v1.c | 50 ++++ keyboards/octagon/v1/v1.h | 36 +++ .../octagon/{ => v2}/keymaps/default/keymap.c | 2 +- .../{ => v2}/keymaps/default/readme.md | 2 +- 12 files changed, 531 insertions(+), 2 deletions(-) create mode 100644 keyboards/octagon/v1/config.h create mode 100644 keyboards/octagon/v1/keymaps/default/keymap.c create mode 100644 keyboards/octagon/v1/keymaps/default/readme.md create mode 100644 keyboards/octagon/v1/matrix.c create mode 100644 keyboards/octagon/v1/readme.md create mode 100644 keyboards/octagon/v1/rules.mk create mode 100644 keyboards/octagon/v1/v1.c create mode 100644 keyboards/octagon/v1/v1.h rename keyboards/octagon/{ => v2}/keymaps/default/keymap.c (99%) rename keyboards/octagon/{ => v2}/keymaps/default/readme.md (81%) diff --git a/keyboards/octagon/octagon.h b/keyboards/octagon/octagon.h index d48a715bb..d91da2eda 100644 --- a/keyboards/octagon/octagon.h +++ b/keyboards/octagon/octagon.h @@ -3,6 +3,10 @@ #include "quantum.h" +#ifdef KEYBOARD_octagon_v1 + #include "v1.h" +#endif + #ifdef KEYBOARD_octagon_v2 #include "v2.h" #endif diff --git a/keyboards/octagon/readme.md b/keyboards/octagon/readme.md index bf937a3f6..5b3169424 100644 --- a/keyboards/octagon/readme.md +++ b/keyboards/octagon/readme.md @@ -4,6 +4,8 @@ Non official firmware for custom Korean keyboard with 75% key layout made by Duc See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +Newest version is the [Octagon V2](http://duck0113.tistory.com/127) + Make example for this keyboard (after setting up your build environment): make octagon/v2:default diff --git a/keyboards/octagon/v1/config.h b/keyboards/octagon/v1/config.h new file mode 100644 index 000000000..fbbc8999b --- /dev/null +++ b/keyboards/octagon/v1/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Duck +#define PRODUCT Octagon V1 +#define DESCRIPTION Duck Octagon V1 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 1 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D6 +#define RGBLED_NUM 17 + +#define TAPPING_TERM 200 + +#endif diff --git a/keyboards/octagon/v1/keymaps/default/keymap.c b/keyboards/octagon/v1/keymaps/default/keymap.c new file mode 100644 index 000000000..0ce6abb71 --- /dev/null +++ b/keyboards/octagon/v1/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2017 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "octagon.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = KEYMAP(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_NO, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + [1] = KEYMAP(\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, 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, RESET, 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, 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) + }; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; diff --git a/keyboards/octagon/v1/keymaps/default/readme.md b/keyboards/octagon/v1/keymaps/default/readme.md new file mode 100644 index 000000000..3a3e3db57 --- /dev/null +++ b/keyboards/octagon/v1/keymaps/default/readme.md @@ -0,0 +1,8 @@ +# Default Octagon Layout + +This is the default implement layout for Duck Octagon V1. + + +## Features + +* Default QWERTY layer diff --git a/keyboards/octagon/v1/matrix.c b/keyboards/octagon/v1/matrix.c new file mode 100644 index 000000000..2d2a5adbc --- /dev/null +++ b/keyboards/octagon/v1/matrix.c @@ -0,0 +1,236 @@ +/* +Copyright 2017 MechMerlin +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include +#include +#include "matrix.h" +#include "util.h" +#include "print.h" +#include "debug.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(uint8_t col); +static void init_rows(void); +static void unselect_cols(void); +static void select_col(uint8_t col); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) +{ + DDRB |= 0b00011111; // PB0 (caps), PB1 (alpha), PB2 (extra), PB3 (modnum), PB4 (caps) + DDRD |= 0b11010000; // PD4, (rgb blue), PD6 (rgb red), PD7 (rgb green) + DDRE |= 0b01000000; // PE6 (frow) +} + +void matrix_init(void) { + backlight_init_ports(); + unselect_cols(); + init_rows(); + + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + + uint8_t rows = read_rows(col); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "v1.h" + +enum BACKLIGHT_AREAS { + BACKLIGHT_ALPHA = 0b0000001, + BACKLIGHT_EXTRA = 0b0000010, + BACKLIGHT_MODNUM = 0b0000100, + BACKLIGHT_FROW = 0b0001000, + BACKLIGHT_RGB = 0b0010000, + BACKLIGHT_RGBRED = 0b0010000, + BACKLIGHT_RGBGREEN = 0b0100000, + BACKLIGHT_RGBBLUE = 0b1000000, + BACKLIGHT_SWITCH = 0b0001111 +}; + +uint8_t backlight_os_state = 0; +uint32_t backlight_layer_state = 0; + +void backlight_set(uint8_t level) { + level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010); + level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100); + level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000); + level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000); + level & BACKLIGHT_RGBRED ? (PORTD |= 0b01000000) : (PORTD &= ~0b01000000); + level & BACKLIGHT_RGBGREEN ? (PORTD |= 0b10000000) : (PORTD &= ~0b10000000); + level & BACKLIGHT_RGBBLUE ? (PORTD |= 0b00010000) : (PORTD &= ~0b00010000); +} + +void led_set_kb(uint8_t usb_led) { + backlight_os_state & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef V1_H +#define V1_H + +#include "../octagon.h" + +#define KEYMAP( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5P, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4P, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3P, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K5O, K2N, K2P, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1P, \ + K0A, K0B, K0C, K0G, K0J, K0K, K0L, K0M, K0N, K0P \ +) { \ + { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, KC_NO, K4P }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, KC_NO, K3P }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, K2N, KC_NO, K2P }, \ + { K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, KC_NO, K1M, K1N, KC_NO, K1P }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, K0G, KC_NO, KC_NO, K0J, K0K, K0L, KC_NO, K0M, K0N, KC_NO, K0P } \ +} +#endif diff --git a/keyboards/octagon/keymaps/default/keymap.c b/keyboards/octagon/v2/keymaps/default/keymap.c similarity index 99% rename from keyboards/octagon/keymaps/default/keymap.c rename to keyboards/octagon/v2/keymaps/default/keymap.c index 5fd2d0aeb..0590f17c8 100644 --- a/keyboards/octagon/keymaps/default/keymap.c +++ b/keyboards/octagon/v2/keymaps/default/keymap.c @@ -36,4 +36,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; -}; +}; \ No newline at end of file diff --git a/keyboards/octagon/keymaps/default/readme.md b/keyboards/octagon/v2/keymaps/default/readme.md similarity index 81% rename from keyboards/octagon/keymaps/default/readme.md rename to keyboards/octagon/v2/keymaps/default/readme.md index 456fc3ecb..d52c00129 100644 --- a/keyboards/octagon/keymaps/default/readme.md +++ b/keyboards/octagon/v2/keymaps/default/readme.md @@ -5,4 +5,4 @@ This is the default implement layout for Duck Octagon V2. ## Features -* Default QWERTY layer +* Default QWERTY layer \ No newline at end of file From 846598541b03d97b2b3fbab0a276110d215ce9e2 Mon Sep 17 00:00:00 2001 From: Oscillope Date: Wed, 20 Dec 2017 19:54:43 -0500 Subject: [PATCH 012/556] Oscillope keymap: handy programming macros (#2176) * Added macro to type -> since that symbol requres much finger acrobatics otherwise. * Added macros for braces --- keyboards/jj40/jj40.h | 1 + keyboards/jj40/keymaps/oscillope/keymap.c | 32 ++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/keyboards/jj40/jj40.h b/keyboards/jj40/jj40.h index b1a7a6238..6e90cb972 100644 --- a/keyboards/jj40/jj40.h +++ b/keyboards/jj40/jj40.h @@ -18,6 +18,7 @@ along with this program. If not, see . #ifndef KEYMAP_COMMON_H #define KEYMAP_COMMON_H +#include "quantum.h" #include "quantum_keycodes.h" #include "keycode.h" #include "action.h" diff --git a/keyboards/jj40/keymaps/oscillope/keymap.c b/keyboards/jj40/keymaps/oscillope/keymap.c index 28bfbc154..2eaecd7e4 100644 --- a/keyboards/jj40/keymaps/oscillope/keymap.c +++ b/keyboards/jj40/keymaps/oscillope/keymap.c @@ -26,6 +26,10 @@ enum custom_keycodes { QWERTY = SAFE_RANGE, LOWER, RAISE, + CC_ARRW, + CC_PRN, + CC_BRC, + CC_CBR, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -51,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Ins | | | | | | Left | Down | Up |Right | | | + * | Ins | | | () | [] | {} | Left | Down | Up |Right | | | * |------+------+------+------+------+------|------+------+------+------+------+------| * |PrScr | Back | Fwd | | | | | | Mute | Vol- | Vol+ | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -60,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_LOWER] = KEYMAP( \ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - KC_INS, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + KC_INS, _______, _______, CC_PRN, CC_BRC, CC_CBR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ KC_PSCR, KC_WBAK, KC_WFWD, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, \ _______, _______, _______, _______, KC_LOCK, _______, _______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT \ ), @@ -71,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Tab | $ | % | ^ | [ | ] | 4 | 5 | 6 | - | + |Enter | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | ` | ! | @ | # | { | } | 1 | 2 | 3 | . | \ | | | + * | -> | ! | @ | # | { | } | 1 | 2 | 3 | . | \ | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Ctrl | OS | Alt | |Shift | | 0 | Home | PgDn | PgUp | End | * `-----------------------------------------------------------------------------------' @@ -79,7 +83,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = KEYMAP( \ KC_CAPS, KC_AMPR, KC_ASTR, KC_UNDS, KC_LPRN, KC_RPRN, KC_7, KC_8, KC_9, KC_EQL, KC_BSPC, KC_DEL, \ KC_TAB, KC_DLR, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, _______, \ - _______, KC_EXLM, KC_AT, KC_HASH, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, _______, KC_BSLS, KC_PIPE, \ + CC_ARRW, KC_EXLM, KC_AT, KC_HASH, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, _______, KC_BSLS, KC_PIPE, \ _______, _______, _______, _______, _______, _______, KC_0, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ) }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case CC_ARRW: + SEND_STRING("->"); + return false; + case CC_PRN: + SEND_STRING("()"SS_TAP(X_LEFT)); + return false; + case CC_BRC: + SEND_STRING("[]"SS_TAP(X_LEFT)); + return false; + case CC_CBR: + SEND_STRING("{}"SS_TAP(X_LEFT)); + return false; + } + } + return true; +} From 7c57104b51903bfb1f7e35a5195222e13def7557 Mon Sep 17 00:00:00 2001 From: adiabatic Date: Wed, 20 Dec 2017 16:55:17 -0800 Subject: [PATCH 013/556] Zweihander: remove app keys, etc. (#2167) * zweihander-osx: Remove app keys, etc. - add right command keys - add F16 on ;' for Siri - remove command-Q (too easy to hit) * Zweihander: update readme --- layouts/community/ergodox/zweihander-osx/readme.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/layouts/community/ergodox/zweihander-osx/readme.markdown b/layouts/community/ergodox/zweihander-osx/readme.markdown index 5125a12ee..e88f7c055 100644 --- a/layouts/community/ergodox/zweihander-osx/readme.markdown +++ b/layouts/community/ergodox/zweihander-osx/readme.markdown @@ -20,7 +20,6 @@ I tend to have my mouse in my left hand, but I like to use my other hand to make - Open and Close Parent Folder (⌥⌘↓) - Go Up and Close Just-Left Folder (⌥⌘↑) - Cycle through open windows in current application (⌘\` and ⌘⇧\`) -- Cycle through tabs in current window (⌥⇥ and ⌥⇧⇥) Because moving letter-by-letter is way slower than moving word-by-word, I added Option (⌥) to the bottommost button on the left side. This key can be held easily while holding ; (activate media layer) and pressing J and L to move left and right by word. @@ -30,7 +29,6 @@ Because moving letter-by-letter is way slower than moving word-by-word, I added I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once; this is why the bottom left of the keyboard has shift, control, option, and command in the usual spaces. Further, some common shortcuts I press have a key on the right side of the keyboard. These shortcuts include: - Empty Trash Without Asking for Confirmation (⇧⌥⌘⌫) -- Shut Down Without Asking for Confirmation (⇧⌥⌘ power) ⇧⌥⌘⌫, when you press the backspace on the right half of the keyboard, is much more satisfying than if you curl your left hand into a claw to press all the keys on the left. Try both; you’ll agree. From 3b9e4967b89383307e00cbcb05061d3a1830c07e Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 20 Dec 2017 21:19:45 -0600 Subject: [PATCH 014/556] fix breaking build: remove merge conflict text --- keyboards/dz60/keymaps/iso_7u_space/keymap.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/keyboards/dz60/keymaps/iso_7u_space/keymap.c b/keyboards/dz60/keymaps/iso_7u_space/keymap.c index cae948ff8..71c5c60d0 100644 --- a/keyboards/dz60/keymaps/iso_7u_space/keymap.c +++ b/keyboards/dz60/keymaps/iso_7u_space/keymap.c @@ -4,7 +4,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -<<<<<<< HEAD /* ISO 7u layout layer 0 * ,-----------------------------------------------------------------------------------------. * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | ´ | BSPC | @@ -19,8 +18,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ -======= ->>>>>>> dc7cc26dff01cc84b6f9f96af6d3aa03469aaca3 KEYMAP( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, From 97c6b8143cf495624ede76500c9c6140ccca1400 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Thu, 21 Dec 2017 15:49:55 -0800 Subject: [PATCH 015/556] Adding a Zelda Treasure sound. It's the sound that's made when opening a treasure chest. --- quantum/audio/song_list.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index afb82a298..091f59e7a 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -247,6 +247,12 @@ Q__NOTE(_GS5), \ HD_NOTE(_C6), +#define ZELDA_TREASURE \ + Q__NOTE(_A4), \ + Q__NOTE(_AS4), \ + Q__NOTE(_B4), \ + HD_NOTE(_C5), \ + #define TERMINAL_SOUND \ E__NOTE(_C5 ) From 4932f9566af126bf98c36856856180a1532ff837 Mon Sep 17 00:00:00 2001 From: skullY Date: Thu, 14 Dec 2017 23:02:49 -0800 Subject: [PATCH 016/556] capslock led fix for clueboard 60 --- keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h b/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h index 145d569f0..7405c0ea9 100644 --- a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h +++ b/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h @@ -416,7 +416,7 @@ PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ @@ -432,7 +432,7 @@ PIN_ODR_HIGH(GPIOB_PIN4) | \ PIN_ODR_HIGH(GPIOB_PIN5) | \ PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_LOW(GPIOB_PIN7) | \ PIN_ODR_HIGH(GPIOB_PIN8) | \ PIN_ODR_HIGH(GPIOB_PIN9) | \ PIN_ODR_HIGH(GPIOB_PIN10) | \ From 9cb80d68e299ff6e2a1a520e216d41784a0d5d33 Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 22 Dec 2017 09:49:52 -0800 Subject: [PATCH 017/556] Add the missing rules.mk for my layout --- keyboards/clueboard/66/keymaps/skully/rules.mk | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 keyboards/clueboard/66/keymaps/skully/rules.mk diff --git a/keyboards/clueboard/66/keymaps/skully/rules.mk b/keyboards/clueboard/66/keymaps/skully/rules.mk new file mode 100644 index 000000000..ef4a726fe --- /dev/null +++ b/keyboards/clueboard/66/keymaps/skully/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = no +MOUSEKEY_ENABLE = yes From e9f44ee96d7c89ea9c6b8a199aba7f938d826b62 Mon Sep 17 00:00:00 2001 From: TurboMech <32869044+TurboMech@users.noreply.github.com> Date: Sun, 31 Dec 2017 22:39:34 -0500 Subject: [PATCH 018/556] added ALU84 keyboard and TurboMech user space (#2206) * Added ALU84 Added ALU84 from mechkeys.ca. TurboMech keymap is MacOS oriented, need to still update the defualt keymap. * added alu84 and TurboMech userspace * updated keymap, config.h and rules.mk for alu84 --- keyboards/alu84/alu84.c | 46 +++ keyboards/alu84/alu84.h | 41 ++ keyboards/alu84/config.h | 76 ++++ keyboards/alu84/keymaps/TurboMech/config.h | 25 ++ keyboards/alu84/keymaps/TurboMech/keymap.c | 182 +++++++++ keyboards/alu84/keymaps/TurboMech/readme.md | 93 +++++ keyboards/alu84/keymaps/TurboMech/rules.mk | 15 + keyboards/alu84/keymaps/default/keymap.c | 144 ++++++++ keyboards/alu84/readme.md | 14 + keyboards/alu84/rules.mk | 56 +++ users/turbomech/backupturbomech.c | 390 ++++++++++++++++++++ users/turbomech/turbomech.c | 125 +++++++ users/turbomech/turbomech.h | 50 +++ 13 files changed, 1257 insertions(+) create mode 100755 keyboards/alu84/alu84.c create mode 100755 keyboards/alu84/alu84.h create mode 100755 keyboards/alu84/config.h create mode 100644 keyboards/alu84/keymaps/TurboMech/config.h create mode 100644 keyboards/alu84/keymaps/TurboMech/keymap.c create mode 100644 keyboards/alu84/keymaps/TurboMech/readme.md create mode 100644 keyboards/alu84/keymaps/TurboMech/rules.mk create mode 100755 keyboards/alu84/keymaps/default/keymap.c create mode 100644 keyboards/alu84/readme.md create mode 100755 keyboards/alu84/rules.mk create mode 100644 users/turbomech/backupturbomech.c create mode 100644 users/turbomech/turbomech.c create mode 100644 users/turbomech/turbomech.h diff --git a/keyboards/alu84/alu84.c b/keyboards/alu84/alu84.c new file mode 100755 index 000000000..46e510efb --- /dev/null +++ b/keyboards/alu84/alu84.c @@ -0,0 +1,46 @@ +/* Copyright 2017 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include "alu84.h" +#include "rgblight.h" +#include "action_layer.h" +#include "quantum.h" +#include "action.h" + + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + + + diff --git a/keyboards/alu84/alu84.h b/keyboards/alu84/alu84.h new file mode 100755 index 000000000..299b6a22b --- /dev/null +++ b/keyboards/alu84/alu84.h @@ -0,0 +1,41 @@ +/* Copyright 2017 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#ifndef ALU84_H +#define ALU84_H + +#include "quantum.h" + + + +#define KEYMAP( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, K415, \ + K500, K501, K503, K506, K510, K511, K512, K513, K514, K515 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, K415 }, \ + { K500, K501, KC_NO, K503, KC_NO, KC_NO, K506, KC_NO, KC_NO, KC_NO, K510, K511, K512, K513, K514, K515 } \ +} + +#endif diff --git a/keyboards/alu84/config.h b/keyboards/alu84/config.h new file mode 100755 index 000000000..ab71f92ba --- /dev/null +++ b/keyboards/alu84/config.h @@ -0,0 +1,76 @@ +/* Copyright 2017 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ALU84_CONFIG_H +#define ALU84_CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER mechkeys.ca +#define PRODUCT ALU84 +#define DESCRIPTION A 75% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, B7 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, F5, D4, B1, B0, B5, B4, D7, D6, B3, F4, F6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 10 +#define RGBLIGHT_VAL_STEP 10 + +#define RGBLIGHT_ANIMATIONS + +#endif + +#endif \ No newline at end of file diff --git a/keyboards/alu84/keymaps/TurboMech/config.h b/keyboards/alu84/keymaps/TurboMech/config.h new file mode 100644 index 000000000..3013df9ba --- /dev/null +++ b/keyboards/alu84/keymaps/TurboMech/config.h @@ -0,0 +1,25 @@ +/* Copyright 2017 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#define TAPPING_TOGGLE 2 +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/alu84/keymaps/TurboMech/keymap.c b/keyboards/alu84/keymaps/TurboMech/keymap.c new file mode 100644 index 000000000..00397e3f0 --- /dev/null +++ b/keyboards/alu84/keymaps/TurboMech/keymap.c @@ -0,0 +1,182 @@ +/* Copyright 2017 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include "alu84.h" +#include "turbomech.h" + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define _QWERTY 0 //BASE layer +#define _FUNCTION 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL + * ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -. + * | Esc | Scrn | Scrn | Expose |Launchpad| Show |Dock Hide| Screen | Shortcut| Shortcut| Shortcut| Shortcut| Play | Mute | Vol Up | Vol Down| + * | |Brght Up | Brght Dn| | | Desktop | Toggle | Capture | | | | | Pause | | | | + * |- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | Backspace | POWER | + * | | | | | | | | | | | | | | | | + * |- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Shortcut| + * | | | | | | | | | | | | | | | | + * |- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -| + * | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Page | + * | | | | | | | | | | | | | | Up | + * |- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | Page | + * | | | | | | | | | | | | | | Down | + * |- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -| + * | Control | Option | Gui | Space | Gui | Opt | Fn | Left | Down | Right | + * | | /Alt | | | | Alt | | | | | + * `- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' + */ + + [_QWERTY] = KEYMAP( + KC_ESC, KC_F14, KC_F15, LCTL(KC_UP), LCTL(KC_L), KC_F11, LALT(LGUI(KC_D)), LCTL(KC_S), LCTL(LSFT(KC_O)), LCTL(LGUI(KC_1)), LCTL(LGUI(KC_2)), LCTL(LGUI(KC_3)), KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_POWER, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, LCTL(LGUI(KC_N)), + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + +/* FN1 - SEE readme.md + * ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -. + * | Quit | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Trns | Trns | DFU | + * | All | | | | | | | | | | | | | | | Reset | + * |- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -| + * | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Delete | Lock | + * | | | | | | | | | | | | | | |Shortcut | + * |- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -| + * | Trns | RGB | RGB | RGB | RGB | RGB Hue | RGB Hue | RGB Sat | RGB Sat | Trns | Trns | Trns | Trns | Trns | Trns | + * | | Toggle | Mode | Increase| Decrease| Increase| Decrease| Increase| Decrease| | | | | | | + * |- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -| + * | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | + * | | | | | | | | | | | | | | | + * |- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+ + * | Trns |Backlight|Backlight|Backlight|Backlight| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | + * | | Toggle | Increase| Decrease| Step | | | | | | | | | | + * |- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -| + * | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | + * | | | | | | | | | | | + * `- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' + */ + + + [_FUNCTION] = KEYMAP( + LALT(LGUI(KC_Q)), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_RESET, + 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_DEL, LCTL(LALT(LGUI(KC_S))), + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, 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, BL_TOGG, BL_INC, BL_DEC, BL_STEP, 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), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + //switch (id) { + // case _FLIP: + // if (record->event.pressed) + + //SEND_STRING("(╯°□°)╯︵ ┻━┻"); + // } + // return false; + // break; + // } + + return MACRO_NONE; +}; + + switch (id) { + + } + return MACRO_NONE; +} + + + +void matrix_scan_user(void) { +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/alu84/keymaps/TurboMech/readme.md b/keyboards/alu84/keymaps/TurboMech/readme.md new file mode 100644 index 000000000..b78d7a5e7 --- /dev/null +++ b/keyboards/alu84/keymaps/TurboMech/readme.md @@ -0,0 +1,93 @@ +# This is u/TurboMech's keyboard layout for ALU84. + +## It is designed for Mac OS, due to the specific functions I created. + +### Here is the layout found in the keymap.c file. +##### I use shortcuts for the Function row (above number row) listed below + - Scrn Bright Up: F14 + - Scrn Bright Down: F15 + - Expose: LCTRL + Up + - Launchpad: LCTRL + L + - Show Desktop: F11 + - Show/Hide Dock: LALT + LGUI + D + - Screen Capture: LCTRL + S + - Custom Shortcut (setup for an application I use frequently): LCTRL + LSHFT + O + - Custom Shortcut 1: LCTRL + LGUI + 1 + - Custom Shortcut 2: LCTRL + LGUI + 2 + - Custom Shortcut 3: LCTRL + LGUI + 3 + - use the custom shortcuts for whatever you want: launch an application, a macro, etc. + - Play/Pause: exactly that + - Mute / Volume Up / Volume Down: exactly what it says + + ##### Going down the right side from Vol Down: + - POWER: this serves as the power button on Mac's only. Press and hold the button as you would on your Macbook or iMac keyboard. + - Menu: this slides the notification bar on the right side (its the same as on iPhones/ iPads) + +### See below keymaps for how to setup shortcuts on Mac + +#### Base Layer +``` +.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -. +| Esc | Scrn | Scrn | Expose |Launchpad| Show |Dock Hide| Screen | Shortcut| Shortcut| Shortcut| Shortcut| Play | Mute | Vol Up | Vol Down| +| |Brght Up | Brght Dn| | | Desktop | Toggle | Capture | | | | | Pause | | | | +|- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -| +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | Backspace | POWER | +| | | | | | | | | | | | | | | | +|- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -| +| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Shortcut| +| | | | | | | | | | | | | | | | +|- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -| +| CAPS | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Page | +| | | | | | | | | | | | | | Up | +|- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+ +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | Page | +| | | | | | | | | | | | | | Down | +|- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -| +| Control | Option | Gui | Space | Gui | Opt | Fn | Left | Down | Right | +| | /Alt | | | | Alt | | | | | +'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' +``` +#### Function Layer 1 - See above for shortcuts +``` +.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -. +| Quit | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Trns | Trns | DFU | +| All | | | | | | | | | | | | | | | Reset | +|- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -| +| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Delete | Lock | +| | | | | | | | | | | | | | |Shortcut | +|- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -| +| Trns | RGB | RGB | RGB | RGB | RGB Hue | RGB Hue | RGB Sat | RGB Sat | Trns | Trns | Trns | Trns | Trns | Trns | +| | Toggle | Mode | Increase| Decrease| Increase| Decrease| Increase| Decrease| | | | | | | +|- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -| +| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | +| | | | | | | | | | | | | | | +|- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+ +| Trns |Backlight|Backlight|Backlight|Backlight| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | +| | Toggle | Increase| Decrease| Step | | | | | | | | | | +|- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -| +| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | +| | | | | | | | | | | +'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' +``` + +#### How to use/ setup shortcuts on Mac +- First navigate to System Preferences > Keyboard > Shortcuts + - You can use any of them in here + - Just set them to the shortcut keys listed above + +#### How to make your own (to launch applications, quit all, etc.) +- Navigate to Automator > New Document > click Service > Choose +- Now we have to setup our shortcut + - Here's how to setup the Quit All Shortcut + - In the right window select the Service recieves dropdown > select No Input + - At the top left click the Name (Search) > type quit > click and hold Quit All Applications > drag to the right hand box (under the Service Recieves) + - **IMPORTANT** You have to click the Run button at the upper right hand corner in order for these to actually work. + - Now click File > Save > save it as Quit All Apps (or whatever you want) / you can also just exit out and it'll ask you if you want to save +- Navigate back to System Preferences > Keyboard > Shortcuts + - The new shortcut can be found under services, set it to one of the shortcuts I listed above and done +- The same applies for applications in the Name (search) just type the application you want to have as shortcut. Don't forget to run it, then do the same steps + to set it up as a shortcut. + + + + diff --git a/keyboards/alu84/keymaps/TurboMech/rules.mk b/keyboards/alu84/keymaps/TurboMech/rules.mk new file mode 100644 index 000000000..ff8b4b2e6 --- /dev/null +++ b/keyboards/alu84/keymaps/TurboMech/rules.mk @@ -0,0 +1,15 @@ +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # 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 +SLEEP_LED_ENABLE ?= no # 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 +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= yes +UNICODE_ENABLE ?= yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/alu84/keymaps/default/keymap.c b/keyboards/alu84/keymaps/default/keymap.c new file mode 100755 index 000000000..31e640ec9 --- /dev/null +++ b/keyboards/alu84/keymaps/default/keymap.c @@ -0,0 +1,144 @@ +#include "alu84.h" +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define _BL 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL + * ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . + * | Esc | Scrn Brght Up | Scrn Bright Down | Expose | Launchpad | Show Desktop | Dock Hide Tog | Screen Capture | Shortcut | Shortcut | Shortcut| Shortcut | Play/Pause | Mute | Vol Up | Vol Down | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | Backspace | POWER | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Shortcut | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Pg Up | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | Pg Dn | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | Control | Option/Alt | Gui | Space | Gui | Opt | Fn (layer) | Left | Down | Right | + * `- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -' + */ + + [_BL] = KEYMAP( + KC_ESC, KC_F14, KC_F15, LCTL(KC_UP), LCTL(KC_L), KC_F11, LALT(LGUI(KC_D)), LCTL(KC_S), LCTL(LSFT(KC_O)), LCTL(LGUI(KC_1)), LCTL(LGUI(KC_2)), LCTL(LGUI(KC_3)), KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_POWER, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, LCTL(LGUI(KC_N)), + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + +/* FN1 + * ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . + * | Quit All | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Trns | Trns | DFU RESET | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | DELETE | Lock Shrct | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | Trns | RGB Toggle | RGB Mode | RGB Increase | RGB Decrease | RGB Hue Inc | RGB Hue Dec | RGB Sat Inc | RGB Sat Dec | Trns | Trns | Trns | Trns | Trns | Trns | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | Trns | Backlight Tog | Backlight Inc | Backlight Dec | Backlight Step | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | + * |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -| + * | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | + * `- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -' + */ + + [_FN1] = KEYMAP( + LALT(LGUI(KC_Q)), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, RESET, + 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_DEL, LCTL(LALT(LGUI(KC_S))), + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, 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, BL_TOGG, BL_INC, BL_DEC, BL_STEP, 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), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} \ No newline at end of file diff --git a/keyboards/alu84/readme.md b/keyboards/alu84/readme.md new file mode 100644 index 000000000..979a49d0f --- /dev/null +++ b/keyboards/alu84/readme.md @@ -0,0 +1,14 @@ +ALU84 +=== + +A 75% keyboard kit made and sold by mechkeys.ca [More info on mechkeys.ca](https://mechkeys.ca) + +Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) +Hardware Supported: ALU84 +Hardware Availability: [mechkeys.ca](https://mechkeys.ca) + +Make example for this keyboard (after setting up your build environment): + + make alu84:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/alu84/rules.mk b/keyboards/alu84/rules.mk new file mode 100755 index 000000000..14d3e7089 --- /dev/null +++ b/keyboards/alu84/rules.mk @@ -0,0 +1,56 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # 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 +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 +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= yes \ No newline at end of file diff --git a/users/turbomech/backupturbomech.c b/users/turbomech/backupturbomech.c new file mode 100644 index 000000000..49bcded55 --- /dev/null +++ b/users/turbomech/backupturbomech.c @@ -0,0 +1,390 @@ +/* Copyright 2017 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "turbomech.h" +#include "quantum.h" +//#include "action_layer.h" +#include "action.h" +//#include "rgblight.h" + +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + +//#define default_layer _QWERTY (0) +//extern keymap_config_t keymap_config; + +extern rgblight_config_t rgblight_config; + + +//#ifdef RGBLIGHT_ENABLE +/*change the rgblight_setrgb(#, #, #) to what you want CAPS lock - currenlty red*/ + //#define rgblight_set_caps rgblight_setrgb(255, 0, 0) + //#define rgblight_base rgblight_mode(RGB_current_mode) +//#endif +// +//bool rgb_layer_change = true; +//bool RGB_INIT = false; +//bool TOG_STATUS = false; +#ifdef RGBLIGHT_ENABLE +bool rgb_layer_change = true; +#endif +int RGB_current_mode; + +/*void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + if (true) { + eeconfig_read_rgblight(); + rgblight_get_mode(); + eeconfig_update_rgblight_default(); + + + // eeconfig_debug_rgblight(); + //rgblight_init(); + } + #endif + +} +*/ + +/*void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + eeconfig_read_rgblight(); + eeconfig_update_rgblight_default(); + //rgblight_init(); + //rgblight_mode(RGB_current_mode); + //rgblight_mode(RGB_current_mode); + //RGB_current_mode = rgblight_config.mode; + #endif +}*/ + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); + default_layer = _QWERTY; + // eeconfig_update_rgblight(rgblight_config.raw); +} + + //Setting ADJUST layer RGB back to default +/*void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer1); + } else { + layer_off(layer2); + } +}*/ + + +void matrix_init_user(void) { + + uint8_t default_layer = eeconfig_read_default_layer(); + + rgblight_enable(); + + if(true) { + if (default_layer & (1UL << _QWERTY)) { + //RGB_current_mode = rgblight_config.mode; + rgblight_mode(11); + } + else { + rgblight_mode (12); + } + + /*else if (default_layer & (1UL << _DVORAK)) { + rgblight_set_green; + } + //else if (default_layer & (1UL << _WORKMAN)) { + rgblight_set_purple; + } + else { + rgblight_set_teal;*/ + + + } + + +} + +static bool is_capslocked = false; +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<event.pressed) { + SEND_STRING("make alu84:TurboMech:dfu"); + SEND_STRING(SS_TAP(X_ENTER)); + } + return false; + break; + case KC_QMK: + if (!record->event.pressed) { + SEND_STRING("cd QMK/qmk_firmware"); + SEND_STRING(SS_TAP(X_ENTER)); + } + return false; + break; + case KC_RESET: + if (!record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(255, 255, 255); + #endif + //_delay_ms(2000); + reset_keyboard(); + } + return false; + break; + /*case RGB_MOD: + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + RGB_current_mode = rgblight_config.mode; + rgblight_step(); + // rgblight_mode(RGB_current_mode); + //RGB_current_mode = rgblight_config.mode; + // _delay_ms(50); + // rgblight_set(); + RGB_current_mode = rgblight_config.mode; + } + else //if (rgblight_config.enable) + { + _delay_ms(50); + rgblight_set(); + //rgblight_mode(rgblight_config.mode); + // eeconfig_update_rgblight(rgblight_config.raw); + } + + return true; + break;*/ + + /*case MO(1): + if (record->event.realeased) { + rgblight_mode(1); + rgblight_set_red; + } + return true; + break;*/ + + /*case KC_CAPS: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + register_code(KC_CAPS); + rgblight_mode(1); + rgblight_set_red; + } + else { + unregister_code(KC_CAPS); + rgblight_mode(RGB_current_mode); + + } + return false; + break;*/ + + /* rgblight_mode(RGB_current_mode); + register_code(KC_CAPS); + rgblight_mode(1); + rgblight_set_red; + } + else { + unregister_code(KC_CAPS); + rgblight_mode(RGB_current_mode);*/ + + // } + // return true; + // break; + /*case KC_RESET: + if (record->event.pressed) { + layer_off(_FUNCTION); + rgblight_mode(RGB_current_mode); + RGB_current_mode = rgblight_config.mode; + layer_clear(); + _delay_ms(1000); + reset_keyboard(); + } + else{ + //layer_off(_FUNCTION); + _delay_ms(1000); + rgblight_mode(RGB_current_mode); + RGB_current_mode = rgblight_config.mode; + + //eeconfig_update_rgblight_default(); + } + + return false; + break; + }*/ + + + return true; + break; + + + + + +/*case RGB_MOD: +case RGB_SMOD: +case RGB_HUI: +case RGB_HUD: +case RGB_SAI: +case RGB_SAD: +case RGB_VAI: +case RGB_VAD: +case RGB_MODE_PLAIN: +case RGB_MODE_BREATHE: +case RGB_MODE_RAINBOW: +case RGB_MODE_SWIRL: +case RGB_MODE_SNAKE: +case RGB_MODE_KNIGHT: +case RGB_MODE_XMAS: +case RGB_MODE_GRADIENT: + if (record->event.pressed) { + rgb_layer_change = false; + } + break; + } + return true;*/ + } + + + return process_record_keymap(keycode, record); + +} + +uint32_t layer_state_set_user(uint32_t state) { +#ifdef RGBLIGHT_ENABLE + uint8_t default_layer = eeconfig_read_default_layer(); + if (rgb_layer_change) { + switch (biton32(state)) { + case _FUNCTION: + rgblight_set_blue; + rgblight_mode(1); + break; + case _QWERTY: + + rgblight_mode(11); + break; + // case _MOUS: + // rgblight_set_yellow; + // rgblight_mode(1); + // break; + //case _MACROS: + //rgblight_set_orange; + //is_overwatch ? rgblight_mode(17) : rgblight_mode(18); + //break; + //case _MEDIA: + //rgblight_set_green; + //rgblight_mode(22); + //break; + default: + if (is_capslocked) { + rgblight_mode(1); + rgblight_set_red; + } + else { if (default_layer & (1UL << _QWERTY)) { + rgblight_mode(11); + } + + else if (default_layer & (1UL << _FUNCTION)) { + rgblight_set_cyan; + } + //else if (default_layer & (1UL << _WORKMAN)) { + // rgblight_set_purple; + // } + else { + rgblight_set_orange; + } + } + rgblight_mode(1); + break; + } + } +#endif + return state; +} + + +!!** possible for later + +void set_single_persistent_default_layer(uint8_t default_layer); + +void set_single_persistent_default_layer(uint8_t default_layer) { + #if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS) + PLAY_SONG(default_layer_songs[default_layer]); + #endif + eeconfig_update_default_layer(1U< @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +//**!! Currently after reboot the set rgb mode does not persist after reboot. Need to find a way to "save" the rgb mode. Color remains after reboot though. + +#include "turbomech.h" +#include "quantum.h" +#include "action_layer.h" +#include "action.h" +#include "rgblight.h" +//#include "process_unicode.h" + +extern keymap_config_t keymap_config; +extern rgblight_config_t rgblight_config; +bool RGB_INIT = false; +bool TOG_STATUS = false; +bool caps_is_active = false; +int RGB_current_mode; + +void matirx_scan_kb (void) { + if (RGB_INIT) {} + else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; +} + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} +/*void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +}*/ + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_CAPS: + if (record->event.pressed) { + register_code(KC_CAPS); + caps_is_active = !caps_is_active; + if (caps_is_active) { + rgblight_mode(14); + } + else if (!caps_is_active) { + unregister_code(KC_CAPS); + rgblight_mode(RGB_current_mode); + } + } + return false; + break; + + case RGB_MOD: + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + // rgblight_set(); + } + return false; + break; + + case KC_RESET: + if (record->event.pressed) { + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(255, 255, 255); + //_delay_ms(2000); + reset_keyboard(); + } + return false; + break; + + /*case _FLIP: //(╯°□°)╯︵ ┻━┻ + if (record->event.pressed) { + register_code(KC_LPRN); + unregister_code(KC_LPRN); + register_code(X(0x00B0)); + unregister_code(X(0x00B0)); + + UC(0x256F); + PROCESS_UNICODE(UC(0x00B0)); + SEND_TAP(UC(0x25A1)); + SEND_TAP(UC(0x00B0)); + SEND_STRING(")"); + SEND_TAP(UC(0x256F)); + SEND_TAP(UC(0xFE35)); + SEND_TAP(UC(0x253B)); + SEND_TAP(UC(0x2501)); + SEND_TAP(UC(0x253B)); + } + return false; + break;*/ + + return true; + break; + } +return process_record_keymap(keycode, record); +} diff --git a/users/turbomech/turbomech.h b/users/turbomech/turbomech.h new file mode 100644 index 000000000..87fd4da68 --- /dev/null +++ b/users/turbomech/turbomech.h @@ -0,0 +1,50 @@ +/* Copyright 2017 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +// Definine layer names +#define _QWERTY 0 +#define _FUNCTION 1 + +#ifdef RGBLIGHT_ENABLE +//values are HSV (Hue, Sat, Val) - except Sat and Val equal 255 for 100%. +#define rgblight_set_blue rgblight_sethsv (240, 255, 255); +#define rgblight_set_red rgblight_sethsv (0, 255, 255); +#define rgblight_set_green rgblight_sethsv (120, 255, 255); +#define rgblight_set_orange rgblight_sethsv (30, 255, 255); +#define rgblight_set_teal rgblight_sethsv (195, 255, 255); +#define rgblight_set_magenta rgblight_sethsv (300, 255, 255); +#define rgblight_set_yellow rgblight_sethsv (60, 255, 255); +#define rgblight_set_purple rgblight_sethsv (270, 255, 255); +#define rgblight_set_cyan rgblight_sethsv (180, 255, 255); +#define rgblight_set_white rgblight_sethsv (0, 0, 255) +#endif + +//must use KC_RESET in order to have RESET indicate a color/mode +enum userspace_custom_keycodes { + EPRM = SAFE_RANGE, //should always be here + KC_RESET, + KC_MAKE_ALU84, + KC_QMK, + _FLIP, + NEW_SAFE_RANGE +}; +#endif From 9fc3e26f70d343c6fbc7b63b36846a868f015608 Mon Sep 17 00:00:00 2001 From: Mikkel Jeppesen <{dumle29}@users.noreply.github.com> Date: Sat, 30 Dec 2017 14:15:28 +0100 Subject: [PATCH 019/556] Fix of #2094 --- quantum/audio/audio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index 29bad8060..85220e163 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -151,16 +151,16 @@ void audio_init() #ifdef C6_AUDIO DDRC |= _BV(PORTC6); - #else - DDRC |= _BV(PORTC6); - PORTC &= ~_BV(PORTC6); + //#else + // DDRC |= _BV(PORTC6); // Why is PC6 being set as output low, if C6_audio isn't defined? + // PORTC &= ~_BV(PORTC6); #endif #ifdef B5_AUDIO DDRB |= _BV(PORTB5); - #else - DDRB |= _BV(PORTB5); - PORTB &= ~_BV(PORTB5); + //#else + // DDRB |= _BV(PORTB5); // Same as with PC6 + // PORTB &= ~_BV(PORTB5); #endif #ifdef C6_AUDIO From c58921c64cfd5dcd700704506c8598ad1d8bc55b Mon Sep 17 00:00:00 2001 From: Hannes Egler Date: Mon, 1 Jan 2018 23:16:24 +0100 Subject: [PATCH 020/556] KBD75 ISO support (#2201) * iso_de_mac ISO-DE layout with mac media controls * Delete keymap.c * iso_de_mac ISO-DE support with Mac media keys * Add files via upload Layout overview * iso layout support Adds support for the extra key of ISO * Update keymap.c typo-fix * fixed mac next key * Delete Layout.png * Delete keymap.c --- keyboards/kbd75/keymaps/iso/keymap.c | 220 +++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 keyboards/kbd75/keymaps/iso/keymap.c diff --git a/keyboards/kbd75/keymaps/iso/keymap.c b/keyboards/kbd75/keymaps/iso/keymap.c new file mode 100644 index 000000000..3edc56ae5 --- /dev/null +++ b/keyboards/kbd75/keymaps/iso/keymap.c @@ -0,0 +1,220 @@ +#include "kbd75.h" +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP( + LT(2, KC_ESC), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, MO(1), KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + KEYMAP( + 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, RESET, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, 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, BL_DEC, BL_TOGG, BL_INC, BL_STEP, 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), + + KEYMAP( + KC_TRNS, M(1), M(2), 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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), + + KEYMAP( + 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_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_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) + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} From eb903c7623f97ecd51a0fe4a0ca911bdcbc204cf Mon Sep 17 00:00:00 2001 From: Takahiro Miyamoto Date: Sun, 31 Dec 2017 10:17:56 +0900 Subject: [PATCH 021/556] Add meira/takmiya keymap --- keyboards/meira/keymaps/takmiya/config.h | 24 ++ keyboards/meira/keymaps/takmiya/keymap.c | 262 ++++++++++++++++++++++ keyboards/meira/keymaps/takmiya/readme.md | 1 + 3 files changed, 287 insertions(+) create mode 100644 keyboards/meira/keymaps/takmiya/config.h create mode 100644 keyboards/meira/keymaps/takmiya/keymap.c create mode 100644 keyboards/meira/keymaps/takmiya/readme.md diff --git a/keyboards/meira/keymaps/takmiya/config.h b/keyboards/meira/keymaps/takmiya/config.h new file mode 100644 index 000000000..97210115b --- /dev/null +++ b/keyboards/meira/keymaps/takmiya/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Cole Markham, WoodKeys.click + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/meira/keymaps/takmiya/keymap.c b/keyboards/meira/keymaps/takmiya/keymap.c new file mode 100644 index 000000000..48602dfaf --- /dev/null +++ b/keyboards/meira/keymaps/takmiya/keymap.c @@ -0,0 +1,262 @@ +/* Copyright 2017 Cole Markham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "meira.h" +#include "issi.h" +#include "lighting.h" + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . |//GUI |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | GUI |Lower |Space |Enter |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, GUI_T(KC_SLSH), KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_RGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | DEL | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home | PgUp | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | DEL | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home | PgUp | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + BL_TOGG, RESET, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_PSCR, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, \ + BL_STEP, RGB_MOD, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { +#ifdef RGBLIGHT_ENABLE + rgblight_mode(RGB_current_mode); +#endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +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; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif +// persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; +#ifdef RGBLIGHT_ENABLE + rgblight_mode(16); +#endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { +#ifdef RGBLIGHT_ENABLE + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change +#endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; +#ifdef RGBLIGHT_ENABLE + rgblight_mode(15); +#endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { +#ifdef RGBLIGHT_ENABLE + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change +#endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + // FIXME add RGB feedback + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case BL_TOGG: +#ifdef ISSI_ENABLE + if (record->event.pressed) { + print("Enabling backlight\n"); + issi_init(); + } +#endif + return false; + break; + case BL_STEP: + if (record->event.pressed) { + print("Stepping backlight\n"); +#ifdef BACKLIGHT_ENABLE + print("Really stepping backlight\n"); + backlight_step(); +#endif + + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released +#ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; +#endif +// case BL_INC: +// meira_inc_backlight_level(); +// return false; +// break; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/meira/keymaps/takmiya/readme.md b/keyboards/meira/keymaps/takmiya/readme.md new file mode 100644 index 000000000..40f48bb09 --- /dev/null +++ b/keyboards/meira/keymaps/takmiya/readme.md @@ -0,0 +1 @@ +# The takmiya keymap for meira From 17200f47123b839ee0a5e4f2dfd33a00dff09e90 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Jan 2018 14:21:01 -0800 Subject: [PATCH 022/556] Clean up and tweaks of drashna keymaps and userspace (#2200) * Minor tweaks modified: users/drashna/drashna.c * Fix Workman ASCII art * Add OSM for shifts * Make Viterbi's 00 code consistant * Minor Cleanup off Userspace * Change Tapping Term on Ergodox * Re-add EEPROM code * Minor updates and tweaks * Use QMK_H variables to make keymaps more universal * Forgot 'break;' for covecube layer * Tweak Viterbi files now that I have hands on * Add secrets to Ergodox * RGB tweaks to Viterbi * Viterbi RGB layout tweeks * Minor tweaks * Add One Shot Mod tap toggle * Add Faux Clicky to Viterbi, and disable controller's LEDs * Minor tweaks * Move D3 keycode defines into userspace * Updated Userspace Readme --- keyboards/ergodox_ez/keymaps/drashna/config.h | 11 ++- keyboards/ergodox_ez/keymaps/drashna/keymap.c | 51 +++++--------- keyboards/ergodox_ez/keymaps/drashna/rules.mk | 5 -- .../woodpad/keymaps/drashna/config.h | 2 +- keyboards/orthodox/keymaps/drashna/config.h | 13 ++-- keyboards/orthodox/keymaps/drashna/keymap.c | 8 +-- keyboards/orthodox/keymaps/drashna/rules.mk | 6 +- keyboards/orthodox/rev3/rules.mk | 3 - keyboards/viterbi/keymaps/drashna/config.h | 16 +++-- keyboards/viterbi/keymaps/drashna/keymap.c | 69 +++++++++++-------- keyboards/viterbi/keymaps/drashna/rules.mk | 5 -- users/drashna/drashna.c | 7 +- users/drashna/drashna.h | 29 +++++++- users/drashna/readme.md | 15 ++-- users/drashna/rules.mk | 2 +- 15 files changed, 133 insertions(+), 109 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/drashna/config.h b/keyboards/ergodox_ez/keymaps/drashna/config.h index 3d138e072..c0286f16a 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/config.h +++ b/keyboards/ergodox_ez/keymaps/drashna/config.h @@ -1,9 +1,8 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" +#include QMK_KEYBOARD_CONFIG_H -#define TAPPING_TERM 200 #ifdef RGBLIGHT_ENABLE #undef RGBLIGHT_SAT_STEP @@ -13,6 +12,12 @@ #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 #endif // RGBLIGHT_ENABLE -#define FORCE_NKRO +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 150 +#undef PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#define ONESHOT_TAP_TOGGLE 2 #endif diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 8743ae282..c7939de37 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -15,15 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" #include "drashna.h" -#include "keymap_german.h" - -#include "keymap_nordic.h" - @@ -31,18 +24,6 @@ along with this program. If not, see . bool skip_leds = false; -#ifdef TAP_DANCE_ENABLE -#define KC_D3_1 TD(TD_D3_1) -#define KC_D3_2 TD(TD_D3_2) -#define KC_D3_3 TD(TD_D3_3) -#define KC_D3_4 TD(TD_D3_4) -#else -#define KC_D3_1 KC_1 -#define KC_D3_2 KC_2 -#define KC_D3_3 KC_3 -#define KC_D3_4 KC_4 -#endif - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -71,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(_DIABLO), KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSHIFT, LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), + OSM(MOD_LSFT), LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), LT(_SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET, ALT_T(KC_APPLICATION), KC_LGUI, @@ -81,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, TG(_DIABLO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_QUOTE), - TG(_GAMEPAD), KC_N, KC_M, KC_COMMA, KC_DOT, RCTL_T(KC_SLASH),KC_RSHIFT, + TG(_GAMEPAD), KC_N, KC_M, KC_COMMA, KC_DOT, RCTL_T(KC_SLASH),OSM(MOD_RSFT), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), KC_RGUI, CTL_T(KC_ESCAPE), KC_PGUP, @@ -115,7 +96,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(_DIABLO), KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, ALT_T(KC_APP), KC_LGUI, KC_HOME, @@ -124,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(_DIABLO), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, KC_H, KC_N, KC_E, KC_I, KC_O, GUI_T(KC_QUOTE), - TG(_GAMEPAD),KC_K, KC_M, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), KC_RSHIFT, + TG(_GAMEPAD),KC_K, KC_M, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), OSM(MOD_RSFT), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), KC_RGUI, CTL_T(KC_ESC), KC_PGUP, @@ -156,9 +137,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DVORAK] = LAYOUT_ergodox( // left hand KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(_DIABLO), + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(_DIABLO), KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD), + OSM(MOD_LSFT), LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD), LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET, ALT_T(KC_APP), KC_LEAD, KC_HOME, @@ -167,7 +148,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, TG(_DIABLO), 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(_GAMEPAD),KC_B, KC_M, KC_W, KC_V, RCTL_T(KC_Z), KC_RSHIFT, + TG(_GAMEPAD),KC_B, KC_M, KC_W, KC_V, RCTL_T(KC_Z), OSM(MOD_RSFT), KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, TT(_SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, @@ -178,11 +159,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | + * | Del | Q | D | R | W | B | L1 | | L1 | J | F | U | P | ; | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' | + * | BkSp | A | S | H | T | D |------| |------| Y | N | E | O | I | ' | * |--------+------+------+------+------+------| OVER | | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | + * | LShift |Z/Ctrl| X | M | C | V | | | | K | L | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' @@ -201,7 +182,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(_DIABLO), KC_BSPC, KC_A, KC_S, KC_H, KC_T, KC_G, - KC_LSFT, LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD), + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD), LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, ALT_T(KC_APP), KC_LEAD, KC_HOME, @@ -210,7 +191,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(_DIABLO), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOTE, - TG(_GAMEPAD),KC_K, KC_L, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), KC_RSHIFT, + TG(_GAMEPAD),KC_K, KC_L, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), OSM(MOD_RSFT), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, @@ -239,7 +220,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ [_SYMB] = LAYOUT_ergodox( - KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_WORKMAN, + EPRM, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_WORKMAN, VRSN, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_DVORAK, KC_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE, KC_RESET, KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_COLEMAK, @@ -280,7 +261,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ [_GAMEPAD] = LAYOUT_ergodox( - KC_ESCAPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_ESCAPE, KC_TRNS, KC_TRNS, KC_TRNS, HYPR(KC_D), HYPR(KC_Q), HYPR(KC_GRV), KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, @@ -294,7 +275,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, - KC_NO, KC_NO, + KC_HYPR, MAGIC_TOGGLE_NKRO, KC_NO, KC_PGDOWN, KC_DELETE, KC_ENTER ), @@ -364,7 +345,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ [_MOUS] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_SECRET_1,KC_SECRET_2,KC_SECRET_3,KC_SECRET_4,KC_SECRET_5,KC_TRNS, KC_NO, KC_NO, KC_MS_U, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_NO, KC_NO, KC_TRNS, diff --git a/keyboards/ergodox_ez/keymaps/drashna/rules.mk b/keyboards/ergodox_ez/keymaps/drashna/rules.mk index bfeb6be49..6f30c5491 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/rules.mk +++ b/keyboards/ergodox_ez/keymaps/drashna/rules.mk @@ -4,8 +4,3 @@ COMMAND_ENABLE = no # Commands for debug and configuration RGBLIGHT_ENABLE = yes CONSOLE_ENABLE = no -EXTRAFLAGS = -flto - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/handwired/woodpad/keymaps/drashna/config.h b/keyboards/handwired/woodpad/keymaps/drashna/config.h index e505aac41..a35b60d36 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/config.h +++ b/keyboards/handwired/woodpad/keymaps/drashna/config.h @@ -17,7 +17,7 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" +#include QMK_KEYBOARD_CONFIG_H #ifdef TAP_DANCE_ENABLE #define TAPPING_TERM 200 diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 4dee43905..f39c34e76 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -22,7 +22,7 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "config_common.h" +#include QMK_KEYBOARD_CONFIG_H /* Use I2C or Serial, not both */ @@ -35,9 +35,14 @@ along with this program. If not, see . // #define MASTER_RIGHT #define EE_HANDS -#ifndef TAPPING_TERM -#define TAPPING_TERM 200 +#ifdef TAPPING_TERM +#undef TAPPING_TERM #endif +#define TAPPING_TERM 150 +#undef PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#define ONESHOT_TAP_TOGGLE 2 + /* key combination for command */ @@ -63,7 +68,7 @@ along with this program. If not, see . #ifdef AUDIO_ENABLE #define C6_AUDIO -#define STARTUP_SONG SONG(ZELDA_PUZZLE) +#define STARTUP_SONG SONG(ZELDA_TREASURE) #endif #endif diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index f5a18033e..af235f55d 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -50,24 +50,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = KEYMAP(\ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ + OSM(MOD_LSFT),CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ ), [_COLEMAK] = KEYMAP(\ KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ ), [_DVORAK] = KEYMAP(\ KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ + OSM(MOD_LSFT), CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ ), [_WORKMAN] = KEYMAP(\ KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ + OSM(MOD_LSFT), CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ ), [_LOWER] = KEYMAP(\ diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index 293faf13e..53a44424b 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -4,8 +4,4 @@ RGBLIGHT_ENABLE = yes AUDIO_ENABLE = no MOUSEKEY_ENABLE = no NKRO_ENABLE = yes -FAUXCLICKY_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +FAUXCLICKY_ENABLE = no diff --git a/keyboards/orthodox/rev3/rules.mk b/keyboards/orthodox/rev3/rules.mk index a0825b4ef..549b6a253 100644 --- a/keyboards/orthodox/rev3/rules.mk +++ b/keyboards/orthodox/rev3/rules.mk @@ -1,5 +1,2 @@ BACKLIGHT_ENABLE = no -ifndef QUANTUM_DIR - include ../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h index 8ac492a8a..617f01bb9 100644 --- a/keyboards/viterbi/keymaps/drashna/config.h +++ b/keyboards/viterbi/keymaps/drashna/config.h @@ -18,12 +18,12 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" +#include QMK_KEYBOARD_CONFIG_H + /* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C +// #define USE_SERIAL +#define USE_I2C /* Select hand configuration */ @@ -31,20 +31,26 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS +#ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 +#define RGBLED_NUM 16 #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 300 +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 +#endif // RGBLIGHT_ENABLE #ifdef AUDIO_ENABLE #define C6_AUDIO #endif +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE #endif diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index 4b41d4977..c29bae6ce 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" #include "drashna.h" extern keymap_config_t keymap_config; @@ -21,67 +19,84 @@ extern keymap_config_t keymap_config; #define MEDIA TG(_MEDIA) #define COVECUBE TG(_COVECUBE) +#ifdef FAUXCLICKY_ENABLE +float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A6, 2); // (_D4, 0.25); +float fauxclicky_released_note[2] = MUSICAL_NOTE(_A6, 2); // (_C4, 0.125); +float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 2); // (_C4, 0.25); +#define AUD_ON FC_ON +#define AUD_OFF FC_OFF +#else +#define AUD_ON AU_ON +#define AUD_OFF AU_OFF +#endif + enum more_custom_keycodes { - KC_KP_00 = NEW_SAFE_RANGE + KC_P00 = NEW_SAFE_RANGE }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMLOCK] = KEYMAP( - LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - MEDIA, KC_CALC, COVECUBE, KC_P7, KC_P8, KC_P9, KC_PAST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_KP_00,KC_PDOT, KC_PENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MEDIA, KC_CALC, COVECUBE,KC_P7, KC_P8, KC_P9, KC_PAST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_COLN, KC_PENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_DIABLO] = KEYMAP( - KC_ESC, DIABLO, KC_V, KC_D, XXXXXXX, XXXXXXX, KC_L, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_J, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_F, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LCTL, TD(TD_D3_1), TD(TD_D3_2), TD(TD_D3_3), TD(TD_D3_4), KC_Z, KC_DIABLO_CLEAR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LALT, KC_F4, KC_F5, KC_F8, KC_F9, KC_F10, SFT_T(KC_SPACE), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + KC_ESC, DIABLO, KC_V, KC_D, XXXXXXX, XXXXXXX, KC_L, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_J, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_F, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LCTL, KC_D3_3, KC_D3_3, KC_D3_3, KC_D3_3, KC_Z, KC_DIABLO_CLEAR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LALT, KC_F4, KC_F5, KC_F8, KC_F9, KC_F10, SFT_T(KC_SPACE), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_GAMEPAD] = KEYMAP( // Game pad layout designed primarily for Overwatch - LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_MACROS] = KEYMAP( - LMACRO, XXXXXXX, GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + LMACRO, KC_OVERWATCH,GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_SYMM, KC_TORB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_GLHF, KC_GOODGAME, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_GLHF, KC_GOODGAME, KC_GGEZ, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_SALT, KC_MORESALT, KC_SALTHARD, KC_JUSTGAME, KC_AIM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_COVECUBE] = KEYMAP( - COVECUBE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, COVECUBE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_MEDIA] = KEYMAP( - KC_RESET,KC_MAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - MEDIA, XXXXXXX, RGB_SAI, RGB_VAI, RGB_M_P, RGB_M_B, RGB_M_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - RGB_TOG, RGB_MOD, RGB_SAD, RGB_VAD, RGB_M_SW,RGB_M_SN,RGB_M_K, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, RGB_M_K, RGB_M_X, RGB_M_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + KC_MAKE, KC_RESET,XXXXXXX, AUD_ON, AUD_OFF, XXXXXXX, RGB_SAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MEDIA, XXXXXXX, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_MPLY, KC_MPRV, KC_MNXT, RGB_M_X, RGB_M_G, RGB_M_P, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ) }; +void matrix_init_keymap(void) { + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +} bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case KC_KP_00: + case KC_P00: if (record->event.pressed) { register_code(KC_KP_0); unregister_code(KC_KP_0); diff --git a/keyboards/viterbi/keymaps/drashna/rules.mk b/keyboards/viterbi/keymaps/drashna/rules.mk index 34b190370..9af36434c 100644 --- a/keyboards/viterbi/keymaps/drashna/rules.mk +++ b/keyboards/viterbi/keymaps/drashna/rules.mk @@ -5,8 +5,3 @@ RGBLIGHT_ENABLE = yes MOUSEKEY_ENABLE = no NKRO_ENABLE = yes -EXTRAFLAGS = -flto - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 95fb793a7..2ac0257b5 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -16,8 +16,6 @@ along with this program. If not, see . */ #include "drashna.h" -#include "quantum.h" -#include "action.h" #include "version.h" #if (__has_include("secrets.h")) @@ -450,8 +448,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ":dfu" #elif defined(BOOTLOADER_HALFKAY) ":teensy" -#elif defined(BOOTLOADER_CATERINA) - ":avrdude" +//#elif defined(BOOTLOADER_CATERINA) +// ":avrdude" #endif #ifdef RGBLIGHT_ENABLE " RGBLIGHT_ENABLE=yes" @@ -572,6 +570,7 @@ uint32_t layer_state_set_user(uint32_t state) { case _COVECUBE: rgblight_set_green; rgblight_mode(2); + break; default: if (default_layer & (1UL << _COLEMAK)) { rgblight_set_magenta; diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 0b9347f1d..2475c99d4 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -45,17 +45,27 @@ along with this program. If not, see . #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -#ifdef RGBLIGHT_ENABLE +#ifndef RGBLIGHT_ANIMATIONS // add "EXTRA_FLADS=-DDRASHNA_SETRGB" to enable this ... but don't +#define rgblight_set_blue rgblight_setrgb (0x00, 0x00, 0xFF); +#define rgblight_set_red rgblight_setrgb (0xFF, 0x00, 0x00); +#define rgblight_set_green rgblight_setrgb (0x00, 0xFF, 0x00); +#define rgblight_set_orange rgblight_setrgb (0xFF, 0x80, 0x00); +#define rgblight_set_teal rgblight_setrgb (0x00, 0xFF, 0xFF); +#define rgblight_set_magenta rgblight_setrgb (0xFF, 0x00, 0xFF); +#define rgblight_set_yellow rgblight_setrgb (0xFF, 0xFF, 0x00); +#define rgblight_set_purple rgblight_setrgb (0x7A, 0x00, 0xFF); +#define rgblight_set_white rgblight_setrgb (0xFF, 0xFF, 0xFF); +#else #define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); #define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); #define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); #define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); -#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); +#define rgblight_set_teal rgblight_sethsv (0xB4, 0xFF, 0xFF); #define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); #define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); #define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); #define rgblight_set_white rgblight_sethsv (0x00, 0x00, 0xFF); -#endif +#endif // DRASHNA_SETRGB extern bool is_overwatch; extern bool rgb_layer_change; @@ -103,6 +113,17 @@ enum { }; #endif +#ifdef TAP_DANCE_ENABLE +#define KC_D3_1 TD(TD_D3_1) +#define KC_D3_2 TD(TD_D3_2) +#define KC_D3_3 TD(TD_D3_3) +#define KC_D3_4 TD(TD_D3_4) +#else +#define KC_D3_1 KC_1 +#define KC_D3_2 KC_2 +#define KC_D3_3 KC_3 +#define KC_D3_4 KC_4 +#endif #define QMK_KEYS_PER_SCAN 8 @@ -110,4 +131,6 @@ enum { #define RGBLIGHT_SLEEP #endif +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + #endif diff --git a/users/drashna/readme.md b/users/drashna/readme.md index 0523be2a6..e77948ea9 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -4,19 +4,26 @@ Overview This is my personal userspace file. Most of my code exists here, as it's heavily shared. -Custom handlers ---------------- +Custom userspace handlers +------------------------- + +Specifically QMK works by using customized handlers for everything. This allows for multiple levels of customization. + +`matrix_scan` calls `matrix_scan_quantum`, which alls `matrix_scan_kb`, which calls `matrix_scan_user`. +`process_record` calls a bunch of stuff, but eventually calls `process_record_kb` which calls `process_record_user` +The same goes for `matrix_init`, `layer_state_set`, `led_set`, and a few other functions. All (most) `_user` functions are handled here instead. To allow keyboard specific configuration, I've created `_keymap` functions that can be called by the keymap.c files instead. This allows for keyboard specific configuration while maintaining the ability to customize the board. -My Ergodox EZ Keymap is a good example of this, as it uses the LEDs as modifier indicators. +My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/drashna/keymap.c#L399) is a good example of this, as it uses the LEDs as modifier indicators. + Custom Keycodes --------------- -Keycods are defined in the drashna.h file and need to be included in the keymap.c files, so that they can be used there. +Keycodes are defined in the drashna.h file and need to be included in the keymap.c files, so that they can be used there. A bunch of macros are present and are only included on boards that are not the Ergodox EZ or Orthodox, as they are not needed for those boards. diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 6ce1ff5ba..ab2ab607d 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,3 +1,3 @@ SRC += drashna.c -EXTRAFLAGS = -flto +EXTRAFLAGS += -flto From 492a16308ae890a8d9c29383a1ffddcc1febfb47 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Thu, 28 Dec 2017 17:58:36 -0800 Subject: [PATCH 023/556] wanleg's gherkin layout my layout for the Gherkin --- keyboards/gherkin/keymaps/wanleg/config.h | 61 ++++++ keyboards/gherkin/keymaps/wanleg/keymap.c | 221 +++++++++++++++++++++ keyboards/gherkin/keymaps/wanleg/readme.md | 12 ++ keyboards/gherkin/keymaps/wanleg/rules.mk | 63 ++++++ 4 files changed, 357 insertions(+) create mode 100644 keyboards/gherkin/keymaps/wanleg/config.h create mode 100644 keyboards/gherkin/keymaps/wanleg/keymap.c create mode 100644 keyboards/gherkin/keymaps/wanleg/readme.md create mode 100644 keyboards/gherkin/keymaps/wanleg/rules.mk diff --git a/keyboards/gherkin/keymaps/wanleg/config.h b/keyboards/gherkin/keymaps/wanleg/config.h new file mode 100644 index 000000000..6b69b2150 --- /dev/null +++ b/keyboards/gherkin/keymaps/wanleg/config.h @@ -0,0 +1,61 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 40 Percent Club +#define PRODUCT Gherkin +#define DESCRIPTION A 30 key ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +/*tap dance definition */ +#define TAPPING_TERM 200 + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/gherkin/keymaps/wanleg/keymap.c b/keyboards/gherkin/keymaps/wanleg/keymap.c new file mode 100644 index 000000000..b16c15a90 --- /dev/null +++ b/keyboards/gherkin/keymaps/wanleg/keymap.c @@ -0,0 +1,221 @@ +/* Copyright 2017 Brian Fong + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "gherkin.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QW 0 +#define DIR 1 +#define NUM 2 +#define ETC 3 + + +/////////////// TAP DANCE SECTION START /////////////// +//Tap Dance Declarations (list of my tap dance configurations) +enum { + TD_SFT_CAPS = 0 + ,TD_Q_ESC + ,ENT_TAP_DANCE + ,DEL_TAP_DANCE +}; + +///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION START ///// +///// (no need to edit this section) ///// +//Enums used to clearly convey the state of the tap dance +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP + // Add more enums here if you want for triple, quadruple, etc. +}; + +typedef struct { + bool is_press_action; + int state; +} tap; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP + if (state->interrupted || !state->pressed) return SINGLE_TAP; + if (state->interrupted) return SINGLE_TAP; + else return SINGLE_HOLD; + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else return 6; //magic number. At some point this method will expand to work for more presses +} +///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END ///// +///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START ///// +//instantialize an instance of 'tap' for the 'ENT' tap dance. +static tap ENTtap_state = { + .is_press_action = true, + .state = 0 +}; + +void ENT_finished (qk_tap_dance_state_t *state, void *user_data) { + ENTtap_state.state = cur_dance(state); + switch (ENTtap_state.state) { + case SINGLE_TAP: register_code(KC_SPC); break; + case SINGLE_HOLD: register_code(KC_LSFT); break; + case DOUBLE_TAP: register_code(KC_ENT); break; + case DOUBLE_HOLD: register_code(KC_NO); break; // setting double hold to do nothing (change this if you want) + case DOUBLE_SINGLE_TAP: register_code(KC_SPC); unregister_code(KC_SPC); register_code(KC_SPC); + //Last case is for fast typing. Assuming your key is `f`: + //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`. + //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms. + } +} + +void ENT_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (ENTtap_state.state) { + case SINGLE_TAP: unregister_code(KC_SPC); break; + case SINGLE_HOLD: unregister_code(KC_LSFT); break; + case DOUBLE_TAP: unregister_code(KC_ENT); break; + case DOUBLE_HOLD: unregister_code(KC_NO); + case DOUBLE_SINGLE_TAP: unregister_code(KC_SPC); + } + ENTtap_state.state = 0; +} + +//instanalize an instance of 'tap' for the 'DEL' tap dance. +static tap DELtap_state = { + .is_press_action = true, + .state = 0 +}; + +void DEL_finished (qk_tap_dance_state_t *state, void *user_data) { + DELtap_state.state = cur_dance(state); + switch (DELtap_state.state) { + case SINGLE_TAP: register_code(KC_BSPC); break; + case SINGLE_HOLD: register_code(KC_LCTL); break; + case DOUBLE_TAP: register_code(KC_DEL); break; + case DOUBLE_HOLD: register_code(KC_NO); break; + case DOUBLE_SINGLE_TAP: register_code(KC_BSPC); unregister_code(KC_BSPC); register_code(KC_BSPC); + } +} + +void DEL_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (DELtap_state.state) { + case SINGLE_TAP: unregister_code(KC_BSPC); break; + case SINGLE_HOLD: unregister_code(KC_LCTL); break; + case DOUBLE_TAP: unregister_code(KC_DEL); break; + case DOUBLE_HOLD: unregister_code(KC_NO); + case DOUBLE_SINGLE_TAP: unregister_code(KC_BSPC); + } + DELtap_state.state = 0; +} +///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END ///// + +//Tap Dance Definitions +//THIS SECTION HAS TO BE AT THE END OF THE TAP DANCE SECTION +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +// Other declarations would go here, separated by commas, if you have them + ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) + ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset) + ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset) +}; + +//In Layer declaration, add tap dance item in place of a key code +//TD(TD_SFT_CAPS) + +///////////// TAP DANCE SECTION END /////////////// + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * .-----------------------------------------------------------------------------------------. + * | Q//ESC | W | E | R | T | Y | U | I | O | P | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | A | S | D | F | G | H | J | K | L | ENTER | + * | | | | | | | | | |SFThold | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BKSC | + * | SFThold| | | | | | | | |CTRLhold| + * '-----------------------------------------------------------------------------------------' + */ + + [_QW] = KEYMAP( /* Qwerty*/ + TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC), + SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V), LT(ETC, KC_B), KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) + ), + + +// +///* +// * Directional Modifiers +// * .-----------------------------------------------------------------------------------------. +// * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +// * | left | down | right | PrScr | SHIFT | CTRL | PgDn | END | [ | ] | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +// * | | | | | | | | | ALT | / | +// * '-----------------------------------------------------------------------------------------' +// */ +// +[DIR] = KEYMAP( /* Directional Modifiers */ + KC_TAB, KC_UP, KC_TRNS, KC_INS, KC_LCTL, KC_RSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL , + KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC , + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_SLSH +), +// +// /* +// * Numbers +// * .-----------------------------------------------------------------------------------------. +// * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +// * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +// * | F11 | F12 | | | | ENTER | SHIFT | GUI | ./ALT | BKSC | +// * | | | | | | | | | |CTRLhold| +// * '-----------------------------------------------------------------------------------------' +// */ +// +[NUM] = KEYMAP ( /* Numbers */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 , + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 , + KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC) +), +// +// +// /* +// * ETC +// * .-----------------------------------------------------------------------------------------. +// * | ` | | | | | | | | | \ | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +// * | CAPS | P-Brk | | | | | | | ; | ' | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +// * | SHIFT | | | | | C-A-D | | GUI | | DEL | +// * '-----------------------------------------------------------------------------------------' +// */ +// +[ETC] = KEYMAP( /* ETC */ + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS , + KC_CAPS, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT , + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LALT(LCTL(KC_DEL)), KC_TRNS, KC_RGUI, KC_TRNS, KC_DEL + ), +}; diff --git a/keyboards/gherkin/keymaps/wanleg/readme.md b/keyboards/gherkin/keymaps/wanleg/readme.md new file mode 100644 index 000000000..a364fcabc --- /dev/null +++ b/keyboards/gherkin/keymaps/wanleg/readme.md @@ -0,0 +1,12 @@ +![Gherkin Wanleg Layout Image](https://i.imgur.com/RpN5N42.png) + +# Gherkin Wanleg Layout + +Here is the layout I came up with to preserve a standard QWERTY layout as much as possible, in as few layers as possible for a 30 key board. +I originally set up a few Tap Dance keys, but eventually dropped most of them in favor of chorded versions, since in actual use, they tended to impede typing speed more than their (current) two-key versions. +I've left them in my layout ready for use if anyone wants to try them out: +Single tap - Double tap - Hold +space - enter - shift +backspace - delete - control +shift - caps lock - XXXX +KC_Q - escape - XXXX \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/wanleg/rules.mk b/keyboards/gherkin/keymaps/wanleg/rules.mk new file mode 100644 index 000000000..06e66c16e --- /dev/null +++ b/keyboards/gherkin/keymaps/wanleg/rules.mk @@ -0,0 +1,63 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # 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 +SLEEP_LED_ENABLE = no # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no +TAP_DANCE_ENABLE = yes # Enable Tap Dance (comment if not being implemented) \ No newline at end of file From 85ea96393131e4080737f574c93b001cbc99d46d Mon Sep 17 00:00:00 2001 From: James Neill <895886+jmsnll@users.noreply.github.com> Date: Mon, 1 Jan 2018 22:32:39 +0000 Subject: [PATCH 024/556] Remove residual Makefiles from the keyboards directory (#2193) * Removed residual Makefiles from keyboards directory * Removed reference to Makefile --- .../teensy_lc_onekey/Makefile.3.0 | 77 ------------------- .../teensy_lc_onekey/Makefile.3.2 | 77 ------------------- .../clueboard/66/keymaps/bloodlvst/Makefile | 2 - .../clueboard/66/keymaps/mouse_keys/Makefile | 1 - .../clueboard/66/keymaps/mrscooty/Makefile | 4 - .../clueboard/66/keymaps/serubin/Makefile | 4 - .../clueboard/66/keymaps/tetris/Makefile | 1 - .../clueboard/66/keymaps/xyverz/Makefile | 49 ------------ keyboards/nyquist/keymaps/pitty/Makefile | 7 -- keyboards/orthodox/rev3/rules.mk | 1 - keyboards/planck/keymaps/fabian/Makefile | 3 - keyboards/planck/keymaps/matrixman/Makefile | 5 -- keyboards/xd75/keymaps/atomic_style/Makefile | 18 ----- keyboards/xd75/keymaps/kim-kim-xd73/Makefile | 21 ----- keyboards/xd75/keymaps/kim-kim/Makefile | 21 ----- 15 files changed, 291 deletions(-) delete mode 100644 keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 delete mode 100644 keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 delete mode 100644 keyboards/clueboard/66/keymaps/bloodlvst/Makefile delete mode 100644 keyboards/clueboard/66/keymaps/mouse_keys/Makefile delete mode 100644 keyboards/clueboard/66/keymaps/mrscooty/Makefile delete mode 100644 keyboards/clueboard/66/keymaps/serubin/Makefile delete mode 100644 keyboards/clueboard/66/keymaps/tetris/Makefile delete mode 100644 keyboards/clueboard/66/keymaps/xyverz/Makefile delete mode 100644 keyboards/nyquist/keymaps/pitty/Makefile delete mode 100644 keyboards/planck/keymaps/fabian/Makefile delete mode 100644 keyboards/planck/keymaps/matrixman/Makefile delete mode 100644 keyboards/xd75/keymaps/atomic_style/Makefile delete mode 100644 keyboards/xd75/keymaps/kim-kim-xd73/Makefile delete mode 100644 keyboards/xd75/keymaps/kim-kim/Makefile diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 deleted file mode 100644 index dbf12c363..000000000 --- a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 +++ /dev/null @@ -1,77 +0,0 @@ -# Target file name (without extension). -PROJECT = ch - -# Directory common source files exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -MCU_FAMILY = KINETIS -MCU_SERIES = K20x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -MCU_LDSCRIPT = MK20DX128 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 -# - k20x7 for Teensy 3.1 and 3.2 -MCU_STARTUP = k20x5 - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -BOARD = PJRC_TEENSY_3 - -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -ARMV = 7 - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - -include $(TMK_DIR)/tool/chibios/common.mk -include $(TMK_DIR)/tool/chibios/chibios.mk diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 deleted file mode 100644 index 41bfa41a0..000000000 --- a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 +++ /dev/null @@ -1,77 +0,0 @@ -# Target file name (without extension). -PROJECT = ch - -# Directory common source files exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -MCU_FAMILY = KINETIS -MCU_SERIES = K20x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -MCU_LDSCRIPT = MK20DX256 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 -# - k20x7 for Teensy 3.1 and 3.2 -MCU_STARTUP = k20x7 - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -BOARD = PJRC_TEENSY_3_1 - -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -ARMV = 7 - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - -include $(TMK_DIR)/tool/chibios/common.mk -include $(TMK_DIR)/tool/chibios/chibios.mk diff --git a/keyboards/clueboard/66/keymaps/bloodlvst/Makefile b/keyboards/clueboard/66/keymaps/bloodlvst/Makefile deleted file mode 100644 index b1c2f32f6..000000000 --- a/keyboards/clueboard/66/keymaps/bloodlvst/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -EXTRAKEY_ENABLE = yes -COMMAND_ENABLE = no diff --git a/keyboards/clueboard/66/keymaps/mouse_keys/Makefile b/keyboards/clueboard/66/keymaps/mouse_keys/Makefile deleted file mode 100644 index 6c605daec..000000000 --- a/keyboards/clueboard/66/keymaps/mouse_keys/Makefile +++ /dev/null @@ -1 +0,0 @@ -MOUSEKEY_ENABLE = yes diff --git a/keyboards/clueboard/66/keymaps/mrscooty/Makefile b/keyboards/clueboard/66/keymaps/mrscooty/Makefile deleted file mode 100644 index ba997f869..000000000 --- a/keyboards/clueboard/66/keymaps/mrscooty/Makefile +++ /dev/null @@ -1,4 +0,0 @@ - -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes - diff --git a/keyboards/clueboard/66/keymaps/serubin/Makefile b/keyboards/clueboard/66/keymaps/serubin/Makefile deleted file mode 100644 index ba997f869..000000000 --- a/keyboards/clueboard/66/keymaps/serubin/Makefile +++ /dev/null @@ -1,4 +0,0 @@ - -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes - diff --git a/keyboards/clueboard/66/keymaps/tetris/Makefile b/keyboards/clueboard/66/keymaps/tetris/Makefile deleted file mode 100644 index 461353129..000000000 --- a/keyboards/clueboard/66/keymaps/tetris/Makefile +++ /dev/null @@ -1 +0,0 @@ -SRC = tetris_text.c diff --git a/keyboards/clueboard/66/keymaps/xyverz/Makefile b/keyboards/clueboard/66/keymaps/xyverz/Makefile deleted file mode 100644 index 950dadf84..000000000 --- a/keyboards/clueboard/66/keymaps/xyverz/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# make flip-ee = Download the eeprom file to the device, using Atmel FLIP -# (must have Atmel FLIP installed). -# -# make debug = Start either simulavr or avarice as specified for debugging, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - -# Build Options -# change to "no" to disable the options, or define them in the makefile.mk in -# the appropriate keymap folder that will get included automatically -# -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/nyquist/keymaps/pitty/Makefile b/keyboards/nyquist/keymaps/pitty/Makefile deleted file mode 100644 index 48c5e08dd..000000000 --- a/keyboards/nyquist/keymaps/pitty/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -RGBLIGHT_ENABLE = yes -NKRO_ENABLE = yes - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/orthodox/rev3/rules.mk b/keyboards/orthodox/rev3/rules.mk index 549b6a253..7b30c0bef 100644 --- a/keyboards/orthodox/rev3/rules.mk +++ b/keyboards/orthodox/rev3/rules.mk @@ -1,2 +1 @@ BACKLIGHT_ENABLE = no - diff --git a/keyboards/planck/keymaps/fabian/Makefile b/keyboards/planck/keymaps/fabian/Makefile deleted file mode 100644 index 457a3d01d..000000000 --- a/keyboards/planck/keymaps/fabian/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/matrixman/Makefile b/keyboards/planck/keymaps/matrixman/Makefile deleted file mode 100644 index 159f80be9..000000000 --- a/keyboards/planck/keymaps/matrixman/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -MOUSEKEY_ENABLE = yes -BACKLIGHT_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/atomic_style/Makefile b/keyboards/xd75/keymaps/atomic_style/Makefile deleted file mode 100644 index d4e08cfb2..000000000 --- a/keyboards/xd75/keymaps/atomic_style/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2013 Jun Wako -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/kim-kim-xd73/Makefile b/keyboards/xd75/keymaps/kim-kim-xd73/Makefile deleted file mode 100644 index d993e2ef8..000000000 --- a/keyboards/xd75/keymaps/kim-kim-xd73/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2013 Jun Wako -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -BACKLIGHT_ENABLE = yes diff --git a/keyboards/xd75/keymaps/kim-kim/Makefile b/keyboards/xd75/keymaps/kim-kim/Makefile deleted file mode 100644 index d993e2ef8..000000000 --- a/keyboards/xd75/keymaps/kim-kim/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2013 Jun Wako -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -BACKLIGHT_ENABLE = yes From eba4cb7a0437c115c56dfe1796a76c69a99c4d4f Mon Sep 17 00:00:00 2001 From: Kenneth Aloysius Date: Tue, 2 Jan 2018 09:34:46 +1100 Subject: [PATCH 025/556] RGB underglow support for JJ40, clean up redundant code in Mechmini keymap (#2196) * Cleanup Mechmini keymap. Once the custom RGB function is defined, there is no need to manually handle RGB code. * Change default to KEYMAP_MIT, not KEYMAP_OFFSET * Add custom RGB code for JJ40 * Reset Mechmini advertised power draw to 500. Will have to test actual maximum power draw later. * RGB working on JJ40. * Fix: saturation increase/decrease flipped * Add new directory for my custom keymap with RGB keycodes * Swap LAlt and LGUI * Update JJ40 max power draw with measured value * Update: fun40 rules.mk to enable underglow; earlier failed Travis CI --- keyboards/jj40/config.h | 9 ++ keyboards/jj40/jj40.c | 32 +++--- keyboards/jj40/jj40.h | 2 +- keyboards/jj40/keymaps/fun40/rules.mk | 6 +- keyboards/jj40/keymaps/krusli/keymap.c | 85 ++++++++++++++ keyboards/jj40/keymaps/krusli/readme.md | 2 + keyboards/jj40/rules.mk | 9 +- keyboards/jj40/usbconfig.h | 3 +- keyboards/mechmini/config.h | 7 +- keyboards/mechmini/keymaps/default/keymap.c | 118 +------------------- keyboards/mechmini/mechmini.c | 7 +- keyboards/mechmini/usbconfig.h | 2 +- 12 files changed, 143 insertions(+), 139 deletions(-) create mode 100644 keyboards/jj40/keymaps/krusli/keymap.c create mode 100644 keyboards/jj40/keymaps/krusli/readme.md diff --git a/keyboards/jj40/config.h b/keyboards/jj40/config.h index 02339a33f..3152f22be 100644 --- a/keyboards/jj40/config.h +++ b/keyboards/jj40/config.h @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config_common.h" + #ifndef CONFIG_H #define CONFIG_H @@ -39,6 +41,13 @@ along with this program. If not, see . #define NO_UART 1 +/* RGB underglow */ +// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. +#define RGBLED_NUM 5 +#define RGB_DI_PIN E2 +#define RGBLIGHT_ANIMATIONS + /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/jj40/jj40.c b/keyboards/jj40/jj40.c index d5add2a6b..6044e83fd 100644 --- a/keyboards/jj40/jj40.c +++ b/keyboards/jj40/jj40.c @@ -22,19 +22,25 @@ along with this program. If not, see . #include "action_layer.h" #include "quantum.h" +#include "i2c.h" + +// custom RGB driver +extern rgblight_config_t rgblight_config; +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i=0; i. { K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \ } -#define KEYMAP KEYMAP_OFFSET +#define KEYMAP KEYMAP_MIT #endif diff --git a/keyboards/jj40/keymaps/fun40/rules.mk b/keyboards/jj40/keymaps/fun40/rules.mk index cd2208edd..6fe3b0515 100644 --- a/keyboards/jj40/keymaps/fun40/rules.mk +++ b/keyboards/jj40/keymaps/fun40/rules.mk @@ -11,7 +11,11 @@ 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. + +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +DISABLE_WS2812 = yes + SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/jj40/keymaps/krusli/keymap.c b/keyboards/jj40/keymaps/krusli/keymap.c new file mode 100644 index 000000000..59e3988e1 --- /dev/null +++ b/keyboards/jj40/keymaps/krusli/keymap.c @@ -0,0 +1,85 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "jj40.h" +#include "action_layer.h" + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + _______, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | RGB | RGB | RGB | RGB |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | RGB | RGB | RGB | RGB | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, \ + _______, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +) +}; diff --git a/keyboards/jj40/keymaps/krusli/readme.md b/keyboards/jj40/keymaps/krusli/readme.md new file mode 100644 index 000000000..75a84d0e6 --- /dev/null +++ b/keyboards/jj40/keymaps/krusli/readme.md @@ -0,0 +1,2 @@ +# krusli +Default JJ40 keymap, adapted with RGB underglow support. GUI and LAlt is also swapped. diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk index c6279a2a5..cdc898c0f 100644 --- a/keyboards/jj40/rules.mk +++ b/keyboards/jj40/rules.mk @@ -26,7 +26,7 @@ F_CPU = 12000000 # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = bootloadHID @@ -37,8 +37,11 @@ EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no COMMAND_ENABLE = yes BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no -RGBLIGHT_CUSTOM_DRIVER = no + +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +DISABLE_WS2812 = yes # TODO check if this is necessary + KEY_LOCK_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/jj40/usbconfig.h b/keyboards/jj40/usbconfig.h index cae839e74..520d08f61 100644 --- a/keyboards/jj40/usbconfig.h +++ b/keyboards/jj40/usbconfig.h @@ -118,7 +118,8 @@ section at the end of this file). /* Define this to 1 if the device has its own power supply. Set it to 0 if the * device is powered from the USB bus. */ -#define USB_CFG_MAX_BUS_POWER 500 +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 150 /* Set this variable to the maximum USB bus power consumption of your device. * The value is in milliamperes. [It will be divided by two since USB * communicates power requirements in units of 2 mA.] diff --git a/keyboards/mechmini/config.h b/keyboards/mechmini/config.h index e7004608e..6a4523f85 100644 --- a/keyboards/mechmini/config.h +++ b/keyboards/mechmini/config.h @@ -30,12 +30,15 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 15 +#define NO_UART 1 + +/* RGB underglow */ +// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. #define RGBLED_NUM 16 #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN E2 -#define NO_UART 1 - /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/mechmini/keymaps/default/keymap.c b/keyboards/mechmini/keymaps/default/keymap.c index 5cae1bc81..4a0a4dc0a 100644 --- a/keyboards/mechmini/keymaps/default/keymap.c +++ b/keyboards/mechmini/keymaps/default/keymap.c @@ -14,16 +14,12 @@ along with this program. If not, see . */ #include "mechmini.h" -#include "rgblight.h" #include "quantum.h" -#define MAX_BRIGHTNESS 15 -#define MAX_BRIGHTNESS_IOS 5 // max brightness suitable for iOS devices - -#define _BL 0 -#define _FN1 1 -#define _FN2 2 -#define _FN3 3 +#define _BL 0 // base layer +#define _FN1 1 // function layer 1 +#define _FN2 2 // function layer 2 +#define _FN3 3 // function layer 3 #define _____ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -52,109 +48,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _____, _____, _____, _____, _____, _____, _____, _____ ) }; - -/** - * Blank keymap - [0] = KEYMAP( - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, - _____, _____, _____, _____, _____, _____, _____, _____ - ) - */ - -uint8_t current_level = 4; -int is_on = 0; - -uint8_t r = 0xFF; -uint8_t g = 0xFF; -uint8_t b = 0xFF; - -uint8_t max_brightness = MAX_BRIGHTNESS_IOS; - -enum macro_id { - TOGGLE_RGB, - BRIGHTNESS_DOWN, - BRIGHTNESS_UP, - COLOR_1, - COLOR_2, - COLOR_3, - ENABLE_MAX_BRIGHTNESS -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - - switch (id) { - case TOGGLE_RGB: - if (event.pressed) { - if (!is_on) { - current_level = 4; - is_on = 1; - } else { - is_on = 0; - } - } - case BRIGHTNESS_DOWN: - if (event.pressed && current_level > 0) { - current_level--; - } - break; - case BRIGHTNESS_UP: - if (event.pressed && current_level < max_brightness) { - current_level++; - } - break; - case COLOR_1: // set to pink - if (event.pressed) { - r = 0xFF; - g = 0x81; - b = 0xC2; - } - break; - case COLOR_2: // set to cyan - if (event.pressed) { - r = 0x00; - g = 0xE0; - b = 0xFF; - } - break; - case COLOR_3: // set to white - if (event.pressed) { - r = 0xFF; - g = 0xFF; - b = 0xFF; - } - break; - case ENABLE_MAX_BRIGHTNESS: // enable all 16 brightness steps - if (event.pressed) { - max_brightness = MAX_BRIGHTNESS; - } - break; - } - - return MACRO_NONE; -} - -const uint16_t fn_actions[] PROGMEM = { -}; - -void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); - -uint8_t dim(uint8_t color, uint8_t opacity) { - return ((uint16_t) color * opacity / 0xFF) & 0xFF; -} - -void user_setrgb(uint8_t r, uint8_t g, uint8_t b) { - uint8_t alpha = current_level * 0x11; - rgblight_setrgb(dim(r, alpha), dim(g, alpha), dim(b, alpha)); -} - -void matrix_scan_user(void) { - if (!is_on) { - current_level = 0; - user_setrgb(r, g, b); - } else { - user_setrgb(r, g, b); - } -} diff --git a/keyboards/mechmini/mechmini.c b/keyboards/mechmini/mechmini.c index baa2e0357..9897da099 100644 --- a/keyboards/mechmini/mechmini.c +++ b/keyboards/mechmini/mechmini.c @@ -16,16 +16,16 @@ along with this program. If not, see . */ #include "mechmini.h" -#include "rgblight.h" - #include #include "action_layer.h" #include "i2c.h" #include "quantum.h" -extern rgblight_config_t rgblight_config; +#include "rgblight.h" +// custom RGB driver +extern rgblight_config_t rgblight_config; void rgblight_set(void) { if (!rgblight_config.enable) { for (uint8_t i = 0; i < RGBLED_NUM; i++) { @@ -42,4 +42,5 @@ void rgblight_set(void) { __attribute__ ((weak)) void matrix_scan_user(void) { rgblight_task(); + /* add other tasks to be done on each matrix scan */ } diff --git a/keyboards/mechmini/usbconfig.h b/keyboards/mechmini/usbconfig.h index b6b8cdbbb..d2d848fcd 100644 --- a/keyboards/mechmini/usbconfig.h +++ b/keyboards/mechmini/usbconfig.h @@ -118,7 +118,7 @@ section at the end of this file). /* Define this to 1 if the device has its own power supply. Set it to 0 if the * device is powered from the USB bus. */ -#define USB_CFG_MAX_BUS_POWER 100 +#define USB_CFG_MAX_BUS_POWER 500 /* Set this variable to the maximum USB bus power consumption of your device. * The value is in milliamperes. [It will be divided by two since USB * communicates power requirements in units of 2 mA.] From d6215ad6aff3857cea8a6877b56a547a76ab13ac Mon Sep 17 00:00:00 2001 From: John Ramsay <34961240+ramsayjp@users.noreply.github.com> Date: Tue, 2 Jan 2018 09:35:32 +1100 Subject: [PATCH 026/556] Aviator Keymap (#2204) * Create aviator.txt * Add files via upload * Delete aviator.txt * Delete readme.md * Add files via upload * Update readme.md * Update readme.md * Delete keyboard-layout.png * Update readme.md * Update readme.md * Update readme.md --- keyboards/planck/keymaps/aviator/config.h | 44 ++++ .../keymaps/aviator/keyboard-layout.json | 138 ++++++++++++ keyboards/planck/keymaps/aviator/keymap.c | 198 ++++++++++++++++++ keyboards/planck/keymaps/aviator/readme.md | 68 ++++++ keyboards/planck/keymaps/aviator/rules.mk | 1 + 5 files changed, 449 insertions(+) create mode 100644 keyboards/planck/keymaps/aviator/config.h create mode 100644 keyboards/planck/keymaps/aviator/keyboard-layout.json create mode 100644 keyboards/planck/keymaps/aviator/keymap.c create mode 100644 keyboards/planck/keymaps/aviator/readme.md create mode 100644 keyboards/planck/keymaps/aviator/rules.mk diff --git a/keyboards/planck/keymaps/aviator/config.h b/keyboards/planck/keymaps/aviator/config.h new file mode 100644 index 000000000..6bc53cf57 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/config.h @@ -0,0 +1,44 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +#define BACKLIGHT_BREATHING + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/aviator/keyboard-layout.json b/keyboards/planck/keymaps/aviator/keyboard-layout.json new file mode 100644 index 000000000..84af51859 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/keyboard-layout.json @@ -0,0 +1,138 @@ +[ + { + "name": "The Aviator", + "author": "John Ramsay", + "notes": "Designed for aeronautical data entry on the OLKB Planck.", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Green", + "plate": true + }, + [ + { + "c": "#ADADAD", + "t": "#000000\n#3f76d4\n#d67509" + }, + "\nDel\nDel\n\n\n\n\n\n\nEsc", + { + "c": "#CDC1B0" + }, + "\n!\nF1\n\n\n\n\n\n\nQ", + "\n@\nF2\n\n\n\n\n\n\nW", + "\n#\nF3\n\n\n\n\n\n\nE", + "\n$\nF4\n\n\n\n\n\n\nR", + "\n%\n\n\n\n\n\n\n\nT", + "\n^\nN\n\n\n\n\n\n\nY", + "\n&\nS\n\n\n\n\n\n\nU", + "\n*\n7\n\n\n\n\n\n\nI", + "\n(\n8\n\n\n\n\n\n\nO", + "\n)\n9\n\n\n\n\n\n\nP", + { + "c": "#ADADAD", + "t": "#000000", + "a": 7 + }, + "Back Space" + ], + [ + "Tab", + { + "c": "#CDC1B0", + "t": "#000000\n#3f76d4\n#d67509", + "a": 4 + }, + "\n~\nF5\n\n\n\n\n\n\nA", + "\n`\nF6\n\n\n\n\n\n\nS", + { + "t": "#000000\n\n#d67509" + }, + "\n\nF7\n\n\n\n\n\n\nD", + "\n\nF8\n\n\n\n\n\n\nF", + { + "t": "#000000", + "a": 7 + }, + "G", + { + "t": "#000000\n\n#d67509", + "a": 4 + }, + "\n\nE\n\n\n\n\n\n\nH", + { + "t": "#000000\n#3f76d4\n#d67509" + }, + "\n_\nW\n\n\n\n\n\n\nJ", + "\n+\n4\n\n\n\n\n\n\nK", + "\n{\n5\n\n\n\n\n\n\nL", + "\n}\n6\n\n\n\n\n\n\n:\n;", + "\n\\\nTab\n\n\n\n\n\n\n\"\n'" + ], + [ + { + "c": "#ADADAD", + "t": "#000000", + "a": 7 + }, + "Shift", + { + "c": "#CDC1B0", + "t": "#000000\n\n#d67509", + "a": 4 + }, + "\n\nF9\n\n\n\n\n\n\nZ", + "\n\nF10\n\n\n\n\n\n\nX", + "\n\nF11\n\n\n\n\n\n\nC", + "\n\nF12\n\n\n\n\n\n\nV", + { + "t": "#000000", + "a": 7 + }, + "B", + { + "t": "#000000\n\n#d67509", + "a": 4 + }, + "\n\n+\n\n\n\n\n\n\nN", + { + "t": "#000000\n#3f76d4\n#d67509" + }, + "\n-\n-\n\n\n\n\n\n\nM", + "\n=\n1\n\n\n\n\n\n\n<\n,", + "\n[\n2\n\n\n\n\n\n\n>\n.", + "\n]\n3\n\n\n\n\n\n\n?\n/", + { + "c": "#ADADAD", + "t": "#000000", + "a": 7 + }, + "Return" + ], + [ + "Fn", + "Ctrl", + "Alt", + "Meta", + { + "c": "#9FACBF" + }, + "⇓", + { + "c": "#CDC1B0" + }, + "", + "", + { + "c": "#E5A65B" + }, + "⇑", + { + "c": "#ADADAD", + "t": "#000000\n#3f76d4\n#d67509", + "a": 4 + }, + "\nHome\n0\n\n\n\n\n\n\n←", + "\nPDwn\n.\n\n\n\n\n\n\n↓", + "\nPUp\nShift\n\n\n\n\n\n\n↑", + "\nEnd\nReturn\n\n\n\n\n\n\n→" + ] +] \ No newline at end of file diff --git a/keyboards/planck/keymaps/aviator/keymap.c b/keyboards/planck/keymaps/aviator/keymap.c new file mode 100644 index 000000000..97d2bd063 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/keymap.c @@ -0,0 +1,198 @@ +/* Copyright 2017 John Ramsay + * Aviator Keymap v1.0 + * + * Designed for aeronautical data entry on the OLKB Planck. + */ + + #include "planck.h" + #include "action_layer.h" + + extern keymap_config_t keymap_config; + + enum planck_layers { + _QWERTY, + _DATA, + _LOWER, + _RAISE, + _ADJUST + }; + + enum planck_keycodes { + QWERTY = SAFE_RANGE, + DATA, + LOWER, + RAISE, + BACKLIT + }; + +#define _______ KC_TRNS +#define ___x___ KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Data + * ,-----------------------------------------------------------------------------------. + * | Esc | Home | Up | End | | | N | S | 7 | 8 | 9 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | Left | Down | Right| | | E | W | 4 | 5 | 6 | Tab | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | | + | - | 1 | 2 | 3 |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | 0 | . |Shift |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DATA] = { + {KC_ESC, KC_HOME, KC_UP, KC_END, ___x___, ___x___, KC_N, KC_S, KC_7, KC_8, KC_9, KC_BSPC}, + {KC_TAB, KC_LEFT, KC_DOWN, KC_RIGHT, ___x___, ___x___, KC_E, KC_W, KC_4, KC_5, KC_6, KC_TAB}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, ___x___, KC_PLUS, KC_MINS, KC_1, KC_2, KC_3, KC_ENT}, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_0, KC_DOT, KC_RSFT, KC_ENT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ~ | ` | | | | | _ | + | { | } | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | - | = | [ | ] | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {_______, KC_TILD, KC_GRV, ___x___, ___x___, ___x___, ___x___, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS}, + {_______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Del | F1 | F2 | F3 | F4 | | N | S | 7 | 8 | 9 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | E | W | 4 | 5 | 6 | Tab | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | + | - | 1 | 2 | 3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | . |Shift |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, ___x___, KC_N, KC_S, KC_7, KC_8, KC_9, KC_BSPC}, + {_______, KC_F5, KC_F6, KC_F7, KC_F8, ___x___, KC_E, KC_W, KC_4, KC_5, KC_6, KC_TAB}, + {_______, KC_F9, KC_F10, KC_F11, KC_F12, ___x___, KC_PLUS, KC_MINS, KC_1, KC_2, KC_3, _______,}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_RSFT, KC_ENT} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Esc | Reset| Debug| | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| Data | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {KC_ESC, RESET, DEBUG, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, KC_DEL}, + {_______, ___x___, ___x___, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, DATA, ___x___, ___x___, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, ___x___, ___x___, ___x___, ___x___, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + breathing_self_disable(); + } + return false; + break; + case DATA: + if (record->event.pressed) { + set_single_persistent_default_layer(_DATA); + #ifdef BACKLIGHT_ENABLE + breathing_speed_set(3); + breathing_enable(); + #endif + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + uint8_t default_layer = biton32(default_layer_state); + if (default_layer == _QWERTY) { + #ifdef BACKLIGHT_ENABLE + breathing_speed_set(3); + breathing_enable(); + #endif + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + uint8_t default_layer = biton32(default_layer_state); + if (default_layer == _QWERTY) { + breathing_self_disable(); + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + uint8_t default_layer = biton32(default_layer_state); + if (default_layer == _QWERTY) { + #ifdef BACKLIGHT_ENABLE + breathing_speed_set(3); + breathing_enable(); + #endif + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + uint8_t default_layer = biton32(default_layer_state); + if (default_layer == _QWERTY) { + breathing_self_disable(); + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/aviator/readme.md b/keyboards/planck/keymaps/aviator/readme.md new file mode 100644 index 000000000..3319c7fe1 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/readme.md @@ -0,0 +1,68 @@ +# The Aviator + +Designed for aeronautical data entry on the OLKB Planck. + +![Imgur](https://i.imgur.com/lj6uMYI.png) + +## Layers + +```` +Qwerty +,-----------------------------------------------------------------------------------. +| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Tab | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' + +Data +,-----------------------------------------------------------------------------------. +| Esc | Home | Up | End | | | N | S | 7 | 8 | 9 | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Tab | Left | Down | Right| | | E | W | 4 | 5 | 6 | Tab | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | | + | - | 1 | 2 | 3 |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | 0 | . |Shift |Enter | +`-----------------------------------------------------------------------------------' + +Lower +,-----------------------------------------------------------------------------------. +| Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | ~ | ` | | | | | _ | + | { | } | \ | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | | - | = | [ | ] | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Home |Pg Dn |Pg Up | End | +`-----------------------------------------------------------------------------------' + +Raise +,-----------------------------------------------------------------------------------. +| Del | F1 | F2 | F3 | F4 | | N | S | 7 | 8 | 9 | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | F5 | F6 | F7 | F8 | | E | W | 4 | 5 | 6 | Tab | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F9 | F10 | F11 | F12 | | + | - | 1 | 2 | 3 | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | 0 | . |Shift |Enter | +`-----------------------------------------------------------------------------------' + +Adjust (Lower + Raise) +,-----------------------------------------------------------------------------------. +| Esc | Reset| Debug| | | | | | | | | Del | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| Data | | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +```` + +## Notes + +Supports LED backlighting. diff --git a/keyboards/planck/keymaps/aviator/rules.mk b/keyboards/planck/keymaps/aviator/rules.mk new file mode 100644 index 000000000..bd518d8f2 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes From 4931510ad38aadb1769c9241bfad0c3d77ad687f Mon Sep 17 00:00:00 2001 From: Balz Guenat Date: Mon, 1 Jan 2018 23:47:51 +0100 Subject: [PATCH 027/556] backlight breathing overhaul (#2187) * add breathing to bananasplit * backlight breathing overhaul * fix the backlight_tick thing. * fix for vision_division backlight * fix a few keymaps and probably break breathing for some weirdly set-up boards. * remove BL_x keycodes because they made unreasonable assumptions * some fixes for BL keycodes * integer cie lightness scaling * use cie lightness for non-breathing backlight and make breathing able to reach true max brightness --- docs/config_options.md | 4 + docs/faq_keymap.md | 2 +- docs/feature_backlight.md | 28 +- docs/hardware_avr.md | 3 +- keyboards/atomic/keymaps/pvc/keymap.c | 12 +- keyboards/bananasplit/config.h | 2 +- .../bananasplit/keymaps/coloneljesus/config.h | 2 + .../bananasplit/keymaps/coloneljesus/keymap.c | 16 +- keyboards/jd45/keymaps/mjt/keymap.c | 8 +- keyboards/planck/keymaps/cbbrowne/keymap.c | 4 +- .../planck/keymaps/experimental/keymap.c | 4 +- keyboards/planck/keymaps/khord/keymap.c | 4 +- keyboards/planck/keymaps/pvc/keymap.c | 12 +- .../keymaps/zach/zach_common_functions.c | 2 +- keyboards/planck/keymaps/zrichard/keymap.c | 12 +- .../keymaps/zach/zach_common_functions.c | 2 +- .../vision_division/keymaps/default/keymap.c | 14 +- keyboards/xd75/keymaps/cbbrowne/keymap.c | 4 +- quantum/keymap_common.c | 7 +- quantum/quantum.c | 422 ++++++++---------- quantum/quantum.h | 9 +- quantum/quantum_keycodes.h | 22 +- tmk_core/common/action.c | 7 +- tmk_core/common/action_code.h | 6 +- tmk_core/common/backlight.c | 6 +- 25 files changed, 285 insertions(+), 329 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index a9ff54995..1dd4cdbaa 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -70,6 +70,10 @@ This is a C header file that is one of the first things included, and will persi * pin of the backlight - B5, B6, B7 use PWM, others use softPWM * `#define BACKLIGHT_LEVELS 3` * number of levels your backlight will have (not including off) +* `#define BACKLIGHT_BREATHING` + * enables backlight breathing (only works with backlight pins B5, B6 and B7) +* `#define BREATHING_PERIOD 6` + * the length of one backlight "breath" in seconds * `#define DEBOUNCING_DELAY 5` * the delay when reading the value of the pin (5 is default) * `#define LOCKING_SUPPORT_ENABLE` diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 7093dec20..0fed0445f 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -127,7 +127,7 @@ https://github.com/tekezo/Karabiner/issues/403 ## Esc and ` on a Single Key -See the [Grave Escape](feature_grave_escape.md) feature. +See the [Grave Escape](feature_grave_esc.md) feature. ## Arrow on Right Modifier Keys with Dual-Role This turns right modifier keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**. diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index aa747f90e..97421c043 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -10,8 +10,30 @@ These keycodes control the backlight. Most keyboards use this for single color i |---------|------------------------------------------| |`BL_TOGG`|Turn the backlight on or off | |`BL_STEP`|Cycle through backlight levels | -|`BL_x` |Set a specific backlight level between 0-9| -|`BL_ON` |An alias for `BL_9` | -|`BL_OFF` |An alias for `BL_0` | +|`BL_ON` |Set backlight to max brightness | +|`BL_OFF` |Turn backlight off | |`BL_INC` |Increase backlight level | |`BL_DEC` |Decrease backlight level | +|`BL_BRTG`|Toggle backlight breathing | + +Note that for backlight breathing, you need to have `#define BACKLIGHT_BREATHING` in your config.h. + +## Configuration Options in `config.h` + +* `BACKLIGHT_PIN B7` defines the pin that controlls the LEDs. Unless you design your own keyboard, you don't need to set this. +* `BACKLIGHT_LEVELS 3` defines the number of brightness levels (excluding OFF). +* `BACKLIGHT_BREATHING` if defined, enables backlight breathing. Note that this is only available if `BACKLIGHT_PIN` is B5, B6 or B7. +* `BREATHING_PERIOD 6` defines the length of one backlight "breath" in seconds. + +## Notes on Implementation + +To change the brightness when using pins B5, B6 or B7, the PWM (Pulse Width Modulation) functionality of the on-chip timer is used. +The timer is a counter that counts up to a certain TOP value (`0xFFFF` set in ICR1) before resetting to 0. +We also set an OCR1x register. +When the counter reaches the value stored in that register, the PWM pin drops to low. +The PWM pin is pulled high again when the counter resets to 0. +Therefore, OCR1x basically sets the duty cycle of the LEDs and as such the brightness where `0` is the darkest and `0xFFFF` the brightest setting. + +To enable the breathing effect, we register an interrupt handler to be called whenever the counter resets (with `ISR(TIMER1_OVF_vect)`). +In this handler, which gets called roughly 244 times per second, we compute the desired brightness using a precomputed brightness curve. +To disable breathing, we can just disable the respective interrupt vector and reset the brightness to the desired level. diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md index c6f3881dc..770817045 100644 --- a/docs/hardware_avr.md +++ b/docs/hardware_avr.md @@ -101,8 +101,9 @@ By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are us ``` #define BACKLIGHT_PIN B7 -#define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 ``` {% hint style='info' %} diff --git a/keyboards/atomic/keymaps/pvc/keymap.c b/keyboards/atomic/keymaps/pvc/keymap.c index 4a7cc863e..2e78e64b1 100644 --- a/keyboards/atomic/keymaps/pvc/keymap.c +++ b/keyboards/atomic/keymaps/pvc/keymap.c @@ -345,14 +345,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_BREATH_SPEED_INC: if (record->event.pressed) { - breathing_speed_inc(1); + breathing_period_inc(); } break; case MACRO_BREATH_SPEED_DEC: if (record->event.pressed) { - breathing_speed_dec(1); + breathing_period_dec(); } break; @@ -374,7 +374,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_UPPER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -389,7 +389,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_LOWER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -403,13 +403,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_FUNCTION: if (record->event.pressed) { - breathing_speed_set(3); + breathing_period_set(3); breathing_enable(); layer_on(LAYER_FUNCTION); } else { - breathing_speed_set(1); + breathing_period_set(1); breathing_self_disable(); layer_off(LAYER_FUNCTION); } diff --git a/keyboards/bananasplit/config.h b/keyboards/bananasplit/config.h index 4bb5b85e0..5649ab4aa 100644 --- a/keyboards/bananasplit/config.h +++ b/keyboards/bananasplit/config.h @@ -42,7 +42,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* number of backlight levels */ -#define BACKLIGHT_LEVELS 1 +#define BACKLIGHT_LEVELS 3 /* mapping backlight LEDs to correct Pin */ #define BACKLIGHT_PIN B7 diff --git a/keyboards/bananasplit/keymaps/coloneljesus/config.h b/keyboards/bananasplit/keymaps/coloneljesus/config.h index 5f2cd13fe..92a67f647 100644 --- a/keyboards/bananasplit/keymaps/coloneljesus/config.h +++ b/keyboards/bananasplit/keymaps/coloneljesus/config.h @@ -21,5 +21,7 @@ // place overrides here #define GRAVE_ESC_CTRL_OVERRIDE +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 8 #endif diff --git a/keyboards/bananasplit/keymaps/coloneljesus/keymap.c b/keyboards/bananasplit/keymaps/coloneljesus/keymap.c index ac7f1113a..b5889aa19 100644 --- a/keyboards/bananasplit/keymaps/coloneljesus/keymap.c +++ b/keyboards/bananasplit/keymaps/coloneljesus/keymap.c @@ -16,7 +16,7 @@ #include "bananasplit.h" enum custom_keycodes { - WIN_SWITCH_LAYOUT = SAFE_RANGE + WIN_SWITCH_LAYOUT = SAFE_RANGE, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ KC_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, KC_PGUP, KC_INS, KC_HOME, LCTL(KC_LEFT), LCTL(KC_RGHT), KC_END, _______, _______, _______, KC_PSCR, \ _______, KC_MUTE, KC_VOLD, KC_MPLY, KC_PGDN, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, \ - _______, _______, _______, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, _______, \ + _______, BL_STEP, BL_BRTG, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, RESET \ ), }; @@ -76,19 +76,19 @@ void matrix_scan_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + case WIN_SWITCH_LAYOUT: { // Sends Alt+Shift on both key down and key up. // Designed to switch between two keyboard layouts on Windows using a locking switch. // Does nothing if right shift is pressed for easy resync. - if (!(get_mods() & MOD_BIT(KC_RSFT))) { + if (!(get_mods() & MOD_BIT(KC_RSFT))) SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_LSHIFT)SS_UP(X_LALT)); - return false; - } - else - return false; + return false; } + + default: + return true; } - return true; } void led_set_user(uint8_t usb_led) { diff --git a/keyboards/jd45/keymaps/mjt/keymap.c b/keyboards/jd45/keymaps/mjt/keymap.c index 1a7302216..610552ecf 100644 --- a/keyboards/jd45/keymaps/mjt/keymap.c +++ b/keyboards/jd45/keymaps/mjt/keymap.c @@ -50,13 +50,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // action_function_tap may also handle this... if (record->event.pressed) { - breathing_speed_set(3); + breathing_period_set(3); breathing_enable(); layer_on(1); } else { - breathing_speed_set(1); + breathing_period_set(1); breathing_self_disable(); layer_off(1); } @@ -64,13 +64,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case M_LAYER2: if (record->event.pressed) { - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); layer_on(2); } else { - breathing_speed_set(1); + breathing_period_set(1); breathing_self_disable(); layer_off(2); } diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c index d1214dda1..9bae6fb50 100644 --- a/keyboards/planck/keymaps/cbbrowne/keymap.c +++ b/keyboards/planck/keymaps/cbbrowne/keymap.c @@ -220,7 +220,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { layer_on(_RAISE); #ifdef BACKLIGHT_ENABLE - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif update_tri_layer(_LOWER, _RAISE, _ADJUST); @@ -236,7 +236,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { layer_on(_LOWER); #ifdef BACKLIGHT_ENABLE - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif update_tri_layer(_LOWER, _RAISE, _ADJUST); diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index 272c09332..feeb137fa 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -242,7 +242,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { layer_on(_LOWER); #ifdef BACKLIGHT_ENABLE - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif update_tri_layer(_LOWER, _RAISE, _ADJUST); @@ -256,7 +256,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { layer_on(_RAISE); #ifdef BACKLIGHT_ENABLE - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif update_tri_layer(_LOWER, _RAISE, _ADJUST); diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index c8022a389..c515a0d36 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -128,12 +128,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case MACRO_BREATH_SPEED_INC: if (record->event.pressed) { - breathing_speed_inc(1); + breathing_period_inc(); } break; case MACRO_BREATH_SPEED_DEC: if (record->event.pressed) { - breathing_speed_dec(1); + breathing_period_dec(); } break; case MACRO_BREATH_DEFAULT: diff --git a/keyboards/planck/keymaps/pvc/keymap.c b/keyboards/planck/keymaps/pvc/keymap.c index 60f6d925a..820018af6 100644 --- a/keyboards/planck/keymaps/pvc/keymap.c +++ b/keyboards/planck/keymaps/pvc/keymap.c @@ -323,14 +323,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_BREATH_SPEED_INC: if (record->event.pressed) { - breathing_speed_inc(1); + breathing_period_inc(); } break; case MACRO_BREATH_SPEED_DEC: if (record->event.pressed) { - breathing_speed_dec(1); + breathing_period_dec(); } break; @@ -352,7 +352,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_UPPER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -367,7 +367,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_LOWER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -381,13 +381,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_FUNCTION: if (record->event.pressed) { - breathing_speed_set(3); + breathing_period_set(3); breathing_enable(); layer_on(LAYER_FUNCTION); } else { - breathing_speed_set(1); + breathing_period_set(1); breathing_self_disable(); layer_off(LAYER_FUNCTION); } diff --git a/keyboards/planck/keymaps/zach/zach_common_functions.c b/keyboards/planck/keymaps/zach/zach_common_functions.c index f824b4033..e6aeaa50a 100644 --- a/keyboards/planck/keymaps/zach/zach_common_functions.c +++ b/keyboards/planck/keymaps/zach/zach_common_functions.c @@ -270,7 +270,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { PLAY_SONG(tone_ctrl_mod); #endif #ifdef BACKLIGHT_BREATHING - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif } diff --git a/keyboards/planck/keymaps/zrichard/keymap.c b/keyboards/planck/keymaps/zrichard/keymap.c index c40492f5e..cf4478cee 100755 --- a/keyboards/planck/keymaps/zrichard/keymap.c +++ b/keyboards/planck/keymaps/zrichard/keymap.c @@ -332,14 +332,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_BREATH_SPEED_INC: if (record->event.pressed) { - breathing_speed_inc(1); + breathing_period_inc(); } break; case MACRO_BREATH_SPEED_DEC: if (record->event.pressed) { - breathing_speed_dec(1); + breathing_period_dec(); } break; @@ -361,7 +361,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_UPPER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -376,7 +376,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_LOWER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -390,13 +390,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_FUNCTION: if (record->event.pressed) { - breathing_speed_set(3); + breathing_period_set(3); breathing_enable(); layer_on(LAYER_FUNCTION); } else { - breathing_speed_set(1); + breathing_period_set(1); breathing_self_disable(); layer_off(LAYER_FUNCTION); } diff --git a/keyboards/preonic/keymaps/zach/zach_common_functions.c b/keyboards/preonic/keymaps/zach/zach_common_functions.c index f824b4033..e6aeaa50a 100644 --- a/keyboards/preonic/keymaps/zach/zach_common_functions.c +++ b/keyboards/preonic/keymaps/zach/zach_common_functions.c @@ -270,7 +270,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { PLAY_SONG(tone_ctrl_mod); #endif #ifdef BACKLIGHT_BREATHING - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif } diff --git a/keyboards/vision_division/keymaps/default/keymap.c b/keyboards/vision_division/keymaps/default/keymap.c index c40bf1ef6..31b107661 100644 --- a/keyboards/vision_division/keymaps/default/keymap.c +++ b/keyboards/vision_division/keymaps/default/keymap.c @@ -406,21 +406,21 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_BREATH_SPEED_INC: if (record->event.pressed) { - breathing_speed_inc(1); + breathing_period_inc(); } break; case MACRO_BREATH_SPEED_DEC: if (record->event.pressed) { - breathing_speed_dec(1); + breathing_period_dec(); } break; case MACRO_BREATH_DEFAULT: if (record->event.pressed) { - breathing_defaults(); + breathing_period_default(); } break; @@ -435,7 +435,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_UPPER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -450,7 +450,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { layer_on(LAYER_LOWER); - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } @@ -464,13 +464,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case MACRO_FUNCTION: if (record->event.pressed) { - breathing_speed_set(3); + breathing_period_set(3); breathing_enable(); layer_on(LAYER_FUNCTION); } else { - breathing_speed_set(1); + breathing_period_set(1); breathing_self_disable(); layer_off(LAYER_FUNCTION); } diff --git a/keyboards/xd75/keymaps/cbbrowne/keymap.c b/keyboards/xd75/keymaps/cbbrowne/keymap.c index 5496ed40d..ec98b6d5a 100644 --- a/keyboards/xd75/keymaps/cbbrowne/keymap.c +++ b/keyboards/xd75/keymaps/cbbrowne/keymap.c @@ -265,7 +265,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { layer_on(_RAISE); #ifdef BACKLIGHT_ENABLE - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif update_tri_layer(_LOWER, _RAISE, _ADJUST); @@ -281,7 +281,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { layer_on(_LOWER); #ifdef BACKLIGHT_ENABLE - breathing_speed_set(2); + breathing_period_set(2); breathing_pulse(); #endif update_tri_layer(_LOWER, _RAISE, _ADJUST); diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index b1460c53c..a0d4c1ddb 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -127,8 +127,11 @@ action_t action_for_key(uint8_t layer, keypos_t key) action.code = ACTION_MODS_TAP_KEY(mod, keycode & 0xFF); break; #ifdef BACKLIGHT_ENABLE - case BL_0 ... BL_15: - action.code = ACTION_BACKLIGHT_LEVEL(keycode - BL_0); + case BL_ON: + action.code = ACTION_BACKLIGHT_ON(); + break; + case BL_OFF: + action.code = ACTION_BACKLIGHT_OFF(); break; case BL_DEC: action.code = ACTION_BACKLIGHT_DECREASE(); diff --git a/quantum/quantum.c b/quantum/quantum.c index c80975f21..88617412c 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -23,6 +23,10 @@ #define TAPPING_TERM 200 #endif +#ifndef BREATHING_PERIOD +#define BREATHING_PERIOD 6 +#endif + #include "backlight.h" extern backlight_config_t backlight_config; @@ -618,7 +622,17 @@ bool process_record_quantum(keyrecord_t *record) { } send_keyboard_report(); + return false; } + +#if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_BREATHING) + case BL_BRTG: { + if (record->event.pressed) + breathing_toggle(); + return false; + } +#endif + default: { shift_interrupted[0] = true; shift_interrupted[1] = true; @@ -831,6 +845,7 @@ void matrix_scan_quantum() { static const uint8_t backlight_pin = BACKLIGHT_PIN; +// depending on the pin, we use a different output compare unit #if BACKLIGHT_PIN == B7 # define COM1x1 COM1C1 # define OCR1x OCR1C @@ -841,17 +856,18 @@ static const uint8_t backlight_pin = BACKLIGHT_PIN; # define COM1x1 COM1A1 # define OCR1x OCR1A #else -# define NO_BACKLIGHT_CLOCK +# define NO_HARDWARE_PWM #endif #ifndef BACKLIGHT_ON_STATE #define BACKLIGHT_ON_STATE 0 #endif +#ifdef NO_HARDWARE_PWM // pwm through software + __attribute__ ((weak)) void backlight_init_ports(void) { - // Setup backlight pin as output and output to on state. // DDRx |= n _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF); @@ -862,83 +878,15 @@ void backlight_init_ports(void) // PORTx |= n _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); #endif - - #ifndef NO_BACKLIGHT_CLOCK - // Use full 16-bit resolution. - ICR1 = 0xFFFF; - - // I could write a wall of text here to explain... but TL;DW - // Go read the ATmega32u4 datasheet. - // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on - - // Pin PB7 = OCR1C (Timer 1, Channel C) - // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 - // (i.e. start high, go low when counter matches.) - // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 - // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 - - TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010; - TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; - #endif - - backlight_init(); - #ifdef BACKLIGHT_BREATHING - breathing_defaults(); - #endif } __attribute__ ((weak)) -void backlight_set(uint8_t level) -{ - // Prevent backlight blink on lowest level - // #if BACKLIGHT_ON_STATE == 0 - // // PORTx &= ~n - // _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); - // #else - // // PORTx |= n - // _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); - // #endif - - if ( level == 0 ) { - #ifndef NO_BACKLIGHT_CLOCK - // Turn off PWM control on backlight pin, revert to output low. - TCCR1A &= ~(_BV(COM1x1)); - OCR1x = 0x0; - #else - // #if BACKLIGHT_ON_STATE == 0 - // // PORTx |= n - // _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); - // #else - // // PORTx &= ~n - // _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); - // #endif - #endif - } - #ifndef NO_BACKLIGHT_CLOCK - else if ( level == BACKLIGHT_LEVELS ) { - // Turn on PWM control of backlight pin - TCCR1A |= _BV(COM1x1); - // Set the brightness - OCR1x = 0xFFFF; - } - else { - // Turn on PWM control of backlight pin - TCCR1A |= _BV(COM1x1); - // Set the brightness - OCR1x = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2)); - } - #endif - - #ifdef BACKLIGHT_BREATHING - breathing_intensity_default(); - #endif -} +void backlight_set(uint8_t level) {} uint8_t backlight_tick = 0; void backlight_task(void) { - #ifdef NO_BACKLIGHT_CLOCK - if ((0xFFFF >> ((BACKLIGHT_LEVELS - backlight_config.level) * ((BACKLIGHT_LEVELS + 1) / 2))) & (1 << backlight_tick)) { + if ((0xFFFF >> ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2))) & (1 << backlight_tick)) { #if BACKLIGHT_ON_STATE == 0 // PORTx &= ~n _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); @@ -955,232 +903,216 @@ void backlight_task(void) { _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); #endif } - backlight_tick = (backlight_tick + 1) % 16; - #endif + backlight_tick = backlight_tick + 1 % 16; } #ifdef BACKLIGHT_BREATHING +#error "Backlight breathing only available with hardware PWM. Please disable." +#endif -#ifdef NO_BACKLIGHT_CLOCK -void breathing_defaults(void) {} -void breathing_intensity_default(void) {} -#else +#else // pwm through timer + +#define TIMER_TOP 0xFFFFU + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + +// range for val is [0..TIMER_TOP]. PWM pin is high while the timer count is below val. +static inline void set_pwm(uint16_t val) { + OCR1x = val; +} + +__attribute__ ((weak)) +void backlight_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + + if (level == 0) { + // Turn off PWM control on backlight pin + TCCR1A &= ~(_BV(COM1x1)); + } else { + // Turn on PWM control of backlight pin + TCCR1A |= _BV(COM1x1); + } + // Set the brightness + set_pwm(cie_lightness(TIMER_TOP * (uint32_t)level / BACKLIGHT_LEVELS)); +} + +void backlight_task(void) {} + +#ifdef BACKLIGHT_BREATHING #define BREATHING_NO_HALT 0 #define BREATHING_HALT_OFF 1 #define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 -static uint8_t breath_intensity; -static uint8_t breath_speed; -static uint16_t breathing_index; -static uint8_t breathing_halt; +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +bool is_breathing(void) { + return !!(TIMSK1 & _BV(TOIE1)); +} + +#define breathing_interrupt_enable() do {TIMSK1 |= _BV(TOIE1);} while (0) +#define breathing_interrupt_disable() do {TIMSK1 &= ~_BV(TOIE1);} while (0) +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) void breathing_enable(void) { - if (get_backlight_level() == 0) - { - breathing_index = 0; - } - else - { - // Set breathing_index to be at the midpoint (brightest point) - breathing_index = 0x20 << breath_speed; - } - - breathing_halt = BREATHING_NO_HALT; - - // Enable breathing interrupt - TIMSK1 |= _BV(OCIE1A); + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); } void breathing_pulse(void) { if (get_backlight_level() == 0) - { - breathing_index = 0; - } + breathing_min(); else - { - // Set breathing_index to be at the midpoint + 1 (brightest point) - breathing_index = 0x21 << breath_speed; - } - + breathing_max(); breathing_halt = BREATHING_HALT_ON; - - // Enable breathing interrupt - TIMSK1 |= _BV(OCIE1A); + breathing_interrupt_enable(); } void breathing_disable(void) { - // Disable breathing interrupt - TIMSK1 &= ~_BV(OCIE1A); + breathing_interrupt_disable(); + // Restore backlight level backlight_set(get_backlight_level()); } void breathing_self_disable(void) { - if (get_backlight_level() == 0) - { - breathing_halt = BREATHING_HALT_OFF; - } - else - { - breathing_halt = BREATHING_HALT_ON; - } - - //backlight_set(get_backlight_level()); + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; } -void breathing_toggle(void) +void breathing_toggle(void) { + if (is_breathing()) + breathing_disable(); + else + breathing_enable(); +} + +void breathing_period_set(uint8_t value) { - if (!is_breathing()) - { - if (get_backlight_level() == 0) - { - breathing_index = 0; - } - else - { - // Set breathing_index to be at the midpoint + 1 (brightest point) - breathing_index = 0x21 << breath_speed; - } - - breathing_halt = BREATHING_NO_HALT; - } - - // Toggle breathing interrupt - TIMSK1 ^= _BV(OCIE1A); - - // Restore backlight level - if (!is_breathing()) - { - backlight_set(get_backlight_level()); - } + if (!value) + value = 1; + breathing_period = value; } -bool is_breathing(void) +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) { - return (TIMSK1 && _BV(OCIE1A)); + breathing_period_set(breathing_period+1); } -void breathing_intensity_default(void) +void breathing_period_dec(void) { - //breath_intensity = (uint8_t)((uint16_t)100 * (uint16_t)get_backlight_level() / (uint16_t)BACKLIGHT_LEVELS); - breath_intensity = ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2)); + breathing_period_set(breathing_period-1); } -void breathing_intensity_set(uint8_t value) -{ - breath_intensity = value; -} - -void breathing_speed_default(void) -{ - breath_speed = 4; -} - -void breathing_speed_set(uint8_t value) -{ - bool is_breathing_now = is_breathing(); - uint8_t old_breath_speed = breath_speed; - - if (is_breathing_now) - { - // Disable breathing interrupt - TIMSK1 &= ~_BV(OCIE1A); - } - - breath_speed = value; - - if (is_breathing_now) - { - // Adjust index to account for new speed - breathing_index = (( (uint8_t)( (breathing_index) >> old_breath_speed ) ) & 0x3F) << breath_speed; - - // Enable breathing interrupt - TIMSK1 |= _BV(OCIE1A); - } - -} - -void breathing_speed_inc(uint8_t value) -{ - if ((uint16_t)(breath_speed - value) > 10 ) - { - breathing_speed_set(0); - } - else - { - breathing_speed_set(breath_speed - value); - } -} - -void breathing_speed_dec(uint8_t value) -{ - if ((uint16_t)(breath_speed + value) > 10 ) - { - breathing_speed_set(10); - } - else - { - breathing_speed_set(breath_speed + value); - } -} - -void breathing_defaults(void) -{ - breathing_intensity_default(); - breathing_speed_default(); - breathing_halt = BREATHING_NO_HALT; -} - -/* Breathing Sleep LED brighness(PWM On period) table - * (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle - * - * http://www.wolframalpha.com/input/?i=%28sin%28+x%2F64*pi%29**8+*+255%2C+x%3D0+to+63 - * (0..63).each {|x| p ((sin(x/64.0*PI)**8)*255).to_i } +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] */ -static const uint8_t breathing_table[64] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 10, - 15, 23, 32, 44, 58, 74, 93, 113, 135, 157, 179, 199, 218, 233, 245, 252, -255, 252, 245, 233, 218, 199, 179, 157, 135, 113, 93, 74, 58, 44, 32, 23, - 15, 10, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -ISR(TIMER1_COMPA_vect) -{ - // OCR1x = (pgm_read_byte(&breathing_table[ ( (uint8_t)( (breathing_index++) >> breath_speed ) ) & 0x3F ] )) * breath_intensity; - - - uint8_t local_index = ( (uint8_t)( (breathing_index++) >> breath_speed ) ) & 0x3F; - - if (((breathing_halt == BREATHING_HALT_ON) && (local_index == 0x20)) || ((breathing_halt == BREATHING_HALT_OFF) && (local_index == 0x3F))) - { - // Disable breathing interrupt - TIMSK1 &= ~_BV(OCIE1A); - } - - OCR1x = (uint16_t)(((uint16_t)pgm_read_byte(&breathing_table[local_index]) * 257)) >> breath_intensity; +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); } -#endif // NO_BACKLIGHT_CLOCK -#endif // breathing +/* Assuming a 16MHz CPU clock and a timer that resets at 64k (ICR1), the following interrupt handler will run + * about 244 times per second. + */ +ISR(TIMER1_OVF_vect) +{ + uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 244); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; -#else // backlight + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + breathing_interrupt_disable(); + } + + set_pwm(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U))); +} + +#endif // BACKLIGHT_BREATHING __attribute__ ((weak)) void backlight_init_ports(void) { + // Setup backlight pin as output and output to on state. + // DDRx |= n + _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF); + #if BACKLIGHT_ON_STATE == 0 + // PORTx &= ~n + _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); + #else + // PORTx |= n + _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); + #endif + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + // Pin PB7 = OCR1C (Timer 1, Channel C) + // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 + // (i.e. start high, go low when counter matches.) + // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 + // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 + + /* + 14.8.3: + "In fast PWM mode, the compare units allow generation of PWM waveforms on the OCnx pins. Setting the COMnx1:0 bits to two will produce a non-inverted PWM [..]." + "In fast PWM mode the counter is incremented until the counter value matches either one of the fixed values 0x00FF, 0x01FF, or 0x03FF (WGMn3:0 = 5, 6, or 7), the value in ICRn (WGMn3:0 = 14), or the value in OCRnA (WGMn3:0 = 15)." + */ + + TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010; + TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + // Use full 16-bit resolution. Counter counts to ICR1 before reset to 0. + ICR1 = TIMER_TOP; + + backlight_init(); + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif } +#endif // NO_HARDWARE_PWM + +#else // backlight + __attribute__ ((weak)) -void backlight_set(uint8_t level) -{ +void backlight_init_ports(void) {} -} +__attribute__ ((weak)) +void backlight_set(uint8_t level) {} #endif // backlight diff --git a/quantum/quantum.h b/quantum/quantum.h index 056d37292..6ca5ecb5c 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -173,12 +173,11 @@ void breathing_self_disable(void); void breathing_toggle(void); bool is_breathing(void); -void breathing_defaults(void); void breathing_intensity_default(void); -void breathing_speed_default(void); -void breathing_speed_set(uint8_t value); -void breathing_speed_inc(uint8_t value); -void breathing_speed_dec(uint8_t value); +void breathing_period_default(void); +void breathing_period_set(uint8_t value); +void breathing_period_inc(void); +void breathing_period_dec(void); #endif #endif diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 65bf9e141..1b9a7534c 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -380,26 +380,13 @@ enum quantum_keycodes { #endif // MIDI_ADVANCED // Backlight functionality - BL_0, - BL_1, - BL_2, - BL_3, - BL_4, - BL_5, - BL_6, - BL_7, - BL_8, - BL_9, - BL_10, - BL_11, - BL_12, - BL_13, - BL_14, - BL_15, + BL_ON, + BL_OFF, BL_DEC, BL_INC, BL_TOGG, BL_STEP, + BL_BRTG, // RGB functionality RGB_TOG, @@ -579,9 +566,6 @@ enum quantum_keycodes { #define AG_SWAP MAGIC_SWAP_ALT_GUI #define AG_NORM MAGIC_UNSWAP_ALT_GUI -#define BL_ON BL_9 -#define BL_OFF BL_0 - // GOTO layer - 16 layers max // when: // ON_PRESS = 1 diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index b39aa4cbc..dd3a5b3ee 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -512,8 +512,11 @@ void process_action(keyrecord_t *record, action_t action) case BACKLIGHT_STEP: backlight_step(); break; - case BACKLIGHT_LEVEL: - backlight_level(action.backlight.level); + case BACKLIGHT_ON: + backlight_level(BACKLIGHT_LEVELS); + break; + case BACKLIGHT_OFF: + backlight_level(0); break; } } diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index b15aaa0eb..05bc84573 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h @@ -304,7 +304,8 @@ enum backlight_opt { BACKLIGHT_DECREASE = 1, BACKLIGHT_TOGGLE = 2, BACKLIGHT_STEP = 3, - BACKLIGHT_LEVEL = 4, + BACKLIGHT_ON = 4, + BACKLIGHT_OFF = 5, }; /* Macro */ @@ -316,7 +317,8 @@ enum backlight_opt { #define ACTION_BACKLIGHT_DECREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_DECREASE << 8) #define ACTION_BACKLIGHT_TOGGLE() ACTION(ACT_BACKLIGHT, BACKLIGHT_TOGGLE << 8) #define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8) -#define ACTION_BACKLIGHT_LEVEL(level) ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | (level)) +#define ACTION_BACKLIGHT_ON() ACTION(ACT_BACKLIGHT, BACKLIGHT_ON << 8) +#define ACTION_BACKLIGHT_OFF() ACTION(ACT_BACKLIGHT, BACKLIGHT_OFF << 8) /* Command */ #define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (id)) /* Function */ diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c index d03bfe931..4d2491b98 100644 --- a/tmk_core/common/backlight.c +++ b/tmk_core/common/backlight.c @@ -61,6 +61,8 @@ void backlight_decrease(void) void backlight_toggle(void) { backlight_config.enable ^= 1; + if (backlight_config.raw == 1) // enabled but level = 0 + backlight_config.level = 1; eeconfig_update_backlight(backlight_config.raw); dprintf("backlight toggle: %u\n", backlight_config.enable); backlight_set(backlight_config.enable ? backlight_config.level : 0); @@ -81,7 +83,9 @@ void backlight_step(void) void backlight_level(uint8_t level) { - backlight_config.level ^= level; + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; backlight_config.enable = !!backlight_config.level; eeconfig_update_backlight(backlight_config.raw); backlight_set(backlight_config.level); From feac994f6fa971b3cc2ba8b3792fe179aa8955c5 Mon Sep 17 00:00:00 2001 From: benlyall Date: Tue, 2 Jan 2018 09:49:26 +1100 Subject: [PATCH 028/556] Added support for V60 Type R Polestar backlight and RGB underglow (#1852) * Added V60 Type R Polestar Backlight and RGB Underglow support * made RGB Underglow stuff optional, to support the non Polestar V60 * updated readme and rules * fixed typo in readme --- keyboards/v60_type_r/config.h | 18 +- keyboards/v60_type_r/keymaps/default/config.h | 26 +++ keyboards/v60_type_r/keymaps/default/keymap.c | 16 +- keyboards/v60_type_r/keymaps/vimouse/config.h | 31 +++ keyboards/v60_type_r/keymaps/vimouse/keymap.c | 130 ++++++++++++ .../v60_type_r/keymaps/vimouse/readme.md | 0 keyboards/v60_type_r/keymaps/vimouse/rules.mk | 2 + keyboards/v60_type_r/readme.md | 27 ++- keyboards/v60_type_r/rules.mk | 3 +- keyboards/v60_type_r/v60_type_r.c | 200 +++++++++++++++++- keyboards/v60_type_r/v60_type_r.h | 17 ++ 11 files changed, 439 insertions(+), 31 deletions(-) create mode 100644 keyboards/v60_type_r/keymaps/default/config.h create mode 100644 keyboards/v60_type_r/keymaps/vimouse/config.h create mode 100644 keyboards/v60_type_r/keymaps/vimouse/keymap.c create mode 100644 keyboards/v60_type_r/keymaps/vimouse/readme.md create mode 100644 keyboards/v60_type_r/keymaps/vimouse/rules.mk diff --git a/keyboards/v60_type_r/config.h b/keyboards/v60_type_r/config.h index c20bfe3a6..1f3ebcd51 100644 --- a/keyboards/v60_type_r/config.h +++ b/keyboards/v60_type_r/config.h @@ -48,10 +48,20 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 + +#define BACKLIGHT_PIN F7 +//#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_ON_STATE 0 + +#define RGBLIGHT_CUSTOM_DRIVER +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 1 +#define RGB_RED_PIN PF6 +#define RGB_GREEN_PIN PF5 +#define RGB_BLUE_PIN PF4 +#define RGB_DI_PIN 0 +#define RGB_STEP 16 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ diff --git a/keyboards/v60_type_r/keymaps/default/config.h b/keyboards/v60_type_r/keymaps/default/config.h new file mode 100644 index 000000000..9561b0255 --- /dev/null +++ b/keyboards/v60_type_r/keymaps/default/config.h @@ -0,0 +1,26 @@ +/* Copyright 2017 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef V60_POLESTAR +#undef V60_POLESTAR +#endif + +#endif diff --git a/keyboards/v60_type_r/keymaps/default/keymap.c b/keyboards/v60_type_r/keymaps/default/keymap.c index 58ae81c4b..e277254b9 100644 --- a/keyboards/v60_type_r/keymaps/default/keymap.c +++ b/keyboards/v60_type_r/keymaps/default/keymap.c @@ -15,7 +15,7 @@ */ /* This is the default layout provided by the KBP V60 Type R -* as depicted in their manual and on the stock keycaps. +* as depicted in their manual and on the stock keycaps. */ #include "v60_type_r.h" @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, KC_TRNS, \ KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_NO, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS), - + }; @@ -86,18 +86,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } diff --git a/keyboards/v60_type_r/keymaps/vimouse/config.h b/keyboards/v60_type_r/keymaps/vimouse/config.h new file mode 100644 index 000000000..3937420d0 --- /dev/null +++ b/keyboards/v60_type_r/keymaps/vimouse/config.h @@ -0,0 +1,31 @@ +/* Copyright 2017 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define V60_POLESTAR + +// place overrides here +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +#endif diff --git a/keyboards/v60_type_r/keymaps/vimouse/keymap.c b/keyboards/v60_type_r/keymaps/vimouse/keymap.c new file mode 100644 index 000000000..1dd9f7eaa --- /dev/null +++ b/keyboards/v60_type_r/keymaps/vimouse/keymap.c @@ -0,0 +1,130 @@ +/* Copyright 2017 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "v60_type_r.h" + +#define _____ KC_TRNS +#define XXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bs | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |FN0 | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |LShift | Z| X| C| V| B| N| M| ,| .| /| RShift | + * |-----------------------------------------------------------| + * |Ctrl|Alt |Gui | Space/L3 |Gui |Alt |Ctrl|Fn1| + * `-----------------------------------------------------------' + */ + [0] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXX, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + LT(1, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, XXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXX, \ + KC_LCTL, KC_LALT, KC_LGUI, LT(2, KC_SPC), KC_RGUI, KC_RALT, KC_RCTL, MO(3)), + /* Keymap 1: FN Layer + * ,-----------------------------------------------------------. + * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del | + * |-----------------------------------------------------------| + * | | | | | | | | | | |PSc|SLk|Pau| Ins | + * |-----------------------------------------------------------| + * | | | | | | | Lt| Dn| Up| Rt|Hom|PgU| | + * |-----------------------------------------------------------| + * | | | | | | |Mut|VDn|VUp|End|PgD| | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [1] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, KC_DEL, \ + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, \ + _____, _____, _____, _____, _____, _____, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_HOME, KC_PGUP, _____, \ + _____, _____, _____, _____, _____, _____, _____, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, KC_PGDN, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____), + /* Keymap 2: Mouse Keys Layer + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | |MWU|MWD| | | | | | + * |-----------------------------------------------------------| + * | | | | | | |MLt|MDn|MUp|MRt| | | | + * |-----------------------------------------------------------| + * | | | | | |SPC|Ms1|Ms2|Ms3| | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [2] = KEYMAP( + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, KC_MS_WH_UP, KC_MS_WH_DOWN, _____, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, KC_SPC, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____), + /* Keymap 3: LED Modification Layer + * ,-----------------------------------------------------------. + * | |BLT|BLC|UGT|UGP|UGB|UGR| | | | | | | | + * |-----------------------------------------------------------| + * | |RD+|GN+|BL+|HU+|SA+|VA+| | | | | | | | + * |-----------------------------------------------------------| + * | |RD-|GN-|BL-|HU-|SA-|VA-| | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [3] = KEYMAP( + _____, BL_TOGG, BL_STEP, RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, _____, _____, _____, _____, _____, _____, _____, _____, \ + _____, RGB_RI, RGB_GI, RGB_BI, RGB_HUI, RGB_SAI, RGB_VAI, _____, _____, _____, _____, _____, _____, _____, \ + _____, RGB_RD, RGB_GD, RGB_BD, RGB_HUD, RGB_SAD, RGB_VAD, _____, _____, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +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; +}; + + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1< + +#include "action_layer.h" +#include "quantum.h" + +// if we've got an RGB underglow! +#ifdef V60_POLESTAR +#define SOFTPWM_LED_TIMER_TOP F_CPU/(256*64) + +extern rgblight_config_t rgblight_config; +static uint8_t softpwm_buff[3] = {0}; + +void matrix_init_user(void) { + rgb_init(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t r = led[0].r, g = led[0].g, b = led[0].b; + switch(keycode) { + case RGB_RI: + if (record->event.pressed) { + r += RGB_STEP; + if (r < led[0].r) { + r = 255; + } + rgblight_setrgb(r, g, b); + } + + return false; + case RGB_RD: + if (record->event.pressed) { + r -= RGB_STEP; + if (r > led[0].r) { + r = 0; + } + rgblight_setrgb(r, g, b); + } + + return false; + case RGB_BI: + if (record->event.pressed) { + b += RGB_STEP; + if (b < led[0].b) { + b = 255; + } + rgblight_setrgb(r, g, b); + } + + return false; + case RGB_BD: + if (record->event.pressed) { + b -= RGB_STEP; + if (b > led[0].b) { + b = 0; + } + rgblight_setrgb(r, g, b); + } + + return false; + case RGB_GI: + if (record->event.pressed) { + g += RGB_STEP; + if (g < led[0].g) { + g = 255; + } + rgblight_setrgb(r, g, b); + } + + return false; + case RGB_GD: + if (record->event.pressed) { + g -= RGB_STEP; + if (g > led[0].g) { + g = 0; + } + rgblight_setrgb(r, g, b); + } + + return false; + } + + return true; +} + + +void rgb_timer_init(void) { + /* Timer1 setup */ + /* CTC mode */ + TCCR1B |= (1<> 8) & 0xff; + OCR1AL = SOFTPWM_LED_TIMER_TOP & 0xff; + SREG = sreg; + + // Enable the compare match interrupt on timer 1 + TIMSK1 |= (1< Date: Mon, 1 Jan 2018 17:55:18 -0600 Subject: [PATCH 029/556] JC65 - Adding in CapsLock LED support and my personal keymap Signed-off-by: Stacy Devino --- keyboards/jc65/jc65.c | 10 +++++++++- keyboards/jc65/keymaps/coth/config.h | 1 + keyboards/jc65/keymaps/coth/keymap.c | 25 +++++++++++++++++++++++++ keyboards/jc65/keymaps/coth/readme.md | 14 ++++++++++++++ keyboards/jc65/keymaps/coth/rules.mk | 0 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 keyboards/jc65/keymaps/coth/config.h create mode 100644 keyboards/jc65/keymaps/coth/keymap.c create mode 100644 keyboards/jc65/keymaps/coth/readme.md create mode 100644 keyboards/jc65/keymaps/coth/rules.mk diff --git a/keyboards/jc65/jc65.c b/keyboards/jc65/jc65.c index 82b1d5741..6f51c0d6e 100644 --- a/keyboards/jc65/jc65.c +++ b/keyboards/jc65/jc65.c @@ -23,6 +23,14 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - + if (usb_led & (1< Date: Tue, 2 Jan 2018 19:58:16 +0100 Subject: [PATCH 030/556] macOS also requires avrdude --- docs/getting_started_build_tools.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 6c8eca0de..cd748dbf8 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -53,6 +53,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew install avr-gcc brew install dfu-programmer brew install gcc-arm-none-eabi + brew install avrdude This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of avr-libc can take over 20 minutes and exhibit high CPU usage. From d19805f9de89a6200bc5d85f429cc3f18731b587 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 2 Jan 2018 21:35:42 -0500 Subject: [PATCH 031/556] update avr url --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 181bf366f..125e8f333 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ env: global: - secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM= before_install: - - wget http://www.atmel.com/images/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz + - wget http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz install: - tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz - export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin" @@ -38,4 +38,4 @@ notifications: - https://webhooks.gitter.im/e/afce403d65f143dfac09 on_success: always # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always \ No newline at end of file + on_start: never # options: [always|never|change] default: always From 6c24e28b8db255b77b4945cd843a617ee5141678 Mon Sep 17 00:00:00 2001 From: YouCanFly Date: Wed, 3 Jan 2018 10:54:56 +0800 Subject: [PATCH 032/556] ADD RGBLIGHT_LIMIT_VAL (#2214) --- docs/feature_rgblight.md | 1 + quantum/rgblight.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 554eb2dcd..f96fa8773 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -41,6 +41,7 @@ You can change the behavior of the RGB Lighting by setting these configuration v | `RGBLIGHT_HUE_STEP` | 10 | How many hues you want to have available. | | `RGBLIGHT_SAT_STEP` | 17 | How many steps of saturation you'd like. | | `RGBLIGHT_VAL_STEP` | 17 | The number of levels of brightness you want. | +| `RGBLIGHT_LIMIT_VAL` | 255 | Limit the val of HSV to limit the maximum brightness simply. | ### Animations diff --git a/quantum/rgblight.c b/quantum/rgblight.c index ab218b8c5..cc49cdf63 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -46,6 +46,12 @@ bool rgblight_timer_enabled = false; void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { uint8_t r = 0, g = 0, b = 0, base, color; + #ifdef RGBLIGHT_LIMIT_VAL + if (val > RGBLIGHT_LIMIT_VAL) { + val=RGBLIGHT_LIMIT_VAL; // limit the val + } + #endif + if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. r = val; g = val; From 0a5d302622b440183fbb42593fd07c4da11abba3 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Tue, 2 Jan 2018 22:17:49 +0100 Subject: [PATCH 033/556] Let's Split: Minor fixes in keymap.c comments - Single quote (') is the un-shifted key, not double quote (") - Fixed alignment --- keyboards/lets_split/keymaps/default/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c index 3664f3108..bf3ae4551 100644 --- a/keyboards/lets_split/keymaps/default/keymap.c +++ b/keyboards/lets_split/keymaps/default/keymap.c @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * | Esc | A | R | S | T | D | H | N | E | I | O | ' | * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Dvorak * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| * | Esc | A | O | E | U | I | D | H | T | N | S | / | * |------+------+------+------+------+------|------+------+------+------+------+------| @@ -88,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| From 9cb1d36974b7ea4c380c0b7818812f6f5aae56c1 Mon Sep 17 00:00:00 2001 From: TurboMech Date: Wed, 3 Jan 2018 05:48:09 -0500 Subject: [PATCH 034/556] Added Mechmini 2.0 to Mechmini keyboard folder This creates a v1 and v2 subproject. V1 retains all the same implementations of the bootmapper-ported Mechmnini 1 including #2196. V2 adds the Mechmini 2.0 kayboard support (I know it took me way to long to get it a pull request in). All readme's updated to reflect compiling the two seperate keyboards. Simply either `make mechmini/v1:default` or `make mechmini/v2:defualt`. Utilizing the rules.mk using `make mechmini:default` will automatically create the Mechmini 2 default keymap as this is the current version and has a much wider user base. --- keyboards/mechmini/config.h | 57 +++----- keyboards/mechmini/mechmini.c | 57 ++------ keyboards/mechmini/mechmini.h | 54 +++----- keyboards/mechmini/readme.md | 62 ++------- keyboards/mechmini/rules.mk | 51 +------ keyboards/mechmini/v1/README.md | 83 ++++++++++++ keyboards/mechmini/v1/config.h | 48 +++++++ keyboards/mechmini/{ => v1}/i2c.c | 0 keyboards/mechmini/{ => v1}/i2c.h | 0 .../{ => v1}/keymaps/default/keymap.c | 0 keyboards/mechmini/{ => v1}/matrix.c | 0 keyboards/mechmini/v1/rules.mk | 50 +++++++ keyboards/mechmini/{ => v1}/usbconfig.h | 0 keyboards/mechmini/v1/v1.c | 44 +++++++ keyboards/mechmini/v1/v1.h | 43 ++++++ keyboards/mechmini/v2/README.md | 20 +++ keyboards/mechmini/v2/config.h | 77 +++++++++++ .../v2/keymaps/2u_space_ortho/keymap.c | 124 ++++++++++++++++++ .../mechmini/v2/keymaps/625_space/keymap.c | 116 ++++++++++++++++ .../mechmini/v2/keymaps/default/keymap.c | 115 ++++++++++++++++ .../mechmini/v2/keymaps/default/readme.md | 2 + keyboards/mechmini/v2/keymaps/ortho/keymap.c | 124 ++++++++++++++++++ .../mechmini/v2/keymaps/split_space/keymap.c | 115 ++++++++++++++++ .../mechmini/v2/keymaps/split_space/readme.md | 2 + keyboards/mechmini/v2/rules.mk | 63 +++++++++ keyboards/mechmini/v2/v2.c | 1 + keyboards/mechmini/v2/v2.h | 69 ++++++++++ 27 files changed, 1163 insertions(+), 214 deletions(-) create mode 100644 keyboards/mechmini/v1/README.md create mode 100644 keyboards/mechmini/v1/config.h rename keyboards/mechmini/{ => v1}/i2c.c (100%) rename keyboards/mechmini/{ => v1}/i2c.h (100%) rename keyboards/mechmini/{ => v1}/keymaps/default/keymap.c (100%) rename keyboards/mechmini/{ => v1}/matrix.c (100%) create mode 100644 keyboards/mechmini/v1/rules.mk rename keyboards/mechmini/{ => v1}/usbconfig.h (100%) create mode 100644 keyboards/mechmini/v1/v1.c create mode 100644 keyboards/mechmini/v1/v1.h create mode 100644 keyboards/mechmini/v2/README.md create mode 100755 keyboards/mechmini/v2/config.h create mode 100644 keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c create mode 100755 keyboards/mechmini/v2/keymaps/625_space/keymap.c create mode 100755 keyboards/mechmini/v2/keymaps/default/keymap.c create mode 100644 keyboards/mechmini/v2/keymaps/default/readme.md create mode 100755 keyboards/mechmini/v2/keymaps/ortho/keymap.c create mode 100755 keyboards/mechmini/v2/keymaps/split_space/keymap.c create mode 100644 keyboards/mechmini/v2/keymaps/split_space/readme.md create mode 100755 keyboards/mechmini/v2/rules.mk create mode 100755 keyboards/mechmini/v2/v2.c create mode 100755 keyboards/mechmini/v2/v2.h diff --git a/keyboards/mechmini/config.h b/keyboards/mechmini/config.h index 6a4523f85..98c9fb651 100644 --- a/keyboards/mechmini/config.h +++ b/keyboards/mechmini/config.h @@ -1,45 +1,28 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . +/* Copyright 2017 Luiz Ribeiro + * Copyright 2018 TurboMech /u/TurboMech @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "config_common.h" #ifndef CONFIG_H #define CONFIG_H -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422D -// TODO: share these strings with usbconfig.h -// Edit usbconfig.h to change these. -#define MANUFACTURER winkeyless.kr -#define PRODUCT mechmini - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 - -#define NO_UART 1 - -/* RGB underglow */ -// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. -// The same pin is used on the JJ40, at least. -#define RGBLED_NUM 16 -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN E2 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA40 +#define MANUFACTURER MECHKEYS +#define PRODUCT Mechmini +#define DESCRIPTION 40% modular keyboard #endif diff --git a/keyboards/mechmini/mechmini.c b/keyboards/mechmini/mechmini.c index 9897da099..46e29ba3e 100644 --- a/keyboards/mechmini/mechmini.c +++ b/keyboards/mechmini/mechmini.c @@ -1,46 +1,17 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . +/* Copyright 2017 Luiz Ribeiro + * Copyright 2018 TurboMech /u/TurboMech @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #include "mechmini.h" -#include - -#include "action_layer.h" -#include "i2c.h" -#include "quantum.h" - -#include "rgblight.h" - -// custom RGB driver -extern rgblight_config_t rgblight_config; -void rgblight_set(void) { - if (!rgblight_config.enable) { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - } - } - - i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { - rgblight_task(); - /* add other tasks to be done on each matrix scan */ -} diff --git a/keyboards/mechmini/mechmini.h b/keyboards/mechmini/mechmini.h index 2890fad7a..637021cd2 100644 --- a/keyboards/mechmini/mechmini.h +++ b/keyboards/mechmini/mechmini.h @@ -1,42 +1,30 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . +/* Copyright 2017 Luiz Ribeiro + * Copyright 2018 TurboMech /u/TurboMech @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef MECHMINI_H #define MECHMINI_H -#include "keycode.h" -#include "action.h" #include "quantum.h" -#define KEYMAP( \ - K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, \ - K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, \ - K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, \ - K00, K10, K20, K56, K57, KB0, KC0, K66 \ -) \ -{ \ - { K00, K10, K20, K56, KC_NO, K57, KC_NO, KC_NO, KB0, KC0, K66, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, 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, 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, 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, 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, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} +#ifdef KEYBOARD_mechmini_v1 + #include "v1.h" +#endif + +#ifdef KEYBOARD_mechmini_v2 + #include "v2.h" +#endif #endif diff --git a/keyboards/mechmini/readme.md b/keyboards/mechmini/readme.md index ef0602297..56dd81a24 100644 --- a/keyboards/mechmini/readme.md +++ b/keyboards/mechmini/readme.md @@ -1,13 +1,17 @@ -mechmini +Mechmini ======== -A compact ortholinear/staggered keyboard. +A 40% compact ortholinear/staggered keyboard. -Keyboard Maintainer: QMK Community -Hardware Supported: mechmini PCB -Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0-pcb +Version 1 was originally bootmapper (ps2avrGB) and can be ported to QMK following the v1 readme (../mechmini/v1/readme.md). This version is no longer in production. -Make example for this keyboard (after setting up your build environment): +Version 2 (Mechmini 2.0) was shipped powered by QMK [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: QMK Community (version 1) & [TurboMech](https://github.com/TurboMech) (version 2 - aka Mechmini 2.0) +Hardware Supported: Mechmini keyboard +Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0 + +Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space) - please see v1 readme for v1 make instructions: make mechmini:default @@ -15,50 +19,6 @@ See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) ## Mechmini Notes -Note that this is a complete replacement for the firmware, so you won't be -using Bootmapper Client to change any keyboard settings, since not all the -USB report options are supported. +There are 2 versions of the Mechmini keyboard. Please read the readme for the version you have for make instructions. -## Installing -First, install the requirements. These commands are for OSX, but all you -need is the AVR toolchain and `bootloadHID` for flashing: - -``` -$ brew cask install crosspack-avr -$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb -``` - -In order to use the `./program` script, which can reboot the board into -the bootloader, you'll need Python 2 with PyUSB installed: - -``` -$ pip install pyusb -``` - -Then, with the keyboard plugged in, simply run this command from the -`qmk_firmware` directory: - -``` -$ make mechmini:program -``` - -If you prefer, you can just build it and flash the firmware directly with -`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it -in the bootloader: - -``` -$ make mechmini -$ bootloadHID -r mechmini_default.hex -``` - -## Troubleshooting - -From my experience, it's really hard to brick these boards. But these -tricks have been useful when it got stuck in a weird scenario. - -1. Try plugging the board in while pressing `L_Ctrl`. This will force it - to boot only the bootloader without loading the firmware. Once this is - done, just reflash the board with the original firmware. -2. Sometimes USB hubs can act weird, so try connecting the board directly - to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/mechmini/rules.mk b/keyboards/mechmini/rules.mk index ed55ae1c4..71dae5127 100644 --- a/keyboards/mechmini/rules.mk +++ b/keyboards/mechmini/rules.mk @@ -1,50 +1 @@ -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# MCU name -MCU = atmega32a -PROTOCOL = VUSB - -# unsupported features for now -NO_UART = yes -NO_SUSPEND_POWER_DOWN = yes - -# processor frequency -F_CPU = 12000000 - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = atmel-dfu - -# build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes -RGBLIGHT_CUSTOM_DRIVER = yes - -OPT_DEFS = -DDEBUG_LEVEL=0 - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c - -# programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex \ No newline at end of file +DEFAULT_FOLDER = mechmini/v2 diff --git a/keyboards/mechmini/v1/README.md b/keyboards/mechmini/v1/README.md new file mode 100644 index 000000000..9f44a9c2c --- /dev/null +++ b/keyboards/mechmini/v1/README.md @@ -0,0 +1,83 @@ +Mechmini V1 +=========== + +A 40% ortholinear/staggered keyboard, that was originally bootmapper and can be ported to QMK following this readme. This version is no longer in production [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: QMK Community +Hardware Supported: Mechmini 1 PCB +Hardware Availability: Version 1 (Bootmapper) no longer in production [MECHKEYS](https://mechkeys.ca) + +Make example for this keyboard (after setting up your build environment): + + make mechmini/v1:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +## Mechmini Notes + +Note that this is a complete replacement for the firmware, so you won't be +using Bootmapper Client to change any keyboard settings, since not all the +USB report options are supported. + +## Installing + +First, install the requirements. These commands are for OSX, but all you +need is the AVR toolchain and `bootloadHID` for flashing: + +``` +$ brew cask install crosspack-avr +$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb +``` + +In order to use the `./program` script, which can reboot the board into +the bootloader, you'll need Python 2 with PyUSB installed: + +``` +$ pip install pyusb +``` + +Then, with the keyboard plugged in, simply run this command from the +`qmk_firmware` directory: + +``` +$ make mechmini:program +``` + +If you prefer, you can just build it and flash the firmware directly with +`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it +in the bootloader: + +``` +$ make mechmini +$ bootloadHID -r mechmini_default.hex +``` + +## Troubleshooting + +From my experience, it's really hard to brick these boards. But these +tricks have been useful when it got stuck in a weird scenario. + +1. Try plugging the board in while pressing `L_Ctrl`. This will force it + to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. +3. If errors happen with +`./tmk_core/common/avr/suspend.c` it is likely you implemented a RGB underglow sleep setting previously. Simply comment out the following code found under `void suspend_wakeup_init(void)`: +``` +ifdef RGBLIGHT_ANIMATIONS + rgblight_timer_enable(); + _delay_ms(50); + rgblight_set(); +#endif +``` +So that the resulting code should know reflect: +``` +/*#ifdef RGBLIGHT_ANIMATIONS + rgblight_timer_enable(); + _delay_ms(50); + rgblight_set(); +#endif*/ +``` + + diff --git a/keyboards/mechmini/v1/config.h b/keyboards/mechmini/v1/config.h new file mode 100644 index 000000000..1f46451f9 --- /dev/null +++ b/keyboards/mechmini/v1/config.h @@ -0,0 +1,48 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef V1_CONFIG_H +#define V1_CONFIG_H + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA40 +#define DEVICE_VER 0x0001 +// TODO: share these strings with usbconfig.h +// Edit usbconfig.h to change these. +#define MANUFACTURER MECHKEYS +#define PRODUCT Mechmini +#define DESCRIPTION 40% modular keyboard + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define NO_UART 1 + +/* RGB underglow */ +// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN E2 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#endif diff --git a/keyboards/mechmini/i2c.c b/keyboards/mechmini/v1/i2c.c similarity index 100% rename from keyboards/mechmini/i2c.c rename to keyboards/mechmini/v1/i2c.c diff --git a/keyboards/mechmini/i2c.h b/keyboards/mechmini/v1/i2c.h similarity index 100% rename from keyboards/mechmini/i2c.h rename to keyboards/mechmini/v1/i2c.h diff --git a/keyboards/mechmini/keymaps/default/keymap.c b/keyboards/mechmini/v1/keymaps/default/keymap.c similarity index 100% rename from keyboards/mechmini/keymaps/default/keymap.c rename to keyboards/mechmini/v1/keymaps/default/keymap.c diff --git a/keyboards/mechmini/matrix.c b/keyboards/mechmini/v1/matrix.c similarity index 100% rename from keyboards/mechmini/matrix.c rename to keyboards/mechmini/v1/matrix.c diff --git a/keyboards/mechmini/v1/rules.mk b/keyboards/mechmini/v1/rules.mk new file mode 100644 index 000000000..11bd8955f --- /dev/null +++ b/keyboards/mechmini/v1/rules.mk @@ -0,0 +1,50 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# build options +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/mechmini/usbconfig.h b/keyboards/mechmini/v1/usbconfig.h similarity index 100% rename from keyboards/mechmini/usbconfig.h rename to keyboards/mechmini/v1/usbconfig.h diff --git a/keyboards/mechmini/v1/v1.c b/keyboards/mechmini/v1/v1.c new file mode 100644 index 000000000..24c74c6cf --- /dev/null +++ b/keyboards/mechmini/v1/v1.c @@ -0,0 +1,44 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "v1.h" +#include +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" +#include "rgblight.h" + +// custom RGB driver +extern rgblight_config_t rgblight_config; +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { + rgblight_task(); + /* add other tasks to be done on each matrix scan */ +} diff --git a/keyboards/mechmini/v1/v1.h b/keyboards/mechmini/v1/v1.h new file mode 100644 index 000000000..501bd89c5 --- /dev/null +++ b/keyboards/mechmini/v1/v1.h @@ -0,0 +1,43 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef V1_H +#define V2_H + +#include "../mechmini.h" +#include "keycode.h" +#include "action.h" +#include "quantum.h" + +#define KEYMAP( \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, \ + K00, K10, K20, K56, K57, KB0, KC0, K66 \ +) \ +{ \ + { K00, K10, K20, K56, KC_NO, K57, KC_NO, KC_NO, KB0, KC0, K66, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, 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, 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, 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, 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, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +#endif diff --git a/keyboards/mechmini/v2/README.md b/keyboards/mechmini/v2/README.md new file mode 100644 index 000000000..e1efc9904 --- /dev/null +++ b/keyboards/mechmini/v2/README.md @@ -0,0 +1,20 @@ +Mechmini 2.0 +============ + +A 40% compact ortholinear/staggered keyboard. + +Version 2 (Mechmini 2.0) was shipped powered by QMK [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) +Hardware Supported: Mechmini 2.0 keyboard +Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0 + +Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space): + + make mechmini/v2:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +## Mechmini Notes + +There are 2 versions of the Mechmini keyboard. Please read the readme for the version you have for make instructions. diff --git a/keyboards/mechmini/v2/config.h b/keyboards/mechmini/v2/config.h new file mode 100755 index 000000000..58c751e0f --- /dev/null +++ b/keyboards/mechmini/v2/config.h @@ -0,0 +1,77 @@ +/* Copyright 2018 TurboMech /u/TurboMech @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ +#ifndef V2_CONFIG_H +#define V2_CONFIG_H + +#include "config_common.h" + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA40 +#define DEVICE_VER 0x0002 +#define MANUFACTURER MECHKEYS +#undef PRODUCT +#define PRODUCT Mechmini 2 +#undef DESCRIPTION +#define DESCRIPTION 40% modular keyboard + +/* key matrix size */ +#undef MATRIX_COLS +#undef MATRIX_ROWS +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B3, B1, B0, D5, B7, C7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c b/keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c new file mode 100644 index 000000000..1b0983331 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c @@ -0,0 +1,124 @@ +#include "mechmini.h" + +#define _BL 0 +#define _FN1 1 +#define _FN2 2 + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = KEYMAP_2U_SPACE_ORTHO( + F(0), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_CAPS, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + + [_FN1] = KEYMAP_2U_SPACE_ORTHO( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, M(1), M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + [_FN2] = KEYMAP_2U_SPACE_ORTHO( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, BL_TOGG, BL_STEP, BL_INC, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_HOME, KC_END, KC_TRNS, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_PGDN, KC_PGUP, KC_MPLY), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + case 1: + if (record->event.pressed) { + return MACRO( D(LCTL), T(C), U(LCTL), END ); + } + break; + case 2: + if (record->event.pressed) { + return MACRO( D(LCTL), T(V), U(LCTL), END ); + } + break; + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/mechmini/v2/keymaps/625_space/keymap.c b/keyboards/mechmini/v2/keymaps/625_space/keymap.c new file mode 100755 index 000000000..4c9f6011e --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/625_space/keymap.c @@ -0,0 +1,116 @@ +#include "mechmini.h" + +#define _BL 0 +#define _FN1 1 +#define _FN2 2 + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = KEYMAP_625_SPACE( + F(0), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_LSFT, KC_DOT, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, MO(1), MO(2)), + + [_FN1] = KEYMAP_625_SPACE( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_PGUP, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_TRNS, + KC_LSFT, KC_PGDN, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_SLSH, KC_TRNS, KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = KEYMAP_625_SPACE( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, + KC_TRNS, BL_TOGG, BL_STEP, BL_INC, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_END, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/mechmini/v2/keymaps/default/keymap.c b/keyboards/mechmini/v2/keymaps/default/keymap.c new file mode 100755 index 000000000..f9c792e55 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/default/keymap.c @@ -0,0 +1,115 @@ +#include "mechmini.h" + +#define _BL 0 +#define _FN1 1 +#define _FN2 2 + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = KEYMAP_SPLIT_SPACE( + F(0), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT, KC_DOT, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_RCTL, MO(1), MO(2)), + + [_FN1] = KEYMAP_SPLIT_SPACE( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_PGUP, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_TRNS, + KC_LSFT, KC_PGDN, KC_VOLD, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_SLSH, KC_COMM, KC_TRNS, KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = KEYMAP_SPLIT_SPACE( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, + KC_TRNS, BL_TOGG, BL_STEP, BL_INC, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_END, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/mechmini/v2/keymaps/default/readme.md b/keyboards/mechmini/v2/keymaps/default/readme.md new file mode 100644 index 000000000..093a7b084 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Mechmini 2.0 Layout - the same as split_space keymap + diff --git a/keyboards/mechmini/v2/keymaps/ortho/keymap.c b/keyboards/mechmini/v2/keymaps/ortho/keymap.c new file mode 100755 index 000000000..fb33e1775 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/ortho/keymap.c @@ -0,0 +1,124 @@ +#include "mechmini.h" + +#define _BL 0 +#define _FN1 1 +#define _FN2 2 + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = KEYMAP_ORTHO( + F(0), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_CAPS, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + + [_FN1] = KEYMAP_ORTHO( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, M(1), M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + [_FN2] = KEYMAP_ORTHO( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, BL_TOGG, BL_STEP, BL_INC, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_HOME, KC_END, KC_TRNS, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_PGDN, KC_PGUP, KC_MPLY), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + case 1: + if (record->event.pressed) { + return MACRO( D(LCTL), T(C), U(LCTL), END ); + } + break; + case 2: + if (record->event.pressed) { + return MACRO( D(LCTL), T(V), U(LCTL), END ); + } + break; + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/mechmini/v2/keymaps/split_space/keymap.c b/keyboards/mechmini/v2/keymaps/split_space/keymap.c new file mode 100755 index 000000000..f9c792e55 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/split_space/keymap.c @@ -0,0 +1,115 @@ +#include "mechmini.h" + +#define _BL 0 +#define _FN1 1 +#define _FN2 2 + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = KEYMAP_SPLIT_SPACE( + F(0), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT, KC_DOT, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_RCTL, MO(1), MO(2)), + + [_FN1] = KEYMAP_SPLIT_SPACE( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_PGUP, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_TRNS, + KC_LSFT, KC_PGDN, KC_VOLD, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_SLSH, KC_COMM, KC_TRNS, KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = KEYMAP_SPLIT_SPACE( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, + KC_TRNS, BL_TOGG, BL_STEP, BL_INC, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_END, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/mechmini/v2/keymaps/split_space/readme.md b/keyboards/mechmini/v2/keymaps/split_space/readme.md new file mode 100644 index 000000000..9c2dad396 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/split_space/readme.md @@ -0,0 +1,2 @@ +# The Default Mechmini 2.0 Layout + diff --git a/keyboards/mechmini/v2/rules.mk b/keyboards/mechmini/v2/rules.mk new file mode 100755 index 000000000..f9ef6414b --- /dev/null +++ b/keyboards/mechmini/v2/rules.mk @@ -0,0 +1,63 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +SLEEP_LED_ENABLE = no # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes diff --git a/keyboards/mechmini/v2/v2.c b/keyboards/mechmini/v2/v2.c new file mode 100755 index 000000000..caf7c6f0f --- /dev/null +++ b/keyboards/mechmini/v2/v2.c @@ -0,0 +1 @@ +#include "v2.h" diff --git a/keyboards/mechmini/v2/v2.h b/keyboards/mechmini/v2/v2.h new file mode 100755 index 000000000..7ab22b07a --- /dev/null +++ b/keyboards/mechmini/v2/v2.h @@ -0,0 +1,69 @@ +/* Copyright 2018 TurboMech /u/TurboMech @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +#ifndef V2_H +#define V2_H + +#include "../mechmini.h" + +#define KEYMAP_ORTHO( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K305, K307, K308, K309, K310, K311 } \ +} + +#define KEYMAP_625_SPACE( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K111, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K306, K310, K311 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, KC_NO, K111 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, KC_NO, KC_NO, KC_NO, K306, KC_NO, KC_NO, KC_NO, K310, K311 } \ +} + +#define KEYMAP_SPLIT_SPACE( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K111, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K304, K307, K309, K310, K311 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, KC_NO, K111 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, KC_NO, K304, KC_NO, KC_NO, K307, KC_NO, K309, K310, K311 } \ +} + +#define KEYMAP_2U_SPACE_ORTHO( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K307, K308, K309, K310, K311 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K305, K307, K308, K309, K310, K311 } \ +} + +#endif From cbc5de67be36d5b9b3872a3c41c9619b93b04b9f Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 3 Jan 2018 09:17:09 -0800 Subject: [PATCH 035/556] Duck Eagle/Viper V2 support (#2216) * Preliminary support for Duck Eagle/Viper V2 60% board. This is a copy of the octagon/v2 with things changed to reach a compiling state * Get a 60% keymap compiling, this might not be what the eagle/viper really supports * Update readme to point to correct GeekHack link * Get keymap working on a Duck Eagle * Add code submitted by profanum429 - Add HHKB style top row to v2.h - Modify read_rows function to take into accout the caps lock firmware key - Modify default keymap to match the new v2.h - Adjust readmes * Fix bug related to col 0 not working * Add keymap for mechmerlin * Add profanum429's viper hhkb layout * Add visual representation for mechmerlin layout Add navigation keys to keymap * Add a better visual representation to the mechmerlin keymap * Add profanum429's Viper layout! * Updated profanum429 keymap to match a full HHKB Enabled media keys in rules.mk * Revert "Updated profanum429 keymap to match a full HHKB" This reverts commit ed914160d7e27e6412d2c7c5c1c4fa0a04838667. * Fix default keymap for Eagle * Enable extra keys for audio control support * Modified timings in indicator_leds to accomodate the WS2811S chips on the Eagle/Viper2 PCBs at 800kHz with a 16mHz clock Modified the backlight settings to not interfere with the default RGB underglow code from QMK Modified the order of the LEDs in the LED status bar at the top of the Eagle/Viper2 PCBs (3,2,1,6,5,4,8,7 order) * Cleaned up indicator code to remove unused functions as the RGB underglow uses the default driver provided by QMK Commented out backlighting code in v2.c * update readmes to reflect profanum's awesome contributions and fix typo in make instructions * Remove custom RGB logic and just rely on QMK RGB underglow. We'll leave the backlighting in place for now --- keyboards/eagle_viper/eagle_viper.c | 1 + keyboards/eagle_viper/eagle_viper.h | 10 + keyboards/eagle_viper/readme.md | 12 + keyboards/eagle_viper/rules.mk | 1 + keyboards/eagle_viper/v2/config.h | 54 ++++ keyboards/eagle_viper/v2/indicator_leds.c | 89 ++++++ keyboards/eagle_viper/v2/indicator_leds.h | 2 + .../eagle_viper/v2/keymaps/default/keymap.c | 37 +++ .../eagle_viper/v2/keymaps/default/readme.md | 10 + .../v2/keymaps/mechmerlin/keymap.c | 44 +++ .../v2/keymaps/mechmerlin/readme.md | 15 + .../v2/keymaps/profanum429/keymap.c | 40 +++ .../v2/keymaps/profanum429/readme.md | 5 + keyboards/eagle_viper/v2/matrix.c | 266 ++++++++++++++++++ keyboards/eagle_viper/v2/readme.md | 30 ++ keyboards/eagle_viper/v2/rules.mk | 72 +++++ keyboards/eagle_viper/v2/v2.c | 66 +++++ keyboards/eagle_viper/v2/v2.h | 34 +++ 18 files changed, 788 insertions(+) create mode 100644 keyboards/eagle_viper/eagle_viper.c create mode 100644 keyboards/eagle_viper/eagle_viper.h create mode 100644 keyboards/eagle_viper/readme.md create mode 100644 keyboards/eagle_viper/rules.mk create mode 100644 keyboards/eagle_viper/v2/config.h create mode 100644 keyboards/eagle_viper/v2/indicator_leds.c create mode 100644 keyboards/eagle_viper/v2/indicator_leds.h create mode 100644 keyboards/eagle_viper/v2/keymaps/default/keymap.c create mode 100644 keyboards/eagle_viper/v2/keymaps/default/readme.md create mode 100644 keyboards/eagle_viper/v2/keymaps/mechmerlin/keymap.c create mode 100644 keyboards/eagle_viper/v2/keymaps/mechmerlin/readme.md create mode 100644 keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c create mode 100644 keyboards/eagle_viper/v2/keymaps/profanum429/readme.md create mode 100644 keyboards/eagle_viper/v2/matrix.c create mode 100644 keyboards/eagle_viper/v2/readme.md create mode 100644 keyboards/eagle_viper/v2/rules.mk create mode 100644 keyboards/eagle_viper/v2/v2.c create mode 100644 keyboards/eagle_viper/v2/v2.h diff --git a/keyboards/eagle_viper/eagle_viper.c b/keyboards/eagle_viper/eagle_viper.c new file mode 100644 index 000000000..c2d44c4e7 --- /dev/null +++ b/keyboards/eagle_viper/eagle_viper.c @@ -0,0 +1 @@ +#include "eagle_viper.h" diff --git a/keyboards/eagle_viper/eagle_viper.h b/keyboards/eagle_viper/eagle_viper.h new file mode 100644 index 000000000..fc34e7dde --- /dev/null +++ b/keyboards/eagle_viper/eagle_viper.h @@ -0,0 +1,10 @@ +#ifndef EAGLE_VIPER_H +#define EAGLE_VIPER_H + +#include "quantum.h" + +#ifdef KEYBOARD_eagle_viper_v2 + #include "v2.h" +#endif + +#endif diff --git a/keyboards/eagle_viper/readme.md b/keyboards/eagle_viper/readme.md new file mode 100644 index 000000000..48f4a4be3 --- /dev/null +++ b/keyboards/eagle_viper/readme.md @@ -0,0 +1,12 @@ +# Duck Eagle/Viper + +Non official firmware for custom Korean keyboard with 60% key layout made by Duck. + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127) + +Make example for this keyboard (after setting up your build environment): + + make eagle_viper/v2:default + diff --git a/keyboards/eagle_viper/rules.mk b/keyboards/eagle_viper/rules.mk new file mode 100644 index 000000000..ba2241fa8 --- /dev/null +++ b/keyboards/eagle_viper/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = eagle_viper/v2 diff --git a/keyboards/eagle_viper/v2/config.h b/keyboards/eagle_viper/v2/config.h new file mode 100644 index 000000000..0538f9620 --- /dev/null +++ b/keyboards/eagle_viper/v2/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Duck +#define PRODUCT Eagle/Viper V2 +#define DESCRIPTION 60% Korean custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 1 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D6 +#define RGBLED_NUM 17 + +#define TAPPING_TERM 200 + +#endif diff --git a/keyboards/eagle_viper/v2/indicator_leds.c b/keyboards/eagle_viper/v2/indicator_leds.c new file mode 100644 index 000000000..03a93197d --- /dev/null +++ b/keyboards/eagle_viper/v2/indicator_leds.c @@ -0,0 +1,89 @@ +/* +Copyright 2017 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include +#include +#include "indicator_leds.h" + +#define RES 6000 + +#define LED_T1H 600 +#define LED_T1L 650 +#define LED_T0H 250 +#define LED_T0L 1000 + +#define NS_PER_SEC (1000000000L) +#define CYCLES_PER_SEC (F_CPU) +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +void send_bit_d4(bool bitVal) { + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); + } +} + +void show(void) { + _delay_us((RES / 1000UL) + 1); +} + +void send_value(uint8_t byte) { + for(uint8_t b = 0; b < 8; b++) { + send_bit_d4(byte & 0b10000000); + byte <<= 1; + } +} + +// Send the LED indicators to the WS2811S chips +void indicator_leds_set(bool leds[8]) { + uint8_t led_cnt; + + cli(); + for(led_cnt = 0; led_cnt < 8; led_cnt++) + send_value(leds[led_cnt] ? 255 : 0); + sei(); + show(); +} diff --git a/keyboards/eagle_viper/v2/indicator_leds.h b/keyboards/eagle_viper/v2/indicator_leds.h new file mode 100644 index 000000000..c174fa404 --- /dev/null +++ b/keyboards/eagle_viper/v2/indicator_leds.h @@ -0,0 +1,2 @@ +void indicator_leds_set(bool leds[8]); +void show(void); diff --git a/keyboards/eagle_viper/v2/keymaps/default/keymap.c b/keyboards/eagle_viper/v2/keymaps/default/keymap.c new file mode 100644 index 000000000..c76eaa7be --- /dev/null +++ b/keyboards/eagle_viper/v2/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2017 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "eagle_viper.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = KEYMAP(\ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_NO, KC_RALT, KC_RGUI, KC_RCTL), + + [1] = KEYMAP(\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, 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, RESET, 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_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + }; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; diff --git a/keyboards/eagle_viper/v2/keymaps/default/readme.md b/keyboards/eagle_viper/v2/keymaps/default/readme.md new file mode 100644 index 000000000..834ff7cd3 --- /dev/null +++ b/keyboards/eagle_viper/v2/keymaps/default/readme.md @@ -0,0 +1,10 @@ +# Default Eagle Layout + +This is the default implement layout for Duck Eagle V2. + +![Duck Eagle V2 Default Layout](https://imgur.com/mWBY3Dc.png) + + +## Features + +* Default QWERTY layer diff --git a/keyboards/eagle_viper/v2/keymaps/mechmerlin/keymap.c b/keyboards/eagle_viper/v2/keymaps/mechmerlin/keymap.c new file mode 100644 index 000000000..2dc3f0190 --- /dev/null +++ b/keyboards/eagle_viper/v2/keymaps/mechmerlin/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2017 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "eagle_viper.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = KEYMAP(\ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_NO, KC_RALT, KC_RGUI, KC_RCTL), + + [1] = KEYMAP(\ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_PGDN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = KEYMAP(\ + 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_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_UP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT), + }; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; diff --git a/keyboards/eagle_viper/v2/keymaps/mechmerlin/readme.md b/keyboards/eagle_viper/v2/keymaps/mechmerlin/readme.md new file mode 100644 index 000000000..2e8784696 --- /dev/null +++ b/keyboards/eagle_viper/v2/keymaps/mechmerlin/readme.md @@ -0,0 +1,15 @@ +MechMerlin's Duck Eagle V2 Layout +====================== + +This is the preferred 60% layout used by u/merlin36, host of the MechMerlin YouTube channel. + +![Duck Eagle V2 Layout](https://imgur.com/FRcsmJc.png) + +## Keymap Notes +- Highly influenced by the KBP V60 and WKL B.Face standard layouts +- Does not support any form of inswitch lighting as Merlin hates them. +- Arrow toggle switch is FN + Space +- Reset is FN + R + +### Build +To build this keymap, simply run `make eagle_viper/v2:mechmerlin` from the qmk_firmware directory. \ No newline at end of file diff --git a/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c b/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c new file mode 100644 index 000000000..4141f6122 --- /dev/null +++ b/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2017 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "eagle_viper.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = KEYMAP(\ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_NO, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_NO, KC_RALT, KC_RGUI, KC_NO), + + [1] = KEYMAP(\ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, KC_TRNS, KC_ENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + }; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; + + + diff --git a/keyboards/eagle_viper/v2/keymaps/profanum429/readme.md b/keyboards/eagle_viper/v2/keymaps/profanum429/readme.md new file mode 100644 index 000000000..0f993559e --- /dev/null +++ b/keyboards/eagle_viper/v2/keymaps/profanum429/readme.md @@ -0,0 +1,5 @@ +# Profanum429 Duck Viper V2 Layout +TODO + +## Features +TODO diff --git a/keyboards/eagle_viper/v2/matrix.c b/keyboards/eagle_viper/v2/matrix.c new file mode 100644 index 000000000..c93766d1b --- /dev/null +++ b/keyboards/eagle_viper/v2/matrix.c @@ -0,0 +1,266 @@ +/* +Copyright 2017 MechMerlin +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include +#include +#include "matrix.h" +#include "util.h" +#include "print.h" +#include "debug.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(uint8_t col); +static void init_rows(void); +static void unselect_cols(void); +static void select_col(uint8_t col); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) +{ + DDRD |= 0b11010000; + PORTD &= ~0b01010000; + PORTD |= 0b10000000; + DDRB |= 0b00011111; + PORTB &= ~0b00001110; + PORTB |= 0b00010001; + DDRE |= 0b01000000; + PORTE &= ~0b01000000; +} + +void matrix_init(void) { + backlight_init_ports(); + unselect_cols(); + init_rows(); + + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + + uint8_t rows = read_rows(col); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "v2.h" +#include "indicator_leds.h" + +enum BACKLIGHT_AREAS { + BACKLIGHT_ALPHA = 0b0000001, + BACKLIGHT_EXTRA = 0b0000010, + BACKLIGHT_MODNUM = 0b0000100, + BACKLIGHT_FROW = 0b0001000, + BACKLIGHT_RGB = 0b0010000, + BACKLIGHT_SWITCH = 0b0001111 +}; + +uint8_t backlight_rgb_r = 255; +uint8_t backlight_rgb_g = 0; +uint8_t backlight_rgb_b = 0; + +void backlight_set(uint8_t level) { +/* + * DISABLE for now -> this causes issues with initial rgb setup + */ + +/* + level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010); + level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100); + level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000); + level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000); + level & BACKLIGHT_RGB ? backlight_toggle_rgb(true) : backlight_toggle_rgb(false); +*/ +} + +// Port from backlight_update_state +void led_set_kb(uint8_t usb_led) { + bool status[8] = { + host_keyboard_leds() & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef V2_H +#define V2_H + +#include "../eagle_viper.h" + +#define KEYMAP( \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2O, \ + K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ + K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O \ +) { \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, KC_NO, K2O, }, \ + { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O } \ +} +#endif From e956c11bc96814872b142a8f97e03e2935d285b6 Mon Sep 17 00:00:00 2001 From: skullY Date: Wed, 3 Jan 2018 10:00:15 -0800 Subject: [PATCH 036/556] Update the urls for atmel tools --- util/msys2_install.sh | 4 ++-- util/win_shared_install.sh | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/util/msys2_install.sh b/util/msys2_install.sh index de03b89ac..282053fe4 100644 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh @@ -13,7 +13,7 @@ source "$dir/win_shared_install.sh" function install_avr { rm -f -r "$avrtools" - wget "http://www.atmel.com/images/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe" + wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe" 7z x avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe } @@ -114,4 +114,4 @@ echo echo "******************************************************************************" echo "Installation completed!" echo "Please close this Window and restart MSYS2 MinGW" -echo "******************************************************************************" \ No newline at end of file +echo "******************************************************************************" diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh index 8d1949ae9..27539c5b5 100644 --- a/util/win_shared_install.sh +++ b/util/win_shared_install.sh @@ -18,9 +18,10 @@ function install_utils { wget 'https://www.pjrc.com/teensy/teensy_loader_cli_windows.zip' unzip teensy_loader_cli_windows.zip - echo "Installing Atmel Flip" - wget 'http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe' - mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe + # This URL has changed and I can't find the new location. Commenting out until we figure out the new URL or determine this isn't needed. -skullY + #echo "Installing Atmel Flip" + #wget 'http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe' + #mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe echo "Downloading the QMK driver installer" wget -qO- https://api.github.com/repos/qmk/qmk_driver_installer/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4 | wget -i - From 22b9303e2adfd9e5d708df425b97b5f4dbb0f8ee Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 3 Jan 2018 22:19:59 -0800 Subject: [PATCH 037/556] Keeb json layouts (#2219) * info.json committed to support the qmk configurator project These are info.json for each of the keyboards I've contributed to during my time here at QMK * change LAYOUT to KEYMAP to adhere to matrix definitions --- keyboards/eagle_viper/info.json | 13 +++++++++++++ keyboards/kc60/info.json | 13 +++++++++++++ keyboards/octagon/info.json | 13 +++++++++++++ keyboards/v60_type_r/info.json | 13 +++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 keyboards/eagle_viper/info.json create mode 100644 keyboards/kc60/info.json create mode 100644 keyboards/octagon/info.json create mode 100644 keyboards/v60_type_r/info.json diff --git a/keyboards/eagle_viper/info.json b/keyboards/eagle_viper/info.json new file mode 100644 index 000000000..a2ca3c59d --- /dev/null +++ b/keyboards/eagle_viper/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Eagle/Viper", + "manufacturer": "Duck", + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "width": 15, + "height": 5, + "layout": { + "KEYMAP": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":13, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/kc60/info.json b/keyboards/kc60/info.json new file mode 100644 index 000000000..bccc97f82 --- /dev/null +++ b/keyboards/kc60/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "KC60", + "manufacturer": "NKPC", + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "width": 15, + "height": 5, + "layout": { + "KEYMAP": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":14, "y":0, "w":2}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":14, "y":3, "w":2.75}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/octagon/info.json b/keyboards/octagon/info.json new file mode 100644 index 000000000..1c0e018a2 --- /dev/null +++ b/keyboards/octagon/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Octagon", + "manufacturer": "Duck", + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "width": 16, + "height": 6, + "layout": { + "KEYMAP": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":14, "y":1, "w":2}, {"x":15, "y":1}, {"x":0.5, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":14, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":0.75, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":14, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":1.25, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":13, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":0.25, "y":5, "w":1.25}, {"x":1.5, "y":5, "w":1.25}, {"x":2.75, "y":5, "w":1.25}, {"x":9, "y":5, "w":6.25}, {"x":10, "y":5}, {"x":11, "y":5}, {"x":12, "y":5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}] + } + } +} \ No newline at end of file diff --git a/keyboards/v60_type_r/info.json b/keyboards/v60_type_r/info.json new file mode 100644 index 000000000..6bf683e5d --- /dev/null +++ b/keyboards/v60_type_r/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "V60 Type R", + "manufacturer": "KBParadise", + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "width": 15, + "height": 5, + "layout": { + "KEYMAP": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":14, "y":0, "w":2}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":14, "y":3, "w":2.75}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}] + } + } +} \ No newline at end of file From 4b7fcf0af06070fc184350e9639f4da07210fc3d Mon Sep 17 00:00:00 2001 From: Daniel Gordon Date: Thu, 4 Jan 2018 00:20:18 -0600 Subject: [PATCH 038/556] Add info.json file for Chimera Ortho (#2217) * Add info.json file for Chimera Ortho * Correct LAYOUT to KEYMAP Correct LAYOUT to KEYMAP in chimera ortho's json.info --- keyboards/chimera_ortho/info.json | 247 ++++++++++++++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 keyboards/chimera_ortho/info.json diff --git a/keyboards/chimera_ortho/info.json b/keyboards/chimera_ortho/info.json new file mode 100644 index 000000000..18fcb3fbc --- /dev/null +++ b/keyboards/chimera_ortho/info.json @@ -0,0 +1,247 @@ +{ + "keyboard_name": "", + "manufacturer": "", + "identifier": "", + "url": "", + "maintainer": "qmk", + "processor": "", + "bootloader": "", + "width": 15.5, + "height": 4.25, + "layout": { + "KEYMAP": { + "layout": [ + { + "label": "Esc", + "x": 0, + "y": 0 + }, + { + "label": "Q", + "x": 1, + "y": 0 + }, + { + "label": "W", + "x": 2, + "y": 0 + }, + { + "label": "E", + "x": 3, + "y": 0 + }, + { + "label": "R", + "x": 4, + "y": 0 + }, + { + "label": "T", + "x": 5, + "y": 0 + }, + { + "label": "{", + "x": 6, + "y": 0 + }, + { + "label": "}", + "x": 8.5, + "y": 0 + }, + { + "label": "Y", + "x": 9.5, + "y": 0 + }, + { + "label": "U", + "x": 10.5, + "y": 0 + }, + { + "label": "I", + "x": 11.5, + "y": 0 + }, + { + "label": "O", + "x": 12.5, + "y": 0 + }, + { + "label": "P", + "x": 13.5, + "y": 0 + }, + { + "label": "\"", + "x": 14.5, + "y": 0 + }, + { + "label": "Tab", + "x": 0, + "y": 1 + }, + { + "label": "A", + "x": 1, + "y": 1 + }, + { + "label": "S", + "x": 2, + "y": 1 + }, + { + "label": "D", + "x": 3, + "y": 1 + }, + { + "label": "F", + "x": 4, + "y": 1 + }, + { + "label": "G", + "x": 5, + "y": 1 + }, + { + "label": "-", + "x": 6, + "y": 1 + }, + { + "label": "1", + "x": 8.5, + "y": 1 + }, + { + "label": "H", + "x": 9.5, + "y": 1 + }, + { + "label": "J", + "x": 10.5, + "y": 1 + }, + { + "label": "K", + "x": 11.5, + "y": 1 + }, + { + "label": "L", + "x": 12.5, + "y": 1 + }, + { + "label": ";", + "x": 13.5, + "y": 1 + }, + { + "label": "Enter", + "x": 14.5, + "y": 1 + }, + { + "label": "(", + "x": 0, + "y": 2 + }, + { + "label": "Z", + "x": 1, + "y": 2 + }, + { + "label": "X", + "x": 2, + "y": 2 + }, + { + "label": "C", + "x": 3, + "y": 2 + }, + { + "label": "V", + "x": 4, + "y": 2 + }, + { + "label": "B", + "x": 5, + "y": 2 + }, + { + "label": "=", + "x": 6, + "y": 2 + }, + { + "label": "8", + "x": 8.5, + "y": 2 + }, + { + "label": "N", + "x": 9.5, + "y": 2 + }, + { + "label": "M", + "x": 10.5, + "y": 2 + }, + { + "label": ",", + "x": 11.5, + "y": 2 + }, + { + "label": ".", + "x": 12.5, + "y": 2 + }, + { + "label": "/", + "x": 13.5, + "y": 2 + }, + { + "label": ")", + "x": 14.5, + "y": 2 + }, + { + "label": "Num Layer", + "x": 4, + "y": 3.25 + }, + { + "label": "Back Space", + "x": 5, + "y": 3.25 + }, + { + "label": "Space", + "x": 9.5, + "y": 3.25 + }, + { + "label": "Symbol Layer", + "x": 10.5, + "y": 3.25 + } + ] + } + } +} From 9e0b244a34d28aa2a03f2bf87919af4f25e5e96f Mon Sep 17 00:00:00 2001 From: profanum429 Date: Thu, 4 Jan 2018 00:20:58 -0600 Subject: [PATCH 039/556] profanum429@gmail.com (#2222) * Added initial in-switch LED support for the Eagle/Viper V2. Currently only has four modes: All ON, Mods/Nums ON, Alphas ON, or All OFF * Revert keymap changes * Changed switch curly bracket to match style. --- keyboards/eagle_viper/v2/config.h | 2 +- keyboards/eagle_viper/v2/v2.c | 41 +++++++++++++++---------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/keyboards/eagle_viper/v2/config.h b/keyboards/eagle_viper/v2/config.h index 0538f9620..f04b4a0fd 100644 --- a/keyboards/eagle_viper/v2/config.h +++ b/keyboards/eagle_viper/v2/config.h @@ -38,7 +38,7 @@ along with this program. If not, see . #define DEBOUNCING_DELAY 5 /* number of backlight levels */ -#define BACKLIGHT_LEVELS 1 +#define BACKLIGHT_LEVELS 3 /* key combination for magic key command */ #define IS_COMMAND() ( \ diff --git a/keyboards/eagle_viper/v2/v2.c b/keyboards/eagle_viper/v2/v2.c index 2d7fe1a20..a60acb978 100644 --- a/keyboards/eagle_viper/v2/v2.c +++ b/keyboards/eagle_viper/v2/v2.c @@ -17,30 +17,29 @@ #include "indicator_leds.h" enum BACKLIGHT_AREAS { - BACKLIGHT_ALPHA = 0b0000001, - BACKLIGHT_EXTRA = 0b0000010, - BACKLIGHT_MODNUM = 0b0000100, - BACKLIGHT_FROW = 0b0001000, - BACKLIGHT_RGB = 0b0010000, - BACKLIGHT_SWITCH = 0b0001111 + BACKLIGHT_ALPHAS = 0b00000010, + BACKLIGHT_MODNUM = 0b00001000 }; -uint8_t backlight_rgb_r = 255; -uint8_t backlight_rgb_g = 0; -uint8_t backlight_rgb_b = 0; - void backlight_set(uint8_t level) { -/* - * DISABLE for now -> this causes issues with initial rgb setup - */ - -/* - level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010); - level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100); - level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000); - level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000); - level & BACKLIGHT_RGB ? backlight_toggle_rgb(true) : backlight_toggle_rgb(false); -*/ + switch(level) { + case 0: + PORTB |= BACKLIGHT_ALPHAS; + PORTB |= BACKLIGHT_MODNUM; + break; + case 1: + PORTB &= ~BACKLIGHT_ALPHAS; + PORTB |= BACKLIGHT_MODNUM; + break; + case 2: + PORTB |= BACKLIGHT_ALPHAS; + PORTB &= ~BACKLIGHT_MODNUM; + break; + case 3: + PORTB &= ~BACKLIGHT_ALPHAS; + PORTB &= ~BACKLIGHT_MODNUM; + break; + } } // Port from backlight_update_state From 6bb3fbd4e0ff3123a1b3ea00d00c2ae7a2550120 Mon Sep 17 00:00:00 2001 From: rooski15 <34818505+rooski15@users.noreply.github.com> Date: Thu, 4 Jan 2018 10:32:51 -0800 Subject: [PATCH 040/556] Prime_R (#2221) * Rooski15: Add Prime_R Keyboard * Rooski15: Added keymaps to xd60, xd75, planck, and prime_r * Rooski15: Updated prime_r keymap * Rooski15: Added Prime_R and Documentation * Rooski15: Added Prime_R and Documentation * Rooski15: Prime_R - Added futher documentation. * Update config.h Added device information * Update readme.md Updated Planck:EmilyH Readme * Update readme.md Updated XD75:EmilyH Readme --- keyboards/planck/keymaps/emilyh/config.h | 42 +++ keyboards/planck/keymaps/emilyh/keymap.c | 317 ++++++++++++++++++ keyboards/planck/keymaps/emilyh/readme.md | 2 + keyboards/prime_r/config.h | 75 +++++ keyboards/prime_r/keymaps/default/config.h | 24 ++ keyboards/prime_r/keymaps/default/keymap.c | 76 +++++ keyboards/prime_r/keymaps/default/readme.md | 3 + keyboards/prime_r/keymaps/rooski/config.h | 24 ++ keyboards/prime_r/keymaps/rooski/keymap.c | 179 ++++++++++ keyboards/prime_r/keymaps/rooski/readme.md | 3 + keyboards/prime_r/prime_r.c | 43 +++ keyboards/prime_r/prime_r.h | 35 ++ keyboards/prime_r/readme.md | 17 + keyboards/prime_r/rules.mk | 56 ++++ .../xd60/keymaps/rooski/instructions.txt | 2 + keyboards/xd60/keymaps/rooski/keymap.c | 82 +++++ keyboards/xd75/keymaps/emilyh/config.h | 24 ++ keyboards/xd75/keymaps/emilyh/keymap.c | 187 +++++++++++ keyboards/xd75/keymaps/emilyh/readme.md | 1 + keyboards/xd75/keymaps/emilyh/rules.mk | 18 + 20 files changed, 1210 insertions(+) create mode 100644 keyboards/planck/keymaps/emilyh/config.h create mode 100644 keyboards/planck/keymaps/emilyh/keymap.c create mode 100644 keyboards/planck/keymaps/emilyh/readme.md create mode 100644 keyboards/prime_r/config.h create mode 100644 keyboards/prime_r/keymaps/default/config.h create mode 100644 keyboards/prime_r/keymaps/default/keymap.c create mode 100644 keyboards/prime_r/keymaps/default/readme.md create mode 100644 keyboards/prime_r/keymaps/rooski/config.h create mode 100644 keyboards/prime_r/keymaps/rooski/keymap.c create mode 100644 keyboards/prime_r/keymaps/rooski/readme.md create mode 100644 keyboards/prime_r/prime_r.c create mode 100644 keyboards/prime_r/prime_r.h create mode 100644 keyboards/prime_r/readme.md create mode 100644 keyboards/prime_r/rules.mk create mode 100644 keyboards/xd60/keymaps/rooski/instructions.txt create mode 100644 keyboards/xd60/keymaps/rooski/keymap.c create mode 100644 keyboards/xd75/keymaps/emilyh/config.h create mode 100644 keyboards/xd75/keymaps/emilyh/keymap.c create mode 100644 keyboards/xd75/keymaps/emilyh/readme.md create mode 100644 keyboards/xd75/keymaps/emilyh/rules.mk diff --git a/keyboards/planck/keymaps/emilyh/config.h b/keyboards/planck/keymaps/emilyh/config.h new file mode 100644 index 000000000..b406e2fed --- /dev/null +++ b/keyboards/planck/keymaps/emilyh/config.h @@ -0,0 +1,42 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/emilyh/keymap.c b/keyboards/planck/keymaps/emilyh/keymap.c new file mode 100644 index 000000000..cfc4bebae --- /dev/null +++ b/keyboards/planck/keymaps/emilyh/keymap.c @@ -0,0 +1,317 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Brite| GUI | Alt |Lower | Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT }, + {KC_LCTL, BACKLIT, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ | Home | Next | Vol+ | Mute | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | End | Prev | Vol- | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, + {KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), KC_HOME, KC_MNXT, KC_VOLU, KC_MUTE}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_MPRV, KC_VOLD, KC_MPLY} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |Plover|Pg Up | Next | Vol+ | Mute | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Pg Dn | Prev | Vol- | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(_PLOVER), KC_PGUP, KC_MNXT, KC_VOLU, KC_MUTE}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MPRV, KC_VOLD, KC_MPLY} +}, + +/* Numpad Layer + * ,-----------------------------------------------------------------------------------. + * | ESC | | | ( | ) | | | 7 | 8 | 9 | + | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | + | - | * | / | | | 4 | 5 | 6 | - | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | Up | | | | | 1 | 2 | 3 | Up | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |ToQrty| Left | Down |Right | | Space | 0 | . | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_ESC , XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN,XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_BSPC}, + {KC_TAB , KC_PPLS, KC_PMNS, KC_PAST, KC_PSLS,XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX}, + {XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_UP, _______}, + {TO(_QWERTY),KC_LEFT,KC_DOWN,KC_RGHT,XXXXXXX, KC_SPC, KC_SPC, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL }, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/emilyh/readme.md b/keyboards/planck/keymaps/emilyh/readme.md new file mode 100644 index 000000000..5805480eb --- /dev/null +++ b/keyboards/planck/keymaps/emilyh/readme.md @@ -0,0 +1,2 @@ +# A modified planck layout with arrow cluster + diff --git a/keyboards/prime_r/config.h b/keyboards/prime_r/config.h new file mode 100644 index 000000000..b53f14905 --- /dev/null +++ b/keyboards/prime_r/config.h @@ -0,0 +1,75 @@ +/* +Copyright 2018 Andrew Heaston + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER PrimeKB +#define PRODUCT Prime_R +#define DESCRIPTION A compact layout with mini-numpad. + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D0, B7, B3, B2 } +#define MATRIX_COL_PINS { D2, D3, D5, D4, D6, D7, B4, B5, C7, C6, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/prime_r/keymaps/default/config.h b/keyboards/prime_r/keymaps/default/config.h new file mode 100644 index 000000000..e7ffd3aa2 --- /dev/null +++ b/keyboards/prime_r/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Andrew Heaston + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/prime_r/keymaps/default/keymap.c b/keyboards/prime_r/keymaps/default/keymap.c new file mode 100644 index 000000000..ff00dc657 --- /dev/null +++ b/keyboards/prime_r/keymaps/default/keymap.c @@ -0,0 +1,76 @@ +/* Copyright 2018 Andrew Heaston @rooski15 + * + * Developed by /u/holtenc at www.primekb.com + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +// Prime_R Rev 1.0 + +#include "prime_r.h" +#include "action_layer.h" +#include "backlight.h" + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* (Base Layer) Default Layer + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0|PUP|BSP|PSC|PUP|PDN| + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P|PDN|DEL| 7| 8| 9| + * |---------------------------------------------------------------| + * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1| 2| 3| + * |---------------------------------------------------------------| + * |Ctrl|Gui |App|Alt| Space| Space |Alt|App|GUI|Ctrl | 0| .|Ret| + * `---------------------------------------------------------------' + */ + // 0: Base Layer + KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGUP, KC_BSPC, KC_PSCR, KC_PGUP, KC_PGDN, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PGDN, KC_DEL, KC_7, KC_8, KC_9, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_DQUO, KC_ENT, KC_4, KC_5, KC_6, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LABK, KC_RABK, KC_QUES, KC_LSFT, KC_1, KC_2, KC_3, \ + KC_LCTL, KC_LGUI, KC_APP, KC_LALT, MO(0), KC_SPC, KC_RALT, KC_APP, KC_RGUI, KC_RCTL, KC_0, KC_DOT, KC_ENT), \ + + // 1: Function Layer + KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/prime_r/keymaps/default/readme.md b/keyboards/prime_r/keymaps/default/readme.md new file mode 100644 index 000000000..be92dce9b --- /dev/null +++ b/keyboards/prime_r/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default Prime_R layout, with nothing committed to function layer. + +# Extracted from json at https://www.primekb.com/pages/programming \ No newline at end of file diff --git a/keyboards/prime_r/keymaps/rooski/config.h b/keyboards/prime_r/keymaps/rooski/config.h new file mode 100644 index 000000000..e7ffd3aa2 --- /dev/null +++ b/keyboards/prime_r/keymaps/rooski/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Andrew Heaston + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/prime_r/keymaps/rooski/keymap.c b/keyboards/prime_r/keymaps/rooski/keymap.c new file mode 100644 index 000000000..c536d01fe --- /dev/null +++ b/keyboards/prime_r/keymaps/rooski/keymap.c @@ -0,0 +1,179 @@ +/* Copyright 2018 Andrew Heaston @rooski15 + * + * Developed by /u/holtenc at www.primekb.com + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */// Prime_R Rev 1.0 + +#include "prime_r.h" +#include "action_layer.h" +#include "backlight.h" + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +//Arrow Cluster Toggle +static bool arrow_toggle = false; + +//Arrow Keys +enum custom_keycodes{ + AR_TOG = SAFE_RANGE, //Toggle Arrow Keys + AR_LT, //Num0 or Left Arrow + AR_RT, //NumEnt or Right Arrow + AR_DN, //NumDot or Down Arrow + AR_UP, //Num2 or Up Arrow +}; + +// Tap/Hold Space Layer +#define SPC_LT LT(1, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* (Base Layer) Default Layer + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -|BSP|DEL|HOM|END| + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| ]| 7| 8| 9| + * |---------------------------------------------------------------| + * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|ARU| 3| AR - U/D/L/R & Toggle + * |---------------------------------------------------------------| + * |Ctrl|Gui |Alt|TO1| 1/SP | 1/SP |ART|App|Alt|Ctrl |ARL|ARD|ARR| Arrow keys operate on AR Toggle to be numpad keys + * `---------------------------------------------------------------' + */ + // 0: Base Layer + KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, KC_DEL, KC_HOME, KC_END, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_P1, AR_UP, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, TO(1), SPC_LT, SPC_LT, AR_TOG, KC_APP, KC_RALT, KC_RCTL, AR_LT, AR_DN, AR_RT), \ + + /* (Base Layer) Default Layer + * ,---------------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| =|BSP|HOM|END|DEL| + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| \| 7| 8| 9| + * |---------------------------------------------------------------| + * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|ARU| 3| + * |---------------------------------------------------------------| + * |Ctrl|Gui |Alt|TO0| 1/SP | 1/SP |ART|App|Alt|Ctrl |ARL|ARD|ARR| + * `---------------------------------------------------------------' + */ + // 1: Function Layer + + KEYMAP( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, _______, KC_PAST, KC_PMNS, KC_PPLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______), + + // 2: Extra + KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + +}; + +void matrix_init_user(void) { + if (get_backlight_level() != 0){ + backlight_toggle(); + } +}; + +void matrix_scan_user(void) { +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if(record->event.pressed){ + switch(keycode) { + case AR_TOG: + arrow_toggle = !arrow_toggle; + backlight_toggle(); + return false; break; + + case AR_UP: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_UP)); + } else { + SEND_STRING(SS_DOWN(X_KP_2)); + } + return false; break; + + case AR_DN: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_DOWN)); + } else { + SEND_STRING(SS_DOWN(X_KP_DOT)); + } + return false; break; + + case AR_LT: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_LEFT)); + } else { + SEND_STRING(SS_DOWN(X_KP_0)); + } + return false; break; + + case AR_RT: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_RIGHT)); + } else { + SEND_STRING(SS_DOWN(X_KP_ENTER)); + } + return false; break; + } + } + if(!record->event.pressed){ + switch(keycode) { + case AR_UP: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_UP)); + } else { + SEND_STRING(SS_UP(X_KP_2)); + } + return false; break; + case AR_DN: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_DOWN)); + } else { + SEND_STRING(SS_UP(X_KP_DOT)); + } + return false; break; + case AR_LT: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_LEFT)); + } else { + SEND_STRING(SS_UP(X_KP_0)); + } + return false; break; + case AR_RT: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_RIGHT)); + } else { + SEND_STRING(SS_UP(X_KP_ENTER)); + } + return false; break; + } + } + return true; +}; \ No newline at end of file diff --git a/keyboards/prime_r/keymaps/rooski/readme.md b/keyboards/prime_r/keymaps/rooski/readme.md new file mode 100644 index 000000000..08064320e --- /dev/null +++ b/keyboards/prime_r/keymaps/rooski/readme.md @@ -0,0 +1,3 @@ +# /u/rooski15 layout + +# Changes include numpad codes, layer additions, and a toggle-able arrow cluster that is non layer dependant. \ No newline at end of file diff --git a/keyboards/prime_r/prime_r.c b/keyboards/prime_r/prime_r.c new file mode 100644 index 000000000..845769dae --- /dev/null +++ b/keyboards/prime_r/prime_r.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Andrew Heaston + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "prime_r.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/prime_r/prime_r.h b/keyboards/prime_r/prime_r.h new file mode 100644 index 000000000..f98b5e87b --- /dev/null +++ b/keyboards/prime_r/prime_r.h @@ -0,0 +1,35 @@ +/* Copyright 2018 Andrew Heaston + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef PRIMER_H +#define PRIMER_H + +#include "quantum.h" + +#define KEYMAP( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ + K400, K402, K403, K404, K405, K407, K409, K410, K411, K412, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, KC_NO, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, KC_NO, K407, KC_NO, K409, K410, K411, K412, K413, K414, K415 } \ +} + +#endif \ No newline at end of file diff --git a/keyboards/prime_r/readme.md b/keyboards/prime_r/readme.md new file mode 100644 index 000000000..f9df97dfa --- /dev/null +++ b/keyboards/prime_r/readme.md @@ -0,0 +1,17 @@ +# Prime_R + +![Prime_R](https://imgur.com/3nwvMu4) + +A compact layout with the footprint of your typical 65% board, featuring a right mini-numpad. Produced by /u/holtenc at www.primekb.com +[Additional resources here](https://www.primekb.com/pages/programming) + +Keyboard Maintainer: [Andrew Heaston](https://github.com/rooski15) +Hardware Supported: prime_r pcb, ATmega32U4 +Hardware Availability: [Prime_KB](https://www.primekb.com/ + +Make example for this keyboard (after setting up your build environment): + + make prime_r:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + diff --git a/keyboards/prime_r/rules.mk b/keyboards/prime_r/rules.mk new file mode 100644 index 000000000..0e7a40727 --- /dev/null +++ b/keyboards/prime_r/rules.mk @@ -0,0 +1,56 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # 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 +SLEEP_LED_ENABLE ?= no # 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 +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= no \ No newline at end of file diff --git a/keyboards/xd60/keymaps/rooski/instructions.txt b/keyboards/xd60/keymaps/rooski/instructions.txt new file mode 100644 index 000000000..1486647dc --- /dev/null +++ b/keyboards/xd60/keymaps/rooski/instructions.txt @@ -0,0 +1,2 @@ +cd c:/QMK +make xd60 / / / / / / / / \ No newline at end of file diff --git a/keyboards/xd60/keymaps/rooski/keymap.c b/keyboards/xd60/keymaps/rooski/keymap.c new file mode 100644 index 000000000..4b7b03e6a --- /dev/null +++ b/keyboards/xd60/keymaps/rooski/keymap.c @@ -0,0 +1,82 @@ +// XD60 Rev 2.0 + +#include "xd60.h" +#include "action_layer.h" +//#include "action_tapping.h" +#include "backlight.h" + +// Define tapping term +#define TAPPING_TERM 150 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +// Layer definitions~ +#define _BL 0 +#define _FL 1 +#define _LK 2 + +// RShift TapHold +#define RSTT MT(MOD_RSFT, KC_SLSH) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * | Caps | A| S| D| F| G| H| J| K| L| ;| '| Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .|Shift| Up |Del | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Ctrl|Fn| LT| DN | RT | + * `-----------------------------------------------------------' + */ + // 0: Base Layer + [_BL] = KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, XXXXXXX, RSTT, KC_UP, KC_DEL, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RIGHT), + + // 1: Function Layer + [_FL] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG(_LK), _______, KC_HOME, _______, KC_END), + + // 2: Lighting Keys + [_LK] = KEYMAP( + TO(_BL), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, \ + RESET , KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, XXXXXXX, XXXXXXX, RGB_VAI, BL_STEP, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TO(_BL), XXXXXXX, RGB_TOG, RGB_VAD, RGB_MOD), + +}; + +// Macros +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); + backlight_step(); + } + else { unregister_code(KC_RSFT); } + break; + } + + return MACRO_NONE; +}; + +// Loop +void matrix_scan_user(void) { + // Empty +}; \ No newline at end of file diff --git a/keyboards/xd75/keymaps/emilyh/config.h b/keyboards/xd75/keymaps/emilyh/config.h new file mode 100644 index 000000000..f52a97bbc --- /dev/null +++ b/keyboards/xd75/keymaps/emilyh/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/xd75/keymaps/emilyh/keymap.c b/keyboards/xd75/keymaps/emilyh/keymap.c new file mode 100644 index 000000000..034bb55ac --- /dev/null +++ b/keyboards/xd75/keymaps/emilyh/keymap.c @@ -0,0 +1,187 @@ +/* Copyright 2017 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "xd75.h" +#include "backlight.h" + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define ___T___ KC_TRNS +#define XXXXXXX KC_NO + +// Layer shorthand +#define _QW 0 +#define _CM 1 +#define _DV 2 +#define _LW 3 +#define _RS 4 +#define _FN 5 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY - MIT ENHANCED / GRID COMPATIBLE + * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| + * | ESC | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN | + * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| + * | BRITE | LCTRL | LALT | LGUI | RAISE | XXXXXX . SPACE | LOWER | RGUI | RALT | RCTRL | FN | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = { /* QWERTY */ + { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, KC_PSLS, KC_PAST, KC_PPLS }, + { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_P7, KC_P8, KC_P9 }, + { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_P4, KC_P5, KC_P6 }, + { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, KC_P1, KC_P2, KC_P3 }, + { KC_LCTL, M(0), KC_LGUI, KC_LALT, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_SLSH, KC_LEFT, KC_DOWN, KC_RIGHT,KC_P0, KC_PDOT, KC_PENT }, + }, + +/* COLEMAK - MIT ENHANCED / GRID COMPATIBLE + * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| + * | ESC | A | R | S | T | D | H | N | E | I | O | ' | XXXXXX . ENTER | PG UP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| + * | LSHIFT | Z | X | C | V | B | K | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN | + * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| + * | BRITE | LCTRL | LALT | LGUI | RAISE | XXXXXX . SPACE | LOWER | RGUI | RALT | RCTRL | FN | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_CM] = { /* COLEMAK */ + { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC }, + { KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL }, + { KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP }, + { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN }, + { M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT }, + }, + +/* DVORAK - MIT ENHANCED / GRID COMPATIBLE + * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | ' | , | . | P | Y | F | G | C | R | L | [ | ] | \ | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| + * | ESC | A | O | E | U | I | D | H | T | N | S | / | XXXXXX . ENTER | PG UP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| + * | LSHIFT | ; | Q | J | K | X | B | M | W | V | Z | XXXXXX . RSHIFT | UP | PG DN | + * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| + * | BRITE | LCTRL | LALT | LGUI | RAISE | XXXXXX . SPACE | LOWER | RGUI | RALT | RCTRL | FN | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_DV] = { /* DVORAK */ + { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC }, + { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL }, + { KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, KC_ENT, KC_ENT, KC_PGUP }, + { KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN }, + { M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT }, + }, + +/* LOWERED + * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | | INS | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | XXXXXX . | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | XXXXXX . | | | + * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | XXXXXX . | | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_LW] = { /* LOWERED */ + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ }, + { _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, _______, KC_INS }, + { RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, ___T___, ___T___, _______ }, + { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, ___T___, ___T___, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, + +/* RAISED + * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | INS | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | XXXXXX . | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | XXXXXX . | | | + * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | XXXXXX . | | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_RS] = { /* RAISED */ + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ }, + { _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_INS }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, ___T___, ___T___, _______ }, + { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, ___T___, ___T___, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, + +/* FUNCTION + * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. + * | NUM LK | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | SCR LK | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | PAUSE | PR SCR | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| + * | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | XXXXXX . | WHEEL+ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| + * | RGB TG | RGB MD | RGB HI | RGB HD | RGB SI | RGB SD | RGB VI | RGB VD | BL TOG | BL INC | BL DEC | XXXXXX . | MOUS U | WHEEL- | + * |--------+--------+--------+--------+--------+-- 2u -----------+--------+--------+--------+--------+-----------------+--------+--------| + * | RESET | | QWERTY | COLEMK | DVORAK | XXXXXX . MS BT1 | | | | | | MOUS L | MOUS D | MOUS R | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = { /* FUNCTION */ + { KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ }, + { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR }, + { KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U }, + { RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, ___T___, ___T___, KC_MS_U, KC_WH_D }, + { RESET , _______, DF(_QW), DF(_CM), DF(_DV), KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, + }, +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/xd75/keymaps/emilyh/readme.md b/keyboards/xd75/keymaps/emilyh/readme.md new file mode 100644 index 000000000..743aae5b3 --- /dev/null +++ b/keyboards/xd75/keymaps/emilyh/readme.md @@ -0,0 +1 @@ +# Modified keymap for xd75 with numpad on right diff --git a/keyboards/xd75/keymaps/emilyh/rules.mk b/keyboards/xd75/keymaps/emilyh/rules.mk new file mode 100644 index 000000000..d4e08cfb2 --- /dev/null +++ b/keyboards/xd75/keymaps/emilyh/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 6b584a23c032712b2219725e0cdd5a5ea576b31c Mon Sep 17 00:00:00 2001 From: TurboMech <32869044+TurboMech@users.noreply.github.com> Date: Fri, 5 Jan 2018 11:37:22 -0500 Subject: [PATCH 041/556] Updated ACR60, Mechmini, ALU84 readme information and config.h descripters (#2231) * Updated ACR60, Mechmini, ALU84 readme information and config.h descripters Update MECHKEYS keyboards to be uniform in readmes and config.h's PID, MANUFACTORER, and DESCRIPTIONS. This allows the keyboards to be more uniform amongst the different types. * Rename keyboards/alu84/keymaps/TurboMech/config.h to keyboards/alu84/keymaps/turbomech * Rename keyboards/alu84/keymaps/turbomech to keyboards/alu84/keymaps/TurboMech/config.h * Fixed folder naming for alu84/keymaps/turbomech * fixed error from compile removed double `return MACRO_NONE;` and `switch (id) {` --- keyboards/acr60/config.h | 6 +++--- keyboards/acr60/readme.md | 11 +++++++---- keyboards/alu84/config.h | 8 ++++---- .../alu84/keymaps/{TurboMech => turbomech}/config.h | 0 .../alu84/keymaps/{TurboMech => turbomech}/keymap.c | 6 ------ .../alu84/keymaps/{TurboMech => turbomech}/readme.md | 0 .../alu84/keymaps/{TurboMech => turbomech}/rules.mk | 0 keyboards/alu84/readme.md | 8 ++++++-- keyboards/mechmini/readme.md | 6 +++++- keyboards/mechmini/v2/README.md | 4 +++- 10 files changed, 28 insertions(+), 21 deletions(-) rename keyboards/alu84/keymaps/{TurboMech => turbomech}/config.h (100%) rename keyboards/alu84/keymaps/{TurboMech => turbomech}/keymap.c (99%) rename keyboards/alu84/keymaps/{TurboMech => turbomech}/readme.md (100%) rename keyboards/alu84/keymaps/{TurboMech => turbomech}/rules.mk (100%) diff --git a/keyboards/acr60/config.h b/keyboards/acr60/config.h index 3d34dc975..c44ba737e 100644 --- a/keyboards/acr60/config.h +++ b/keyboards/acr60/config.h @@ -5,11 +5,11 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x2260 +#define PRODUCT_ID 0xCA60 #define DEVICE_VER 0x0001 -#define MANUFACTURER MechKeysCa +#define MANUFACTURER MECHKEYS #define PRODUCT ACR60 -#define DESCRIPTION ACR60 Keyboard +#define DESCRIPTION 60% customizable keyboard /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/acr60/readme.md b/keyboards/acr60/readme.md index 86e063ed5..a0ba2ecde 100644 --- a/keyboards/acr60/readme.md +++ b/keyboards/acr60/readme.md @@ -1,12 +1,15 @@ -# ACR60 +ACR60 +===== ![acr60](https://cdn.shopify.com/s/files/1/1697/5323/products/20170522001035_1024x1024.jpg?v=1504725199) -A customizable 60% keyboard based on the DZ60. +A customizable 60% keyboard made and sold by mechkeys.ca [More info on MECHKEYS](https://mechkeys.ca) + +Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) -Keyboard Maintainer: QMK Community Hardware Supported: ACR60 -Hardware Availability: [mechkeysca](https://mechkeys.ca/products/acr60) + +Hardware Availability: [MECHKEYS](https://mechkeys.ca/products/acr60) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/alu84/config.h b/keyboards/alu84/config.h index ab71f92ba..9e013dbcc 100755 --- a/keyboards/alu84/config.h +++ b/keyboards/alu84/config.h @@ -21,11 +21,11 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 +#define PRODUCT_ID 0xCA75 #define DEVICE_VER 0x0001 -#define MANUFACTURER mechkeys.ca +#define MANUFACTURER MECHKEYS #define PRODUCT ALU84 -#define DESCRIPTION A 75% keyboard +#define DESCRIPTION 75% keyboard /* key matrix size */ #define MATRIX_ROWS 6 @@ -73,4 +73,4 @@ #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/alu84/keymaps/TurboMech/config.h b/keyboards/alu84/keymaps/turbomech/config.h similarity index 100% rename from keyboards/alu84/keymaps/TurboMech/config.h rename to keyboards/alu84/keymaps/turbomech/config.h diff --git a/keyboards/alu84/keymaps/TurboMech/keymap.c b/keyboards/alu84/keymaps/turbomech/keymap.c similarity index 99% rename from keyboards/alu84/keymaps/TurboMech/keymap.c rename to keyboards/alu84/keymaps/turbomech/keymap.c index 00397e3f0..97b192a7b 100644 --- a/keyboards/alu84/keymaps/TurboMech/keymap.c +++ b/keyboards/alu84/keymaps/turbomech/keymap.c @@ -102,12 +102,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }; - switch (id) { - - } - return MACRO_NONE; -} - void matrix_scan_user(void) { diff --git a/keyboards/alu84/keymaps/TurboMech/readme.md b/keyboards/alu84/keymaps/turbomech/readme.md similarity index 100% rename from keyboards/alu84/keymaps/TurboMech/readme.md rename to keyboards/alu84/keymaps/turbomech/readme.md diff --git a/keyboards/alu84/keymaps/TurboMech/rules.mk b/keyboards/alu84/keymaps/turbomech/rules.mk similarity index 100% rename from keyboards/alu84/keymaps/TurboMech/rules.mk rename to keyboards/alu84/keymaps/turbomech/rules.mk diff --git a/keyboards/alu84/readme.md b/keyboards/alu84/readme.md index 979a49d0f..9d23bff06 100644 --- a/keyboards/alu84/readme.md +++ b/keyboards/alu84/readme.md @@ -1,11 +1,15 @@ ALU84 === -A 75% keyboard kit made and sold by mechkeys.ca [More info on mechkeys.ca](https://mechkeys.ca) +![alu84](https://i.imgur.com/wBfazDc.jpg) + +A 75% keyboard made and sold by MECHKEYS [More info on MECHKEYS](https://mechkeys.ca). Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) + Hardware Supported: ALU84 -Hardware Availability: [mechkeys.ca](https://mechkeys.ca) + +Hardware Availability: [MECHKEYS](https://mechkeys.ca) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/mechmini/readme.md b/keyboards/mechmini/readme.md index 56dd81a24..427cbbd03 100644 --- a/keyboards/mechmini/readme.md +++ b/keyboards/mechmini/readme.md @@ -1,6 +1,8 @@ Mechmini ======== +![mechmini](https://cdn.shopify.com/s/files/1/1697/5323/products/20495451_468333093530388_1648547540_o_grande.jpg?v=1510792821) + A 40% compact ortholinear/staggered keyboard. Version 1 was originally bootmapper (ps2avrGB) and can be ported to QMK following the v1 readme (../mechmini/v1/readme.md). This version is no longer in production. @@ -8,8 +10,10 @@ Version 1 was originally bootmapper (ps2avrGB) and can be ported to QMK followin Version 2 (Mechmini 2.0) was shipped powered by QMK [More info on MECHKEYS](https://mechkeys.ca). Keyboard Maintainer: QMK Community (version 1) & [TurboMech](https://github.com/TurboMech) (version 2 - aka Mechmini 2.0) + Hardware Supported: Mechmini keyboard -Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0 + +Hardware Availability: [MECHKEYS](https://mechkeys.ca/collections/keyboards/products/mechmini-2-0) Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space) - please see v1 readme for v1 make instructions: diff --git a/keyboards/mechmini/v2/README.md b/keyboards/mechmini/v2/README.md index e1efc9904..a43afc674 100644 --- a/keyboards/mechmini/v2/README.md +++ b/keyboards/mechmini/v2/README.md @@ -6,8 +6,10 @@ A 40% compact ortholinear/staggered keyboard. Version 2 (Mechmini 2.0) was shipped powered by QMK [More info on MECHKEYS](https://mechkeys.ca). Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) + Hardware Supported: Mechmini 2.0 keyboard -Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0 + +Hardware Availability: [MECHKEYS Mechmini 2.0](https://mechkeys.ca/collections/keyboards/products/mechmini-2-0) Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space): From c5c35f5f4bd8ed1fe2b678c53c959f3c173d70f3 Mon Sep 17 00:00:00 2001 From: rooski15 <34818505+rooski15@users.noreply.github.com> Date: Fri, 5 Jan 2018 08:37:53 -0800 Subject: [PATCH 042/556] Rooski15: Update Prime_R ReadMe & Keymap (#2228) * Rooski15: Updated prime_r Keymaps * Rooski15: Updated Prime_R:Rooski * Rooski15: Updated Prime_R readme * Rooski15: Updated Prime_R readme * Rooski15: Updated Prime_R readme --- keyboards/prime_r/keymaps/rooski/config.h | 3 ++ keyboards/prime_r/keymaps/rooski/keymap.c | 48 +++++++++++++++------- keyboards/prime_r/keymaps/rooski/readme.md | 2 +- keyboards/prime_r/keymaps/rooski/rules.mk | 2 + keyboards/prime_r/readme.md | 5 ++- 5 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 keyboards/prime_r/keymaps/rooski/rules.mk diff --git a/keyboards/prime_r/keymaps/rooski/config.h b/keyboards/prime_r/keymaps/rooski/config.h index e7ffd3aa2..51728ccd3 100644 --- a/keyboards/prime_r/keymaps/rooski/config.h +++ b/keyboards/prime_r/keymaps/rooski/config.h @@ -21,4 +21,7 @@ // place overrides here +#define DISABLE_SPACE_CADET_ROLLOVER + + #endif diff --git a/keyboards/prime_r/keymaps/rooski/keymap.c b/keyboards/prime_r/keymaps/rooski/keymap.c index c536d01fe..091dcce24 100644 --- a/keyboards/prime_r/keymaps/rooski/keymap.c +++ b/keyboards/prime_r/keymaps/rooski/keymap.c @@ -55,35 +55,55 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // 0: Base Layer KEYMAP( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, KC_DEL, KC_HOME, KC_END, \ - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_P1, AR_UP, KC_P3, \ - KC_LCTL, KC_LGUI, KC_LALT, TO(1), SPC_LT, SPC_LT, AR_TOG, KC_APP, KC_RALT, KC_RCTL, AR_LT, AR_DN, AR_RT), \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, KC_DEL, KC_HOME, KC_END, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_P1, AR_UP, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, TO(1), SPC_LT, SPC_LT, AR_TOG, KC_APP, KC_RALT, KC_RCTL, AR_LT, AR_DN, AR_RT), \ - /* (Base Layer) Default Layer + /* (Function Layer) * ,---------------------------------------------------------------. * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| =|BSP|HOM|END|DEL| * |---------------------------------------------------------------| * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| \| 7| 8| 9| * |---------------------------------------------------------------| - * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |BL | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|VUP| 3| + * |---------------------------------------------------------------| + * |Ctrl|Gui |Alt|TO0| 1/SP | 1/SP |ART|TO2|Alt|Ctrl |MUT|VDN|STP| + * `---------------------------------------------------------------' + */ + // 1: Function Layer + KEYMAP( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, _______, KC_PSLS, KC_PAST, KC_PPLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, _______, _______, _______, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, + _______, _______, _______, TO(0), _______, _______, _______, TO(2), _______, _______, KC_MUTE, KC_VOLD, KC_MSTP), + + /* (Numpad Mods) + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -|BSP| /| *| +| Mirrors base layer, but with numpad mods + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| ]| 7| 8| 9| + * |---------------------------------------------------------------| + * |Tab | A| S| D| F| G| H| J| K| L| ;|Return| 4| 5| 6| * |---------------------------------------------------------------| * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|ARU| 3| * |---------------------------------------------------------------| * |Ctrl|Gui |Alt|TO0| 1/SP | 1/SP |ART|App|Alt|Ctrl |ARL|ARD|ARR| * `---------------------------------------------------------------' */ - // 1: Function Layer - + // 2: Numpad Mods KEYMAP( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, _______, KC_PAST, KC_PMNS, KC_PPLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, _______, _______, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, _______, KC_PSLS, KC_PAST, KC_PPLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, AR_UP, _______, + _______, _______, _______, TO(0), _______, _______, _______, KC_APP, _______, _______, AR_LT, AR_DN, AR_RT ), - // 2: Extra + // 3: Extra KEYMAP( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/prime_r/keymaps/rooski/readme.md b/keyboards/prime_r/keymaps/rooski/readme.md index 08064320e..c61314ee0 100644 --- a/keyboards/prime_r/keymaps/rooski/readme.md +++ b/keyboards/prime_r/keymaps/rooski/readme.md @@ -1,3 +1,3 @@ # /u/rooski15 layout -# Changes include numpad codes, layer additions, and a toggle-able arrow cluster that is non layer dependant. \ No newline at end of file +Changes include numpad codes, layer additions, and a toggle-able arrow cluster that is non layer dependant. \ No newline at end of file diff --git a/keyboards/prime_r/keymaps/rooski/rules.mk b/keyboards/prime_r/keymaps/rooski/rules.mk new file mode 100644 index 000000000..f81654768 --- /dev/null +++ b/keyboards/prime_r/keymaps/rooski/rules.mk @@ -0,0 +1,2 @@ + +COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboards/prime_r/readme.md b/keyboards/prime_r/readme.md index f9df97dfa..7a77b2073 100644 --- a/keyboards/prime_r/readme.md +++ b/keyboards/prime_r/readme.md @@ -1,13 +1,14 @@ # Prime_R -![Prime_R](https://imgur.com/3nwvMu4) +![Prime_R](https://i.imgur.com/ldOVlLG.jpg) A compact layout with the footprint of your typical 65% board, featuring a right mini-numpad. Produced by /u/holtenc at www.primekb.com + [Additional resources here](https://www.primekb.com/pages/programming) Keyboard Maintainer: [Andrew Heaston](https://github.com/rooski15) Hardware Supported: prime_r pcb, ATmega32U4 -Hardware Availability: [Prime_KB](https://www.primekb.com/ +Hardware Availability: [Prime_KB](https://www.primekb.com/) Make example for this keyboard (after setting up your build environment): From c9d23f50f66f3cb0aa5994d9fc6a0a7439def36a Mon Sep 17 00:00:00 2001 From: Hannes Egler Date: Fri, 5 Jan 2018 17:50:28 +0100 Subject: [PATCH 043/556] Added RGB and in-switch LED controls (#2227) * Default layout with RGB and in-switch LED controls This is a variation of the default keymap with added RGB underglow and in-switch LED controls. * Readme for default_rgb keymap * ISO keymap with RGB and in-switch LED controls This is a variation of the default ISO keymap with added RGB Underglow and in-switch LED controls. * readme for iso_rgb keymap --- keyboards/s60_x/keymaps/default_rgb/keymap.c | 50 +++++++++++++++++++ keyboards/s60_x/keymaps/default_rgb/readme.md | 27 ++++++++++ keyboards/s60_x/keymaps/iso_rgb/keymap.c | 50 +++++++++++++++++++ keyboards/s60_x/keymaps/iso_rgb/readme.md | 27 ++++++++++ 4 files changed, 154 insertions(+) create mode 100644 keyboards/s60_x/keymaps/default_rgb/keymap.c create mode 100644 keyboards/s60_x/keymaps/default_rgb/readme.md create mode 100644 keyboards/s60_x/keymaps/iso_rgb/keymap.c create mode 100644 keyboards/s60_x/keymaps/iso_rgb/readme.md diff --git a/keyboards/s60_x/keymaps/default_rgb/keymap.c b/keyboards/s60_x/keymaps/default_rgb/keymap.c new file mode 100644 index 000000000..1c81e8eca --- /dev/null +++ b/keyboards/s60_x/keymaps/default_rgb/keymap.c @@ -0,0 +1,50 @@ +#include "s60_x.h" + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT , \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, KC_NO, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_APP, KC_RCTL), + +/* 1: Fn layer +UG = Underglow = RGB Backlighting +BL = Backlighting = In-Switch LED +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, 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, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; diff --git a/keyboards/s60_x/keymaps/default_rgb/readme.md b/keyboards/s60_x/keymaps/default_rgb/readme.md new file mode 100644 index 000000000..69cede566 --- /dev/null +++ b/keyboards/s60_x/keymaps/default_rgb/readme.md @@ -0,0 +1,27 @@ +### 1 Standard - ANSI +This is a variation of the default keymap with added RGB underglow and in-switch LED controls. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 1.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ \ No newline at end of file diff --git a/keyboards/s60_x/keymaps/iso_rgb/keymap.c b/keyboards/s60_x/keymaps/iso_rgb/keymap.c new file mode 100644 index 000000000..62f6231fd --- /dev/null +++ b/keyboards/s60_x/keymaps/iso_rgb/keymap.c @@ -0,0 +1,50 @@ +#include "s60_x.h" + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NO, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT , \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, KC_NO, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_APP, KC_RCTL), + +/* 1: Fn layer +UG = Underglow = RGB Backlighting +BL = Backlighting = In-Switch LED +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, 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, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; diff --git a/keyboards/s60_x/keymaps/iso_rgb/readme.md b/keyboards/s60_x/keymaps/iso_rgb/readme.md new file mode 100644 index 000000000..d02498e6a --- /dev/null +++ b/keyboards/s60_x/keymaps/iso_rgb/readme.md @@ -0,0 +1,27 @@ +### 2 Standard - ISO +This is a variation of the default ISO keymap with added RGB Underglow and in-switch LED controls. + +#### 2.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 2.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ From 0ea6cf719ea585efd51b6786de16e8679cae705b Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 5 Jan 2018 15:32:52 -0500 Subject: [PATCH 044/556] Update info.json --- keyboards/chimera_ortho/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/chimera_ortho/info.json b/keyboards/chimera_ortho/info.json index 18fcb3fbc..846ad8e2f 100644 --- a/keyboards/chimera_ortho/info.json +++ b/keyboards/chimera_ortho/info.json @@ -8,7 +8,7 @@ "bootloader": "", "width": 15.5, "height": 4.25, - "layout": { + "layouts": { "KEYMAP": { "layout": [ { From e3541853a9d7f6435c08e4150ac3bda3d6c68e98 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 5 Jan 2018 15:33:15 -0500 Subject: [PATCH 045/556] Update info.json --- keyboards/eagle_viper/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/eagle_viper/info.json b/keyboards/eagle_viper/info.json index a2ca3c59d..2993ffdac 100644 --- a/keyboards/eagle_viper/info.json +++ b/keyboards/eagle_viper/info.json @@ -5,9 +5,9 @@ "bootloader": "atmel-dfu", "width": 15, "height": 5, - "layout": { + "layouts": { "KEYMAP": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":13, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}] } } -} \ No newline at end of file +} From e659bc4467f09163e3e4d1cf7261f43b9609f6c6 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 5 Jan 2018 15:44:59 -0500 Subject: [PATCH 046/556] Info json fixes (#2232) * Update info.json * Update info.json * Update info.json * Update info.json --- keyboards/gh60/info.json | 4 ++-- keyboards/kc60/info.json | 4 ++-- keyboards/octagon/info.json | 4 ++-- keyboards/v60_type_r/info.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/gh60/info.json b/keyboards/gh60/info.json index 1ea3c2e0e..56e1e0a2d 100644 --- a/keyboards/gh60/info.json +++ b/keyboards/gh60/info.json @@ -1,7 +1,7 @@ { "keyboard_name": "GH60", "identifier": "FEED:6060:0001", - "layout": { + "layouts": { "LAYOUT_60_ansi": { "layout": [{"x":0, "y":0, "label":"~"}, {"x":1, "y":0, "label":"!"}, {"x":2, "y":0, "label":"@"}, {"x":3, "y":0, "label":"#"}, {"x":4, "y":0, "label":"$"}, {"x":5, "y":0, "label":"%"}, {"x":6, "y":0, "label":"^"}, {"x":7, "y":0, "label":"&"}, {"x":8, "y":0, "label":"*"}, {"x":9, "y":0, "label":"("}, {"x":10, "y":0, "label":")"}, {"x":11, "y":0, "label":"_"}, {"x":12, "y":0, "label":"+"}, {"x":14, "y":0, "label":"Backspace", "w":2}, {"x":0.5, "y":1, "label":"Tab", "w":1.5}, {"x":1.5, "y":1, "label":"Q"}, {"x":2.5, "y":1, "label":"W"}, {"x":3.5, "y":1, "label":"E"}, {"x":4.5, "y":1, "label":"R"}, {"x":5.5, "y":1, "label":"T"}, {"x":6.5, "y":1, "label":"Y"}, {"x":7.5, "y":1, "label":"U"}, {"x":8.5, "y":1, "label":"I"}, {"x":9.5, "y":1, "label":"O"}, {"x":10.5, "y":1, "label":"P"}, {"x":11.5, "y":1, "label":"{"}, {"x":12.5, "y":1, "label":"}"}, {"x":14, "y":1, "label":"|", "w":1.5}, {"x":0.75, "y":2, "label":"Caps Lock", "w":1.75}, {"x":1.75, "y":2, "label":"A"}, {"x":2.75, "y":2, "label":"S"}, {"x":3.75, "y":2, "label":"D"}, {"x":4.75, "y":2, "label":"F"}, {"x":5.75, "y":2, "label":"G"}, {"x":6.75, "y":2, "label":"H"}, {"x":7.75, "y":2, "label":"J"}, {"x":8.75, "y":2, "label":"K"}, {"x":9.75, "y":2, "label":"L"}, {"x":10.75, "y":2, "label":":"}, {"x":11.75, "y":2, "label":"\""}, {"x":14, "y":2, "label":"Enter", "w":2.25}, {"x":1.25, "y":3, "label":"Shift", "w":2.25}, {"x":2.25, "y":3, "label":"Z"}, {"x":3.25, "y":3, "label":"X"}, {"x":4.25, "y":3, "label":"C"}, {"x":5.25, "y":3, "label":"V"}, {"x":6.25, "y":3, "label":"B"}, {"x":7.25, "y":3, "label":"N"}, {"x":8.25, "y":3, "label":"M"}, {"x":9.25, "y":3, "label":"<"}, {"x":10.25, "y":3, "label":">"}, {"x":11.25, "y":3, "label":"?"}, {"x":14, "y":3, "label":"Shift", "w":2.75}, {"x":0.25, "y":4, "label":"Ctrl", "w":1.25}, {"x":1.5, "y":4, "label":"Win", "w":1.25}, {"x":2.75, "y":4, "label":"Alt", "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "label":"Alt", "w":1.25}, {"x":11.5, "y":4, "label":"Win", "w":1.25}, {"x":12.75, "y":4, "label":"Menu", "w":1.25}, {"x":14, "y":4, "label":"Ctrl", "w":1.25}] } @@ -14,4 +14,4 @@ "height": 5, "url": "http://qmk.fm/keyboards/gh60", "manufacturer": "geekhack" -} \ No newline at end of file +} diff --git a/keyboards/kc60/info.json b/keyboards/kc60/info.json index bccc97f82..81d18ffdf 100644 --- a/keyboards/kc60/info.json +++ b/keyboards/kc60/info.json @@ -5,9 +5,9 @@ "bootloader": "atmel-dfu", "width": 15, "height": 5, - "layout": { + "layouts": { "KEYMAP": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":14, "y":0, "w":2}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":14, "y":3, "w":2.75}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}] } } -} \ No newline at end of file +} diff --git a/keyboards/octagon/info.json b/keyboards/octagon/info.json index 1c0e018a2..7d3f4963b 100644 --- a/keyboards/octagon/info.json +++ b/keyboards/octagon/info.json @@ -5,9 +5,9 @@ "bootloader": "atmel-dfu", "width": 16, "height": 6, - "layout": { + "layouts": { "KEYMAP": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":14, "y":1, "w":2}, {"x":15, "y":1}, {"x":0.5, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":14, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":0.75, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":14, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":1.25, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":13, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":0.25, "y":5, "w":1.25}, {"x":1.5, "y":5, "w":1.25}, {"x":2.75, "y":5, "w":1.25}, {"x":9, "y":5, "w":6.25}, {"x":10, "y":5}, {"x":11, "y":5}, {"x":12, "y":5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}] } } -} \ No newline at end of file +} diff --git a/keyboards/v60_type_r/info.json b/keyboards/v60_type_r/info.json index 6bf683e5d..e73cb02ff 100644 --- a/keyboards/v60_type_r/info.json +++ b/keyboards/v60_type_r/info.json @@ -5,9 +5,9 @@ "bootloader": "atmel-dfu", "width": 15, "height": 5, - "layout": { + "layouts": { "KEYMAP": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":14, "y":0, "w":2}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":14, "y":3, "w":2.75}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}] } } -} \ No newline at end of file +} From 81ae0fb10efb10414a7578f374e5fbbff58984d4 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 5 Jan 2018 16:28:46 -0500 Subject: [PATCH 047/556] Update info.json --- keyboards/gh60/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/gh60/info.json b/keyboards/gh60/info.json index 56e1e0a2d..aed31f751 100644 --- a/keyboards/gh60/info.json +++ b/keyboards/gh60/info.json @@ -3,7 +3,7 @@ "identifier": "FEED:6060:0001", "layouts": { "LAYOUT_60_ansi": { - "layout": [{"x":0, "y":0, "label":"~"}, {"x":1, "y":0, "label":"!"}, {"x":2, "y":0, "label":"@"}, {"x":3, "y":0, "label":"#"}, {"x":4, "y":0, "label":"$"}, {"x":5, "y":0, "label":"%"}, {"x":6, "y":0, "label":"^"}, {"x":7, "y":0, "label":"&"}, {"x":8, "y":0, "label":"*"}, {"x":9, "y":0, "label":"("}, {"x":10, "y":0, "label":")"}, {"x":11, "y":0, "label":"_"}, {"x":12, "y":0, "label":"+"}, {"x":14, "y":0, "label":"Backspace", "w":2}, {"x":0.5, "y":1, "label":"Tab", "w":1.5}, {"x":1.5, "y":1, "label":"Q"}, {"x":2.5, "y":1, "label":"W"}, {"x":3.5, "y":1, "label":"E"}, {"x":4.5, "y":1, "label":"R"}, {"x":5.5, "y":1, "label":"T"}, {"x":6.5, "y":1, "label":"Y"}, {"x":7.5, "y":1, "label":"U"}, {"x":8.5, "y":1, "label":"I"}, {"x":9.5, "y":1, "label":"O"}, {"x":10.5, "y":1, "label":"P"}, {"x":11.5, "y":1, "label":"{"}, {"x":12.5, "y":1, "label":"}"}, {"x":14, "y":1, "label":"|", "w":1.5}, {"x":0.75, "y":2, "label":"Caps Lock", "w":1.75}, {"x":1.75, "y":2, "label":"A"}, {"x":2.75, "y":2, "label":"S"}, {"x":3.75, "y":2, "label":"D"}, {"x":4.75, "y":2, "label":"F"}, {"x":5.75, "y":2, "label":"G"}, {"x":6.75, "y":2, "label":"H"}, {"x":7.75, "y":2, "label":"J"}, {"x":8.75, "y":2, "label":"K"}, {"x":9.75, "y":2, "label":"L"}, {"x":10.75, "y":2, "label":":"}, {"x":11.75, "y":2, "label":"\""}, {"x":14, "y":2, "label":"Enter", "w":2.25}, {"x":1.25, "y":3, "label":"Shift", "w":2.25}, {"x":2.25, "y":3, "label":"Z"}, {"x":3.25, "y":3, "label":"X"}, {"x":4.25, "y":3, "label":"C"}, {"x":5.25, "y":3, "label":"V"}, {"x":6.25, "y":3, "label":"B"}, {"x":7.25, "y":3, "label":"N"}, {"x":8.25, "y":3, "label":"M"}, {"x":9.25, "y":3, "label":"<"}, {"x":10.25, "y":3, "label":">"}, {"x":11.25, "y":3, "label":"?"}, {"x":14, "y":3, "label":"Shift", "w":2.75}, {"x":0.25, "y":4, "label":"Ctrl", "w":1.25}, {"x":1.5, "y":4, "label":"Win", "w":1.25}, {"x":2.75, "y":4, "label":"Alt", "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "label":"Alt", "w":1.25}, {"x":11.5, "y":4, "label":"Win", "w":1.25}, {"x":12.75, "y":4, "label":"Menu", "w":1.25}, {"x":14, "y":4, "label":"Ctrl", "w":1.25}] + "layout": [{"x":0, "y":0, "label":"~"}, {"x":1, "y":0, "label":"!"}, {"x":2, "y":0, "label":"@"}, {"x":3, "y":0, "label":"#"}, {"x":4, "y":0, "label":"$"}, {"x":5, "y":0, "label":"%"}, {"x":6, "y":0, "label":"^"}, {"x":7, "y":0, "label":"&"}, {"x":8, "y":0, "label":"*"}, {"x":9, "y":0, "label":"("}, {"x":10, "y":0, "label":")"}, {"x":11, "y":0, "label":"_"}, {"x":12, "y":0, "label":"+"}, {"x":13, "y":0, "label":"Backspace", "w":2}, {"x":0, "y":1, "label":"Tab", "w":1.5}, {"x":1.5, "y":1, "label":"Q"}, {"x":2.5, "y":1, "label":"W"}, {"x":3.5, "y":1, "label":"E"}, {"x":4.5, "y":1, "label":"R"}, {"x":5.5, "y":1, "label":"T"}, {"x":6.5, "y":1, "label":"Y"}, {"x":7.5, "y":1, "label":"U"}, {"x":8.5, "y":1, "label":"I"}, {"x":9.5, "y":1, "label":"O"}, {"x":10.5, "y":1, "label":"P"}, {"x":11.5, "y":1, "label":"{"}, {"x":12.5, "y":1, "label":"}"}, {"x":13.5, "y":1, "label":"|", "w":1.5}, {"x":0, "y":2, "label":"Caps Lock", "w":1.75}, {"x":1.75, "y":2, "label":"A"}, {"x":2.75, "y":2, "label":"S"}, {"x":3.75, "y":2, "label":"D"}, {"x":4.75, "y":2, "label":"F"}, {"x":5.75, "y":2, "label":"G"}, {"x":6.75, "y":2, "label":"H"}, {"x":7.75, "y":2, "label":"J"}, {"x":8.75, "y":2, "label":"K"}, {"x":9.75, "y":2, "label":"L"}, {"x":10.75, "y":2, "label":":"}, {"x":11.75, "y":2, "label":"\""}, {"x":12.75, "y":2, "label":"Enter", "w":2.25}, {"x":0, "y":3, "label":"Shift", "w":2.25}, {"x":2.25, "y":3, "label":"Z"}, {"x":3.25, "y":3, "label":"X"}, {"x":4.25, "y":3, "label":"C"}, {"x":5.25, "y":3, "label":"V"}, {"x":6.25, "y":3, "label":"B"}, {"x":7.25, "y":3, "label":"N"}, {"x":8.25, "y":3, "label":"M"}, {"x":9.25, "y":3, "label":"<"}, {"x":10.25, "y":3, "label":">"}, {"x":11.25, "y":3, "label":"?"}, {"x":12.25, "y":3, "label":"Shift", "w":2.75}, {"x":0, "y":4, "label":"Ctrl", "w":1.25}, {"x":1.25, "y":4, "label":"Win", "w":1.25}, {"x":2.5, "y":4, "label":"Alt", "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "label":"Alt", "w":1.25}, {"x":11.25, "y":4, "label":"Win", "w":1.25}, {"x":12.5, "y":4, "label":"Menu", "w":1.25}, {"x":13.75, "y":4, "label":"Ctrl", "w":1.25}] } }, "maintainer": "qmk", From 8e0d9e26379db34fc4af2d2228269cb980ea78c8 Mon Sep 17 00:00:00 2001 From: farmakon Date: Sun, 7 Jan 2018 17:23:45 +0100 Subject: [PATCH 048/556] Adding XMMX (#2236) * gh80_3000 * Add files via upload --- keyboards/xmmx/config.h | 58 ++++++ keyboards/xmmx/keymaps/default/keymap.c | 30 +++ keyboards/xmmx/keymaps/toad/keymap.c | 30 +++ keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c | 30 +++ keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c | 30 +++ keyboards/xmmx/keymaps/toad_iso_wk/keymap.c | 30 +++ keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c | 30 +++ keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c | 30 +++ keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c | 30 +++ keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c | 30 +++ keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c | 30 +++ keyboards/xmmx/readme.md | 20 ++ keyboards/xmmx/rules.mk | 56 ++++++ keyboards/xmmx/xmmx.c | 1 + keyboards/xmmx/xmmx.h | 177 ++++++++++++++++++ 15 files changed, 612 insertions(+) create mode 100644 keyboards/xmmx/config.h create mode 100644 keyboards/xmmx/keymaps/default/keymap.c create mode 100644 keyboards/xmmx/keymaps/toad/keymap.c create mode 100644 keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c create mode 100644 keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c create mode 100644 keyboards/xmmx/keymaps/toad_iso_wk/keymap.c create mode 100644 keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c create mode 100644 keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c create mode 100644 keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c create mode 100644 keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c create mode 100644 keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c create mode 100644 keyboards/xmmx/readme.md create mode 100644 keyboards/xmmx/rules.mk create mode 100644 keyboards/xmmx/xmmx.c create mode 100644 keyboards/xmmx/xmmx.h diff --git a/keyboards/xmmx/config.h b/keyboards/xmmx/config.h new file mode 100644 index 000000000..f3f893e28 --- /dev/null +++ b/keyboards/xmmx/config.h @@ -0,0 +1,58 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6776 +#define DEVICE_VER 0x0001 +#define MANUFACTURER farmakon +#define PRODUCT "XMMX" +#define DESCRIPTION "XMMX" + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, F6, F5, F4, F1, F0 } +#define MATRIX_COL_PINS { B3, B2, B1, E6, B7, C7, C6, D4, D6, D7, B4, D0, D1, F7, D2, D3, D5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 0 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif \ No newline at end of file diff --git a/keyboards/xmmx/keymaps/default/keymap.c b/keyboards/xmmx/keymaps/default/keymap.c new file mode 100644 index 000000000..6b0a11432 --- /dev/null +++ b/keyboards/xmmx/keymaps/default/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, KC_NO, KC_NO, KC_NO, \ + KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_NO, KC_UP, KC_NO, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/toad/keymap.c b/keyboards/xmmx/keymaps/toad/keymap.c new file mode 100644 index 000000000..c13dc8f67 --- /dev/null +++ b/keyboards/xmmx/keymaps/toad/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + TOAD_KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c b/keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c new file mode 100644 index 000000000..5e61dfffb --- /dev/null +++ b/keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + TOAD_KEYMAP_ANSI_WK( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c b/keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c new file mode 100644 index 000000000..7778b0652 --- /dev/null +++ b/keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + TOAD_KEYMAP_ANSI_WKL( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/toad_iso_wk/keymap.c b/keyboards/xmmx/keymaps/toad_iso_wk/keymap.c new file mode 100644 index 000000000..c51ff862a --- /dev/null +++ b/keyboards/xmmx/keymaps/toad_iso_wk/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + TOAD_KEYMAP_ISO_WK( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c b/keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c new file mode 100644 index 000000000..efcebc713 --- /dev/null +++ b/keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + TOAD_KEYMAP_ISO_WKL( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c b/keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c new file mode 100644 index 000000000..20d55c1fd --- /dev/null +++ b/keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP_ANSI_WK( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c b/keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c new file mode 100644 index 000000000..3c8ba436f --- /dev/null +++ b/keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP_ANSI_WKL( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c b/keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c new file mode 100644 index 000000000..ee68253c7 --- /dev/null +++ b/keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP_ISO_WK( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c b/keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c new file mode 100644 index 000000000..c27914e45 --- /dev/null +++ b/keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c @@ -0,0 +1,30 @@ +#include "xmmx.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP_ISO_WKL( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/readme.md b/keyboards/xmmx/readme.md new file mode 100644 index 000000000..cf16231e1 --- /dev/null +++ b/keyboards/xmmx/readme.md @@ -0,0 +1,20 @@ +XMMX and Toad +======== + +XMMX: Tenkeyless Mechanical Keyboard PCB designed to fit Filco Majestouch TKL and Cooler Master Quickfire Rapid cases +Toad: 70% Mechanical Keyboard PCB. + +XMMX schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/XMMX-0447d28c1e4644b88fd04905d983684d) +Toad schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/70_Keyboard-d4f6baf4792d4ada9c0571fa3713e461) + +For more informations on the XMMX please visit this [geekhack.org thread](https://geekhack.org/index.php?topic=93422.0) +For more informations on the Toad please visit this [geekhack.org thread](https://geekhack.org/index.php?topic=91388.0) + +Make examples for these keyboards (after setting up your build environment): + + make xmmx:default + + make xmmx:toad + + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/xmmx/rules.mk b/keyboards/xmmx/rules.mk new file mode 100644 index 000000000..ee87c6e8d --- /dev/null +++ b/keyboards/xmmx/rules.mk @@ -0,0 +1,56 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # 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 +SLEEP_LED_ENABLE ?= no # 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 +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= no \ No newline at end of file diff --git a/keyboards/xmmx/xmmx.c b/keyboards/xmmx/xmmx.c new file mode 100644 index 000000000..399ae4eb4 --- /dev/null +++ b/keyboards/xmmx/xmmx.c @@ -0,0 +1 @@ +#include "xmmx.h" diff --git a/keyboards/xmmx/xmmx.h b/keyboards/xmmx/xmmx.h new file mode 100644 index 000000000..ad6ae3014 --- /dev/null +++ b/keyboards/xmmx/xmmx.h @@ -0,0 +1,177 @@ +#ifndef XMMX +#define XMMX + +#include "quantum.h" + +// 80% keyboard: default - all keys +#define KEYMAP( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K013, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K415, K416, \ + K500, K501, K502, K507, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K415, K416 }, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513, K514, K515, K516 } \ +} + +// 80% keyboard: ANSI Winkey +#define KEYMAP_ANSI_WK( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K415, \ + K500, K501, K502, K507, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO,K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313, KC_NO,KC_NO,KC_NO}, \ + { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO,KC_NO,K415, KC_NO}, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513, K514, K515, K516 } \ +} + +// 80% keyboard: ANSI Winkeyless +#define KEYMAP_ANSI_WKL( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K415, \ + K500, K502, K507, K511, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO,K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313, KC_NO,KC_NO,KC_NO}, \ + { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO,KC_NO,K415, KC_NO}, \ + { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513, K514, K515, K516 } \ +} + +// 80% keyboard: ISO Winkey +#define KEYMAP_ISO_WK( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K415, \ + K500, K501, K502, K507, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO,K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO,K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO,KC_NO,KC_NO}, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO,KC_NO,K415, KC_NO}, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513, K514, K515, K516 } \ +} + +// 80% keyboard: ISO Winkeyless +#define KEYMAP_ISO_WKL( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K415, \ + K500, K502, K507, K511, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO,K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO,K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO,KC_NO,KC_NO}, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO,KC_NO,K415, KC_NO}, \ + { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513, K514, K515, K516 } \ +} + + +// 70% keyboard: default - all keys +#define TOAD_KEYMAP( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, \ + K500, K501, K502, K507, K510, K511, K512, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413 }, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ +} + +// 70% keyboard: ANSI Winkey +#define TOAD_KEYMAP_ANSI_WK( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K501, K502, K507, K510, K511, K512, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313 }, \ + { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ +} + +// 70% keyboard: ANSI Winkeyless +#define TOAD_KEYMAP_ANSI_WKL( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K502, K507, K511, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313 }, \ + { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513 } \ +} + +// 70% keyboard: ISO Winkey +#define TOAD_KEYMAP_ISO_WK( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K501, K502, K507, K510, K511, K512, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO}, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ +} + +// 70% keyboard: ISO Winkeyless +#define TOAD_KEYMAP_ISO_WKL( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K502, K507, K511, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO}, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513 } \ +} + +#endif From fe8942e55c9e3131f08927cb31761e56b576be71 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Fri, 12 Jan 2018 12:12:19 -0500 Subject: [PATCH 049/556] Add -e to enable interpretation of escape characters --- tmk_core/avr.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index c083f6b72..30d4fe26e 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -173,10 +173,10 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ else \ ls /dev/tty* > /tmp/1; \ - echo "Detecting USB port, reset your controller now.\c"; \ + echo -e "Detecting USB port, reset your controller now.\c"; \ while [ -z $$USB ]; do \ sleep 1; \ - echo ".\c"; \ + echo -e ".\c"; \ ls /dev/tty* > /tmp/2; \ USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ done; \ From dcb2627237c798570dfcd2baef2b2e25498debb4 Mon Sep 17 00:00:00 2001 From: Oryhara Date: Fri, 12 Jan 2018 11:35:33 -0600 Subject: [PATCH 050/556] Halfkeyboard functionality for dvorak and qwerty (#2261) * started work on halfkeyboard * update to keymap * halfkey layouts complete for dvorak and qwerty --- .../keymaps/halfkeyboard/keymap.c | 356 ++++++++++++++++++ 1 file changed, 356 insertions(+) create mode 100644 keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c new file mode 100644 index 000000000..0bf0a86a6 --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c @@ -0,0 +1,356 @@ +#include QMK_KEYBOARD_H +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +#define QWERTY 0 // qwerty layer +#define HALFQWERTY 1 // mirrored qwerty layer +#define DVORAK 2 // dvorak layer +#define HALFDVORAK 3 // mirrored dvorak layer +#define SYMB 5 // symbols +#define MDIA 6 // media keys + +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: qwerty + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |ENTER | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Alt | LGui | | RGui |Alt | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * |mirror|ace | End | | PgDn | |mirror| + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[QWERTY] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, BL_ON, + KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, + KC_LALT, TG(DVORAK), + KC_HOME, + LT(HALFQWERTY, KC_SPACE),KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, + KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, + TG(DVORAK), KC_RALT, + KC_PGUP, + KC_PGDN,KC_TAB, LT(HALFQWERTY, KC_ENT) + ), +/* Keymap 1: mirrored qwerty + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | BSPC | 0 | 9 | 8 | 7 | 6 | LEFT | | RIGHT| 5 | 4 | 3 | 2 | 1 | ESC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | \ | P | O | I | U | Y | L1 | | L1 | T | R | E | W | Q | TAB | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ENTER | ; | L | K | J | H |------| |------| G | F | D | S | A | BSPC | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | / | . | , | M | N | | | | B | V | C | X | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Alt | LGui | | RGui |Alt | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * |mirror|ace | End | | PgDn | |mirror| + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[HALFQWERTY] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_BSPC, KC_0, KC_9, KC_8, KC_7, KC_6, KC_LEFT, + KC_TAB, KC_P, KC_O, KC_I, KC_U, KC_Y, TG(SYMB), + KC_BSPC, KC_SCLN, KC_L, KC_K, KC_J, KC_H, + KC_LSFT, KC_SLASH, KC_DOT, KC_COMM,KC_M, KC_N, KC_TRANSPARENT, + KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, + KC_LALT, KC_TRANSPARENT, + KC_HOME, + KC_TRANSPARENT,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_5, KC_4, KC_3, KC_2, KC_1, KC_BSPC, + TG(SYMB), KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSLS, + KC_G, KC_F, KC_D, KC_S, KC_A, KC_ENT, + MEH_T(KC_NO),KC_B, KC_V, KC_C, KC_X, KC_Z, KC_RSFT, + KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, + KC_TRANSPARENT, KC_RALT, + KC_PGUP, + KC_PGDN,KC_TAB, KC_TRANSPARENT + ), +/* Keymap 3: dvorak + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |------| D | H | T | S | - |ENTER | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Alt | LGui | | RGui |Alt | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * |mirror|ace | End | | PgDn | |mirror| + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[DVORAK] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, TG(SYMB), + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), + KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, + KC_LALT, KC_TRANSPARENT, + KC_HOME, + LT(HALFDVORAK, KC_SPACE),KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + TG(SYMB), KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, + KC_D, KC_H, KC_T, KC_S, KC_MINUS, KC_ENT, + MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, + KC_TRANSPARENT, KC_RALT, + KC_PGUP, + KC_PGDN,KC_TAB, LT(HALFDVORAK, KC_ENT) + ), +/* Keymap 3: mirrored dvorak + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | BSPC | 0 | 9 | 8 | 7 | 6 | LEFT | | RIGHT| 5 | 4 | 3 | 2 | 1 | ESC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | L | R | C | G | F | L1 | | L1 | Y | P | . | , | ' | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | - | S | T | H | D |------| |------| I | U | E | O | A |ENTER | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | V | W | M | B | | | | X | K | J | Q | ; | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Alt | LGui | | RGui |Alt | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * |mirror|ace | End | | PgDn | |mirror| + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[HALFDVORAK] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_SLASH, KC_L, KC_R, KC_C, KC_G, KC_F, TG(SYMB), + KC_ENT, KC_S, KC_N, KC_T, KC_H, KC_D, + KC_LSFT, KC_Z, KC_V, KC_W, KC_M, KC_B, ALL_T(KC_NO), + KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, + KC_LALT, KC_TRANSPARENT, + KC_HOME, + KC_TRANSPARENT,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC, + TG(SYMB), KC_Y, KC_P, KC_DOT, KC_COMM,KC_P, KC_TAB, + KC_I, KC_U, KC_E, KC_O, KC_A, KC_ENT, + MEH_T(KC_NO),KC_X, KC_K, KC_J, KC_Q, KC_SCLN, KC_RSFT, + KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, + KC_TRANSPARENT, KC_RALT, + KC_PGUP, + KC_PGDN,KC_TAB, KC_TRANSPARENT + ), +/* Keymap 5: 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 | = | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Animat| | |Toggle|Solid | + * ,------|------|------| |------+------+------. + * |Bright|Bright| | | |Hue- |Hue+ | + * |ness- |ness+ |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + 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, + RGB_MOD,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, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI +), +/* Keymap 6: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = LAYOUT_ergodox( + 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; + case 1: + if (record->event.pressed) { // For resetting EEPROM + eeconfig_init(); + } + break; + } + 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) { + +}; + + +// 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; + } + +}; From cfcf0fd36b1e9179e8d136731254c38fed9828b6 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 12 Jan 2018 23:49:15 +1100 Subject: [PATCH 051/556] Remove reference to BL_x in keycodes.md, and add BL_BRTG --- docs/feature_backlight.md | 10 +++++----- docs/keycodes.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 97421c043..470b9f21f 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -10,11 +10,11 @@ These keycodes control the backlight. Most keyboards use this for single color i |---------|------------------------------------------| |`BL_TOGG`|Turn the backlight on or off | |`BL_STEP`|Cycle through backlight levels | -|`BL_ON` |Set backlight to max brightness | -|`BL_OFF` |Turn backlight off | -|`BL_INC` |Increase backlight level | -|`BL_DEC` |Decrease backlight level | -|`BL_BRTG`|Toggle backlight breathing | +|`BL_ON` |Set the backlight to max brightness | +|`BL_OFF` |Turn the backlight off | +|`BL_INC` |Increase the backlight level | +|`BL_DEC` |Decrease the backlight level | +|`BL_BRTG`|Toggle backlight breathing | Note that for backlight breathing, you need to have `#define BACKLIGHT_BREATHING` in your config.h. diff --git a/docs/keycodes.md b/docs/keycodes.md index 1dc0e62c2..fa02512de 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -256,11 +256,11 @@ This is a reference only. Each group of keys links to the page documenting their |---------|------------------------------------------| |`BL_TOGG`|Turn the backlight on or off | |`BL_STEP`|Cycle through backlight levels | -|`BL_x` |Set a specific backlight level between 0-9| -|`BL_ON` |An alias for `BL_9` | -|`BL_OFF` |An alias for `BL_0` | -|`BL_INC` |Increase backlight level | -|`BL_DEC` |Decrease backlight level | +|`BL_ON` |Set the backlight to max brightness | +|`BL_OFF` |Turn the backlight off | +|`BL_INC` |Increase the backlight level | +|`BL_DEC` |Decrease the backlight level | +|`BL_BRTG`|Toggle backlight breathing | ## [RGB Lighting](feature_rgblight.md) From 4764e7712109be63df6395d70b069bceb0258e61 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 13 Jan 2018 00:26:39 +1100 Subject: [PATCH 052/556] Clarify that we actually have max 16 total backlight levels --- docs/config_options.md | 2 +- docs/feature_backlight.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index 1dd4cdbaa..055531b67 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -69,7 +69,7 @@ This is a C header file that is one of the first things included, and will persi * `#define BACKLIGHT_PIN B7` * pin of the backlight - B5, B6, B7 use PWM, others use softPWM * `#define BACKLIGHT_LEVELS 3` - * number of levels your backlight will have (not including off) + * number of levels your backlight will have (maximum 15 excluding off) * `#define BACKLIGHT_BREATHING` * enables backlight breathing (only works with backlight pins B5, B6 and B7) * `#define BREATHING_PERIOD 6` diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 470b9f21f..5336e8526 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -21,7 +21,7 @@ Note that for backlight breathing, you need to have `#define BACKLIGHT_BREATHING ## Configuration Options in `config.h` * `BACKLIGHT_PIN B7` defines the pin that controlls the LEDs. Unless you design your own keyboard, you don't need to set this. -* `BACKLIGHT_LEVELS 3` defines the number of brightness levels (excluding OFF). +* `BACKLIGHT_LEVELS 3` defines the number of brightness levels (maximum 15 excluding off). * `BACKLIGHT_BREATHING` if defined, enables backlight breathing. Note that this is only available if `BACKLIGHT_PIN` is B5, B6 or B7. * `BREATHING_PERIOD 6` defines the length of one backlight "breath" in seconds. From a01dc4dd489a8ab2919bf9b7e8389d87ef5ccf64 Mon Sep 17 00:00:00 2001 From: pmalecka Date: Fri, 1 Dec 2017 09:09:52 +0100 Subject: [PATCH 053/556] added the possibility to hav shifted(modded) tap dance --- quantum/process_keycode/process_tap_dance.c | 4 ++++ quantum/process_keycode/process_tap_dance.h | 1 + 2 files changed, 5 insertions(+) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index f1f28e016..f196a9cb6 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -79,6 +79,7 @@ static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_acti return; action->state.finished = true; add_mods(action->state.oneshot_mods); + add_weak_mods(action->state.weak_mods); send_keyboard_report(); _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_dance_finished); } @@ -87,6 +88,7 @@ static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *act { _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_reset); del_mods(action->state.oneshot_mods); + del_weak_mods(action->state.weak_mods); send_keyboard_report(); } @@ -110,6 +112,8 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { action->state.count++; action->state.timer = timer_read(); action->state.oneshot_mods = get_oneshot_mods(); + action->state.weak_mods = get_mods(); + action->state.weak_mods |= get_weak_mods(); process_tap_dance_action_on_each_tap (action); if (last_td && last_td != keycode) { diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 37a27c536..ab20ea04e 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -25,6 +25,7 @@ typedef struct { uint8_t count; uint8_t oneshot_mods; + uint8_t weak_mods; uint16_t keycode; uint16_t timer; bool interrupted; From ee15d2fe5e89462ba8599e14d947f72afef34880 Mon Sep 17 00:00:00 2001 From: Kyle Sargent Date: Fri, 12 Jan 2018 09:56:50 -0800 Subject: [PATCH 054/556] Layout for BananaSplit60 (#2257) * Kamon bananasplit layout * readme --- keyboards/bananasplit/keymaps/kamon/config.h | 25 +++++ keyboards/bananasplit/keymaps/kamon/keymap.c | 96 +++++++++++++++++++ keyboards/bananasplit/keymaps/kamon/readme.md | 34 +++++++ keyboards/bananasplit/keymaps/kamon/rules.mk | 37 +++++++ 4 files changed, 192 insertions(+) create mode 100644 keyboards/bananasplit/keymaps/kamon/config.h create mode 100644 keyboards/bananasplit/keymaps/kamon/keymap.c create mode 100644 keyboards/bananasplit/keymaps/kamon/readme.md create mode 100644 keyboards/bananasplit/keymaps/kamon/rules.mk diff --git a/keyboards/bananasplit/keymaps/kamon/config.h b/keyboards/bananasplit/keymaps/kamon/config.h new file mode 100644 index 000000000..af6cf8ef1 --- /dev/null +++ b/keyboards/bananasplit/keymaps/kamon/config.h @@ -0,0 +1,25 @@ +/* Copyright 2017 Balz Guenat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#define GRAVE_ESC_CTRL_OVERRIDE + +#endif diff --git a/keyboards/bananasplit/keymaps/kamon/keymap.c b/keyboards/bananasplit/keymaps/kamon/keymap.c new file mode 100644 index 000000000..d9dcafe11 --- /dev/null +++ b/keyboards/bananasplit/keymaps/kamon/keymap.c @@ -0,0 +1,96 @@ +/* Copyright 2017 Balz Guenat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "bananasplit.h" + +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +------------------------------------------------------------------------------------------- +|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +------------------------------------------------------------------------------------------- +| Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | Fn1 | Fn1 | Ctrl | +------------------------------------------------------------------------------------------- +*/ +[0] = KEYMAP( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, M(0),\ + MO(1), KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_NO, MO(1), KC_RCTL \ +), +/* +------------------------------------------------------------------------------------------- +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Delete | +------------------------------------------------------------------------------------------- +| TAB |Home | Up | End |PgUp | | | | | | | | | PrtSc | +------------------------------------------------------------------------------------------- +| Ctrl |Left |Down |Right |PgDn | | | | | | | | Enter | +------------------------------------------------------------------------------------------- +| Shift | | | | | | | | | | | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | | | Ctrl | +------------------------------------------------------------------------------------------- +*/ +[1] = KEYMAP( \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TAB, KC_HOME, KC_UP, KC_END, KC_PGUP, ______, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, \ + KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, ______, ______, ______, ______, ______, ______, ______, ______, \ + KC_LSFT, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_RSFT, ______, \ + ______, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, ______, ______, ______, KC_RCTL \ +), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case 0: + // Sends Alt+Shift on both key down and key up. + // Fesigned to switch between two keyboard layouts on Windows using a locking switch. + // Does nothing if right shift is pressed for easier resync. + if (!(get_mods() & MOD_BIT(KC_RSFT))) + return MACRO(D(LALT), T(LSFT), U(LALT), END); + else + return MACRO_NONE; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/bananasplit/keymaps/kamon/readme.md b/keyboards/bananasplit/keymaps/kamon/readme.md new file mode 100644 index 000000000..a08bea519 --- /dev/null +++ b/keyboards/bananasplit/keymaps/kamon/readme.md @@ -0,0 +1,34 @@ +# Kamon's keymap for the Bananasplit +A simple layout to get you started with the BananaSplit60. + +Default layer: + +``` +------------------------------------------------------------------------------------------- +|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +------------------------------------------------------------------------------------------- +| Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | Fn1 | Fn1 | Ctrl | +------------------------------------------------------------------------------------------- +``` + +Fn1 layer: + +``` +------------------------------------------------------------------------------------------- +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Delete | +------------------------------------------------------------------------------------------- +| TAB |Home | Up | End |PgUp | | | | | | | | | PrtSc | +------------------------------------------------------------------------------------------- +| Ctrl |Left |Down |Right |PgDn | | | | | | | | Enter | +------------------------------------------------------------------------------------------- +| Shift | | | | | | | | | | | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | | | Ctrl | +------------------------------------------------------------------------------------------- +``` \ No newline at end of file diff --git a/keyboards/bananasplit/keymaps/kamon/rules.mk b/keyboards/bananasplit/keymaps/kamon/rules.mk new file mode 100644 index 000000000..7d09c322e --- /dev/null +++ b/keyboards/bananasplit/keymaps/kamon/rules.mk @@ -0,0 +1,37 @@ +# Copyright 2017 Balz Guenat +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# QMK 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 = no # Enable keyboard backlight functionality +# MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +# 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. +# SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 3a2acd447540cd6db54b9b9d672ac6faf19e1b94 Mon Sep 17 00:00:00 2001 From: Mason McAllaster Date: Thu, 11 Jan 2018 18:12:15 -0500 Subject: [PATCH 055/556] Updating default niu mini keymap to better reflect product --- keyboards/niu_mini/keymaps/default/keymap.c | 24 ++++++++++----------- keyboards/niu_mini/rules.mk | 4 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/keyboards/niu_mini/keymaps/default/keymap.c b/keyboards/niu_mini/keymaps/default/keymap.c index 20e90f6e9..a0bfef73f 100755 --- a/keyboards/niu_mini/keymaps/default/keymap.c +++ b/keyboards/niu_mini/keymaps/default/keymap.c @@ -3,25 +3,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT}, - {KC_LCTL, KC_LGUI, KC_1, KC_2, KC_3, KC_SPC, MO(2), MO(1), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} - // NOTE MO(2) does not correspond to an actual key since the NIU only comes - // in MIT layout + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT}, + {KC_LCTL, KC_LGUI, KC_CAPS, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} }, [1] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, - {KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, BL_TOGG, BL_STEP, 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_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, 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}, + {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} }, [2] = { - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, + {KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, BL_TOGG, BL_STEP, 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} } }; diff --git a/keyboards/niu_mini/rules.mk b/keyboards/niu_mini/rules.mk index 7c7e98121..64ef5f303 100644 --- a/keyboards/niu_mini/rules.mk +++ b/keyboards/niu_mini/rules.mk @@ -56,12 +56,12 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +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. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE From e2352d4fbf6b11cc70b578abadb322b2401017ef Mon Sep 17 00:00:00 2001 From: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com> Date: Fri, 12 Jan 2018 18:57:48 +0100 Subject: [PATCH 056/556] Updated files to better support sockets version (#2255) --- keyboards/lets_split/matrix.c | 6 ++++++ keyboards/lets_split/sockets/config.h | 6 +++--- keyboards/lets_split/sockets/rules.mk | 2 +- keyboards/lets_split/sockets/sockets.h | 5 +++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c index 47cda6fa8..77def4212 100644 --- a/keyboards/lets_split/matrix.c +++ b/keyboards/lets_split/matrix.c @@ -124,6 +124,12 @@ uint8_t matrix_cols(void) void matrix_init(void) { +#ifdef DISABLE_JTAG + // JTAG disable for PORT F. write JTD bit twice within four cycles. + MCUCR |= (1<. // wiring of each half #define MATRIX_ROW_PINS { B1, B5, E6, B4 } #define MATRIX_COL_PINS { F4, F7, D7, B3, B2, B6} -// #define MATRIX_COL_PINS { B6, B2, B3, C6, F7, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +// #define MATRIX_COL_PINS { B6, B2, B3, D7, F7, F4} //uncomment this line and comment line above if you need to reverse left-to-right key order /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -59,8 +59,8 @@ along with this program. If not, see . ) /* ws2812 RGB LED */ -#define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER #define RGBLED_NUM 12 // Number of LEDs #define ws2812_PORTREG PORTD #define ws2812_DDRREG DDRD diff --git a/keyboards/lets_split/sockets/rules.mk b/keyboards/lets_split/sockets/rules.mk index a975e56f1..e14d18d8d 100644 --- a/keyboards/lets_split/sockets/rules.mk +++ b/keyboards/lets_split/sockets/rules.mk @@ -1,3 +1,3 @@ BACKLIGHT_ENABLE = no AUDIO_ENABLE = yes -RGBLIGHT_ENABLE = no \ No newline at end of file +RGBLIGHT_ENABLE = yes #Don't enable this along with I2C diff --git a/keyboards/lets_split/sockets/sockets.h b/keyboards/lets_split/sockets/sockets.h index 16b93b3d8..05cc78f9e 100644 --- a/keyboards/lets_split/sockets/sockets.h +++ b/keyboards/lets_split/sockets/sockets.h @@ -1,5 +1,6 @@ -#ifndef REV2_H -#define REV2_H +#ifndef SOCKETS_H +#define SOCKETS_H +#define DISABLE_JTAG // The keyboard uses PF4 and PF7, which are used by JTAG. #include "lets_split.h" From 383a3c1e08d0f4e00b1c6f07e8468c5eac544eb4 Mon Sep 17 00:00:00 2001 From: Daniel Gordon Date: Mon, 18 Dec 2017 16:01:59 -0600 Subject: [PATCH 057/556] Add Daniel Gordon's Ergodox Infinity and Chimera * gordon.c defines many aliases for KC codes. * gordon.c defines many advanced tap dance functions. * This is a squashed commit of about 6 months of work on chimera and ergodox infinity changes. * Ignore the change-id below. Change-Id: I83927139e8a80fe08992ae91ec7d62571498f7f7 --- .../chimera_ortho/keymaps/gordon/keymap.c | 389 ++++++++++++++++++ .../ergodox_infinity/keymaps/gordon/keymap.c | 315 ++++++++++++++ users/gordon/gordon.c | 275 +++++++++++++ users/gordon/gordon.h | 157 +++++++ users/gordon/readme.md | 14 + users/gordon/rules.mk | 1 + 6 files changed, 1151 insertions(+) create mode 100644 keyboards/chimera_ortho/keymaps/gordon/keymap.c create mode 100644 keyboards/ergodox_infinity/keymaps/gordon/keymap.c create mode 100644 users/gordon/gordon.c create mode 100644 users/gordon/gordon.h create mode 100644 users/gordon/readme.md create mode 100644 users/gordon/rules.mk diff --git a/keyboards/chimera_ortho/keymaps/gordon/keymap.c b/keyboards/chimera_ortho/keymaps/gordon/keymap.c new file mode 100644 index 000000000..721f8207a --- /dev/null +++ b/keyboards/chimera_ortho/keymaps/gordon/keymap.c @@ -0,0 +1,389 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include "chimera_ortho.h" +#include "action_layer.h" +#include "version.h" +#include "process_keycode/process_tap_dance.h" +#include "gordon.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +#define KC_SNAPLEFT LGUI(KC_LEFT) +#define KC_SNAPRIGHT LGUI(KC_RIGHT) +#define KC_SNAPUP LGUI(KC_UP) +#define KC_SNAPDOWN LGUI(KC_DOWN) +#define KC_PREVTAB LCTL(LSFT(KC_TAB)) +#define KC_NEXTTAB LCTL(KC_TAB) +#define KC_WORKRIGHT LCTL(LGUI(KC_RIGHT)) +#define KC_WORKLEFT LCTL(LGUI(KC_LEFT)) + +#define KC_NMPD TG(_NUMPAD) +#define KC_SYMB TG(_SYMBOLS) + +#define KC_SCTL MT(MOD_LCTL, KC_LBRC) +#define KC_SCTR MT(MOD_LCTL, KC_RBRC) +#define KC_SPLT MT(MOD_LALT, KC_MINS) +#define KC_SPRT MT(MOD_LALT, KC_1) +#define KC_GBRC MT(MOD_RGUI, KC_8) +#define KC_GQOT MT(MOD_LGUI, KC_QUOT) +#define KC_CSHW MT(MOD_LCTL|MOD_LSFT,KC_W) + +#define KC_CDEL LCTL(KC_DEL) +#define KC_AUDUP KC_AUDIO_VOL_UP +#define KC_AUDOWN KC_AUDIO_VOL_DOWN + + +#define KC_MEHS MEH_T(KC_S) +#define KC_MEHL MEH_T(KC_L) +#define KC_GWIN GUI_T(KC_G) +#define KC_FCTL CTL_T(KC_F) +#define KC_JCTL CTL_T(KC_J) +#define KC_ZCTL CTL_T(KC_Z) +#define KC_ALTV ALT_T(KC_V) +#define KC_ALTN ALT_T(KC_N) +#define KC_MEHX ALL_T(KC_X) +#define KC_RESET RESET + +//LTs +#define KC_MESC LT(_MACROS, KC_ESC) +#define KC_DNUM LT(_NUMPAD, KC_D) +#define KC_SPFN LT(_NAV,KC_EQL) +#define KC_EMAUS LT(_MOUSE,KC_E) +#define KC_ENAV LT(_NAV,KC_E) +#define KC_INAV LT(_TEXTNAV,KC_I) +#define KC_BSPSYM LT(_SYMBOLS,KC_BSPACE) +#define KC_ENTSYM LT(_SYMBOLS,KC_ENTER) +#define KC_CLNMAUS LT(_MOUSE,KC_SCOLON) + +#define KC_FUNC TT(_FUNCTION) + +//TAP DANCE +#define KC_F6F7 TD(F6F7) +#define KC_ALF4 TD(ALTF4) +#define KC_TTT TD(TTT) +#define KC_ENHM TD(HOME_END) +#define KC_CLPS TD(CALC_PRINTSCREEN) + + +#define KC_INCL M(0) +#define KC_PULL M(1) +#define KC_PUSH M(2) +#define KC_SCAP M(3) +#define KC_SCOF M(4) +#define KC_CAD LALT(LCTL(KC_DEL)) + +#define LONGPRESS_DELAY 150 +//#define LAYER_TOGGLE_DELAY 300 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define KC_ KC_TRNS + +/* TODO: + * + * DONE: RESET and CAD into macro layer. + * DONE: WINUP AND WINDOWN in NAV layer + * DONE: Get rid of caps layer. not sure what it is even for. + * DONE: LMEH + * DONE: plus, divide, multiply on left hand for num layer + * DONE: F1 - F12 on a layer toggle (not a temp toggle but a one shot or something) + * DONE: Volume, page up and down for mouse layer. + * DONE: Add full user files - without using anything. + * DONE: Insert, ctrl delete + * DONE: Home and End + * DONE: Printscreen + + * Easier way to open new terminal (instead of alt + F2) + * Intellij/text navigation layer (ctrl delete could be here). + * Macro for "System.exit(0)" probably macro layer and "c" + * Some sort of tap dance for comma, H, right pinky, and possibly other corners. + * Something more with the right hand. not sure what. + * Mouse: Left scroll, right scroll + * Passwords and any other macros. + * LED for control + * All modifiers reset + * Russain layer + * Hebrew layer + * Get rid of stupid git pull and push macros. + * +*/ + +//Tap dance enums +enum { + F12ETAPS = 0, + CALCCOMP, + ALTF4, + F6F7, + TTT, + HOME_END, + CALC_PRINTSCREEN +}; + +static xtap ttt_state = { + .is_press_action = true, + .state = 0 +}; + + +//Already exists in gordon.c, shouldn't need this anymore +/*// To activate SINGLE_HOLD, you will need to hold for 200ms first. +// This tap dance favors keys that are used frequently in typing like 'f' +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted) { + return SINGLE_TAP; + } + else { + if (!state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP; + else if (state->count == 3) return TRIPLE_HOLD; + else return 8; //magic number. At some point this method will expand to work for more presses +}*/ + +/* "Super tap toggle" + * Basically, TT but for two or more layers for a single key. + * This particular dance: + * Single tap/hold - TT for Function layer + * Double tap/hold - TT for Numpad layer + * Triple tap/hold - TT for Mouse layer + * +*/ +void TTT_finished (qk_tap_dance_state_t *state, void *user_data) { + ttt_state.state = cur_dance(state); + switch (ttt_state.state) { + case SINGLE_TAP: layer_invert(_FUNCTION); break; + case SINGLE_HOLD: layer_on(_FUNCTION); break; + case DOUBLE_TAP: layer_invert(_NUMPAD); break; + case DOUBLE_HOLD: layer_on(_NUMPAD); break; + case DOUBLE_SINGLE_TAP: layer_invert(_NUMPAD); break; + case TRIPLE_TAP: layer_invert(_MOUSE); break; + case TRIPLE_HOLD: layer_on(_MOUSE); break; + } +} + +void TTT_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (ttt_state.state) { + case SINGLE_TAP: break; + case SINGLE_HOLD: layer_off(_FUNCTION); break; + case DOUBLE_TAP: break; + case DOUBLE_HOLD: layer_off(_NUMPAD); break; + case DOUBLE_SINGLE_TAP: break; + case TRIPLE_TAP: break; + case TRIPLE_HOLD: layer_off(_MOUSE); break; + } + ttt_state.state = 0; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + // simple tap dance + [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), + [CALCCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_MY_COMPUTER), + [CALC_PRINTSCREEN] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_PSCR), + [ALTF4] = ACTION_TAP_DANCE_DOUBLE(KC_F4,LALT(KC_F4)), + [F6F7] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_F6), LALT(KC_F7)), + [HOME_END] = ACTION_TAP_DANCE_DOUBLE(KC_END, KC_HOME), + [TTT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL,TTT_finished, TTT_reset), +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + MESC, Q ,CSHW,ENAV, R , T ,SPC , CLPS, Y , U ,INAV, O , P ,TTT, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + TAB , A , MEHS,DNUM,FCTL,GWIN,GRAVE, TILD, H ,JCTL, K ,MEHL,CLNMAUS,ENHM, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + MINUS,ZCTL,MEHX, C ,ALTV, B ,DELETE, INS ,ALTN, M ,COMM,DOT ,SLSH,UNDS, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + LSHIFT,BSPSYM, SPC ,ENTSYM + // \------------------+----+----+---/ \---+----+----+-------------------/ + ), + + [_NUMPAD] = KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , , , ,ASTR, , , , , 7 , 8 , 9 ,ASTR,/**/, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,MINS,PLUS,/**/,EQUAL, , , , , 4 , 5 , 6 ,PLUS, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , ,SLSH, , , , , 1 , 2 , 3 ,SLSH, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , 0 + // \------------------+----+----+---/ \---+----+----+-------------------/ + ), + + [_SYMBOLS] = KEYMAP( + //,----+----+-----+----+----+----+----. ,----+----+----+----+----+----+----. + ,EXLM, AT ,LCBR,RCBR,HASH, , ,CIRC,AMPR,ASTR,LPRN,RPRN,/**/, + //|----+----+-----+----+----+----+----| |----+----+----+----+----+----+----| + ,EXLM,EXLM,LPRN,RPRN , , , , ,DQUO,EQUAL,QUOTE,RCBR, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,DOLLAR, PERC,LBRACKET,RBRACKET, , , ,PIPE,BSLASH,PLUS, , , , + //|----+----+-----+----+----+----+----| |----+----+----+----+----+----+----| + UNDS,/**/, ,/**/ + // \-------------------+----+----+---/ \---+----+----+-------------------/ + ), + + [_FUNCTION] = KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + F6F7 ,F1 ,F2 ,F3 ,ALF4,F5 ,F6 , F7 ,F8 ,F9 ,F10 ,F11 ,F12 ,/**/, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , + // \------------------+----+----+---/ \---+----+----+-------------------/ + ), + + [_NAV] = KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , ,SNAPLEFT,/**/,SNAPRIGHT,, , , , , UP , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,SNAPUP,PREVTAB, ,NEXTTAB,SNAPDOWN,, , ,LEFT,DOWN,RGHT, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,WORKLEFT, ,WORKRIGHT,, , , ,PGUP,PGDN, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + CDEL ,DEL, , + // \------------------+----+----+---/ \---+----+----+-------------------/ + ), + + [_TEXTNAV] = KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , , , , , , , , , ,/**/, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , + // \------------------+----+----+---/ \---+----+----+-------------------/ + ), + + [_MOUSE] = KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , , ,MS_UP, , , , , , , UP , , , ,/**/ + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,MS_LEFT,MS_DOWN,MS_RIGHT, , , , ,LEFT,DOWN,RGHT,/**/, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,MS_BTN1 ,MS_BTN2 , + // \------------------+----+----+---/ \---+----+----+-------------------/ + ), + + + [_MACROS] = KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + /**/,RESET,SECRET_2,SECRET_3, , , ,SYSTEM_SLEEP, , ,INCL, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + CAD ,SECRET_1, , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + SCAP, , , , , , , , , , , , ,SCAP, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , + // \------------------+----+----+---/ \---+----+----+-------------------/ + ) + +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + /* include some kind of library or header */ + case 0: + if (record->event.pressed) { + SEND_STRING("#include <>"); + return MACRO( T(LEFT), END); + } + break; + case 1: + if (record->event.pressed) { + SEND_STRING("git pull"); + return MACRO( T(ENT), END ); + } + break; + case 2: + if (record->event.pressed){ + SEND_STRING("git push"); + return MACRO( T(ENT), END ); + } + break; + case 3: + if (record->event.pressed){ + // layer_on(_CAPS); + // register_code(KC_CAPSLOCK); + // unregister_code(KC_CAPSLOCK); + } + break; + case 4: + if (record->event.pressed){ + // layer_off(_CAPS); + // register_code(KC_CAPSLOCK); + // unregister_code(KC_CAPSLOCK); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + switch (layer) { + case _QWERTY: + set_led_green; + break; + case _MOUSE: + set_led_yellow; + break; + case _NUMPAD: + set_led_blue; + break; + case _SYMBOLS: + set_led_red; + break; + case _NAV: + set_led_magenta; + break; + case _MACROS: + set_led_green; + _delay_ms(45); + set_led_red; + _delay_ms(45); + break; + case _FUNCTION: + set_led_green; + _delay_ms(45); + set_led_blue; + _delay_ms(45); + break; + default: + set_led_green; + break; + } +}; diff --git a/keyboards/ergodox_infinity/keymaps/gordon/keymap.c b/keyboards/ergodox_infinity/keymaps/gordon/keymap.c new file mode 100644 index 000000000..7e3e51cdd --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/gordon/keymap.c @@ -0,0 +1,315 @@ +#include QMK_KEYBOARD_H +#include "debug.h" +#include "action_layer.h" +#include "version.h" +#include "process_keycode/process_tap_dance.h" +#include "gordon.h" + +#include "keymap_german.h" + +#include "keymap_nordic.h" + + +#define TLSLSH M(TIL_SLASH) +#define F1_F13 TD(F1F13) +#define F2_F14 TD(F2F14) +#define F5_F15 TD(F5F15) +#define F4_ALTF4 TD(ALTF4) +#define END_ESC TD(ENDESC) +#define SHF6_AF7 TD(F6F7) +#define F12_RUN TD(F12ETAPS) +#define COMMA_TD TD(COMMA) + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + RGB_SLD, +}; + +//Tap dance enums +enum { + F12TAP = 0, + F12ETAPS, + CALCCOMP, + REFRESH, //send R, or Control+R if double tapped. + ENDESC, + XESC, //'quad function'. x, control, escape, alt + ALY2, //'quad function': a, Hyper, ctrl+a, layer 2 + PRLOCK, + F6F7, // Shift F6 or Alt F7 + TABCOMBO, + FCTRL, + F3D, + ALTF4, + COMMA, + AT, + HTAB, + F1F13, + F2F14, + F5F15 +}; + + + +// Custom tapping terms for each key. +// Requires changes to action_taping.c +/* uint16_t get_tapping_term(keyevent_t* event) { + uint16_t keycode = keymap_key_to_keycode(layer_switch_get_layer(event->key), event->key); + if (keycode == LT(3,KC_E) ) { + return TAPPING_TERM + 50; + } + return TAPPING_TERM; +} */ + + +// Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // simple tap dance + [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), + [REFRESH] = ACTION_TAP_DANCE_DOUBLE(KC_R,LCTL(KC_R)), + [ENDESC] = ACTION_TAP_DANCE_DOUBLE(KC_END, KC_ESC), + [CALCCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_MY_COMPUTER), + [ALTF4] = ACTION_TAP_DANCE_DOUBLE(KC_F4,LALT(KC_F4)), + [F6F7] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_F6), LALT(KC_F7)), + [F1F13] = ACTION_TAP_DANCE_DOUBLE(KC_F1, KC_F13), + [F2F14] = ACTION_TAP_DANCE_DOUBLE(KC_F2, KC_F14), + [F5F15] = ACTION_TAP_DANCE_DOUBLE(KC_F5, KC_F15), + [TABCOMBO] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tab_finished, tab_reset), + [F3D] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, bt_finished, bt_reset), + [COMMA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, comma_finished, comma_reset), + [HTAB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL,h_finished, h_reset) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +//**************************FIRST LAYER - LAYER ZERO ************************************** + [_QWERTY] = KEYMAP( + + SHF6_AF7, F1_F13, F2_F14, TD(F3D), F4_ALTF4, F5_F15, KC_F11, + ________, KC_Q, CTR_SH_W, NAV_E, CTR_AL_R, KC_T, PRINTSCR, + KC_TAB, KC_A, MEH_S, NUMPAD_D, CTRL_F, WIN_G, + ALT_SHFT, CTRL_Z, HYPER_X, MOUSE_C, ALT_V, KC_B, TT(_MOUSE), + KC_MINUS, KC_GRAVE, KC_DELETE, KC_LEFT, KC_RIGHT, + + KC_INSERT, KC_DELETE, + ALT_HOME, + KC_LSHIFT, SYMB_BSP, END_ESC, + + F12_RUN, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, TD(CALCCOMP), + ________, KC_Y, KC_U, KC_I, KC_O, KC_P, ________, + WIN_H, CTRL_J, KC_K, MEH_L, COL_MOUS, ________, + KC_LEAD, KC_N, ALT_M, COMMA_TD, HYPE_DOT, KC_SLASH, TD(TABCOMBO), + KC_UP, KC_DOWN, KC_ESC, KC_TILD, KC_UNDS, + + KC_ESCAPE, KC_DELETE, + ALT_T(KC_PGUP), + RCTL_T(KC_PGDOWN), LT(_NAV,KC_ENTER), SPAC_SYM), + + + //**************************SYMBOLS LAYER************************** + [_SYMBOLS] = KEYMAP( + ________, ________, ________, ________, ________, ________, ________, + ________, TLSLSH, KC_AT, KC_LCBR, KC_RCBR, KC_CIRC, ________, + ________, KC_EXLM, KC_PIPE, KC_LPRN, KC_RPRN, M(DEREF), + ________,KC_DOLLAR, KC_PERC, LSQUIGLY, RSQUIGLY, ________, ________, + ________, M(TICK3), ________, ________, ________, + + ________,________, + ________, + ________,________,________, + + + ________, ________, ________, ________, ________, ________, NUMLOCK, + ________, TLSLSH, KC_PIPE, KC_PLUS, KC_AMPR, ________, CAPLOCK, + M(EQRIGHT), KC_DQUO, KC_EQUAL, KC_QUOTE,KC_SCOLON, ________, + ________, KC_PIPE, BK_SLASH, ASTERSK, KC_DOT, KC_SLASH, ________, + ________,________,________,M(TILD3),________, + ________,________, + ________, + ________,________,________), + + //**************************MOUSE MOVEMENT LAYER************************** + [_MOUSE] = KEYMAP(RESET,________,________,________,________,________,________, + RESET,________,________,KC_MS_UP,________,KC_MS_WH_UP,CALTDEL, + ________,________,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_MS_WH_DOWN, + KC_SECRET_1,________,HYPR(KC_F13),________,HYPR(KC_F14),KC_SECRET_2,________, + ________,________,HYPR(KC_F15),KC_MS_WH_LEFT,KC_MS_WH_RIGHT, + + ________,________, + ________, + KC_MS_BTN1,KC_MS_BTN2,________, + + + ________,________,________,________,________,________,________, + KC_MS_WH_UP,________,________,KC_UP,________,________,________, + ________,KC_LEFT,KC_DOWN,KC_RIGHT,________,________, + KC_MS_WH_DOWN,________,KC_PGUP,KC_PGDOWN,KC_MEDIA_NEXT_TRACK,________,________, + KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE,KC_MEDIA_PLAY_PAUSE,________, + ________,________, + ________, + ________,________,KC_WWW_BACK), + + + + + //**************************WINDOWS NAVIGATION LAYER************************** + + [_NAV] = KEYMAP(________,________,________,________,________,________,________, + ________,________,SNAPLEFT,________,SNAPRGHT,LALT(KC_LEFT),________, + ________,LCTL(KC_W),PREVTAB,LGUI(KC_D),NEXTTAB,________, + ________,________,WORKLEFT,________,WORKRIGHT,________,________, + ________,________,________,________,________, + + ________,________, + ________, + ________,________,________, + + + ________,________,________,________,________,________,________, + ________,________,SNAPUP ,KC_UP ,SNAPDOWN,________,________, + ________,KC_LEFT ,KC_DOWN ,KC_RIGHT,________,________, + ________,________,________,________,________,________,________, + ________,________,________,________,________, + + + ________,________, + ________, + ________,________,________), + + //****************************NUMPAD LAYER**************************** + [_NUMPAD] = KEYMAP(________,________,________,________,________,________,________, + ________,________,________,________,________,________,________, + ________,________,________,________,________,________, + ________,________,________,________,________,________,________, + ________,________,________,________,________, + + ________,________, + ________, + ________,________,________, + + BL_TOGG ,BL_STEP ,________,________,________,________,________, + ________,________,KC_7 ,KC_8 ,KC_9 ,________,________, + ________,KC_4 ,KC_5 ,KC_6 ,________,________, + ________,________,KC_1 ,KC_2 ,KC_3 ,________,________, + KC_0 ,KC_0 , KC_DOT ,________,________, + + ________,________, + ________, + ________,________,KC_0), + //****************************TEXT/INTELLIJ NAVIGATION LAYER**************************** + [_TEXTNAV] = KEYMAP(________,________,________,________,________,________,________, + ________,MEH(KC_Q),LSFT(KC_ESCAPE),MEH(KC_D),MEH(KC_2),LALT(LSFT(KC_UP)),________, + ________,LALT(KC_F7),LCTL(KC_LEFT),LCTL(KC_B),LCTL(KC_RIGHT),LALT(LSFT(KC_DOWN)), + ________,________,________,LCTL(LSFT(KC_COMMA)),MEH(KC_DOT),LALT(KC_MS_WH_UP),________,________,________,________,________,________,________,________,________,________,LCTL(KC_DELETE),________,LALT(LSFT(KC_F9)),________,________,________,________,________,________,________,MEH(KC_5),LALT(LSFT(KC_Z)),________,LALT(KC_Z),________,________,________,LCTL(LSFT(KC_LEFT)),LALT(LCTL(KC_S)),LCTL(LSFT(KC_RIGHT)),LCTL(LSFT(KC_COMMA)),________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________) +}; + +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 INFOQM: { + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + } + + case TIL_SLASH: { + if (record->event.pressed) { + SEND_STRING ("~/."); + } + break; + } + + case DEREF: { + if (record->event.pressed) { + SEND_STRING ("->"); + } + break; + } + + case EQRIGHT: { + if (record->event.pressed) { + SEND_STRING ("=>"); + } + break; + } + + case TICK3: { + if (record->event.pressed) { + SEND_STRING ("```"); + } + break; + } + + case TILD3: { + if (record->event.pressed) { + SEND_STRING ("~~~"); + } + break; + } + + case ALTTAB_START: { + register_code(KC_LALT); + layer_on(8); + } + + case ALTTAB_END: { + unregister_code(KC_LALT); + layer_off(8); + } + + + + } + return MACRO_NONE; +}; + +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_on(); + ergodox_led_all_on(); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case _SYMBOLS: + ergodox_right_led_1_on(); + break; + case _MOUSE: + ergodox_right_led_2_on(); + break; + case _NUMPAD: + ergodox_right_led_3_on(); + break; + case _NAV: + 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/users/gordon/gordon.c b/users/gordon/gordon.c new file mode 100644 index 000000000..056012a21 --- /dev/null +++ b/users/gordon/gordon.c @@ -0,0 +1,275 @@ +#include "gordon.h" +#include "quantum.h" +#include "action.h" +#include "process_keycode/process_tap_dance.h" + +#if (__has_include("secret.h")) +#include "secret.h" +#else +const char secret[][64] = { + "test1", + "test2", + "test3", + "test4", + "test5" +}; +#endif + + + + +void register_hyper (void) { //Helper function to invoke Hyper + register_code (KC_LSFT); + register_code (KC_LCTL); + register_code (KC_LALT); + register_code (KC_LGUI); +} +void unregister_hyper (void) { //Helper function to invoke Hyper + unregister_code (KC_LSFT); + unregister_code (KC_LCTL); + unregister_code (KC_LALT); + unregister_code (KC_LGUI); +} + +void register_ctrl_a (void) { + register_code(KC_LCTL); + register_code(KC_A); +} + +void unregister_ctrl_a (void) { + unregister_code(KC_LCTL); + unregister_code(KC_A); +} + +void register_alt_f7 (void) { + register_code (KC_LALT); + register_code (KC_F7); +} + +void unregister_alt_f7 (void) { + unregister_code (KC_LALT); + unregister_code (KC_F7); +} + +void register_shift_f6 (void) { + register_code (KC_LSFT); + register_code (KC_F6); +} + +void unregister_shift_f6 (void) { + unregister_code (KC_LSFT); + unregister_code (KC_F6); +} + +void register_ctrl_shift (void) { + register_code (KC_LSFT); + register_code (KC_LCTRL); +} + +void unregister_ctrl_shift (void) { + unregister_code (KC_LSFT); + unregister_code (KC_LCTRL); +} + +void register_alt_shift (void) { + register_code (KC_LSFT); + register_code (KC_LALT); +} + +void unregister_alt_shift (void) { + unregister_code (KC_LSFT); + unregister_code (KC_LALT); +} + +// To activate SINGLE_HOLD, you will need to hold for 200ms first. +// This tap dance favors keys that are used frequently in typing like 'f' +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP + if (state->interrupted) { + // if (!state->pressed) return SINGLE_TAP; + //need "permissive hold" here. + // else return SINsGLE_HOLD; + //If the interrupting key is released before the tap-dance key, then it is a single HOLD + //However, if the tap-dance key is released first, then it is a single TAP + //But how to get access to the state of the interrupting key???? + return SINGLE_TAP; + } + else { + if (!state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP; + else if (state->count == 3) return TRIPLE_HOLD; + else return 8; //magic number. At some point this method will expand to work for more presses +} + +//This works well if you want this key to work as a "fast modifier". It favors being held over being tapped. +int hold_cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted) { + if (!state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + else { + if (!state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. + else if (state->count == 2) { + if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else if (state->count == 3) { + if (!state->pressed) return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return 8; //magic number. At some point this method will expand to work for more presses +} + + +static xtap htap_state = { + .is_press_action = true, + .state = 0 +}; + +void h_finished (qk_tap_dance_state_t *state, void *user_data) { + htap_state.state = cur_dance(state); + switch (htap_state.state) { + case SINGLE_TAP: register_code(KC_H); break; + case SINGLE_HOLD: layer_on(8); register_code(KC_LALT); break; + case DOUBLE_TAP: layer_invert(8); register_code(KC_LALT); break; + // case DOUBLE_HOLD: register_code(KC_LALT); + case DOUBLE_SINGLE_TAP: register_code(KC_H);unregister_code(KC_H);register_code(KC_H); + } +} + +void h_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (htap_state.state) { + case SINGLE_TAP: unregister_code(KC_H); break; + case SINGLE_HOLD: layer_off(8); unregister_code(KC_LALT); break; + case DOUBLE_TAP: unregister_code(KC_LALT);break; + // case DOUBLE_HOLD: unregister_code(KC_LALT); + case DOUBLE_SINGLE_TAP: unregister_code(KC_H); + } + htap_state.state = 0; +} + + +/**************** QUAD FUNCTION FOR TAB ****************/ +// TAB, ALT + SHIFT, TAB TAB, CTRL + SHIFT +static xtap tab_state = { + .is_press_action = true, + .state = 0 +}; + +void tab_finished (qk_tap_dance_state_t *state, void *user_data) { + tab_state.state = cur_dance(state); + switch (tab_state.state) { + case SINGLE_TAP: register_code(KC_TAB); break; //send tab on single press + case SINGLE_HOLD: register_ctrl_shift(); break; + case DOUBLE_HOLD: register_alt_shift(); break; //alt shift on single hold + case DOUBLE_TAP: register_code(KC_TAB); unregister_code(KC_TAB); register_code(KC_TAB); break; //tab tab + case TRIPLE_TAP: register_code(KC_LSHIFT) ;register_code(KC_ESC); break; + case TRIPLE_HOLD: register_code(KC_LSHIFT); register_code(KC_LGUI); break; + } +} + +void tab_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (tab_state.state) { + case SINGLE_TAP: unregister_code(KC_TAB); break; //unregister tab + case DOUBLE_HOLD: unregister_alt_shift(); break; //let go of alt shift + case DOUBLE_TAP: unregister_code(KC_TAB); break; + case SINGLE_HOLD: unregister_ctrl_shift(); break; + case TRIPLE_TAP: unregister_code(KC_LSHIFT); unregister_code(KC_ESC); break; + case TRIPLE_HOLD: unregister_code(KC_LSHIFT); unregister_code(KC_LGUI); break; + } + tab_state.state = 0; +} +/**************** QUAD FUNCTION FOR TAB ****************/ + +//*************** SUPER COMMA *******************// +// Assumption: we don't care about trying to hit ,, quickly +//*************** SUPER COMMA *******************// +static xtap comma_state = { + .is_press_action = true, + .state = 0 +}; + +void comma_finished (qk_tap_dance_state_t *state, void *user_data) { + comma_state.state = hold_cur_dance(state); //Use the dance that favors being held + switch (comma_state.state) { + case SINGLE_TAP: register_code(KC_COMMA); break; + case SINGLE_HOLD: layer_on(1); break; //turn on symbols layer + case DOUBLE_TAP: layer_invert(4); break; //toggle numbers layer + case DOUBLE_HOLD: layer_on(2); break; + case TRIPLE_TAP: register_code(KC_CALCULATOR); break; + case TRIPLE_HOLD: layer_on(3); + } +} + +void comma_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (comma_state.state) { + case SINGLE_TAP: unregister_code(KC_COMMA); break; //unregister comma + case SINGLE_HOLD: layer_off(1); break; + case DOUBLE_TAP: ;break; + case DOUBLE_HOLD: layer_off(2); break; + case TRIPLE_TAP: unregister_code(KC_CALCULATOR); break; + case TRIPLE_HOLD: layer_off(3); + } + comma_state.state = 0; +} +//*************** SUPER COMMA *******************// +//*************** SUPER COMMA *******************// + + +//*************** F3 TAP DANCE *******************// +//Good example for accessing multiple layers from the same key. +static xtap S1_state = { + .is_press_action = true, + .state = 0 +}; + +void bt_finished (qk_tap_dance_state_t *state, void *user_data) { + S1_state.state = cur_dance(state); + switch (S1_state.state) { + case SINGLE_TAP: register_code(KC_F3); break; + case SINGLE_HOLD: layer_on(4); break; + case DOUBLE_TAP: layer_invert(4); break; + case DOUBLE_HOLD: layer_on(5); break; + case DOUBLE_SINGLE_TAP: layer_invert(4); break; + } +} + +void bt_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (S1_state.state) { + case SINGLE_TAP: unregister_code(KC_F3); break; + case SINGLE_HOLD: layer_off(4); break; + case DOUBLE_TAP: break; //already inverted. Don't do anything. + case DOUBLE_HOLD: layer_off(5); break; + case DOUBLE_SINGLE_TAP: break; + } + S1_state.state = 0; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_SECRET_1 ... KC_SECRET_5: + if (!record->event.pressed) { + send_string(secret[keycode - KC_SECRET_1]); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/users/gordon/gordon.h b/users/gordon/gordon.h new file mode 100644 index 000000000..548c63049 --- /dev/null +++ b/users/gordon/gordon.h @@ -0,0 +1,157 @@ +#ifndef GORDON +#define GORDON + +#include "quantum.h" +#include "process_keycode/process_tap_dance.h" + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define ________ KC_TRNS +#define _________ KC_TRNS +#define XXXXXXX KC_NO + +// KC codes that are too long +#define DOLLAR KC_DOLLAR +#define LSQUIGLY KC_LBRACKET +#define RSQUIGLY KC_RBRACKET +#define NUMLOCK KC_NUMLOCK +#define CAPLOCK KC_CAPSLOCK +#define BK_SLASH KC_BSLASH +#define ASTERSK KC_KP_ASTERISK + +// Navigation +#define SNAPLEFT LGUI(KC_LEFT) +#define SNAPRGHT LGUI(KC_RIGHT) +#define SNAPUP LGUI(KC_UP) +#define SNAPDOWN LGUI(KC_DOWN) +#define PREVTAB LCTL(LSFT(KC_TAB)) +#define NEXTTAB LCTL(KC_TAB) +#define WORKRIGHT LCTL(LGUI(KC_RIGHT)) +#define WORKLEFT LCTL(LGUI(KC_LEFT)) + +// KC/modifier hold +#define CTRL_F CTL_T(KC_F) +#define CTRL_J CTL_T(KC_J) +#define CTRL_Z CTL_T(KC_Z) +#define ALT_V ALT_T(KC_V) +#define ALT_M ALT_T(KC_M) +#define WIN_G GUI_T(KC_G) +#define WIN_H GUI_T(KC_H) +#define HYPER_X ALL_T(KC_X) +#define HYPE_DOT ALL_T(KC_DOT) +#define MEH_S MEH_T(KC_S) +#define MEH_L MEH_T(KC_L) +#define ALT_HOME ALT_T(KC_HOME) + + +// KC/Layer Hold +#define NAV_E LT(_NAV,KC_E) +#define NUMPAD_D LT(_NUMPAD,KC_D) +#define MOUSE_C LT(_MOUSE,KC_C) +#define SYMB_BSP LT(_SYMBOLS,KC_BSPACE) +#define COL_MOUS LT(_MOUSE,KC_SCOLON) +#define SPAC_SYM LT(_SYMBOLS,KC_SPACE) + +// Double Modifier ONLY hold +#define ALT_SHFT LSFT(KC_LALT) +#define CTR_SHFT LSFT(KC_LCTL) + +// KC/Double modifier Hold +#define CTR_SH_W MT(MOD_LCTL|MOD_LSFT,KC_W) +#define CTR_AL_R MT(MOD_LCTL|MOD_LALT,KC_R) + +//MISC +#define PRINTSCR KC_PSCREEN +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + + +typedef struct { + bool is_press_action; + int state; +} xtap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, //send two single taps + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7 +}; + +enum gordon_layers +{ + _QWERTY = 0, + _SYMBOLS, + _MOUSE, + _NUMPAD, + _NAV, + _MACROS, + _FUNCTION, + _TEXTNAV +}; + + + +void register_hyper (void); +void unregister_hyper (void); + +void register_ctrl_a (void); +void unregister_ctrl_a (void); + +void register_alt_f7 (void); +void unregister_alt_f7 (void); + +void register_shift_f6 (void); +void unregister_shift_f6 (void); + +void register_ctrl_shift (void); +void unregister_ctrl_shift (void); + +void register_alt_shift (void); +void unregister_alt_shift (void); + +int cur_dance (qk_tap_dance_state_t *state); +int hold_cur_dance (qk_tap_dance_state_t *state); + +void x_finished (qk_tap_dance_state_t *state, void *user_data); +void x_reset (qk_tap_dance_state_t *state, void *user_data); + +void h_finished (qk_tap_dance_state_t *state, void *user_data); +void h_reset (qk_tap_dance_state_t *state, void *user_data); + +void tab_finished (qk_tap_dance_state_t *state, void *user_data); +void tab_reset (qk_tap_dance_state_t *state, void *user_data); + +void comma_finished (qk_tap_dance_state_t *state, void *user_data); +void comma_reset (qk_tap_dance_state_t *state, void *user_data); + +void bt_finished (qk_tap_dance_state_t *state, void *user_data); +void bt_reset (qk_tap_dance_state_t *state, void *user_data); + +// Macro Declarations +enum { + INFOQM, + TIL_SLASH, + DEREF, + EQRIGHT, + TILD3, + TICK3, + ALTTAB_START, + ALTTAB_END +}; + +enum secret_strings { + KC_SECRET_1 = SAFE_RANGE, + KC_SECRET_2, + KC_SECRET_3, + KC_SECRET_4, + KC_SECRET_5, +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); + +#endif \ No newline at end of file diff --git a/users/gordon/readme.md b/users/gordon/readme.md new file mode 100644 index 000000000..fdea33b67 --- /dev/null +++ b/users/gordon/readme.md @@ -0,0 +1,14 @@ +Copyright @ + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . \ No newline at end of file diff --git a/users/gordon/rules.mk b/users/gordon/rules.mk new file mode 100644 index 000000000..5dd62c200 --- /dev/null +++ b/users/gordon/rules.mk @@ -0,0 +1 @@ +SRC += gordon.c \ No newline at end of file From 586a5e8d1da98c98cc3f14639ad820c2cd417860 Mon Sep 17 00:00:00 2001 From: chancellorr Date: Thu, 11 Jan 2018 01:50:54 -0500 Subject: [PATCH 058/556] Adding my Tada68 Keymap. --- keyboards/tada68/keymaps/trashcat/keymap.c | 113 ++++++++++++++++++++ keyboards/tada68/keymaps/trashcat/readme.md | 7 ++ keyboards/tada68/keymaps/trashcat/rules.mk | 21 ++++ 3 files changed, 141 insertions(+) create mode 100644 keyboards/tada68/keymaps/trashcat/keymap.c create mode 100644 keyboards/tada68/keymaps/trashcat/readme.md create mode 100644 keyboards/tada68/keymaps/trashcat/rules.mk diff --git a/keyboards/tada68/keymaps/trashcat/keymap.c b/keyboards/tada68/keymaps/trashcat/keymap.c new file mode 100644 index 000000000..79a14753e --- /dev/null +++ b/keyboards/tada68/keymaps/trashcat/keymap.c @@ -0,0 +1,113 @@ +#include "tada68.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 +#define _GM 2 +#define _GF 3 + +#define _______ KC_TRNS + +// Tap dance declarations (These must go above the keymaps) +enum { + TD_F1 = 0, + TD_F2, + TD_F3, + TD_F4, + TD_F5, + TD_F6, + TD_F7, + TD_F8, + TD_F9, + TD_F10, + TD_F11, + TD_F12, + TD_AE_FITCOMP, + TD_AE_IN, + TD_AE_OUT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bksp |Del | + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |FN| Alt|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = KEYMAP_ANSI( + KC_ESC, TD(TD_F1), TD(TD_F2), TD(TD_F3), TD(TD_F4), TD(TD_F5), TD(TD_F6), TD(TD_F7), TD(TD_F8), TD(TD_F9), TD(TD_F10), TD(TD_F11), TD(TD_F12), KC_BSLS,KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC,KC_DEL, \ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,KC_UP,KC_PGDN, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, MO(_FL),KC_RALT,KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| _GM |Ins | + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | Caps |<- |Dn | ->| | | | | | | | | |End | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |Prev|P/P|Next| + * `----------------------------------------------------------------' + */ +[_FL] = KEYMAP_ANSI( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_INS , \ + _______,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_HOME, \ + KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,KC_VOLD,KC_VOLU,KC_MUTE,_______,_______, _______, _______, \ + _______,_______,_______, TG(_GM), _______,_______,_______,KC_MPRV,KC_MPLY, KC_MNXT), + + /* Keymap _GL: Gaming Layer. Basically makes Caps Lock behave normally. I know there is a better way to do this but copy and paste was my friend + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bksp |Del | + * |----------------------------------------------------------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |FN| Alt|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_GM] = KEYMAP_ANSI( + KC_ESC,TD(TD_F1), TD(TD_F2), TD(TD_F3), TD(TD_F4), TD(TD_F5), TD(TD_F6), TD(TD_F7), TD(TD_F8), TD(TD_F9), TD(TD_F10), TD(TD_F11), TD(TD_F12), _______, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC,KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,KC_UP,KC_PGDN, \ + KC_LCTL, KC_LGUI,KC_LALT, _______, MO(_FL),KC_RALT,KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + +}; + +// Tapdance definitions. Tap Dance F Keys. +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_F1] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_F1), + [TD_F2] = ACTION_TAP_DANCE_DOUBLE(KC_2, KC_F2), + [TD_F3] = ACTION_TAP_DANCE_DOUBLE(KC_3, KC_F3), + [TD_F4] = ACTION_TAP_DANCE_DOUBLE(KC_4, KC_F4), + [TD_F5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_F5), + [TD_F6] = ACTION_TAP_DANCE_DOUBLE(KC_6, KC_F6), + [TD_F7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_F7), + [TD_F8] = ACTION_TAP_DANCE_DOUBLE(KC_8, KC_F8), + [TD_F9] = ACTION_TAP_DANCE_DOUBLE(KC_9, KC_F9), + [TD_F10] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_F10), + [TD_F11] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_F11), + [TD_F12] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_F12), + [TD_AE_FITCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, LALT(KC_SLSH)), + [TD_AE_IN] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, LALT(KC_LBRC)), +[TD_AE_OUT] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, LALT(KC_RBRC)) +}; diff --git a/keyboards/tada68/keymaps/trashcat/readme.md b/keyboards/tada68/keymaps/trashcat/readme.md new file mode 100644 index 000000000..d8e37fa21 --- /dev/null +++ b/keyboards/tada68/keymaps/trashcat/readme.md @@ -0,0 +1,7 @@ +# Trashcat's Tada68 + +Just my simple layout for the Tada68. +Caps Lock behaves as LCtrl until switched to the Gaming Layer. I have a stupid reason for why I need caps lock at all but I won't get into it. +LCtrl is also LCtrl because I had no idea what else to put there. + +Tap Dance for the F Row.. i.e double tap 1 and get F1 instead. diff --git a/keyboards/tada68/keymaps/trashcat/rules.mk b/keyboards/tada68/keymaps/trashcat/rules.mk new file mode 100644 index 000000000..644b6a814 --- /dev/null +++ b/keyboards/tada68/keymaps/trashcat/rules.mk @@ -0,0 +1,21 @@ +# 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 = 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. +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Tappa Dance Bitch +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 3be81a2dafe13a9c2a591528db1b3973de923167 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Wed, 10 Jan 2018 13:15:06 -0800 Subject: [PATCH 059/556] Fix call to memset for various keyboards --- keyboards/clueboard/60/matrix.c | 62 ++++++++++++++--------------- keyboards/ergodox_infinity/matrix.c | 4 +- keyboards/infinity60/matrix.c | 4 +- keyboards/jm60/matrix.c | 4 +- keyboards/k_type/matrix.c | 4 +- keyboards/whitefox/matrix.c | 5 ++- 6 files changed, 42 insertions(+), 41 deletions(-) diff --git a/keyboards/clueboard/60/matrix.c b/keyboards/clueboard/60/matrix.c index 76a15ca7e..4023bc03c 100644 --- a/keyboards/clueboard/60/matrix.c +++ b/keyboards/clueboard/60/matrix.c @@ -11,7 +11,7 @@ /* Clueboard 60% * - * Column pins are input with internal pull-down. + * Column pins are input with internal pull-down. * Row pins are output and strobe with high. * Key is high or 1 when it turns on. * @@ -68,8 +68,8 @@ void matrix_init(void) { palSetPadMode(GPIOA, 15, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN); - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, MATRIX_COLS); + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); /* Setup capslock */ // palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL); @@ -84,20 +84,20 @@ uint8_t matrix_scan(void) { // strobe col { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC14, PC15, PC13, PB5, PB6 } switch (col) { - case 0: palSetPad(GPIOA, 2); break; - case 1: palSetPad(GPIOA, 3); break; - case 2: palSetPad(GPIOA, 6); break; - case 3: palSetPad(GPIOB, 14); break; - case 4: palSetPad(GPIOB, 15); break; - case 5: palSetPad(GPIOA, 8); break; - case 6: palSetPad(GPIOA, 9); break; - case 7: palSetPad(GPIOA, 7); break; - case 8: palSetPad(GPIOB, 3); break; - case 9: palSetPad(GPIOB, 4); break; - case 10: palSetPad(GPIOC, 15); break; - case 11: palSetPad(GPIOC, 14); break; - case 12: palSetPad(GPIOC, 13); break; - case 13: palSetPad(GPIOB, 5); break; + case 0: palSetPad(GPIOA, 2); break; + case 1: palSetPad(GPIOA, 3); break; + case 2: palSetPad(GPIOA, 6); break; + case 3: palSetPad(GPIOB, 14); break; + case 4: palSetPad(GPIOB, 15); break; + case 5: palSetPad(GPIOA, 8); break; + case 6: palSetPad(GPIOA, 9); break; + case 7: palSetPad(GPIOA, 7); break; + case 8: palSetPad(GPIOB, 3); break; + case 9: palSetPad(GPIOB, 4); break; + case 10: palSetPad(GPIOC, 15); break; + case 11: palSetPad(GPIOC, 14); break; + case 12: palSetPad(GPIOC, 13); break; + case 13: palSetPad(GPIOB, 5); break; case 14: palSetPad(GPIOB, 6); break; } @@ -115,20 +115,20 @@ uint8_t matrix_scan(void) { // unstrobe col { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC15, PC14, PC13, PB5, PB6 } switch (col) { - case 0: palClearPad(GPIOA, 2); break; - case 1: palClearPad(GPIOA, 3); break; - case 2: palClearPad(GPIOA, 6); break; - case 3: palClearPad(GPIOB, 14); break; - case 4: palClearPad(GPIOB, 15); break; - case 5: palClearPad(GPIOA, 8); break; - case 6: palClearPad(GPIOA, 9); break; - case 7: palClearPad(GPIOA, 7); break; - case 8: palClearPad(GPIOB, 3); break; - case 9: palClearPad(GPIOB, 4); break; - case 10: palClearPad(GPIOC, 15); break; - case 11: palClearPad(GPIOC, 14); break; - case 12: palClearPad(GPIOC, 13); break; - case 13: palClearPad(GPIOB, 5); break; + case 0: palClearPad(GPIOA, 2); break; + case 1: palClearPad(GPIOA, 3); break; + case 2: palClearPad(GPIOA, 6); break; + case 3: palClearPad(GPIOB, 14); break; + case 4: palClearPad(GPIOB, 15); break; + case 5: palClearPad(GPIOA, 8); break; + case 6: palClearPad(GPIOA, 9); break; + case 7: palClearPad(GPIOA, 7); break; + case 8: palClearPad(GPIOB, 3); break; + case 9: palClearPad(GPIOB, 4); break; + case 10: palClearPad(GPIOC, 15); break; + case 11: palClearPad(GPIOC, 14); break; + case 12: palClearPad(GPIOC, 13); break; + case 13: palClearPad(GPIOB, 5); break; case 14: palClearPad(GPIOB, 6); break; } diff --git a/keyboards/ergodox_infinity/matrix.c b/keyboards/ergodox_infinity/matrix.c index 3364f8c90..3baa07f58 100644 --- a/keyboards/ergodox_infinity/matrix.c +++ b/keyboards/ergodox_infinity/matrix.c @@ -62,8 +62,8 @@ void matrix_init(void) palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS); + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS * sizeof(matrix_row_t)); matrix_init_quantum(); } diff --git a/keyboards/infinity60/matrix.c b/keyboards/infinity60/matrix.c index b6ccf86c3..bf86591cc 100644 --- a/keyboards/infinity60/matrix.c +++ b/keyboards/infinity60/matrix.c @@ -60,8 +60,8 @@ void matrix_init(void) palSetPadMode(GPIOC, 5, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); #endif - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, MATRIX_ROWS); + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); matrix_init_quantum(); } diff --git a/keyboards/jm60/matrix.c b/keyboards/jm60/matrix.c index 8430a5843..01bb4a80d 100644 --- a/keyboards/jm60/matrix.c +++ b/keyboards/jm60/matrix.c @@ -49,8 +49,8 @@ void matrix_init(void) palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, MATRIX_ROWS); + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); } uint8_t matrix_scan(void) diff --git a/keyboards/k_type/matrix.c b/keyboards/k_type/matrix.c index 7f230bebb..d919bb880 100644 --- a/keyboards/k_type/matrix.c +++ b/keyboards/k_type/matrix.c @@ -42,8 +42,8 @@ void matrix_init(void) palSetPadMode(GPIOD, 1, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, 4, PAL_MODE_OUTPUT_PUSHPULL); - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, MATRIX_ROWS); + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); matrix_init_quantum(); } diff --git a/keyboards/whitefox/matrix.c b/keyboards/whitefox/matrix.c index ff334c03a..c6f2c8d62 100644 --- a/keyboards/whitefox/matrix.c +++ b/keyboards/whitefox/matrix.c @@ -47,8 +47,9 @@ void matrix_init(void) palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL); - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, MATRIX_ROWS); + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + matrix_init_quantum(); } From 6bbe2366ec3f8d5a25d12bba9fe71d683ab55a39 Mon Sep 17 00:00:00 2001 From: noisebomb44 Date: Tue, 9 Jan 2018 00:21:50 +0100 Subject: [PATCH 060/556] Update ergodone.c --- keyboards/ergodone/ergodone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/ergodone/ergodone.c b/keyboards/ergodone/ergodone.c index dd05a8def..e0579408e 100644 --- a/keyboards/ergodone/ergodone.c +++ b/keyboards/ergodone/ergodone.c @@ -12,6 +12,8 @@ extern inline void ergodox_right_led_2_off(void); extern inline void ergodox_right_led_3_off(void); extern inline void ergodox_right_led_off(uint8_t led); +extern inline void ergodox_led_all_off(void); + void ergodox_led_init(void); void ergodox_blink_all_leds(void); From 820930490432ef28431b047d989fe9c0d4b01b49 Mon Sep 17 00:00:00 2001 From: Marco Scannadinari <4211302+marcoms@users.noreply.github.com> Date: Mon, 8 Jan 2018 23:11:26 +0000 Subject: [PATCH 061/556] Reset color after submodule warning message Fixes leaking bold text --- message.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message.mk b/message.mk index f5fb751ed..1401698dd 100644 --- a/message.mk +++ b/message.mk @@ -58,7 +58,7 @@ MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\ make git-submodule\n\ You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\ - or if you have modified the ChibiOS libraries yourself. \n\n + or if you have modified the ChibiOS libraries yourself. \n\n$(NO_COLOR) MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR) define GENERATE_MSG_MAKE_KB From 4aef0318aa0259fb66492f86762f36d0b64d8905 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 12 Jan 2018 20:47:39 -0500 Subject: [PATCH 062/556] Update info.json --- keyboards/preonic/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/preonic/info.json b/keyboards/preonic/info.json index a87e5953c..67cc08632 100644 --- a/keyboards/preonic/info.json +++ b/keyboards/preonic/info.json @@ -10,7 +10,7 @@ "width": 12, "height": 5, "layouts": { - "LAYOUT_preonic_mit": { + "KEYMAP": { "key_count": 59, "layout": [ { "w": 1, "x": 0, "y": 0 }, @@ -138,4 +138,4 @@ { "w": 1, "x": 11, "y": 4 } ] } } -} \ No newline at end of file +} From fd359e23e8b46826f480d1bcf21261c3f777e2f4 Mon Sep 17 00:00:00 2001 From: manofinterests <35388320+manofinterests@users.noreply.github.com> Date: Fri, 12 Jan 2018 20:23:25 -0800 Subject: [PATCH 063/556] Update info.json --- keyboards/eagle_viper/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/eagle_viper/info.json b/keyboards/eagle_viper/info.json index 2993ffdac..45dba95bb 100644 --- a/keyboards/eagle_viper/info.json +++ b/keyboards/eagle_viper/info.json @@ -7,7 +7,7 @@ "height": 5, "layouts": { "KEYMAP": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":13, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}] + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"iso", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":5}, {"x":9, "y":4}, {"x":10, "y":4}, {"label":"Win", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"|", "x":13.75, "y":5}] } } } From 5836d1a06a7265781fa37acf13e3ba9df7224247 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sat, 13 Jan 2018 20:38:25 -0800 Subject: [PATCH 064/556] Fix up the ARM audio support (#2136) * Get audio working on clueboard/60 * add keys for music mode * Change doubles to floats * add keys for all the songs * revert to the default startup sound * Remove music mode until we can figure out why it crashes --- common_features.mk | 6 +- .../clueboard/60/keymaps/default/keymap.c | 94 +++++++- keyboards/clueboard/60/led.c | 9 +- keyboards/clueboard/60/matrix.c | 6 +- keyboards/clueboard/60/rules.mk | 2 +- quantum/audio/audio_arm.c | 1 - quantum/audio/musical_notes.h | 226 +++++++++--------- quantum/audio/song_list.h | 18 ++ 8 files changed, 230 insertions(+), 132 deletions(-) diff --git a/common_features.mk b/common_features.mk index 319834b5e..a67cf230f 100644 --- a/common_features.mk +++ b/common_features.mk @@ -34,7 +34,11 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes) OPT_DEFS += -DAUDIO_ENABLE MUSIC_ENABLE := 1 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c - SRC += $(QUANTUM_DIR)/audio/audio.c + ifeq ($(PLATFORM),AVR) + SRC += $(QUANTUM_DIR)/audio/audio.c + else + SRC += $(QUANTUM_DIR)/audio/audio_arm.c + endif SRC += $(QUANTUM_DIR)/audio/voices.c SRC += $(QUANTUM_DIR)/audio/luts.c endif diff --git a/keyboards/clueboard/60/keymaps/default/keymap.c b/keyboards/clueboard/60/keymaps/default/keymap.c index 1b0c71264..8397c4bbf 100644 --- a/keyboards/clueboard/60/keymaps/default/keymap.c +++ b/keyboards/clueboard/60/keymaps/default/keymap.c @@ -3,11 +3,35 @@ #define _______ KC_TRNS enum keyboard_layers { - _BL, - _FL, - _CL + _BL, + _FL, + _CL }; +enum custom_keycodes { + S_BSKTC = SAFE_RANGE, + S_ODEJY, + S_RCKBY, + S_DOEDR, + S_SCALE, + S_ONEUP, + S_COIN, + S_SONIC, + S_ZELDA +}; + +#ifdef AUDIO_ENABLE + float song_basketcase[][2] = SONG(BASKET_CASE); + float song_ode_to_joy[][2] = SONG(ODE_TO_JOY); + float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY); + float song_doe_a_deer[][2] = SONG(DOE_A_DEER); + float song_scale[][2] = SONG(MUSIC_SCALE_SOUND); + float song_coin[][2] = SONG(COIN_SOUND); + float song_one_up[][2] = SONG(ONE_UP_SOUND); + float song_sonic_ring[][2] = SONG(SONIC_RING); + float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE); +#endif + const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------. @@ -33,11 +57,71 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FL), _______), + _______,_______,_______, _______, _______, _______, MO(_FL), _______), [_CL] = KEYMAP( - BL_STEP,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + BL_STEP,S_BSKTC,S_ODEJY,S_RCKBY,S_DOEDR,S_SCALE,S_ONEUP,S_COIN, S_SONIC,S_ZELDA,_______,_______,_______,_______,_______,\ _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______, _______, _______, _______, _______, MO(_FL), _______) }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case S_BSKTC: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_basketcase); + } + return false; + case S_ODEJY: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_ode_to_joy); + } + return false; + case S_RCKBY: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_rock_a_bye_baby); + } + return false; + case S_DOEDR: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_doe_a_deer); + } + return false; + case S_SCALE: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_scale); + } + return false; + case S_ONEUP: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_one_up); + } + return false; + case S_COIN: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_coin); + } + return false; + case S_SONIC: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_sonic_ring); + } + return false; + case S_ZELDA: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_zelda_puzzle); + } + return false; + } + return true; +} diff --git a/keyboards/clueboard/60/led.c b/keyboards/clueboard/60/led.c index fdf244ad5..350696736 100644 --- a/keyboards/clueboard/60/led.c +++ b/keyboards/clueboard/60/led.c @@ -23,7 +23,7 @@ void backlight_init_ports(void) { printf("backlight_init_ports()\n"); #ifdef BACKLIGHT_ENABLE - palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL); palSetPad(GPIOB, 8); #endif } @@ -41,13 +41,8 @@ void backlight_set(uint8_t level) { #endif } -void led_init_ports() { - printf("led_init_ports()\n"); - palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL); -} - void led_set_kb(uint8_t usb_led) { - printf("led_init_ports()\n"); + printf("led_set_kb(%d)\n", usb_led); if (usb_led & (1< DEBOUNCE) { for (int row = 0; row < MATRIX_ROWS; row++) { matrix[row] = 0; diff --git a/keyboards/clueboard/60/rules.mk b/keyboards/clueboard/60/rules.mk index 01b7dad9b..93e6019a4 100644 --- a/keyboards/clueboard/60/rules.mk +++ b/keyboards/clueboard/60/rules.mk @@ -50,5 +50,5 @@ COMMAND_ENABLE = yes # Commands for debug and configuration #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover CUSTOM_MATRIX = yes # Custom matrix file -#AUDIO_ENABLE = yes +AUDIO_ENABLE = yes # SERIAL_LINK_ENABLE = yes diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c index 5ad0c86ec..43c8d67c4 100644 --- a/quantum/audio/audio_arm.c +++ b/quantum/audio/audio_arm.c @@ -18,7 +18,6 @@ #include "ch.h" #include "hal.h" -#include #include #include "print.h" #include "keymap.h" diff --git a/quantum/audio/musical_notes.h b/quantum/audio/musical_notes.h index 647b69564..065608ccc 100644 --- a/quantum/audio/musical_notes.h +++ b/quantum/audio/musical_notes.h @@ -53,127 +53,127 @@ // Note Timbre // Changes how the notes sound -#define TIMBRE_12 0.125 -#define TIMBRE_25 0.250 -#define TIMBRE_50 0.500 -#define TIMBRE_75 0.750 +#define TIMBRE_12 0.125f +#define TIMBRE_25 0.250f +#define TIMBRE_50 0.500f +#define TIMBRE_75 0.750f #define TIMBRE_DEFAULT TIMBRE_50 // Notes - # = Octave -#define NOTE_REST 0.00 +#define NOTE_REST 0.00f /* These notes are currently bugged -#define NOTE_C0 16.35 -#define NOTE_CS0 17.32 -#define NOTE_D0 18.35 -#define NOTE_DS0 19.45 -#define NOTE_E0 20.60 -#define NOTE_F0 21.83 -#define NOTE_FS0 23.12 -#define NOTE_G0 24.50 -#define NOTE_GS0 25.96 -#define NOTE_A0 27.50 -#define NOTE_AS0 29.14 -#define NOTE_B0 30.87 -#define NOTE_C1 32.70 -#define NOTE_CS1 34.65 -#define NOTE_D1 36.71 -#define NOTE_DS1 38.89 -#define NOTE_E1 41.20 -#define NOTE_F1 43.65 -#define NOTE_FS1 46.25 -#define NOTE_G1 49.00 -#define NOTE_GS1 51.91 -#define NOTE_A1 55.00 -#define NOTE_AS1 58.27 +#define NOTE_C0 16.35f +#define NOTE_CS0 17.32f +#define NOTE_D0 18.35f +#define NOTE_DS0 19.45f +#define NOTE_E0 20.60f +#define NOTE_F0 21.83f +#define NOTE_FS0 23.12f +#define NOTE_G0 24.50f +#define NOTE_GS0 25.96f +#define NOTE_A0 27.50f +#define NOTE_AS0 29.14f +#define NOTE_B0 30.87f +#define NOTE_C1 32.70f +#define NOTE_CS1 34.65f +#define NOTE_D1 36.71f +#define NOTE_DS1 38.89f +#define NOTE_E1 41.20f +#define NOTE_F1 43.65f +#define NOTE_FS1 46.25f +#define NOTE_G1 49.00f +#define NOTE_GS1 51.91f +#define NOTE_A1 55.00f +#define NOTE_AS1 58.27f */ -#define NOTE_B1 61.74 -#define NOTE_C2 65.41 -#define NOTE_CS2 69.30 -#define NOTE_D2 73.42 -#define NOTE_DS2 77.78 -#define NOTE_E2 82.41 -#define NOTE_F2 87.31 -#define NOTE_FS2 92.50 -#define NOTE_G2 98.00 -#define NOTE_GS2 103.83 -#define NOTE_A2 110.00 -#define NOTE_AS2 116.54 -#define NOTE_B2 123.47 -#define NOTE_C3 130.81 -#define NOTE_CS3 138.59 -#define NOTE_D3 146.83 -#define NOTE_DS3 155.56 -#define NOTE_E3 164.81 -#define NOTE_F3 174.61 -#define NOTE_FS3 185.00 -#define NOTE_G3 196.00 -#define NOTE_GS3 207.65 -#define NOTE_A3 220.00 -#define NOTE_AS3 233.08 -#define NOTE_B3 246.94 -#define NOTE_C4 261.63 -#define NOTE_CS4 277.18 -#define NOTE_D4 293.66 -#define NOTE_DS4 311.13 -#define NOTE_E4 329.63 -#define NOTE_F4 349.23 -#define NOTE_FS4 369.99 -#define NOTE_G4 392.00 -#define NOTE_GS4 415.30 -#define NOTE_A4 440.00 -#define NOTE_AS4 466.16 -#define NOTE_B4 493.88 -#define NOTE_C5 523.25 -#define NOTE_CS5 554.37 -#define NOTE_D5 587.33 -#define NOTE_DS5 622.25 -#define NOTE_E5 659.26 -#define NOTE_F5 698.46 -#define NOTE_FS5 739.99 -#define NOTE_G5 783.99 -#define NOTE_GS5 830.61 -#define NOTE_A5 880.00 -#define NOTE_AS5 932.33 -#define NOTE_B5 987.77 -#define NOTE_C6 1046.50 -#define NOTE_CS6 1108.73 -#define NOTE_D6 1174.66 -#define NOTE_DS6 1244.51 -#define NOTE_E6 1318.51 -#define NOTE_F6 1396.91 -#define NOTE_FS6 1479.98 -#define NOTE_G6 1567.98 -#define NOTE_GS6 1661.22 -#define NOTE_A6 1760.00 -#define NOTE_AS6 1864.66 -#define NOTE_B6 1975.53 -#define NOTE_C7 2093.00 -#define NOTE_CS7 2217.46 -#define NOTE_D7 2349.32 -#define NOTE_DS7 2489.02 -#define NOTE_E7 2637.02 -#define NOTE_F7 2793.83 -#define NOTE_FS7 2959.96 -#define NOTE_G7 3135.96 -#define NOTE_GS7 3322.44 -#define NOTE_A7 3520.00 -#define NOTE_AS7 3729.31 -#define NOTE_B7 3951.07 -#define NOTE_C8 4186.01 -#define NOTE_CS8 4434.92 -#define NOTE_D8 4698.64 -#define NOTE_DS8 4978.03 -#define NOTE_E8 5274.04 -#define NOTE_F8 5587.65 -#define NOTE_FS8 5919.91 -#define NOTE_G8 6271.93 -#define NOTE_GS8 6644.88 -#define NOTE_A8 7040.00 -#define NOTE_AS8 7458.62 -#define NOTE_B8 7902.13 +#define NOTE_B1 61.74f +#define NOTE_C2 65.41f +#define NOTE_CS2 69.30f +#define NOTE_D2 73.42f +#define NOTE_DS2 77.78f +#define NOTE_E2 82.41f +#define NOTE_F2 87.31f +#define NOTE_FS2 92.50f +#define NOTE_G2 98.00f +#define NOTE_GS2 103.83f +#define NOTE_A2 110.00f +#define NOTE_AS2 116.54f +#define NOTE_B2 123.47f +#define NOTE_C3 130.81f +#define NOTE_CS3 138.59f +#define NOTE_D3 146.83f +#define NOTE_DS3 155.56f +#define NOTE_E3 164.81f +#define NOTE_F3 174.61f +#define NOTE_FS3 185.00f +#define NOTE_G3 196.00f +#define NOTE_GS3 207.65f +#define NOTE_A3 220.00f +#define NOTE_AS3 233.08f +#define NOTE_B3 246.94f +#define NOTE_C4 261.63f +#define NOTE_CS4 277.18f +#define NOTE_D4 293.66f +#define NOTE_DS4 311.13f +#define NOTE_E4 329.63f +#define NOTE_F4 349.23f +#define NOTE_FS4 369.99f +#define NOTE_G4 392.00f +#define NOTE_GS4 415.30f +#define NOTE_A4 440.00f +#define NOTE_AS4 466.16f +#define NOTE_B4 493.88f +#define NOTE_C5 523.25f +#define NOTE_CS5 554.37f +#define NOTE_D5 587.33f +#define NOTE_DS5 622.25f +#define NOTE_E5 659.26f +#define NOTE_F5 698.46f +#define NOTE_FS5 739.99f +#define NOTE_G5 783.99f +#define NOTE_GS5 830.61f +#define NOTE_A5 880.00f +#define NOTE_AS5 932.33f +#define NOTE_B5 987.77f +#define NOTE_C6 1046.50f +#define NOTE_CS6 1108.73f +#define NOTE_D6 1174.66f +#define NOTE_DS6 1244.51f +#define NOTE_E6 1318.51f +#define NOTE_F6 1396.91f +#define NOTE_FS6 1479.98f +#define NOTE_G6 1567.98f +#define NOTE_GS6 1661.22f +#define NOTE_A6 1760.00f +#define NOTE_AS6 1864.66f +#define NOTE_B6 1975.53f +#define NOTE_C7 2093.00f +#define NOTE_CS7 2217.46f +#define NOTE_D7 2349.32f +#define NOTE_DS7 2489.02f +#define NOTE_E7 2637.02f +#define NOTE_F7 2793.83f +#define NOTE_FS7 2959.96f +#define NOTE_G7 3135.96f +#define NOTE_GS7 3322.44f +#define NOTE_A7 3520.00f +#define NOTE_AS7 3729.31f +#define NOTE_B7 3951.07f +#define NOTE_C8 4186.01f +#define NOTE_CS8 4434.92f +#define NOTE_D8 4698.64f +#define NOTE_DS8 4978.03f +#define NOTE_E8 5274.04f +#define NOTE_F8 5587.65f +#define NOTE_FS8 5919.91f +#define NOTE_G8 6271.93f +#define NOTE_GS8 6644.88f +#define NOTE_A8 7040.00f +#define NOTE_AS8 7458.62f +#define NOTE_B8 7902.13f // Flat Aliases #define NOTE_DF0 NOTE_CS0 diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 091f59e7a..4018f817c 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -53,6 +53,24 @@ E__NOTE(_CS4), E__NOTE(_B4), QD_NOTE(_AS4), \ E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), +#define CLUEBOARD_SOUND \ + HD_NOTE(_C3), HD_NOTE(_D3), HD_NOTE(_E3), HD_NOTE(_F3), HD_NOTE(_G3), HD_NOTE(_A4), HD_NOTE(_B4), HD_NOTE(_C4) +/* + HD_NOTE(_G3), HD_NOTE(_E3), HD_NOTE(_C3), \ + Q__NOTE(_E3), Q__NOTE(_C3), Q__NOTE(_G3), \ + Q__NOTE(_E3) +*/ +/* + HD_NOTE(_C3), HD_NOTE(_G3), HD_NOTE(_E3), \ + Q__NOTE(_G3), Q__NOTE(_E3), Q__NOTE(_G3), \ + Q__NOTE(_F3) +*/ + +#define BASKET_CASE \ + QD_NOTE(_G3), E__NOTE(_F3), E__NOTE(_E3), Q__NOTE(_F3), M__NOTE(_G3, 8+32), Q__NOTE(_REST), \ + Q__NOTE(_B4), Q__NOTE(_C4), Q__NOTE(_B4), E__NOTE(_A4), Q__NOTE(_G3), M__NOTE(_G3, 8+32), Q__NOTE(_REST), \ + Q__NOTE(_B4), Q__NOTE(_C4), Q__NOTE(_B4), E__NOTE(_A4), Q__NOTE(_G3), Q__NOTE(_G3), Q__NOTE(_G3), Q__NOTE(_G3), E__NOTE(_A4), E__NOTE(_C4), QD_NOTE(_B4), HD_NOTE(_B4) + #define STARTUP_SOUND \ E__NOTE(_E6), \ E__NOTE(_A6), \ From ccaacde4d663f50b04fcd67d1477db7e0bd46091 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 17 Jan 2018 11:28:23 -0800 Subject: [PATCH 065/556] Update to drashna keymaps (#2281) * Move faux clicky into userspace * Get Audio and RGB enabled on Orthodox-rev1 * Add faux click to userspace * Add Orthodox Rev3 check to macros * Hack Orthodox Name for drashna keymap * No more One Shots * Ergodox product name hack * Enable Audio on Orthodox by default --- keyboards/ergodox_ez/keymaps/drashna/config.h | 3 ++ keyboards/ergodox_ez/keymaps/drashna/keymap.c | 8 ++--- keyboards/orthodox/keymaps/drashna/config.h | 8 ++++- keyboards/orthodox/keymaps/drashna/keymap.c | 22 +++--------- keyboards/orthodox/keymaps/drashna/rules.mk | 10 ++++-- users/drashna/drashna.c | 35 +++++++++++++++---- users/drashna/drashna.h | 9 +++++ 7 files changed, 63 insertions(+), 32 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/drashna/config.h b/keyboards/ergodox_ez/keymaps/drashna/config.h index c0286f16a..2f5422b14 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/config.h +++ b/keyboards/ergodox_ez/keymaps/drashna/config.h @@ -20,4 +20,7 @@ #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) #define ONESHOT_TAP_TOGGLE 2 +#undef PRODUCT +#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine + #endif diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index c7939de37..0d0e1fba2 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(_DIABLO), KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G, - OSM(MOD_LSFT), LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), + KC_LSFT, LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), LT(_SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET, ALT_T(KC_APPLICATION), KC_LGUI, @@ -96,7 +96,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(_DIABLO), KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), + KC_LSFT, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, ALT_T(KC_APP), KC_LGUI, KC_HOME, @@ -139,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(_DIABLO), KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - OSM(MOD_LSFT), LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD), + KC_LSFT, LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD), LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET, ALT_T(KC_APP), KC_LEAD, KC_HOME, @@ -182,7 +182,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(_DIABLO), KC_BSPC, KC_A, KC_S, KC_H, KC_T, KC_G, - OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD), + KC_LSFT, LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD), LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, ALT_T(KC_APP), KC_LEAD, KC_HOME, diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index f39c34e76..d83b77927 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -27,7 +27,7 @@ along with this program. If not, see . /* Use I2C or Serial, not both */ #define USE_SERIAL -// #define USE_I2C +#undef USE_I2C /* Select hand configuration */ @@ -71,4 +71,10 @@ along with this program. If not, see . #define STARTUP_SONG SONG(ZELDA_TREASURE) #endif +#undef PRODUCT +#ifdef KEYBOARD_orthodox_rev1 +#define PRODUCT Drashna Hacked Orthodox Rev.1 +#elif KEYBOARD_orthodox_rev3 +#define PRODUCT Drashna Hacked Orthodox Rev.3 +#endif #endif diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index af235f55d..f74b39ae4 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -32,42 +32,30 @@ along with this program. If not, see . #define _______ KC_TRNS #define XXXXXXX KC_NO -#ifdef FAUXCLICKY_ENABLE -float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A6, 2); // (_D4, 0.25); -float fauxclicky_released_note[2] = MUSICAL_NOTE(_A6, 2); // (_C4, 0.125); -float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 2); // (_C4, 0.25); -#define AUD_ON FC_ON -#define AUD_OFF FC_OFF -#else -#define AUD_ON AU_ON -#define AUD_OFF AU_OFF - -#endif - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = KEYMAP(\ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - OSM(MOD_LSFT),CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ + KC_LSFT,CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ ), [_COLEMAK] = KEYMAP(\ KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ ), [_DVORAK] = KEYMAP(\ KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - OSM(MOD_LSFT), CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ + KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ ), [_WORKMAN] = KEYMAP(\ KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - OSM(MOD_LSFT), CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ + KC_LSFT,CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ ), [_LOWER] = KEYMAP(\ @@ -84,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = KEYMAP(\ KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - RGB_SMOD,RGB_HUI, _______, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ + RGB_SMOD,RGB_HUI, KC_FXCL, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ ) diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index 53a44424b..c4cf6629c 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -1,7 +1,11 @@ -CONSOLE_ENABLE = no +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = no -MOUSEKEY_ENABLE = no +AUDIO_ENABLE = yes NKRO_ENABLE = yes FAUXCLICKY_ENABLE = no +USE_I2C = no diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 2ac0257b5..a07d74407 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -30,6 +30,15 @@ PROGMEM const char secret[][64] = { }; #endif +#ifdef FAUXCLICKY_ENABLE +float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A6, 2); // (_D4, 0.25); +float fauxclicky_released_note[2] = MUSICAL_NOTE(_A6, 2); // (_C4, 0.125); +#else +float fauxclicky_pressed[][2] = SONG(E__NOTE(_A6)); // change to your tastes +float fauxclicky_released[][2] = SONG(E__NOTE(_A6)); // change to your tastes +#endif +bool faux_click_enabled = true; + #ifdef TAP_DANCE_ENABLE //define diablo macro timer variables static uint16_t diablo_timer[4]; @@ -222,11 +231,22 @@ void persistent_default_layer_set(uint16_t default_layer) { // Defines actions tor my global custom keycodes. Defined in drashna.h file // Then runs the _keymap's recod handier if not processed here bool process_record_user(uint16_t keycode, keyrecord_t *record) { - + #ifdef CONSOLE_ENABLE xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); #endif +#ifdef AUDIO_ENABLE + if (faux_click_enabled) { + if (record->event.pressed) { + PLAY_SONG(fauxclicky_pressed); + } else { + stop_note(NOTE_A6); + PLAY_SONG(fauxclicky_released); + } + } +#endif + switch (keycode) { case KC_QWERTY: if (record->event.pressed) { @@ -295,7 +315,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; -#if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_ergodox_ez)) +#if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_orthodox_rev3) || defined(KEYBOARD_ergodox_ez)) case KC_OVERWATCH: if (record->event.pressed) { is_overwatch = !is_overwatch; @@ -460,11 +480,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { " AUDIO_ENABLE=yes" #else " AUDIO_ENABLE=no" -#endif -#ifdef FAUXCLICKY_ENABLE - " FAUXCLICKY_ENABLE=yes" -#else - " FAUXCLICKY_ENABLE=no" #endif SS_TAP(X_ENTER)); } @@ -499,6 +514,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case KC_FXCL: + if (!record->event.pressed) { + faux_click_enabled = !faux_click_enabled; + } + return false; + break; case KC_RGB_T: // Because I want the option to go back to normal RGB mode rather than always layer indication #ifdef RGBLIGHT_ENABLE if (record->event.pressed) { diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 2475c99d4..aa9c83086 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -101,6 +101,7 @@ enum userspace_custom_keycodes { KC_SECRET_3, KC_SECRET_4, KC_SECRET_5, + KC_FXCL, NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes }; @@ -133,4 +134,12 @@ enum { #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#ifdef FAUXCLICKY_ENABLE +#define AUD_ON FC_ON +#define AUD_OFF FC_OFF +#else +#define AUD_ON AU_ON +#define AUD_OFF AU_OFF +#endif + #endif From c776c1ce82b5323011d73f6dc958d8e48c721ba7 Mon Sep 17 00:00:00 2001 From: stephengrier Date: Wed, 17 Jan 2018 19:44:12 +0000 Subject: [PATCH 066/556] Adding stephengrier keymap for the tada68 keyboard. (#2269) --- .../tada68/keymaps/stephengrier/config.h | 3 ++ .../tada68/keymaps/stephengrier/keymap.c | 52 +++++++++++++++++++ .../tada68/keymaps/stephengrier/readme.md | 15 ++++++ .../tada68/keymaps/stephengrier/rules.mk | 21 ++++++++ 4 files changed, 91 insertions(+) create mode 100755 keyboards/tada68/keymaps/stephengrier/config.h create mode 100755 keyboards/tada68/keymaps/stephengrier/keymap.c create mode 100755 keyboards/tada68/keymaps/stephengrier/readme.md create mode 100644 keyboards/tada68/keymaps/stephengrier/rules.mk diff --git a/keyboards/tada68/keymaps/stephengrier/config.h b/keyboards/tada68/keymaps/stephengrier/config.h new file mode 100755 index 000000000..56c5996d2 --- /dev/null +++ b/keyboards/tada68/keymaps/stephengrier/config.h @@ -0,0 +1,3 @@ +#include "../../config.h" + +#define BACKLIGHT_BREATHING diff --git a/keyboards/tada68/keymaps/stephengrier/keymap.c b/keyboards/tada68/keymaps/stephengrier/keymap.c new file mode 100755 index 000000000..ee9054e01 --- /dev/null +++ b/keyboards/tada68/keymaps/stephengrier/keymap.c @@ -0,0 +1,52 @@ +#include "tada68.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |FN | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = KEYMAP_ANSI( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS,KC_DEL, \ + MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,KC_UP,KC_PGDN, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RALT,MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * | | |Up | | | | | |UP | | | | | |Hme | + * |----------------------------------------------------------------| + * | |<- |Dn | ->| | | |<- |Dn | ->| | | |End | + * |----------------------------------------------------------------| + * | | |BR |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |MsL|MsD|MsR | + * `----------------------------------------------------------------' + */ +[_FL] = KEYMAP_ANSI( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS , \ + _______,_______, KC_UP,_______,_______, _______,_______,_______, KC_UP,_______,_______,_______,_______, _______,KC_HOME, \ + _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______, _______,KC_END, \ + _______,_______,BL_BRTG,BL_DEC, BL_TOGG,BL_INC, _______,KC_VOLD,KC_VOLU,KC_MUTE,_______,KC_BTN1, KC_MS_U, KC_BTN2, \ + _______,_______,_______, _______, _______,_______,_______,KC_MS_L,KC_MS_D, KC_MS_R), +}; diff --git a/keyboards/tada68/keymaps/stephengrier/readme.md b/keyboards/tada68/keymaps/stephengrier/readme.md new file mode 100755 index 000000000..f10f4ebdc --- /dev/null +++ b/keyboards/tada68/keymaps/stephengrier/readme.md @@ -0,0 +1,15 @@ +# stephengrier's TADA68 layout + +This layout mostly replicates the default ANSI layout of the TADA68 but with a +few modifications to suit my tastes. + +The modifications from the default keymap are: + +* Replaced capslock with a second function key +* Swapped the left ALT and Win keys to be more like the Mac layout +* Added an arrow key cluster on the IJKL keys +* Fn+x toggles backlight breathing mode + +With this keymap backlight breathing mode can be enabled/disabled with Fn+x. +This is not supported at all in the default keymap. + diff --git a/keyboards/tada68/keymaps/stephengrier/rules.mk b/keyboards/tada68/keymaps/stephengrier/rules.mk new file mode 100644 index 000000000..2a7ff2779 --- /dev/null +++ b/keyboards/tada68/keymaps/stephengrier/rules.mk @@ -0,0 +1,21 @@ +# 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 = 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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 5b22ddf5262af8860373ce7a3847f912d5947071 Mon Sep 17 00:00:00 2001 From: amanda flagg Date: Wed, 17 Jan 2018 15:13:52 -0800 Subject: [PATCH 067/556] add dz60 map with arrow keys (#2270) --- .../dz60/keymaps/60_plus_arrows/keymap.c | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 keyboards/dz60/keymaps/60_plus_arrows/keymap.c diff --git a/keyboards/dz60/keymaps/60_plus_arrows/keymap.c b/keyboards/dz60/keymaps/60_plus_arrows/keymap.c new file mode 100644 index 000000000..6b857e3f8 --- /dev/null +++ b/keyboards/dz60/keymaps/60_plus_arrows/keymap.c @@ -0,0 +1,86 @@ +#include "dz60.h" + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | FN | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Cmd | RAlt | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + KEYMAP_2_SHIFTS( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, ______, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, ______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT + ), + +/* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | BL- | BL+ | BL | | | |RESET| | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | |RBGM | | | | | | | | | | Val+ | Val- |RBGTOG| + * |-----------------------------------------------------------------------------------------+ + * | | Hue+| Hue-| Sat+| Sat-| | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | Ctrl| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + + KEYMAP_DIRECTIONAL( + KC_ESC, BL_TOGG, BL_STEP, BL_DEC, BL_INC, ______, ______, RESET, ______, ______, ______, ______, ______, ______, ______, + ______, RGB_MOD, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_VAI, RGB_VAD, RGB_TOG, + ______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_RCTL, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ + ), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} \ No newline at end of file From 365b86357825ebed7012377a5684269760326fd2 Mon Sep 17 00:00:00 2001 From: Kenneth Aloysius Date: Fri, 19 Jan 2018 08:02:32 +1100 Subject: [PATCH 068/556] Backlighting for JJ40 and underglow initialisation code (#2260) * Cleanup Mechmini keymap. Once the custom RGB function is defined, there is no need to manually handle RGB code. * Change default to KEYMAP_MIT, not KEYMAP_OFFSET * Add custom RGB code for JJ40 * Reset Mechmini advertised power draw to 500. Will have to test actual maximum power draw later. * RGB working on JJ40. * Fix: saturation increase/decrease flipped * Add new directory for my custom keymap with RGB keycodes * Swap LAlt and LGUI * Update JJ40 max power draw with measured value * Update: fun40 rules.mk to enable underglow; earlier failed Travis CI * Fix: init RGB LEDs on boot. Also added HHKB-like keymap for XD60. * Super rudimentary backlight test, init RGB LEDs on boot * Backlighting works - stays on for now * Toggling working * Now can override backlight.c functions. Problem was functions in backlight.c weren't called before due to a lack of matrix_scan_quantum() in matrix.c * Timers not working * Delete global.h * Cleanup * Compiles * Good sign: LEDs stop working again * Handle timer1 overflow * Progress: fix: forgot to init * Backlighting fully working now except breathing. * Revert keymap to original keycodes * Update XD60 keymap README * Update JJ40 keymap with backlight toggles * Breathing working just fine. * Update references * Add backlight_set() call * Cleanup code to disable backlight * Fix: does not compile * Fix: missing call to rgblight_task. * Testing with BACKLIGHT_BREATHING * Cleanup * Cleanup comments * More commenting cleanup. * Do not enable BACKLIGHT_BREATHING by default --- common_features.mk | 3 + keyboards/jj40/backlight.c | 212 ++++++++++++++++++++ keyboards/jj40/backlight_custom.h | 15 ++ keyboards/jj40/breathing_custom.h | 140 +++++++++++++ keyboards/jj40/config.h | 6 +- keyboards/jj40/jj40.c | 42 +++- keyboards/jj40/jj40.h | 2 + keyboards/jj40/keymaps/default/keymap.c | 17 -- keyboards/jj40/keymaps/krusli/config.h | 8 + keyboards/jj40/keymaps/krusli/keymap.c | 23 +-- keyboards/jj40/matrix.c | 36 ++-- keyboards/jj40/rules.mk | 8 +- keyboards/jj40/usbconfig.h | 2 +- keyboards/xd60/keymaps/krusli/HHKB-like.txt | 0 keyboards/xd60/keymaps/krusli/keymap.c | 62 ++++++ keyboards/xd60/keymaps/krusli/readme.md | 2 + quantum/quantum.c | 12 +- tmk_core/common/backlight.c | 2 +- 18 files changed, 528 insertions(+), 64 deletions(-) create mode 100644 keyboards/jj40/backlight.c create mode 100644 keyboards/jj40/backlight_custom.h create mode 100644 keyboards/jj40/breathing_custom.h create mode 100644 keyboards/jj40/keymaps/krusli/config.h create mode 100644 keyboards/xd60/keymaps/krusli/HHKB-like.txt create mode 100644 keyboards/xd60/keymaps/krusli/keymap.c create mode 100644 keyboards/xd60/keymaps/krusli/readme.md diff --git a/common_features.mk b/common_features.mk index a67cf230f..1c0b3546a 100644 --- a/common_features.mk +++ b/common_features.mk @@ -155,6 +155,9 @@ endif ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) ifeq ($(strip $(VISUALIZER_ENABLE)), yes) CIE1931_CURVE = yes + endif + ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) + OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER endif endif diff --git a/keyboards/jj40/backlight.c b/keyboards/jj40/backlight.c new file mode 100644 index 000000000..079c410ff --- /dev/null +++ b/keyboards/jj40/backlight.c @@ -0,0 +1,212 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#include "backlight.h" +#include "quantum.h" + +#include +#include + +#include "backlight_custom.h" +#include "breathing_custom.h" + +// DEBUG +#include +#include + +// Port D: digital pins of the AVR chipset +#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) +#define CAPSLOCK_PORT (1 << 2) // 2nd pin +#define BACKLIGHT_PORT (1 << 4) // 4th pin +#define SCROLLLOCK_PORT (1 << 6) // 6th pin + +#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 +#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default + +#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask + +#define PWM_MAX 0xFF +#define TIMER_TOP 255 // 8 bit PWM + +extern backlight_config_t backlight_config; + +/** + * References + * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation + * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b + * Timers: http://www.avrbeginners.net/architecture/timers/timers.html + * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ + * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware + */ + +// @Override +// turn LEDs on and off depending on USB caps/num/scroll lock states. +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + // turn on + DDRD |= NUMLOCK_PORT; + PORTD |= NUMLOCK_PORT; + } else { + // turn off + DDRD &= ~NUMLOCK_PORT; + PORTD &= ~NUMLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= CAPSLOCK_PORT; + PORTD |= CAPSLOCK_PORT; + } else { + DDRD &= ~CAPSLOCK_PORT; + PORTD &= ~CAPSLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRD |= SCROLLLOCK_PORT; + PORTD |= SCROLLLOCK_PORT; + } else { + DDRD &= ~SCROLLLOCK_PORT; + PORTD &= ~SCROLLLOCK_PORT; + } +} + +#ifdef BACKLIGHT_ENABLE + +// sets up Timer 1 for 8-bit PWM +void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE + // default 8 bit mode + TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH + TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW + + // clear output compare value A + // outb(OCR1AH, 0); + // outb(OCR1AL, 0); + + // clear output comparator registers for B + OCR1BH = 0; // outb(OCR1BH, 0); + OCR1BL = 0; // outb(OCR1BL, 0); +} + +bool is_init = false; +void timer1Init(void) { + // timer1SetPrescaler(TIMER1PRESCALE) + // set to DIV/64 + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE; + + // reset TCNT1 + TCNT1H = 0; // outb(TCNT1H, 0); + TCNT1L = 0; // outb(TCNT1L, 0); + + // TOIE1: Timer Overflow Interrupt Enable (Timer 1); + TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1); + + is_init = true; +} + +void timer1UnInit(void) { + // set prescaler back to NONE + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP + + // disable timer overflow interrupt + TIMSK &= ~_BV(TOIE1); // overflow bit? + + setPWM(0); + + is_init = false; +} + + +// handle TCNT1 overflow +//! Interrupt handler for tcnt1 overflow interrupt +ISR(TIMER1_OVF_vect, ISR_NOBLOCK) +{ + // sei(); + // handle breathing here + #ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + custom_breathing_handler(); + } + #endif + + // TODO call user defined function +} + +// enable timer 1 PWM +// timer1PWMBOn() +void timer1PWMBEnable(void) { + // turn on channel B (OC1B) PWM output + // set OC1B as non-inverted PWM + TCCR1A |= _BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +// disable timer 1 PWM +// timer1PWMBOff() +void timer1PWMBDisable(void) { + TCCR1A &= ~_BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +void enableBacklight(void) { + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high +} + +void disableBacklight(void) { + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low +} + +void startPWM(void) { + timer1Init(); + timer1PWMBEnable(); + enableBacklight(); +} + +void stopPWM(void) { + timer1UnInit(); + disableBacklight(); + timer1PWMBDisable(); +} + +void b_led_init_ports(void) { + /* turn backlight on/off depending on user preference */ + #if BACKLIGHT_ON_STATE == 0 + // DDRx register: sets the direction of Port D + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low + #else + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high + #endif + + timer1PWMSetup(); + startPWM(); + + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} + +void b_led_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) { + level = BACKLIGHT_LEVELS; + } + + setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS)); +} + +// called every matrix scan +void b_led_task(void) { + // do nothing for now +} + +void setPWM(uint16_t xValue) { + if (xValue > TIMER_TOP) { + xValue = TIMER_TOP; + } + OCR1B = xValue; // timer1PWMBSet(xValue); +} + +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/jj40/backlight_custom.h b/keyboards/jj40/backlight_custom.h new file mode 100644 index 000000000..7210be840 --- /dev/null +++ b/keyboards/jj40/backlight_custom.h @@ -0,0 +1,15 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifndef BACKLIGHT_CUSTOM_H +#define BACKLIGHT_CUSTOM_H + +#include +void b_led_init_ports(void); +void b_led_set(uint8_t level); +void b_led_task(void); +void setPWM(uint16_t xValue); + +#endif // BACKLIGHT_CUSTOM_H diff --git a/keyboards/jj40/breathing_custom.h b/keyboards/jj40/breathing_custom.h new file mode 100644 index 000000000..71416b1b4 --- /dev/null +++ b/keyboards/jj40/breathing_custom.h @@ -0,0 +1,140 @@ +/** + * Breathing effect code for PS2AVRGB boards (ATMEGA32A) + * Works in conjunction with `backlight.c`. + * + * Code adapted from `quantum.c` to register with the existing TIMER1 overflow + * handler in `backlight.c` instead of setting up its own timer. + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifdef BACKLIGHT_ENABLE +#ifdef BACKLIGHT_BREATHING + +#include "backlight_custom.h" + +#ifndef BREATHING_PERIOD +#define BREATHING_PERIOD 6 +#endif + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) + +// TODO make this share code with quantum.c + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + +void breathing_enable(void) { + breathing = true; + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + // interrupt already registered +} + +void breathing_pulse(void) { + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + // breathing_interrupt_enable(); + breathing = true; +} + +void breathing_disable(void) { + breathing = false; + // backlight_set(get_backlight_level()); + b_led_set(get_backlight_level()); // custom implementation of backlight_set() +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()) + breathing_disable(); + else + breathing_enable(); +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +void custom_breathing_handler(void) { + uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 244); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + // breathing_interrupt_disable(); + } + + setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U))); +} + +#endif // BACKLIGHT_BREATHING +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/jj40/config.h b/keyboards/jj40/config.h index 3152f22be..7fac1ed5b 100644 --- a/keyboards/jj40/config.h +++ b/keyboards/jj40/config.h @@ -34,8 +34,8 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_LEVELS 12 +// #define BACKLIGHT_BREATHING // works, but BL_TOGG might not work #define TAPPING_TOGGLE 3 @@ -45,7 +45,7 @@ along with this program. If not, see . // The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. // The same pin is used on the JJ40, at least. #define RGBLED_NUM 5 -#define RGB_DI_PIN E2 +#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. #define RGBLIGHT_ANIMATIONS /* key combination for command */ diff --git a/keyboards/jj40/jj40.c b/keyboards/jj40/jj40.c index 6044e83fd..9c1775d6a 100644 --- a/keyboards/jj40/jj40.c +++ b/keyboards/jj40/jj40.c @@ -1,5 +1,6 @@ /* Copyright 2017 Luiz Ribeiro +Modified 2018 Kenneth A. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,8 +25,34 @@ along with this program. If not, see . #include "i2c.h" -// custom RGB driver +#include "backlight.h" +#include "backlight_custom.h" + extern rgblight_config_t rgblight_config; + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + // matrix_init_user(); +} + +#ifdef BACKLIGHT_ENABLE +/// Overrides functions in `quantum.c` +void backlight_init_ports(void) { + b_led_init_ports(); +} + +void backlight_task(void) { + b_led_task(); +} + +void backlight_set(uint8_t level) { + b_led_set(level); +} +#endif + +// custom RGB driver void rgblight_set(void) { if (!rgblight_config.enable) { for (uint8_t i=0; i. #include "keycode.h" #include "action.h" +void matrix_init_user(void); // TODO port this to other PS2AVRGB boards + #define KEYMAP_GRID( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \ diff --git a/keyboards/jj40/keymaps/default/keymap.c b/keyboards/jj40/keymaps/default/keymap.c index 480486a18..e02dd902a 100644 --- a/keyboards/jj40/keymaps/default/keymap.c +++ b/keyboards/jj40/keymaps/default/keymap.c @@ -1,20 +1,3 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - #include "jj40.h" #include "action_layer.h" diff --git a/keyboards/jj40/keymaps/krusli/config.h b/keyboards/jj40/keymaps/krusli/config.h new file mode 100644 index 000000000..11cafbefc --- /dev/null +++ b/keyboards/jj40/keymaps/krusli/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define PREVENT_STUCK_MODIFIERS + +#endif diff --git a/keyboards/jj40/keymaps/krusli/keymap.c b/keyboards/jj40/keymaps/krusli/keymap.c index 59e3988e1..5a985199e 100644 --- a/keyboards/jj40/keymaps/krusli/keymap.c +++ b/keyboards/jj40/keymaps/krusli/keymap.c @@ -1,20 +1,3 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - #include "jj40.h" #include "action_layer.h" @@ -62,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + BL_TOGG, BL_STEP, BL_BRTG, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ), /* Raise @@ -73,13 +56,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 | RGB | RGB | RGB | RGB |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | RGB | RGB | RGB | RGB | | | Next | Vol- | Vol+ | Play | + * | RGB | RGB | RGB | RGB | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ [_RAISE] = KEYMAP( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, \ - _______, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ) }; diff --git a/keyboards/jj40/matrix.c b/keyboards/jj40/matrix.c index 140026013..a9e9cb539 100644 --- a/keyboards/jj40/matrix.c +++ b/keyboards/jj40/matrix.c @@ -29,6 +29,9 @@ static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; +void matrix_set_row_status(uint8_t row); +uint8_t bit_reverse(uint8_t x); + void matrix_init(void) { // all outputs for rows high DDRB = 0xFF; @@ -47,18 +50,8 @@ void matrix_init(void) { matrix[row] = 0x00; matrix_debouncing[row] = 0x00; } -} -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -} - -uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; + matrix_init_quantum(); // missing from original port by Luiz } uint8_t matrix_scan(void) { @@ -93,11 +86,30 @@ uint8_t matrix_scan(void) { } } - matrix_scan_user(); + matrix_scan_quantum(); // also missing in original PS2AVRGB implementation return 1; } +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +}; + +// declarations +void matrix_set_row_status(uint8_t row) { + DDRB = (1 << row); + PORTB = ~(1 << row); +} + +uint8_t bit_reverse(uint8_t x) { + x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk index cdc898c0f..670967fbd 100644 --- a/keyboards/jj40/rules.mk +++ b/keyboards/jj40/rules.mk @@ -36,11 +36,13 @@ MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no + +BACKLIGHT_ENABLE = yes +BACKLIGHT_CUSTOM_DRIVER = yes RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes -DISABLE_WS2812 = yes # TODO check if this is necessary +# DISABLE_WS2812 = no KEY_LOCK_ENABLE = yes @@ -51,7 +53,7 @@ OPT_DEFS = -DDEBUG_LEVEL=0 # custom matrix setup CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC = matrix.c i2c.c backlight.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/jj40/usbconfig.h b/keyboards/jj40/usbconfig.h index 520d08f61..ad97e7f0a 100644 --- a/keyboards/jj40/usbconfig.h +++ b/keyboards/jj40/usbconfig.h @@ -119,7 +119,7 @@ section at the end of this file). * device is powered from the USB bus. */ // max power draw with maxed white underglow measured at 120 mA (peaks) -#define USB_CFG_MAX_BUS_POWER 150 +#define USB_CFG_MAX_BUS_POWER 100 /* Set this variable to the maximum USB bus power consumption of your device. * The value is in milliamperes. [It will be divided by two since USB * communicates power requirements in units of 2 mA.] diff --git a/keyboards/xd60/keymaps/krusli/HHKB-like.txt b/keyboards/xd60/keymaps/krusli/HHKB-like.txt new file mode 100644 index 000000000..e69de29bb diff --git a/keyboards/xd60/keymaps/krusli/keymap.c b/keyboards/xd60/keymaps/krusli/keymap.c new file mode 100644 index 000000000..71f6e3c2e --- /dev/null +++ b/keyboards/xd60/keymaps/krusli/keymap.c @@ -0,0 +1,62 @@ +#include "xd60.h" +#include "action_layer.h" + +/* HHKB-like layout for standard 60% layout with split RShift and split backspace */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // 0: Base Layer + KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, F(0), \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, F(0), KC_RCTL, KC_RCTL), + + // 1: Function Layer + /* Layer HHKB: HHKB mode (HHKB Fn) + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | | | | | | | + | - | End | PgD | Dow | | | | | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + + |------+------+----------------------+------+------+ + | **** | **** | ******************** | **** | **** | + |------+------+----------------------+------+------+ + */ + KEYMAP( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \ + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_NO, KC_ENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(0), KC_TRNS, KC_TRNS), +}; + +// Custom Actions +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; + +// Macros +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; +}; + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/xd60/keymaps/krusli/readme.md b/keyboards/xd60/keymaps/krusli/readme.md new file mode 100644 index 000000000..7b6bce9c4 --- /dev/null +++ b/keyboards/xd60/keymaps/krusli/readme.md @@ -0,0 +1,2 @@ +# krusli's HHKB-style keymap for the XD60 +HHKB-style keymap for the XD60. The board was not built with split backspace but still has Backspace and |\\ swapped. diff --git a/quantum/quantum.c b/quantum/quantum.c index 88617412c..65fa25961 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -138,13 +138,13 @@ void reset_keyboard(void) { clear_keyboard(); #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) process_midi_all_notes_off(); -#endif +#endif #if defined(AUDIO_ENABLE) music_all_notes_off(); uint16_t timer_start = timer_read(); PLAY_SONG(goodbye_song); shutdown_user(); - while(timer_elapsed(timer_start) < 250) + while(timer_elapsed(timer_start) < 250) wait_ms(1); stop_all_notes(); #else @@ -885,6 +885,7 @@ void backlight_set(uint8_t level) {} uint8_t backlight_tick = 0; +#ifndef BACKLIGHT_CUSTOM_DRIVER void backlight_task(void) { if ((0xFFFF >> ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2))) & (1 << backlight_tick)) { #if BACKLIGHT_ON_STATE == 0 @@ -905,9 +906,12 @@ void backlight_task(void) { } backlight_tick = backlight_tick + 1 % 16; } +#endif #ifdef BACKLIGHT_BREATHING -#error "Backlight breathing only available with hardware PWM. Please disable." + #ifndef BACKLIGHT_CUSTOM_DRIVER + #error "Backlight breathing only available with hardware PWM. Please disable." + #endif #endif #else // pwm through timer @@ -935,6 +939,7 @@ static inline void set_pwm(uint16_t val) { OCR1x = val; } +#ifndef BACKLIGHT_CUSTOM_DRIVER __attribute__ ((weak)) void backlight_set(uint8_t level) { if (level > BACKLIGHT_LEVELS) @@ -952,6 +957,7 @@ void backlight_set(uint8_t level) { } void backlight_task(void) {} +#endif // BACKLIGHT_CUSTOM_DRIVER #ifdef BACKLIGHT_BREATHING diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c index 4d2491b98..12f75b38a 100644 --- a/tmk_core/common/backlight.c +++ b/tmk_core/common/backlight.c @@ -94,4 +94,4 @@ void backlight_level(uint8_t level) uint8_t get_backlight_level(void) { return backlight_config.level; -} \ No newline at end of file +} From 2018df1a61136f5db5032fc7f0ecb6dff05c6351 Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 19 Jan 2018 11:58:19 -0800 Subject: [PATCH 069/556] Clarify the format for layout names --- docs/feature_layouts.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md index 24c42c09f..bfae92044 100644 --- a/docs/feature_layouts.md +++ b/docs/feature_layouts.md @@ -35,10 +35,12 @@ New names should try to stick to the standards set by existing layouts, and can ## Supporting a Layout -For a keyboard to support a layout, the variable (`[a-z0-9_]`) must be defined in it's `.h`, and match the number of arguments/keys (and preferably the physical layout): +For a keyboard to support a layout, the variable must be defined in it's `.h`, and match the number of arguments/keys (and preferably the physical layout): #define LAYOUT_60_ansi KEYMAP_ANSI +The name of the layout must match this regex: `[a-z0-9_]+` + The folder name must be added to the keyboard's `rules.mk`: LAYOUTS = 60_ansi From 510a8d33394780a0713b26a0c516ecab1b140bc2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Jan 2018 10:55:40 +0200 Subject: [PATCH 070/556] Fix compiler settings for MCUs with floating point --- tmk_core/chibios.mk | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 4fa9fac2e..cb0482d75 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -26,7 +26,7 @@ endif # Imported source files and paths CHIBIOS = $(TOP_DIR)/lib/chibios CHIBIOS_CONTRIB = $(TOP_DIR)/lib/chibios-contrib -# Startup files. Try a few different locations, for compability with old versions and +# Startup files. Try a few different locations, for compability with old versions and # for things hardware in the contrib repository STARTUP_MK = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_$(MCU_STARTUP).mk ifeq ("$(wildcard $(STARTUP_MK))","") @@ -46,7 +46,7 @@ endif include $(PLATFORM_MK) -BOARD_MK := +BOARD_MK := ifneq ("$(wildcard $(KEYBOARD_PATH_5)/boards/$(BOARD)/board.mk)","") BOARD_PATH = $(KEYBOARD_PATH_5) @@ -115,14 +115,14 @@ CHIBISRC = $(STARTUPSRC) \ $(STREAMSSRC) \ $(STARTUPASM) \ $(PORTASM) \ - $(OSALASM) + $(OSALASM) CHIBISRC := $(patsubst $(TOP_DIR)/%,%,$(CHIBISRC)) - + EXTRAINCDIRS += $(CHIBIOS)/os/license \ $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(STREAMSINC) $(CHIBIOS)/os/various + $(STREAMSINC) $(CHIBIOS)/os/various # # Project, sources and paths @@ -139,17 +139,17 @@ SIZE = arm-none-eabi-size AR = arm-none-eabi-ar NM = arm-none-eabi-nm HEX = $(OBJCOPY) -O $(FORMAT) -EEP = +EEP = BIN = $(OBJCOPY) -O binary -THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB +THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB -COMPILEFLAGS += -fomit-frame-pointer +COMPILEFLAGS += -fomit-frame-pointer COMPILEFLAGS += -falign-functions=16 COMPILEFLAGS += -ffunction-sections COMPILEFLAGS += -fdata-sections COMPILEFLAGS += -fno-common -COMPILEFLAGS += $(THUMBFLAGS) +COMPILEFLAGS += $(THUMBFLAGS) CFLAGS += $(COMPILEFLAGS) @@ -168,6 +168,22 @@ OPT_DEFS += -DPROTOCOL_CHIBIOS MCUFLAGS = -mcpu=$(MCU) +# FPU options default (Cortex-M4 and Cortex-M7 single precision). +ifeq ($(USE_FPU_OPT),) + USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant +endif + +# FPU-related options +ifeq ($(USE_FPU),) + USE_FPU = no +endif +ifneq ($(USE_FPU),no) + OPT += $(USE_FPU_OPT) + OPT_DEFS += -DCORTEX_USE_FPU=TRUE +else + OPT_DEFS += -DCORTEX_USE_FPU=FALSE +endif + DEBUG = gdb DFU_ARGS ?= From a14d539ad67a59d297908f2eb1589cb68d990194 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Jan 2018 10:56:41 +0200 Subject: [PATCH 071/556] Revert back to normal sleeping wait behaviour for STM32 --- tmk_core/common/wait.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h index 553f5243f..a7cded942 100644 --- a/tmk_core/common/wait.h +++ b/tmk_core/common/wait.h @@ -13,13 +13,8 @@ extern "C" { # define wait_us(us) _delay_us(us) #elif defined PROTOCOL_CHIBIOS # include "ch.h" -# if defined(STM32F3xx_MCUCONF) -# define wait_ms(ms) chSysPolledDelayX(MS2RTC(STM32_HCLK, (ms))) -# define wait_us(us) chSysPolledDelayX(US2RTC(STM32_HCLK, (us))) -# else -# define wait_ms(ms) chThdSleepMilliseconds(ms) -# define wait_us(us) chThdSleepMicroseconds(us) -# endif +# define wait_ms(ms) chThdSleepMilliseconds(ms) +# define wait_us(us) chThdSleepMicroseconds(us) #elif defined(__arm__) # include "wait_api.h" #else // Unit tests From 894fa0902fb27ed87a17d6c665959647883cbbce Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Jan 2018 10:57:25 +0200 Subject: [PATCH 072/556] Enable FPU on Clueboard60 --- keyboards/clueboard/60/rules.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/clueboard/60/rules.mk b/keyboards/clueboard/60/rules.mk index 93e6019a4..e0c4b8502 100644 --- a/keyboards/clueboard/60/rules.mk +++ b/keyboards/clueboard/60/rules.mk @@ -28,11 +28,13 @@ MCU = cortex-m4 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 ARMV = 7 +USE_FPU = yes + # Vector table for application # 0x00000000-0x00001000 area is occupied by bootlaoder.*/ # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB # OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 -OPT_DEFS = +OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000 -R From 7d8a20b07f31309bc41de69583839058040c55b9 Mon Sep 17 00:00:00 2001 From: "U-LANDSRAAD\\drashna" Date: Tue, 26 Dec 2017 18:06:27 -0800 Subject: [PATCH 073/556] Disable MIDI on Planck so all revisions compile without compilition size errors --- keyboards/planck/rev5/rules.mk | 1 - keyboards/planck/rules.mk | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/planck/rev5/rules.mk b/keyboards/planck/rev5/rules.mk index 2ca882a07..7e64e7edc 100644 --- a/keyboards/planck/rev5/rules.mk +++ b/keyboards/planck/rev5/rules.mk @@ -1,2 +1 @@ AUDIO_ENABLE = yes # Audio output on port C6 -MIDI_ENABLE = no diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk index 439f7db64..4d882d0b0 100644 --- a/keyboards/planck/rules.mk +++ b/keyboards/planck/rules.mk @@ -65,7 +65,7 @@ CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = no # 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 = no # Enable keyboard backlight functionality -MIDI_ENABLE = yes # MIDI controls +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 From ac642de9d7560fdd994790288a81163a410a601e Mon Sep 17 00:00:00 2001 From: Joe DeVivo Date: Fri, 29 Dec 2017 09:09:54 -0700 Subject: [PATCH 074/556] Iris send backlight info over i2c --- keyboards/iris/matrix.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/keyboards/iris/matrix.c b/keyboards/iris/matrix.c index b83311ce1..3d8d2adb8 100644 --- a/keyboards/iris/matrix.c +++ b/keyboards/iris/matrix.c @@ -208,6 +208,15 @@ int i2c_transaction(void) { err = i2c_master_write(0x00); if (err) goto i2c_error; +#ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + err = i2c_master_write(get_backlight_level()); +#else + // Write zero, so our byte index is the same + err = i2c_master_write(0x00); +#endif + if (err) goto i2c_error; + // Start read err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; @@ -285,8 +294,12 @@ void matrix_slave_scan(void) { int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_I2C +#ifdef BACKLIGHT_ENABLE + // Read backlight level sent from master and update level on slave + backlight_set(i2c_slave_buffer[0]); +#endif for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; + i2c_slave_buffer[i+1] = matrix[offset+i]; } #else // USE_SERIAL for (int i = 0; i < ROWS_PER_HAND; ++i) { From c73514a2b7284df51b8c6acd416e3fcb01dcbdc7 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 18 Jan 2018 14:51:16 -0500 Subject: [PATCH 075/556] Update pinout for Rev. 1.0 Iris without LED --- keyboards/iris/iris.h | 2 + keyboards/iris/keymaps/default/config.h | 2 +- keyboards/iris/keymaps/hexwire/config.h | 2 +- keyboards/iris/keymaps/lewisridden/config.h | 2 +- keyboards/iris/rev1/config.h | 6 +- keyboards/iris/rev1_led/config.h | 90 +++++++++++++++++++++ keyboards/iris/rev1_led/rev1_led.c | 22 +++++ keyboards/iris/rev1_led/rev1_led.h | 40 +++++++++ keyboards/iris/rev1_led/rules.mk | 1 + keyboards/iris/rev2/config.h | 2 +- keyboards/iris/rev2/rev2.h | 4 +- 11 files changed, 164 insertions(+), 9 deletions(-) create mode 100644 keyboards/iris/rev1_led/config.h create mode 100644 keyboards/iris/rev1_led/rev1_led.c create mode 100644 keyboards/iris/rev1_led/rev1_led.h create mode 100644 keyboards/iris/rev1_led/rules.mk diff --git a/keyboards/iris/iris.h b/keyboards/iris/iris.h index ec2aabab0..a0df746fb 100644 --- a/keyboards/iris/iris.h +++ b/keyboards/iris/iris.h @@ -3,6 +3,8 @@ #ifdef KEYBOARD_iris_rev1 #include "rev1.h" +#elif KEYBOARD_iris_rev1_led + #include "rev1_led.h" #else #include "rev2.h" #endif diff --git a/keyboards/iris/keymaps/default/config.h b/keyboards/iris/keymaps/default/config.h index c4604af43..72e35c472 100644 --- a/keyboards/iris/keymaps/default/config.h +++ b/keyboards/iris/keymaps/default/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Danny Nguyen +Copyright 2017 Danny Nguyen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/keyboards/iris/keymaps/hexwire/config.h b/keyboards/iris/keymaps/hexwire/config.h index 81df2e916..53b00d24f 100644 --- a/keyboards/iris/keymaps/hexwire/config.h +++ b/keyboards/iris/keymaps/hexwire/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Danny Nguyen +Copyright 2017 Danny Nguyen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/keyboards/iris/keymaps/lewisridden/config.h b/keyboards/iris/keymaps/lewisridden/config.h index 259efc8d2..6d96b31bd 100644 --- a/keyboards/iris/keymaps/lewisridden/config.h +++ b/keyboards/iris/keymaps/lewisridden/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Danny Nguyen +Copyright 2017 Danny Nguyen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/keyboards/iris/rev1/config.h b/keyboards/iris/rev1/config.h index c9bc62528..c22d49b26 100644 --- a/keyboards/iris/rev1/config.h +++ b/keyboards/iris/rev1/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Danny Nguyen +Copyright 2017 Danny Nguyen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ along with this program. If not, see . // wiring of each half #define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, F4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -59,7 +59,7 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -#define BACKLIGHT_PIN B6 +#define BACKLIGHT_PIN D2 #define BACKLIGHT_LEVELS 5 /* ws2812 RGB LED */ diff --git a/keyboards/iris/rev1_led/config.h b/keyboards/iris/rev1_led/config.h new file mode 100644 index 000000000..957776022 --- /dev/null +++ b/keyboards/iris/rev1_led/config.h @@ -0,0 +1,90 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Iris Keyboard +#define DESCRIPTION Split 50 percent ergonomic keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, F4 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/iris/rev1_led/rev1_led.c b/keyboards/iris/rev1_led/rev1_led.c new file mode 100644 index 000000000..7a4c87488 --- /dev/null +++ b/keyboards/iris/rev1_led/rev1_led.c @@ -0,0 +1,22 @@ +#include "rev1_led.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; diff --git a/keyboards/iris/rev1_led/rev1_led.h b/keyboards/iris/rev1_led/rev1_led.h new file mode 100644 index 000000000..82aa01eb5 --- /dev/null +++ b/keyboards/iris/rev1_led/rev1_led.h @@ -0,0 +1,40 @@ +#ifndef REV1_LED_H +#define REV1_LED_H + +#include "iris.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, LT4, RT4, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, LT3, RT3, RT2, RT1 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, LT4, LT1, LT2, LT3 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \ + } + +#endif diff --git a/keyboards/iris/rev1_led/rules.mk b/keyboards/iris/rev1_led/rules.mk new file mode 100644 index 000000000..7b30c0bef --- /dev/null +++ b/keyboards/iris/rev1_led/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = no diff --git a/keyboards/iris/rev2/config.h b/keyboards/iris/rev2/config.h index 290fba450..4aa8cda17 100644 --- a/keyboards/iris/rev2/config.h +++ b/keyboards/iris/rev2/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Danny Nguyen +Copyright 2017 Danny Nguyen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/keyboards/iris/rev2/rev2.h b/keyboards/iris/rev2/rev2.h index 6d2053651..e0230673e 100644 --- a/keyboards/iris/rev2/rev2.h +++ b/keyboards/iris/rev2/rev2.h @@ -1,5 +1,5 @@ -#ifndef REV1_H -#define REV1_H +#ifndef REV2_H +#define REV2_H #include "iris.h" From 9a91b42e922ed152cb548c529233cf7f2b6d5183 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Wed, 20 Dec 2017 10:58:28 -0500 Subject: [PATCH 076/556] Add Chocopad keyboard --- keyboards/chocopad/README.md | 14 +++++ keyboards/chocopad/chocopad.c | 1 + keyboards/chocopad/chocopad.h | 32 +++++++++++ keyboards/chocopad/config.h | 59 ++++++++++++++++++++ keyboards/chocopad/keymaps/default/config.h | 6 ++ keyboards/chocopad/keymaps/default/keymap.c | 61 +++++++++++++++++++++ keyboards/chocopad/keymaps/default/rules.mk | 5 ++ keyboards/chocopad/rules.mk | 56 +++++++++++++++++++ 8 files changed, 234 insertions(+) create mode 100644 keyboards/chocopad/README.md create mode 100644 keyboards/chocopad/chocopad.c create mode 100644 keyboards/chocopad/chocopad.h create mode 100644 keyboards/chocopad/config.h create mode 100644 keyboards/chocopad/keymaps/default/config.h create mode 100644 keyboards/chocopad/keymaps/default/keymap.c create mode 100644 keyboards/chocopad/keymaps/default/rules.mk create mode 100644 keyboards/chocopad/rules.mk diff --git a/keyboards/chocopad/README.md b/keyboards/chocopad/README.md new file mode 100644 index 000000000..ad0f6b356 --- /dev/null +++ b/keyboards/chocopad/README.md @@ -0,0 +1,14 @@ +Chocopad +======== + +A 4x4 macropad keyboard using Kailh PG1350 Lower Profile Choc switches. + +Keyboard Maintainer: Keebio +Hardware Supported: Chocopad PCB, Arduino Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make chocopad:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/chocopad/chocopad.c b/keyboards/chocopad/chocopad.c new file mode 100644 index 000000000..f54753af5 --- /dev/null +++ b/keyboards/chocopad/chocopad.c @@ -0,0 +1 @@ +#include "chocopad.h" diff --git a/keyboards/chocopad/chocopad.h b/keyboards/chocopad/chocopad.h new file mode 100644 index 000000000..329e2d56f --- /dev/null +++ b/keyboards/chocopad/chocopad.h @@ -0,0 +1,32 @@ +#ifndef CHOCOPAD_H +#define CHOCOPAD_H + +#include "quantum.h" + +#define KEYMAP( \ + A1, A2, A3, A4, \ + B1, B2, B3, B4, \ + C1, C2, C3, C4, \ + D1, D2, D3, D4 \ +) { \ + { A1, A2, A3, A4 }, \ + { B1, B2, B3, B4 }, \ + { C1, C2, C3, C4 }, \ + { D1, D2, D3, D4 } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define KC_KEYMAP( \ + A1, A2, A3, A4, \ + B1, B2, B3, B4, \ + C1, C2, C3, C4, \ + D1, D2, D3, D4 \ +) \ + KEYMAP( \ + KC_##A1, KC_##A2, KC_##A3, KC_##A4, \ + KC_##B1, KC_##B2, KC_##B3, KC_##B4, \ + KC_##C1, KC_##C2, KC_##C3, KC_##C4, \ + KC_##D1, KC_##D2, KC_##D3, KC_##D4 \ + ) + +#endif diff --git a/keyboards/chocopad/config.h b/keyboards/chocopad/config.h new file mode 100644 index 000000000..bf861ccda --- /dev/null +++ b/keyboards/chocopad/config.h @@ -0,0 +1,59 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1144 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Chocopad +#define DESCRIPTION 4x4 macropad using Kailh Choc low-profile switches + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D7, E6, B3, B2 } +#define MATRIX_COL_PINS { D2, D4, F6, F5 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 6 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 4 +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +#endif \ No newline at end of file diff --git a/keyboards/chocopad/keymaps/default/config.h b/keyboards/chocopad/keymaps/default/config.h new file mode 100644 index 000000000..7fa3bf328 --- /dev/null +++ b/keyboards/chocopad/keymaps/default/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#endif diff --git a/keyboards/chocopad/keymaps/default/keymap.c b/keyboards/chocopad/keymaps/default/keymap.c new file mode 100644 index 000000000..c4536a1b4 --- /dev/null +++ b/keyboards/chocopad/keymaps/default/keymap.c @@ -0,0 +1,61 @@ +#include "chocopad.h" + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_X1 MO(_FN1) +#define KC_X2 MO(_FN2) +#define KC_RST RESET +#define KC_BSTP BL_STEP +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = KC_KEYMAP( + //,----+----+----+----. + PGUP,HOME, UP ,END , + //|----+----+----+----| + PGDN,LEFT,DOWN,RGHT, + //|----+----+----+----| + X2 ,VOLU,MPLY,MPRV, + //|----+----+----+----| + X1 ,VOLD,MUTE,MNXT + //`----+----+----+----' + ), + + [_FN1] = KC_KEYMAP( + //,----+----+----+----. + ESC , P7 , P8 , P9 , + //|----+----+----+----| + TAB , P4 , P5 , P6 , + //|----+----+----+----| + ENT , P1 , P2 , P3 , + //|----+----+----+----| + , P0 , P0 ,DOT + //`----+----+----+----' + ), + + [_FN2] = KC_KEYMAP( + //,----+----+----+----. + RTOG,RHUI,RSAI,RVAI, + //|----+----+----+----| + RMOD,RHUD,RSAD,RVAD, + //|----+----+----+----| + , , ,RST , + //|----+----+----+----| + BSTP, , , + //`----+----+----+----' + ) + +}; diff --git a/keyboards/chocopad/keymaps/default/rules.mk b/keyboards/chocopad/keymaps/default/rules.mk new file mode 100644 index 000000000..1e5761278 --- /dev/null +++ b/keyboards/chocopad/keymaps/default/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/chocopad/rules.mk b/keyboards/chocopad/rules.mk new file mode 100644 index 000000000..cd9222a15 --- /dev/null +++ b/keyboards/chocopad/rules.mk @@ -0,0 +1,56 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +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 +SLEEP_LED_ENABLE = no # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes From d837ab586a127721679ac1971874f52e5c72aefb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20J=C3=A4rvstrand?= Date: Sun, 21 Jan 2018 21:32:19 +0100 Subject: [PATCH 077/556] Make new_project.sh a bit more robust --- util/new_project.sh | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/util/new_project.sh b/util/new_project.sh index 18d16e560..0f507b679 100755 --- a/util/new_project.sh +++ b/util/new_project.sh @@ -12,19 +12,11 @@ cd "$(dirname "$0")/.." KEYBOARD=$1 KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}') -mkdir keyboards/$1 -mkdir keyboards/$1/keymaps -mkdir keyboards/$1/keymaps/default -sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboards/$KEYBOARD/$KEYBOARD.h -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboards/$KEYBOARD/$KEYBOARD.c -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboards/$KEYBOARD/config.h -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/readme.md > keyboards/$KEYBOARD/readme.md -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboards/$KEYBOARD/Makefile -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/rules.mk > keyboards/$KEYBOARD/rules.mk -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/config.h > keyboards/$KEYBOARD/keymaps/default/config.h -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/keymap.c > keyboards/$KEYBOARD/keymaps/default/keymap.c -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/Makefile > keyboards/$KEYBOARD/keymaps/default/Makefile -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/readme.md > keyboards/$KEYBOARD/keymaps/default/readme.md +cp -r quantum/template keyboards/$KEYBOARD +mv keyboards/$KEYBOARD/template.c keyboards/$KEYBOARD/$KEYBOARD.c +mv keyboards/$KEYBOARD/template.h keyboards/$KEYBOARD/$KEYBOARD.h +find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD%;$KEYBOARD;g" {} \; +find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" {} \; echo "######################################################" echo "# /keyboards/$KEYBOARD project created. To start" From 7c3d2d5f64061db8ff54aefe3e41b0505aa9f4e8 Mon Sep 17 00:00:00 2001 From: allo-world <35620024+allo-world@users.noreply.github.com> Date: Wed, 24 Jan 2018 22:00:31 -0800 Subject: [PATCH 078/556] Added KBD66 (#2292) * Created default layout for KBD66. * Added KBD66 ISO layout. --- keyboards/kbd66/config.h | 191 ++++++++++++++++++++++ keyboards/kbd66/kbd66.c | 43 +++++ keyboards/kbd66/kbd66.h | 36 ++++ keyboards/kbd66/keymaps/ansi/config.h | 24 +++ keyboards/kbd66/keymaps/ansi/keymap.c | 103 ++++++++++++ keyboards/kbd66/keymaps/ansi/readme.md | 11 ++ keyboards/kbd66/keymaps/default/config.h | 24 +++ keyboards/kbd66/keymaps/default/keymap.c | 103 ++++++++++++ keyboards/kbd66/keymaps/default/readme.md | 12 ++ keyboards/kbd66/keymaps/iso/config.h | 24 +++ keyboards/kbd66/keymaps/iso/keymap.c | 103 ++++++++++++ keyboards/kbd66/keymaps/iso/readme.md | 11 ++ keyboards/kbd66/readme.md | 15 ++ keyboards/kbd66/rules.mk | 68 ++++++++ 14 files changed, 768 insertions(+) create mode 100644 keyboards/kbd66/config.h create mode 100644 keyboards/kbd66/kbd66.c create mode 100644 keyboards/kbd66/kbd66.h create mode 100644 keyboards/kbd66/keymaps/ansi/config.h create mode 100644 keyboards/kbd66/keymaps/ansi/keymap.c create mode 100644 keyboards/kbd66/keymaps/ansi/readme.md create mode 100644 keyboards/kbd66/keymaps/default/config.h create mode 100644 keyboards/kbd66/keymaps/default/keymap.c create mode 100644 keyboards/kbd66/keymaps/default/readme.md create mode 100644 keyboards/kbd66/keymaps/iso/config.h create mode 100644 keyboards/kbd66/keymaps/iso/keymap.c create mode 100644 keyboards/kbd66/keymaps/iso/readme.md create mode 100644 keyboards/kbd66/readme.md create mode 100644 keyboards/kbd66/rules.mk diff --git a/keyboards/kbd66/config.h b/keyboards/kbd66/config.h new file mode 100644 index 000000000..1802a0219 --- /dev/null +++ b/keyboards/kbd66/config.h @@ -0,0 +1,191 @@ +/* +Copyright 2018 Alex Peters + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xBD66 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT KBD66 +#define DESCRIPTION QMK keyboard firmware for KBD66 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, F0, F1, D4 } // From qmkeyboard.cn +#define MATRIX_COL_PINS { C6, C7, E2, F5, F6, F4, D3, D2, D5, D0, D1, B4, D7, D6, E6, B3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/kbd66/kbd66.c b/keyboards/kbd66/kbd66.c new file mode 100644 index 000000000..7a84b6368 --- /dev/null +++ b/keyboards/kbd66/kbd66.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kbd66.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/kbd66/kbd66.h b/keyboards/kbd66/kbd66.h new file mode 100644 index 000000000..af1156e5e --- /dev/null +++ b/keyboards/kbd66/kbd66.h @@ -0,0 +1,36 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef KBD66_H +#define KBD66_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D,k0E, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k45, k48, k4A, k4B, k4C, k4D, k4E, k4F \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F}, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F}, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, KC_NO, KC_NO}, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, KC_NO}, \ + { k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, k48, KC_NO, k4A, k4B, k4C, k4D, k4E, k4F}, \ +} + +#endif diff --git a/keyboards/kbd66/keymaps/ansi/config.h b/keyboards/kbd66/keymaps/ansi/config.h new file mode 100644 index 000000000..c7b3d6ecc --- /dev/null +++ b/keyboards/kbd66/keymaps/ansi/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/kbd66/keymaps/ansi/keymap.c b/keyboards/kbd66/keymaps/ansi/keymap.c new file mode 100644 index 000000000..f5ffa7b75 --- /dev/null +++ b/keyboards/kbd66/keymaps/ansi/keymap.c @@ -0,0 +1,103 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kbd66.h" + +#define _____ KC_TRNS +#define XXXXX KC_NO +#define _L0 0 +#define _L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0 + * ,-----------------------------------------------------------. ,---. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BckSp | |INS| + * |-----------------------------------------------------------| |---| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |DEL| + * |-----------------------------------------------------------| `---' + * |Cap | A| S| D| F| G| H| J| K| L| ;| '| Enter | + * |---------------------------------------------------------------. + * | Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | UP| + * |-------------------------------------------------------------------. + * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| + * `-------------------------------------------------------------------' + */ +[_L0] = KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXX, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, XXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXX, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* Layer 1 + * ,-----------------------------------------------------------. ,---. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |HOM| + * |-----------------------------------------------------------| |---| + * | | | | | | | | | | |PSc|VDn|VUp| Mute| |END| + * |-----------------------------------------------------------| `---' + * |RESET| | | | | | |PRV|PLY|NXT|STP| | | + * |---------------------------------------------------------------. + * | | | | | | | | |BLB|BLC|Slp| |PUp| + * |-------------------------------------------------------------------. + * | | | | | | | | |PDn|SLk| + * `-------------------------------------------------------------------' + */ +[_L1] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, + RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, + _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, + _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK +) + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd66/keymaps/ansi/readme.md b/keyboards/kbd66/keymaps/ansi/readme.md new file mode 100644 index 000000000..6ad0d85e0 --- /dev/null +++ b/keyboards/kbd66/keymaps/ansi/readme.md @@ -0,0 +1,11 @@ +# ANSI keymap for KBD66 + +![KBD66 Layout Image](https://i.imgur.com/Hmt5QDW.jpg) + +Your standard ANSI layout for the KBD66. +Cycle backlight: Fn + . +Backlight breathing: Fn + , +Volume Up/Down: Fn + [ and Fn + ] +Mute: Fn + \ +Sleep: Fn + / +Bootloader Mode: Fn + CapsLock \ No newline at end of file diff --git a/keyboards/kbd66/keymaps/default/config.h b/keyboards/kbd66/keymaps/default/config.h new file mode 100644 index 000000000..c7b3d6ecc --- /dev/null +++ b/keyboards/kbd66/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/kbd66/keymaps/default/keymap.c b/keyboards/kbd66/keymaps/default/keymap.c new file mode 100644 index 000000000..551df1418 --- /dev/null +++ b/keyboards/kbd66/keymaps/default/keymap.c @@ -0,0 +1,103 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kbd66.h" + +#define _____ KC_TRNS +#define XXXXX KC_NO +#define _L0 0 +#define _L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0 + * ,-----------------------------------------------------------. ,---. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `| BS| |INS| + * |-----------------------------------------------------------| |---| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |DEL| + * |-----------------------------------------------------------| `---' + * |Cap | A| S| D| F| G| H| J| K| L| ;| '| Enter | + * |---------------------------------------------------------------. + * |Shft| `| Z| X| C| V| B| N| M| ,| .| /| Shft |Fn | UP| + * |-------------------------------------------------------------------. + * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| + * `-------------------------------------------------------------------' + */ +[_L0] = KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_L1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* Layer 1 + * ,-----------------------------------------------------------. ,---. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | |HOM| + * |-----------------------------------------------------------| |---| + * | | | | | | | | | | |PSc|VDn|VUp| Mute| |END| + * |-----------------------------------------------------------| `---' + * |RESET| | | | | | |PRV|PLY|NXT|STP| | | + * |---------------------------------------------------------------. + * | | | | | | | | | |BLB|BLC|Slp| | |PUp| + * |-------------------------------------------------------------------. + * | | | | | | | | |PDn|SLk| + * `-------------------------------------------------------------------' + */ +[_L1] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, + RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, + _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, + _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK +) + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd66/keymaps/default/readme.md b/keyboards/kbd66/keymaps/default/readme.md new file mode 100644 index 000000000..f4ab771a5 --- /dev/null +++ b/keyboards/kbd66/keymaps/default/readme.md @@ -0,0 +1,12 @@ +# The default keymap for KBD66 + +![KBD66 Layout Image](https://i.imgur.com/QNpHnMe.jpg) + +This is a fairly universal layout that supports standard ANSI, split backspace, +split left shift, and split right shift. +Cycle backlight: Fn + . +Backlight breathing: Fn + , +Volume Up/Down: Fn + [ and Fn + ] +Mute: Fn + \ +Sleep: Fn + / +Bootloader Mode: Fn + CapsLock \ No newline at end of file diff --git a/keyboards/kbd66/keymaps/iso/config.h b/keyboards/kbd66/keymaps/iso/config.h new file mode 100644 index 000000000..c7b3d6ecc --- /dev/null +++ b/keyboards/kbd66/keymaps/iso/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/kbd66/keymaps/iso/keymap.c b/keyboards/kbd66/keymaps/iso/keymap.c new file mode 100644 index 000000000..fa9202cad --- /dev/null +++ b/keyboards/kbd66/keymaps/iso/keymap.c @@ -0,0 +1,103 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kbd66.h" + +#define _____ KC_TRNS +#define XXXXX KC_NO +#define _L0 0 +#define _L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0 + * ,-----------------------------------------------------------. ,---. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BckSp | |INS| + * |-----------------------------------------------------------| |---| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |DEL| + * |------------------------------------------------------|Ent | `---' + * |Cap | A| S| D| F| G| H| J| K| L| ;| '| #| | + * |---------------------------------------------------------------. + * |Shft| \| Z| X| C| V| B| N| M| ,| .| /| Shft |Fn | UP| + * |-------------------------------------------------------------------. + * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| + * `-------------------------------------------------------------------' + */ +[_L0] = KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NUHS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_L1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* Layer 1 + * ,-----------------------------------------------------------. ,---. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | |HOM| + * |-----------------------------------------------------------| |---| + * | | | | | | | | | | |PSc|VDn|VUp| | |END| + * |------------------------------------------------------| | `---' + * |RESET | | | | | | |PRV|PLY|NXT|STP| |Mut| | + * |---------------------------------------------------------------. + * | | | | | | | | | |BLB|BLC|Slp| | |PUp| + * |-------------------------------------------------------------------. + * | | | | | | | | |PDn|SLk| + * `-------------------------------------------------------------------' + */ +[_L1] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, + RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, + _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, + _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK +) + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd66/keymaps/iso/readme.md b/keyboards/kbd66/keymaps/iso/readme.md new file mode 100644 index 000000000..f325b741c --- /dev/null +++ b/keyboards/kbd66/keymaps/iso/readme.md @@ -0,0 +1,11 @@ +# ISO keymap for KBD66 + +![KBD66 Layout Image](https://i.imgur.com/q6GTOsb.jpg) + +Standard ISO layout for KBD66. +Cycle backlight: Fn + . +Backlight breathing: Fn + , +Volume Up/Down: Fn + [ and Fn + ] +Mute: Fn + # +Sleep: Fn + / +Bootloader Mode: Fn + CapsLock \ No newline at end of file diff --git a/keyboards/kbd66/readme.md b/keyboards/kbd66/readme.md new file mode 100644 index 000000000..71fe1f2e3 --- /dev/null +++ b/keyboards/kbd66/readme.md @@ -0,0 +1,15 @@ +# KBD66 + +![KBD66](https://i.imgur.com/qtLuL2o.jpg) + +A 65% keyboard from KBDFans. + +Keyboard Maintainer: [Alex](https://github.com/allo-world) +Hardware Supported: KBD66, ATmega32U4 +Hardware Availability: [KBDFans](https://kbdfans.cn), [Massdrop](https://www.massdrop.com/buy/kbd66-mechanical-keyboard-kit?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make kbd66:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/kbd66/rules.mk b/keyboards/kbd66/rules.mk new file mode 100644 index 000000000..45eb6ee37 --- /dev/null +++ b/keyboards/kbd66/rules.mk @@ -0,0 +1,68 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +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 = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches From 61d851af6594be3b52c316be29115e282dc2a4f2 Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Thu, 25 Jan 2018 01:00:59 -0500 Subject: [PATCH 079/556] Add SSD1306 OLED display support to TKC1800 (#2293) * Add support for SSD1306 OLED display * Correct keymap Had tilde on keymap instead of grave, corrected. * Winkeyless keymap --- keyboards/tkc1800/i2c.c | 166 +++++++++++++++++++++ keyboards/tkc1800/i2c.h | 49 ++++++ keyboards/tkc1800/keymaps/default/config.h | 5 + keyboards/tkc1800/keymaps/default/keymap.c | 102 ++++++++++--- keyboards/tkc1800/keymaps/wkl/config.h | 29 ++++ keyboards/tkc1800/keymaps/wkl/keymap.c | 145 ++++++++++++++++++ keyboards/tkc1800/rules.mk | 5 +- 7 files changed, 479 insertions(+), 22 deletions(-) create mode 100644 keyboards/tkc1800/i2c.c create mode 100644 keyboards/tkc1800/i2c.h create mode 100644 keyboards/tkc1800/keymaps/wkl/config.h create mode 100644 keyboards/tkc1800/keymaps/wkl/keymap.c diff --git a/keyboards/tkc1800/i2c.c b/keyboards/tkc1800/i2c.c new file mode 100644 index 000000000..cd2b835d5 --- /dev/null +++ b/keyboards/tkc1800/i2c.c @@ -0,0 +1,166 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 800000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/tkc1800/keymaps/default/config.h b/keyboards/tkc1800/keymaps/default/config.h index a3828f7d5..30973348a 100644 --- a/keyboards/tkc1800/keymaps/default/config.h +++ b/keyboards/tkc1800/keymaps/default/config.h @@ -19,6 +19,11 @@ #include "../../config.h" +#define USE_I2C +#define SSD1306OLED +//#define OLED_ROTATE180 +#define SSD1306_ADDRESS 0x3C + // place overrides here #endif diff --git a/keyboards/tkc1800/keymaps/default/keymap.c b/keyboards/tkc1800/keymaps/default/keymap.c index 1b9f390b2..7821f0f31 100644 --- a/keyboards/tkc1800/keymaps/default/keymap.c +++ b/keyboards/tkc1800/keymaps/default/keymap.c @@ -14,21 +14,33 @@ * along with this program. If not, see . */ #include "tkc1800.h" +#include "LUFA/Drivers/Peripheral/TWI.h" +#include "i2c.h" +#include "ssd1306.h" + #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + // Helpful defines #define ______ KC_TRNS #define XXXXXX KC_NO -#define _DEFAULT 0 -#define _FUNCTION 1 +//Layers + +enum { + BASE = 0, + FUNCTION, +}; + +//13 characters max without re-writing the "Layer: " format in iota_gfx_task_user() +static char layer_lookup[][14] = {"Base","Function"}; + -//RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: (Base Layer) Default Layer + /* Keymap BASE: (Base Layer) Default Layer * ,-------------------------------------------------------. ,-------------------. * |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| |Ins |Home|PgUp|PrSc| * `-------------------------------------------------------' |-------------------| @@ -45,41 +57,89 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | * `---------------------------------------------------------------------------------' */ - [_DEFAULT] = KEYMAP( + [BASE] = KEYMAP( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FUNCTION), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, XXXXXX + KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT ), - [_FUNCTION] = KEYMAP( + [FUNCTION] = KEYMAP( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, RESET, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, ______, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, XXXXXX + KC_LSFT, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, ______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT ), }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } void led_set_user(uint8_t usb_led) { +} +void matrix_init_user(void) { + #ifdef USE_I2C + i2c_master_init(); + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display + #endif + #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + iota_gfx_task(); // this is what updates the display continuously + #endif +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("TKC1800")); + + uint8_t layer = biton32(layer_state); + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%d", layer); + matrix_write_P(&matrix, PSTR("\nLayer: ")); + matrix_write(&matrix, layer_lookup[layer]); + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n\n%s %s %s", + (host_keyboard_leds() & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define USE_I2C +#define SSD1306OLED +//#define OLED_ROTATE180 +#define SSD1306_ADDRESS 0x3C + +// place overrides here + +#endif diff --git a/keyboards/tkc1800/keymaps/wkl/keymap.c b/keyboards/tkc1800/keymaps/wkl/keymap.c new file mode 100644 index 000000000..b72a77c21 --- /dev/null +++ b/keyboards/tkc1800/keymaps/wkl/keymap.c @@ -0,0 +1,145 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "tkc1800.h" +#include "LUFA/Drivers/Peripheral/TWI.h" +#include "i2c.h" +#include "ssd1306.h" + + +#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + + +// Helpful defines +#define ______ KC_TRNS +#define XXXXXX KC_NO + +//Layers + +enum { + BASE = 0, + FUNCTION, +}; + +//13 characters max without re-writing the "Layer: " format in iota_gfx_task_user() +static char layer_lookup[][14] = {"Base","Function"}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap BASE: (Base Layer) Default Layer + * ,-------------------------------------------------------. ,-------------------. + * |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| |Ins |Home|PgUp|PrSc| + * `-------------------------------------------------------' |-------------------| + * |Del |End |PgDn|ScrL| + * ,-----------------------------------------------------------. |-------------------| + * | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * |Paus| + * |-----------------------------------------------------------| |-------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 7 | 8 | 9 | - | + * |-----------------------------------------------------------| |-------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4 | 5 | 6 | + | + * |-----------------------------------------------------------' |-------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up | 1 | 2 | 3 | Ent| + * |--------------------------------------------------------'----`--------------| | + * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | + * `---------------------------------------------------------------------------------' + */ + [BASE] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LALT, XXXXXX, KC_SPC, XXXXXX, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), + [FUNCTION] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, RESET, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, XXXXXX, ______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), +}; + +// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} +void matrix_init_user(void) { + #ifdef USE_I2C + i2c_master_init(); + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display + #endif + #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + iota_gfx_task(); // this is what updates the display continuously + #endif +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("TKC1800")); + + uint8_t layer = biton32(layer_state); + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%d", layer); + matrix_write_P(&matrix, PSTR("\nLayer: ")); + matrix_write(&matrix, layer_lookup[layer]); + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n\n%s %s %s", + (host_keyboard_leds() & (1< Date: Sat, 20 Jan 2018 16:41:36 +0100 Subject: [PATCH 080/556] Fix compilation error when RGB light is disabled --- keyboards/ergodox_ez/keymaps/default/keymap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index 3c15b8a44..e400ffcd3 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -217,8 +217,10 @@ uint32_t layer_state_set_user(uint32_t state) { #ifdef RGBLIGHT_COLOR_LAYER_0 rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); #else + #ifdef RGBLIGHT_ENABLE rgblight_init(); #endif + #endif break; case 1: ergodox_right_led_1_on(); From b9b67e9614eed1634850a3a0b05711b90ee98fe1 Mon Sep 17 00:00:00 2001 From: Alex Vogel Date: Thu, 25 Jan 2018 07:03:49 +0100 Subject: [PATCH 081/556] [Keymap] semi-ISO Spanish HHKB Keymap for Satan Keyboards (#2290) * ISO HHKB first commit * First version of my HHKB ISO Spanish Keymap * Readme.md * Added more media keys. Caps Lock added on function layer. Backlight toggle added on funtion layer. * RGB support for WS2812B RGB led strip * RGB and brightness control. --- keyboards/satan/keymaps/isoHHKB/keymap.c | 110 ++++++++++++++++++ keyboards/satan/keymaps/isoHHKB/readme.md | 55 +++++++++ keyboards/satan/keymaps/isoHHKB/rules.mk | 21 ++++ .../satan/keymaps/isoHHKB/stunny_iso_hhkb.h | 21 ++++ 4 files changed, 207 insertions(+) create mode 100644 keyboards/satan/keymaps/isoHHKB/keymap.c create mode 100644 keyboards/satan/keymaps/isoHHKB/readme.md create mode 100644 keyboards/satan/keymaps/isoHHKB/rules.mk create mode 100644 keyboards/satan/keymaps/isoHHKB/stunny_iso_hhkb.h diff --git a/keyboards/satan/keymaps/isoHHKB/keymap.c b/keyboards/satan/keymaps/isoHHKB/keymap.c new file mode 100644 index 000000000..a14c5c39d --- /dev/null +++ b/keyboards/satan/keymaps/isoHHKB/keymap.c @@ -0,0 +1,110 @@ +#include "satan.h" +#include "stunny_iso_hhkb.h" + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +#define KC_ENYE M(0) +#define KC_CEDL M(1) + +#define _______ KC_TRNS + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret | + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| Ñ| ;| ' |urn| + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Fn| + * |-----------------------------------------------------------| + * | |Alt|WinK | Space |WinK |Alt| | + * `-----------------------------------------------------------' + * + */ + + [_BL] = KEYMAP_ISO_HHKB( \ + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,_______, \ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENYE,KC_SCLN,KC_QUOT,KC_ENT, \ + OSM(MOD_LSFT),_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, OSM(MOD_RSFT), MO(_FL), \ + _______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI,_______, _______), + + /* Keymap _FL: (Function Layer) Second Layer + * ,-----------------------------------------------------------. + * | |F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|PSR| RESET| + * |-----------------------------------------------------------| + * | | |VUP| | | | | | | | | | | | + * |-----------------------------------------------------------| + * |CapsLck|PRV|VDN|NXT| |RGB|FRW|BRT|VAI|VAD|INC|DEC| | | + * |-----------------------------------------------------------| + * | | | | Ç| |BTG| |MUT| | | | | | + * |-----------------------------------------------------------| + * | | | | PLY/PAU | | | | + * `-----------------------------------------------------------' + */ + [_FL] = KEYMAP_ISO_HHKB(\ + + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_PSCR, RESET, \ + _______,_______,KC_VOLU,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, _______, \ + KC_CAPS,KC_MPRV,KC_VOLD,KC_MNXT,_______,_______,RGB_TOG,RGB_MOD,RGB_M_B,RGB_VAI,RGB_VAD,BL_INC, BL_DEC, _______, \ + _______,_______,_______,_______,KC_CEDL,_______,BL_TOGG,_______,KC_MUTE,_______,_______,_______,_______, _______, \ + _______,_______,_______, KC_MPLY, _______,_______,_______, _______) + +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + if (record->event.pressed) { + switch(id) { + case 0: // Ñ + return MACRO(D(LALT), T(KP_0), T(KP_2), T(KP_4), T(KP_1), U(LALT), END); + case 1: // Ç + return MACRO(D(LALT), T(KP_0), T(KP_2), T(KP_3), T(KP_1), U(LALT), END); + } + } + return MACRO_NONE; +}; diff --git a/keyboards/satan/keymaps/isoHHKB/readme.md b/keyboards/satan/keymaps/isoHHKB/readme.md new file mode 100644 index 000000000..60454efb6 --- /dev/null +++ b/keyboards/satan/keymaps/isoHHKB/readme.md @@ -0,0 +1,55 @@ +# HKKB-ISO Satan Layout by Stunny + +This layout combines the split Right Shift ISO layout with the popular HHKB layout. The Caps Lock key will be replaced in the default layout by the Control key, which is more convenient for some people. + +This version is designed to have in its base layer letter 'Ñ' for Spanish writing. Also, 'ç' is included for those who have to write in French, Catalan or other languages that may need it. + +This keymap also supports control for a WS2812B RGB led strip connected to pin E2 of the microcontroller. If you want more functionalities, pls check RGB documentation at [QMK Docs]( https://docs.qmk.fm/feature_rgblight.html#rgb-lighting). This also goes for backlighting functionalities. If you want more control, check [QMK Docs](https://docs.qmk.fm/feature_backlight.html#backlighting) on that. + +Base Layer: + +``` +,-----------------------------------------------------------. +|Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | +|-----------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret | +|-----------------------------------------------------------| +|Ctrl | A| S| D| F| G| H| J| K| L| Ñ| ;| ' |urn| +|-----------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Fn| +|-----------------------------------------------------------| +| |Alt|LGUI | Space |RGUI |Alt| | +`-----------------------------------------------------------' +``` + +Function Layer +``` +,-----------------------------------------------------------. +| |F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|PSR| RESET| +|-----------------------------------------------------------| +| | |VUP| | | | | | | | | | | | +|-----------------------------------------------------------| +|CapsLck|PRV|VDN|NXT| |RGB|FRW|BRT|VAI|VAD|INC|DEC| | | +|-----------------------------------------------------------| +| | | | Ç| |BTG| |MUT| | | | | | +|-----------------------------------------------------------| +| | | | PLY/PAU | | | | +`-----------------------------------------------------------' +``` + +Where: +- `PRV` is `KC_MEDIA_PREV_TRACK` +- `NXT` is `KC_MEDIA_NEXT_TRACK` +- `VUP` is `KC_AUDIO_VOL_UP` +- `VDN` is `KC_AUDIO_VOL_DOWN` +- `MUT` is `KC_AUDIO_MUTE` +- `PLY/PAU` is `KC_MEDIA_PLAY_PAUSE` +- `BTG` is `BL_TOGG` (toggles key backlighting) +- `INC` increases backlighting brightness +- `DEC` decreases backlighting brightness +- `PSR` is `KC_PSCREEN` +- `RGB` is `RGB_TOG` +- `FRW` jumps to next RGB mode +- `BRT` activates RGB breathing mode directly +- `VAI` increases RGB brightness +- `VAD` decreases RGB brightness diff --git a/keyboards/satan/keymaps/isoHHKB/rules.mk b/keyboards/satan/keymaps/isoHHKB/rules.mk new file mode 100644 index 000000000..026b33c7d --- /dev/null +++ b/keyboards/satan/keymaps/isoHHKB/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/isoHHKB/stunny_iso_hhkb.h b/keyboards/satan/keymaps/isoHHKB/stunny_iso_hhkb.h new file mode 100644 index 000000000..b5737f5af --- /dev/null +++ b/keyboards/satan/keymaps/isoHHKB/stunny_iso_hhkb.h @@ -0,0 +1,21 @@ +#ifndef STUNNY_ISO_HHKB_H +#define STUNNY_ISO_HHKB_H + +/* Satan ISO - HHKB matrix layout + * With 7u space bar, split right shift and 2u Backspace + * ,------------------------------------------------------------. + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * |------------------------------------------------------------| + * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| | + * |------------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c| 2d | + * |------------------------------------------------------------| + * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c | + * |------------------------------------------------------------| + * | | 41| 42 | 45 | 4a | 4b | | | + * `------------------------------------------------------------' + */ + +#define KEYMAP_ISO_HHKB KEYMAP_ISO_SPLITRSHIFT + +#endif From ed659aa3a84b415f91e640ffaaec2b97e78623c3 Mon Sep 17 00:00:00 2001 From: na7thana Date: Wed, 24 Jan 2018 22:04:31 -0800 Subject: [PATCH 082/556] Hi there :) (#2273) --- keyboards/jc65/keymaps/na7thana/config.h | 1 + keyboards/jc65/keymaps/na7thana/keymap.c | 18 ++++++++++++++++++ keyboards/jc65/keymaps/na7thana/readme.md | 10 ++++++++++ keyboards/jc65/keymaps/na7thana/rules.mk | 0 4 files changed, 29 insertions(+) create mode 100644 keyboards/jc65/keymaps/na7thana/config.h create mode 100644 keyboards/jc65/keymaps/na7thana/keymap.c create mode 100644 keyboards/jc65/keymaps/na7thana/readme.md create mode 100644 keyboards/jc65/keymaps/na7thana/rules.mk diff --git a/keyboards/jc65/keymaps/na7thana/config.h b/keyboards/jc65/keymaps/na7thana/config.h new file mode 100644 index 000000000..a5568e400 --- /dev/null +++ b/keyboards/jc65/keymaps/na7thana/config.h @@ -0,0 +1 @@ +#include "../../config.h" diff --git a/keyboards/jc65/keymaps/na7thana/keymap.c b/keyboards/jc65/keymaps/na7thana/keymap.c new file mode 100644 index 000000000..2f262efa9 --- /dev/null +++ b/keyboards/jc65/keymaps/na7thana/keymap.c @@ -0,0 +1,18 @@ +#include "jc65.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSLS, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LCTL, KC_LALT, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = KEYMAP( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_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_HOME, KC_END, KC_DEL, KC_TRNS, + KC_CAPS, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_VOLU, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_VOLD, KC_TRNS + ), +}; \ No newline at end of file diff --git a/keyboards/jc65/keymaps/na7thana/readme.md b/keyboards/jc65/keymaps/na7thana/readme.md new file mode 100644 index 000000000..13430a630 --- /dev/null +++ b/keyboards/jc65/keymaps/na7thana/readme.md @@ -0,0 +1,10 @@ +Default Keymap +=== + +Super simple default keymap with only a base layer. + +Keymap Maintainer: [Ethan Madden](https://github.com/jetpacktuxedo) + +Difference from base layout: This is (as close as I can tell) the same as the layout that ships on the boards other than default underglow color. + +Intended usage: This is mostly provided for testing before you build your own keymap and as a reference to a stock(ish) configuration diff --git a/keyboards/jc65/keymaps/na7thana/rules.mk b/keyboards/jc65/keymaps/na7thana/rules.mk new file mode 100644 index 000000000..e69de29bb From a9bbf9ee5cedcef9e7b7c88f8f7a3fa3b54e1800 Mon Sep 17 00:00:00 2001 From: manofinterests Date: Fri, 12 Jan 2018 19:41:14 -0800 Subject: [PATCH 083/556] hi there friends --- .../66/keymaps/manofinterests/keymap.c | 39 +++++++++++++++++++ .../66/keymaps/manofinterests/readme.md | 8 ++++ 2 files changed, 47 insertions(+) create mode 100644 keyboards/clueboard/66/keymaps/manofinterests/keymap.c create mode 100644 keyboards/clueboard/66/keymaps/manofinterests/readme.md diff --git a/keyboards/clueboard/66/keymaps/manofinterests/keymap.c b/keyboards/clueboard/66/keymaps/manofinterests/keymap.c new file mode 100644 index 000000000..ae74b12d1 --- /dev/null +++ b/keyboards/clueboard/66/keymaps/manofinterests/keymap.c @@ -0,0 +1,39 @@ +#include "66.h" + +// Helpful defines +#define _______ KC_TRNS + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +#define _BL 0 +#define _FL 1 +#define _CL 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = KEYMAP( + KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_GRV, KC_BSPC, RGB_VAI, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, RGB_VAD, \ + KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, \ + KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RO, KC_RSFT, KC_UP, \ + KC_LCTL,KC_LGUI,KC_LALT,KC_MHEN, KC_SPC, KC_SPC, KC_HENK,KC_RALT,MO(_FL),KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + */ +[_FL] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_DEL, KC_VOLU, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_MUTE, KC_VOLD, \ + _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_PGUP, \ + _______,_______,_______,_______, _______,_______, _______,_______,MO(_FL),_______,KC_HOME,KC_PGDN,KC_END), + + /* Keymap _CL: Control layer + */ +[_CL] = KEYMAP( + BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______,_______,RGB_TOG, RGB_VAI, \ + _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ + _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + MO(_FL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_SAI, \ + _______,_______,_______,_______, RGB_MOD, RGB_MOD, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI), +}; diff --git a/keyboards/clueboard/66/keymaps/manofinterests/readme.md b/keyboards/clueboard/66/keymaps/manofinterests/readme.md new file mode 100644 index 000000000..019131aeb --- /dev/null +++ b/keyboards/clueboard/66/keymaps/manofinterests/readme.md @@ -0,0 +1,8 @@ +![Clueboard Layout Image](http://i.imgur.com/7Capi8W.png) + +# Default Clueboard Layout + +This is the default layout that comes flashed on every Clueboard. For the most +part it's a straightforward and easy to follow layout. The only unusual key is +the key in the upper left, which sends Escape normally, but Grave when any of +the Ctrl, Alt, or GUI modifiers are held down. From 13d288116f59b6ea502f65ef669daeaf00433d21 Mon Sep 17 00:00:00 2001 From: Mason McAllaster Date: Thu, 25 Jan 2018 01:09:37 -0500 Subject: [PATCH 084/556] Adding personal keymap for planck/niu_mini (#2263) * Adding mason keymap for planck/niu_mini * Adding power shortcut --- keyboards/niu_mini/keymaps/mason/keymap.c | 116 ++++++++++++++++++++++ keyboards/planck/keymaps/mason/keymap.c | 116 ++++++++++++++++++++++ 2 files changed, 232 insertions(+) create mode 100644 keyboards/niu_mini/keymaps/mason/keymap.c create mode 100644 keyboards/planck/keymaps/mason/keymap.c diff --git a/keyboards/niu_mini/keymaps/mason/keymap.c b/keyboards/niu_mini/keymaps/mason/keymap.c new file mode 100644 index 000000000..09a755a87 --- /dev/null +++ b/keyboards/niu_mini/keymaps/mason/keymap.c @@ -0,0 +1,116 @@ +#include "niu_mini.h" + +enum layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum keycodes { + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ;: | '" | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_CAPS, KC_ESC, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | ~ | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______}, + {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), S(KC_BSLS), _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Ins | Home | PgUp | | | | - | = | [ | ] | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Del | End | PgDn | | | | ` | \ | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {_______, KC_INS, KC_HOME, KC_PGUP, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______}, + {_______, KC_DEL, KC_END, KC_PGDN, _______, _______, _______, KC_GRV, KC_BSLS, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |BLtogg|BLstep| | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |RGBtog|RGBhui|RGBhud|RGBmod|RGBsai|RGBsad| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_POWER}, + {_______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_MOD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/mason/keymap.c b/keyboards/planck/keymaps/mason/keymap.c new file mode 100644 index 000000000..87039cf4b --- /dev/null +++ b/keyboards/planck/keymaps/mason/keymap.c @@ -0,0 +1,116 @@ +#include "planck.h" + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ;: | '" | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_CAPS, KC_ESC, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | ~ | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______}, + {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), S(KC_BSLS), _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Ins | Home | PgUp | | | | - | = | [ | ] | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Del | End | PgDn | | | | ` | \ | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {_______, KC_INS, KC_HOME, KC_PGUP, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______}, + {_______, KC_DEL, KC_END, KC_PGDN, _______, _______, _______, KC_GRV, KC_BSLS, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |BLtogg|BLstep| | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |RGBtog|RGBhui|RGBhud|RGBmod|RGBsai|RGBsad| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_POWER}, + {_______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_MOD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} From 86225ccc9b22f6b7b3cbbb9c5c578ea31f2214fa Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Fri, 26 Jan 2018 13:57:09 +0100 Subject: [PATCH 085/556] katana60: fix bootloader size to work with PCB Fix the bootloader size so the `RESET` key actually resets to the bootloader instead of just restarting the boards. --- keyboards/katana60/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/katana60/rules.mk b/keyboards/katana60/rules.mk index a3571e8de..ca2a2a5f8 100644 --- a/keyboards/katana60/rules.mk +++ b/keyboards/katana60/rules.mk @@ -45,7 +45,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Atmel DFU loader 4096 # LUFA bootloader 4096 # USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options From bceffdefcac30dd8b08ec3b803af372cbf254a7b Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Mon, 29 Jan 2018 02:14:12 +0900 Subject: [PATCH 086/556] Add helix keyboard (#2308) * Fork from Let's Split * Organizing files * Delete some keymaps * I2C and serial enabled at the same time * Change readme * add #define HELIX_ROWS for multiple rows * Delete avrdude flashing script * Delete makefiles * Subproject elimination * Fix lufa path * Remove PLAY_NOTE_ARRAY usages to get rid of warning. Fix conflicting function name * Mousekey change default to off * Fix to oled display adjust * make rev2 change pin assign change keymap * use master_buffer * Timing adjustment * Organizing files * Change Keymap * Change Keymap Add EISU and KANA Correct 4rows * NKRO default to disable * EXTRAKEY_ENABLE default to disable * add rgb reset key * rgb custom function enable * Extend font * add RGBLED_POWER default folder to helix/rev2 RGB_ENABLE to no * renamed directory * Disable RGBLIGHT_CUSTOM_DRIVER * Disable LOCKING_SUPPORT_ENABLE * Update bootloader setting * Change readme * Fixed argument error --- keyboards/helix/common/glcdfont.c | 244 +++++++ keyboards/helix/config.h | 28 + keyboards/helix/helix.c | 1 + keyboards/helix/helix.h | 57 ++ keyboards/helix/i2c.c | 162 +++++ keyboards/helix/i2c.h | 49 ++ keyboards/helix/pro_micro.h | 362 ++++++++++ keyboards/helix/readme.md | 16 + keyboards/helix/rev1/config.h | 103 +++ .../helix/rev1/keymaps/OLED_sample/config.h | 54 ++ .../helix/rev1/keymaps/OLED_sample/keymap.c | 498 ++++++++++++++ .../helix/rev1/keymaps/OLED_sample/readme.md | 25 + .../helix/rev1/keymaps/OLED_sample/rules.mk | 25 + keyboards/helix/rev1/keymaps/default/config.h | 37 ++ keyboards/helix/rev1/keymaps/default/keymap.c | 349 ++++++++++ keyboards/helix/rev1/keymaps/default/rules.mk | 3 + keyboards/helix/rev1/matrix.c | 316 +++++++++ keyboards/helix/rev1/rev1.c | 39 ++ keyboards/helix/rev1/rev1.h | 145 +++++ keyboards/helix/rev1/rules.mk | 4 + keyboards/helix/rev1/split_util.c | 86 +++ keyboards/helix/rev1/split_util.h | 24 + keyboards/helix/rev2/config.h | 97 +++ keyboards/helix/rev2/keymaps/default/config.h | 54 ++ keyboards/helix/rev2/keymaps/default/keymap.c | 616 ++++++++++++++++++ .../helix/rev2/keymaps/default/readme.md | 25 + keyboards/helix/rev2/keymaps/default/rules.mk | 25 + keyboards/helix/rev2/matrix.c | 359 ++++++++++ keyboards/helix/rev2/rev2.c | 32 + keyboards/helix/rev2/rev2.h | 115 ++++ keyboards/helix/rev2/rules.mk | 3 + keyboards/helix/rev2/split_util.c | 71 ++ keyboards/helix/rev2/split_util.h | 23 + keyboards/helix/rules.mk | 73 +++ keyboards/helix/serial.c | 238 +++++++ keyboards/helix/serial.h | 36 + keyboards/helix/ssd1306.c | 324 +++++++++ keyboards/helix/ssd1306.h | 93 +++ 38 files changed, 4811 insertions(+) create mode 100644 keyboards/helix/common/glcdfont.c create mode 100644 keyboards/helix/config.h create mode 100644 keyboards/helix/helix.c create mode 100644 keyboards/helix/helix.h create mode 100644 keyboards/helix/i2c.c create mode 100644 keyboards/helix/i2c.h create mode 100644 keyboards/helix/pro_micro.h create mode 100644 keyboards/helix/readme.md create mode 100644 keyboards/helix/rev1/config.h create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/config.h create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/keymap.c create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/readme.md create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/rules.mk create mode 100644 keyboards/helix/rev1/keymaps/default/config.h create mode 100644 keyboards/helix/rev1/keymaps/default/keymap.c create mode 100644 keyboards/helix/rev1/keymaps/default/rules.mk create mode 100644 keyboards/helix/rev1/matrix.c create mode 100644 keyboards/helix/rev1/rev1.c create mode 100644 keyboards/helix/rev1/rev1.h create mode 100644 keyboards/helix/rev1/rules.mk create mode 100644 keyboards/helix/rev1/split_util.c create mode 100644 keyboards/helix/rev1/split_util.h create mode 100644 keyboards/helix/rev2/config.h create mode 100644 keyboards/helix/rev2/keymaps/default/config.h create mode 100644 keyboards/helix/rev2/keymaps/default/keymap.c create mode 100644 keyboards/helix/rev2/keymaps/default/readme.md create mode 100644 keyboards/helix/rev2/keymaps/default/rules.mk create mode 100644 keyboards/helix/rev2/matrix.c create mode 100644 keyboards/helix/rev2/rev2.c create mode 100644 keyboards/helix/rev2/rev2.h create mode 100644 keyboards/helix/rev2/rules.mk create mode 100644 keyboards/helix/rev2/split_util.c create mode 100644 keyboards/helix/rev2/split_util.h create mode 100644 keyboards/helix/rules.mk create mode 100644 keyboards/helix/serial.c create mode 100644 keyboards/helix/serial.h create mode 100644 keyboards/helix/ssd1306.c create mode 100644 keyboards/helix/ssd1306.h diff --git a/keyboards/helix/common/glcdfont.c b/keyboards/helix/common/glcdfont.c new file mode 100644 index 000000000..89665ba07 --- /dev/null +++ b/keyboards/helix/common/glcdfont.c @@ -0,0 +1,244 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x03, 0x07, 0x1F, 0x7F, 0xFF, 0xFF, + 0xFE, 0xF8, 0xF0, 0xC0, 0x20, 0xF8, + 0xFE, 0xFF, 0xFE, 0x79, 0x27, 0x1F, + 0x7F, 0xFF, 0xFF, 0xFE, 0xF8, 0xF0, + 0xC0, 0x20, 0xF8, 0xFE, 0xFF, 0xFF, + 0x7F, 0x3F, 0x3F, 0x7F, 0xFF, 0xFE, + 0xF8, 0xF0, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x7F, 0x7F, 0x7F, + 0xBF, 0xBF, 0xC0, 0xC0, 0xC0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, + 0xF8, 0x78, 0x78, 0x7C, 0x3C, 0x3C, + 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0xBF, 0xBF, 0xDF, 0xDF, 0xEF, 0xEF, + 0x00, 0x03, 0x07, 0x1F, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xF8, 0xE0, 0xC0, + 0xE0, 0xF8, 0xFE, 0xFF, 0xFF, 0xFF, + 0x7F, 0x1F, 0x07, 0x03, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC1, 0xF3, + 0xCF, 0xBF, 0x7F, 0xFF, 0xFF, 0xFC, + 0xFB, 0xE7, 0x81, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xE3, 0xCF, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFC, 0xFB, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x81, 0xE7, + 0xFF, 0xFF, 0xFF, 0xFF, 0x3C, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF8, 0xF8, 0xFC, 0x7C, 0x7E, + 0x7E, 0x3E, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF7, 0xF7, 0xF7, 0xFB, + 0xFB, 0x7D, 0x7D, 0x7D, 0xBE, 0xBE, + 0xBE, 0xDF, 0xDF, 0xE0, 0xE0, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xFC, 0xFC, 0x7C, 0x7E, 0x7E, + 0x3E, 0x3E, 0x1F, 0x1F, 0x1F, 0x0F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, + 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x70, 0x7C, 0x7F, 0x7F, 0x7F, + 0x7F, 0x1F, 0x06, 0x01, 0x03, 0x0F, + 0x3F, 0x7F, 0x7F, 0x7E, 0x7C, 0x7C, + 0x7E, 0x7F, 0x7F, 0x7F, 0x1F, 0x06, + 0x01, 0x07, 0x0F, 0x3F, 0x7F, 0x7F, + 0x7E, 0x7C, 0x7C, 0x7E, 0x7F, 0x7F, + 0x3F, 0x0F, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x7D, 0x7D, 0x3D, 0x3E, + 0x1E, 0x1F, 0x1F, 0x1F, 0x0F, 0x0F, + 0x07, 0x07, 0x07, 0x03, 0x03, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x00, 0x40, 0x70, 0x78, 0x7E, 0x7F, + 0x7F, 0x7F, 0x3F, 0x0F, 0x03, 0x01, + 0x03, 0x0F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7E, 0x78, 0x70, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +#endif // FONT5X7_H diff --git a/keyboards/helix/config.h b/keyboards/helix/config.h new file mode 100644 index 000000000..8f0524f97 --- /dev/null +++ b/keyboards/helix/config.h @@ -0,0 +1,28 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#ifdef SUBPROJECT_rev1 + #include "rev1/config.h" +#endif + +#endif diff --git a/keyboards/helix/helix.c b/keyboards/helix/helix.c new file mode 100644 index 000000000..539abd534 --- /dev/null +++ b/keyboards/helix/helix.c @@ -0,0 +1 @@ +#include "helix.h" diff --git a/keyboards/helix/helix.h b/keyboards/helix/helix.h new file mode 100644 index 000000000..cddeb8830 --- /dev/null +++ b/keyboards/helix/helix.h @@ -0,0 +1,57 @@ +#ifndef HELIX_H +#define HELIX_H + +#ifdef KEYBOARD_helix_rev1 + #include "rev1.h" +#endif +#ifdef KEYBOARD_helix_rev2 + #include "rev2.h" +#endif + +#if HELIX_ROWS == 3 + #define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + ) +#elif HELIX_ROWS == 4 + // Used to create a keymap using only KC_ prefixed keys + #define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) +#elif HELIX_ROWS == 5 + #define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45 \ + ) +#else + #error "expected HELIX_ROWS 3 or 4 or 5" +#endif + +#include "quantum.h" + +#endif diff --git a/keyboards/helix/i2c.c b/keyboards/helix/i2c.c new file mode 100644 index 000000000..084c890c4 --- /dev/null +++ b/keyboards/helix/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/helix/pro_micro.h b/keyboards/helix/pro_micro.h new file mode 100644 index 000000000..f9e7ed75d --- /dev/null +++ b/keyboards/helix/pro_micro.h @@ -0,0 +1,362 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +// Workaround for wrong definitions in "iom32u4.h". +// This should be fixed in the AVR toolchain. +#undef UHCON +#undef UHINT +#undef UHIEN +#undef UHADDR +#undef UHFNUM +#undef UHFNUML +#undef UHFNUMH +#undef UHFLEN +#undef UPINRQX +#undef UPINTX +#undef UPNUM +#undef UPRST +#undef UPCONX +#undef UPCFG0X +#undef UPCFG1X +#undef UPSTAX +#undef UPCFG2X +#undef UPIENX +#undef UPDATX +#undef TCCR2A +#undef WGM20 +#undef WGM21 +#undef COM2B0 +#undef COM2B1 +#undef COM2A0 +#undef COM2A1 +#undef TCCR2B +#undef CS20 +#undef CS21 +#undef CS22 +#undef WGM22 +#undef FOC2B +#undef FOC2A +#undef TCNT2 +#undef TCNT2_0 +#undef TCNT2_1 +#undef TCNT2_2 +#undef TCNT2_3 +#undef TCNT2_4 +#undef TCNT2_5 +#undef TCNT2_6 +#undef TCNT2_7 +#undef OCR2A +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 +#undef OCR2B +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 + +#define NUM_DIGITAL_PINS 30 +#define NUM_ANALOG_INPUTS 12 + +#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) +#define TXLED0 PORTD |= (1<<5) +#define TXLED1 PORTD &= ~(1<<5) +#define RXLED0 PORTB |= (1<<0) +#define RXLED1 PORTB &= ~(1<<0) + +static const uint8_t SDA = 2; +static const uint8_t SCL = 3; +#define LED_BUILTIN 13 + +// Map SPI port to 'new' pins D14..D17 +static const uint8_t SS = 17; +static const uint8_t MOSI = 16; +static const uint8_t MISO = 14; +static const uint8_t SCK = 15; + +// Mapping of analog pins as digital I/O +// A6-A11 share with digital pins +static const uint8_t ADC0 = 18; +static const uint8_t ADC1 = 19; +static const uint8_t ADC2 = 20; +static const uint8_t ADC3 = 21; +static const uint8_t ADC4 = 22; +static const uint8_t ADC5 = 23; +static const uint8_t ADC6 = 24; // D4 +static const uint8_t ADC7 = 25; // D6 +static const uint8_t ADC8 = 26; // D8 +static const uint8_t ADC9 = 27; // D9 +static const uint8_t ADC10 = 28; // D10 +static const uint8_t ADC11 = 29; // D12 + +#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) 0 +#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) +#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) + +// __AVR_ATmega32U4__ has an unusual mapping of pins to channels +extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; +#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) + +#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) + +#ifdef ARDUINO_MAIN + +// On the Arduino board, digital pins are also used +// for the analog output (software PWM). Analog input +// pins are a separate set. + +// ATMEL ATMEGA32U4 / ARDUINO LEONARDO +// +// D0 PD2 RXD1/INT2 +// D1 PD3 TXD1/INT3 +// D2 PD1 SDA SDA/INT1 +// D3# PD0 PWM8/SCL OC0B/SCL/INT0 +// D4 A6 PD4 ADC8 +// D5# PC6 ??? OC3A/#OC4A +// D6# A7 PD7 FastPWM #OC4D/ADC10 +// D7 PE6 INT6/AIN0 +// +// D8 A8 PB4 ADC11/PCINT4 +// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 +// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 +// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 +// D12 A11 PD6 T1/#OC4D/ADC9 +// D13# PC7 PWM10 CLK0/OC4A +// +// A0 D18 PF7 ADC7 +// A1 D19 PF6 ADC6 +// A2 D20 PF5 ADC5 +// A3 D21 PF4 ADC4 +// A4 D22 PF1 ADC1 +// A5 D23 PF0 ADC0 +// +// New pins D14..D17 to map SPI port to digital pins +// +// MISO D14 PB3 MISO,PCINT3 +// SCK D15 PB1 SCK,PCINT1 +// MOSI D16 PB2 MOSI,PCINT2 +// SS D17 PB0 RXLED,SS/PCINT0 +// +// Connected LEDs on board for TX and RX +// TXLED D24 PD5 XCK1 +// RXLED D17 PB0 +// HWB PE2 HWB + +// these arrays map port names (e.g. port B) to the +// appropriate addresses for various functions (e.g. reading +// and writing) +const uint16_t PROGMEM port_to_mode_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &DDRB, + (uint16_t) &DDRC, + (uint16_t) &DDRD, + (uint16_t) &DDRE, + (uint16_t) &DDRF, +}; + +const uint16_t PROGMEM port_to_output_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PORTB, + (uint16_t) &PORTC, + (uint16_t) &PORTD, + (uint16_t) &PORTE, + (uint16_t) &PORTF, +}; + +const uint16_t PROGMEM port_to_input_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PINB, + (uint16_t) &PINC, + (uint16_t) &PIND, + (uint16_t) &PINE, + (uint16_t) &PINF, +}; + +const uint8_t PROGMEM digital_pin_to_port_PGM[] = { + PD, // D0 - PD2 + PD, // D1 - PD3 + PD, // D2 - PD1 + PD, // D3 - PD0 + PD, // D4 - PD4 + PC, // D5 - PC6 + PD, // D6 - PD7 + PE, // D7 - PE6 + + PB, // D8 - PB4 + PB, // D9 - PB5 + PB, // D10 - PB6 + PB, // D11 - PB7 + PD, // D12 - PD6 + PC, // D13 - PC7 + + PB, // D14 - MISO - PB3 + PB, // D15 - SCK - PB1 + PB, // D16 - MOSI - PB2 + PB, // D17 - SS - PB0 + + PF, // D18 - A0 - PF7 + PF, // D19 - A1 - PF6 + PF, // D20 - A2 - PF5 + PF, // D21 - A3 - PF4 + PF, // D22 - A4 - PF1 + PF, // D23 - A5 - PF0 + + PD, // D24 - PD5 + PD, // D25 / D6 - A7 - PD7 + PB, // D26 / D8 - A8 - PB4 + PB, // D27 / D9 - A9 - PB5 + PB, // D28 / D10 - A10 - PB6 + PD, // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { + _BV(2), // D0 - PD2 + _BV(3), // D1 - PD3 + _BV(1), // D2 - PD1 + _BV(0), // D3 - PD0 + _BV(4), // D4 - PD4 + _BV(6), // D5 - PC6 + _BV(7), // D6 - PD7 + _BV(6), // D7 - PE6 + + _BV(4), // D8 - PB4 + _BV(5), // D9 - PB5 + _BV(6), // D10 - PB6 + _BV(7), // D11 - PB7 + _BV(6), // D12 - PD6 + _BV(7), // D13 - PC7 + + _BV(3), // D14 - MISO - PB3 + _BV(1), // D15 - SCK - PB1 + _BV(2), // D16 - MOSI - PB2 + _BV(0), // D17 - SS - PB0 + + _BV(7), // D18 - A0 - PF7 + _BV(6), // D19 - A1 - PF6 + _BV(5), // D20 - A2 - PF5 + _BV(4), // D21 - A3 - PF4 + _BV(1), // D22 - A4 - PF1 + _BV(0), // D23 - A5 - PF0 + + _BV(5), // D24 - PD5 + _BV(7), // D25 / D6 - A7 - PD7 + _BV(4), // D26 / D8 - A8 - PB4 + _BV(5), // D27 / D9 - A9 - PB5 + _BV(6), // D28 / D10 - A10 - PB6 + _BV(6), // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + TIMER0B, /* 3 */ + NOT_ON_TIMER, + TIMER3A, /* 5 */ + TIMER4D, /* 6 */ + NOT_ON_TIMER, + + NOT_ON_TIMER, + TIMER1A, /* 9 */ + TIMER1B, /* 10 */ + TIMER0A, /* 11 */ + + NOT_ON_TIMER, + TIMER4A, /* 13 */ + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, +}; + +const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { + 7, // A0 PF7 ADC7 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 + 4, // A3 PF4 ADC4 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 + 8, // A6 D4 PD4 ADC8 + 10, // A7 D6 PD7 ADC10 + 11, // A8 D8 PB4 ADC11 + 12, // A9 D9 PB5 ADC12 + 13, // A10 D10 PB6 ADC13 + 9 // A11 D12 PD6 ADC9 +}; + +#endif /* ARDUINO_MAIN */ + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* Pins_Arduino_h */ diff --git a/keyboards/helix/readme.md b/keyboards/helix/readme.md new file mode 100644 index 000000000..5ee233e81 --- /dev/null +++ b/keyboards/helix/readme.md @@ -0,0 +1,16 @@ +Helix +=== + +![Helix](https://i.imgur.com/XBAmynN.jpg) + +A compact split ortholinear keyboard. + +Keyboard Maintainer: [Makoto Kurauchi](https://github.com/MakotoKurauchi/) [@pluis9](https://twitter.com/pluis9) +Hardware Supported: Helix PCB Alpha, Beta, Pro Micro +Hardware Availability: [PCB & Case Data](https://github.com/MakotoKurauchi/helix), [Yushakobo Shop](https://yushakobo.jp/shop/) + +Make example for this keyboard (after setting up your build environment): + + make helix:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/helix/rev1/config.h b/keyboards/helix/rev1/config.h new file mode 100644 index 000000000..3420992d8 --- /dev/null +++ b/keyboards/helix/rev1/config.h @@ -0,0 +1,103 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include "../config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yushakobo +#define PRODUCT Helix Alpha +#define DESCRIPTION A split keyboard for the cheap makers + +#define HELIX_ROWS 5 + +/* key matrix size */ +// Rows are doubled-up +#if HELIX_ROWS == 3 + #define MATRIX_ROWS 6 + #define MATRIX_COLS 6 + #define MATRIX_ROW_PINS { D7, E6, B4 } +#elif HELIX_ROWS == 4 + #define MATRIX_ROWS 8 + #define MATRIX_COLS 6 + #define MATRIX_ROW_PINS { D7, E6, B4, B5 } +#elif HELIX_ROWS == 5 + #define MATRIX_ROWS 10 + #define MATRIX_COLS 6 + #define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } +#else + #error "expected HELIX_ROWS 3 or 4 or 5" +#endif + +// wiring of each half +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +#define CATERINA_BOOTLOADER + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + + +#endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/config.h b/keyboards/helix/rev1/keymaps/OLED_sample/config.h new file mode 100644 index 000000000..6cd3072b1 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/config.h @@ -0,0 +1,54 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial */ + +#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c new file mode 100644 index 000000000..4f1ffb7c5 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c @@ -0,0 +1,498 @@ +#include "helix.h" +#include "bootloader.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "LUFA/Drivers/Peripheral/TWI.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +#if HELIX_ROWS == 5 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#elif HELIX_ROWS == 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + + [_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#else +#error "undefined keymaps" +#endif + + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(16); + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(15); + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + RGB_current_mode = rgblight_config.mode; +} + +//SSD1306 OLED init and update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED +void matrix_master_OLED_init (void) { + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(0); // turns on the display +} + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} +#endif + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + switch (id) { + case KC_SAMPLEMACRO: + if (record->event.pressed){ + return MACRO (I(10), T(H), T(E), T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); + } + + } + + return MACRO_NONE; +} diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/readme.md b/keyboards/helix/rev1/keymaps/OLED_sample/readme.md new file mode 100644 index 000000000..02888855b --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/readme.md @@ -0,0 +1,25 @@ +SSD1306 OLED Display via I2C +====== + +Features +-------- + +Some features supported by the firmware: + + +* I2C connection between the two halves is required as the OLED display will use this connection as well. Note this + requires pull-up resistors on the data and clock lines. +* OLED display will connect from either side + + +Wiring +------ + + +Work in progress... + + +OLED Configuration +------------------------------- + +Work in progress... diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk new file mode 100644 index 000000000..67a0ff2d8 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk @@ -0,0 +1,25 @@ + +# 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 = no # 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 +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 = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +ONEHAND_ENABLE = no # Enable one-hand typing + +# 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 diff --git a/keyboards/helix/rev1/keymaps/default/config.h b/keyboards/helix/rev1/keymaps/default/config.h new file mode 100644 index 000000000..7f33a4363 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/default/config.h @@ -0,0 +1,37 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + +#endif \ No newline at end of file diff --git a/keyboards/helix/rev1/keymaps/default/keymap.c b/keyboards/helix/rev1/keymaps/default/keymap.c new file mode 100644 index 000000000..d7cf34053 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/default/keymap.c @@ -0,0 +1,349 @@ +#include "helix.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#if HELIX_ROWS == 5 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#elif HELIX_ROWS == 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + + [_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#else +#error "undefined keymaps" +#endif + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/helix/rev1/keymaps/default/rules.mk b/keyboards/helix/rev1/keymaps/default/rules.mk new file mode 100644 index 000000000..457a3d01d --- /dev/null +++ b/keyboards/helix/rev1/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/helix/rev1/matrix.c b/keyboards/helix/rev1/matrix.c new file mode 100644 index 000000000..375057a6f --- /dev/null +++ b/keyboards/helix/rev1/matrix.c @@ -0,0 +1,316 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + int ret = _matrix_scan(); + + + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/helix/rev1/rev1.c b/keyboards/helix/rev1/rev1.c new file mode 100644 index 000000000..950e4eec3 --- /dev/null +++ b/keyboards/helix/rev1/rev1.c @@ -0,0 +1,39 @@ +#include "helix.h" + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); + #endif + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + +void shutdown_kb(void) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); + #endif +} diff --git a/keyboards/helix/rev1/rev1.h b/keyboards/helix/rev1/rev1.h new file mode 100644 index 000000000..fb56de022 --- /dev/null +++ b/keyboards/helix/rev1/rev1.h @@ -0,0 +1,145 @@ +#ifndef REV1_H +#define REV1_CONFIG_H + +#include "../helix.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +#if HELIX_ROWS == 3 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + } + #endif +#elif HELIX_ROWS == 4 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 } \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 } \ + } + #endif +#elif HELIX_ROWS == 5 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { R45, R44, R43, R42, R41, R40 } \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 } \ + } + #endif +#else + #error "expected HELIX_ROWS 3 or 4 or 5" +#endif + +#endif diff --git a/keyboards/helix/rev1/rules.mk b/keyboards/helix/rev1/rules.mk new file mode 100644 index 000000000..daba80eae --- /dev/null +++ b/keyboards/helix/rev1/rules.mk @@ -0,0 +1,4 @@ +SRC += rev1/matrix.c \ + rev1/split_util.c + +BACKLIGHT_ENABLE = no diff --git a/keyboards/helix/rev1/split_util.c b/keyboards/helix/rev1/split_util.c new file mode 100644 index 000000000..5debd6e00 --- /dev/null +++ b/keyboards/helix/rev1/split_util.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { +#ifdef USE_I2C +#ifdef SSD1306OLED + matrix_master_OLED_init (); +#endif +#endif +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< + +#ifdef EE_HANDS + #define EECONFIG_BOOTMAGIC_END (uint8_t *)10 + #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END +#endif + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); +void keyboard_slave_loop(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h new file mode 100644 index 000000000..42878d5c0 --- /dev/null +++ b/keyboards/helix/rev2/config.h @@ -0,0 +1,97 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef REV2_CONFIG_H +#define REV2_CONFIG_H + +#include "../config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yushakobo +#define PRODUCT Helix Beta +#define DESCRIPTION A split keyboard for the cheap makers + +#define HELIX_ROWS 5 + +/* key matrix size */ +// Rows are doubled-up +#if HELIX_ROWS == 4 + #define MATRIX_ROWS 8 + #define MATRIX_COLS 7 + #define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#elif HELIX_ROWS == 5 + #define MATRIX_ROWS 10 + #define MATRIX_COLS 7 + #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#else + #error "expected HELIX_ROWS 4 or 5" +#endif + +// wiring of each half +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + + +#endif diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h new file mode 100644 index 000000000..1b3875fcd --- /dev/null +++ b/keyboards/helix/rev2/keymaps/default/config.h @@ -0,0 +1,54 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial */ + +#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +//#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 +#define RGBLIGHT_LIMIT_VAL 255 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 +#endif diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c new file mode 100644 index 000000000..b8a9baee3 --- /dev/null +++ b/keyboards/helix/rev2/keymaps/default/keymap.c @@ -0,0 +1,616 @@ +#include "helix.h" +#include "bootloader.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#include "LUFA/Drivers/Peripheral/TWI.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + EISU, + KANA, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +#if HELIX_ROWS == 5 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | [ | ] | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | [ | ] | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | [ | ] | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LBRC, KC_RBRC, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | ( | ) | F12 | | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | F12 | | |PageDn|PageUp| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Reset|RGBRST| | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff| Mac | | Win |Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +#elif HELIX_ROWS == 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | Home | End | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | |PageDn|PageUp| | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset| | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff| Mac | | Win |Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +#else +#error "undefined keymaps" +#endif + + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_FNLAYER 64 +#define L_NUMLAY 128 +#define L_NLOWER 136 +#define L_NFNLAYER 192 +#define L_MOUSECURSOR 256 +#define L_ADJUST 65536 +#define L_ADJUST_TRI 65560 + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(matrix, PSTR("Lower")); + break; + case L_ADJUST: + case L_ADJUST_TRI: + matrix_write_P(matrix, PSTR("Adjust")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int ret=serial_update_buffers(); + if (ret ) { + if(ret==2)RXLED1; + return 1; + } +RXLED0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + +// if(serial_slave_DATA_CORRUPT()){ +// TXLED0; + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[offset+i] = serial_master_buffer[i]; + } + +// }else{ +// TXLED1; +// } + + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + +#ifndef KEYBOARD_helix_rev1 + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_master_buffer[i] = matrix[offset+i]; + } +#endif +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c new file mode 100644 index 000000000..1b23edb79 --- /dev/null +++ b/keyboards/helix/rev2/rev2.c @@ -0,0 +1,32 @@ +#include "helix.h" + + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); + #endif + + matrix_init_user(); +}; + +void shutdown_kb(void) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); + #endif +} diff --git a/keyboards/helix/rev2/rev2.h b/keyboards/helix/rev2/rev2.h new file mode 100644 index 000000000..7cab57ea0 --- /dev/null +++ b/keyboards/helix/rev2/rev2.h @@ -0,0 +1,115 @@ +#ifndef REV2_H +#define REV2_CONFIG_H + +#include "../helix.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +#if HELIX_ROWS == 4 +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { R05, R04, R03, R02, R01, R00, KC_NO }, \ + { R15, R14, R13, R12, R11, R10, KC_NO }, \ + { R25, R24, R23, R22, R21, R20, KC_NO }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { KC_NO, R00, R01, R02, R03, R04, R05 }, \ + { KC_NO, R10, R11, R12, R13, R14, R15 }, \ + { KC_NO, R20, R21, R22, R23, R24, R25 }, \ + { R36, R30, R31, R32, R33, R34, R35 }, \ + } +#endif +#elif HELIX_ROWS == 5 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R05, R04, R03, R02, R01, R00, KC_NO }, \ + { R15, R14, R13, R12, R11, R10, KC_NO }, \ + { R25, R24, R23, R22, R21, R20, KC_NO }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + { R45, R44, R43, R42, R41, R40, R46 } \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { KC_NO, R00, R01, R02, R03, R04, R05 }, \ + { KC_NO, R10, R11, R12, R13, R14, R15 }, \ + { KC_NO, R20, R21, R22, R23, R24, R25 }, \ + { R36, R30, R31, R32, R33, R34, R35 }, \ + { R46, R40, R41, R42, R43, R44, R45 } \ + } + #endif +#else + #error "expected HELIX_ROWS 4 or 5" +#endif + +#endif diff --git a/keyboards/helix/rev2/rules.mk b/keyboards/helix/rev2/rules.mk new file mode 100644 index 000000000..6ab01f44b --- /dev/null +++ b/keyboards/helix/rev2/rules.mk @@ -0,0 +1,3 @@ +SRC += rev2/matrix.c \ + rev2/split_util.c \ + ws2812.c diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c new file mode 100644 index 000000000..8bc064174 --- /dev/null +++ b/keyboards/helix/rev2/split_util.c @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< + +#ifdef EE_HANDS + #define EECONFIG_BOOTMAGIC_END (uint8_t *)10 + #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END +#endif + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/helix/rules.mk b/keyboards/helix/rules.mk new file mode 100644 index 000000000..c35f93fb0 --- /dev/null +++ b/keyboards/helix/rules.mk @@ -0,0 +1,73 @@ +SRC += i2c.c \ + serial.c \ + ssd1306.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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. +SUBPROJECT_rev1 = no +USE_I2C = 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 + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = helix/rev2 diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c new file mode 100644 index 000000000..e918ab6ee --- /dev/null +++ b/keyboards/helix/serial.c @@ -0,0 +1,238 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifdef USE_SERIAL + +// Serial pulse period in microseconds. Its probably a bad idea to lower this +// value. +#define SERIAL_DELAY 24 + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} +void serial_delay_short(void) { + _delay_us(SERIAL_DELAY-1); +} +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input(); + +#ifndef USE_SERIAL_PD2 + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +#else + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); +#endif +} + +// Used by the master to synchronize timing with the slave. +static +void sync_recv(void) { + serial_input(); + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); + //serial_delay(); + _delay_us(SERIAL_DELAY-5); +} + +// Used by the slave to send a synchronization signal to the master. +static +void sync_send(void) { + serial_output(); + + serial_low(); + serial_delay(); + + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + serial_input(); + for ( uint8_t i = 0; i < 8; ++i) { + byte = (byte << 1) | serial_read_pin(); + serial_delay(); + _delay_us(1); + } + + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 8; + serial_output(); + while( b-- ) { + if(data & (1 << b)) { + serial_high(); + } else { + serial_low(); + } + serial_delay(); + } +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + sync_send(); + + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_slave_buffer[i]); + sync_send(); + checksum += serial_slave_buffer[i]; + } + serial_write_byte(checksum); + sync_send(); + + // wait for the sync to finish sending + serial_delay(); + + // read the middle of pulses + _delay_us(SERIAL_DELAY/2); + + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_master_buffer[i] = serial_read_byte(); + sync_send(); + checksum_computed += serial_master_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_send(); + + serial_input(); // end transaction + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(1); + + // wait for the slaves response + serial_input(); + serial_high(); + _delay_us(SERIAL_DELAY); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + sei(); + return 1; + } + + // if the slave is present syncronize with it + sync_recv(); + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_slave_buffer[i] = serial_read_byte(); + sync_recv(); + checksum_computed += serial_slave_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_recv(); + + if (checksum_computed != checksum_received) { + sei(); + return 2; + } + + uint8_t checksum = 0; + // send data to the slave + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_master_buffer[i]); + sync_recv(); + checksum += serial_master_buffer[i]; + } + serial_write_byte(checksum); + sync_recv(); + + // always, release the line when not in use + serial_output(); + serial_high(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h new file mode 100644 index 000000000..8f15d6675 --- /dev/null +++ b/keyboards/helix/serial.h @@ -0,0 +1,36 @@ +#ifndef MY_SERIAL_H +#define MY_SERIAL_H + +#include "config.h" +#include + +/* TODO: some defines for interrupt setup */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND + +#ifndef USE_SERIAL_PD2 +#define SERIAL_PIN_MASK _BV(PD0) +#define SERIAL_PIN_INTERRUPT INT0_vect +#else +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect +#endif + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#ifdef KEYBOARD_helix_rev1 +#define SERIAL_MASTER_BUFFER_LENGTH 1 +#else +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 +#endif + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif diff --git a/keyboards/helix/ssd1306.c b/keyboards/helix/ssd1306.c new file mode 100644 index 000000000..80efc3d16 --- /dev/null +++ b/keyboards/helix/ssd1306.c @@ -0,0 +1,324 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#include "common/glcdfont.c" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ +#define ScreenOffInterval 300000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty) { + iota_gfx_flush(); + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} +#endif diff --git a/keyboards/helix/ssd1306.h b/keyboards/helix/ssd1306.h new file mode 100644 index 000000000..b65c505c9 --- /dev/null +++ b/keyboards/helix/ssd1306.h @@ -0,0 +1,93 @@ +#ifndef SSD1306_H +#define SSD1306_H + +#include +#include +#include "pincontrol.h" +#include "config.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + + + +#endif From f0f991dd89733b7dc9ca54042923c031b3b3ca73 Mon Sep 17 00:00:00 2001 From: Sam Perman Date: Sat, 27 Jan 2018 10:49:43 -0500 Subject: [PATCH 087/556] update sed to work on mac See https://stackoverflow.com/questions/19456518/invalid-command-code-despite-escaping-periods-using-sed --- util/new_project.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/new_project.sh b/util/new_project.sh index 0f507b679..11218440b 100755 --- a/util/new_project.sh +++ b/util/new_project.sh @@ -15,8 +15,8 @@ KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}') cp -r quantum/template keyboards/$KEYBOARD mv keyboards/$KEYBOARD/template.c keyboards/$KEYBOARD/$KEYBOARD.c mv keyboards/$KEYBOARD/template.h keyboards/$KEYBOARD/$KEYBOARD.h -find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD%;$KEYBOARD;g" {} \; -find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" {} \; +find keyboards/${KEYBOARD} -type f -exec sed -i'' -e "s;%KEYBOARD%;$KEYBOARD;g" {} \; +find keyboards/${KEYBOARD} -type f -exec sed -i'' -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" {} \; echo "######################################################" echo "# /keyboards/$KEYBOARD project created. To start" From 9bfaf66792310fae2d525633b280b354babca026 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sun, 28 Jan 2018 11:11:28 -0800 Subject: [PATCH 088/556] Always copy the firmware file to the root qmk_firmware directory (#2314) * Always copy the firmware file to the root qmk_firmware directory * remove circular dependency --- build_keyboard.mk | 4 +++- tmk_core/avr.mk | 2 +- tmk_core/chibios.mk | 2 +- tmk_core/rules.mk | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index cbdaaa010..bee8fcc87 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -113,9 +113,11 @@ endif # We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA ifdef MCU_FAMILY + FIRMWARE_FORMAT=bin PLATFORM=CHIBIOS else PLATFORM=AVR + FIRMWARE_FORMAT=hex endif ifeq ($(PLATFORM),CHIBIOS) @@ -270,7 +272,7 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) all: build check-size # Change the build target to build a HEX file or a library. -build: elf cphex +build: elf cpfirmware #build: elf hex eep lss sym #build: lib diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 30d4fe26e..24722736e 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -136,7 +136,7 @@ flip: $(BUILD_DIR)/$(TARGET).hex check-size DFU_PROGRAMMER ?= dfu-programmer -dfu: $(BUILD_DIR)/$(TARGET).hex check-size +dfu: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ echo "Error: Bootloader not found. Trying again in 5s." ;\ sleep 5 ;\ diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index cb0482d75..df9fa8498 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -220,7 +220,7 @@ qmk: $(BUILD_DIR)/$(TARGET).bin zip $(TARGET).qmk -urj $(BUILD_DIR)/$(TARGET).json printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk -dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter +dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin bin: $(BUILD_DIR)/$(TARGET).bin sizeafter diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 920a7f6ad..7a282cacc 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -216,9 +216,9 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) elf: $(BUILD_DIR)/$(TARGET).elf hex: $(BUILD_DIR)/$(TARGET).hex -cphex: hex - $(SILENT) || printf "Copying $(TARGET).hex to qmk_firmware folder" | $(AWK_CMD) - $(COPY) $(BUILD_DIR)/$(TARGET).hex $(TARGET).hex && $(PRINT_OK) +cpfirmware: $(FIRMWARE_FORMAT) + $(SILENT) || printf "Copying $(TARGET).$(FIRMWARE_FORMAT) to qmk_firmware folder" | $(AWK_CMD) + $(COPY) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) $(TARGET).$(FIRMWARE_FORMAT) && $(PRINT_OK) eep: $(BUILD_DIR)/$(TARGET).eep lss: $(BUILD_DIR)/$(TARGET).lss sym: $(BUILD_DIR)/$(TARGET).sym @@ -392,4 +392,4 @@ $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null))) .PHONY : all finish sizebefore sizeafter qmkversion \ gccversion build elf hex eep lss sym coff extcoff \ clean clean_list debug gdb-config show_path \ -program teensy dfu flip dfu-ee flip-ee dfu-start \ No newline at end of file +program teensy dfu flip dfu-ee flip-ee dfu-start From 056ecb1463de9fd5ab17e4b15893b2fbd2b1c339 Mon Sep 17 00:00:00 2001 From: sanosis Date: Sun, 28 Jan 2018 20:46:22 +0100 Subject: [PATCH 089/556] Adding jj40 to keyboard list (#2315) * Adding jj40 to keyboard list Adding jj40 to Community-supported list. * Update readme.md --- keyboards/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/readme.md b/keyboards/readme.md index eb77bf56c..b81d5841e 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -44,6 +44,7 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [Happy Hacking Keyboard](/keyboards/hhkb) — The Happy Hacking keyboard can be hacked with a custom controller to run QMK. * [Infinity 60%](/keyboards/infinity60) - — Compact community keyboard by Input Club. * [JD45](/keyboards/jd45) — Another Geekhack community project, designed by jdcarpe. +* [JJ40](/keyboards/jj40) — ps2avrGB based ortholinear sold by KPrepublic * [KBD75](/keyboards/kbd75) — A 75% keyboard made by made by KBDFans. * [KC60](/keyboards/kc60) — A programmable Chinese-made keyboard, lost in the mists of time. * [Kinesis Advantage](/keyboards/kinesis) — Contoured ergonomic keyboard by Kinesis Computer Ergonomics. From 2480e5d69a11fd0774d16e57384b69c1e92cbfc8 Mon Sep 17 00:00:00 2001 From: sanosis Date: Sun, 28 Jan 2018 21:58:03 +0100 Subject: [PATCH 090/556] Support for YMDK NP21 (#2316) * ymdk_np21 initial support Base support of ymdk_np21 - based on jj40. Full grid layout * Update README.md Replacing description. * Adding YMDK NP21 to comunity list. Adding YMDK NP21 to community supported list. --- keyboards/readme.md | 1 + keyboards/ymdk_np21/README.md | 17 + keyboards/ymdk_np21/backlight.c | 212 ++++++++++ keyboards/ymdk_np21/backlight_custom.h | 15 + keyboards/ymdk_np21/breathing_custom.h | 140 +++++++ keyboards/ymdk_np21/config.h | 54 +++ keyboards/ymdk_np21/i2c.c | 104 +++++ keyboards/ymdk_np21/i2c.h | 25 ++ keyboards/ymdk_np21/keymaps/default/keymap.c | 47 +++ keyboards/ymdk_np21/matrix.c | 118 ++++++ keyboards/ymdk_np21/rules.mk | 59 +++ keyboards/ymdk_np21/usbconfig.h | 397 +++++++++++++++++++ keyboards/ymdk_np21/ymdk_np21.c | 80 ++++ keyboards/ymdk_np21/ymdk_np21.h | 43 ++ 14 files changed, 1312 insertions(+) create mode 100644 keyboards/ymdk_np21/README.md create mode 100644 keyboards/ymdk_np21/backlight.c create mode 100644 keyboards/ymdk_np21/backlight_custom.h create mode 100644 keyboards/ymdk_np21/breathing_custom.h create mode 100644 keyboards/ymdk_np21/config.h create mode 100644 keyboards/ymdk_np21/i2c.c create mode 100644 keyboards/ymdk_np21/i2c.h create mode 100644 keyboards/ymdk_np21/keymaps/default/keymap.c create mode 100644 keyboards/ymdk_np21/matrix.c create mode 100644 keyboards/ymdk_np21/rules.mk create mode 100644 keyboards/ymdk_np21/usbconfig.h create mode 100644 keyboards/ymdk_np21/ymdk_np21.c create mode 100644 keyboards/ymdk_np21/ymdk_np21.h diff --git a/keyboards/readme.md b/keyboards/readme.md index b81d5841e..35900f611 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -60,3 +60,4 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [WhiteFox](/keyboards/whitefox) — A 65% keyboard designed as a partnership by matt3o, Massdrop and Input Club * [Vision Division](/keyboards/vision_division) — Full Size / Split Linear Keyboard by IBNobody. * [XD75](/keyboards/xd75) — 15x5 ortholinear keyboard by XIUDI. +* [YMDK NP21](/keyboards/ymdk_np21) — ps2avrGB based number pad (numpad) sold by YMDK on Aliexpress. diff --git a/keyboards/ymdk_np21/README.md b/keyboards/ymdk_np21/README.md new file mode 100644 index 000000000..79e3386f0 --- /dev/null +++ b/keyboards/ymdk_np21/README.md @@ -0,0 +1,17 @@ +# YMDK NP21 + +![kp21 — full grid layout](https://ae01.alicdn.com/kf/HTB1d.txfHsTMeJjSszhq6AGCFXaF.jpg?size=35021&height=662&width=1000&hash=62b3a453686e2154dc51a7af67495e28) + +ps2avrGB based number-pad sold fully assembled by YMDK on Aliexpress. + +Keyboard Maintainer: [QMK Community](https://github.com/qmk) +Hardware Supported: Atmega32A +Hardware Availability: [AliExpress](https://www.aliexpress.com/item/21-Key-NPKC-Programmable-Cherry-MX-Kailh-Gateron-Switches-Mechanical-Keyboard-Numpad-Free-shipping/32812732361.html) + +Make example for this keyboard (after setting up your build environment): + + make ymdk_np21:default:program + +Plugging the board in while pressing 'Top Left Key' (USB on top) will force it to boot bootloader without loading the firmware. + +The code for NP21 is a minor edit of jj40. diff --git a/keyboards/ymdk_np21/backlight.c b/keyboards/ymdk_np21/backlight.c new file mode 100644 index 000000000..079c410ff --- /dev/null +++ b/keyboards/ymdk_np21/backlight.c @@ -0,0 +1,212 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#include "backlight.h" +#include "quantum.h" + +#include +#include + +#include "backlight_custom.h" +#include "breathing_custom.h" + +// DEBUG +#include +#include + +// Port D: digital pins of the AVR chipset +#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) +#define CAPSLOCK_PORT (1 << 2) // 2nd pin +#define BACKLIGHT_PORT (1 << 4) // 4th pin +#define SCROLLLOCK_PORT (1 << 6) // 6th pin + +#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 +#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default + +#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask + +#define PWM_MAX 0xFF +#define TIMER_TOP 255 // 8 bit PWM + +extern backlight_config_t backlight_config; + +/** + * References + * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation + * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b + * Timers: http://www.avrbeginners.net/architecture/timers/timers.html + * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ + * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware + */ + +// @Override +// turn LEDs on and off depending on USB caps/num/scroll lock states. +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + // turn on + DDRD |= NUMLOCK_PORT; + PORTD |= NUMLOCK_PORT; + } else { + // turn off + DDRD &= ~NUMLOCK_PORT; + PORTD &= ~NUMLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= CAPSLOCK_PORT; + PORTD |= CAPSLOCK_PORT; + } else { + DDRD &= ~CAPSLOCK_PORT; + PORTD &= ~CAPSLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRD |= SCROLLLOCK_PORT; + PORTD |= SCROLLLOCK_PORT; + } else { + DDRD &= ~SCROLLLOCK_PORT; + PORTD &= ~SCROLLLOCK_PORT; + } +} + +#ifdef BACKLIGHT_ENABLE + +// sets up Timer 1 for 8-bit PWM +void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE + // default 8 bit mode + TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH + TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW + + // clear output compare value A + // outb(OCR1AH, 0); + // outb(OCR1AL, 0); + + // clear output comparator registers for B + OCR1BH = 0; // outb(OCR1BH, 0); + OCR1BL = 0; // outb(OCR1BL, 0); +} + +bool is_init = false; +void timer1Init(void) { + // timer1SetPrescaler(TIMER1PRESCALE) + // set to DIV/64 + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE; + + // reset TCNT1 + TCNT1H = 0; // outb(TCNT1H, 0); + TCNT1L = 0; // outb(TCNT1L, 0); + + // TOIE1: Timer Overflow Interrupt Enable (Timer 1); + TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1); + + is_init = true; +} + +void timer1UnInit(void) { + // set prescaler back to NONE + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP + + // disable timer overflow interrupt + TIMSK &= ~_BV(TOIE1); // overflow bit? + + setPWM(0); + + is_init = false; +} + + +// handle TCNT1 overflow +//! Interrupt handler for tcnt1 overflow interrupt +ISR(TIMER1_OVF_vect, ISR_NOBLOCK) +{ + // sei(); + // handle breathing here + #ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + custom_breathing_handler(); + } + #endif + + // TODO call user defined function +} + +// enable timer 1 PWM +// timer1PWMBOn() +void timer1PWMBEnable(void) { + // turn on channel B (OC1B) PWM output + // set OC1B as non-inverted PWM + TCCR1A |= _BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +// disable timer 1 PWM +// timer1PWMBOff() +void timer1PWMBDisable(void) { + TCCR1A &= ~_BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +void enableBacklight(void) { + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high +} + +void disableBacklight(void) { + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low +} + +void startPWM(void) { + timer1Init(); + timer1PWMBEnable(); + enableBacklight(); +} + +void stopPWM(void) { + timer1UnInit(); + disableBacklight(); + timer1PWMBDisable(); +} + +void b_led_init_ports(void) { + /* turn backlight on/off depending on user preference */ + #if BACKLIGHT_ON_STATE == 0 + // DDRx register: sets the direction of Port D + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low + #else + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high + #endif + + timer1PWMSetup(); + startPWM(); + + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} + +void b_led_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) { + level = BACKLIGHT_LEVELS; + } + + setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS)); +} + +// called every matrix scan +void b_led_task(void) { + // do nothing for now +} + +void setPWM(uint16_t xValue) { + if (xValue > TIMER_TOP) { + xValue = TIMER_TOP; + } + OCR1B = xValue; // timer1PWMBSet(xValue); +} + +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/ymdk_np21/backlight_custom.h b/keyboards/ymdk_np21/backlight_custom.h new file mode 100644 index 000000000..7210be840 --- /dev/null +++ b/keyboards/ymdk_np21/backlight_custom.h @@ -0,0 +1,15 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifndef BACKLIGHT_CUSTOM_H +#define BACKLIGHT_CUSTOM_H + +#include +void b_led_init_ports(void); +void b_led_set(uint8_t level); +void b_led_task(void); +void setPWM(uint16_t xValue); + +#endif // BACKLIGHT_CUSTOM_H diff --git a/keyboards/ymdk_np21/breathing_custom.h b/keyboards/ymdk_np21/breathing_custom.h new file mode 100644 index 000000000..71416b1b4 --- /dev/null +++ b/keyboards/ymdk_np21/breathing_custom.h @@ -0,0 +1,140 @@ +/** + * Breathing effect code for PS2AVRGB boards (ATMEGA32A) + * Works in conjunction with `backlight.c`. + * + * Code adapted from `quantum.c` to register with the existing TIMER1 overflow + * handler in `backlight.c` instead of setting up its own timer. + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifdef BACKLIGHT_ENABLE +#ifdef BACKLIGHT_BREATHING + +#include "backlight_custom.h" + +#ifndef BREATHING_PERIOD +#define BREATHING_PERIOD 6 +#endif + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) + +// TODO make this share code with quantum.c + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + +void breathing_enable(void) { + breathing = true; + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + // interrupt already registered +} + +void breathing_pulse(void) { + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + // breathing_interrupt_enable(); + breathing = true; +} + +void breathing_disable(void) { + breathing = false; + // backlight_set(get_backlight_level()); + b_led_set(get_backlight_level()); // custom implementation of backlight_set() +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()) + breathing_disable(); + else + breathing_enable(); +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +void custom_breathing_handler(void) { + uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 244); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + // breathing_interrupt_disable(); + } + + setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U))); +} + +#endif // BACKLIGHT_BREATHING +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/ymdk_np21/config.h b/keyboards/ymdk_np21/config.h new file mode 100644 index 000000000..2b358113d --- /dev/null +++ b/keyboards/ymdk_np21/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "config_common.h" + +#ifndef CONFIG_H +#define CONFIG_H + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +// TODO: share these strings with usbconfig.h +// Edit usbconfig.h to change these. +#define MANUFACTURER ymdk +#define PRODUCT np21 + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 12 +// #define BACKLIGHT_BREATHING // works, but BL_TOGG might not work + +#define TAPPING_TOGGLE 3 + +#define NO_UART 1 + +/* RGB underglow */ +// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. +#define RGBLED_NUM 5 +#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. +#define RGBLIGHT_ANIMATIONS + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#endif diff --git a/keyboards/ymdk_np21/i2c.c b/keyboards/ymdk_np21/i2c.c new file mode 100644 index 000000000..c27f3e3d1 --- /dev/null +++ b/keyboards/ymdk_np21/i2c.c @@ -0,0 +1,104 @@ +/* +Copyright 2016 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef __I2C_H__ +#define __I2C_H__ + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + +#endif diff --git a/keyboards/ymdk_np21/keymaps/default/keymap.c b/keyboards/ymdk_np21/keymaps/default/keymap.c new file mode 100644 index 000000000..e79d326b7 --- /dev/null +++ b/keyboards/ymdk_np21/keymaps/default/keymap.c @@ -0,0 +1,47 @@ +#include "ymdk_np21.h" +#include "action_layer.h" + +#define _NP 0 +#define _BL 1 + +enum custom_keycodes { + NP = SAFE_RANGE, + BL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------. + * | 0 | 1 | 4 | 7 | NUM | ESC | + * |------+------+------+------+------+------| + * | . | 2 | 5 | 8 | / | TAB |---, + * |------+------+------+------+------+------|USB| + * | DOT | 3 | 6 | 9 | * | BS |---' + * |------+------+------+------+------+------| + * | Enter| Enter| + | + | - | FN | + * `-----------------------------------------' + */ +[_NP] = KEYMAP( \ + KC_KP_0, KC_KP_1, KC_KP_4, KC_KP_7, KC_NUMLOCK, KC_ESC, \ + KC_DOT, KC_KP_2, KC_KP_5, KC_KP_8, KC_KP_SLASH, KC_TAB, \ + KC_KP_DOT, KC_KP_3, KC_KP_6, KC_KP_9, KC_KP_ASTERISK, KC_BSPACE, \ + KC_KP_ENTER, KC_KP_ENTER, KC_KP_PLUS, KC_KP_PLUS, KC_KP_MINUS, MO(_BL) \ +), +/* Qwerty + * ,---------------------------------------------. + * | BL_BRTG | | | | | | + * |---------+--------+---------+--------+---+---| + * | | BL_OFF | BL_TOGG | BL_ON | | |---, + * |---------+--------+---------+--------+---+---|USB| + * | | | | | | |---' + * |---------+--------+---------+--------+---+---| + * | BL_DEC | BL_DEC | BL_INC | BL_INC | | | + * `---------------------------------------------' + */ +[_BL] = KEYMAP( \ + BL_BRTG, _______, _______, _______, _______, _______, \ + _______, BL_OFF, BL_TOGG, BL_ON, _______, _______, \ + _______, _______, _______, _______, _______, _______, \ + BL_DEC, BL_DEC, BL_INC, BL_INC, _______, _______ \ +) +}; diff --git a/keyboards/ymdk_np21/matrix.c b/keyboards/ymdk_np21/matrix.c new file mode 100644 index 000000000..a9e9cb539 --- /dev/null +++ b/keyboards/ymdk_np21/matrix.c @@ -0,0 +1,118 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include + +#include "matrix.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +void matrix_set_row_status(uint8_t row); +uint8_t bit_reverse(uint8_t x); + +void matrix_init(void) { + // all outputs for rows high + DDRB = 0xFF; + PORTB = 0xFF; + // all inputs for columns + DDRA = 0x00; + DDRC &= ~(0x111111<<2); + DDRD &= ~(1< 7 + (~PINA) & 0xFF + ) | ( + // cols 8..13, PORTC 7 -> 0 + bit_reverse((~PINC) & 0xFF) << 8 + ) | ( + // col 14, PORTD 7 + ((~PIND) & (1 << PIND7)) << 7 + ); + + if (matrix_debouncing[row] != cols) { + matrix_debouncing[row] = cols; + debouncing = DEBOUNCE; + } + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_quantum(); // also missing in original PS2AVRGB implementation + + return 1; +} + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +}; + +// declarations +void matrix_set_row_status(uint8_t row) { + DDRB = (1 << row); + PORTB = ~(1 << row); +} + +uint8_t bit_reverse(uint8_t x) { + x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + +inline matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { +} diff --git a/keyboards/ymdk_np21/rules.mk b/keyboards/ymdk_np21/rules.mk new file mode 100644 index 000000000..670967fbd --- /dev/null +++ b/keyboards/ymdk_np21/rules.mk @@ -0,0 +1,59 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes + +BACKLIGHT_ENABLE = yes +BACKLIGHT_CUSTOM_DRIVER = yes + +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +# DISABLE_WS2812 = no + +KEY_LOCK_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 + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/ymdk_np21/usbconfig.h b/keyboards/ymdk_np21/usbconfig.h new file mode 100644 index 000000000..ad97e7f0a --- /dev/null +++ b/keyboards/ymdk_np21/usbconfig.h @@ -0,0 +1,397 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'j', 'j', '4', '0' +#define USB_CFG_DEVICE_NAME_LEN 4 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/ymdk_np21/ymdk_np21.c b/keyboards/ymdk_np21/ymdk_np21.c new file mode 100644 index 000000000..670083a11 --- /dev/null +++ b/keyboards/ymdk_np21/ymdk_np21.c @@ -0,0 +1,80 @@ +/* +Copyright 2017 Luiz Ribeiro +Modified 2018 Kenneth A. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "ymdk_np21.h" + +#include + +#include "action_layer.h" +#include "quantum.h" + +#include "i2c.h" + +#include "backlight.h" +#include "backlight_custom.h" + +extern rgblight_config_t rgblight_config; + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + // matrix_init_user(); +} + +#ifdef BACKLIGHT_ENABLE +/// Overrides functions in `quantum.c` +void backlight_init_ports(void) { + b_led_init_ports(); +} + +void backlight_task(void) { + b_led_task(); +} + +void backlight_set(uint8_t level) { + b_led_set(level); +} +#endif + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i=0; i + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef KEYMAP_COMMON_H +#define KEYMAP_COMMON_H + +#include "quantum.h" +#include "quantum_keycodes.h" +#include "keycode.h" +#include "action.h" + +void matrix_init_user(void); // TODO port this to other PS2AVRGB boards + +#define KEYMAP_GRID( \ + K01, K02, K03, K04, K05, K06, \ + K11, K12, K13, K14, K15, K16, \ + K21, K22, K23, K24, K25, K26, \ + K31, K32, K33, K34, K35, K36 \ +) \ +{ \ + { K06, K05, K04, K03, K02, K01 }, \ + { K16, K15, K14, K13, K12, K11 }, \ + { K26, K25, K24, K23, K22, K21 }, \ + { K36, K35, K34, K33, K32, K31 } \ +} + +#define KEYMAP KEYMAP_GRID + +#endif From b0805e38b9389ff79e4ba9b4e35ec08b18f7a728 Mon Sep 17 00:00:00 2001 From: LEdiodes Date: Sun, 28 Jan 2018 14:58:42 -0600 Subject: [PATCH 091/556] added ATOM47 (Vortex Core QMK powered PCB) & DZ60 Custom config(LEdiodes) (#2310) * added ATOM47 (Vortex Core QMK powered PCB) * fixed broken\unfinished comment block * moved Layer template to default template. * moved Layer template to default template and removed template from the keymap.c file. * Added LEdiodes config * created readme.md contains an image of 60% board(LEdiodes). * updated readme.md with images added images of the PCB and some feature details from https://geekhack.org/index.php?topic=93447.msg2545221#msg2545221 * removed excess words. * followed the readme template to a T. * formatting fix : added a return. --- keyboards/atom47/atom47.c | 31 +++++ keyboards/atom47/atom47.h | 25 ++++ keyboards/atom47/config.h | 73 +++++++++++ keyboards/atom47/keymaps/LEdiodes/atom47.c | 31 +++++ keyboards/atom47/keymaps/LEdiodes/atom47.h | 25 ++++ keyboards/atom47/keymaps/LEdiodes/config.h | 73 +++++++++++ keyboards/atom47/keymaps/LEdiodes/keymap.c | 35 +++++ keyboards/atom47/keymaps/LEdiodes/rules.mk | 65 ++++++++++ keyboards/atom47/keymaps/default/keymap.c | 39 ++++++ keyboards/atom47/keymaps/default/readme.md | 10 ++ keyboards/atom47/readme.md | 28 ++++ keyboards/atom47/rules.mk | 65 ++++++++++ keyboards/dz60/keymaps/LEdiodes/config.h | 58 +++++++++ keyboards/dz60/keymaps/LEdiodes/keymap.c | 141 +++++++++++++++++++++ keyboards/dz60/keymaps/LEdiodes/readme.md | 9 ++ keyboards/dz60/keymaps/LEdiodes/rules.mk | 57 +++++++++ 16 files changed, 765 insertions(+) create mode 100644 keyboards/atom47/atom47.c create mode 100644 keyboards/atom47/atom47.h create mode 100644 keyboards/atom47/config.h create mode 100644 keyboards/atom47/keymaps/LEdiodes/atom47.c create mode 100644 keyboards/atom47/keymaps/LEdiodes/atom47.h create mode 100644 keyboards/atom47/keymaps/LEdiodes/config.h create mode 100644 keyboards/atom47/keymaps/LEdiodes/keymap.c create mode 100644 keyboards/atom47/keymaps/LEdiodes/rules.mk create mode 100644 keyboards/atom47/keymaps/default/keymap.c create mode 100644 keyboards/atom47/keymaps/default/readme.md create mode 100644 keyboards/atom47/readme.md create mode 100644 keyboards/atom47/rules.mk create mode 100644 keyboards/dz60/keymaps/LEdiodes/config.h create mode 100644 keyboards/dz60/keymaps/LEdiodes/keymap.c create mode 100644 keyboards/dz60/keymaps/LEdiodes/readme.md create mode 100644 keyboards/dz60/keymaps/LEdiodes/rules.mk diff --git a/keyboards/atom47/atom47.c b/keyboards/atom47/atom47.c new file mode 100644 index 000000000..7b839e796 --- /dev/null +++ b/keyboards/atom47/atom47.c @@ -0,0 +1,31 @@ +#include "atom47.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB &= ~(1<<5); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<. +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Vortex +#define PRODUCT Core +#define DESCRIPTION Atom47 PCB for the Vortex Core + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS {B1,B2,B3,B7} +#define MATRIX_COL_PINS {D7,D5,F0,F1,F4,F6,F7,D4,C7,C6,D6,B5,B4} +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +#endif + +#define RGB_DI_PIN D0 // The pin the LED strip is connected to +#define RGBLED_NUM 1 // Number of LEDs in your strip + +#define QMK_ESC_OUTPUT D7 // usually COL +#define QMK_ESC_INPUT B1 // usually ROW +#define QMK_LED B6 \ No newline at end of file diff --git a/keyboards/atom47/keymaps/LEdiodes/atom47.c b/keyboards/atom47/keymaps/LEdiodes/atom47.c new file mode 100644 index 000000000..7b839e796 --- /dev/null +++ b/keyboards/atom47/keymaps/LEdiodes/atom47.c @@ -0,0 +1,31 @@ +#include "atom47.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB &= ~(1<<5); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<. +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Vortex +#define PRODUCT Core +#define DESCRIPTION Atom47 PCB for the Vortex Core + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS {B1,B2,B3,B7} +#define MATRIX_COL_PINS {D7,D5,F0,F1,F4,F6,F7,D4,C7,C6,D6,B5,B4} +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +#endif + +#define RGB_DI_PIN D0 // The pin the LED strip is connected to +#define RGBLED_NUM 1 // Number of LEDs in your strip + +#define QMK_ESC_OUTPUT D7 // usually COL +#define QMK_ESC_INPUT B1 // usually ROW +#define QMK_LED B6 \ No newline at end of file diff --git a/keyboards/atom47/keymaps/LEdiodes/keymap.c b/keyboards/atom47/keymaps/LEdiodes/keymap.c new file mode 100644 index 000000000..3ea8609b6 --- /dev/null +++ b/keyboards/atom47/keymaps/LEdiodes/keymap.c @@ -0,0 +1,35 @@ +#include QMK_KEYBOARD_H + +// These are all aliases for the function layers. +#define _L0 0 +#define _L1 1 +#define _L2 2 +#define _L3 3 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_L0] = KEYMAP_ANSI( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, MO(_L1), \ + KC_LCTL, KC_LGUI, KC_LALT, TG(_L3), KC_SPC, KC_SPC, MO(_L2), KC_RALT, KC_APP, KC_RCTRL), \ + +[_L2] = KEYMAP_ANSI( + _______, KC_VOLD, KC_VOLU, KC_MUTE, RESET, _______, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_CAPS, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, _______, \ + _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_L1] = KEYMAP_ANSI( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + _______, _______, _______, _______, _______, KC_QUOT, KC_SLSH, KC_LBRC, KC_RBRC, KC_BSLS, KC_RSFT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_L3] = KEYMAP_ANSI( + _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_0, KC_DOT, _______, _______, _______, RESET), \ +}; diff --git a/keyboards/atom47/keymaps/LEdiodes/rules.mk b/keyboards/atom47/keymaps/LEdiodes/rules.mk new file mode 100644 index 000000000..d446d3a69 --- /dev/null +++ b/keyboards/atom47/keymaps/LEdiodes/rules.mk @@ -0,0 +1,65 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/atom47/keymaps/default/keymap.c b/keyboards/atom47/keymaps/default/keymap.c new file mode 100644 index 000000000..cd8e622f2 --- /dev/null +++ b/keyboards/atom47/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _MA 0 //Main layer +#define _FN 1 //Fn +#define _FN1 2 //Fn1 +#define _PN 3 //Pn + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_MA] = KEYMAP_ANSI( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, MO(_FN1), \ + KC_LCTL, KC_LGUI, KC_LALT, MO(_PN), KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_APP, KC_RCTRL), \ + +[_FN] = KEYMAP_ANSI( + _______, KC_VOLD, KC_VOLU, KC_MUTE, RESET, _______, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_CAPS, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, _______, \ + _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_FN1] = KEYMAP_ANSI( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + _______, _______, _______, _______, _______, KC_QUOT, KC_SLSH, KC_LBRC, KC_RBRC, KC_BSLS, KC_RSFT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_PN] = KEYMAP_ANSI( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET), +}; \ No newline at end of file diff --git a/keyboards/atom47/keymaps/default/readme.md b/keyboards/atom47/keymaps/default/readme.md new file mode 100644 index 000000000..02422eb97 --- /dev/null +++ b/keyboards/atom47/keymaps/default/readme.md @@ -0,0 +1,10 @@ +To be updated... + + +// This layer is just a blank template to be copied for easy layer creation. please don not edit it. + + [_LX] = KEYMAP_ANSI( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET), diff --git a/keyboards/atom47/readme.md b/keyboards/atom47/readme.md new file mode 100644 index 000000000..fec7843ae --- /dev/null +++ b/keyboards/atom47/readme.md @@ -0,0 +1,28 @@ +# ATOM47 + +![ATOM47](https://i.imgur.com/rjrFTKT.png) + +## Support +Keyboard Maintainer: [Matthew Kerfoot(https://github.com/mkerfoot) +Hardware Supported: ATOM47 +Hardware Availability: [GeekHack.com Group Buy](https://geekhack.org/index.php?topic=93447.msg2545221) + + +## Features +QMK Firmware +6 Underglow RGB leds +In-switch leds +Through-hole micro usb connector (less likely to break off!) +South facing leds for the QMX/Zealencio users +Multiple layouts +Easily reachable reset button under the spacebar +CapsLock indicator + +## Build +To build the default keymap, simply run `make atom47:default`. + +For an alternative, heavily modified layout you would just need to run `make atom47:LEdiodes`. + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +![ATOM47](https://i.imgur.com/WebeUOF.png) diff --git a/keyboards/atom47/rules.mk b/keyboards/atom47/rules.mk new file mode 100644 index 000000000..d446d3a69 --- /dev/null +++ b/keyboards/atom47/rules.mk @@ -0,0 +1,65 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/dz60/keymaps/LEdiodes/config.h b/keyboards/dz60/keymaps/LEdiodes/config.h new file mode 100644 index 000000000..bb78d9bb6 --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/config.h @@ -0,0 +1,58 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x2260 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT DZ60 +#define DESCRIPTION DZ60 Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 5 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN E2 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +/* sets 'Auto Shift' timeouts */ +#define AUTO_SHIFT_TIMEOUT 150 +#define NO_AUTO_SHIFT_SPECIAL + +#endif diff --git a/keyboards/dz60/keymaps/LEdiodes/keymap.c b/keyboards/dz60/keymaps/LEdiodes/keymap.c new file mode 100644 index 000000000..46bdb5fed --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/keymap.c @@ -0,0 +1,141 @@ +#include "xd60.h" +#include "action_layer.h" + +#Define _L0 0 +#Define _L1 1 +#Define _L2 2 +#Define _L3 3 +#Define _L4 4 + +#define _______ KC_TRNS + +/* + * template + * [_L1] = KEYMAP( + * _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + * _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + * _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + * _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + * _______,_______,_______, _______,_______,_______, _______,_______,_______,_______,_______, + * + * + *\ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap _L0: (Layer 0 - Base Layer) This is the default layer + * This layer has a key set to MO(_L1) which means when held down Layer 1 will become active, If Layer 1 does not have anything set for tat key is will revert to uing the key set at layer 0. + * LT(_L1, KC_1) means that when the "1" key is long touched then it will activate the layer _L1 key(F1) but if the key is just tapped it will activate the "1" key. + * KC_GESC = Escape when tapped, ` when pressed with Shift or GUI + * KC_LSPO = Left Shift when held, ( when tapped + * TD(LT(_L3,KC_SPACE)) = This is a test... hoping it will tap dance if double tapped it does enter if single tap it does space if long hold down it does _L3(Layer 3). + * LT(_L3,KC_SPACE) = if tapped it does space, is long touch it does _L3(Layer 3) + * BL_TOGG = Toggles the LEDs. + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bkspc| Del | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | _L4 | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | _L1 | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Win | Alt | _L3[Space] |LEdiodes| Space |Win | _L2| L | D | R | + * `-----------------------------------------------------------------------------------------' + */ +[_L0] = KEYMAP( + KC_GESC, LT(_L1, KC_1),LT(_L1, KC_2),LT(_L1, KC_3),LT(_L1, KC_4),LT(_L1, KC_5),LT(_L1, KC_6),LT(_L1, KC_7),LT(_L1, KC_8),LT(_L1, KC_9),LT(_L1, KC_0),LT(_L1, KC_MINS),LT(_L1, KC_EQL),KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPO, KC_UP, M0(_L1), \ + KC_LCTL, KC_LGUI, KC_LALT, TD(LT(_L3,KC_SPACE)),BL_TOGG,TD(TD_SPC_ENT), KC_RGUI, M0(_L2), KC_LEFT, KC_DOWN, KC_RIGHT), + +/* Keymap _L1: (Layer 1) This is function layer 1 + * This layer is activated while the Fn key is being held down. + * ,-----------------------------------------------------------------------------------------. + * | Reset | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | F13| F14| + * |-----------------------------------------------------------------------------------------+ + * | | WhUp| U | WhDn | | | | | | PrtScr | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | L | D | R | | | Home | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | End | VolDn|VolUp|Mute | | | PgUp| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | Home| PgDn| End | + * `-----------------------------------------------------------------------------------------' + */ +[_L1] = KEYMAP( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \ + _______, KC_WH_U, KC_UP, KC_WH_D, _______, _______,_______, _______, _______, _______, KC_PSCR, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_HOME, _______, _______, _______, KC_HOME, _______, _______, _______, \ + _______, _______, _______, KC_APP, BL_STEP,_______, KC_END, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______,_______,_______, _______, _______, KC_HOME, KC_PGDOWN, KC_END), + +/* Keymap _L2: (Layer 2) This is function layer 2 + * This layer is activated while the Fn2 key is being held down. + * LCA(KC_TAB) = Hold Left Control and Alt and press kc_tab which cycles trough open apps. + * MEH(KC_TAB) = Hold Left Control, Shift and Alt and press kc_TAB to cycle backwards through apps. + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | LCA(KC_TAB)| + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | |MEH(KC_TAB) + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | || | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ +[_L2] = KEYMAP( + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,LCA(KC_TAB), \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, MEH(KC_TAB), \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MS_BTN1,KC_MS_UP,KC_MS_BTN2, \ + _______,_______,_______, _______,_______,_______, _______,_______,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT, + +}; + +// Custom Actions +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; + +// Macros +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; +}; + +// Loop +void matrix_scan_user(void) { + // Empty +}; + +//Tap Dance Declarations +enum { + TD_SPC_ENT = 0, + TD_KC_LSFT_CAPS = 0, + TD_KC_RSFT_CAPS = 0 +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + + //Tap once for space, tap twice for enter + [TD_SPC_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT), + //Tap once for Left Shift, twice for Caps Lock + [TD_KC_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), + //Tap once for Right Shift, twice for Caps Lock + [TD_KC_RSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_RSFT, KC_CAPS) + +// Other declarations would go here, separated by commas, if you have them + +}; diff --git a/keyboards/dz60/keymaps/LEdiodes/readme.md b/keyboards/dz60/keymaps/LEdiodes/readme.md new file mode 100644 index 000000000..db83b2494 --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/readme.md @@ -0,0 +1,9 @@ +# LEdiodes Keymap for XD60 60% PCB + +![LEdiodes Layer 0 Keymap for XD60](https://i.imgur.com/pDneawX.jpg) + +## Additional Notes +Layer 0(default) Keymap for LEdiodes XD60. + +## Build +To build the default keymap, simply run `make xd60:LEdiodes`. diff --git a/keyboards/dz60/keymaps/LEdiodes/rules.mk b/keyboards/dz60/keymaps/LEdiodes/rules.mk new file mode 100644 index 000000000..f54d9500f --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/rules.mk @@ -0,0 +1,57 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # 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 +SLEEP_LED_ENABLE = no # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +AUTO_SHIFT_ENABLE = yes # If the time depressed is greater than or equal to the AUTO_SHIFT_TIMEOUT, then a shifted version of the key is emitted. If the time is less than the AUTO_SHIFT_TIMEOUT time, then the normal state is emitted \ No newline at end of file From 91c133f4e0e9ae232503a28768c35f054eeb771f Mon Sep 17 00:00:00 2001 From: Michael Kaylan <1063516+kaylanm@users.noreply.github.com> Date: Thu, 1 Feb 2018 16:12:23 -0600 Subject: [PATCH 092/556] Add missing parenthesis back to backlight_tick --- quantum/quantum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 65fa25961..f5246d9b1 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -904,7 +904,7 @@ void backlight_task(void) { _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); #endif } - backlight_tick = backlight_tick + 1 % 16; + backlight_tick = (backlight_tick + 1) % 16; } #endif From ee0a2b7dab2ecf1b1ca34db8ccdd378256f6a876 Mon Sep 17 00:00:00 2001 From: Mitchell van Manen Date: Thu, 1 Feb 2018 22:10:25 +0100 Subject: [PATCH 093/556] Imperial Match (Darth Vader's Theme) added crappy recording: https://clyp.it/0lufqils --- quantum/audio/song_list.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 4018f817c..d52f45d16 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -53,6 +53,12 @@ E__NOTE(_CS4), E__NOTE(_B4), QD_NOTE(_AS4), \ E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), +#define IMPERIAL_MARCH \ + HD_NOTE(_A4), HD_NOTE(_A4), HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), \ + HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), WD_NOTE(_A4), \ + HD_NOTE(_E5), HD_NOTE(_E5), HD_NOTE(_E5), QD_NOTE(_F5), QD_NOTE(_C5), \ + HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), WD_NOTE(_A4) + #define CLUEBOARD_SOUND \ HD_NOTE(_C3), HD_NOTE(_D3), HD_NOTE(_E3), HD_NOTE(_F3), HD_NOTE(_G3), HD_NOTE(_A4), HD_NOTE(_B4), HD_NOTE(_C4) /* From cee0a333964626bd93b6c6df48278eb3d18d3e9f Mon Sep 17 00:00:00 2001 From: Null <35205049+NuIIUC@users.noreply.github.com> Date: Thu, 1 Feb 2018 22:07:47 -0600 Subject: [PATCH 094/556] added my layout (#2326) * added my layout basically just default with proper arrow-keys * fixed arrow keys now works properly --- .../dz60/keymaps/Ansi_plus_fn_arrows/keymap.c | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c diff --git a/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c new file mode 100644 index 000000000..c00d55001 --- /dev/null +++ b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c @@ -0,0 +1,61 @@ +#include "dz60.h" + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_RALT, KC_RALT, KC_LGUI, KC_RCTL), + + KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + 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, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT), + + KEYMAP( + KC_TRNS, M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), M(12), 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_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), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} \ No newline at end of file From 7636fdbbd087d7c799829c1ce6112d0a90a7bc9d Mon Sep 17 00:00:00 2001 From: Oryhara Date: Thu, 1 Feb 2018 22:08:18 -0600 Subject: [PATCH 095/556] Halfkey function for every layer (#2327) * started work on halfkeyboard * update to keymap * halfkey layouts complete for dvorak and qwerty * added plover layout to halfkeyboard mapping * fixed error in dvorak layout right hand * fixed error in dvorak layout right hand, comments updated * thing * added minus and equals to normal layouts * added minus and equals to normal layouts * adde visualizer matching halfkeyboard mappings * adde visualizer matching halfkeyboard mappings * updated keymaps for mirror handedness functionality for all layers. Also added visualizer code for distinct color for each layer, and LCD text displaying the current layer. * had a KC_TILD where should have had KC_GRAV * its spelled KC_GRAVE --- .../keymaps/halfkeyboard/keymap.c | 337 +++++++++++------- .../keymaps/halfkeyboard/visualizer.c | 72 ++++ 2 files changed, 286 insertions(+), 123 deletions(-) create mode 100644 keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c index 0bf0a86a6..b1c3f7be4 100644 --- a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c @@ -8,7 +8,10 @@ #define DVORAK 2 // dvorak layer #define HALFDVORAK 3 // mirrored dvorak layer #define SYMB 5 // symbols -#define MDIA 6 // media keys +#define HALFSYMB 6 // media keys +#define PLVR 7 // steno plover layout +#define SHORTCUTS 8 //layer with shortcut keys + enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here @@ -21,258 +24,346 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: qwerty * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * | ESC | 1 | 2 | 3 | 4 | 5 | ` | | \ | 6 | 7 | 8 | 9 | 0 | BSPC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * | TAB | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | ' | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |ENTER | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * |Symbol|Dvorak| |Plover|HalfSymb| * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [QWERTY] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRAVE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, BL_ON, - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, TG(DVORAK), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MINUS, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), MO(SHORTCUTS), + TG(SYMB), TG(DVORAK), KC_HOME, - LT(HALFQWERTY, KC_SPACE),KC_BSPC,KC_END, + LT(HALFQWERTY, KC_SPACE),KC_DEL,KC_END, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SLASH, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, + KC_EQL,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - TG(DVORAK), KC_RALT, + TG(PLVR), TG(HALFSYMB), KC_PGUP, KC_PGDN,KC_TAB, LT(HALFQWERTY, KC_ENT) ), /* Keymap 1: mirrored qwerty * * ,--------------------------------------------------. ,--------------------------------------------------. - * | BSPC | 0 | 9 | 8 | 7 | 6 | LEFT | | RIGHT| 5 | 4 | 3 | 2 | 1 | ESC | + * | BSPC | 0 | 9 | 8 | 7 | 6 | \ | | ` | 5 | 4 | 3 | 2 | 1 | ESC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | \ | P | O | I | U | Y | L1 | | L1 | T | R | E | W | Q | TAB | + * | ' | P | O | I | U | Y | ] | | [ | T | R | E | W | Q | TAB | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | ENTER | ; | L | K | J | H |------| |------| G | F | D | S | A | BSPC | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| * | LShift | / | . | , | M | N | | | | B | V | C | X | Z | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * | | | | | | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [HALFQWERTY] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_BSPC, KC_0, KC_9, KC_8, KC_7, KC_6, KC_LEFT, - KC_TAB, KC_P, KC_O, KC_I, KC_U, KC_Y, TG(SYMB), - KC_BSPC, KC_SCLN, KC_L, KC_K, KC_J, KC_H, - KC_LSFT, KC_SLASH, KC_DOT, KC_COMM,KC_M, KC_N, KC_TRANSPARENT, - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, KC_TRANSPARENT, + KC_BSPC, KC_0, KC_9, KC_8, KC_7, KC_6, KC_BSLS, + KC_BSLS, KC_P, KC_O, KC_I, KC_U, KC_Y, KC_RBRC, + KC_ENT, KC_SCLN, KC_L, KC_K, KC_J, KC_H, + KC_LSFT, KC_SLASH, KC_DOT, KC_COMM,KC_M, KC_N, KC_EQL, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, + KC_TRNS, KC_TRANSPARENT, KC_HOME, - KC_TRANSPARENT,KC_BSPC,KC_END, + KC_TRANSPARENT,KC_DEL,KC_END, // right hand - KC_RGHT, KC_5, KC_4, KC_3, KC_2, KC_1, KC_BSPC, - TG(SYMB), KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSLS, + KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_1, KC_BSPC, + KC_LBRC, KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSLS, KC_G, KC_F, KC_D, KC_S, KC_A, KC_ENT, - MEH_T(KC_NO),KC_B, KC_V, KC_C, KC_X, KC_Z, KC_RSFT, + KC_MINUS,KC_B, KC_V, KC_C, KC_X, KC_Z, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - KC_TRANSPARENT, KC_RALT, + KC_TRANSPARENT, KC_TRNS, KC_PGUP, KC_PGDN,KC_TAB, KC_TRANSPARENT ), /* Keymap 3: dvorak * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * | ESC | 1 | 2 | 3 | 4 | 5 | ` | | \ | 6 | 7 | 8 | 9 | 0 | BSPC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | + * | TAB | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | / | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | S | - |ENTER | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |------| D | H | T | N | S |ENTER | + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * | Alt | | | |Alt | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [DVORAK] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, TG(SYMB), + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRAVE, + KC_TAB, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, KC_LBRC, KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, KC_TRANSPARENT, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_MINUS, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, + TG(SYMB), KC_TRANSPARENT, KC_HOME, - LT(HALFDVORAK, KC_SPACE),KC_BSPC,KC_END, + LT(HALFDVORAK, KC_SPACE),KC_DEL,KC_END, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - TG(SYMB), KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, - KC_D, KC_H, KC_T, KC_S, KC_MINUS, KC_ENT, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_RBRC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_EQL,KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - KC_TRANSPARENT, KC_RALT, + KC_TRANSPARENT, TG(HALFSYMB), KC_PGUP, KC_PGDN,KC_TAB, LT(HALFDVORAK, KC_ENT) ), /* Keymap 3: mirrored dvorak * * ,--------------------------------------------------. ,--------------------------------------------------. - * | BSPC | 0 | 9 | 8 | 7 | 6 | LEFT | | RIGHT| 5 | 4 | 3 | 2 | 1 | ESC | + * | BSPC | 0 | 9 | 8 | 7 | 6 | \ | | ` | 5 | 4 | 3 | 2 | 1 | ESC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | L | R | C | G | F | L1 | | L1 | Y | P | . | , | ' | / | + * | / | L | R | C | G | F | L1 | | L1 | Y | P | . | , | ' | TAB | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | - | S | T | H | D |------| |------| I | U | E | O | A |ENTER | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | ENTER | S | N | T | H | D |------| |------| I | U | E | O | A |BSPC | + * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| * | LShift | Z | V | W | M | B | | | | X | K | J | Q | ; | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * | Alt | | | |Alt | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [HALFDVORAK] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_SLASH, KC_L, KC_R, KC_C, KC_G, KC_F, TG(SYMB), + KC_BSPC, KC_0, KC_9, KC_8, KC_7, KC_6, KC_BSLS, + KC_SLASH, KC_L, KC_R, KC_C, KC_G, KC_F, KC_RBRC, KC_ENT, KC_S, KC_N, KC_T, KC_H, KC_D, - KC_LSFT, KC_Z, KC_V, KC_W, KC_M, KC_B, ALL_T(KC_NO), - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, KC_TRANSPARENT, + KC_LSFT, KC_Z, KC_V, KC_W, KC_M, KC_B, KC_EQL, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, + KC_TRANSPARENT, KC_TRANSPARENT, KC_HOME, - KC_TRANSPARENT,KC_BSPC,KC_END, + KC_TRANSPARENT,KC_DEL,KC_END, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC, - TG(SYMB), KC_Y, KC_P, KC_DOT, KC_COMM,KC_P, KC_TAB, - KC_I, KC_U, KC_E, KC_O, KC_A, KC_ENT, - MEH_T(KC_NO),KC_X, KC_K, KC_J, KC_Q, KC_SCLN, KC_RSFT, + KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_5, KC_ESC, + KC_LBRC, KC_Y, KC_P, KC_DOT, KC_COMM,KC_P, KC_TAB, + KC_I, KC_U, KC_E, KC_O, KC_A, KC_BSPC, + KC_MINUS,KC_X, KC_K, KC_J, KC_Q, KC_SCLN, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - KC_TRANSPARENT, KC_RALT, + KC_TRANSPARENT, KC_TRNS, KC_PGUP, KC_PGDN,KC_TAB, KC_TRANSPARENT ), /* Keymap 5: Symbol Layer * * ,---------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |Version | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |BkSp | * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * | | / | \ | { | } | | | | | | Up | 7 | 8 | 9 | * | / | * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * | | ' | ; | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | - | ENTER | * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * | | - | = | [ | ] | ~ | | | | & | 1 | 2 | 3 | + | | * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | EPRM | | | | | | | . | 0 | = | | * `-----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * |Animat| | |Toggle|Solid | + * | | | | | | * ,------|------|------| |------+------+------. - * |Bright|Bright| | | |Hue- |Hue+ | - * |ness- |ness+ |------| |------| | | * | | | | | | | | + * |mirror| |------| |------| |mirror| + * |space | | | | | |enter | * `--------------------' `--------------------' */ // SYMBOLS [SYMB] = LAYOUT_ergodox( // left hand - 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, - RGB_MOD,KC_TRNS, - KC_TRNS, - RGB_VAD,RGB_VAI,KC_TRNS, + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_NO,KC_SLASH,KC_BSLS, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_NO,KC_QUOT,KC_SCLN, KC_LPRN,KC_RPRN,KC_GRV, + KC_NO,KC_MINUS,KC_EQL,KC_LBRC,KC_RBRC,KC_TILD,KC_NO, + EPRM,KC_NO,KC_NO,KC_NO,KC_TRNS, + KC_TRNS,KC_NO, + KC_NO, + LT(HALFSYMB, KC_SPACE),KC_NO,KC_NO, // 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, - RGB_TOG, RGB_SLD, - KC_TRNS, - KC_TRNS, RGB_HUD, RGB_HUI + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, + KC_NO, KC_UP, KC_KP_7, KC_KP_8, KC_KP_9,KC_KP_ASTERISK, KC_KP_SLASH, + KC_DOWN, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_ENTER, + KC_NO,KC_AMPR,KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_NO, + KC_NO,KC_DOT, KC_0, KC_KP_EQUAL, KC_NO, + KC_NO, KC_TRNS, + KC_NO, + KC_NO, KC_NO, LT(HALFSYMB, KC_ENT) ), -/* Keymap 6: Media and mouse keys +/* Keymap 6: Mirrored Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |delete | F12 | F11 | F10 | F9 | F8 | F7 | | F6 | F5 | F4 | F3 | F2 | F1 |BkSp | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | | 7 | 8 | 9 | * | / | | | | | { | } | / | \ | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | 4 | 5 | 6 | - |------| |------| ` | ( | ) | ; | ' | | + * |---------+------+------+------+------+------|enter | | |------+------+------+------+------+--------| + * | | | 1 | 2 | 3 | + | | | | ~ | [ | ] | = | - | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EPRM | | 0 | . | = | | | | | | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[HALFSYMB] = LAYOUT_ergodox( + // left hand + KC_BSPC, KC_F12, KC_F11, KC_F10, KC_F9, KC_F8, KC_F7, + KC_NO,KC_NO,KC_KP_7, KC_KP_8, KC_KP_9,KC_KP_ASTERISK,KC_KP_SLASH, + KC_ENTER,KC_NO,KC_KP_4, KC_KP_5, KC_KP_6,KC_KP_MINUS, + KC_NO,KC_NO,KC_KP_1, KC_KP_2, KC_KP_3,KC_KP_PLUS,KC_KP_ENTER, + EPRM,KC_NO,KC_KP_0,KC_KP_DOT,KC_KP_EQUAL, + KC_TRNS,KC_NO, + KC_NO, + KC_TRANSPARENT,KC_NO,KC_NO, + // right hand + KC_F6, KC_F5, KC_F4, KC_F3, KC_F2, KC_F1, KC_BSPC, + KC_NO,KC_PIPE,KC_LCBR,KC_RCBR, KC_SLASH, KC_BSLS, KC_NO, + KC_GRV,KC_LPRN,KC_RPRN, KC_SCLN, KC_QUOT, KC_NO, + KC_NO, KC_TILD,KC_LBRC,KC_RBRC, KC_EQL, KC_MINUS, KC_NO, + KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_TRNS, + KC_NO, + KC_NO, KC_NO, KC_TRANSPARENT +), + +/* Keymap 7: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | + * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | + * | | | | | | | | + * | c | v |------| |------| n | m | * | | | | | | | | * `--------------------' `--------------------' */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - 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 + +[PLVR] = LAYOUT_ergodox( // layout: layer 4: 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_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, 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 8: shortcuts + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |ENTER | + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCTRL|ALT |CTLShTab|CTL-TAB| | | RGui| UP | DOWN | ALT | RCTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Alt |Dvorak| |Plover|Alt | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[SHORTCUTS] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_TAB, LCTL(KC_Q), LCTL(KC_W),LCTL(KC_E),LCTL(KC_R),LCTL(KC_T), KC_NO, + KC_BSPC, LCTL(KC_A), LCTL(KC_S),LCTL(KC_D),LCTL(KC_F),LCTL(KC_G), + KC_LSFT, LCTL(KC_Z), LCTL(KC_X),LCTL(KC_C),LCTL(KC_V),LCTL(KC_B), KC_MINUS, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRANSPARENT, + KC_NO, KC_NO, + + KC_NO, + KC_NO,KC_NO,KC_NO, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_EQL,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, + KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, + KC_NO, KC_NO, + KC_NO, + KC_NO,KC_NO, KC_NO + ), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c new file mode 100644 index 000000000..6842635d1 --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c @@ -0,0 +1,72 @@ +/* +Copyright 2017 Fred Sundvik +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "simple_visualizer.h" + +#define RED 0 +#define ORANGE 21 +#define YELLOW 42 +#define SPRING_GREEN 64 +#define GREEN 85 +#define TURQUOISE 107 +#define CYAN 127 +#define OCEAN 149 +#define BLUE 170 +#define VIOLET 192 +#define MAGENTA 212 +#define RASPBERRY 234 + +// This function should be implemented by the keymap visualizer +// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing +// that the simple_visualizer assumes that you are updating +// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is +// stopped. This can be done by either double buffering it or by using constant strings +static void get_visualizer_layer_and_color(visualizer_state_t* state) { + uint8_t saturation = 255; + /* if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { + saturation = 255; + } */ + if (state->status.layer & 0x100) { + state->target_lcd_color = LCD_COLOR(MAGENTA, saturation, 0xFF); + state->layer_text = "Shortcuts Layer"; + } + else if (state->status.layer & 0x80) { + state->target_lcd_color = LCD_COLOR(VIOLET, saturation, 0xFF); + state->layer_text = "Plover"; + } + else if (state->status.layer & 0x40) { + state->target_lcd_color = LCD_COLOR(RASPBERRY, saturation, 0xFF); + state->layer_text = "Mirrored Symbols"; + } + else if (state->status.layer & 0x20) { + state->target_lcd_color = LCD_COLOR(RED, saturation, 0xFF); + state->layer_text = "Symbols"; + } + else if (state->status.layer & 0x8) { + state->target_lcd_color = LCD_COLOR(OCEAN, saturation, 0xFF); + state->layer_text = "Mirrored Dvorak"; + } + else if (state->status.layer & 0x4) { + state->target_lcd_color = LCD_COLOR(BLUE, saturation, 0xFF); + state->layer_text = "Dvorak"; + } + else if (state->status.layer & 0x2) { + state->target_lcd_color = LCD_COLOR(ORANGE, saturation, 0xFF); + state->layer_text = "Mirrored Qwerty"; + } + else { + state->target_lcd_color = LCD_COLOR(YELLOW, saturation, 0xFF); + state->layer_text = "Qwerty"; + } +} \ No newline at end of file From 38ab86e8f2b6731557f28902509a011715ed5d29 Mon Sep 17 00:00:00 2001 From: Koen Klinkers Date: Fri, 2 Feb 2018 05:08:39 +0100 Subject: [PATCH 096/556] updated xd75 layout (#2321) * plank layout * ergodone * x75 * readmes * added rgb controls * bslash * added backlighting based on layer/modifier * changed colors --- keyboards/xd75/keymaps/kloki/keymap.c | 98 +++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 4 deletions(-) diff --git a/keyboards/xd75/keymaps/kloki/keymap.c b/keyboards/xd75/keymaps/kloki/keymap.c index 36d8a4294..62023cf70 100644 --- a/keyboards/xd75/keymaps/kloki/keymap.c +++ b/keyboards/xd75/keymaps/kloki/keymap.c @@ -20,14 +20,15 @@ #define _QW 1 #define _NUM 2 #define _SYM 3 +#define _FUN 4 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_WO] = { /* WORKMAN */ - { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LSFT, TG(_NUM),TG(_QW),KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_GRV, KC_LGUI, KC_QUOT, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_QUOT }, + { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, MO(_FUN),TG(_NUM),TG(_QW),KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, + { KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_GRV, KC_LGUI, KC_QUOT, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS }, { CTL_T(KC_ESC),KC_A,KC_S, KC_H, KC_T, KC_G, KC_EQL, KC_UP, KC_MINS, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_ENT }, { KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_LEFT, KC_DOWN, KC_RGHT, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, { KC_MEH,KC_LGUI,KC_LALT,KC_LEFT,KC_RGHT,LT(_SYM,KC_SPC),LGUI_T(KC_ENT),KC_SPC,LT(_SYM,KC_TAB),KC_BSPC,KC_DOWN,KC_UP,KC_LBRC,KC_RBRC,MO(_SYM)}, @@ -49,11 +50,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { _______, _______, _______, _______, _______,_______,_______, KC_0, _______, _______,_______,_______, _______, _______, _______ }, }, [_SYM] = { /* SYM */ - { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, }, - { _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR,KC_ASTR,_______, _______, _______, KC_LABK,KC_HOME,KC_UP, KC_PGUP, KC_ASTR, _______ }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, }, + { _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR,KC_ASTR,_______, KC_F11, KC_F12, KC_LABK,KC_HOME,KC_UP, KC_PGUP, KC_ASTR, _______ }, { _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN,KC_GRV, _______, _______, _______, KC_RABK,KC_LEFT,KC_DOWN, KC_RIGHT,KC_PLUS, _______ }, { _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC,KC_TILD,_______, _______, _______, KC_AMPR,KC_END, KC_DOWN, KC_PGDN, KC_BSLS, _______ }, { _______, _______, _______, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + }, + [_FUN] = { /* FUN */ + { _______, RGB_RMOD,RGB_MOD, RGB_TOG, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, RESET }, + { _______, RGB_HUD, RGB_HUI, RGB_MODE_PLAIN, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + { _______, RGB_SAD, RGB_SAI, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + { _______, RGB_VAD, RGB_VAI, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + { _______, _______, _______, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, } }; const uint16_t PROGMEM fn_actions[] = { @@ -77,3 +85,85 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; + +bool CTRLDOWN = false; +bool WINDOWN = false; +bool SHIFTDOWN = false; +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + switch (layer) { + case 0: + rgblight_setrgb(0,240, 255); + break; + case 1: + rgblight_setrgb(0,255, 100); + break; + case 2: + rgblight_setrgb(10,255, 0); + break; + case 3: + rgblight_setrgb(255,0, 85); + break; + case 4: + rgblight_setrgb(240,255, 0); + break; + default: + // none + break; + } + if ( SHIFTDOWN) { + rgblight_setrgb(255,255, 255); + } + if ( CTRLDOWN) { + rgblight_setrgb(240,255, 0); + } + if ( WINDOWN) { + rgblight_setrgb(255,255, 255); + } + + + +}; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LGUI: + if (record->event.pressed) { + WINDOWN = true; + } else { + WINDOWN = false; + } + return true; + case LGUI_T(KC_ENT): + if (record->event.pressed) { + WINDOWN = true; + } else { + WINDOWN = false; + } + return true; + case CTL_T(KC_ESC): + if (record->event.pressed) { + CTRLDOWN = true; + } else { + CTRLDOWN = false; + } + return true; + case KC_LSFT: + if (record->event.pressed) { + SHIFTDOWN = true; + } else { + SHIFTDOWN = false; + } + return true; + case KC_RSFT: + if (record->event.pressed) { + SHIFTDOWN = true; + } else { + SHIFTDOWN = false; + } + return true; + default: + return true; // Process all other keycodes normally + } +}; From 9584db055b73937dfba7b9878a8b61af6aa96710 Mon Sep 17 00:00:00 2001 From: Chris Lee Date: Sat, 2 Dec 2017 03:26:49 -0700 Subject: [PATCH 097/556] Add support for key backlighting to bfake If BACKLIGHT_ENABLE is set to `yes` in `rules.mk`, then the user can use the `BL_*` keycodes to adjust the backlight. At the moment, only on/off is supported. --- keyboards/bfake/bfake.c | 23 ++++++++++++++++++++++- keyboards/bfake/config.h | 3 ++- keyboards/bfake/rules.mk | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/keyboards/bfake/bfake.c b/keyboards/bfake/bfake.c index 33d0a60c2..2160706fe 100644 --- a/keyboards/bfake/bfake.c +++ b/keyboards/bfake/bfake.c @@ -16,7 +16,12 @@ along with this program. If not, see . */ #include "bfake.h" +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE #include "rgblight.h" +#endif #include @@ -24,6 +29,7 @@ along with this program. If not, see . #include "i2c.h" #include "quantum.h" +#ifdef RGBLIGHT_ENABLE extern rgblight_config_t rgblight_config; void rgblight_set(void) { @@ -38,8 +44,23 @@ void rgblight_set(void) { i2c_init(); i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); } +#endif __attribute__ ((weak)) void matrix_scan_user(void) { - rgblight_task(); +} + +void backlight_init_ports(void) { + DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // Turn out the lights + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); + } else { + // Turn on the lights + PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + } } diff --git a/keyboards/bfake/config.h b/keyboards/bfake/config.h index c0e0face5..de8c4b5df 100644 --- a/keyboards/bfake/config.h +++ b/keyboards/bfake/config.h @@ -37,7 +37,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCING_DELAY 5 - +#define NO_BACKLIGHT_CLOCK +#define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS #define NO_UART 1 diff --git a/keyboards/bfake/rules.mk b/keyboards/bfake/rules.mk index 9165de424..6577ea193 100644 --- a/keyboards/bfake/rules.mk +++ b/keyboards/bfake/rules.mk @@ -37,7 +37,7 @@ EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = no RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 @@ -47,4 +47,4 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c # programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex \ No newline at end of file +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex From 4a04c7265e74afc8a83a19942af5e9483aac287d Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Fri, 8 Dec 2017 14:33:24 +0000 Subject: [PATCH 098/556] Replace custom tap dance keys with mod tap keys in planck/keymaps/dshields --- keyboards/planck/keymaps/dshields/config.h | 21 ++----------- keyboards/planck/keymaps/dshields/keymap.c | 34 ++-------------------- keyboards/planck/keymaps/dshields/rules.mk | 3 +- 3 files changed, 7 insertions(+), 51 deletions(-) diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index d920d1539..438e007d0 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -5,6 +5,7 @@ #define _______ KC_TRNS #define XXXXXXX KC_NO +#define PREVENT_STUCK_MODIFIERS #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 @@ -31,24 +32,8 @@ #define OSM_ALT OSM(MOD_LALT) #define OSM_SFT OSM(MOD_LSFT) -// tap dance keys -#define TD_SCLN TD(TDK_SCLN) -#define TD_COMM TD(TDK_COMM) -#define TD_DOT TD(TDK_DOT) -#define TD_SLSH TD(TDK_SLSH) - -// macros -#define ACTION_TAP_DANCE_FN_KEYCODE(user_fn, kc) { \ - .fn = { NULL, user_fn, NULL }, \ - .user_data = (void *)&((qk_tap_dance_pair_t) { kc, 0 }) \ -} - -#define ACTION_TAP_DANCE_FN_KEYCODE2(user_fn, kc1, kc2) { \ - .fn = { NULL, user_fn, NULL }, \ - .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }) \ -} - -#define TAP(keycode) register_code16(keycode); unregister_code16(keycode) +// mod-tap keys +#define MT_SPC SFT_T(KC_SPC) #endif diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c index a13c261ed..a99777917 100644 --- a/keyboards/planck/keymaps/dshields/keymap.c +++ b/keyboards/planck/keymaps/dshields/keymap.c @@ -6,7 +6,6 @@ extern keymap_config_t keymap_config; enum planck_layers { DEF, LWR, RSE, FUN }; enum planck_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE }; -enum tap_dance_keys { TDK_SCLN, TDK_COMM, TDK_DOT, TDK_SLSH }; #include "dynamic_macro.h" @@ -24,9 +23,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [DEF] = { {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P }, - {KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, TD_SCLN}, - {KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, TD_COMM, TD_DOT, TD_SLSH}, - {OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, KC_SPC, KC_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH}, + {OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, MT_SPC, MT_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower * ,-----------------------------------------------------------------------------------. @@ -81,33 +80,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, }; -void tap_dance_triple(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; - uint16_t keycode = pair->kc1; - - switch(state->count) { - case 2: - register_code(KC_LSFT); - TAP(keycode); - unregister_code(KC_LSFT); - break; - case 3: // fall through - if (pair->kc2) { - keycode = pair->kc2; - } - TAP(keycode); - default: - TAP(keycode); - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TDK_SCLN] = ACTION_TAP_DANCE_FN_KEYCODE2(tap_dance_triple, KC_SCLN, KC_COLN), - [TDK_COMM] = ACTION_TAP_DANCE_FN_KEYCODE2(tap_dance_triple, KC_COMM, KC_LABK), - [TDK_DOT] = ACTION_TAP_DANCE_FN_KEYCODE (tap_dance_triple, KC_DOT), - [TDK_SLSH] = ACTION_TAP_DANCE_FN_KEYCODE (tap_dance_triple, KC_SLSH) -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_dynamic_macro(keycode, record)) { return false; diff --git a/keyboards/planck/keymaps/dshields/rules.mk b/keyboards/planck/keymaps/dshields/rules.mk index 57144283e..c266b9393 100644 --- a/keyboards/planck/keymaps/dshields/rules.mk +++ b/keyboards/planck/keymaps/dshields/rules.mk @@ -4,10 +4,9 @@ endif MOUSEKEY_ENABLE = yes # Mouse keys(+4700) COMMAND_ENABLE = yes # Commands for debug and configuration -CONSOLE_ENABLE = yes # Console for debug(+400) +CONSOLE_ENABLE = no # Console for debug(+400) BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE = yes AUDIO_ENABLE = no API_SYSEX_ENABLE = no From 087fa37b7af7873cec74752bcbca3455a4b66cb5 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Fri, 2 Feb 2018 07:00:09 +0100 Subject: [PATCH 099/556] Added us based keyboard layout with cursor keys and mouse functionality for SATAN GH60 (#2180) * Add chaser keymap * Added missing readme * Add missing mousewheel und mousebutton 3 --- keyboards/satan/keymaps/chaser/keymap.c | 89 ++++++++++++++++++++++++ keyboards/satan/keymaps/chaser/readme.md | 38 ++++++++++ keyboards/satan/keymaps/chaser/rules.mk | 21 ++++++ 3 files changed, 148 insertions(+) create mode 100644 keyboards/satan/keymaps/chaser/keymap.c create mode 100644 keyboards/satan/keymaps/chaser/readme.md create mode 100644 keyboards/satan/keymaps/chaser/rules.mk diff --git a/keyboards/satan/keymaps/chaser/keymap.c b/keyboards/satan/keymaps/chaser/keymap.c new file mode 100644 index 000000000..63028f1ce --- /dev/null +++ b/keyboards/satan/keymaps/chaser/keymap.c @@ -0,0 +1,89 @@ +#include "satan.h" + + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up |FN | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Left |Down|Right| + * `-----------------------------------------------------------' + */ +[_BL] = KEYMAP( + F(0) ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC , _______, \ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS , \ + KC_CAPS ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,_______,KC_ENT , \ + KC_LSHIFT ,_______,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_UP ,MO(_FL) , \ + KC_LCTL ,KC_LGUI,KC_LALT, KC_SPC ,KC_RALT,KC_LEFT,KC_DOWN,KC_RIGHT), + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * |GRV|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | + * |-----------------------------------------------------------| + * | MB3|MB2|MUP|MB1|MWU| | | |INS| |RST| | |Print| + * |-----------------------------------------------------------| + * | | ML|MDN|MR |MWD| | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | |PGUP| | + * |-----------------------------------------------------------| + * | | | | |Ctrl|HOME|PGD |END | + * `-----------------------------------------------------------' + */ +[_FL] = KEYMAP( + KC_GRV , KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL ,_______, \ + KC_MS_BTN3 ,KC_MS_BTN2 ,KC_MS_UP ,KC_MS_BTN1 ,KC_MS_WH_UP ,_______,_______,_______,KC_INS ,_______,RESET ,_______,_______ ,KC_PSCREEN , \ + _______ ,KC_MS_LEFT ,KC_MS_DOWN ,KC_MS_RIGHT,KC_MS_WH_DOWN,_______,_______,_______,_______,_______,_______,_______,_______ ,_______ , \ + _______ ,_______ ,_______ ,_______ ,_______ ,_______,_______,_______,_______,_______,_______,_______,KC_PGUP ,_______ , \ + KC_LCTL ,_______ ,KC_LALT , _______, KC_RCTL,KC_HOME,KC_PGDOWN ,KC_END ), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/satan/keymaps/chaser/readme.md b/keyboards/satan/keymaps/chaser/readme.md new file mode 100644 index 000000000..c6e70b188 --- /dev/null +++ b/keyboards/satan/keymaps/chaser/readme.md @@ -0,0 +1,38 @@ +# [dragonchasers](https://github.com/dragonchaser) Satan GH60 layout + +Layout derived from the default Satan GH60 keymap. + +![Photo of the keyboard](https://pbs.twimg.com/media/DQzlD0yX0AA8spX.jpg) + +## Layers + +### Base +``` +,-----------------------------------------------------------. +|Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | +|-----------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | +|-----------------------------------------------------------| +|CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | +|-----------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /| Up |FN | +|-----------------------------------------------------------| +|Ctrl|Gui |Alt | Space |Alt |Left |Down|Right| +`-----------------------------------------------------------' +``` + +### Function Layer + +``` +,-----------------------------------------------------------. +|GRV|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | +|-----------------------------------------------------------| +| MB3|MB2|MUP|MB1|MWU| | | |INS| |RST| | |Print| +|-----------------------------------------------------------| +| | ML|MDN|MR |MWD| | | | | | | | +|-----------------------------------------------------------| +| | | | | | | | | | | |PGUP| | +|-----------------------------------------------------------| +| | | | |Ctrl|HOME|PGD |END | +`-----------------------------------------------------------' +``` diff --git a/keyboards/satan/keymaps/chaser/rules.mk b/keyboards/satan/keymaps/chaser/rules.mk new file mode 100644 index 000000000..2a7ff2779 --- /dev/null +++ b/keyboards/satan/keymaps/chaser/rules.mk @@ -0,0 +1,21 @@ +# 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 = 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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 3cf752f83f1bd8fbdeab18563f9ec39bb1aa205a Mon Sep 17 00:00:00 2001 From: Brosseau Valentin Date: Fri, 2 Feb 2018 07:00:39 +0100 Subject: [PATCH 100/556] =?UTF-8?q?Xd75=20:=20B=C3=A9po=20layout=20for=20t?= =?UTF-8?q?he=20XD75=20(#2166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add xd75 layout * Add Readme * Update layout * Remove Backlight keys * Move ENTER / BACKSP / DEL * Commit my bepo layout instead of the qwerty version since i will not use it * Use 0 instead of 00 * Fix TODO key * Update the readme * Replace wrong key placment * Update center column * Update the layout with 2-u key * Adjust the fn layer * Adjust the main layer * Adjust the fn layer --- .../xd75/keymaps/c4software_bepo/README.md | 37 ++++++++ .../xd75/keymaps/c4software_bepo/config.h | 24 +++++ .../xd75/keymaps/c4software_bepo/keymap.c | 90 +++++++++++++++++++ .../xd75/keymaps/c4software_bepo/rules.mk | 18 ++++ 4 files changed, 169 insertions(+) create mode 100644 keyboards/xd75/keymaps/c4software_bepo/README.md create mode 100644 keyboards/xd75/keymaps/c4software_bepo/config.h create mode 100644 keyboards/xd75/keymaps/c4software_bepo/keymap.c create mode 100644 keyboards/xd75/keymaps/c4software_bepo/rules.mk diff --git a/keyboards/xd75/keymaps/c4software_bepo/README.md b/keyboards/xd75/keymaps/c4software_bepo/README.md new file mode 100644 index 000000000..7a852962a --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/README.md @@ -0,0 +1,37 @@ +# c4software Custom Keyboard + +Layout for Bépo Dev + +``` +/* Native BepoDev for compatible computer + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | " | < | > | ( | ) | % | VOL- | VOL+ | @ | + | - | / | * | = | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | B | E_ACUT | P | O | $ | E_GRAV | DEL | E_CIRC | V | D | L | J | Z | C_CEDIL| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | RALT | A | U | I | E | , | | | C | T | S | R | N | M | W | + * |--------+--------+--------+--------+--------+--------+ BACKSP + ENTER +--------+--------+--------+--------------------------+--------| + * | LSHIFT | A_GRAV | Y | X | . | K | | | ’ | Q | G | H | F | UP | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LCTRL | FN | LGUI | SPACE | RALT | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + ``` + + The FN layer : + + ``` +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | P/ | P* | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | P7 | P8 | P9 | - | RGB_TOG| RGB_MOD| RGB_HUI| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | PREV | PLAY | NEXT | STOP | | | | P4 | P5 | P6 | + | RGB_SAI| RGB_SAD| RGB_VAI| + * |--------+--------+--------+--------+--------+--------+ + +--------+--------+--------+--------+--------+--------+--------| + * | | VOL- | MUTE | VOL+ | | | | | P1 | P2 | P3 | ENT | RGB_VAD| Home | RGB_HUD| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RESET | | FN | | | | P0 | . | FN | | End | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + ``` \ No newline at end of file diff --git a/keyboards/xd75/keymaps/c4software_bepo/config.h b/keyboards/xd75/keymaps/c4software_bepo/config.h new file mode 100644 index 000000000..015377b5f --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Benjamin Kesselring + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/xd75/keymaps/c4software_bepo/keymap.c b/keyboards/xd75/keymaps/c4software_bepo/keymap.c new file mode 100644 index 000000000..28f032a7f --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2017 Valentin Brosseau + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "xd75.h" +#include "keymap_bepo.h" + +// Layer shorthand +#define _BP 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Native BepoDev for compatible computer + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | " | < | > | ( | ) | % | VOL- | VOL+ | @ | + | - | / | * | = | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | B | E_ACUT | P | O | $ | E_GRAV | DEL | E_CIRC | V | D | L | J | Z | C_CEDIL| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | RALT | A | U | I | E | , | | | C | T | S | R | N | M | W | + * |--------+--------+--------+--------+--------+--------+ BACKSP + ENTER +--------+--------+--------+--------------------------+--------| + * | LSHIFT | A_GRAV | Y | X | . | K | | | ’ | Q | G | H | F | UP | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LCTRL | FN | LGUI | SPACE | RALT | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_BP] = { /* BepoDev */ + { KC_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_PERCENT, KC_VOLD, KC_VOLU, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL }, + { KC_TAB, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_DOLLAR, BP_E_GRAVE, KC_DEL, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_CCED }, + { KC_RALT, BP_A, BP_U, BP_I, BP_E, BP_COMMA, KC_BSPC, KC_ENT, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, BP_W }, + { KC_LSFT, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TRNS, KC_TRNS, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_UP, KC_RSFT }, + { KC_LALT, KC_LCTL, MO(_FN), KC_LGUI, KC_TRNS, KC_SPC, KC_TRNS, KC_RALT, KC_SPC, KC_TRNS, KC_RGUI, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT }, + }, + +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | P/ | P* | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | P7 | P8 | P9 | - | RGB_TOG| RGB_MOD| RGB_HUI| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | PREV | PLAY | NEXT | STOP | | | | P4 | P5 | P6 | + | RGB_SAI| RGB_SAD| RGB_VAI| + * |--------+--------+--------+--------+--------+--------+ + +--------+--------+--------+--------+--------+--------+--------| + * | | VOL- | MUTE | VOL+ | | | | | P1 | P2 | P3 | ENT | RGB_VAD| Home | RGB_HUD| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RESET | | FN | | | | P0 | . | FN | | End | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = { /* FUNCTION */ + { KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_SLSH, KC_ASTR, KC_F9, KC_F10, KC_F11, KC_F12 }, + { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_MINS, RGB_TOG, RGB_MOD, RGB_HUI }, + { KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PLUS, RGB_SAI, RGB_SAD, RGB_VAI }, + { KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_ENT, RGB_VAD, KC_HOME, RGB_HUD }, + { RESET, KC_TRNS, MO(_FN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_TRNS, KC_PDOT, MO(_FN), KC_TRNS, KC_END, KC_TRNS }, + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/xd75/keymaps/c4software_bepo/rules.mk b/keyboards/xd75/keymaps/c4software_bepo/rules.mk new file mode 100644 index 000000000..d4e08cfb2 --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 9f0aac22e9d9b22ebc95e44a77734104ee27d755 Mon Sep 17 00:00:00 2001 From: adiabatic Date: Thu, 1 Feb 2018 22:01:18 -0800 Subject: [PATCH 101/556] =?UTF-8?q?zweihander:=20rename,=20=E2=8C=83=20?= =?UTF-8?q?=E2=86=92=20=E2=8C=A5,=20README=20revamp=20(#2311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * zweihander-osx: Remove app keys, etc. - add right command keys - add F16 on ;' for Siri - remove command-Q (too easy to hit) * Rename zweihander-osx to zweihander-macos zweihander-macos: / / ^ → / / ⌥; README revamp zweihander: rename, ⌃ → ⌥, README revamp --- .../keymap.c | 8 +- .../ergodox/zweihander-macos/readme.markdown | 73 +++++++++++++++++++ .../ergodox/zweihander-macos/rules.mk | 3 + .../ergodox/zweihander-osx/readme.markdown | 45 ------------ .../community/ergodox/zweihander-osx/rules.mk | 2 - 5 files changed, 80 insertions(+), 51 deletions(-) rename layouts/community/ergodox/{zweihander-osx => zweihander-macos}/keymap.c (97%) create mode 100644 layouts/community/ergodox/zweihander-macos/readme.markdown create mode 100644 layouts/community/ergodox/zweihander-macos/rules.mk delete mode 100644 layouts/community/ergodox/zweihander-osx/readme.markdown delete mode 100644 layouts/community/ergodox/zweihander-osx/rules.mk diff --git a/layouts/community/ergodox/zweihander-osx/keymap.c b/layouts/community/ergodox/zweihander-macos/keymap.c similarity index 97% rename from layouts/community/ergodox/zweihander-osx/keymap.c rename to layouts/community/ergodox/zweihander-macos/keymap.c index 8c216b09b..6dd2b04f4 100644 --- a/layouts/community/ergodox/zweihander-osx/keymap.c +++ b/layouts/community/ergodox/zweihander-macos/keymap.c @@ -16,9 +16,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / L⌘ | + * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / R⌘ | * |--------+------+------+------+------+------| L⌘ | | R⌘ |------+------+------+------+------+--------| - * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / / ⌃| R⇧ | + * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / /R⌥| R⇧ | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | L⌃ | L⌥ | L⌘ | ← | → | | ↑ | ↓ | [ | ] | | * `----------------------------------' `----------------------------------' @@ -45,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, MO(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), - KC_RGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),RGUI_T(KC_QUOT), + KC_RGUI, KC_N, KC_M, KC_COMM,KC_DOT, RALT_T(KC_SLSH), KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_SPC , KC_ESC, KC_BSPC, KC_PGDN, diff --git a/layouts/community/ergodox/zweihander-macos/readme.markdown b/layouts/community/ergodox/zweihander-macos/readme.markdown new file mode 100644 index 000000000..8921647bd --- /dev/null +++ b/layouts/community/ergodox/zweihander-macos/readme.markdown @@ -0,0 +1,73 @@ +# The Zweihander Layout + +NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “Command-backtick”, not “Command-backslash-backtick”. + +This README refers to two secondary layers: the Media Layer and the Symbol Layer. The Media Layer is accessed by holding ; (the semicolon) and has cursor-movement, window-management, and volume-adjustment keys on it. The Symbol Layer is accessed by holding either of the two tall keys between T and Y, or by tapping one of the small keys between 5 and 6. It has a 10-key keypad, parentheses and similar grouping punctuation, and F1–F12. + +This layout is tuned for people who… + + +## use macOS + +While this layout works fine in Windows, it’s not tuned for it. No sane person who primarily uses Windows would put this many Windows keys on a keyboard layout. That said, Print Screen, Scroll Lock, and Pause are available in their usual order on the Media Layer if you need them. + + +## mouse left-handed while doing other things with the right hand + +I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the Media Layer (hold ;) to speed up browsing in applications like Safari and Finder: + +- ⌘[ — Back +- ⌘] — Forward +- ⌥⌘↓ — Open Selection and Close Parent Folder +- ⌥⌘↑ — Go Up and Close Just-Left Folder + +I also have a few keys dedicated to window management: + +- ⌘W — Close Window +- ⌘\` — Move Focus to Next Window +- ⌘⇧\` — Move Focus to Previous Window + +Cut, Copy, and Paste (⌘X, ⌘C, and ⌘V) are also available on the three bottommost right-thumb buttons if you hold ;. + + +## use lots of modifier keys in OS X menu-item shortcuts + +I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once. This is why the bottom left of the keyboard has Shift, Control, Option, and Command in the usual spots. Further I’ve added affordances so some key combinations are easier to press with just the right hand. + +I also put a second Backspace (⌫) key on the right half of the keyboard to make some particularly commonly-used keyboard shortcuts faster and more convenient for right-handed use: + +- ⌘⌫ — Move to Trash / Delete +- ⇧⌥⌘⌫ — Empty Trash Without Asking for Confirmation + +⇧⌥⌘⌫ is much more satisfying to press when you do it like on a normal keyboard: one left-hand finger on each of ⇧, ⌥, and ⌘, and the right index finger on ⌫. + +Pressing and holding / will give you Option. This makes a number of keyboard shortcuts easy to press with just the right hand: + +- ⌥↑ — Move Line Up +- ⌥↓ — Move Line Down +- ⌥⇧↑ — Copy Line Up / Go To Previous Channel With Unread Messages +- ⌥⇧↓ — Copy Line Down / Go To Next Channel With Unread Messages + + +## use Emacs-style shortcuts + +I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the Control key on the far left, so the leftmost thumb button on the right side is another Control key. + +Having trouble remembering which innermost thumb key is Alt and which is Control? The two’re like on the lower right of a normal keyboard — leftmost is Alt, rightmost is Control. + + +## use spreadsheets + +All the common spreadsheet operations (+-*/=) are on the right side of the Symbol Layer. Make-numbers-bigger (+, \*) operations on the right; make-numbers-smaller (-, /) on the left. There’s also a colon there for entering times and maybe IPv6 addresses. + + +## know the ↑↓←→ fn-key shortcuts for MacBooks + +Have you looked at the Page Up, Page Down, Home, and End keys on the EDSF keys and wondered why they’re arranged that way? They’re arranged the same way as the fn-key shortcuts on an Apple laptop’s arrow keys. On Apple keyboards with an\* fn key, if you press fn-↑, you’ll get Page Up; if you press fn-← you’ll get Home. Similarly, on Zweihander, ;-E is Page Up and ;-S is Home. + + +## use Siri + +F16, accessed by holding ; and pressing the ' key next to it, is intended for Siri. + +\* I pronounce “fn” as “effin’”. Your mileage may vary. diff --git a/layouts/community/ergodox/zweihander-macos/rules.mk b/layouts/community/ergodox/zweihander-macos/rules.mk new file mode 100644 index 000000000..8011660ce --- /dev/null +++ b/layouts/community/ergodox/zweihander-macos/rules.mk @@ -0,0 +1,3 @@ +# Don’t do a tricolor flashing-light wave when the computer is shut down in Windows, +# or when the machine is sleeping in macOS +SLEEP_LED_ENABLE = no diff --git a/layouts/community/ergodox/zweihander-osx/readme.markdown b/layouts/community/ergodox/zweihander-osx/readme.markdown deleted file mode 100644 index e88f7c055..000000000 --- a/layouts/community/ergodox/zweihander-osx/readme.markdown +++ /dev/null @@ -1,45 +0,0 @@ -# The Zweihander Layout - -NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “command-backtick”, not “command-backslash-backtick”. - -This layout is tuned for people who… - - -## use OS X - -While this layout should work fine in Windows, it’s not tuned for it. No sane person who primarily uses Windows would put this many Windows keys on a keyboard layout. - - -## mouse left-handed while doing other things with the right hand - -I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the media layer to speed up browsing in Safari and Finder: - -- Close Window (⌘W) -- Back (⌘[) -- Forward (⌘]) -- Open and Close Parent Folder (⌥⌘↓) -- Go Up and Close Just-Left Folder (⌥⌘↑) -- Cycle through open windows in current application (⌘\` and ⌘⇧\`) - -Because moving letter-by-letter is way slower than moving word-by-word, I added Option (⌥) to the bottommost button on the left side. This key can be held easily while holding ; (activate media layer) and pressing J and L to move left and right by word. - - -## use lots of modifier keys in OS X menu-item shortcuts - -I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once; this is why the bottom left of the keyboard has shift, control, option, and command in the usual spaces. Further, some common shortcuts I press have a key on the right side of the keyboard. These shortcuts include: - -- Empty Trash Without Asking for Confirmation (⇧⌥⌘⌫) - -⇧⌥⌘⌫, when you press the backspace on the right half of the keyboard, is much more satisfying than if you curl your left hand into a claw to press all the keys on the left. Try both; you’ll agree. - - -## use Emacs-style shortcuts - -I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the control key on the bottom left and I’m too quick on the draw for the control function on the / key to work reliably, so the bottommost thumb button on the right side is another control key. - -Having trouble remembering which thumb key is alt and which is ctrl? It’s like on the lower right of a normal keyboard — leftmost is alt, rightmost is ctrl. - - -## use spreadsheets - -All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. There’s also a colon there for entering times and maybe IPv6 addresses. Not that I expect people to type IPv6 addresses into a spreadsheet, but, y’know. diff --git a/layouts/community/ergodox/zweihander-osx/rules.mk b/layouts/community/ergodox/zweihander-osx/rules.mk deleted file mode 100644 index 6e3d088a4..000000000 --- a/layouts/community/ergodox/zweihander-osx/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Don’t do a tricolor wave when the computer is shut down in Windows -SLEEP_LED_ENABLE = no From f2459997ba5a2f4e14c17bcba301ca6624780aa2 Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Sun, 7 Jan 2018 16:59:56 -0500 Subject: [PATCH 102/556] Add smt keymap for KBD75 --- keyboards/kbd75/keymaps/smt/keymap.c | 180 +++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 keyboards/kbd75/keymaps/smt/keymap.c diff --git a/keyboards/kbd75/keymaps/smt/keymap.c b/keyboards/kbd75/keymaps/smt/keymap.c new file mode 100644 index 000000000..7dc557667 --- /dev/null +++ b/keyboards/kbd75/keymaps/smt/keymap.c @@ -0,0 +1,180 @@ +#include "kbd75.h" + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _FL 3 +#define _CL 4 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK +}; + +// Helpful defines +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Qwerty layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_QWERTY] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 1: Colemak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: ANSI colemak */ + [_COLEMAK] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 2: Dvorak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: ANSI dvorak */ + [_DVORAK] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 3: Function layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │PG_UP│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ _FL │ │HOME │PG_DN│ END │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 3: ANSI Fn layer */ + [_FL] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, MO(_FL), _______, KC_HOME, KC_PGDN, KC_END), + + /* 4: Control layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ RGB │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │RESET│ │ │QWRTY│COLMK│DVORK│ │ │ │ │█████│RGBV+│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│RGBV-│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ _FL │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │RGBS+│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│RGB_M│█████│█████│█████│ │ _FL │ │RGBH-│RGBS-│RGBH+│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 4: ANSI control layer */ + [_CL] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, \ + _______, _______, _______, _______, RESET, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, RGB_VAI, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \ + MO(_FL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, \ + _______, _______, _______, _______, RGB_MOD, _______, _______, MO(_FL), _______, RGB_HUD, RGB_SAD, RGB_HUI), +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + } + return true; +} From 0310eafdcf3fd372f6804f209d42b5baf927eee3 Mon Sep 17 00:00:00 2001 From: mvs Date: Wed, 17 Jan 2018 19:21:31 -0500 Subject: [PATCH 103/556] QWERTY based layout with thumb-chording (SHIFT + SPECIAL) and programming layer. --- keyboards/ergodox_ez/keymaps/saha/keymap.c | 255 +++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/saha/keymap.c diff --git a/keyboards/ergodox_ez/keymaps/saha/keymap.c b/keyboards/ergodox_ez/keymaps/saha/keymap.c new file mode 100644 index 000000000..4df9e8833 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/saha/keymap.c @@ -0,0 +1,255 @@ +#include QMK_KEYBOARD_H + +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // Base layer - QWERTY +#define SPEC 1 // Special keys favoring programming in c-like languages +#define NUM 2 // Numeric layer with number row functional keys + +#define ___ KC_TRNS +#define BSLASH LSFT(KC_SLSH) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT_ergodox( + + // Left side + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_VOLU, /**/ KC_1, /**/ KC_2, /**/ KC_3, /**/ KC_4, /**/ KC_5, /**/ KC_F11, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_VOLD, /**/ KC_Q, /**/ KC_W, /**/ KC_E, /**/ KC_R, /**/ KC_T, /**/ KC_ESC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_MPLY, /**/ KC_A, /**/ KC_S, /**/ KC_D, /**/ KC_F, /**/ KC_G, /*===============*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_MUTE, /**/ KC_Z, /**/ KC_X, /**/ KC_C, /**/ KC_V, /**/ KC_B, /**/ KC_BSPC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ KC_RALT, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ KC_DEL, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ /**/ /**/ KC_LALT, /**/ + /**/ /**/ /**/ /**/ + /**/ /**/ /*===============*/ + /**/ /**/ /**/ /**/ + /**/ KC_SPACE, /**/ KC_LGUI, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + + // Right side + // + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_F12, /**/ KC_1, /**/ KC_2, /**/ KC_3, /**/ KC_4, /**/ KC_5, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_Y, /**/ KC_U, /**/ KC_I, /**/ KC_O, /**/ KC_P, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*===============*/ KC_H, /**/ KC_J, /**/ KC_K, /**/ KC_L, /**/ KC_SCLN, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_ENT, /**/ KC_N, /**/ KC_M, /**/ KC_COMM, /**/ KC_DOT, /**/ KC_SLSH, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ MO(NUM), /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ /**/ /**/ + /**/ /**/ /**/ /**/ + /*===============*/ /**/ /**/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_RSFT, /**/ MO(SPEC) /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + ), + + + [SPEC] = LAYOUT_ergodox( + + // Left side + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_EXLM, /**/ KC_AT, /**/ KC_HASH, /**/ KC_DLR, /**/ KC_PERC, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_GRV, /**/ KC_QUOT, /**/ KC_LCBR, /**/ KC_RCBR, /**/ KC_PLUS, /**/ KC_ESC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_TAB, /**/ KC_ASTR, /**/ KC_LPRN, /**/ KC_RPRN, /**/ KC_EQUAL, /*===============*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_HASH, /**/ KC_PERC, /**/ KC_LBRC, /**/ KC_RBRC, /**/ KC_MINUS, /**/ KC_BSPC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ KC_LALT, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ KC_DEL, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ /**/ /**/ KC_LALT, /**/ + /**/ /**/ /**/ /**/ + /**/ /**/ /*===============*/ + /**/ /**/ /**/ /**/ + /**/ KC_SPACE, /**/ KC_LGUI, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + + // Right side + // + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_CIRC, /**/ KC_AMPR, /**/ KC_ASTR, /**/ KC_LPRN, /**/ KC_RPRN, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_AMPR, /**/ KC_HOME, /**/ KC_UP, /**/ KC_END, /**/ KC_CIRC, /**/ KC_F7, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*===============*/ KC_EXLM, /**/ KC_LEFT, /**/ KC_DOWN, /**/ KC_RIGHT, /**/ KC_COLN, /**/ KC_F8, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_ENT, /**/ KC_PIPE, /**/ KC_UNDS, /**/ KC_LT, /**/ KC_GT, /**/ KC_BSLS, /**/ KC_F9, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/KC_F10,/**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ /**/ /**/ + /**/ /**/ /**/ /**/ + /*===============*/ /**/ /**/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_RSFT, /**/ ___ /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + ), + + [NUM] = LAYOUT_ergodox( + + // Left side + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_F1, /**/ KC_F2, /**/ KC_F3, /**/ KC_F4, /**/ KC_F5, /**/ KC_F11, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_EXLM, /**/ KC_AT, /**/ KC_HASH, /**/ KC_DLR, /**/ KC_PERC, /**/ KC_ESC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_1, /**/ KC_2, /**/ KC_3, /**/ KC_4, /**/ KC_5, /*===============*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_HASH, /**/ KC_PERC, /**/ KC_LBRC, /**/ KC_RBRC, /**/ KC_MINUS, /**/ KC_BSPC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ KC_LALT, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ KC_DEL, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ /**/ /**/ KC_LALT, /**/ + /**/ /**/ /**/ /**/ + /**/ /**/ /*===============*/ + /**/ /**/ /**/ /**/ + /**/ KC_SPACE, /**/ KC_LGUI, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + + // Right side + // + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_F12, /**/ KC_F6, /**/ KC_F7, /**/ KC_F8, /**/ KC_F9, /**/ KC_F10, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_CIRC, /**/ KC_AMPR, /**/ KC_ASTR, /**/ KC_LPRN, /**/ KC_RPRN, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*===============*/ KC_6, /**/ KC_7, /**/ KC_8, /**/ KC_9, /**/ KC_0, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_ENT, /**/ KC_PIPE, /**/ KC_UNDS, /**/ KC_COMM, /**/ KC_DOT, /**/ KC_BSLS, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ /**/ /**/ + /**/ /**/ /**/ /**/ + /*===============*/ /**/ /**/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_RSFT, /**/ ___ /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + ), + +}; From 904b1b3f99201f4bead195e2b777a71cb25736d8 Mon Sep 17 00:00:00 2001 From: Erin Call Date: Mon, 22 Jan 2018 14:11:46 -0800 Subject: [PATCH 104/556] Use perl directly instead of grep -P BSD grep (the one on OSX) lacks a -P flag. The grep -P command thus fails and prints a usage message to the terminal. This fixes that. --- tmk_core/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 7a282cacc..a1df7fc28 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -371,7 +371,7 @@ show_path: @echo OBJ=$(OBJ) check-size: - $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | grep -oP "(?<=AVR_SIZE: ).+"`; echo $$(($$n)) || echo 0)) + $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | perl -ne 'print "$&\n" if /(?<=AVR_SIZE: ).+/'`; echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ From 55d4c9b162b505695597a87d64ef04e29120118e Mon Sep 17 00:00:00 2001 From: Louis Orleans Date: Thu, 1 Feb 2018 22:11:57 -0800 Subject: [PATCH 105/556] =?UTF-8?q?=F0=9F=94=A7=20create=20info.json=20for?= =?UTF-8?q?=20Infinity=20Ergodox=20(#2267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔧 create info.json for Infinity Ergodox I'm not sure if the bootloader key is set correctly. * 🐛 fix layout name --- keyboards/ergodox_infinity/info.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 keyboards/ergodox_infinity/info.json diff --git a/keyboards/ergodox_infinity/info.json b/keyboards/ergodox_infinity/info.json new file mode 100644 index 000000000..72d035c5b --- /dev/null +++ b/keyboards/ergodox_infinity/info.json @@ -0,0 +1,14 @@ +{ + "keyboard_name": "Infinity Ergodox", + "manufacturer": "Input Club", + "identifier": "FEED:6464:0001", + "processor": "MK20DX256VLH7", + "bootloader": "KIIBOHD_BOOTLOADER", + "width": 19.5, + "height": 9.375, + "layouts": { + "KEYMAP": { + "layout": [{"label":"#", "x":3.5, "y":0}, {"label":"*", "x":15, "y":0}, {"label":"@", "x":2.5, "y":0.125}, {"label":"$", "x":4.5, "y":0.125}, {"label":"&", "x":14, "y":0.125}, {"label":"(", "x":16, "y":0.125}, {"label":"%", "x":5.5, "y":0.25}, {"x":6.5, "y":0.25}, {"x":12, "y":0.25}, {"label":"^", "x":13, "y":0.25}, {"x":0, "y":0.375, "w":1.5}, {"label":"!", "x":1.5, "y":0.375}, {"label":")", "x":17, "y":0.375}, {"x":18, "y":0.375, "w":1.5}, {"label":"E", "x":3.5, "y":1}, {"label":"I", "x":15, "y":1}, {"label":"W", "x":2.5, "y":1.125}, {"label":"R", "x":4.5, "y":1.125}, {"label":"U", "x":14, "y":1.125}, {"label":"O", "x":16, "y":1.125}, {"label":"T", "x":5.5, "y":1.25}, {"x":6.5, "y":1.25, "h":1.5}, {"x":12, "y":1.25, "h":1.5}, {"label":"Y", "x":13, "y":1.25}, {"x":0, "y":1.375, "w":1.5}, {"label":"Q", "x":1.5, "y":1.375}, {"label":"P", "x":17, "y":1.375}, {"x":18, "y":1.375, "w":1.5}, {"label":"D", "x":3.5, "y":2}, {"label":"K", "x":15, "y":2}, {"label":"S", "x":2.5, "y":2.125}, {"label":"F", "x":4.5, "y":2.125}, {"label":"J", "x":14, "y":2.125}, {"label":"L", "x":16, "y":2.125}, {"label":"G", "x":5.5, "y":2.25}, {"label":"H", "x":13, "y":2.25}, {"x":0, "y":2.375, "w":1.5}, {"label":"A", "x":1.5, "y":2.375}, {"label":":", "x":17, "y":2.375}, {"x":18, "y":2.375, "w":1.5}, {"x":6.5, "y":2.75, "h":1.5}, {"x":12, "y":2.75, "h":1.5}, {"label":"C", "x":3.5, "y":3}, {"label":"<", "x":15, "y":3}, {"label":"X", "x":2.5, "y":3.125}, {"label":"V", "x":4.5, "y":3.125}, {"label":"M", "x":14, "y":3.125}, {"label":">", "x":16, "y":3.125}, {"label":"B", "x":5.5, "y":3.25}, {"label":"N", "x":13, "y":3.25}, {"x":0, "y":3.375, "w":1.5}, {"label":"Z", "x":1.5, "y":3.375}, {"label":"?", "x":17, "y":3.375}, {"x":18, "y":3.375, "w":1.5}, {"x":3.5, "y":4}, {"x":15, "y":4}, {"x":2.5, "y":4.125}, {"x":4.5, "y":4.125}, {"x":14, "y":4.125}, {"x":16, "y":4.125}, {"x":0.5, "y":4.375}, {"x":1.5, "y":4.375}, {"x":17, "y":4.375}, {"x":18, "y":4.375}, {"x":1, "y":4.375}, {"x":2, "y":4.375}, {"x":0, "y":5.375, "h":2}, {"x":1, "y":5.375, "h":2}, {"x":2, "y":5.375}, {"x":2, "y":6.375}, {"x":-3.0, "y":6.375}, {"x":-2, "y":6.375}, {"x":-3.0, "y":7.375}, {"x":-2, "y":7.375, "h":2}, {"x":-1.0, "y":7.375, "h":2}, {"x":-3.0, "y":8.375}] + } + } +} From 2917e55bd4c8e25d79981ec997037b89478d402c Mon Sep 17 00:00:00 2001 From: Donald Date: Fri, 2 Feb 2018 01:13:44 -0500 Subject: [PATCH 106/556] Added info.json and updated README for Deltasplit75 (#2266) * Added info.json and updated README * Updated info.json --- keyboards/deltasplit75/info.json | 18 ++++++++++++++++++ keyboards/deltasplit75/readme.md | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 keyboards/deltasplit75/info.json diff --git a/keyboards/deltasplit75/info.json b/keyboards/deltasplit75/info.json new file mode 100644 index 000000000..53b06e0f6 --- /dev/null +++ b/keyboards/deltasplit75/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "DeltaSplit75", + "identifier":"FEED:3060:0001", + "manufacturer": "xyxjj", + "maintainer": "xyxjj & itsaferbie", + "processor": "atmega32u4", + "bootloader": "n/a", + "width": 17, + "height": 6, + "layouts": { + "KEYMAP_V2": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":8, "y":0}, {"label":"F8", "x":9, "y":0}, {"label":"F9", "x":10, "y":0}, {"label":"F10", "x":11, "y":0}, {"label":"F11", "x":12, "y":0}, {"label":"F12", "x":13, "y":0}, {"label":"Print", "x":14, "y":0}, {"label":"Scroll", "x":15, "y":0}, {"label":"Pause", "x":16, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":8, "y":1}, {"label":"*", "x":9, "y":1}, {"label":"(", "x":10, "y":1}, {"label":")", "x":11, "y":1}, {"label":"_", "x":12, "y":1}, {"label":"+", "x":13, "y":1}, {"label":"Back", "x":14, "y":1}, {"label":"Trns", "x":15, "y":1}, {"label":"Home", "x":16, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":7.5, "y":2}, {"label":"U", "x":8.5, "y":2}, {"label":"I", "x":9.5, "y":2}, {"label":"O", "x":10.5, "y":2}, {"label":"P", "x":11.5, "y":2}, {"label":"{", "x":12.5, "y":2}, {"label":"}", "x":13.5, "y":2}, {"label":"Back", "x":14.5, "y":2, "w":1.5}, {"label":"PgUp", "x":16, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":7.75, "y":3}, {"label":"J", "x":8.75, "y":3}, {"label":"K", "x":9.75, "y":3}, {"label":"L", "x":10.75, "y":3}, {"label":":", "x":11.75, "y":3}, {"label":"\"", "x":12.75, "y":3}, {"label":"Trns", "x":13.75, "y":3}, {"label":"Enter", "x":14.75, "y":3, "w":1.25}, {"label":"PgDn", "x":16, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"label":"Trns", "x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"B", "x":7.25, "y":4}, {"label":"N", "x":8.25, "y":4}, {"label":"M", "x":9.25, "y":4}, {"label":"<", "x":10.25, "y":4}, {"label":">", "x":11.25, "y":4}, {"label":"?", "x":12.25, "y":4}, {"label":"Shift", "x":13.25, "y":4, "w":1.75}, {"label":"Up", "x":15, "y":4}, {"label":"End", "x":16, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"label":"Space", "x":3.75, "y":5, "w":2}, {"label":"Fn", "x":5.75, "y":5}, {"label":"Space", "x":7.75, "y":5, "w":2.75}, {"label":"Alt", "x":10.5, "y":5, "w":1.25}, {"label":"Win", "x":11.75, "y":5}, {"label":"Ctrl", "x":12.75, "y":5, "w":1.25}, {"label":"Left", "x":14, "y":5}, {"label":"Down", "x":15, "y":5}, {"label":"Right", "x":16, "y":5}] + }, + "KEYMAP_PROTOSPLIT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":8, "y":0}, {"label":"F8", "x":9, "y":0}, {"label":"F9", "x":10, "y":0}, {"label":"F10", "x":11, "y":0}, {"label":"F11", "x":12, "y":0}, {"label":"F12", "x":13, "y":0}, {"label":"Insert", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"PgUp", "x":16, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":8, "y":1}, {"label":"*", "x":9, "y":1}, {"label":"(", "x":10, "y":1}, {"label":")", "x":11, "y":1}, {"label":"_", "x":12, "y":1}, {"label":"+", "x":13, "y":1}, {"label":"Delete", "x":14, "y":1}, {"label":"End", "x":15, "y":1}, {"label":"PgDn", "x":16, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":7.5, "y":2}, {"label":"U", "x":8.5, "y":2}, {"label":"I", "x":9.5, "y":2}, {"label":"O", "x":10.5, "y":2}, {"label":"P", "x":11.5, "y":2}, {"label":"{", "x":12.5, "y":2}, {"label":"}", "x":13.5, "y":2}, {"label":"Back", "x":14.5, "y":2, "w":1.5}, {"label":"Scroll", "x":16, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":7.75, "y":3}, {"label":"J", "x":8.75, "y":3}, {"label":"K", "x":9.75, "y":3}, {"label":"L", "x":10.75, "y":3}, {"label":":", "x":11.75, "y":3}, {"label":"\"", "x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":2.25}, {"label":"Pause", "x":16, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"B", "x":7.25, "y":4}, {"label":"N", "x":8.25, "y":4}, {"label":"M", "x":9.25, "y":4}, {"label":"<", "x":10.25, "y":4}, {"label":">", "x":11.25, "y":4}, {"label":"?", "x":12.25, "y":4}, {"label":"Shift", "x":13.25, "y":4, "w":1.75}, {"label":"Up", "x":15, "y":4}, {"label":"Print", "x":16, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"label":"Space", "x":3.75, "y":5, "w":2}, {"label":"Fn", "x":5.75, "y":5}, {"label":"Space", "x":7.75, "y":5, "w":2.75}, {"label":"Alt", "x":10.5, "y":5, "w":1.25}, {"label":"Win", "x":11.75, "y":5}, {"label":"Ctrl", "x":12.75, "y":5, "w":1.25}, {"label":"Left", "x":14, "y":5}, {"label":"Down", "x":15, "y":5}, {"label":"Right", "x":16, "y":5}] + } + } +} diff --git a/keyboards/deltasplit75/readme.md b/keyboards/deltasplit75/readme.md index f911f7871..990f8902d 100644 --- a/keyboards/deltasplit75/readme.md +++ b/keyboards/deltasplit75/readme.md @@ -3,7 +3,7 @@ DeltaSplit75 A split 75% keyboard made by xyxjj. [More info on qmk.fm](http://qmk.fm/deltasplit75/) -Keyboard Maintainer: [xyxjj](https://github.com/xyxjj) +Keyboard Maintainer: [xyxjj](https://github.com/xyxjj) & [itsaferbie](https://github.com/itsaferbie) Hardware Supported: Pro Micro Hardware Availability: Group Buy From 2cf6bfe9ac10663181aa3ba32087da956bb7ec1e Mon Sep 17 00:00:00 2001 From: jola5 Date: Fri, 2 Feb 2018 07:21:41 +0100 Subject: [PATCH 107/556] Not quite neo (#2318) * planck with a not-quite-neo layout for a de-DE OS/SW keymap * ergodox infinity with a not-quite-neo layout for a de-DE OS/SW keymap * add documentation --- .../keymaps/not-quite-neo/keymap.c | 292 ++++++++++++++++++ .../keymaps/not-quite-neo/readme.md | 5 + .../keymaps/not-quite-neo/rules.mk | 2 + .../planck/keymaps/not-quite-neo/config.h | 6 + .../planck/keymaps/not-quite-neo/keymap.c | 129 ++++++++ .../planck/keymaps/not-quite-neo/readme.md | 5 + .../planck/keymaps/not-quite-neo/rules.mk | 29 ++ users/not-quite-neo/nqn-basic-layout.h | 124 ++++++++ users/not-quite-neo/nqn-common.h | 14 + .../nqn-keys-on-quertz-de-latin1.h | 73 +++++ users/not-quite-neo/readme.md | 24 ++ 11 files changed, 703 insertions(+) create mode 100644 keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c create mode 100644 keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md create mode 100644 keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk create mode 100644 keyboards/planck/keymaps/not-quite-neo/config.h create mode 100644 keyboards/planck/keymaps/not-quite-neo/keymap.c create mode 100644 keyboards/planck/keymaps/not-quite-neo/readme.md create mode 100644 keyboards/planck/keymaps/not-quite-neo/rules.mk create mode 100644 users/not-quite-neo/nqn-basic-layout.h create mode 100644 users/not-quite-neo/nqn-common.h create mode 100644 users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h create mode 100644 users/not-quite-neo/readme.md diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c b/keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c new file mode 100644 index 000000000..8cf51842a --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c @@ -0,0 +1,292 @@ +#include QMK_KEYBOARD_H + +/* +NQN is not-quite-neo +A layout based on neo2 +*/ + +#include "action_layer.h" +#include "version.h" + +#include "nqn-keys-on-quertz-de-latin1.h" +#include "nqn-basic-layout.h" + +// Since our quirky block definitions are basically a list of comma separated +// arguments, we need a wrapper in order for these definitions to be +// expanded before being used as arguments to the LAYOUT_xxx macro. +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) + +#ifdef LEADER_TIMEOUT +#undef LEADER_TIMEOUT +#endif +#define LEADER_TIMEOUT 300 + +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + + +// Automatic number generation of important keywords +enum my_keycodes{ + // Layer numbers follow the neo2 terminology, i.e. base layer = layer 1 + L01 = 0, + /* L02, SHIFT is not (yet) implemented as a fully customizable layer */ + L03, + L04, + L05, + /* L06, UNSPECIFIED not (yet) needed */ + LFN +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* L01 -> default: BASE LAYER + * ,--------------------------------------------------. ,--------------------------------------------------. + * | TAB | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ESC | | LEADR| | LEADR| | ENTER | + * |--------+ | | | | +--------| + * | L03 | L01_LEFT |------| |------| L01_RIGHT | L03 | + * |--------+ | LFN | | LFN | +--------| + * | SHIFT | | | | | | SHIFT | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | CTRL | GUI | ALT | L05 | L04 | | L04 | L05 | ALTGR| LFN | CTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | HOME | END | | LEFT | RIGHT| + * ,------|------|------| |------+------+------. + * | | | PGUP | | UP | | | + * | SPACE| SHIFT|------| |------| SHIFT| SPACE| + * | | | PGDN | | DOWN | | | + * `--------------------' `--------------------' + */ +[L01] = LAYOUT_ergodox_wrapper( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, + KC_ESC, L01_LEFT_01, KC_LEAD, + MO(L03), L01_LEFT_02, + KC_LSHIFT, L01_LEFT_03, MO(LFN), + KC_LCTRL,KC_LGUI,KC_LALT, MO(L05), MO(L04), + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_SPACE,KC_LSHIFT,KC_PGDN, + //-- + XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPACE, + KC_LEAD, L01_RIGHT_01, KC_ENTER, + L01_RIGHT_02, MO(L03), + MO(LFN), L01_RIGHT_03, KC_RSHIFT, + MO(L04), MO(L05), KC_RALT, MO(LFN), KC_RCTRL, + KC_LEFT, KC_RIGHT, + KC_UP, + KC_DOWN, KC_RSHIFT, KC_SPACE +), + + +/* +L02 -> MO(L02): SHIFT (as a layer not used, not defined, not reachable) + */ + + +/* L03 -> MO(L03): PROGRAMMING + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | + * |--------+ | | | | +--------| + * | | L03_LEFT |------| |------| L03_RIGHT | | + * |--------+ | | | | +--------| + * | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[L03] = LAYOUT_ergodox_wrapper( + _______, _______, _______, _______, _______, _______, _______, + _______, L03_LEFT_01, _______, + _______, L03_LEFT_02, + _______, L03_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, _______, + _______, L03_RIGHT_01, _______, + L03_RIGHT_02, _______, + _______, L03_RIGHT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), + +/* L04 -> MO(L04): NAVIGATION AND NUMBERS + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | + * |--------+ | | | | +--------| + * | | L04_LEFT |------| |------| L04_RIGHT | | + * |--------+ | | | | +--------| + * | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | 0 | |------| |------| | 0 | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[L04] = LAYOUT_ergodox_wrapper( + _______, _______, _______, _______, _______, _______, _______, + _______, L04_LEFT_01, _______, + _______, L04_LEFT_02, + _______, L04_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + KC_0, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, _______, + _______, L04_RIGHT_01, _______, + L04_RIGHT_02, _______, + _______, L04_RIGHT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, KC_0 +), + + +/* L05 -> MO(L05): ALTERNATE + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | + * |--------+ | | | | +--------| + * | | L05_LEFT |------| |------| L05_RIGHT | | + * |--------+ | | | | +--------| + * | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[L05] = LAYOUT_ergodox_wrapper( + _______, _______, _______, _______, _______, _______, _______, + _______, L05_LEFT_01, _______, + _______, L05_LEFT_02, + _______, L05_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, _______, + _______, L05_RIGHT_01, _______, + L05_RIGHT_02, _______, + _______, L05_RIGHT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), + + +/* +L06 -> : UNSPECIFIED +*/ + + +/* LFN -> MO(FN): FUNCTION + * ,--------------------------------------------------. ,--------------------------------------------------. + * | RESET | | | | | | | | | | | | | | RESET | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | BACKSPC| + * |--------+ | | | | +--------| + * | | L06_LEFT |------| |------| L06_RIGHT | INSERT | + * |--------+ | | | | +--------| + * | | | | | | | DELETE | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | VOL+ | VOL- | MUTE | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[LFN] = LAYOUT_ergodox_wrapper( + RESET, _______, _______, _______, _______, _______, _______, + _______, L06_LEFT_01, _______, + _______, L06_LEFT_02, + _______, L06_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, RESET, + _______, L06_RIGHT_01, KC_BSPACE, + L06_RIGHT_02, KC_INSERT, + _______, L06_RIGHT_03, KC_DELETE, + KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, + _______, _______, + _______, + _______, _______, _______ +) + +}; + + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; + + +LEADER_EXTERNS(); + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY (KC_1) { + // ¯\_(ツ)_/¯ + unicode_input_start(); register_hex(0xaf); unicode_input_finish(); + register_code (KC_RALT); TAP_ONCE (KC_MINS); unregister_code (KC_RALT); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); TAP_ONCE(KC_7); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0xaf); unicode_input_finish(); + } + + SEQ_ONE_KEY (KC_2) { + // 凸(ツ)凸 + unicode_input_start(); register_hex(0x51F8); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x51F8); unicode_input_finish(); + } + } +} diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md b/keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md new file mode 100644 index 000000000..3fcb4edf0 --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md @@ -0,0 +1,5 @@ +# not-quite-neo + +This is my personal take on porting the [neo2 layout](https://www.neo-layout.org/) to support multiple keyboards. + +Refer to the [readme.md](../../../../users/not-quite-neo/readme.md) of the generic parts of the implementation. \ No newline at end of file diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk b/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk new file mode 100644 index 000000000..75624bb8c --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = yes +UNICODE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/planck/keymaps/not-quite-neo/config.h b/keyboards/planck/keymaps/not-quite-neo/config.h new file mode 100644 index 000000000..7fa3bf328 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#endif diff --git a/keyboards/planck/keymaps/not-quite-neo/keymap.c b/keyboards/planck/keymaps/not-quite-neo/keymap.c new file mode 100644 index 000000000..8ea7679e3 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/keymap.c @@ -0,0 +1,129 @@ +/* +NQN is not-quite-neo +A layout based on the +*/ + + +#include "planck.h" +#include "nqn-keys-on-quertz-de-latin1.h" +#include "nqn-basic-layout.h" + + +// Automatic number generation of important keywords +enum my_keycodes{ + // Layer numbers follow the neo2 terminology, i.e. base layer = layer 1 + L01 = 0, + /* L02, SHIFT is not (yet) implemented as a fully customizable layer */ + L03, + L04, + L05, + /* L06, UNSPECIFIED not (yet) needed */ + LFN +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* L01 -> default: BASE LAYER + * ,-----------------------------------------------------------------------------------. + * | ESC | | | ENTER| + * |------+ | +------| + * | L03 | L01_LEFT | L01_RIGHT | L03 | + * |------+ | +------| + * | SHIFT| | | SHIFT| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CTLR | GUI | ALT | L05 | L04 | SPACE| SPACE| L04 | L05 | ALTGR| LFN | CTLR | + * `-----------------------------------------------------------------------------------' + */ +[L01] = { + {KC_ESC, L01_LEFT_01, L01_RIGHT_01, KC_ENTER}, + {MO(L03), L01_LEFT_02, L01_RIGHT_02, MO(L03)}, + {KC_LSHIFT, L01_LEFT_03, L01_RIGHT_03, KC_RSFT}, + {KC_LCTRL,KC_LGUI, KC_LALT, MO(L05), MO(L04), KC_SPC, KC_SPC, MO(L04), MO(L05), KC_RALT, MO(LFN), KC_RCTRL} +}, + + +/* +L02 -> MO(L02): SHIFT (as a layer not used, not defined, not reachable) + */ + + +/* L03 -> MO(L03): PROGRAMMING + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L03_LEFT | L03_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L03] = { + {_______, L03_LEFT_01, L03_RIGHT_01, _______}, + {_______, L03_LEFT_02, L03_RIGHT_02, _______}, + {_______, L03_LEFT_03, L03_RIGHT_03, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + + +/* L04 -> MO(L04): NAVIGATION AND NUMBERS + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L04_LEFT | L04_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | 0 | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L04] = { + {_______, L04_LEFT_01, L04_RIGHT_01, _______}, + {_______, L04_LEFT_02, L04_RIGHT_02, _______}, + {_______, L04_LEFT_03, L04_RIGHT_03, _______}, + {_______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______, _______} +}, + + +/* L05 -> MO(L05): ALTERNATE + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L05_LEFT | L05_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L05] = { + {_______, L05_LEFT_01, L05_RIGHT_01, _______}, + {_______, L05_LEFT_02, L05_RIGHT_02, _______}, + {_______, L05_LEFT_03, L05_RIGHT_03, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + + +/* +L06 -> : UNSPECIFIED +*/ + + +/* LFN -> MO(FN): FUNCTION + * ,-----------------------------------------------------------------------------------. + * | RESET| | | BACKS| + * |------+ | +------| + * | | L06_LEFT | L06_RIGHT |INSERT| + * |------+ | +------| + * | | | |DELETE| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |VOICE-|VOICE+|MUS ON|MUS OF| LIGHT| | | VOL+ | VOL- | MUTE | | | + * `-----------------------------------------------------------------------------------' + */ +[LFN] = { + {RESET, L06_LEFT_01, L06_RIGHT_01, KC_BSPC}, + {_______, L06_LEFT_02, L06_RIGHT_02, KC_INS}, + {_______, L06_LEFT_03, L06_RIGHT_03, KC_DEL}, + {MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______} +} +}; diff --git a/keyboards/planck/keymaps/not-quite-neo/readme.md b/keyboards/planck/keymaps/not-quite-neo/readme.md new file mode 100644 index 000000000..3fcb4edf0 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/readme.md @@ -0,0 +1,5 @@ +# not-quite-neo + +This is my personal take on porting the [neo2 layout](https://www.neo-layout.org/) to support multiple keyboards. + +Refer to the [readme.md](../../../../users/not-quite-neo/readme.md) of the generic parts of the implementation. \ No newline at end of file diff --git a/keyboards/planck/keymaps/not-quite-neo/rules.mk b/keyboards/planck/keymaps/not-quite-neo/rules.mk new file mode 100644 index 000000000..316a3ea7b --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/rules.mk @@ -0,0 +1,29 @@ +# Based on Zach's Planck Makefile +# Max .hex size is about 28636 bytes + +# 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 +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +USB_6KRO_ENABLE = no # 6key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +#VARIABLE_TRACE = no # Debug changes to variable values +UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) +UNICODEMAP_ENABLE = no # Enable extended 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 diff --git a/users/not-quite-neo/nqn-basic-layout.h b/users/not-quite-neo/nqn-basic-layout.h new file mode 100644 index 000000000..d1b9a1c47 --- /dev/null +++ b/users/not-quite-neo/nqn-basic-layout.h @@ -0,0 +1,124 @@ +#ifndef NQN_BASIC_LAYOUT_H +#define NQN_BASIC_LAYOUT_H + +/* +This is the basic NQN layout + +It consists of a block of 5x3, 5x4, 6x3, or 6x4 for each hand. This allows us +to use these blocks for a variety of keyboards like the planck, preonic and +even splits like the ergodox. + +You can see that we use some quirky preprocessor defines to achive what we +desire. In the future I would like to see qmk taking a more generic approach +like the KLL. + +The naming convention for these blocks is + L__ + + The LAYER is a number following the neo2 manner starting at 1 for the base + layer, 2 is shift, 3 is for special chars etc. + + SIDE is, well either the left or right side/half of a keyboard. + + The ROW is starting from the top, numbering beginning at 1. +*/ + + +#include "nqn-common.h" + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | x | v | l | c | w | | k | h | g | f | q | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | u | i | a | e | o | | s | n | r | t | d | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | y | < | # | p | z | | b | m | , | . | j | + * `----------------------------------' `----------------------------------' + */ +#define L01_LEFT_01 KC_X, KC_V, KC_L, KC_C, KC_W +#define L01_LEFT_02 KC_U, KC_I, KC_A, KC_E, KC_O +#define L01_LEFT_03 N_Y, N_LT, N_HS, KC_P, N_Z +#define L01_RIGHT_02 KC_S, KC_N, KC_R, KC_T, KC_D +#define L01_RIGHT_01 KC_K, KC_H, KC_G, KC_F, KC_Q +#define L01_RIGHT_03 KC_B, KC_M, KC_COMM, KC_DOT, KC_J + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | … | _ | [ | ] | ^ | | ! | < | > | = | & | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | \ | / | { | } | * | | ? | ( | ) | - | @ | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | # | $ | | | ~ | ` | | + | % | " | ' | ° | + * `----------------------------------' `----------------------------------' + */ +#define L03_LEFT_01 N_DOTS, N_USC, N_LSQBR, N_RSQBR, N_CIRC +#define L03_LEFT_02 N_BSLS, N_SLSH, N_LCUBR, N_RCUBR, N_ASTR +#define L03_LEFT_03 N_HASH, N_DLR, N_PIPE, N_TILD, N_GRAVE +#define L03_RIGHT_01 N_EXKL, N_LT, N_GT, N_EQ, N_AMP +#define L03_RIGHT_02 N_QUES, N_LPARN, N_RPARN, N_MINS, N_AT +#define L03_RIGHT_03 N_PLUS, N_PERC, N_QUOT, N_SING, N_DEGRE + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | PAGEU| BACKS| UP | DELET| PAGED| | / | 7 | 8 | 9 | - | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | HOME | LEFT | DOWN | RIGHT| END | | * | 4 | 5 | 6 | + | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | ESC | TAB | INSRT| ENTER| UNDO | | ENTER| 1 | 2 | 3 | , | + * `----------------------------------' `----------------------------------' + */ +#define L04_LEFT_01 KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN +#define L04_LEFT_02 KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END +#define L04_LEFT_03 KC_ESC, KC_TAB, KC_INS, KC_ENTER, N_UNDO +#define L04_RIGHT_01 KC_KP_SLASH, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_MINUS +#define L04_RIGHT_02 KC_KP_ASTERISK, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS +#define L04_RIGHT_03 KC_KP_ENTER, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_DOT + + +/* + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | | | | | | | | | | | | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | ü | | ä | € | ö | | ß | | | | | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | | | | | | | | µ | | | | + * `----------------------------------' `----------------------------------' + */ +#define L05_LEFT_01 _______, _______, _______, _______, _______ +#define L05_LEFT_02 N_UE, _______, N_AE, N_EURO, N_OE +#define L05_LEFT_03 _______, _______, _______, _______, _______ +#define L05_RIGHT_01 _______, _______, _______, _______, _______ +#define L05_RIGHT_02 N_SS, _______, _______, _______, _______ +#define L05_RIGHT_03 _______, N_MU, _______, _______, _______ + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | F1 | F2 | F3 | F4 | | | MAIL | MUSIC| FILES| CALC | PASTE| + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | F5 | F6 | F7 | F8 | | | PREV |PLAY/P| NEXT | STOP | COPY | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | F9 | F10 | F11 | F12 | | | PRINT| SCROL| PAUSE| NUMLK| CUT | + * `----------------------------------' `----------------------------------' + */ +#define L06_LEFT_01 KC_F1, KC_F2, KC_F3, KC_F4, _______ +#define L06_LEFT_02 KC_F5, KC_F6, KC_F7, KC_F8, _______ +#define L06_LEFT_03 KC_F9, KC_F10, KC_F11, KC_F12, _______ +#define L06_RIGHT_01 KC_MAIL, KC_MSEL, KC_MY_COMPUTER, KC_CALCULATOR, N_PASTE +#define L06_RIGHT_02 KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, N_COPY +#define L06_RIGHT_03 KC_PSCR, KC_SLCK, KC_PAUS, KC_NLCK, N_CUT + + +#endif diff --git a/users/not-quite-neo/nqn-common.h b/users/not-quite-neo/nqn-common.h new file mode 100644 index 000000000..a04dc7a18 --- /dev/null +++ b/users/not-quite-neo/nqn-common.h @@ -0,0 +1,14 @@ +#ifndef NQN_COMMON_H +#define NQN_COMMON_H + + +/* +This file holds some commen NQN definitions +*/ + + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +#endif diff --git a/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h b/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h new file mode 100644 index 000000000..8276cf207 --- /dev/null +++ b/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h @@ -0,0 +1,73 @@ +#ifndef NQN_KEYS_ON_QUERTZ_DE_LATIN1_H +#define NQN_KEYS_ON_QUERTZ_DE_LATIN1_H + + +/* +This file defines the desierd NQN keys if you use a software (operating sysetm) +configured for a QUERTZ layout (de-latin1). + +These chars can be created by using ALTGR on linux and a few of them on windows +with a German de-latin1 layout (depending on desktop environment and/or +application). + ′¹²³¼½¬{[]}\¸ + @ł€¶ŧ←↓→øþ¨~ + æſðđŋħ̣ĸł˝^’ + |»«¢„“”µ·…– + +Additionally, there are some common chars that we dit not yet define: + § +*/ + + +#include "nqn-common.h" + + +// NQN key definitions in no particular order +#define N_LT KC_NONUS_BSLASH +#define N_HS KC_NONUS_HASH +#define N_DOTS RALT(KC_DOT) // … +#define N_USC LSFT(KC_SLASH) // _ +#define N_LSQBR RALT(KC_8) // [ +#define N_RSQBR RALT(KC_9) // ] +#define N_CIRC KC_GRAVE // ^ +#define N_EXKL LSFT(KC_1) // ! +#define N_GT LSFT(KC_NONUS_BSLASH) // > +#define N_EQ LSFT(KC_0) // = +#define N_AMP LSFT(KC_6) // & +#define N_BSLS RALT(KC_MINS) // \ backslash +#define N_SLSH LSFT(KC_7) // / +#define N_LCUBR RALT(KC_7) // { +#define N_RCUBR RALT(KC_0) // } +#define N_ASTR LSFT(KC_RBRC) // * +#define N_QUES LSFT(KC_MINS) // ? +#define N_LPARN LSFT(KC_8) // ( +#define N_RPARN LSFT(KC_9) // ) +#define N_MINS KC_SLASH // - +#define N_COLN LSFT(KC_DOT) // : +#define N_HASH KC_BSLASH // # +#define N_DLR LSFT(KC_4) // $ +#define N_PIPE RALT(KC_NONUS_BSLASH) // | +#define N_TILD RALT(KC_RBRC) // ~ +#define N_GRAVE LSFT(KC_EQUAL) // ` +#define N_PLUS KC_RBRC // + +#define N_PERC LSFT(KC_5) // % +#define N_QUOT LSFT(KC_2) // " +#define N_SING LSFT(KC_BSLASH) // ' +#define N_SEMI LSFT(KC_COMM) // ; +#define N_EURO RALT(KC_E) // € +#define N_AT RALT(KC_Q) // @ +#define N_Z KC_Y +#define N_Y KC_Z +#define N_AE KC_QUOTE // ä +#define N_OE KC_SCOLON // ö +#define N_UE KC_LBRACKET // ü +#define N_MU RALT(KC_M) // µ +#define N_SS KC_MINS // ß +#define N_DEGRE LSFT(KC_GRAVE) // ° +#define N_PASTE LCTL(KC_V) // CTRL+V +#define N_COPY LCTL(KC_C) // CTRL+C +#define N_CUT LCTL(KC_X) // CTRL+X +#define N_UNDO LCTL(N_Z) // CTRL+Z + + +#endif diff --git a/users/not-quite-neo/readme.md b/users/not-quite-neo/readme.md new file mode 100644 index 000000000..85a29ecc6 --- /dev/null +++ b/users/not-quite-neo/readme.md @@ -0,0 +1,24 @@ +# not-quite-neo + +This is my personal take on porting the [neo2 layout](https://www.neo-layout.org/) to support both a ergodox (infinity) and a planck keyboard. Some sacrifices needed to be made, hence this layout is not-quite-neo. + +## Use case +My use case is simple: + +* I want to use neo2 (or a keymap as close as possible) on any computer I can plug my keyboards in. Because installing the neo2 SW driver is often not a acceptable solution. +* Since most computers I work on (colleagues, family, etc.) use a de-DE keymap, I can not use the official neo2 implementation, because it relies on a us layout and I often times do not even posses the administration rights to change that. +* neo2 makes use of most of the keys of a standard 104 key keyboard, especially for supporting the planck I needed to deviate from the original neo2 layout in order to fit everything I wanted. + +Therefore, I put all reusable code in the users/not-quite-neo directory and created a custom not-quite-neo keymap for the planck and the ergodox infinity keyboard respectively. + +## Pitfalls +Mind, since neo2 is a SW driver supported layout it offers a lot of features that are hard to support in hardware (especially the fancy utf stuff with math symbols and greek letters etc.). + +Right now this implementation only incompletely supports neo2 layers 1 to 4. + +The biggest difference is probably the support for the German Umlauts ä, ö, ü and the ß. Since we rely on a smaller number of keys some glyphs needed to be created otherwise. See the implementation in [nqn-basic-layout.h](nqn-basic-layout.h) for details. + +## Keyboards and keymaps + +You can find the *not-quite-neo* keymap for the ergodox infinity under [qmk_firmware/keyboards/ergodox_infinity/keymaps/not-quite-neo/](../../keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md). Respectively the keymap for the planck resides in [qmk_firmware/keyboards/planck/keymaps/not-quite-neo/](../../keyboards/planck/keymaps/not-quite-neo/readme.md) + . \ No newline at end of file From 042a450e24ad84c4a08b9e5435f97fe7bbd653a4 Mon Sep 17 00:00:00 2001 From: kifinnsson Date: Thu, 1 Feb 2018 23:22:37 -0700 Subject: [PATCH 108/556] Personal BEAKL9 based keymap (#2304) * Adding personal BEAKL9 based keymap Initial commit, very much a WIP/Proof of concept. * Updating personal BEAKL9 based layout * F-keys added to upper layer --- keyboards/miuni32/keymaps/ki/config.h | 8 ++ keyboards/miuni32/keymaps/ki/keymap.c | 149 +++++++++++++++++++++++++ keyboards/miuni32/keymaps/ki/readme.md | 4 + keyboards/miuni32/keymaps/ki/rules.mk | 21 ++++ 4 files changed, 182 insertions(+) create mode 100644 keyboards/miuni32/keymaps/ki/config.h create mode 100644 keyboards/miuni32/keymaps/ki/keymap.c create mode 100644 keyboards/miuni32/keymaps/ki/readme.md create mode 100644 keyboards/miuni32/keymaps/ki/rules.mk diff --git a/keyboards/miuni32/keymaps/ki/config.h b/keyboards/miuni32/keymaps/ki/config.h new file mode 100644 index 000000000..df06a2620 --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/miuni32/keymaps/ki/keymap.c b/keyboards/miuni32/keymaps/ki/keymap.c new file mode 100644 index 000000000..1df93b081 --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/keymap.c @@ -0,0 +1,149 @@ +#include "miuni32.h" +#include "action_layer.h" + +enum miuni32_layers { + _BEAKL, + _LOWER, + _RAISE, + _UNION +}; + +enum miuni32_keycodes { + BEAKL = SAFE_RANGE, + LOWER, + RAISE +}; + +#define SPC_SHF SFT_T(KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Level 0: BEAKL + * ,---------------------------------------------------------------------------------------. + * | J | H | O | U | K | LOWER | G | C | R | F | Z | + * |---------------------------------------------------------------------------------------| + * | Q | I | E | A | Y | RAISE | D | S | T | N | B | + * |---------------------------------------------------------------------------------------| + * | / | , | ' | . | X |SPC\SHF| W | M | L | P | V | + * |---------------------------------------------------------------------------------------| + */ + [_BEAKL] ={ + {KC_J, KC_H, KC_O, KC_U, KC_K, KC_NO, KC_G, KC_C, KC_R, KC_F, KC_Z}, + {KC_Q, KC_I, KC_E, KC_A, KC_Y, RAISE, KC_D, KC_S, KC_T, KC_N, KC_B}, + {KC_SLSH, KC_COMM, KC_QUOT, KC_DOT, KC_X, SPC_SHF, KC_W, KC_M, KC_L, KC_P, KC_V} + }, + /* Lower + * ,---------------------------------------------------------------------------------------. + * | Tab | { | _ | } | & | | Gui | [ | % | ] | Bkspc | + * |---------------------------------------------------------------------------------------| + * | \ | ( | 1 | ) | # | | $ | < | 0 | > | | | + * |---------------------------------------------------------------------------------------| + * | 5 | 4 | 3 | 2 | Ctl | | Alt | 9 | 8 | 7 | 6 | + * |---------------------------------------------------------------------------------------| + */ + [_LOWER] ={ + {KC_TAB, KC_LCBR, KC_UNDS, KC_RBRC, KC_AMPR, _______, KC_RGUI, KC_LBRC, KC_PERC, KC_RBRC, KC_BSPC}, + {KC_BSLS, KC_LPRN, KC_1, KC_RPRN, KC_HASH, _______, KC_DLR, KC_LT, KC_0, KC_GT, KC_PIPE}, + {KC_5, KC_4, KC_3, KC_2, KC_LCTL, _______, KC_RALT, KC_9, KC_8, KC_7, KC_6} + }, + /* Raise + * ,---------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |---------------------------------------------------------------------------------------| + * | F11 | F12 | ! | - | + | | = | ; | ) | ` | ? | + * |------------------------------- -------------------------------------------------------| + * | % | $ | # | @ | | | | ( | * | & | ^ | + * |---------------------------------------------------------------------------------------| + */ + [_RAISE] ={ + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10}, + {KC_F11, KC_F12, KC_EXLM, KC_MINS, KC_PLUS, _______, KC_EQL, KC_SCLN, KC_RPRN, KC_GRV, KC_QUES}, + {KC_PERC, KC_DLR, KC_HASH, KC_AT, _______, _______, _______, KC_LPRN, KC_ASTR, KC_AMPR, KC_CIRC} + }, + /* Union + * ,---------------------------------------------------------------------------------------. + * | RESET | | | | | | | | | | Del | + * |---------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * |---------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * |---------------------------------------------------------------------------------------| + */ + [_UNION] ={ + {RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + } +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +//planck like tri layer +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BEAKL: + if (record->event.pressed) { + set_single_persistent_default_layer(_BEAKL); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _UNION); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _UNION); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _UNION); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _UNION); + } + return false; + break; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/miuni32/keymaps/ki/readme.md b/keyboards/miuni32/keymaps/ki/readme.md new file mode 100644 index 000000000..7615d1c6a --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/readme.md @@ -0,0 +1,4 @@ +# A BEAKL9-ish keymap for miuni32 +A major WIP +Using planck like tri layer switching with a single center control column +No mousekey support diff --git a/keyboards/miuni32/keymaps/ki/rules.mk b/keyboards/miuni32/keymaps/ki/rules.mk new file mode 100644 index 000000000..8a72a6e4e --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/rules.mk @@ -0,0 +1,21 @@ +# 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 = 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 +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 = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 9303b42e690f5668e29b874d88e2bb3564bd93a2 Mon Sep 17 00:00:00 2001 From: Kenneth Aloysius Date: Fri, 2 Feb 2018 17:30:47 +1100 Subject: [PATCH 109/556] Update personal layouts, free up matrix_scan_user for JJ40 (#2319) * Add NIU Mini keymap from Planck keymap * Remove old keymap files * Fix README, removed Planck references * Add default layout, move Planck layout to separate folder * Update README * Add my XD60 keymap * Change RShift to slash * Fix keymap: stuck on MO(1) * Move RESET to Fn+Enter * Add: RGB saturation cycle * Add numpad layer to keymap * Fix last case * Cleanup Mechmini keymap. Once the custom RGB function is defined, there is no need to manually handle RGB code. * Change default to KEYMAP_MIT, not KEYMAP_OFFSET * Add custom RGB code for JJ40 * Reset Mechmini advertised power draw to 500. Will have to test actual maximum power draw later. * RGB working on JJ40. * Fix: saturation increase/decrease flipped * Add new directory for my custom keymap with RGB keycodes * Swap LAlt and LGUI * Update JJ40 max power draw with measured value * Update: fun40 rules.mk to enable underglow; earlier failed Travis CI * Fix: init RGB LEDs on boot. Also added HHKB-like keymap for XD60. * Super rudimentary backlight test, init RGB LEDs on boot * Backlighting works - stays on for now * Toggling working * Now can override backlight.c functions. Problem was functions in backlight.c weren't called before due to a lack of matrix_scan_quantum() in matrix.c * Timers not working * Delete global.h * Cleanup * Compiles * Good sign: LEDs stop working again * Handle timer1 overflow * Progress: fix: forgot to init * Backlighting fully working now except breathing. * Revert keymap to original keycodes * Update XD60 keymap README * Update JJ40 keymap with backlight toggles * Breathing working just fine. * Update references * Add backlight_set() call * Cleanup code to disable backlight * Fix: does not compile * Fix: missing call to rgblight_task. * Testing with BACKLIGHT_BREATHING * Cleanup * Cleanup comments * More commenting cleanup. * Do not enable BACKLIGHT_BREATHING by default * Update XD60 keymap * Update: move matrix_scan_kb out from matrix.c to jj40.c (kb-level) * Cleanup for PR * Fix conflict in readme.md for NIU mini * Restore original power consumption figure * Fix: matrix_scan_user() now has to be defined in the keymaps * Add weak `matrix_scan_user` so it does not have to be defined in keymap * Add weak matrix_init_user() --- keyboards/jj40/jj40.c | 18 ++++++++++++++++-- keyboards/jj40/keymaps/default/keymap.c | 5 +++++ keyboards/jj40/keymaps/fun40/keymap.c | 7 ++++++- keyboards/jj40/keymaps/krusli/config.h | 1 + keyboards/jj40/keymaps/krusli/keymap.c | 20 ++++++++++++++++---- keyboards/jj40/keymaps/krusli/rules.mk | 1 + keyboards/jj40/keymaps/oscillope/keymap.c | 6 ++++++ keyboards/jj40/matrix.c | 6 ------ keyboards/jj40/rules.mk | 1 - keyboards/niu_mini/keymaps/default/keymap.c | 0 keyboards/niu_mini/keymaps/readme.md | 2 +- keyboards/xd60/keymaps/krusli/readme.md | 9 +++++++-- tmk_core/protocol/lufa/descriptor.c | 2 +- 13 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 keyboards/jj40/keymaps/krusli/rules.mk mode change 100755 => 100644 keyboards/niu_mini/keymaps/default/keymap.c diff --git a/keyboards/jj40/jj40.c b/keyboards/jj40/jj40.c index 9c1775d6a..4affe199b 100644 --- a/keyboards/jj40/jj40.c +++ b/keyboards/jj40/jj40.c @@ -34,7 +34,7 @@ extern rgblight_config_t rgblight_config; // @Override void matrix_init_kb(void) { // call user level keymaps, if any - // matrix_init_user(); + matrix_init_user(); } #ifdef BACKLIGHT_ENABLE @@ -67,7 +67,8 @@ void rgblight_set(void) { } bool rgb_init = false; -void matrix_scan_user(void) { + +void matrix_scan_kb(void) { // if LEDs were previously on before poweroff, turn them back on if (rgb_init == false && rgblight_config.enable) { i2c_init(); @@ -76,5 +77,18 @@ void matrix_scan_user(void) { } rgblight_task(); + + matrix_scan_user(); /* Nothing else for now. */ } + +__attribute__((weak)) // overridable +void matrix_init_user(void) { + +} + + +__attribute__((weak)) // overridable +void matrix_scan_user(void) { + +} diff --git a/keyboards/jj40/keymaps/default/keymap.c b/keyboards/jj40/keymaps/default/keymap.c index e02dd902a..70c73c966 100644 --- a/keyboards/jj40/keymaps/default/keymap.c +++ b/keyboards/jj40/keymaps/default/keymap.c @@ -66,3 +66,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ) }; + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/jj40/keymaps/fun40/keymap.c b/keyboards/jj40/keymaps/fun40/keymap.c index f5641e297..d6fcfe7c2 100644 --- a/keyboards/jj40/keymaps/fun40/keymap.c +++ b/keyboards/jj40/keymaps/fun40/keymap.c @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | * |------+------+------+------+------+-------------+------+------+------+------+------| * | Shift|PrScr |ISO ~ |ISO | | | | | | |bl_on |bl_stp| Enter| * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -121,3 +121,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/jj40/keymaps/krusli/config.h b/keyboards/jj40/keymaps/krusli/config.h index 11cafbefc..52aaa8f24 100644 --- a/keyboards/jj40/keymaps/krusli/config.h +++ b/keyboards/jj40/keymaps/krusli/config.h @@ -4,5 +4,6 @@ #include "../../config.h" #define PREVENT_STUCK_MODIFIERS +#define TAPPING_TERM 300 #endif diff --git a/keyboards/jj40/keymaps/krusli/keymap.c b/keyboards/jj40/keymaps/krusli/keymap.c index 5a985199e..df692cc48 100644 --- a/keyboards/jj40/keymaps/krusli/keymap.c +++ b/keyboards/jj40/keymaps/krusli/keymap.c @@ -11,6 +11,18 @@ enum custom_keycodes { RAISE, }; +void matrix_scan_user(void) { + // runs at every matrix scan. +} + +enum { + TD_H_E = 0 +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_H_E] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END) +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. @@ -24,10 +36,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - _______, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + TD(TD_H_E), KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower diff --git a/keyboards/jj40/keymaps/krusli/rules.mk b/keyboards/jj40/keymaps/krusli/rules.mk new file mode 100644 index 000000000..e5ddcae8d --- /dev/null +++ b/keyboards/jj40/keymaps/krusli/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/jj40/keymaps/oscillope/keymap.c b/keyboards/jj40/keymaps/oscillope/keymap.c index 2eaecd7e4..5d2f400a1 100644 --- a/keyboards/jj40/keymaps/oscillope/keymap.c +++ b/keyboards/jj40/keymaps/oscillope/keymap.c @@ -107,3 +107,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } + + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/jj40/matrix.c b/keyboards/jj40/matrix.c index a9e9cb539..2932976dd 100644 --- a/keyboards/jj40/matrix.c +++ b/keyboards/jj40/matrix.c @@ -91,12 +91,6 @@ uint8_t matrix_scan(void) { return 1; } -void matrix_scan_kb(void) { - // Looping keyboard code goes here - // This runs every cycle (a lot) - matrix_scan_user(); -}; - // declarations void matrix_set_row_status(uint8_t row) { DDRB = (1 << row); diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk index 670967fbd..42b3d1155 100644 --- a/keyboards/jj40/rules.mk +++ b/keyboards/jj40/rules.mk @@ -42,7 +42,6 @@ BACKLIGHT_CUSTOM_DRIVER = yes RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes -# DISABLE_WS2812 = no KEY_LOCK_ENABLE = yes diff --git a/keyboards/niu_mini/keymaps/default/keymap.c b/keyboards/niu_mini/keymaps/default/keymap.c old mode 100755 new mode 100644 diff --git a/keyboards/niu_mini/keymaps/readme.md b/keyboards/niu_mini/keymaps/readme.md index 804a657e7..d4c2bbc80 100644 --- a/keyboards/niu_mini/keymaps/readme.md +++ b/keyboards/niu_mini/keymaps/readme.md @@ -18,6 +18,6 @@ When adding your keymap to this list, keep it organised alphabetically (select l * **folder_name** description # List of keymaps - - **default** default layout from KBDFans +- **mason** - **planck** Planck default layout diff --git a/keyboards/xd60/keymaps/krusli/readme.md b/keyboards/xd60/keymaps/krusli/readme.md index 7b6bce9c4..aefb23cca 100644 --- a/keyboards/xd60/keymaps/krusli/readme.md +++ b/keyboards/xd60/keymaps/krusli/readme.md @@ -1,2 +1,7 @@ -# krusli's HHKB-style keymap for the XD60 -HHKB-style keymap for the XD60. The board was not built with split backspace but still has Backspace and |\\ swapped. +# krusli's Keymap for XIUDI's 60% XD60 PCB + +## Additional Notes +Keymap for the XD60 with 2.25u left shift and split backspace. HHKB-like function layer. + +## Build +To build this keymap, simply run `make xd60:krusli` on the top-level directory for QMK. diff --git a/tmk_core/protocol/lufa/descriptor.c b/tmk_core/protocol/lufa/descriptor.c index e9f7f8730..bfa91f255 100644 --- a/tmk_core/protocol/lufa/descriptor.c +++ b/tmk_core/protocol/lufa/descriptor.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 2012 Jun Wako * This file is based on: * LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse From e9944bfc8e89dc772fa04be90638cab1e722ece1 Mon Sep 17 00:00:00 2001 From: HagVcom Date: Fri, 2 Feb 2018 07:50:22 +0100 Subject: [PATCH 110/556] Added "hag" keymap to Iris (#2313) * Create keymap.c Add Hag keymap, a heavily modified dvorak swedish keymap with multiple layouts and often used stuff under the alpha cluster. * Create config.h * Create rules.mk --- keyboards/iris/keymaps/hag/config.h | 41 ++++ keyboards/iris/keymaps/hag/keymap.c | 297 ++++++++++++++++++++++++++++ keyboards/iris/keymaps/hag/rules.mk | 6 + 3 files changed, 344 insertions(+) create mode 100644 keyboards/iris/keymaps/hag/config.h create mode 100644 keyboards/iris/keymaps/hag/keymap.c create mode 100644 keyboards/iris/keymaps/hag/rules.mk diff --git a/keyboards/iris/keymaps/hag/config.h b/keyboards/iris/keymaps/hag/config.h new file mode 100644 index 000000000..c4604af43 --- /dev/null +++ b/keyboards/iris/keymaps/hag/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/iris/keymaps/hag/keymap.c b/keyboards/iris/keymaps/hag/keymap.c new file mode 100644 index 000000000..3aac1394e --- /dev/null +++ b/keyboards/iris/keymaps/hag/keymap.c @@ -0,0 +1,297 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + + +//Heavily modified keymap. Some features: +//Multiple layouts, I use dvorak as main. +//Nordic(swedish) signs +//Symbols, numpad, arrows/navigation reachable under the alpas via the layers +//Mirrored ctl, alt and shift to be able to use both hands when doing commands +//Gaming layer, qwerty with space on left half. + +#define _QWERTY 2 +#define _DVORAK 0 +#define _COLEMAK 1 +#define _WORKMAN 3 +#define _GAMING 4 +#define _NUMPAD 5 +#define _LOWER 6 +#define _RAISE 7 + +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + COLEMAK, + WORKMAN, + GAMING, + NUMPAD, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS +#define KC_XXXX KC_NO + +#define KC_Sw2 RALT(KC_2) // Nordic @ +#define KC_Sw3 RALT(KC_3) // Nordic something +#define KC_Sw4 RALT(KC_4) // Nordic something +#define KC_Sw5 RALT(KC_5) // Nordic something +#define KC_Sw6 RALT(KC_6) // ... +#define KC_Sw7 RALT(KC_7) +#define KC_Sw8 RALT(KC_8) +#define KC_Sw9 RALT(KC_9) +#define KC_Sw0 RALT(KC_0) +#define KC_Tild RALT(KC_RBRC) +#define KC_Bsls RALT(KC_MINS) +#define KC_Bar RALT(KC_NUBS) +#define KC_Less S(KC_NUBS) +#define KC_CATDEL LCTL(LALT(KC_DEL)) // Ctrl alt del +#define KC_TSKMGR LCTL(S(KC_ESC)) // Ctrl shift esc +#define KC_NUMP TG(_NUMPAD) // Toggle layer NUMPAD for use in KC_keymaps +#define KC_Close RALT(KC_F4) // Alt F4 +#define KC_Great S(KC_NUBS) +#define KC_MEH1 MEH(KC_1) +#define KC_MEH2 MEH(KC_2) +#define KC_MEH3 MEH(KC_3) +#define KC_MEH4 MEH(KC_4) +#define KC_MEH5 MEH(KC_5) + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,NUMP, ENT , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_GAMING] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,RCTL, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B , Y , ENT , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,SPC, BSPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_DVORAK] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP ,VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB ,LBRC,QUOT,SCLN, P , Y , F , G , C , R , L ,DEL, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LCTL, A , O , E , U , I , D , H , T , N , S ,RCTL, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LSFT,DOT , Q , J , K , X ,NUMP, ENT , B , M , W , V , Z ,RSFT, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_COLEMAK] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , F , P , G , J , L , U , Y ,LBRC,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , R , S , T , D , H , N , E , I , O ,SCLN, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,NUMP, ENT , K , M ,COMM, DOT,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + +[_WORKMAN] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , R , W , B , J , F , U , P ,LBRC,SCLN, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , H , T , G , Y , N , E , O , I ,RCTL, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , M , C , V ,NUMP, ENT , K , L ,QUOT, DOT,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_NUMPAD] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MEH1,BTN2,MS_U,BTN1,CATDEL, PIPE, P7 , P8 , P9 ,SLSH, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MEH4,MS_L,MS_D,MS_R,TSKMGR, COMM, P4 , P5 , P6 ,MINS, , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MEH5,ACL0,ACL1,ACL2,MEH3, , PENT,DOT , P1 , P2 , P3 , P0 , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, , P0 ,NLCK + // `----+----+----' `----+----+----' + ), + + + [_LOWER] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,CAPS,PGUP, UP ,PGDN, ESC, RCBR,EXLM,ASTR,LPRN,UNDS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,HOME,LEFT,DOWN,RGHT, END, RPRN,QUES,Sw8 ,Sw9 ,LABK, , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , ENT, , , , DEL, , ,RABK,NUBS,Sw7 ,Sw0 ,Great, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM,GRV ,EQL, DLR ,PERC, Sw3 ,Sw5 ,Sw6 ,Sw0 ,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,Bar ,Sw2 ,HASH, AT ,PERC, PIPE, 7 , 8 , 9 ,PMNS,PSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,Bsls,Tild,SLSH,AMPR,BSLS, COMM, 4 , 5 , 6 ,PPLS,PAST, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,PIPE,Sw4 ,PLUS,CIRC,TILD, , PENT,DOT , 1 , 2 , 3 , 0 ,PEQL, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = KEYMAP( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + GAMING , DVORAK, WORKMAN, COLEMAK, QWERTY , KC_RST, _______, _______, _______, _______, KC_PWR, RESET, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______,LGUI(KC_UP),_______,LALT(KC_F4), _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______,LGUI(KC_LEFT),LGUI(KC_DOWN),LGUI(KC_RGHT),_______, _______, DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, BL_STEP, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case NUMPAD: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_NUMPAD); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case WORKMAN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case GAMING: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_GAMING); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/hag/rules.mk b/keyboards/iris/keymaps/hag/rules.mk new file mode 100644 index 000000000..22b6ec476 --- /dev/null +++ b/keyboards/iris/keymaps/hag/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From a6be48681a92cd47c63cbe763b723c13cc443399 Mon Sep 17 00:00:00 2001 From: Emily Soldal Date: Thu, 4 Jan 2018 19:20:40 +0100 Subject: [PATCH 111/556] Map num lock and caps lock LED events to the RXLED and TXLED --- keyboards/sweet16/keymaps/default/keymap.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/keyboards/sweet16/keymaps/default/keymap.c b/keyboards/sweet16/keymaps/default/keymap.c index c429d2456..7fa861543 100644 --- a/keyboards/sweet16/keymaps/default/keymap.c +++ b/keyboards/sweet16/keymaps/default/keymap.c @@ -23,4 +23,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} + +void led_set_user(uint8_t usb_led) { + + /* Map RXLED to USB_LED_NUM_LOCK */ + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + /* Map TXLED to USB_LED_CAPS_LOCK */ + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } +} From e7bb9754823ae7a09f7ba3bf4ecd7b45663ae382 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Feb 2018 17:47:28 +0200 Subject: [PATCH 112/556] Fix .editorconfig to not mess with line endings --- .editorconfig | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 82837f7f1..4cd051ce9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,6 @@ indent_style = space indent_size = 2 # We recommend you to keep these unchanged -end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true @@ -16,3 +15,22 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false indent_size = 4 + +# Make these match what we have in .gitattributes +[*.mk] +end_of_line = lf + +[Makefile] +end_of_line = lf + +[*.sh] +end_of_line = lf + +# The gitattributes file will handle the line endings conversion properly according to the operating system settings for other files + + +# We don't have gitattributes properly for these +# So if the user have for example core.autocrlf set to true +# the line endings would be wrong. +[lib/**] +end_of_line = unset From 8350d7e607704d6736271256f20640e8f3deae75 Mon Sep 17 00:00:00 2001 From: yiancar Date: Sat, 3 Feb 2018 20:21:24 +0000 Subject: [PATCH 113/556] Cu24 keyboard addition (#2330) * Added Modular keyboards L,R and NUM Created code modules for the 3 modules of the modular keyboard. Original idea by MechboardsUK. Uses i2c implementation similar to lets split * CU24 Support Addes Support for the upcoming CU24 keyboard sold by CapsUnlocked * Removed modular keyboards to make stuff clear * Lower Case folders * Remove CU24 - Rename Folder * Add CU24 - Renamed * Fixed ignore list I am stupid --- .gitignore | 2 +- keyboards/cu24/config.h | 192 +++++++++++++++++++++++ keyboards/cu24/cu24.c | 16 ++ keyboards/cu24/cu24.h | 42 +++++ keyboards/cu24/keymaps/default/keymap.c | 56 +++++++ keyboards/cu24/keymaps/default/readme.md | 10 ++ keyboards/cu24/readme.md | 15 ++ keyboards/cu24/rules.mk | 69 ++++++++ 8 files changed, 401 insertions(+), 1 deletion(-) create mode 100644 keyboards/cu24/config.h create mode 100644 keyboards/cu24/cu24.c create mode 100644 keyboards/cu24/cu24.h create mode 100644 keyboards/cu24/keymaps/default/keymap.c create mode 100644 keyboards/cu24/keymaps/default/readme.md create mode 100644 keyboards/cu24/readme.md create mode 100644 keyboards/cu24/rules.mk diff --git a/.gitignore b/.gitignore index 90f29a297..226f11868 100644 --- a/.gitignore +++ b/.gitignore @@ -64,4 +64,4 @@ util/Win_Check_Output.txt # things travis sees secrets.tar id_rsa_* -/.vs +/.vs \ No newline at end of file diff --git a/keyboards/cu24/config.h b/keyboards/cu24/config.h new file mode 100644 index 000000000..df009c953 --- /dev/null +++ b/keyboards/cu24/config.h @@ -0,0 +1,192 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar/CapsUnlocked +#define PRODUCT CU24 +#define DESCRIPTION A luxurious fully customisable numpad + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6, F5, B4, B6, C6, C7 } +#define MATRIX_COL_PINS { F0, F1, D0, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +/* Backlight */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +/* RGB Glow */ +#define RGB_DI_PIN F4 // The pin the LED strip is connected to +#define RGBLED_NUM 5 // Number of LEDs in your strip +#define RGBLIGHT_ANIMATIONS + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/cu24/cu24.c b/keyboards/cu24/cu24.c new file mode 100644 index 000000000..0c976f076 --- /dev/null +++ b/keyboards/cu24/cu24.c @@ -0,0 +1,16 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "cu24.h" diff --git a/keyboards/cu24/cu24.h b/keyboards/cu24/cu24.h new file mode 100644 index 000000000..e8e6b46ec --- /dev/null +++ b/keyboards/cu24/cu24.h @@ -0,0 +1,42 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef CU24_H +#define CU24_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, k33, \ + k40, k41, k42, k43, \ + k50, k51, k52, k53 \ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, k33 }, \ + { k40, k41, k42, k43 }, \ + { k50, k51, k52, k53 } \ +} + +#endif diff --git a/keyboards/cu24/keymaps/default/keymap.c b/keyboards/cu24/keymaps/default/keymap.c new file mode 100644 index 000000000..8e2f65632 --- /dev/null +++ b/keyboards/cu24/keymaps/default/keymap.c @@ -0,0 +1,56 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "cu24.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Base */ + KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, \ + MO(1) , KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7 , KC_P8 , KC_P9 , KC_PPLS, \ + KC_P4 , KC_P5 , KC_P6 , KC_PPLS, \ + KC_P1 , KC_P2 , KC_P3 , KC_PENT, \ + KC_P0 , KC_P0 , KC_PDOT, KC_PENT +), + +[1] = KEYMAP( /* FN */ + RGB_TOG, RGB_MOD, BL_STEP, BL_BRTG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, \ + RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, RESET , KC_TRNS +), +}; + +/* Use this function to add macros */ +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; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/cu24/keymaps/default/readme.md b/keyboards/cu24/keymaps/default/readme.md new file mode 100644 index 000000000..5528d6c0d --- /dev/null +++ b/keyboards/cu24/keymaps/default/readme.md @@ -0,0 +1,10 @@ +https://imgur.com/a/vpHFj + +![CU24 Layout Image](https://imgur.com/X1c1qeY) + +# Default CU24 Layout + +This is the default layout that comes flashed on every CU24. It is like a normal numpad, +with all the led customization on the Fn layer. + +See [All Layouts](https://imgur.com/trwO7dN) for all supported configurations! \ No newline at end of file diff --git a/keyboards/cu24/readme.md b/keyboards/cu24/readme.md new file mode 100644 index 000000000..a017cd665 --- /dev/null +++ b/keyboards/cu24/readme.md @@ -0,0 +1,15 @@ +# CU24 + +![CU24](https://geekhack.org/index.php?action=dlattach;topic=93289.0;attach=185492;image) + +A luxurious 24 key keypad with various layouts. Includes RGB underglow, backlight and an aluminium, brass and nylon case. + +Keyboard Maintainer: [Yiancar](https://github.com/yiancar) +Hardware Supported: PCB v1.0 (uses a 32u4) +Hardware Availability: http://caps-unlocked.com/ + +Make example for this keyboard (after setting up your build environment): + + make CU24:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/cu24/rules.mk b/keyboards/cu24/rules.mk new file mode 100644 index 000000000..86f1a8479 --- /dev/null +++ b/keyboards/cu24/rules.mk @@ -0,0 +1,69 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +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 +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGBLIGHT_ENABLE = yes # RGB drivers From 2f65ab183d8f820d5814482fcc9f58fa304b5d47 Mon Sep 17 00:00:00 2001 From: jirgn Date: Sat, 3 Feb 2018 21:22:00 +0100 Subject: [PATCH 114/556] just a planck layout (#2320) * added jirgn keymap from dotfiles * added jirgn s keymap as copy from default * [TASK] removed unnecessary colemak and dvorak layouts * [TASK] added right shift with tab to enter * [TASK] added ctrl keys beside homerow * [TASK] added Navigation Layer removed unnecessary BACKLIT removed Media Controls in Base Layers * [TASK] added left Navigation mode fixed some doc * [Fix] locked navigation layer by adding a transparent key for nav_mod keys * [TASK] added some more symbols and removed lower F1-F12 keys * [TASK] added some README and a layout design * [FIX] forced for adding to repo * [FIX] forced for adding to repo * [FIX] problem with layerswitching and hanging ctrl * removed image from repo * removed github image link with permalink from layout designer * removed github image link with permalink from layout designer * replaced image with permalink to layout editor --- .gitignore | 1 + .../planck/keymaps/jirgn/assets/layout.json | 168 +++++++++++++ keyboards/planck/keymaps/jirgn/config.h | 42 ++++ keyboards/planck/keymaps/jirgn/keymap.c | 221 ++++++++++++++++++ keyboards/planck/keymaps/jirgn/readme.md | 5 + keyboards/planck/keymaps/jirgn/rules.mk | 3 + 6 files changed, 440 insertions(+) create mode 100644 keyboards/planck/keymaps/jirgn/assets/layout.json create mode 100644 keyboards/planck/keymaps/jirgn/config.h create mode 100644 keyboards/planck/keymaps/jirgn/keymap.c create mode 100644 keyboards/planck/keymaps/jirgn/readme.md create mode 100644 keyboards/planck/keymaps/jirgn/rules.mk diff --git a/.gitignore b/.gitignore index 226f11868..a8dd97eff 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ util/Win_Check_Output.txt .vscode/last.sql .vscode/temp.sql .stfolder +.tags # ignore image files *.png diff --git a/keyboards/planck/keymaps/jirgn/assets/layout.json b/keyboards/planck/keymaps/jirgn/assets/layout.json new file mode 100644 index 000000000..d5fc6f26a --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/assets/layout.json @@ -0,0 +1,168 @@ +[ + { + "switchMount": "cherry", + "switchBrand": "cherry", + "switchType": "MX1A-C1xx", + "pcb": true, + "css": ".keylabel2 {\n color: #61ba5d !important;\n}\n.keylabel6 {\n color: #fa7a5f !important;\n}\n.keylabel8 {\n color: #7ab7f7 !important;\n}\n.keylabel7 {\n color: #999 !important;\n}" + }, + [ + { + "fa": [ + 0, + 2, + 0, + 2 + ] + }, + "\n~\n\n`\n\n\n\n\n\nTab", + { + "sm": "cherry", + "sb": "cherry", + "st": "MX1A-C1xx" + }, + "\n!\n\n1\n\n\n\n\n\nQ", + { + "sm": "", + "sb": "", + "st": "" + }, + "\n@\n\n2\n\n\n\n\n\nW", + "\n#\n\n3\n\n\n\n\n\nE", + "\n$\n\n4\n\n\n\n\n\nR", + "\n%\n\n5\n\n\n\n\n\nT", + "\n^\n\n6\n\n\n\n\n\nY", + "\n&\n\n7\n\n\n\n\n\nU", + "\n*\n\n8\n\n\n\n\n\nI", + "\n(\n\n9\n\n\n\n\n\nO", + "\n)\n\n0\n\n\n\n\n\nP", + { + "a": 7 + }, + "" + ], + [ + { + "c": "#b8b8b8", + "a": 5 + }, + "\n\n\n\nCtrl\n\n", + { + "c": "#61ba5d", + "a": 4 + }, + "\n¡\n\nF1\nNav\n\n\n\n\nA", + { + "c": "#cccccc", + "fa": [ + 0, + 2, + 1, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "\n™\nHome\nF2\n\n\n\n\n\nS", + "\n€\nPg Up\nF3\n\n\n\n\n\nD", + "\n¢\nPg Dn\nF4\n\n\n\n\n\nF", + "\n∞\nEnd\nF5\n\n\n\n\n\nG", + { + "fa": [ + 0, + 2, + 2, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "\n§\n←\nF6\n\n\n\n\n\nH", + "\n_\n↓\n-\n\n\n\n\n\nJ", + "\n+\n↑\n=\n\n\n\n\n\nK", + "\n{\n→\n[\n\n\n\n\n\nL", + { + "c": "#61ba5d", + "fa": [ + 0, + 2, + 2, + 2, + 0, + 0, + 0, + 2 + ] + }, + "\n}\n\n]\nNav\n\n\n:\n\n;", + { + "c": "#cccccc" + }, + "\n|\n\n\\\n\n\n\n\"\n\n'" + ], + [ + { + "c": "#b8b8b8", + "a": 7 + }, + "Shift", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n\nF7\n\n\n\n\n\nZ", + "\n\n\nF8\n\n\n\n\n\nX", + "\n\n\nF9\n\n\n\n\n\nC", + "\n\n\nF10\n\n\n\n\n\nV", + "\n\n\nF11\n\n\n\n\n\nB", + "\n\n\nF12\n\n\n\n\n\nN", + "\n~\n\n#\n\n\n\n\n\nM", + "\n|\n\n/\n\n\n\n<\n\n,", + { + "a": 6 + }, + "\n\n>\n\n\n\n\n\n.", + "\n\n?\n\n\n\n\n\n/", + { + "c": "#b8b8b8", + "a": 7 + }, + "\n\n\n\nShift" + ], + [ + "", + "Hyper", + "", + "", + { + "c": "#fa7a5f" + }, + "⇓", + { + "c": "#cccccc", + "w": 2 + }, + "", + { + "c": "#7ab7f7" + }, + "⇑", + { + "c": "#b8b8b8" + }, + "", + "", + "Hyper", + "" + ] +] \ No newline at end of file diff --git a/keyboards/planck/keymaps/jirgn/config.h b/keyboards/planck/keymaps/jirgn/config.h new file mode 100644 index 000000000..b406e2fed --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/config.h @@ -0,0 +1,42 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jirgn/keymap.c b/keyboards/planck/keymaps/jirgn/keymap.c new file mode 100644 index 000000000..87a78d90b --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/keymap.c @@ -0,0 +1,221 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "planck.h" +#include "action_layer.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _NAVIGATION +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + LOWER, + RAISE, + EXT_PLV +}; + +// keycode aliases +#define _______ KC_TRNS +#define ___x___ KC_NO +#define KC_EUR LALT(S(KC_2)) +#define KC_SEC LALT(KC_6) +#define CTL_DEL CTL_T(KC_DEL) +#define NAV_SCLN LT(_NAVIGATION, KC_SCLN) +#define NAV_A LT(_NAVIGATION, KC_A) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab for Esc--| Ctrl | A Nav| S | D | F | G | H | J | K | L | ; Nav| Ctrl |--Tab for " + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift|--Tab for Enter + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Hyper| Alt | Super| Lower| Space | Raise| Super| ALt | Hyper| | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {CTL_T(KC_ESC), NAV_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NAV_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {___x___, KC_HYPR, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LGUI, KC_LALT, KC_HYPR, ___x___} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab to Del---| Ctrl | ¡ | ™ | € | ¢ | ∞ | § | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {CTL_DEL, LALT(KC_1), LALT(KC_2), KC_EUR, LALT(KC_4), LALT(KC_5), LALT(KC_6), KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, S(KC_NUHS), S(KC_NUBS), _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab to Del---| Ctrl | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {CTL_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Navigation + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | HOME | PGUP | PGDN | END | LEFT | DOWN | UP | RIGHT| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAVIGATION] = { + {___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___}, + {_______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END , KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT, _______, ___x___}, + {_______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, _______}, + {___x___, _______, _______, _______, ___x___, ___x___, ___x___, ___x___, _______, _______, _______, ___x___} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {___x___, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {___x___, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, ___x___, ___x___, KC_C, KC_V, ___x___, ___x___, KC_N, KC_M, ___x___, ___x___, ___x___} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Plover| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL }, + {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, PLOVER, _______, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; break; + } + return true; +} diff --git a/keyboards/planck/keymaps/jirgn/readme.md b/keyboards/planck/keymaps/jirgn/readme.md new file mode 100644 index 000000000..afc93d457 --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/readme.md @@ -0,0 +1,5 @@ +# Jirgns Planck Layout + +This layout was designed with [Layout Designer](http://www.keyboard-layout-editor.com/#/) + +[Permalink to Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=cherry&switchType=MX1A-C1xx&pcb:true&css=.keylabel2%20%7B%0A%20%20%20%20color%2F:%20%2361ba5d%20!important%2F%3B%0A%7D%0A.keylabel6%20%7B%0A%20%20%20%20color%2F:%20%23fa7a5f%20!important%2F%3B%0A%7D%0A.keylabel8%20%7B%0A%20%20%20%20color%2F:%20%237ab7f7%20!important%2F%3B%0A%7D%0A.keylabel7%20%7B%0A%20%20%20%20color%2F:%20%23999%20!important%2F%3B%0A%7D%3B&@_fa@:0&:2&:0&:2%3B%3B&=%0A~%0A%0A%60%0A%0A%0A%0A%0A%0ATab&_sm=cherry&sb=cherry&st=MX1A-C1xx%3B&=%0A!%0A%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%2F@%0A%0A2%0A%0A%0A%0A%0A%0AW&=%0A%23%0A%0A3%0A%0A%0A%0A%0A%0AE&=%0A$%0A%0A4%0A%0A%0A%0A%0A%0AR&=%0A%25%0A%0A5%0A%0A%0A%0A%0A%0AT&=%0A%5E%0A%0A6%0A%0A%0A%0A%0A%0AY&=%0A%2F&%0A%0A7%0A%0A%0A%0A%0A%0AU&=%0A*%0A%0A8%0A%0A%0A%0A%0A%0AI&=%0A(%0A%0A9%0A%0A%0A%0A%0A%0AO&=%0A)%0A%0A0%0A%0A%0A%0A%0A%0AP&_a:7%3B&=%3Ci%20class%2F='mss%20mss-Unicode-BackSpace-DeleteLeft-Big-2'%3E%3C%2F%2Fi%3E%3B&@_c=%23b8b8b8&a:5%3B&=%0A%3Ci%20class%2F='mss%20mss-Unicode-DeleteRight-Big-2'%3E%3C%2F%2Fi%3E%0A%0A%0ACtrl%0A%0A%3Ci%20class%2F='mss%20mss-Unicode-Escape-3'%3E%3C%2F%2Fi%3E&_c=%2361ba5d&a:4%3B&=%0A¡%0A%0AF1%0ANav%0A%0A%0A%0A%0AA&_c=%23cccccc&fa@:0&:2&:1&:2%3B%3B&=%0A™%0AHome%0AF2%0A%0A%0A%0A%0A%0AS&=%0A€%0APg%20Up%0AF3%0A%0A%0A%0A%0A%0AD&=%0A¢%0APg%20Dn%0AF4%0A%0A%0A%0A%0A%0AF&=%0A∞%0AEnd%0AF5%0A%0A%0A%0A%0A%0AG&_f2:2%3B&=%0A§%0A←%0AF6%0A%0A%0A%0A%0A%0AH&_f2:2%3B&=%0A%2F_%0A↓%0A-%0A%0A%0A%0A%0A%0AJ&_f2:2%3B&=%0A+%0A↑%0A%2F=%0A%0A%0A%0A%0A%0AK&_f2:2%3B&=%0A%7B%0A→%0A%5B%0A%0A%0A%0A%0A%0AL&_c=%2361ba5d&fa@:0&:2&:2&:2&:0&:2&:2&:2%3B%3B&=%0A%7D%0A%0A%5D%0ANav%0A%0A%0A%2F:%0A%0A%2F%3B&_c=%23cccccc%3B&=%0A%7C%0A%0A%5C%0A%0A%0A%0A%22%0A%0A'%3B&@_c=%23b8b8b8&a:7%3B&=Shift&_c=%23cccccc&a:4%3B&=%0A%0A%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%0AF11%0A%0A%0A%0A%0A%0AB&=%0A%0A%0AF12%0A%0A%0A%0A%0A%0AN&=%0A~%0A%0A%23%0A%0A%0A%0A%0A%0AM&=%0A%7C%0A%0A%2F%2F%0A%0A%0A%0A%3C%0A%0A,&_a:6%3B&=%0A%0A%3E%0A%0A%0A%0A%0A%0A.&=%0A%0A%3F%0A%0A%0A%0A%0A%0A%2F%2F&_c=%23b8b8b8&a:7%3B&=%3Ci%20class%2F='kb%20kb-Return-2'%3E%3C%2F%2Fi%3E%0A%0A%0A%0AShift%3B&@=&=Hyper&=%3Ci%20class%2F='mss%20mss-Unicode-Option-3'%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F='mss%20mss-Unicode-Command-3'%3E%3C%2F%2Fi%3E&_c=%23fa7a5f%3B&=%2F&dArr%2F%3B&_c=%23cccccc&w:2%3B&=&_c=%237ab7f7%3B&=%2F&uArr%2F%3B&_c=%23b8b8b8%3B&=%3Ci%20class%2F='mss%20mss-Unicode-Command-3'%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F='mss%20mss-Unicode-Option-3'%3E%3C%2F%2Fi%3E&=Hyper&=) diff --git a/keyboards/planck/keymaps/jirgn/rules.mk b/keyboards/planck/keymaps/jirgn/rules.mk new file mode 100644 index 000000000..457a3d01d --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 31f52291911e0e2d4a3626ceb5fad52657bb495f Mon Sep 17 00:00:00 2001 From: f3d3 Date: Sat, 3 Feb 2018 21:22:30 +0100 Subject: [PATCH 115/556] Added dz60 custom layout (#2302) * Add files via upload * Update keymap.c * Delete keymap.c * Added dz60 banana-split layout * Added dz60 custom layout Added layout for dz60 with split spacebar, arrows and other customizations. --- keyboards/dz60/keymaps/f3d3/keymap.c | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 keyboards/dz60/keymaps/f3d3/keymap.c diff --git a/keyboards/dz60/keymaps/f3d3/keymap.c b/keyboards/dz60/keymaps/f3d3/keymap.c new file mode 100644 index 000000000..aefa2703c --- /dev/null +++ b/keyboards/dz60/keymaps/f3d3/keymap.c @@ -0,0 +1,85 @@ +#include "dz60.h" + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Layer 0 +* ,-----------------------------------------------------------------------------------------. +* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | Bck | +* |-----------------------------------------------------------------------------------------+ +* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +* |-----------------------------------------------------------------------------------------+ +* | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +* |-----------------------------------------------------------------------------------------+ +* | Shift | Z | X | C | V | B | N | M | , | . | RSh | U | / | +* |-----------------------------------------------------------------------------------------+ +* | Ctrl | GUI | Alt | Space | Fn1 | Play | Pscr | Fn1 | Left |Rght |Down | +* `-----------------------------------------------------------------------------------------' +*/ + + KEYMAP_2_SHIFTS( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_TRNS, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_MPLY, KC_PSCR, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + + + /* Layer 1 +* ,-----------------------------------------------------------------------------------------. +* | PWR | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | Del | +* |-----------------------------------------------------------------------------------------+ +* | |RGBT |RGBM |Hue+ |Hue- |Sat+ |Sat- |Val+ |Val- | | | | | RESET | +* |-----------------------------------------------------------------------------------------+ +* | | | | | | | | | | | | | | +* |-----------------------------------------------------------------------------------------+ +* | | | | | BLT | BL- | BL+ | BLS | | | |Vol+ | | +* |-----------------------------------------------------------------------------------------+ +* | | | | | | Stop | | |Prev |Vol- |Next | +* `-----------------------------------------------------------------------------------------' +*/ + + + KEYMAP_2_SHIFTS( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + 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, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} \ No newline at end of file From ac82cd1ba77f4ed8d38f17662864c6a56a8da293 Mon Sep 17 00:00:00 2001 From: Harley Laue Date: Fri, 6 Oct 2017 16:32:02 -0700 Subject: [PATCH 116/556] Added personal nyquist & levinson layouts --- .../keymaps/losinggeneration/README.md | 28 ++ .../keymaps/losinggeneration/config.h | 42 +++ .../keymaps/losinggeneration/keymap.c | 38 ++ .../keymaps/losinggeneration/rules.mk | 17 + .../keymaps/losinggeneration/README.md | 29 ++ .../nyquist/keymaps/losinggeneration/config.h | 35 ++ .../nyquist/keymaps/losinggeneration/keymap.c | 55 +++ .../nyquist/keymaps/losinggeneration/rules.mk | 17 + users/losinggeneration/README.md | 185 +++++++++ .../losinggeneration-common.h | 74 ++++ .../losinggeneration-config.h | 29 ++ .../losinggeneration-keymap.h | 352 ++++++++++++++++++ users/losinggeneration/rules.mk | 16 + 13 files changed, 917 insertions(+) create mode 100644 keyboards/levinson/keymaps/losinggeneration/README.md create mode 100644 keyboards/levinson/keymaps/losinggeneration/config.h create mode 100644 keyboards/levinson/keymaps/losinggeneration/keymap.c create mode 100644 keyboards/levinson/keymaps/losinggeneration/rules.mk create mode 100644 keyboards/nyquist/keymaps/losinggeneration/README.md create mode 100644 keyboards/nyquist/keymaps/losinggeneration/config.h create mode 100644 keyboards/nyquist/keymaps/losinggeneration/keymap.c create mode 100644 keyboards/nyquist/keymaps/losinggeneration/rules.mk create mode 100644 users/losinggeneration/README.md create mode 100644 users/losinggeneration/losinggeneration-common.h create mode 100644 users/losinggeneration/losinggeneration-config.h create mode 100644 users/losinggeneration/losinggeneration-keymap.h create mode 100644 users/losinggeneration/rules.mk diff --git a/keyboards/levinson/keymaps/losinggeneration/README.md b/keyboards/levinson/keymaps/losinggeneration/README.md new file mode 100644 index 000000000..b406d5000 --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/README.md @@ -0,0 +1,28 @@ +losinggeneration's Levinson Layout +============================ + +See description of the layout in the common folder +[here](../../../../users/losinggeneration/README.md) + +## Features +- Adjust + - Removed AGSwap, AGNorm, & Del + - Added Caps Lock, F1-F12 in a 4x3 grid, backlight control, arrow cluster, + and layer transitions to the new layers. + - Moved Reset & Audio control to the right side + +## Layouts + +### Adjust (Lower + Raise) + +``` + ,-----------------------------------------..-----------------------------------------. + | | F1 | F2 | F3 | F4 |BL Off|| RESET| Game |Numpad|Mouse | | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F5 | F6 | F7 | F8 |BL Tg ||Aud on|Qwerty|Colmak|Workmn|Dvorak| | + |------+------+------+------+------+------||------+------+------+------+------+------| + | CAPS | F9 | F10 | F11 | F12 |BL On ||Audoff| | | | Up | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | XXX | Left | Down |Right | + `-----------------------------------------''-----------------------------------------' +``` diff --git a/keyboards/levinson/keymaps/losinggeneration/config.h b/keyboards/levinson/keymaps/losinggeneration/config.h new file mode 100644 index 000000000..917c6a98b --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2017 Danny Nguyen +Copyright 2018 Harley Laue + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +long with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +/* #define USE_I2C */ + +/* Select hand configuration */ + +#define MASTER_LEFT +/* #define _MASTER_RIGHT */ +/* #define EE_HANDS */ + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/levinson/keymaps/losinggeneration/keymap.c b/keyboards/levinson/keymaps/losinggeneration/keymap.c new file mode 100644 index 000000000..3512f59f1 --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H +#include "losinggeneration-config.h" +#include "losinggeneration-keymap.h" + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = CATMAP( QWERTY_LAYER ), +[_COLEMAK] = CATMAP( COLEMAK_LAYER ), +[_WORKMAN] = CATMAP( WORKMAN_LAYER ), +[_DVORAK] = CATMAP( DVORAK_LAYER ), +[_GAME] = CATMAP( GAME_LAYER ), +[_NUMPAD] = CATMAP( NUMPAD_LAYER ), +[_MOUSE] = CATMAP( MOUSE_LAYER ), +[_LOWER] = CATMAP( LOWER_LAYER ), +[_RAISE] = CATMAP( RAISE_LAYER ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------..-----------------------------------------. + * | | F1 | F2 | F3 | F4 |BL Off|| RESET| Game |Numpad|Mouse | | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 |BL Tg ||Aud on|Qwerty|Colmak|Workmn|Dvorak| | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | CAPS | F9 | F10 | F11 | F12 |BL On ||Audoff| | | | Up | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | XXX | Left | Down |Right | + * `-----------------------------------------''-----------------------------------------' + */ +[_ADJUST] = CATMAP( \ + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , BL_OFF , RESET , TO_GAME, TO_NUM , TO_MS , _______, _______, \ + _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , BL_TOGG, AU_ON , QWERTY , COLEMAK, WORKMAN, DVORAK , _______, \ + KC_CAPS, KC_F9 , KC_F10, KC_F11 , KC_F12 , BL_ON , AU_OFF , _______, _______, _______, KC_UP , _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT \ +) + +}; + diff --git a/keyboards/levinson/keymaps/losinggeneration/rules.mk b/keyboards/levinson/keymaps/losinggeneration/rules.mk new file mode 100644 index 000000000..f3e47b4c2 --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/rules.mk @@ -0,0 +1,17 @@ +# 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 +# +AUDIO_ENABLE = no # Audio output on port C6 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +COMMAND_ENABLE = no # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/nyquist/keymaps/losinggeneration/README.md b/keyboards/nyquist/keymaps/losinggeneration/README.md new file mode 100644 index 000000000..be55af2e0 --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/README.md @@ -0,0 +1,29 @@ +losinggeneration's Nyquist Layout +============================ + +See description of the layout in the common folder +[here](../../../../users/losinggeneration/README.md) + +## Features +- Adjust + - Removed AGSwap, AGNorm, & Del + - Added Caps Lock, F1-F12 in a 4x3 grid, arrow cluster, and layer transitions + to the new layers. + +## Layouts + +### Adjust (Lower + Raise) + +``` + ,-----------------------------------------..-----------------------------------------. + | RESET|DEBUG | | | | || | | | | | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F1 | F2 | F3 | F4 | || | Game |Numpad| Mouse| | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F5 | F6 | F7 | F8 | || |Qwerty|Colmak|Workmn|Dvorak| | + |------+------+------+------+------+------||------+------+------+------+------+------| + | CAPS | F9 | F10 | F11 | F12 | || | | | | Up | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | XXX | Left | Down |Right | + `-----------------------------------------''-----------------------------------------' +``` diff --git a/keyboards/nyquist/keymaps/losinggeneration/config.h b/keyboards/nyquist/keymaps/losinggeneration/config.h new file mode 100644 index 000000000..330379447 --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/config.h @@ -0,0 +1,35 @@ +/* +Copyright 2017 Danny Nguyen +Copyright 2018 Harley Laue + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +long with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +/* #define USE_I2C */ + +/* Select hand configuration */ + +#define MASTER_LEFT +/* #define _MASTER_RIGHT */ +/* #define EE_HANDS */ + +#endif diff --git a/keyboards/nyquist/keymaps/losinggeneration/keymap.c b/keyboards/nyquist/keymaps/losinggeneration/keymap.c new file mode 100644 index 000000000..65fbb9cdd --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/keymap.c @@ -0,0 +1,55 @@ +#include QMK_KEYBOARD_H +#include "losinggeneration-config.h" +#include "losinggeneration-keymap.h" + +extern keymap_config_t keymap_config; + +#define NUMBER_ROW \ + KC_GRV ,KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = CATMAP( NUMBER_ROW, QWERTY_LAYER ), +[_COLEMAK] = CATMAP( NUMBER_ROW, COLEMAK_LAYER ), +[_WORKMAN] = CATMAP( NUMBER_ROW, WORKMAN_LAYER ), +[_DVORAK] = CATMAP( NUMBER_ROW, DVORAK_LAYER ), +[_GAME] = CATMAP( NUMBER_ROW, GAME_LAYER ), +[_NUMPAD] = CATMAP( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_PAST, KC_PSLS, KC_BSPC, KC_BSPC, \ + NUMPAD_LAYER \ +), + +[_MOUSE] = CATMAP( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MOUSE_LAYER \ +), + +[_LOWER] = CATMAP( \ + KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , \ + LOWER_LAYER \ +), + +[_RAISE] = CATMAP(NUMBER_ROW, RAISE_LAYER ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------..-----------------------------------------. + * | RESET|DEBUG | | | | || | | | | | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | || | Game |Numpad| Mouse| | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | || |Qwerty|Colmak|Workmn|Dvorak| | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | CAPS | F9 | F10 | F11 | F12 | || | | | | Up | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | XXX | Left | Down |Right | + * `-----------------------------------------''-----------------------------------------' + */ +[_ADJUST] = CATMAP( \ + RESET , DEBUG , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , _______, _______, TO_GAME, TO_NUM , TO_MS , _______, _______, \ + _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , _______, _______, QWERTY , COLEMAK, WORKMAN, DVORAK , _______, \ + KC_CAPS, KC_F9 , KC_F10, KC_F11 , KC_F12 , _______, _______, _______, _______, _______, KC_UP , _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT \ +) +}; + diff --git a/keyboards/nyquist/keymaps/losinggeneration/rules.mk b/keyboards/nyquist/keymaps/losinggeneration/rules.mk new file mode 100644 index 000000000..1728afd85 --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/rules.mk @@ -0,0 +1,17 @@ +# 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 +# +AUDIO_ENABLE = no # Audio output on port C6 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +COMMAND_ENABLE = no # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/users/losinggeneration/README.md b/users/losinggeneration/README.md new file mode 100644 index 000000000..852103fc6 --- /dev/null +++ b/users/losinggeneration/README.md @@ -0,0 +1,185 @@ +losinggeneration's ortholinear layout +============================ + +### Features + +- Main layer(s) + - The left space bar key has been changed to delete to have backspace + & delete on the same main layer. + - Adujst is a tap dance with one tap goes to the Adjust layer, second tap + goes to the Numpad layer, a third tap goes to the Mouse layer. More taps + are an error and disables tapping until you stop and try again. + - Ctrl when tapped once & Ctrl+Alt when tapped twice + - Left Alt when tapped once & Right Alt when tapped twice. + - Left GUI when tapped once & right GUI when tapped twice. This is + because I have a compose key on the right GUI key. + - Left shift is a one shot modifier. + - Enter when tapped Shift when held. + - Esc when tapped Ctrl when held. +- Lower & Raise + - Removed ISO ~, ISO |, ISO #, ISO /, Media Next, & Media Play + - Added PgUp, PgDn, Home, & End under the home row + - Added Mute next to Vol- +- New layers: Workman, Game, Numpad, & Mouse + +## Layouts +These include the 5x12 layout since it's nearly identical to the 4x12 layout. +The only difference is the top row is removed for the 4x12 layout. + +The Adjust layer keyboard specific, so it's described with the specific +keyboard. + +### Qwerty + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | S | D | F | G || H | J | K | L | ; | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Colemak + +``` + ,-----------------------------------------.,-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | W | F | P | G || J | L | U | Y | ; | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | R | S | T | D || H | N | E | I | O | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | C | V | B || K | M | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Workman + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | D | R | W | B || J | F | U | P | ; | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | S | H | T | G || Y | N | E | O | I | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | M | C | V || K | L | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Dvorak + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | " | , | . | P | Y || F | G | C | R | L | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | O | E | U | I || D | H | T | N | S | / | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| ; | Q | J | K | X || B | M | W | V | Z |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Game (Qwerty without one shot modifiers & tap dancing) + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | S | D | F | G || H | J | K | L | ; | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower |Space ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Number pad + +``` + ,-----------------------------------------..-----------------------------------------. + | XXX | XXX | XXX | XXX | XXX | XXX || XXX | NLCK | * | / | BKSP | BKSP | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | XXX | XXX | XXX | XXX | XXX || NLCK | 7 | 8 | 9 | - | BKSP | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | XXX | XXX | XXX | XXX | XXX || * | 4 | 5 | 6 | + | BKSP | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Shift | XXX | XXX | XXX | XXX | XXX || / | 1 | 2 | 3 | ENT | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI | XXX |Space ||Space | 0 | 0 | . | ENT | XXX | + `-----------------------------------------''-----------------------------------------' +``` + +### Mouse movement + +* M is short for Mouse +* MW is short for Mouse Wheel +* MB is short for Mouse Button +* MA is short for Mouse Acceleration + +  +* MB\_1 is the left click +* MB\_2 is the right click +* MB\_3 is the middle click + +``` + ,-----------------------------------------..-----------------------------------------. + | XXX | XXX | XXX | XXX | XXX | XXX || XXX | XXX | XXX | XXX | XXX | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 || MA_0 | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | MW_L | MW_U | MW_D | MW_R | XXX || MA_1 | M_LT | M_UP | M_DN | M_RT | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Shift | MA_0 | MA_1 | MA_2 | XXX | XXX || MA_2 | MW_L | MW_U | MW_D | MW_R | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI | XXX |Space || XXX | XXX | XXX | XXX | XXX | XXX | + `-----------------------------------------''-----------------------------------------' +``` + +### Lower + +``` + ,-----------------------------------------..-----------------------------------------. + | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 || F6 | _ | + | | \ | | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + `-----------------------------------------'`-----------------------------------------' +``` + +### Raise + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 || F6 | - | = | [ | ] | \ | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + `-----------------------------------------''-----------------------------------------' +``` + diff --git a/users/losinggeneration/losinggeneration-common.h b/users/losinggeneration/losinggeneration-common.h new file mode 100644 index 000000000..8f5b8b241 --- /dev/null +++ b/users/losinggeneration/losinggeneration-common.h @@ -0,0 +1,74 @@ +#ifndef LOSINGGENERATION_COMMON_H +#define LOSINGGENERATION_COMMON_H + +/* Custom keys & combinations to be shorter for keymaps */ +#define KC_LCA LCA(KC_NO) +/* Fillers to make layering more clear */ +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define OSM_LSFT OSM(MOD_LSFT) +#define TD_CTL TD(TD_CTL_CTLALT) +#define TD_GUI TD(TD_LGUI_RGUI) +#define TD_ALT TD(TD_LALT_RALT) +#define MT_ENT SFT_T(KC_ENT) +#define MT_ESC CTL_T(KC_ESC) + +/* Custom layer movements for keymaps */ +#define TD_ADJ TD(TD_ADJUST) +#define TO_GAME TO(_GAME) +#define TO_MS TO(_MOUSE) +#define TO_NUM TO(_NUMPAD) +#define MO_ADJ MO(_ADJUST) + +/* Mouse keys */ +#define MS_BTN1 KC_MS_BTN1 +#define MS_BTN2 KC_MS_BTN2 +#define MS_BTN3 KC_MS_BTN3 +#define MS_BTN4 KC_MS_BTN4 +#define MS_BTN5 KC_MS_BTN5 +#define MS_LEFT KC_MS_LEFT +#define MS_DOWN KC_MS_DOWN +#define MS_UP KC_MS_UP +#define MS_RGHT KC_MS_RIGHT +#define MW_LEFT KC_MS_WH_LEFT +#define MW_DOWN KC_MS_WH_DOWN +#define MW_UP KC_MS_WH_UP +#define MW_RGHT KC_MS_WH_RIGHT +#define MS_ACL0 KC_MS_ACCEL0 +#define MS_ACL1 KC_MS_ACCEL1 +#define MS_ACL2 KC_MS_ACCEL2 + +/* + * This will expand values sent to it to send to the KEYMAP macro so defines + * can be used by KEYMAP + */ +#define CATMAP(...) KEYMAP(__VA_ARGS__) + +/* + Each layer gets a name for readability, which is then used in the keymap matrix below. + The underscores don't mean anything - you can have a layer called STUFF or any other name. + Layer names don't all need to be of the same length, obviously, and you can also skip them + entirely and just use numbers. +*/ +#define _QWERTY 0 +#define _COLEMAK 1 +#define _WORKMAN 2 +#define _DVORAK 3 +#define _GAME 4 +#define _NUMPAD 5 +#define _MOUSE 6 +#define _LOWER 14 +#define _RAISE 15 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + WORKMAN, + DVORAK, + LOWER, + RAISE, +}; + +#endif diff --git a/users/losinggeneration/losinggeneration-config.h b/users/losinggeneration/losinggeneration-config.h new file mode 100644 index 000000000..e1719aa9e --- /dev/null +++ b/users/losinggeneration/losinggeneration-config.h @@ -0,0 +1,29 @@ +/* +Copyright 2017 Danny Nguyen +Copyright 2018 Harley Laue + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +long with this program. If not, see . +*/ + +#ifndef LOSINGGENERATION_CONFIG_H +#define LOSINGGENERATION_CONFIG_H + +#define MOUSEKEY_DELAY 100 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 10 +#define MOUSEKEY_TIME_TO_MAX 20 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 20 + +#endif diff --git a/users/losinggeneration/losinggeneration-keymap.h b/users/losinggeneration/losinggeneration-keymap.h new file mode 100644 index 000000000..89827bc13 --- /dev/null +++ b/users/losinggeneration/losinggeneration-keymap.h @@ -0,0 +1,352 @@ +#ifndef LOSINGGENERATION_KEYMAP_H +#define LOSINGGENERATION_KEYMAP_H + +#include "action_layer.h" +#include "eeconfig.h" +#include "losinggeneration-common.h" + +/* Tap dance keycodes */ +enum tap_dance_keycodes { + TD_CTL_CTLALT = 0, + TD_LGUI_RGUI, + TD_LALT_RALT, + TD_ADJUST, +}; + +/* + Used to indicate a CTRL should be pressed on one press, or CTRL+ALT on + a double tap +*/ +void dance_ctl_ctlalt_each(qk_tap_dance_state_t *state, void *user_data) { + register_code(KC_LCTL); + if(state->count > 1) { + register_code(KC_LALT); + } +} + +/* Used to release CTRL or the double tapped variant CTRL+ALT */ +void dance_ctl_ctlalt_reset(qk_tap_dance_state_t *state, void *user_data) { + unregister_code(KC_LCTL); + if(state->count > 1) { + unregister_code(KC_LALT); + } +} + +/* + Set ADJUST layer on the first press and off after that. + Each is used to make sure ADJUST activates as soon as it's pressed the first + time. +*/ +void dance_adj_each(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 1) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } +} + +/* Set NUMPAD layer on second tap and MOUSE layer on 3rd */ +void dance_adj_finish(qk_tap_dance_state_t *state, void *user_data) { + switch(state->count) { + case 1: break; + case 2: + layer_on(_NUMPAD); + break; + case 3: + layer_on(_MOUSE); + break; + default: + reset_tap_dance(state); + break; + } +} + +/* Turn off any layer that may have been tapped on */ +void dance_adj_reset(qk_tap_dance_state_t *state, void *user_data) { + switch(state->count) { + case 1: + layer_off(_ADJUST); + break; + case 2: + layer_off(_NUMPAD); + break; + case 3: + layer_off(_MOUSE); + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CTL_CTLALT] = ACTION_TAP_DANCE_FN_ADVANCED(dance_ctl_ctlalt_each, NULL, dance_ctl_ctlalt_reset), + [TD_LGUI_RGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, KC_RGUI), + [TD_LALT_RALT] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_RALT), + [TD_ADJUST] = ACTION_TAP_DANCE_FN_ADVANCED(dance_adj_each, dance_adj_finish, dance_adj_reset), +}; + +/* + * ,-----------------------------------------..-----------------------------------------. + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define BOTTOM_40_ROW \ + TD_ADJ ,TD_CTL , TD_ALT , TD_GUI , LOWER , KC_DEL , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT + +/* + * ,-----------------------------------------..-----------------------------------------. + * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + * `-----------------------------------------'`-----------------------------------------' + */ +#define BOTTOM_RAISE_LOWER_ROWS \ + _______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PGUP, KC_PGDN, KC_HOME, KC_END , KC_MSTP, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY + +/* + * ,-----------------------------------------..-----------------------------------------. + * | Tab | || | Bksp | + * `-----------------------------------------'`-----------------------------------------' + */ +#define STD_TAB_ROW(...) KC_TAB, __VA_ARGS__, KC_BSPC + +/* + * ,-----------------------------------------..-----------------------------------------. + * | Esc | || | + * `-----------------------------------------'`-----------------------------------------' + */ + +#define STD_ESC_ROW(...) KC_ESC, __VA_ARGS__ + +/* + * ,-----------------------------------------..-----------------------------------------. + * | Shift| || |Enter | + * `-----------------------------------------'`-----------------------------------------' + */ +#define STD_LSFT_ROW(...) OSM_LSFT, __VA_ARGS__, MT_ENT + +/* Qwerty + * ,-----------------------------------------..-----------------------------------------. + * | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | S | D | F | G || H | J | K | L | ; | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define QWERTY_LAYER \ + STD_TAB_ROW( KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ), \ + STD_ESC_ROW( KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT), \ + STD_LSFT_ROW(KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH), \ + BOTTOM_40_ROW + +/* Colemak + * ,-----------------------------------------.,-----------------------------------------. + * | Tab | Q | W | F | P | G || J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | R | S | T | D || H | N | E | I | O | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | C | V | B || K | M | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define COLEMAK_LAYER \ + STD_TAB_ROW( KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN), \ + STD_ESC_ROW( KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT), \ + STD_LSFT_ROW(KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH), \ + BOTTOM_40_ROW + +/* Workman + * ,-----------------------------------------..-----------------------------------------. + * | Tab | Q | D | R | W | B || J | F | U | P | ; | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | S | H | T | G || Y | N | E | O | I | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | M | C | V || K | L | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define WORKMAN_LAYER \ + STD_TAB_ROW( KC_Q , KC_D , KC_R , KC_W , KC_B , KC_J , KC_F , KC_U , KC_P , KC_SCLN), \ + STD_ESC_ROW( KC_A , KC_S , KC_H , KC_T , KC_G , KC_Y , KC_N , KC_E , KC_O , KC_I , KC_QUOT), \ + STD_LSFT_ROW(KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH), \ + BOTTOM_40_ROW + +/* Dvorak + * ,-----------------------------------------..-----------------------------------------. + * | Tab | " | , | . | P | Y || F | G | C | R | L | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | O | E | U | I || D | H | T | N | S | / | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X || B | M | W | V | Z |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define DVORAK_LAYER \ + STD_TAB_ROW( KC_QUOT, KC_COMM, KC_DOT , KC_P , KC_Y , KC_F , KC_G , KC_C , KC_R , KC_L), \ + STD_ESC_ROW( KC_A , KC_O , KC_E , KC_U , KC_I , KC_D , KC_H , KC_T , KC_N , KC_S , KC_SLSH), \ + STD_LSFT_ROW(KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z), \ + BOTTOM_40_ROW + +/* Game (Qwerty without one shot modifiers & tap dancing) + * ,-----------------------------------------..-----------------------------------------. + * | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | S | D | F | G || H | J | K | L | ; | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define GAME_LAYER \ + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, \ + KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_ENT , \ + MO_ADJ , KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT + +/* Number pad + * ,-----------------------------------------..-----------------------------------------. + * | Tab | XXX | XXX | XXX | XXX | XXX || NLCK | 7 | 8 | 9 | - | BKSP | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | XXX | XXX | XXX | XXX | XXX || * | 4 | 5 | 6 | + | BKSP | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Shift | XXX | XXX | XXX | XXX | XXX || / | 1 | 2 | 3 | ENT | XXX | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI | XXX |Space ||Space | 0 | 0 | . | ENT | XXX | + * `-----------------------------------------''-----------------------------------------' + */ +#define NUMPAD_LAYER \ + KC_TAB , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_P7 , KC_P8 , KC_P9 , KC_PMNS, KC_BSPC, \ + KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4 , KC_P5 , KC_P6 , KC_PPLS, KC_BSPC, \ + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P1 , KC_P2 , KC_P3 , KC_PENT, XXXXXXX, \ + TD_ADJ , TD_CTL , TD_ALT , TD_GUI , XXXXXXX, KC_SPC , KC_SPC , KC_P0 , KC_P0 , KC_PDOT, KC_PENT, XXXXXXX + +/* Mouse movement + * ,-----------------------------------------..-----------------------------------------. + * | Tab | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 || MA_0 | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | MW_L | MW_U | MW_D | MW_R | XXX || MA_1 | M_LT | M_UP | M_DN | M_RT | XXX | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Shift | MA_0 | MA_1 | MA_2 | XXX | XXX || MA_2 | MW_L | MW_U | MW_D | MW_R | XXX | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI | XXX |Space || XXX | XXX | XXX | XXX | XXX | XXX | + * `-----------------------------------------''-----------------------------------------' + */ +#define MOUSE_LAYER \ + KC_TAB , MS_BTN1, MS_BTN3, MS_BTN2, MS_BTN4, MS_BTN5, MS_ACL0, MS_BTN1, MS_BTN3, MS_BTN2, MS_BTN4, MS_BTN5, \ + KC_ESC , MW_LEFT, MW_DOWN, MW_UP , MW_RGHT, XXXXXXX, MS_ACL1, MS_LEFT, MS_DOWN, MS_UP , MS_RGHT, XXXXXXX, \ + KC_LSFT, MS_ACL0, MS_ACL1, MS_ACL2, XXXXXXX, XXXXXXX, MS_ACL2, MW_LEFT, MW_DOWN, MW_UP , MW_RGHT, XXXXXXX, \ + TD_ADJ , TD_CTL , TD_ALT , TD_GUI , XXXXXXX, KC_SPC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + +/* Lower + * ,-----------------------------------------..-----------------------------------------. + * | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 || F6 | _ | + | | \ | | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + * `-----------------------------------------'`-----------------------------------------' + */ +#define LOWER_LAYER \ + KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + BOTTOM_RAISE_LOWER_ROWS + +/* Raise + * ,-----------------------------------------..-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 || F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + * `-----------------------------------------''-----------------------------------------' + */ +#define RAISE_LAYER \ + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC, \ + KC_DEL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_BSLS, \ + BOTTOM_RAISE_LOWER_ROWS + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_workman[][2] = SONG(PLOVER_SOUND); +#else +float tone_qwerty; +float tone_dvorak; +float tone_colemak; +float tone_workman; +#define PLAY_SONG(tone) +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + layer_state_set(default_layer); + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + PLAY_SONG(tone_qwerty); + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + PLAY_SONG(tone_colemak); + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case WORKMAN: + if (record->event.pressed) { + PLAY_SONG(tone_workman); + persistent_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + PLAY_SONG(tone_dvorak); + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + + return true; +} + +#endif diff --git a/users/losinggeneration/rules.mk b/users/losinggeneration/rules.mk new file mode 100644 index 000000000..75277116b --- /dev/null +++ b/users/losinggeneration/rules.mk @@ -0,0 +1,16 @@ +# Build Options +# Only enable things here that are generic to all keyboards. A yes or no here +# will override keyboard/keymap specific values +# +#BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +#COMMAND_ENABLE = no # Commands for debug and configuration +#CONSOLE_ENABLE = no # Console for debug(+400) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +#NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +TAP_DANCE_ENABLE = yes # Enable tap dancing +#UNICODE_ENABLE = no # Unicode + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 598384bc1064ab9250191a1727c27a0eea406756 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 4 Feb 2018 10:44:02 -0800 Subject: [PATCH 117/556] Update to drashna userspace (Keymap Templating) (#2338) * Change tapping term to be longer * Make Audio/Underglow settings permanent * Use wait_ms rather than _delay_ms * Readd One Shot Mods * Switch to Imperial March startup sound * Move OSM to it's own layer * Minor Formatting Tweaks * Keymap Templates and formatting fixes --- keyboards/ergodox_ez/keymaps/drashna/config.h | 2 +- keyboards/ergodox_ez/keymaps/drashna/keymap.c | 164 ++++++++++-------- keyboards/orthodox/keymaps/drashna/config.h | 2 +- keyboards/orthodox/keymaps/drashna/keymap.c | 57 +++--- keyboards/orthodox/keymaps/drashna/rules.mk | 2 - users/drashna/drashna.c | 36 ++-- users/drashna/drashna.h | 63 ++++++- users/drashna/readme.md | 16 ++ 8 files changed, 215 insertions(+), 127 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/drashna/config.h b/keyboards/ergodox_ez/keymaps/drashna/config.h index 2f5422b14..d543379a3 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/config.h +++ b/keyboards/ergodox_ez/keymaps/drashna/config.h @@ -15,7 +15,7 @@ #ifdef TAPPING_TERM #undef TAPPING_TERM #endif -#define TAPPING_TERM 150 +#define TAPPING_TERM 175 #undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) #define ONESHOT_TAP_TOGGLE 2 diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 0d0e1fba2..268a1d085 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -48,26 +48,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | End | | PgDn | | | * `---------------------' `---------------------' */ - [_QWERTY] = LAYOUT_ergodox( - KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(_DIABLO), - KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), - LT(_SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET, + [_QWERTY] = LAYOUT_ergodox_wrapper( + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________QWERTY_L1_________________, TG(_DIABLO), + KC_BSPC, _________________QWERTY_L2_________________, + KC_LSFT, _________________QWERTY_L3_________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, - ALT_T(KC_APPLICATION), KC_LGUI, - KC_HOME, - KC_SPACE, KC_BSPACE, KC_END, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - TG(_DIABLO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, - KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_QUOTE), - TG(_GAMEPAD), KC_N, KC_M, KC_COMMA, KC_DOT, RCTL_T(KC_SLASH),OSM(MOD_RSFT), - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), - KC_RGUI, CTL_T(KC_ESCAPE), - KC_PGUP, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), _________________QWERTY_R1_________________, KC_BSLS, + _________________QWERTY_R2_________________, GUI_T(KC_QUOT), + TG(_GAMEPAD), _________________QWERTY_R3_________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -91,25 +91,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[_COLEMAK] = LAYOUT_ergodox( +[_COLEMAK] = LAYOUT_ergodox_wrapper( // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(_DIABLO), - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), - LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________COLEMAK_L1________________, TG(_DIABLO), + KC_BSPC, _________________COLEMAK_L2________________, + KC_LSFT, _________________COLEMAK_L3________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, // right hand - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(_DIABLO), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, GUI_T(KC_QUOTE), - TG(_GAMEPAD),KC_K, KC_M, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), OSM(MOD_RSFT), - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), - KC_RGUI, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), _________________COLEMAK_R1________________, KC_BSLS, + _________________COLEMAK_R2________________, GUI_T(KC_QUOT), + TG(_GAMEPAD), _________________COLEMAK_R3________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER ), /* Keymap 0: Basic layer * @@ -134,25 +134,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[_DVORAK] = LAYOUT_ergodox( +[_DVORAK] = LAYOUT_ergodox_wrapper( // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(_DIABLO), - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD), - LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________DVORAK_L1_________________, TG(_DIABLO), + KC_BSPC, _________________DVORAK_L2_________________, + KC_LSFT, _________________DVORAK_L3_________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, // right hand - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(_DIABLO), 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(_GAMEPAD),KC_B, KC_M, KC_W, KC_V, RCTL_T(KC_Z), OSM(MOD_RSFT), - KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, TT(_SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + TG(_DIABLO), _________________DVORAK_R1_________________, KC_SLSH, + _________________DVORAK_R2_________________, GUI_T(KC_MINS), + TG(_GAMEPAD), _________________DVORAK_R3_________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER ), /* Keymap 0: Basic layer * @@ -177,27 +177,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[_WORKMAN] = LAYOUT_ergodox( +[_WORKMAN] = LAYOUT_ergodox_wrapper( // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(_DIABLO), - KC_BSPC, KC_A, KC_S, KC_H, KC_T, KC_G, - KC_LSFT, LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD), - LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________WORKMAN_L1________________, TG(_DIABLO), + KC_BSPC, _________________WORKMAN_L2________________, + KC_LSFT, _________________WORKMAN_L3________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, // right hand - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(_DIABLO), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, - KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOTE, - TG(_GAMEPAD),KC_K, KC_L, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), OSM(MOD_RSFT), - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), _________________WORKMAN_R1________________, KC_BSLS, + _________________WORKMAN_R2________________, GUI_T(KC_QUOT), + TG(_GAMEPAD), _________________WORKMAN_R3________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER ), + [_MODS] = LAYOUT_ergodox( + 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, + OSM(MOD_LSFT),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_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, OSM(MOD_RSFT), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + /* Keymap 3: Symbol Layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -220,11 +240,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ [_SYMB] = LAYOUT_ergodox( - EPRM, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_WORKMAN, - VRSN, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_DVORAK, + EPRM, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, TG(_MODS), + VRSN, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_WORKMAN, KC_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE, KC_RESET, KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_COLEMAK, - KC_TRNS, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON, + KC_TRNS, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON, RGB_SMOD, KC_RGB_T, RGB_HUI, RGB_M_R, RGB_M_SW, RGB_HUD, diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index d83b77927..c83380bd0 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -68,7 +68,7 @@ along with this program. If not, see . #ifdef AUDIO_ENABLE #define C6_AUDIO -#define STARTUP_SONG SONG(ZELDA_TREASURE) +#define STARTUP_SONG SONG(IMPERIAL_MARCH) #endif #undef PRODUCT diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index f74b39ae4..cb76a20bd 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -31,49 +31,54 @@ along with this program. If not, see . // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO - +#define KC_MSHF OSM(MOD_LSFT) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = KEYMAP(\ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT,CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ +[_QWERTY] = KEYMAP_wrapper(\ + KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, \ + KC_TAB, _________________QWERTY_L2_________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________QWERTY_R2_________________, KC_QUOT, \ + KC_LSFT, _________________QWERTY_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________QWERTY_R3_________________, KC_LGUI \ ), -[_COLEMAK] = KEYMAP(\ - KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ +[_COLEMAK] = KEYMAP_wrapper(\ + KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, \ + KC_TAB, _________________COLEMAK_L2________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________COLEMAK_R2________________, KC_QUOT, \ + KC_LSFT, _________________COLEMAK_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________COLEMAK_R3________________, KC_LGUI \ ), -[_DVORAK] = KEYMAP(\ - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ +[_DVORAK] = KEYMAP_wrapper(\ + KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, \ + KC_TAB, _________________DVORAK_L2_________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________DVORAK_R2_________________, KC_MINS, \ + KC_LSFT, _________________DVORAK_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________DVORAK_R3_________________, KC_LGUI \ ), -[_WORKMAN] = KEYMAP(\ - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT,CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ +[_WORKMAN] = KEYMAP_wrapper(\ + KC_ESC, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC, \ + KC_TAB, _________________WORKMAN_L2________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________WORKMAN_R2________________, KC_MINS, \ + KC_LSFT, _________________WORKMAN_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________WORKMAN_R3________________, KC_LGUI \ +), +[_MODS] = KEYMAP(\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + OSM(MOD_LSFT), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), [_LOWER] = KEYMAP(\ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, KC_RCTL, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, KC_RCTL, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ ), [_RAISE] = KEYMAP(\ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, _______, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, KC_COMM, KC_DOT, KC_PGDN, _______ \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, _______, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, KC_COMM, KC_DOT, KC_PGDN, _______ \ ), [_ADJUST] = KEYMAP(\ - KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - RGB_SMOD,RGB_HUI, KC_FXCL, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ - KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ + KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SMOD,RGB_HUI, KC_FXCL, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, TG(_MODS), \ + KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ ) diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index c4cf6629c..222a43640 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -7,5 +7,3 @@ TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes AUDIO_ENABLE = yes NKRO_ENABLE = yes -FAUXCLICKY_ENABLE = no -USE_I2C = no diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index a07d74407..6039c7c56 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -166,7 +166,7 @@ void matrix_init_user(void) { } #endif #ifdef AUDIO_ENABLE -// _delay_ms(21); // gets rid of tick +// wait_ms(21); // gets rid of tick // stop_all_notes(); // PLAY_SONG(tone_hackstartup); #endif @@ -329,7 +329,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Salt, salt, salt..."); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -340,7 +340,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Please sir, can I have some more salt?!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -351,7 +351,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Your salt only makes me harder, and even more aggressive!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -362,7 +362,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Good game, everyone!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -373,7 +373,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Good luck, have fun!!!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -384,7 +384,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Left click to win!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -395,7 +395,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games."); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -406,7 +406,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("That was positively riveting!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -417,9 +417,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("That aim is absolutely amazing. It's almost like you're a machine!" SS_TAP(X_ENTER)); - _delay_ms(3000); + wait_ms(3000); register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); SEND_STRING("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!" SS_TAP(X_ENTER)); @@ -430,7 +430,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("OMG!!! C9!!!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -441,7 +441,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("That was a fantastic game, though it was a bit easy. Try harder next time!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -470,16 +470,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ":teensy" //#elif defined(BOOTLOADER_CATERINA) // ":avrdude" -#endif -#ifdef RGBLIGHT_ENABLE - " RGBLIGHT_ENABLE=yes" -#else - " RGBLIGHT_ENABLE=no" -#endif -#ifdef AUDIO_ENABLE - " AUDIO_ENABLE=yes" -#else - " AUDIO_ENABLE=no" #endif SS_TAP(X_ENTER)); } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index aa9c83086..8354c55c9 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -26,8 +26,10 @@ along with this program. If not, see . #define _COLEMAK 1 #define _DVORAK 2 #define _WORKMAN 3 -#define _NAV 5 -#define _COVECUBE 6 +#define _MODS 4 +//#define _MISC 5 +#define _NAV 6 +#define _COVECUBE 7 #define _SYMB 8 #define _GAMEPAD 9 #define _DIABLO 10 @@ -142,4 +144,61 @@ enum { #define AUD_OFF AU_OFF #endif + + +// Since our quirky block definitions are basically a list of comma separated +// arguments, we need a wrapper in order for these definitions to be +// expanded before being used as arguments to the LAYOUT_xxx macro. +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define KEYMAP_wrapper(...) KEYMAP(__VA_ARGS__) + +// Blocks for each of the four major keyboard layouts +// Organized so we can quickly adapt and modify all of them +// at once, rather than for each keyboard, one at a time. +// And this allows wor much cleaner blocks in the keymaps. +// For instance Tap/Hold for Control on all of the layouts + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + + +#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________DVORAK_L3_________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X + +#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z) + + +#define _________________WORKMAN_L1________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________WORKMAN_L2________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________WORKMAN_L3________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X + +#define _________________WORKMAN_R1________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________WORKMAN_R2________________ KC_D, KC_H, KC_T, KC_N, KC_S +#define _________________WORKMAN_R3________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z) + + + +// Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN), +// this allows us to quickly modify the bottom row for all of the layouts +// so we don't have to alter it 4 times and hope that we haven't missed +// anything +#define ___________ERGODOX_BOTTOM_LEFT_____________ KC_QUOT, KC_LGUI, KC_LBRC, KC_RBRC +#define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT #endif diff --git a/users/drashna/readme.md b/users/drashna/readme.md index e77948ea9..92792fb97 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -20,6 +20,22 @@ This allows for keyboard specific configuration while maintaining the ability to My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/drashna/keymap.c#L399) is a good example of this, as it uses the LEDs as modifier indicators. +Keyboard Layout Templates +------------------------- + +This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. + +This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. + +The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: + +`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` + +Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. + +Credit goes to @jola5 for first implementing this awesome idea. + + Custom Keycodes --------------- From 2908c0f9277d021d35133940d6a4d77569229ecf Mon Sep 17 00:00:00 2001 From: KeLorean Date: Sun, 4 Feb 2018 13:44:58 -0500 Subject: [PATCH 118/556] made kelorean keymaps for planck and s65x (#2331) * Planck-swapped up/down arrows,s65x-add dvorak * Added Dvorak as first layer of default keymap * planck-swap up and down arrows. s65x-added dvorak * added colemak to kelorean s65x keymap --- keyboards/planck/keymaps/kelorean/config.h | 42 ++++ keyboards/planck/keymaps/kelorean/keymap.c | 264 ++++++++++++++++++++ keyboards/planck/keymaps/kelorean/readme.md | 2 + keyboards/planck/keymaps/kelorean/rules.mk | 0 keyboards/s65_x/keymaps/kelorean/keymap.c | 155 ++++++++++++ keyboards/s65_x/keymaps/kelorean/readme.md | 81 ++++++ 6 files changed, 544 insertions(+) create mode 100644 keyboards/planck/keymaps/kelorean/config.h create mode 100644 keyboards/planck/keymaps/kelorean/keymap.c create mode 100644 keyboards/planck/keymaps/kelorean/readme.md create mode 100644 keyboards/planck/keymaps/kelorean/rules.mk create mode 100644 keyboards/s65_x/keymaps/kelorean/keymap.c create mode 100644 keyboards/s65_x/keymaps/kelorean/readme.md diff --git a/keyboards/planck/keymaps/kelorean/config.h b/keyboards/planck/keymaps/kelorean/config.h new file mode 100644 index 000000000..a1635f2ba --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/config.h @@ -0,0 +1,42 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/kelorean/keymap.c b/keyboards/planck/keymaps/kelorean/keymap.c new file mode 100644 index 000000000..7578d26b8 --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/keymap.c @@ -0,0 +1,264 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "planck.h" +#include "action_layer.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL }, + {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/kelorean/readme.md b/keyboards/planck/keymaps/kelorean/readme.md new file mode 100644 index 000000000..61146cbce --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout +Swapped up and down arrows. diff --git a/keyboards/planck/keymaps/kelorean/rules.mk b/keyboards/planck/keymaps/kelorean/rules.mk new file mode 100644 index 000000000..e69de29bb diff --git a/keyboards/s65_x/keymaps/kelorean/keymap.c b/keyboards/s65_x/keymaps/kelorean/keymap.c new file mode 100644 index 000000000..20fe0fdba --- /dev/null +++ b/keyboards/s65_x/keymaps/kelorean/keymap.c @@ -0,0 +1,155 @@ +#include "s65_x.h" + +#define _BL 0 +#define _CM 1 +#define _DV 2 +#define _AL 3 +#define _FL 4 +#define _UL 5 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer, swapped alt and GUI for Mac + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = ANSI_KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(4), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 1: Colemak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: Colemak layer */ + [_CM] = ANSI_KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(4), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 2: Dvorak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: Dvorak layer */ + [_DV] = ANSI_KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_END, \ + F(4), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + /* 3: Locking arrow keys to WASD for when you need dedicated arrow keys + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_AL] = ANSI_KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* 4: Fn layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│_UL │ │_CM │_DV │ │ │ │ │Home │End │▒▒▒▒▒│ │Vol+ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_FL] = ANSI_KEYMAP( + KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, F(3), KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, \ + _______, F(5), _______, F(1), F(2), _______, _______, _______, KC_HOME, KC_END, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_MPLY), + + /* 5: Locking layer for controlling the underglow + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_UL] = ANSI_KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + + +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay + [1] = ACTION_LAYER_TOGGLE(_CM), //Toggle Colemak Layer overlay + [2] = ACTION_LAYER_TOGGLE(_DV), // Toggle Dvorak Layer overlay + [3] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay + [4] = ACTION_LAYER_TAP_KEY(_FL, KC_BSPC), // Tap to Backspace and hold to activate function layer + [5] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay + +}; + diff --git a/keyboards/s65_x/keymaps/kelorean/readme.md b/keyboards/s65_x/keymaps/kelorean/readme.md new file mode 100644 index 000000000..be33069e4 --- /dev/null +++ b/keyboards/s65_x/keymaps/kelorean/readme.md @@ -0,0 +1,81 @@ +### 1 ANSI +A Mac ANSI layout that assumes standard sized shifts, enter, and backspace keys, Arrow layer, FN layers and Lighting functions layer... +I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │▒▒▒▒▒│END │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │BKSPC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│▒▒▒▒▒│PG_UP│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.1: Colemak layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│END │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.2: Dvorak layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│END │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │BKSPC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.3 Arrow layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.4 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│_UL │ │_CM │_DV │ │ │ │Home │ End │ │▒▒▒▒▒│▒▒▒▒▒│Vol+ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.5 Underglow layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ From 9fcda95363568156887c76867e843a86f8f75757 Mon Sep 17 00:00:00 2001 From: scauligi Date: Sun, 4 Feb 2018 10:45:19 -0800 Subject: [PATCH 119/556] Fixes to get tap dance to fire at proper places (#2272) * tap dance fixes: fire immediately upon completion and also get properly interrupted before macros * bugfix for tapdance improvement * fix build --- quantum/process_keycode/process_tap_dance.c | 73 +++++++++++++-------- quantum/process_keycode/process_tap_dance.h | 7 +- quantum/quantum.c | 4 ++ 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index f196a9cb6..94dd17c2f 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -21,6 +21,15 @@ uint8_t get_oneshot_mods(void); static uint16_t last_td; static int8_t highest_td = -1; +void qk_tap_dance_pair_on_each_tap (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; + + if (state->count == 2) { + register_code16 (pair->kc2); + state->finished = true; + } +} + void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; @@ -41,6 +50,15 @@ void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) { } } +void qk_tap_dance_dual_role_on_each_tap (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data; + + if (state->count == 2) { + layer_move (pair->layer); + state->finished = true; + } +} + void qk_tap_dance_dual_role_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data; @@ -92,14 +110,31 @@ static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *act send_keyboard_report(); } +void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { + qk_tap_dance_action_t *action; + + if (!record->event.pressed) + return; + + if (highest_td == -1) + return; + + for (int i = 0; i <= highest_td; i++) { + action = &tap_dance_actions[i]; + if (action->state.count) { + if (keycode == action->state.keycode && keycode == last_td) + continue; + action->state.interrupted = true; + process_tap_dance_action_on_dance_finished (action); + reset_tap_dance (&action->state); + } + } +} + bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { uint16_t idx = keycode - QK_TAP_DANCE; qk_tap_dance_action_t *action; - if (last_td && last_td != keycode) { - (&tap_dance_actions[last_td - QK_TAP_DANCE])->state.interrupted = true; - } - switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: if ((int16_t)idx > highest_td) @@ -116,34 +151,14 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { action->state.weak_mods |= get_weak_mods(); process_tap_dance_action_on_each_tap (action); - if (last_td && last_td != keycode) { - qk_tap_dance_action_t *paction = &tap_dance_actions[last_td - QK_TAP_DANCE]; - paction->state.interrupted = true; - process_tap_dance_action_on_dance_finished (paction); - reset_tap_dance (&paction->state); - } - last_td = keycode; + } else { + if (action->state.count && action->state.finished) { + reset_tap_dance (&action->state); + } } break; - - default: - if (!record->event.pressed) - return true; - - if (highest_td == -1) - return true; - - for (int i = 0; i <= highest_td; i++) { - action = &tap_dance_actions[i]; - if (action->state.count == 0) - continue; - action->state.interrupted = true; - process_tap_dance_action_on_dance_finished (action); - reset_tap_dance (&action->state); - } - break; } return true; @@ -156,7 +171,7 @@ void matrix_scan_tap_dance () { return; uint16_t tap_user_defined; -for (uint8_t i = 0; i <= highest_td; i++) { + for (uint8_t i = 0; i <= highest_td; i++) { qk_tap_dance_action_t *action = &tap_dance_actions[i]; if(action->custom_tapping_term > 0 ) { tap_user_defined = action->custom_tapping_term; diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index ab20ea04e..8b0a47c49 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -62,12 +62,12 @@ typedef struct } qk_tap_dance_dual_role_t; #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ - .fn = { NULL, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset }, \ + .fn = { qk_tap_dance_pair_on_each_tap, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset }, \ .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }), \ } #define ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) { \ - .fn = { NULL, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset }, \ + .fn = { qk_tap_dance_dual_role_on_each_tap, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset }, \ .user_data = (void *)&((qk_tap_dance_dual_role_t) { kc, layer }), \ } @@ -91,13 +91,16 @@ extern qk_tap_dance_action_t tap_dance_actions[]; /* To be used internally */ +void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record); bool process_tap_dance(uint16_t keycode, keyrecord_t *record); void matrix_scan_tap_dance (void); void reset_tap_dance (qk_tap_dance_state_t *state); +void qk_tap_dance_pair_on_each_tap (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data); +void qk_tap_dance_dual_role_on_each_tap (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_dual_role_finished (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_dual_role_reset (qk_tap_dance_state_t *state, void *user_data); diff --git a/quantum/quantum.c b/quantum/quantum.c index f5246d9b1..d3685f50b 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -209,6 +209,10 @@ bool process_record_quantum(keyrecord_t *record) { // return false; // } + #ifdef TAP_DANCE_ENABLE + preprocess_tap_dance(keycode, record); + #endif + if (!( #if defined(KEY_LOCK_ENABLE) // Must run first to be able to mask key_up events. From 9aaa491bc0b7f904dca1be0d002efe0f0db86477 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Mon, 5 Feb 2018 08:54:49 -0800 Subject: [PATCH 120/556] Add stm32 to drivers.txt --- util/drivers.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/drivers.txt b/util/drivers.txt index d21a748f0..4e5439c39 100644 --- a/util/drivers.txt +++ b/util/drivers.txt @@ -4,6 +4,7 @@ # Driver can be one of winusb,libusb,libusbk # Use Windows Powershell and type [guid]::NewGuid() to generate guids winusb,Kiibohd DFU Bootloader,1C11,B007,aa5a3f86-b81e-4416-89ad-0c1ea1ed63af +winusb,STM32 Bootloader,0483,df11,6d98a87f-4ecf-464d-89ed-8c684d857a75 libusb,ATxmega16C4,03EB,2FD8,23266ee7-5423-4cc4-993b-034571c43a90 libusb,ATxmega32C4,03EB,2FD9,d4b62886-2ac8-4534-aa24-eae0a2c3ce43 libusb,ATxmega64C3,03EB,2FD6,08467ca7-9b5a-41d2-8d8a-4a26d0b5285b @@ -43,4 +44,4 @@ libusb,AT90USB162,03EB,2FFA,de67bff5-6e39-4e9c-8dfe-de7fce113716 libusb,AT90USB128,03EB,2FFB,fd217df3-59d0-440a-a8f3-4c0c8c84daa3 libusb,AT89C5130,03EB,2FFD,31b69a56-9ac0-4fab-a3ae-cd7bb7021ec5 libusb,AT8XC5122,03EB,2FFE,395a6118-8568-41b2-913a-d16912722342 -libusb,AT89C5132,03EB,2FFF,266ca4bc-5e59-4a7b-82dc-6e8732373d40 \ No newline at end of file +libusb,AT89C5132,03EB,2FFF,266ca4bc-5e59-4a7b-82dc-6e8732373d40 From 84a713b05cb50d01fc94e6b5b3e69420e7028d2c Mon Sep 17 00:00:00 2001 From: "U-LANDSRAAD\\drashna" Date: Mon, 5 Feb 2018 21:57:32 -0800 Subject: [PATCH 121/556] Remove _quantum functions from custom matrix.c code --- keyboards/chimera_ortho/matrix.c | 10 ---------- keyboards/deltasplit75/matrix.c | 9 --------- keyboards/dichotemy/matrix.c | 10 ---------- keyboards/eagle_viper/v2/matrix.c | 9 --------- keyboards/ergo42/matrix.c | 9 --------- keyboards/fc660c/matrix.c | 9 --------- keyboards/fc980c/matrix.c | 9 --------- keyboards/handwired/promethium/matrix.c | 9 --------- keyboards/helix/rev1/matrix.c | 9 --------- keyboards/helix/rev2/matrix.c | 9 --------- keyboards/iris/matrix.c | 8 -------- keyboards/kinesis/alvicstep/matrix.c | 9 --------- keyboards/lets_split/matrix.c | 9 --------- keyboards/levinson/matrix.c | 9 --------- keyboards/lightsaver/matrix.c | 9 --------- keyboards/meira/matrix.c | 9 --------- keyboards/minidox/matrix.c | 9 --------- keyboards/mitosis/matrix.c | 9 --------- keyboards/nyquist/matrix.c | 9 --------- keyboards/octagon/v1/matrix.c | 9 --------- keyboards/octagon/v2/matrix.c | 9 --------- keyboards/orthodox/matrix.c | 9 --------- keyboards/viterbi/matrix.c | 9 --------- 23 files changed, 208 deletions(-) diff --git a/keyboards/chimera_ortho/matrix.c b/keyboards/chimera_ortho/matrix.c index 0d046339e..66d29f8b3 100644 --- a/keyboards/chimera_ortho/matrix.c +++ b/keyboards/chimera_ortho/matrix.c @@ -47,16 +47,6 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} - __attribute__ ((weak)) void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/deltasplit75/matrix.c b/keyboards/deltasplit75/matrix.c index 4def27239..db84fb02c 100644 --- a/keyboards/deltasplit75/matrix.c +++ b/keyboards/deltasplit75/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/dichotemy/matrix.c b/keyboards/dichotemy/matrix.c index 02e96e38c..f2841df1d 100644 --- a/keyboards/dichotemy/matrix.c +++ b/keyboards/dichotemy/matrix.c @@ -50,16 +50,6 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} - __attribute__ ((weak)) void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/eagle_viper/v2/matrix.c b/keyboards/eagle_viper/v2/matrix.c index c93766d1b..7003a7ae0 100644 --- a/keyboards/eagle_viper/v2/matrix.c +++ b/keyboards/eagle_viper/v2/matrix.c @@ -33,15 +33,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/ergo42/matrix.c b/keyboards/ergo42/matrix.c index 47cda6fa8..80d4ce46a 100644 --- a/keyboards/ergo42/matrix.c +++ b/keyboards/ergo42/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/fc660c/matrix.c b/keyboards/fc660c/matrix.c index 69a96b979..e6e494810 100644 --- a/keyboards/fc660c/matrix.c +++ b/keyboards/fc660c/matrix.c @@ -86,15 +86,6 @@ static matrix_row_t _matrix0[MATRIX_ROWS]; static matrix_row_t _matrix1[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/fc980c/matrix.c b/keyboards/fc980c/matrix.c index 3a3a13de5..bde0f3c13 100644 --- a/keyboards/fc980c/matrix.c +++ b/keyboards/fc980c/matrix.c @@ -85,15 +85,6 @@ static matrix_row_t _matrix0[MATRIX_ROWS]; static matrix_row_t _matrix1[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/handwired/promethium/matrix.c b/keyboards/handwired/promethium/matrix.c index 72dbe8d4d..00f2b8e9d 100644 --- a/keyboards/handwired/promethium/matrix.c +++ b/keyboards/handwired/promethium/matrix.c @@ -74,15 +74,6 @@ static void unselect_rows(void); static void select_row(uint8_t row); static void unselect_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/helix/rev1/matrix.c b/keyboards/helix/rev1/matrix.c index 375057a6f..f2506868e 100644 --- a/keyboards/helix/rev1/matrix.c +++ b/keyboards/helix/rev1/matrix.c @@ -60,15 +60,6 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c index 7ddbc2107..a908360c5 100644 --- a/keyboards/helix/rev2/matrix.c +++ b/keyboards/helix/rev2/matrix.c @@ -62,15 +62,6 @@ static void unselect_rows(void); static void select_row(uint8_t row); static uint8_t matrix_master_scan(void); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/iris/matrix.c b/keyboards/iris/matrix.c index 3d8d2adb8..dcfc0216e 100644 --- a/keyboards/iris/matrix.c +++ b/keyboards/iris/matrix.c @@ -85,15 +85,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/kinesis/alvicstep/matrix.c b/keyboards/kinesis/alvicstep/matrix.c index cb0d5ad7d..be2bab039 100644 --- a/keyboards/kinesis/alvicstep/matrix.c +++ b/keyboards/kinesis/alvicstep/matrix.c @@ -43,15 +43,6 @@ static matrix_row_t read_row(uint8_t row); static void unselect_rows(void); static void select_rows(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c index 77def4212..c3bfe8042 100644 --- a/keyboards/lets_split/matrix.c +++ b/keyboards/lets_split/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/levinson/matrix.c b/keyboards/levinson/matrix.c index 9d8a14d19..ed913f34b 100644 --- a/keyboards/levinson/matrix.c +++ b/keyboards/levinson/matrix.c @@ -85,15 +85,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/lightsaver/matrix.c b/keyboards/lightsaver/matrix.c index cb7b38fd4..a07cdd0d1 100644 --- a/keyboards/lightsaver/matrix.c +++ b/keyboards/lightsaver/matrix.c @@ -34,15 +34,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/meira/matrix.c b/keyboards/meira/matrix.c index 40e94ba12..c1952f35f 100644 --- a/keyboards/meira/matrix.c +++ b/keyboards/meira/matrix.c @@ -75,15 +75,6 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/minidox/matrix.c b/keyboards/minidox/matrix.c index 81dfb1445..27a38dca0 100644 --- a/keyboards/minidox/matrix.c +++ b/keyboards/minidox/matrix.c @@ -60,15 +60,6 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/mitosis/matrix.c b/keyboards/mitosis/matrix.c index 0d046339e..4b87242b9 100644 --- a/keyboards/mitosis/matrix.c +++ b/keyboards/mitosis/matrix.c @@ -47,15 +47,6 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/nyquist/matrix.c b/keyboards/nyquist/matrix.c index 21eef9456..5fbae1150 100644 --- a/keyboards/nyquist/matrix.c +++ b/keyboards/nyquist/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/octagon/v1/matrix.c b/keyboards/octagon/v1/matrix.c index 2d2a5adbc..855534994 100644 --- a/keyboards/octagon/v1/matrix.c +++ b/keyboards/octagon/v1/matrix.c @@ -33,15 +33,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/octagon/v2/matrix.c b/keyboards/octagon/v2/matrix.c index e113e5077..a63a37640 100644 --- a/keyboards/octagon/v2/matrix.c +++ b/keyboards/octagon/v2/matrix.c @@ -33,15 +33,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/orthodox/matrix.c b/keyboards/orthodox/matrix.c index 3b60cead8..2ca5f4d87 100644 --- a/keyboards/orthodox/matrix.c +++ b/keyboards/orthodox/matrix.c @@ -64,15 +64,6 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/viterbi/matrix.c b/keyboards/viterbi/matrix.c index 21eef9456..5fbae1150 100644 --- a/keyboards/viterbi/matrix.c +++ b/keyboards/viterbi/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { From 0e31d85b8e2fa37ce8d718feff0db5334697abb4 Mon Sep 17 00:00:00 2001 From: KeLorean Date: Tue, 6 Feb 2018 23:01:29 -0500 Subject: [PATCH 122/556] made changes to my kelorean planck keymap (#2343) * Planck-swapped up/down arrows,s65x-add dvorak * Added Dvorak as first layer of default keymap * planck-swap up and down arrows. s65x-added dvorak * added colemak to kelorean s65x keymap * made more changes to kelorean keymap * just tryinng to fix bc i was not connected upstrem --- keyboards/planck/keymaps/kelorean/config.h | 2 +- keyboards/planck/keymaps/kelorean/keymap.c | 48 ++++++++++----------- keyboards/planck/keymaps/kelorean/readme.md | 3 +- keyboards/s65_x/keymaps/kelorean/keymap.c | 7 +-- keyboards/s65_x/keymaps/kelorean/readme.md | 7 +-- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/keyboards/planck/keymaps/kelorean/config.h b/keyboards/planck/keymaps/kelorean/config.h index a1635f2ba..036fa1a28 100644 --- a/keyboards/planck/keymaps/kelorean/config.h +++ b/keyboards/planck/keymaps/kelorean/config.h @@ -39,4 +39,4 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif \ No newline at end of file +#endif diff --git a/keyboards/planck/keymaps/kelorean/keymap.c b/keyboards/planck/keymaps/kelorean/keymap.c index 7578d26b8..3bbbca2ad 100644 --- a/keyboards/planck/keymaps/kelorean/keymap.c +++ b/keyboards/planck/keymaps/kelorean/keymap.c @@ -44,56 +44,56 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Esc | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * | Bksp | A | S | D | F | G | H | J | K | L | ; | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * | Shift| Z | X | C | V | B | N | M | , | . | / |Sft/En| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ESC}, + {KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT)} }, /* Colemak * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Esc | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * | Bksp | A | R | S | T | D | H | N | E | I | O | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |Sft/Es| Z | X | C | V | B | K | M | , | . | / |Sft/En| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_ESC}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT)} }, /* Dvorak * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * | Tab | " | , | . | P | Y | F | G | C | R | L | Esc | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * | Bksp | A | O | E | U | I | D | H | T | N | S | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |Sft/Es| ; | Q | J | K | X | B | M | W | V | Z |Sft/En| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| * `-----------------------------------------------------------------------------------' */ [_DVORAK] = { - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_ESC}, + {KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, + {KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT)} }, /* Lower diff --git a/keyboards/planck/keymaps/kelorean/readme.md b/keyboards/planck/keymaps/kelorean/readme.md index 61146cbce..fd1f35170 100644 --- a/keyboards/planck/keymaps/kelorean/readme.md +++ b/keyboards/planck/keymaps/kelorean/readme.md @@ -1,2 +1 @@ -# The Default Planck Layout -Swapped up and down arrows. +# The Default Planck Layout \ No newline at end of file diff --git a/keyboards/s65_x/keymaps/kelorean/keymap.c b/keyboards/s65_x/keymaps/kelorean/keymap.c index 20fe0fdba..22fe7b072 100644 --- a/keyboards/s65_x/keymaps/kelorean/keymap.c +++ b/keyboards/s65_x/keymaps/kelorean/keymap.c @@ -30,7 +30,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - /* 1: Colemak layer * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ @@ -89,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - + /* 3: Locking arrow keys to WASD*/ [_AL] = ANSI_KEYMAP( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -138,9 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - - }; const uint16_t PROGMEM fn_actions[] = { @@ -152,4 +148,3 @@ const uint16_t PROGMEM fn_actions[] = { [5] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay }; - diff --git a/keyboards/s65_x/keymaps/kelorean/readme.md b/keyboards/s65_x/keymaps/kelorean/readme.md index be33069e4..ca08cb4c4 100644 --- a/keyboards/s65_x/keymaps/kelorean/readme.md +++ b/keyboards/s65_x/keymaps/kelorean/readme.md @@ -14,7 +14,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.1: Colemak layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ @@ -27,7 +26,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.2: Dvorak layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ @@ -40,7 +38,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.3 Arrow layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ @@ -53,7 +50,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.4 Fn layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ @@ -66,7 +62,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.5 Underglow layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ @@ -78,4 +73,4 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ \ No newline at end of file From f26e6fca8a14471aef9a88cac4ec71487a2bbe50 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Wed, 7 Feb 2018 04:05:15 +0000 Subject: [PATCH 123/556] convert to unix line-endings [skip ci] --- keyboards/s65_x/keymaps/kelorean/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/s65_x/keymaps/kelorean/readme.md b/keyboards/s65_x/keymaps/kelorean/readme.md index ca08cb4c4..12e39eae6 100644 --- a/keyboards/s65_x/keymaps/kelorean/readme.md +++ b/keyboards/s65_x/keymaps/kelorean/readme.md @@ -1,4 +1,4 @@ -### 1 ANSI +### 1 ANSI A Mac ANSI layout that assumes standard sized shifts, enter, and backspace keys, Arrow layer, FN layers and Lighting functions layer... I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. From 9cfcd494064439b0c8b31bc45969b0487ec6e81a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 6 Feb 2018 20:21:03 -0800 Subject: [PATCH 124/556] Re-add Flip Installer (#2355) * Re-add Flip Installer Found the update URL for it. http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip * Comment out JRE installer version --- util/win_shared_install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh index 27539c5b5..f24ec08e8 100644 --- a/util/win_shared_install.sh +++ b/util/win_shared_install.sh @@ -19,9 +19,11 @@ function install_utils { unzip teensy_loader_cli_windows.zip # This URL has changed and I can't find the new location. Commenting out until we figure out the new URL or determine this isn't needed. -skullY - #echo "Installing Atmel Flip" - #wget 'http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe' - #mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe + echo "Installing Atmel Flip" + wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/Flip%20Installer%20-%203.4.7.112.exe' + # This is the JRE-less installer, if we need the larger bundled with JRE installer, use this: + #wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/JRE%20-%20Flip%20Installer%20-%203.4.7.112.exe' + mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe echo "Downloading the QMK driver installer" wget -qO- https://api.github.com/repos/qmk/qmk_driver_installer/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4 | wget -i - From ad01e3c03a5213a46d5e6bd14cbb3c3231f68c78 Mon Sep 17 00:00:00 2001 From: Legonut Date: Tue, 6 Feb 2018 23:44:10 -0500 Subject: [PATCH 125/556] New keyboard added "Zen" (#2347) * New keyboard added Zen is a split ortholinear currently in group buy. * remove bad keymap Keymap was throwing errors * remove other bad keymap I should have checked these before haha * small fix to update folder name * renamed temp * renamed to zen * update folder name * Slim down matrix code Suggested by drashna * move KC_NO * Update keymap * change from rev2 to rev1 --- keyboards/zen/config.h | 29 ++ keyboards/zen/keymaps/default/config.h | 41 +++ keyboards/zen/keymaps/default/keymap.c | 103 ++++++ keyboards/zen/keymaps/default/rules.mk | 6 + keyboards/zen/matrix.c | 466 +++++++++++++++++++++++++ keyboards/zen/readme.md | 12 + keyboards/zen/rev1/config.h | 91 +++++ keyboards/zen/rev1/rev1.c | 22 ++ keyboards/zen/rev1/rev1.h | 40 +++ keyboards/zen/rev1/rules.mk | 2 + keyboards/zen/rules.mk | 73 ++++ keyboards/zen/serial.c | 228 ++++++++++++ keyboards/zen/serial.h | 26 ++ keyboards/zen/split_rgb.c | 41 +++ keyboards/zen/split_rgb.h | 6 + keyboards/zen/split_util.c | 86 +++++ keyboards/zen/split_util.h | 20 ++ keyboards/zen/zen.c | 1 + keyboards/zen/zen.h | 23 ++ 19 files changed, 1316 insertions(+) create mode 100644 keyboards/zen/config.h create mode 100644 keyboards/zen/keymaps/default/config.h create mode 100644 keyboards/zen/keymaps/default/keymap.c create mode 100644 keyboards/zen/keymaps/default/rules.mk create mode 100644 keyboards/zen/matrix.c create mode 100644 keyboards/zen/readme.md create mode 100644 keyboards/zen/rev1/config.h create mode 100644 keyboards/zen/rev1/rev1.c create mode 100644 keyboards/zen/rev1/rev1.h create mode 100644 keyboards/zen/rev1/rules.mk create mode 100644 keyboards/zen/rules.mk create mode 100644 keyboards/zen/serial.c create mode 100644 keyboards/zen/serial.h create mode 100644 keyboards/zen/split_rgb.c create mode 100644 keyboards/zen/split_rgb.h create mode 100644 keyboards/zen/split_util.c create mode 100644 keyboards/zen/split_util.h create mode 100644 keyboards/zen/zen.c create mode 100644 keyboards/zen/zen.h diff --git a/keyboards/zen/config.h b/keyboards/zen/config.h new file mode 100644 index 000000000..f8f8bbf33 --- /dev/null +++ b/keyboards/zen/config.h @@ -0,0 +1,29 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#endif // CONFIG_H + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 + +#define TAPPING_TERM 100 \ No newline at end of file diff --git a/keyboards/zen/keymaps/default/config.h b/keyboards/zen/keymaps/default/config.h new file mode 100644 index 000000000..38e4d73f0 --- /dev/null +++ b/keyboards/zen/keymaps/default/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/zen/keymaps/default/keymap.c b/keyboards/zen/keymaps/default/keymap.c new file mode 100644 index 000000000..a955e892f --- /dev/null +++ b/keyboards/zen/keymaps/default/keymap.c @@ -0,0 +1,103 @@ +#include "zen.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _NAV 2 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + NAV, + +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter|Space | NAV | - | = | PGUP | PGDN | + * `------------------------------------------------''-----------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_NAV, KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, KC_PGUP, KC_PGDN \ +), + +/* NAV + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI| | | | | Left | Down | Right|Delete| End | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | NKRO | | | Pause| Back | Next | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBMOD| | | || | | | | Mute | VOLUP| VOLDN| + * `------------------------------------------------''-----------------------------------------------' + */ +[_NAV] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , \ + KC_TRNS, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME , \ + KC_TRNS, RGB_HUD, RGB_VAD, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END , \ + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MAGIC_TOGGLE_NKRO, KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT , \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLU, KC_VOLD \ +), + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + //case COLEMAK: + //if (record->event.pressed) { + //#ifdef AUDIO_ENABLE + //PLAY_NOTE_ARRAY(tone_colemak, false, 0); + //#endif + //persistant_default_layer_set(1UL<<_COLEMAK); + //} + //return false; + //break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/zen/keymaps/default/rules.mk b/keyboards/zen/keymaps/default/rules.mk new file mode 100644 index 000000000..22b6ec476 --- /dev/null +++ b/keyboards/zen/keymaps/default/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/zen/matrix.c b/keyboards/zen/matrix.c new file mode 100644 index 000000000..12f22214e --- /dev/null +++ b/keyboards/zen/matrix.c @@ -0,0 +1,466 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" +#include "timer.h" +#include "backlight.h" + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#if (DEBOUNCING_DELAY > 0) + static uint16_t debouncing_time; + static bool debouncing = false; +#endif + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#else +# error "Currently only supports 8 COLS" +#endif +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#define ERROR_DISCONNECT_COUNT 5 + +#define SERIAL_LED_ADDR 0x00 + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#if (DIODE_DIRECTION == COL2ROW) + static void init_cols(void); + static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); + static void unselect_rows(void); + static void select_row(uint8_t row); + static void unselect_row(uint8_t row); +#elif (DIODE_DIRECTION == ROW2COL) + static void init_rows(void); + static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); + static void unselect_cols(void); + static void unselect_col(uint8_t col); + static void select_col(uint8_t col); +#endif + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + +} + +uint8_t _matrix_scan(void) +{ + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); +#if (DIODE_DIRECTION == COL2ROW) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + PORTD ^= (1 << 2); + } + +# else + read_cols_on_row(matrix+offset, current_row); +# endif + + } + +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix+offset, current_col); +# endif + + } +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + debouncing = false; + } +# endif + + return 1; +} + +#ifdef USE_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + +#ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); +#endif + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + uint8_t ret = _matrix_scan(); + +#ifdef USE_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } + +#ifdef BACKLIGHT_ENABLE + // Read backlight level sent from master and update level on slave + backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); +#endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) +{ + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // Select the col pin to read (active low) + uint8_t pin = col_pins[col_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +static void select_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void init_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) +{ + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) + { + + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + else + { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) + { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +static void select_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_cols(void) +{ + for(uint8_t x = 0; x < MATRIX_COLS; x++) { + uint8_t pin = col_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#endif diff --git a/keyboards/zen/readme.md b/keyboards/zen/readme.md new file mode 100644 index 000000000..36c63d293 --- /dev/null +++ b/keyboards/zen/readme.md @@ -0,0 +1,12 @@ +Zen Keyboard +==== + +A split ergo keyboard with a few goals in mind: + - Be as thin as possible. Other split KBs (Let's Split, Nyquist, Iris) are 15.2mm thick. The Zen is only 8.0mm thick. + - Layout designed for gaming. 1.5u pinky keys, ortho alphas, and angled thumb keys. After trying Ortholiniear, Atreus62, and Ergodox, this is the best layout for gaming and typing. + - RGB backlighting. 16 WS2812b LEDs shine through the perimeter switches. The SK6812 variant are cheap and easy to solder. + - Price. Using Arduino Pro Micro, SK6812 LEDs, and PCB FR4 for the case, the cost of each half without switches or caps can be reduced to under $20 when purchased at volume. + +A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://legonut.gitbooks.io/zen-keyboard/content/) + +Maintained by u/legonut3 \ No newline at end of file diff --git a/keyboards/zen/rev1/config.h b/keyboards/zen/rev1/config.h new file mode 100644 index 000000000..efae55892 --- /dev/null +++ b/keyboards/zen/rev1/config.h @@ -0,0 +1,91 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0200 +#define MANUFACTURER Legonut +#define PRODUCT Project Zen +#define DESCRIPTION Split gaming keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { B2, B3, B1, F7, F6, D4, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define BACKLIGHT_PIN F4 +#define BACKLIGHT_LEVELS 5 + + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 16 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/zen/rev1/rev1.c b/keyboards/zen/rev1/rev1.c new file mode 100644 index 000000000..5f4cd32f6 --- /dev/null +++ b/keyboards/zen/rev1/rev1.c @@ -0,0 +1,22 @@ +#include "rev1.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/zen/rev1/rev1.h b/keyboards/zen/rev1/rev1.h new file mode 100644 index 000000000..4983bb2a3 --- /dev/null +++ b/keyboards/zen/rev1/rev1.h @@ -0,0 +1,40 @@ +#ifndef REV1_H +#define REV1_H + +#include "zen.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ + k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ + k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ + k30, k31, k32, k33, k34, k35, k85, k84, k83, k82, k81, k80, \ + k40, k41, k42, k43, k44, k45, k46, k96, k95, k94, k93, k92, k91, k90 \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46 }, \ + { k50, k51, k52, k53, k54, k55, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, KC_NO }, \ + { k70, k71, k72, k73, k74, k75, KC_NO }, \ + { k80, k81, k82, k83, k84, k85, KC_NO }, \ + { k90, k91, k92, k93, k94, k95, k96 } \ + } + +#endif diff --git a/keyboards/zen/rev1/rules.mk b/keyboards/zen/rev1/rules.mk new file mode 100644 index 000000000..d7463419b --- /dev/null +++ b/keyboards/zen/rev1/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/keyboards/zen/rules.mk b/keyboards/zen/rules.mk new file mode 100644 index 000000000..32d3dc51c --- /dev/null +++ b/keyboards/zen/rules.mk @@ -0,0 +1,73 @@ +SRC += matrix.c \ + split_util.c \ + serial.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # 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 = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SUBPROJECT_rev1 = yes +USE_I2C = no +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = zen/rev1 diff --git a/keyboards/zen/serial.c b/keyboards/zen/serial.c new file mode 100644 index 000000000..74bcbb6bf --- /dev/null +++ b/keyboards/zen/serial.c @@ -0,0 +1,228 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifndef USE_I2C + +// Serial pulse period in microseconds. Its probably a bad idea to lower this +// value. +#define SERIAL_DELAY 24 + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input(); + + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +} + +// Used by the master to synchronize timing with the slave. +static +void sync_recv(void) { + serial_input(); + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); + serial_delay(); +} + +// Used by the slave to send a synchronization signal to the master. +static +void sync_send(void) { + serial_output(); + + serial_low(); + serial_delay(); + + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + serial_input(); + for ( uint8_t i = 0; i < 8; ++i) { + byte = (byte << 1) | serial_read_pin(); + serial_delay(); + _delay_us(1); + } + + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 8; + serial_output(); + while( b-- ) { + if(data & (1 << b)) { + serial_high(); + } else { + serial_low(); + } + serial_delay(); + } +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + sync_send(); + + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_slave_buffer[i]); + sync_send(); + checksum += serial_slave_buffer[i]; + } + serial_write_byte(checksum); + sync_send(); + + // wait for the sync to finish sending + serial_delay(); + + // read the middle of pulses + _delay_us(SERIAL_DELAY/2); + + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_master_buffer[i] = serial_read_byte(); + sync_send(); + checksum_computed += serial_master_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_send(); + + serial_input(); // end transaction + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(1); + + // wait for the slaves response + serial_input(); + serial_high(); + _delay_us(SERIAL_DELAY); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + sei(); + return 1; + } + + // if the slave is present syncronize with it + sync_recv(); + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_slave_buffer[i] = serial_read_byte(); + sync_recv(); + checksum_computed += serial_slave_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_recv(); + + if (checksum_computed != checksum_received) { + sei(); + return 1; + } + + uint8_t checksum = 0; + // send data to the slave + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_master_buffer[i]); + sync_recv(); + checksum += serial_master_buffer[i]; + } + serial_write_byte(checksum); + sync_recv(); + + // always, release the line when not in use + serial_output(); + serial_high(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/zen/serial.h b/keyboards/zen/serial.h new file mode 100644 index 000000000..15fe4db7b --- /dev/null +++ b/keyboards/zen/serial.h @@ -0,0 +1,26 @@ +#ifndef MY_SERIAL_H +#define MY_SERIAL_H + +#include "config.h" +#include + +/* TODO: some defines for interrupt setup */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD0) +#define SERIAL_PIN_INTERRUPT INT0_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif diff --git a/keyboards/zen/split_rgb.c b/keyboards/zen/split_rgb.c new file mode 100644 index 000000000..6d7cb44cf --- /dev/null +++ b/keyboards/zen/split_rgb.c @@ -0,0 +1,41 @@ +#include +#include +#include "split_util.h" +#include "progmem.h" +#include "print.h" +#include "rgblight.h" + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + + +rgblight_config_t rgblight_config; + +void rgblight_slave_update(void) { + //rgblight_effect_christmas(); +} + + +void rgblight_set(void) { + if (rgblight_config.enable) { + #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; + } + #ifdef RGBW + ws2812_setleds_rgbw(led, RGBLED_NUM); + #else + ws2812_setleds(led, RGBLED_NUM); + #endif + } +} diff --git a/keyboards/zen/split_rgb.h b/keyboards/zen/split_rgb.h new file mode 100644 index 000000000..5f552890a --- /dev/null +++ b/keyboards/zen/split_rgb.h @@ -0,0 +1,6 @@ +#ifndef SPLIT_RGB_H +#define SPLIT_RGB_H + +void rgblight_slave_update(void); + +#endif diff --git a/keyboards/zen/split_util.c b/keyboards/zen/split_util.c new file mode 100644 index 000000000..346cbc908 --- /dev/null +++ b/keyboards/zen/split_util.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" +#include "timer.h" + +#ifdef USE_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { +#ifdef USE_I2C + i2c_master_init(); +#ifdef SSD1306OLED + matrix_master_OLED_init (); +#endif +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + timer_init(); +#ifdef USE_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); +void keyboard_slave_loop(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/zen/zen.c b/keyboards/zen/zen.c new file mode 100644 index 000000000..22131ef5c --- /dev/null +++ b/keyboards/zen/zen.c @@ -0,0 +1 @@ +#include "zen.h" diff --git a/keyboards/zen/zen.h b/keyboards/zen/zen.h new file mode 100644 index 000000000..4560ff8cd --- /dev/null +++ b/keyboards/zen/zen.h @@ -0,0 +1,23 @@ +#ifndef ZEN_H +#define ZEN_H + +#include "rev1.h" +#include "quantum.h" + +// Used to create a keymap using only KC_ prefixed keys +#define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R01, R02, R03, R04, R05, R06,\ + L10, L11, L12, L13, L14, L15, R11, R12, R13, R14, R15, R16,\ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26,\ + L30, L31, L32, L33, L34, L35, R31, R32, R33, R34, R35, R36,\ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46, \ + ) + +#endif \ No newline at end of file From 6a9617b1c6fc298397e3bf9aef61cd0de55e36c8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Jan 2018 18:12:38 +0200 Subject: [PATCH 126/556] Update ChibiOS to 17.6.3 --- lib/chibios | 2 +- tmk_core/protocol/chibios/usb_main.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/chibios b/lib/chibios index 8fce03b3a..e26cb16a7 160000 --- a/lib/chibios +++ b/lib/chibios @@ -1 +1 @@ -Subproject commit 8fce03b3a75c743e5d5c40b9d59c1637c59d22a7 +Subproject commit e26cb16a7296a196d7c74eae22cbee00989cb7b6 diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 9bfdf572a..6173d3ad1 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -778,10 +778,6 @@ static const USBEndpointConfig nkro_ep_config = { * TODO: maybe disable some things when connection is lost? */ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { switch(event) { - case USB_EVENT_RESET: - //TODO: from ISR! print("[R]"); - return; - case USB_EVENT_ADDRESS: return; @@ -804,12 +800,15 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { #endif /* NKRO_ENABLE */ osalSysUnlockFromISR(); return; - case USB_EVENT_SUSPEND: //TODO: from ISR! print("[S]"); #ifdef SLEEP_LED_ENABLE sleep_led_enable(); #endif /* SLEEP_LED_ENABLE */ + /* Falls into.*/ + case USB_EVENT_UNCONFIGURED: + /* Falls into.*/ + case USB_EVENT_RESET: return; case USB_EVENT_WAKEUP: @@ -1032,7 +1031,7 @@ void init_usb_driver(USBDriver *usbp) { chVTObjectInit(&keyboard_idle_timer); #ifdef CONSOLE_ENABLE - obqObjectInit(&console_buf_queue, console_queue_buffer, CONSOLE_EPSIZE, CONSOLE_QUEUE_CAPACITY, console_queue_onotify, (void*)usbp); + obqObjectInit(&console_buf_queue, false, console_queue_buffer, CONSOLE_EPSIZE, CONSOLE_QUEUE_CAPACITY, console_queue_onotify, (void*)usbp); chVTObjectInit(&console_flush_timer); #endif } From 30e413f9855a1ace8ea80505df1476de07e8ce39 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Feb 2018 12:43:22 +0200 Subject: [PATCH 127/556] Update Chibios Contrib with 17.6.3 support --- lib/chibios-contrib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chibios-contrib b/lib/chibios-contrib index cc401cf01..432bc1762 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit cc401cf0175d6ff4fe62acc8efbaa416013b544e +Subproject commit 432bc1762f17eb7b506e8fbca8ec30a3d61629b8 From 30b90de7c9d4edbbaf55e11264d30bda1f82cfde Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Feb 2018 12:55:56 +0200 Subject: [PATCH 128/556] Send usb wakeup through ChibiOS --- tmk_core/protocol/chibios/main.c | 4 ++-- tmk_core/protocol/chibios/usb_main.c | 21 --------------------- tmk_core/protocol/chibios/usb_main.h | 3 --- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 7138b5535..47a7eb09a 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -165,8 +165,8 @@ int main(void) { #endif suspend_power_down(); // on AVR this deep sleeps for 15ms /* Remote wakeup */ - if((USB_DRIVER.status & 2) && suspend_wakeup_condition()) { - send_remote_wakeup(&USB_DRIVER); + if(suspend_wakeup_condition()) { + usbWakeupHost(&USB_DRIVER); } } /* Woken up */ diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 6173d3ad1..caa2770b5 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -1036,27 +1036,6 @@ void init_usb_driver(USBDriver *usbp) { #endif } -/* - * Send remote wakeup packet - * Note: should not be called from ISR - */ -void send_remote_wakeup(USBDriver *usbp) { - (void)usbp; -#if defined(K20x) || defined(KL2x) -#if KINETIS_USB_USE_USB0 - USB0->CTL |= USBx_CTL_RESUME; - wait_ms(15); - USB0->CTL &= ~USBx_CTL_RESUME; -#endif /* KINETIS_USB_USE_USB0 */ -#elif defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) /* End K20x || KL2x */ - STM32_USB->CNTR |= CNTR_RESUME; - wait_ms(15); - STM32_USB->CNTR &= ~CNTR_RESUME; -#else /* End STM32F0XX || STM32F1XX || STM32F3XX */ -#warning Sending remote wakeup packet not implemented for your platform. -#endif -} - /* --------------------------------------------------------- * Keyboard functions * --------------------------------------------------------- diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index 30d8fcaef..b4f894f2f 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -36,9 +36,6 @@ /* Initialize the USB driver and bus */ void init_usb_driver(USBDriver *usbp); -/* Send remote wakeup packet */ -void send_remote_wakeup(USBDriver *usbp); - /* --------------- * Keyboard header * --------------- From 8afbd649f068b3b85146b61429a4bee1787c092a Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 8 Feb 2018 10:09:53 -0500 Subject: [PATCH 129/556] Replace Right key on base layer with RShift, convert adjust to KC_KEYMAP format --- keyboards/iris/keymaps/default/keymap.c | 35 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/keyboards/iris/keymaps/default/keymap.c b/keyboards/iris/keymaps/default/keymap.c index 4d9577c5d..24ef99d20 100644 --- a/keyboards/iris/keymaps/default/keymap.c +++ b/keyboards/iris/keymaps/default/keymap.c @@ -23,6 +23,15 @@ enum custom_keycodes { #define KC_RASE RAISE #define KC_RST RESET #define KC_BL_S BL_STEP +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -34,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----| |----+----+----+----+----+----| RASE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,SPC , ENT , N , M ,COMM,DOT ,SLSH,RGHT, + LSFT, Z , X , C , V , B ,SPC , ENT , N , M ,COMM,DOT ,SLSH,RSFT, //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' LCTL,LOWR,SPC , ENT ,LGUI,LALT // `----+----+----' `----+----+----' @@ -68,18 +77,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // `----+----+----' `----+----+----' ), - [_ADJUST] = KEYMAP( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - BL_STEP, RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' + [_ADJUST] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,DBUG,RHUD,RSAD,RVAD, , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S,RST , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' ) }; From 57dde3ddba5de982b9d70787e977a737c67b9db1 Mon Sep 17 00:00:00 2001 From: Niles Christensen Date: Sun, 28 Jan 2018 15:24:43 -0500 Subject: [PATCH 130/556] Makes layers consistent with comments --- keyboards/viterbi/keymaps/default/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/viterbi/keymaps/default/keymap.c b/keyboards/viterbi/keymaps/default/keymap.c index b5215f929..f4f4c932d 100644 --- a/keyboards/viterbi/keymaps/default/keymap.c +++ b/keyboards/viterbi/keymaps/default/keymap.c @@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| UNDS, ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,LCBR,RCBR, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,PLUS,LCBR,RCBR, , , + PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR, , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , F7 , F8 , F9 ,F10 ,F11 , F12 , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| UNDS, , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,LCBR,RCBR, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,PLUS,LBRC,RBRC, , , + PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC, , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| From 7d79412f9989d71e9c0514958bc39d1cc1649521 Mon Sep 17 00:00:00 2001 From: jetpacktuxedo Date: Thu, 8 Feb 2018 08:55:51 -0800 Subject: [PATCH 131/556] Fixed my minivan F-keys --- keyboards/tv44/keymaps/jetpacktuxedo/keymap.c | 2 +- keyboards/tv44/keymaps/jetpacktuxedo/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c b/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c index f10cd6222..f7c64cfb3 100644 --- a/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [3] = KEYMAP_ARROW_COMMAND( /* LAYER 3 */ KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, 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 ), diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/readme.md b/keyboards/tv44/keymaps/jetpacktuxedo/readme.md index 937d3b4b1..fd95b56ab 100644 --- a/keyboards/tv44/keymaps/jetpacktuxedo/readme.md +++ b/keyboards/tv44/keymaps/jetpacktuxedo/readme.md @@ -34,7 +34,7 @@ I don't want to be using two key combos constantly, so I also added this symbol I very rarely use Fkeys, but figured I'd throw them on anyway just in case. The setup basically mimics the way Fkeys are usually done on a 60%, with F11 and F12 still on - and =, even though the location of those keys has moved. ``` | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 |F10 | | -| | | | | | | | | |F11 |F12 | | +| | | | | | | | |F11 |F12 | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` From 63c16f4b632a2a82a775f51a3ad0cc690cca1fc9 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 8 Feb 2018 14:39:40 -0500 Subject: [PATCH 132/556] ARM audio fixes, stack size increase (#2365) * fix up arm audio implementation * chibios stack size inc * get one channel working * update for chibios --- quantum/audio/audio_arm.c | 280 +++++++++++++++++++++++++++++++------- tmk_core/chibios.mk | 2 +- 2 files changed, 231 insertions(+), 51 deletions(-) diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c index 43c8d67c4..247dc337d 100644 --- a/quantum/audio/audio_arm.c +++ b/quantum/audio/audio_arm.c @@ -77,23 +77,48 @@ bool glissando = true; #endif float startup_song[][2] = STARTUP_SONG; -static void gpt_cb6(GPTDriver *gptp); -static void gpt_cb7(GPTDriver *gptp); static void gpt_cb8(GPTDriver *gptp); +#define DAC_BUFFER_SIZE 360 + +#define START_CHANNEL_1() gptStart(&GPTD6, &gpt6cfg1); \ + gptStartContinuous(&GPTD6, 2U) +#define START_CHANNEL_2() gptStart(&GPTD7, &gpt7cfg1); \ + gptStartContinuous(&GPTD7, 2U) +#define STOP_CHANNEL_1() gptStopTimer(&GPTD6) +#define STOP_CHANNEL_2() gptStopTimer(&GPTD7) +#define RESTART_CHANNEL_1() STOP_CHANNEL_1(); \ + START_CHANNEL_1() +#define RESTART_CHANNEL_2() STOP_CHANNEL_2(); \ + START_CHANNEL_2() +#define UPDATE_CHANNEL_1_FREQ(freq) gpt6cfg1.frequency = freq * DAC_BUFFER_SIZE; \ + RESTART_CHANNEL_1() +#define UPDATE_CHANNEL_2_FREQ(freq) gpt7cfg1.frequency = freq * DAC_BUFFER_SIZE; \ + RESTART_CHANNEL_2() +#define GET_CHANNEL_1_FREQ gpt6cfg1.frequency +#define GET_CHANNEL_2_FREQ gpt7cfg1.frequency + + /* * GPT6 configuration. */ +// static const GPTConfig gpt6cfg1 = { +// .frequency = 1000000U, +// .callback = NULL, +// .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */ +// .dier = 0U +// }; + GPTConfig gpt6cfg1 = { - .frequency = 440, - .callback = gpt_cb6, + .frequency = 440U*DAC_BUFFER_SIZE, + .callback = NULL, .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */ .dier = 0U }; GPTConfig gpt7cfg1 = { - .frequency = 440, - .callback = gpt_cb7, + .frequency = 440U*DAC_BUFFER_SIZE, + .callback = NULL, .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */ .dier = 0U }; @@ -105,15 +130,169 @@ GPTConfig gpt8cfg1 = { .dier = 0U }; -static void gpt_cb6(GPTDriver *gptp) { - palTogglePad(GPIOA, 4); + +/* + * DAC test buffer (sine wave). + */ +// static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { +// 2047, 2082, 2118, 2154, 2189, 2225, 2260, 2296, 2331, 2367, 2402, 2437, +// 2472, 2507, 2542, 2576, 2611, 2645, 2679, 2713, 2747, 2780, 2813, 2846, +// 2879, 2912, 2944, 2976, 3008, 3039, 3070, 3101, 3131, 3161, 3191, 3221, +// 3250, 3278, 3307, 3335, 3362, 3389, 3416, 3443, 3468, 3494, 3519, 3544, +// 3568, 3591, 3615, 3637, 3660, 3681, 3703, 3723, 3744, 3763, 3782, 3801, +// 3819, 3837, 3854, 3870, 3886, 3902, 3917, 3931, 3944, 3958, 3970, 3982, +// 3993, 4004, 4014, 4024, 4033, 4041, 4049, 4056, 4062, 4068, 4074, 4078, +// 4082, 4086, 4089, 4091, 4092, 4093, 4094, 4093, 4092, 4091, 4089, 4086, +// 4082, 4078, 4074, 4068, 4062, 4056, 4049, 4041, 4033, 4024, 4014, 4004, +// 3993, 3982, 3970, 3958, 3944, 3931, 3917, 3902, 3886, 3870, 3854, 3837, +// 3819, 3801, 3782, 3763, 3744, 3723, 3703, 3681, 3660, 3637, 3615, 3591, +// 3568, 3544, 3519, 3494, 3468, 3443, 3416, 3389, 3362, 3335, 3307, 3278, +// 3250, 3221, 3191, 3161, 3131, 3101, 3070, 3039, 3008, 2976, 2944, 2912, +// 2879, 2846, 2813, 2780, 2747, 2713, 2679, 2645, 2611, 2576, 2542, 2507, +// 2472, 2437, 2402, 2367, 2331, 2296, 2260, 2225, 2189, 2154, 2118, 2082, +// 2047, 2012, 1976, 1940, 1905, 1869, 1834, 1798, 1763, 1727, 1692, 1657, +// 1622, 1587, 1552, 1518, 1483, 1449, 1415, 1381, 1347, 1314, 1281, 1248, +// 1215, 1182, 1150, 1118, 1086, 1055, 1024, 993, 963, 933, 903, 873, +// 844, 816, 787, 759, 732, 705, 678, 651, 626, 600, 575, 550, +// 526, 503, 479, 457, 434, 413, 391, 371, 350, 331, 312, 293, +// 275, 257, 240, 224, 208, 192, 177, 163, 150, 136, 124, 112, +// 101, 90, 80, 70, 61, 53, 45, 38, 32, 26, 20, 16, +// 12, 8, 5, 3, 2, 1, 0, 1, 2, 3, 5, 8, +// 12, 16, 20, 26, 32, 38, 45, 53, 61, 70, 80, 90, +// 101, 112, 124, 136, 150, 163, 177, 192, 208, 224, 240, 257, +// 275, 293, 312, 331, 350, 371, 391, 413, 434, 457, 479, 503, +// 526, 550, 575, 600, 626, 651, 678, 705, 732, 759, 787, 816, +// 844, 873, 903, 933, 963, 993, 1024, 1055, 1086, 1118, 1150, 1182, +// 1215, 1248, 1281, 1314, 1347, 1381, 1415, 1449, 1483, 1518, 1552, 1587, +// 1622, 1657, 1692, 1727, 1763, 1798, 1834, 1869, 1905, 1940, 1976, 2012 +// }; + +// squarewave +static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +// squarewave +static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = { + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* + * DAC streaming callback. + */ +size_t nx = 0, ny = 0, nz = 0; +static void end_cb1(DACDriver *dacp, dacsample_t *buffer, size_t n) { + + (void)dacp; + + nz++; + if (dac_buffer == buffer) { + nx += n; + } + else { + ny += n; + } + + if ((nz % 1000) == 0) { + // palTogglePad(GPIOD, GPIOD_LED3); + } } +/* + * DAC error callback. + */ +static void error_cb1(DACDriver *dacp, dacerror_t err) { -static void gpt_cb7(GPTDriver *gptp) { - palTogglePad(GPIOA, 5); + (void)dacp; + (void)err; + + chSysHalt("DAC failure"); } +static const DACConfig dac1cfg1 = { + .init = 2047U, + .datamode = DAC_DHRM_12BIT_RIGHT +}; + +static const DACConversionGroup dacgrpcfg1 = { + .num_channels = 1U, + .end_cb = end_cb1, + .error_cb = error_cb1, + .trigger = DAC_TRG(0) +}; + +static const DACConfig dac1cfg2 = { + .init = 2047U, + .datamode = DAC_DHRM_12BIT_RIGHT +}; + +static const DACConversionGroup dacgrpcfg2 = { + .num_channels = 1U, + .end_cb = end_cb1, + .error_cb = error_cb1, + .trigger = DAC_TRG(0) +}; + void audio_init() { @@ -128,8 +307,30 @@ void audio_init() // audio_config.raw = eeconfig_read_audio(); audio_config.enable = true; - palSetPadMode(GPIOA, 4, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOA, 5, PAL_MODE_OUTPUT_PUSHPULL); + /* + * Starting DAC1 driver, setting up the output pin as analog as suggested + * by the Reference Manual. + */ + palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG); + palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG); + dacStart(&DACD1, &dac1cfg1); + dacStart(&DACD2, &dac1cfg2); + + /* + * Starting GPT6 driver, it is used for triggering the DAC. + */ + START_CHANNEL_1(); + START_CHANNEL_2(); + + /* + * Starting a continuous conversion. + */ + dacStartConversion(&DACD1, &dacgrpcfg1, + (dacsample_t *)dac_buffer, DAC_BUFFER_SIZE); + dacStartConversion(&DACD2, &dacgrpcfg2, + (dacsample_t *)dac_buffer_2, DAC_BUFFER_SIZE); + // gptStartContinuous(&GPTD6, 2U); + audio_initialized = true; @@ -193,8 +394,8 @@ void stop_note(float freq) voice_place = 0; } if (voices == 0) { - gptStopTimer(&GPTD6); - gptStopTimer(&GPTD7); + STOP_CHANNEL_1(); + STOP_CHANNEL_2(); gptStopTimer(&GPTD8); frequency = 0; frequency_alt = 0; @@ -224,20 +425,6 @@ float vibrato(float average_freq) { #endif -static void restart_gpt6(void) { - // gptStopTimer(&GPTD6); - - gptStart(&GPTD6, &gpt6cfg1); - gptStartContinuous(&GPTD6, 2U); -} - -static void restart_gpt7(void) { - // gptStopTimer(&GPTD7); - - gptStart(&GPTD7, &gpt7cfg1); - gptStartContinuous(&GPTD7, 2U); -} - static void gpt_cb8(GPTDriver *gptp) { float freq; @@ -280,13 +467,10 @@ static void gpt_cb8(GPTDriver *gptp) { freq_alt = 30.52; } - if (gpt6cfg1.frequency != (uint16_t)freq_alt) { - gpt6cfg1.frequency = freq_alt; - restart_gpt6(); + if (GET_CHANNEL_2_FREQ != (uint16_t)freq_alt) { + UPDATE_CHANNEL_2_FREQ(freq_alt); } //note_timbre; - } else { - // gptStopTimer(&GPTD6); } if (polyphony_rate > 0) { @@ -342,13 +526,10 @@ static void gpt_cb8(GPTDriver *gptp) { } - if (gpt7cfg1.frequency != (uint16_t)freq) { - gpt7cfg1.frequency = freq; - restart_gpt7(); + if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { + UPDATE_CHANNEL_1_FREQ(freq); } //note_timbre; - } else { - // gptStopTimer(&GPTD7); } } @@ -370,11 +551,9 @@ static void gpt_cb8(GPTDriver *gptp) { freq = voice_envelope(freq); - if (gpt6cfg1.frequency != (uint16_t)freq) { - gpt6cfg1.frequency = freq; - restart_gpt6(); - gpt7cfg1.frequency = freq; - restart_gpt7(); + if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { + UPDATE_CHANNEL_1_FREQ(freq); + UPDATE_CHANNEL_2_FREQ(freq); } //note_timbre; } else { @@ -384,8 +563,8 @@ static void gpt_cb8(GPTDriver *gptp) { note_position++; bool end_of_note = false; - if (gpt6cfg1.frequency > 0) { - if (!note_resting) + if (GET_CHANNEL_1_FREQ > 0) { + if (!note_resting) end_of_note = (note_position >= (note_length*16 - 1)); else end_of_note = (note_position >= (note_length*16)); @@ -399,8 +578,8 @@ static void gpt_cb8(GPTDriver *gptp) { if (notes_repeat) { current_note = 0; } else { - gptStopTimer(&GPTD6); - gptStopTimer(&GPTD7); + STOP_CHANNEL_1(); + STOP_CHANNEL_2(); // gptStopTimer(&GPTD8); playing_notes = false; return; @@ -459,7 +638,8 @@ void play_note(float freq, int vol) { gptStart(&GPTD8, &gpt8cfg1); gptStartContinuous(&GPTD8, 2U); - + RESTART_CHANNEL_1(); + RESTART_CHANNEL_2(); } } @@ -492,8 +672,8 @@ void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat) gptStart(&GPTD8, &gpt8cfg1); gptStartContinuous(&GPTD8, 2U); - restart_gpt6(); - restart_gpt7(); + RESTART_CHANNEL_1(); + RESTART_CHANNEL_2(); } } diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index df9fa8498..1cd0146fe 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -6,7 +6,7 @@ # Stack size to be allocated to the Cortex-M process stack. This stack is # the stack used by the main() thread. ifeq ($(USE_PROCESS_STACKSIZE),) - USE_PROCESS_STACKSIZE = 0x200 + USE_PROCESS_STACKSIZE = 0x800 endif # Stack size to the allocated to the Cortex-M main/exceptions stack. This From 53ff8a31b61952d9675558149d927f7942071df9 Mon Sep 17 00:00:00 2001 From: fredizzimo Date: Thu, 8 Feb 2018 22:07:46 +0200 Subject: [PATCH 133/556] Merge ChibiOS and LUFA descriptor support (#2362) * Move lufa descriptor to protocol/usb_descriptor * Try to compile usb_descriptor on ChibiOS * Add lufa_utils for ChibiOS Lufa USB descriptors for ChibiOS * More lufa_util compatibility fixes * First compiling version of shared USB descriptor * Send the usb descriptors * Fix the CONSOLE output on ChibiOS * Add errors for unsupported interfaces * Enable support for vitual serial port USB descriptors * Implement virtual serial port for ChibiOS * Cleanup the lufa_utils Use the default lufa header files * Add raw hid support for ChibiOS This is completely untested * Enable midi compilation on ChibiOS * Move midi functionality out of lufa.c * Don't register sysex callback when not needed * ChibiOS compilation fixes * Update ChibiOS submodule * Fix the Midi USB descriptor It didn't work properly when both Midi and Virtual serial port was enabled. * Add MIDI support for ChibiOS * Fix USB descriptor strings on ChibiOS * Use serial usb driver for raw hid * Generalize the ChibiOS stream like drivers This makes the initialization much more simple and eliminates a lot of the code duplication. * Convert console output to chibios stream driver * Fixes for ChibiOS update * Update the ChibiOS contrib submodule To include the usb data toggle synchronization fixes * Fix duplicate reset enumeration on ChibiOS * Add missing include * Add number of endpoints check for ChibiOS * Enable serial USB driver on all keyboards * Add missing includes when API is enabled withot midi * Add another missing inlcude --- build_keyboard.mk | 7 +- keyboards/chibios_test/config.h | 8 +- .../chibios_test/stm32_f072_onekey/halconf.h | 2 +- .../chibios_test/stm32_f103_onekey/halconf.h | 2 +- .../chibios_test/teensy_lc_onekey/halconf.h | 2 +- keyboards/clueboard/60/config.h | 8 +- keyboards/ergodox_infinity/config.h | 8 +- keyboards/infinity60/config.h | 6 +- keyboards/infinity60/halconf.h | 2 +- keyboards/jm60/config.h | 8 +- keyboards/jm60/halconf.h | 2 +- keyboards/whitefox/config.h | 8 +- lib/chibios | 2 +- lib/chibios-contrib | 2 +- quantum/api/api_sysex.c | 1 + quantum/keymap.h | 3 + quantum/process_keycode/process_midi.c | 58 +- quantum/process_keycode/process_midi.h | 5 +- quantum/quantum.c | 8 + quantum/quantum.h | 1 - tmk_core/chibios.mk | 2 + tmk_core/common/host_driver.h | 5 - tmk_core/common/keyboard.c | 7 + tmk_core/common/report.h | 30 +- tmk_core/protocol/chibios.mk | 9 + .../chibios/lufa_utils/LUFA/Drivers/USB/USB.h | 42 + tmk_core/protocol/chibios/main.c | 27 + tmk_core/protocol/chibios/usb_main.c | 1047 +++++------------ tmk_core/protocol/chibios/usb_main.h | 34 - tmk_core/protocol/lufa.mk | 4 +- tmk_core/protocol/lufa/lufa.c | 338 +----- tmk_core/protocol/lufa/lufa.h | 10 +- tmk_core/protocol/midi.mk | 3 +- .../midi/bytequeue/interrupt_setting.c | 15 +- tmk_core/protocol/midi/qmk_midi.c | 184 +++ tmk_core/protocol/midi/qmk_midi.h | 9 + .../{lufa/descriptor.c => usb_descriptor.c} | 26 +- .../{lufa/descriptor.h => usb_descriptor.h} | 63 +- 38 files changed, 761 insertions(+), 1237 deletions(-) create mode 100644 tmk_core/protocol/chibios/lufa_utils/LUFA/Drivers/USB/USB.h create mode 100644 tmk_core/protocol/midi/qmk_midi.c create mode 100644 tmk_core/protocol/midi/qmk_midi.h rename tmk_core/protocol/{lufa/descriptor.c => usb_descriptor.c} (97%) rename tmk_core/protocol/{lufa/descriptor.h => usb_descriptor.h} (79%) diff --git a/build_keyboard.mk b/build_keyboard.mk index bee8fcc87..921159a5d 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -121,7 +121,6 @@ else endif ifeq ($(PLATFORM),CHIBIOS) - include $(TMK_PATH)/protocol/chibios.mk include $(TMK_PATH)/chibios.mk OPT_OS = chibios ifneq ("$(wildcard $(KEYBOARD_PATH_5)/bootloader_defs.h)","") @@ -197,7 +196,7 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","") KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) else ifneq ($(LAYOUTS),) include build_layout.mk -else +else $(error Could not find keymap) # this state should never be reached endif @@ -247,6 +246,10 @@ endif include $(TMK_PATH)/avr.mk endif +ifeq ($(PLATFORM),CHIBIOS) + include $(TMK_PATH)/protocol/chibios.mk +endif + ifeq ($(strip $(VISUALIZER_ENABLE)), yes) VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer diff --git a/keyboards/chibios_test/config.h b/keyboards/chibios_test/config.h index c32a77b37..89eb1f33b 100644 --- a/keyboards/chibios_test/config.h +++ b/keyboards/chibios_test/config.h @@ -24,11 +24,9 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 /* in python2: list(u"whatever".encode('utf-16-le')) */ /* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "QMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' -#define PRODUCT "ChibiOS QMK test" -#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00' -#define DESCRIPTION "QMK keyboard firmware test for ChibiOS" +#define MANUFACTURER QMK +#define PRODUCT ChibiOS QMK test +#define DESCRIPTION QMK keyboard firmware test for ChibiOS /* key matrix size */ #define MATRIX_ROWS 1 diff --git a/keyboards/chibios_test/stm32_f072_onekey/halconf.h b/keyboards/chibios_test/stm32_f072_onekey/halconf.h index 1a450d632..46b37a4f4 100644 --- a/keyboards/chibios_test/stm32_f072_onekey/halconf.h +++ b/keyboards/chibios_test/stm32_f072_onekey/halconf.h @@ -139,7 +139,7 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE +#define HAL_USE_SERIAL_USB TRUE #endif /** diff --git a/keyboards/chibios_test/stm32_f103_onekey/halconf.h b/keyboards/chibios_test/stm32_f103_onekey/halconf.h index 1a450d632..46b37a4f4 100644 --- a/keyboards/chibios_test/stm32_f103_onekey/halconf.h +++ b/keyboards/chibios_test/stm32_f103_onekey/halconf.h @@ -139,7 +139,7 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE +#define HAL_USE_SERIAL_USB TRUE #endif /** diff --git a/keyboards/chibios_test/teensy_lc_onekey/halconf.h b/keyboards/chibios_test/teensy_lc_onekey/halconf.h index 0436408b0..f7121f1a9 100644 --- a/keyboards/chibios_test/teensy_lc_onekey/halconf.h +++ b/keyboards/chibios_test/teensy_lc_onekey/halconf.h @@ -139,7 +139,7 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE +#define HAL_USE_SERIAL_USB TRUE #endif /** diff --git a/keyboards/clueboard/60/config.h b/keyboards/clueboard/60/config.h index 333698a08..5c5a86296 100644 --- a/keyboards/clueboard/60/config.h +++ b/keyboards/clueboard/60/config.h @@ -22,11 +22,9 @@ #define VENDOR_ID 0xC1ED #define PRODUCT_ID 0x2350 #define DEVICE_VER 0x0001 -#define MANUFACTURER "Clueboard" -#define USBSTR_MANUFACTURER 'C', '\x00', 'l', '\x00', 'u', '\x00', 'e', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00' -#define PRODUCT "Clueboard60" -#define USBSTR_PRODUCT 'C', '\x00', 'l', '\x00', 'u', '\x00', 'e', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', ' ', '\x00', '6', '\x00', '0', '\x00', '%', '\x00' -#define DESCRIPTION "Clueboard 60%" +#define MANUFACTURER Clueboard +#define PRODUCT Clueboard 60% +#define DESCRIPTION Clueboard 60% /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/ergodox_infinity/config.h b/keyboards/ergodox_infinity/config.h index 094761e0b..2f1be0d28 100644 --- a/keyboards/ergodox_infinity/config.h +++ b/keyboards/ergodox_infinity/config.h @@ -23,12 +23,8 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "TMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00' -#define PRODUCT "Infinity keyboard/TMK" -#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00' +#define MANUFACTURER Input Club +#define PRODUCT Ergodox Infinity (QMK) #define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_DELAY 0 diff --git a/keyboards/infinity60/config.h b/keyboards/infinity60/config.h index 83930901c..0a2f93e22 100644 --- a/keyboards/infinity60/config.h +++ b/keyboards/infinity60/config.h @@ -26,10 +26,8 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 /* in python2: list(u"whatever".encode('utf-16-le')) */ /* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "Input Club" -#define USBSTR_MANUFACTURER 'I', '\x00', 'n', '\x00', 'p', '\x00', 'u', '\x00', 't', '\x00', ' ', '\x00', 'C', '\x00', 'l', '\x00', 'u', '\x00', 'b', '\x00' -#define PRODUCT "Infinity keyboard/QMK" -#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00' +#define MANUFACTURER Input Club +#define PRODUCT Infinity 60% keyboard (QMK) /* key matrix size */ #define MATRIX_ROWS 9 #define MATRIX_COLS 7 diff --git a/keyboards/infinity60/halconf.h b/keyboards/infinity60/halconf.h index f89dfc2e1..b38031529 100644 --- a/keyboards/infinity60/halconf.h +++ b/keyboards/infinity60/halconf.h @@ -139,7 +139,7 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE +#define HAL_USE_SERIAL_USB TRUE #endif /** diff --git a/keyboards/jm60/config.h b/keyboards/jm60/config.h index 259641331..847cf2078 100644 --- a/keyboards/jm60/config.h +++ b/keyboards/jm60/config.h @@ -26,11 +26,9 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 /* in python2: list(u"whatever".encode('utf-16-le')) */ /* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "JMWS" -#define USBSTR_MANUFACTURER 'J', '\x00', 'M', '\x00', 'W', '\x00', 'S', '\x00' -#define PRODUCT "JM60 RGB Keyboard(QMK)" -#define USBSTR_PRODUCT 'J', '\x00', 'M', '\x00', '6', '\x00', '0', '\x00', ' ', '\x00', 'R', '\x00', 'G', '\x00', 'B', '\x00', ' ', '\x00', 'K', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '(', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00', ')', '\x00' -#define DESCRIPTION "QMK keyboard firmware for JM60 RGB Keyboard" +#define MANUFACTURER JMWS +#define PRODUCT JM60 RGB Keyboard(QMK) +#define DESCRIPTION QMK keyboard firmware for JM60 RGB Keyboard /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/jm60/halconf.h b/keyboards/jm60/halconf.h index 1a450d632..46b37a4f4 100644 --- a/keyboards/jm60/halconf.h +++ b/keyboards/jm60/halconf.h @@ -139,7 +139,7 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE +#define HAL_USE_SERIAL_USB TRUE #endif /** diff --git a/keyboards/whitefox/config.h b/keyboards/whitefox/config.h index dc33a7ce5..9397bd61f 100644 --- a/keyboards/whitefox/config.h +++ b/keyboards/whitefox/config.h @@ -26,10 +26,8 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 /* in python2: list(u"whatever".encode('utf-16-le')) */ /* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "Input Club" -#define USBSTR_MANUFACTURER 'I', '\x00', 'n', '\x00', 'p', '\x00', 'u', '\x00', 't', '\x00', ' ', '\x00', 'C', '\x00', 'l', '\x00', 'u', '\x00', 'b', '\x00' -#define PRODUCT "WhiteFox/QMK" -#define USBSTR_PRODUCT 'W', '\x00', 'h', '\x00', 'i', '\x00', 't', '\x00', 'e', '\x00', 'F', '\x00', 'o', '\x00', 'x', '\x00', ' ', '\x00' +#define MANUFACTURER Input Club +#define PRODUCT WhiteFox (QMK) /* key matrix size */ #define MATRIX_ROWS 9 @@ -81,4 +79,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#endif \ No newline at end of file +#endif diff --git a/lib/chibios b/lib/chibios index e26cb16a7..587968d6c 160000 --- a/lib/chibios +++ b/lib/chibios @@ -1 +1 @@ -Subproject commit e26cb16a7296a196d7c74eae22cbee00989cb7b6 +Subproject commit 587968d6cbc2b0e1c7147540872f2a67e59ca18b diff --git a/lib/chibios-contrib b/lib/chibios-contrib index 432bc1762..ede48346e 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit 432bc1762f17eb7b506e8fbca8ec30a3d61629b8 +Subproject commit ede48346eee4b8d6847c19bc01420bee76a5e486 diff --git a/quantum/api/api_sysex.c b/quantum/api/api_sysex.c index 6a2ee9012..89c66a2a2 100644 --- a/quantum/api/api_sysex.c +++ b/quantum/api/api_sysex.c @@ -16,6 +16,7 @@ #include "api_sysex.h" #include "sysex_tools.h" #include "print.h" +#include "qmk_midi.h" void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint16_t length) { // SEND_STRING("\nTX: "); diff --git a/quantum/keymap.h b/quantum/keymap.h index 5d64be19c..bfcb2f7cd 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -23,6 +23,9 @@ along with this program. If not, see . #include "action.h" #if defined(__AVR__) #include +#elif defined PROTOCOL_CHIBIOS +//We need to ensure that chibios is include before redefining reset +#include "ch.h" #endif #include "keycode.h" #include "action_macro.h" diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index 9184feaae..9728076df 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -16,11 +16,13 @@ #include "process_midi.h" #ifdef MIDI_ENABLE +#include #include "midi.h" +#include "qmk_midi.h" #ifdef MIDI_BASIC -void process_midi_basic_noteon(uint8_t note) +void process_midi_basic_noteon(uint8_t note) { midi_send_noteon(&midi_device, 0, note, 128); } @@ -46,6 +48,7 @@ static uint8_t tone_status[MIDI_TONE_COUNT]; static uint8_t midi_modulation; static int8_t midi_modulation_step; static uint16_t midi_modulation_timer; +midi_config_t midi_config; inline uint8_t compute_velocity(uint8_t setting) { @@ -70,30 +73,6 @@ void midi_init(void) midi_modulation_timer = 0; } -void midi_task(void) -{ - if (timer_elapsed(midi_modulation_timer) < midi_config.modulation_interval) - return; - midi_modulation_timer = timer_read(); - - if (midi_modulation_step != 0) - { - dprintf("midi modulation %d\n", midi_modulation); - midi_send_cc(&midi_device, midi_config.channel, 0x1, midi_modulation); - - if (midi_modulation_step < 0 && midi_modulation < -midi_modulation_step) { - midi_modulation = 0; - midi_modulation_step = 0; - return; - } - - midi_modulation += midi_modulation_step; - - if (midi_modulation > 127) - midi_modulation = 127; - } -} - uint8_t midi_compute_note(uint16_t keycode) { return 12 * midi_config.octave + (keycode - MIDI_TONE_MIN) + midi_config.transpose; @@ -250,4 +229,33 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) #endif // MIDI_ADVANCED +void midi_task(void) +{ + midi_device_process(&midi_device); +#ifdef MIDI_ADVANCED + if (timer_elapsed(midi_modulation_timer) < midi_config.modulation_interval) + return; + midi_modulation_timer = timer_read(); + + if (midi_modulation_step != 0) + { + dprintf("midi modulation %d\n", midi_modulation); + midi_send_cc(&midi_device, midi_config.channel, 0x1, midi_modulation); + + if (midi_modulation_step < 0 && midi_modulation < -midi_modulation_step) { + midi_modulation = 0; + midi_modulation_step = 0; + return; + } + + midi_modulation += midi_modulation_step; + + if (midi_modulation > 127) + midi_modulation = 127; + } +#endif +} + + + #endif // MIDI_ENABLE diff --git a/quantum/process_keycode/process_midi.h b/quantum/process_keycode/process_midi.h index ccac8981a..1968fbe3f 100644 --- a/quantum/process_keycode/process_midi.h +++ b/quantum/process_keycode/process_midi.h @@ -27,6 +27,8 @@ void process_midi_basic_noteoff(uint8_t note); void process_midi_all_notes_off(void); #endif +void midi_task(void); + #ifdef MIDI_ADVANCED typedef union { uint32_t raw; @@ -39,10 +41,9 @@ typedef union { }; } midi_config_t; -midi_config_t midi_config; +extern midi_config_t midi_config; void midi_init(void); -void midi_task(void); bool process_midi(uint16_t keycode, keyrecord_t *record); #define MIDI_INVALID_NOTE 0xFF diff --git a/quantum/quantum.c b/quantum/quantum.c index d3685f50b..bd95d5ea8 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -34,6 +34,14 @@ extern backlight_config_t backlight_config; #include "fauxclicky.h" #endif +#ifdef API_ENABLE +#include "api.h" +#endif + +#ifdef MIDI_ENABLE +#include "process_midi.h" +#endif + #ifdef AUDIO_ENABLE #ifndef GOODBYE_SONG #define GOODBYE_SONG SONG(GOODBYE_SOUND) diff --git a/quantum/quantum.h b/quantum/quantum.h index 6ca5ecb5c..b4c9e0b89 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -49,7 +49,6 @@ extern uint32_t default_layer_state; #endif #ifdef MIDI_ENABLE - #include #ifdef MIDI_ADVANCED #include "process_midi.h" #endif diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 1cd0146fe..7c7f658b2 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -149,6 +149,7 @@ COMPILEFLAGS += -falign-functions=16 COMPILEFLAGS += -ffunction-sections COMPILEFLAGS += -fdata-sections COMPILEFLAGS += -fno-common +COMPILEFLAGS += -fshort-wchar COMPILEFLAGS += $(THUMBFLAGS) CFLAGS += $(COMPILEFLAGS) @@ -159,6 +160,7 @@ CPPFLAGS += $(COMPILEFLAGS) CPPFLAGS += -fno-rtti LDFLAGS +=-Wl,--gc-sections +LDFLAGS +=-Wl,--no-wchar-size-warning LDFLAGS += -mno-thumb-interwork -mthumb LDSYMBOLS =,--defsym=__process_stack_size__=$(USE_PROCESS_STACKSIZE) LDSYMBOLS :=$(LDSYMBOLS),--defsym=__main_stack_size__=$(USE_EXCEPTIONS_STACKSIZE) diff --git a/tmk_core/common/host_driver.h b/tmk_core/common/host_driver.h index 588d1c0be..e40f0bfd6 100644 --- a/tmk_core/common/host_driver.h +++ b/tmk_core/common/host_driver.h @@ -30,11 +30,6 @@ typedef struct { void (*send_mouse)(report_mouse_t *); void (*send_system)(uint16_t); void (*send_consumer)(uint16_t); -#ifdef MIDI_ENABLE - void (*usb_send_func)(MidiDevice *, uint16_t, uint8_t, uint8_t, uint8_t); - void (*usb_get_midi)(MidiDevice *); - void (*midi_usb_init)(MidiDevice *); -#endif } host_driver_t; #endif diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 436fb6073..001fb00ce 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -66,6 +66,9 @@ along with this program. If not, see . #ifdef POINTING_DEVICE_ENABLE # include "pointing_device.h" #endif +#ifdef MIDI_ENABLE +# include "process_midi.h" +#endif #ifdef MATRIX_HAS_GHOST extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; @@ -260,6 +263,10 @@ MATRIX_LOOP_END: pointing_device_task(); #endif +#ifdef MIDI_ENABLE + midi_task(); +#endif + // update LED if (led_status != host_keyboard_leds()) { led_status = host_keyboard_leds(); diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index a0811f9a3..6c27eb9dc 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -73,22 +73,20 @@ along with this program. If not, see . /* key report size(NKRO or boot mode) */ -#if defined(PROTOCOL_PJRC) && defined(NKRO_ENABLE) -# include "usb.h" -# define KEYBOARD_REPORT_SIZE KBD2_SIZE -# define KEYBOARD_REPORT_KEYS (KBD2_SIZE - 2) -# define KEYBOARD_REPORT_BITS (KBD2_SIZE - 1) - -#elif defined(PROTOCOL_LUFA) && defined(NKRO_ENABLE) -# include "protocol/lufa/descriptor.h" -# define KEYBOARD_REPORT_SIZE NKRO_EPSIZE -# define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) -# define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) -#elif defined(PROTOCOL_CHIBIOS) && defined(NKRO_ENABLE) -# include "protocol/chibios/usb_main.h" -# define KEYBOARD_REPORT_SIZE NKRO_EPSIZE -# define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) -# define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) +#if defined(NKRO_ENABLE) + #if defined(PROTOCOL_PJRC) + #include "usb.h" + #define KEYBOARD_REPORT_SIZE KBD2_SIZE + #define KEYBOARD_REPORT_KEYS (KBD2_SIZE - 2) + #define KEYBOARD_REPORT_BITS (KBD2_SIZE - 1) + #elif defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS) + #include "protocol/usb_descriptor.h" + #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE + #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) + #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) + #else + #error "NKRO not supported with this protocol" +#endif #else # define KEYBOARD_REPORT_SIZE 8 diff --git a/tmk_core/protocol/chibios.mk b/tmk_core/protocol/chibios.mk index 3f4e0a71f..6e7cfbd83 100644 --- a/tmk_core/protocol/chibios.mk +++ b/tmk_core/protocol/chibios.mk @@ -4,7 +4,16 @@ CHIBIOS_DIR = $(PROTOCOL_DIR)/chibios SRC += $(CHIBIOS_DIR)/usb_main.c SRC += $(CHIBIOS_DIR)/main.c +SRC += usb_descriptor.c VPATH += $(TMK_PATH)/$(PROTOCOL_DIR) VPATH += $(TMK_PATH)/$(CHIBIOS_DIR) +VPATH += $(TMK_PATH)/$(CHIBIOS_DIR)/lufa_utils + +OPT_DEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=64 +OPT_DEFS += -DFIXED_NUM_CONFIGURATIONS=1 + +ifeq ($(strip $(MIDI_ENABLE)), yes) + include $(TMK_PATH)/protocol/midi.mk +endif diff --git a/tmk_core/protocol/chibios/lufa_utils/LUFA/Drivers/USB/USB.h b/tmk_core/protocol/chibios/lufa_utils/LUFA/Drivers/USB/USB.h new file mode 100644 index 000000000..a5374d820 --- /dev/null +++ b/tmk_core/protocol/chibios/lufa_utils/LUFA/Drivers/USB/USB.h @@ -0,0 +1,42 @@ +#include "progmem.h" +#include "stddef.h" +#include "inttypes.h" + +#define ATTR_PACKED __attribute__ ((packed)) +/** Concatenates the given input into a single token, via the C Preprocessor. + * + * \param[in] x First item to concatenate. + * \param[in] y Second item to concatenate. + * + * \return Concatenated version of the input. + */ +#define CONCAT(x, y) x ## y + +/** CConcatenates the given input into a single token after macro expansion, via the C Preprocessor. + * + * \param[in] x First item to concatenate. + * \param[in] y Second item to concatenate. + * + * \return Concatenated version of the expanded input. + */ +#define CONCAT_EXPANDED(x, y) CONCAT(x, y) +#define CPU_TO_LE16(x) (x) + +// We don't need anything from the following files, or we have defined it already +#define __LUFA_COMMON_H__ +#define __USBMODE_H__ +#define __USBEVENTS_H__ +#define __HIDPARSER_H__ +#define __USBCONTROLLER_AVR8_H__ + +#define __INCLUDE_FROM_USB_DRIVER +#define __INCLUDE_FROM_HID_DRIVER +#define __INCLUDE_FROM_CDC_DRIVER +#define __INCLUDE_FROM_AUDIO_DRIVER +#define __INCLUDE_FROM_MIDI_DRIVER +#include "lib/lufa/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h" +#include "lib/lufa/LUFA/Drivers/USB/Class/Common/HIDReportData.h" +#include "lib/lufa/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h" +#include "lib/lufa/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h" +#include "lib/lufa/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h" +#include "lib/lufa/LUFA/Drivers/USB/Core/USBController.h" diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 47a7eb09a..f2abc438d 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -41,6 +41,9 @@ #ifdef VISUALIZER_ENABLE #include "visualizer/visualizer.h" #endif +#ifdef MIDI_ENABLE +#include "qmk_midi.h" +#endif #include "suspend.h" #include "wait.h" @@ -65,6 +68,17 @@ host_driver_t chibios_driver = { send_consumer }; +#ifdef VIRTSER_ENABLE +void virtser_task(void); +#endif + +#ifdef RAW_HID_ENABLE +void raw_hid_task(void); +#endif + +#ifdef CONSOLE_ENABLE +void console_task(void); +#endif /* TESTING * Amber LED blinker thread, times are in milliseconds. @@ -104,6 +118,10 @@ int main(void) { /* init printf */ init_printf(NULL,sendchar_pf); +#ifdef MIDI_ENABLE + setup_midi(); +#endif + #ifdef SERIAL_LINK_ENABLE init_serial_link(); #endif @@ -182,5 +200,14 @@ int main(void) { } keyboard_task(); +#ifdef CONSOLE_ENABLE + console_task(); +#endif +#ifdef VIRTSER_ENABLE + virtser_task(); +#endif +#ifdef RAW_HID_ENABLE + raw_hid_task(); +#endif } } diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index caa2770b5..f980024ab 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -28,6 +28,7 @@ #include "led.h" #endif #include "wait.h" +#include "usb_descriptor.h" #ifdef NKRO_ENABLE #include "keycode_config.h" @@ -63,24 +64,12 @@ report_mouse_t mouse_report_blank = {0}; uint8_t extra_report_blank[3] = {0}; #endif /* EXTRAKEY_ENABLE */ -#ifdef CONSOLE_ENABLE -/* The emission buffers queue */ -output_buffers_queue_t console_buf_queue; -static uint8_t console_queue_buffer[BQ_BUFFER_SIZE(CONSOLE_QUEUE_CAPACITY, CONSOLE_EPSIZE)]; - -static virtual_timer_t console_flush_timer; -void console_queue_onotify(io_buffers_queue_t *bqp); -static void console_flush_cb(void *arg); -#endif /* CONSOLE_ENABLE */ - /* --------------------------------------------------------- * Descriptors and USB driver objects * --------------------------------------------------------- */ /* HID specific constants */ -#define USB_DESCRIPTOR_HID 0x21 -#define USB_DESCRIPTOR_HID_REPORT 0x22 #define HID_GET_REPORT 0x01 #define HID_GET_IDLE 0x02 #define HID_GET_PROTOCOL 0x03 @@ -88,593 +77,21 @@ static void console_flush_cb(void *arg); #define HID_SET_IDLE 0x0A #define HID_SET_PROTOCOL 0x0B -/* USB Device Descriptor */ -static const uint8_t usb_device_descriptor_data[] = { - USB_DESC_DEVICE(0x0200, // bcdUSB (1.1) - 0, // bDeviceClass (defined in later in interface) - 0, // bDeviceSubClass - 0, // bDeviceProtocol - 64, // bMaxPacketSize (64 bytes) (the driver didn't work with 32) - VENDOR_ID, // idVendor - PRODUCT_ID, // idProduct - DEVICE_VER, // bcdDevice - 1, // iManufacturer - 2, // iProduct - 3, // iSerialNumber - 1) // bNumConfigurations -}; - -/* Device Descriptor wrapper */ -static const USBDescriptor usb_device_descriptor = { - sizeof usb_device_descriptor_data, - usb_device_descriptor_data -}; - -/* - * HID Report Descriptor - * - * See "Device Class Definition for Human Interface Devices (HID)" - * (http://www.usb.org/developers/hidpage/HID1_11.pdf) for the - * detailed descrition of all the fields - */ - -/* Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60 */ -static const uint8_t keyboard_hid_report_desc_data[] = { - 0x05, 0x01, // Usage Page (Generic Desktop), - 0x09, 0x06, // Usage (Keyboard), - 0xA1, 0x01, // Collection (Application), - 0x75, 0x01, // Report Size (1), - 0x95, 0x08, // Report Count (8), - 0x05, 0x07, // Usage Page (Key Codes), - 0x19, 0xE0, // Usage Minimum (224), - 0x29, 0xE7, // Usage Maximum (231), - 0x15, 0x00, // Logical Minimum (0), - 0x25, 0x01, // Logical Maximum (1), - 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte - 0x95, 0x01, // Report Count (1), - 0x75, 0x08, // Report Size (8), - 0x81, 0x03, // Input (Constant), ;Reserved byte - 0x95, 0x05, // Report Count (5), - 0x75, 0x01, // Report Size (1), - 0x05, 0x08, // Usage Page (LEDs), - 0x19, 0x01, // Usage Minimum (1), - 0x29, 0x05, // Usage Maximum (5), - 0x91, 0x02, // Output (Data, Variable, Absolute), ;LED report - 0x95, 0x01, // Report Count (1), - 0x75, 0x03, // Report Size (3), - 0x91, 0x03, // Output (Constant), ;LED report padding - 0x95, KBD_REPORT_KEYS, // Report Count (), - 0x75, 0x08, // Report Size (8), - 0x15, 0x00, // Logical Minimum (0), - 0x26, 0xFF, 0x00, // Logical Maximum(255), - 0x05, 0x07, // Usage Page (Key Codes), - 0x19, 0x00, // Usage Minimum (0), - 0x29, 0xFF, // Usage Maximum (255), - 0x81, 0x00, // Input (Data, Array), - 0xc0 // End Collection -}; -/* wrapper */ -static const USBDescriptor keyboard_hid_report_descriptor = { - sizeof keyboard_hid_report_desc_data, - keyboard_hid_report_desc_data -}; - -#ifdef NKRO_ENABLE -static const uint8_t nkro_hid_report_desc_data[] = { - 0x05, 0x01, // Usage Page (Generic Desktop), - 0x09, 0x06, // Usage (Keyboard), - 0xA1, 0x01, // Collection (Application), - // bitmap of modifiers - 0x75, 0x01, // Report Size (1), - 0x95, 0x08, // Report Count (8), - 0x05, 0x07, // Usage Page (Key Codes), - 0x19, 0xE0, // Usage Minimum (224), - 0x29, 0xE7, // Usage Maximum (231), - 0x15, 0x00, // Logical Minimum (0), - 0x25, 0x01, // Logical Maximum (1), - 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte - // LED output report - 0x95, 0x05, // Report Count (5), - 0x75, 0x01, // Report Size (1), - 0x05, 0x08, // Usage Page (LEDs), - 0x19, 0x01, // Usage Minimum (1), - 0x29, 0x05, // Usage Maximum (5), - 0x91, 0x02, // Output (Data, Variable, Absolute), - 0x95, 0x01, // Report Count (1), - 0x75, 0x03, // Report Size (3), - 0x91, 0x03, // Output (Constant), - // bitmap of keys - 0x95, NKRO_REPORT_KEYS * 8, // Report Count (), - 0x75, 0x01, // Report Size (1), - 0x15, 0x00, // Logical Minimum (0), - 0x25, 0x01, // Logical Maximum(1), - 0x05, 0x07, // Usage Page (Key Codes), - 0x19, 0x00, // Usage Minimum (0), - 0x29, NKRO_REPORT_KEYS * 8 - 1, // Usage Maximum (), - 0x81, 0x02, // Input (Data, Variable, Absolute), - 0xc0 // End Collection -}; -/* wrapper */ -static const USBDescriptor nkro_hid_report_descriptor = { - sizeof nkro_hid_report_desc_data, - nkro_hid_report_desc_data -}; -#endif /* NKRO_ENABLE */ - -#ifdef MOUSE_ENABLE -/* Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension - * http://www.microchip.com/forums/tm.aspx?high=&m=391435&mpage=1#391521 - * http://www.keil.com/forum/15671/ - * http://www.microsoft.com/whdc/device/input/wheel.mspx */ -static const uint8_t mouse_hid_report_desc_data[] = { - /* mouse */ - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x02, // USAGE (Mouse) - 0xa1, 0x01, // COLLECTION (Application) - //0x85, REPORT_ID_MOUSE, // REPORT_ID (1) - 0x09, 0x01, // USAGE (Pointer) - 0xa1, 0x00, // COLLECTION (Physical) - // ---------------------------- Buttons - 0x05, 0x09, // USAGE_PAGE (Button) - 0x19, 0x01, // USAGE_MINIMUM (Button 1) - 0x29, 0x05, // USAGE_MAXIMUM (Button 5) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x05, // REPORT_COUNT (5) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x03, // REPORT_SIZE (3) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x03, // INPUT (Cnst,Var,Abs) - // ---------------------------- X,Y position - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x30, // USAGE (X) - 0x09, 0x31, // USAGE (Y) - 0x15, 0x81, // LOGICAL_MINIMUM (-127) - 0x25, 0x7f, // LOGICAL_MAXIMUM (127) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x02, // REPORT_COUNT (2) - 0x81, 0x06, // INPUT (Data,Var,Rel) - // ---------------------------- Vertical wheel - 0x09, 0x38, // USAGE (Wheel) - 0x15, 0x81, // LOGICAL_MINIMUM (-127) - 0x25, 0x7f, // LOGICAL_MAXIMUM (127) - 0x35, 0x00, // PHYSICAL_MINIMUM (0) - reset physical - 0x45, 0x00, // PHYSICAL_MAXIMUM (0) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x06, // INPUT (Data,Var,Rel) - // ---------------------------- Horizontal wheel - 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) - 0x0a, 0x38, 0x02, // USAGE (AC Pan) - 0x15, 0x81, // LOGICAL_MINIMUM (-127) - 0x25, 0x7f, // LOGICAL_MAXIMUM (127) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x06, // INPUT (Data,Var,Rel) - 0xc0, // END_COLLECTION - 0xc0, // END_COLLECTION -}; -/* wrapper */ -static const USBDescriptor mouse_hid_report_descriptor = { - sizeof mouse_hid_report_desc_data, - mouse_hid_report_desc_data -}; -#endif /* MOUSE_ENABLE */ - -#ifdef CONSOLE_ENABLE -static const uint8_t console_hid_report_desc_data[] = { - 0x06, 0x31, 0xFF, // Usage Page 0xFF31 (vendor defined) - 0x09, 0x74, // Usage 0x74 - 0xA1, 0x53, // Collection 0x53 - 0x75, 0x08, // report size = 8 bits - 0x15, 0x00, // logical minimum = 0 - 0x26, 0xFF, 0x00, // logical maximum = 255 - 0x95, CONSOLE_EPSIZE, // report count - 0x09, 0x75, // usage - 0x81, 0x02, // Input (array) - 0xC0 // end collection -}; -/* wrapper */ -static const USBDescriptor console_hid_report_descriptor = { - sizeof console_hid_report_desc_data, - console_hid_report_desc_data -}; -#endif /* CONSOLE_ENABLE */ - -#ifdef EXTRAKEY_ENABLE -/* audio controls & system controls - * http://www.microsoft.com/whdc/archive/w2kbd.mspx */ -static const uint8_t extra_hid_report_desc_data[] = { - /* system control */ - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xa1, 0x01, // COLLECTION (Application) - 0x85, REPORT_ID_SYSTEM, // REPORT_ID (2) - 0x15, 0x01, // LOGICAL_MINIMUM (0x1) - 0x25, 0xb7, // LOGICAL_MAXIMUM (0xb7) - 0x19, 0x01, // USAGE_MINIMUM (0x1) - 0x29, 0xb7, // USAGE_MAXIMUM (0xb7) - 0x75, 0x10, // REPORT_SIZE (16) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x00, // INPUT (Data,Array,Abs) - 0xc0, // END_COLLECTION - /* consumer */ - 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xa1, 0x01, // COLLECTION (Application) - 0x85, REPORT_ID_CONSUMER, // REPORT_ID (3) - 0x15, 0x01, // LOGICAL_MINIMUM (0x1) - 0x26, 0x9c, 0x02, // LOGICAL_MAXIMUM (0x29c) - 0x19, 0x01, // USAGE_MINIMUM (0x1) - 0x2a, 0x9c, 0x02, // USAGE_MAXIMUM (0x29c) - 0x75, 0x10, // REPORT_SIZE (16) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x00, // INPUT (Data,Array,Abs) - 0xc0, // END_COLLECTION -}; -/* wrapper */ -static const USBDescriptor extra_hid_report_descriptor = { - sizeof extra_hid_report_desc_data, - extra_hid_report_desc_data -}; -#endif /* EXTRAKEY_ENABLE */ - - -/* - * Configuration Descriptor tree for a HID device - * - * The HID Specifications version 1.11 require the following order: - * - Configuration Descriptor - * - Interface Descriptor - * - HID Descriptor - * - Endpoints Descriptors - */ -#define KBD_HID_DESC_NUM 0 -#define KBD_HID_DESC_OFFSET (9 + (9 + 9 + 7) * KBD_HID_DESC_NUM + 9) - -#ifdef MOUSE_ENABLE -# define MOUSE_HID_DESC_NUM (KBD_HID_DESC_NUM + 1) -# define MOUSE_HID_DESC_OFFSET (9 + (9 + 9 + 7) * MOUSE_HID_DESC_NUM + 9) -#else /* MOUSE_ENABLE */ -# define MOUSE_HID_DESC_NUM (KBD_HID_DESC_NUM + 0) -#endif /* MOUSE_ENABLE */ - -#ifdef CONSOLE_ENABLE -#define CONSOLE_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 1) -#define CONSOLE_HID_DESC_OFFSET (9 + (9 + 9 + 7) * CONSOLE_HID_DESC_NUM + 9) -#else /* CONSOLE_ENABLE */ -# define CONSOLE_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 0) -#endif /* CONSOLE_ENABLE */ - -#ifdef EXTRAKEY_ENABLE -# define EXTRA_HID_DESC_NUM (CONSOLE_HID_DESC_NUM + 1) -# define EXTRA_HID_DESC_OFFSET (9 + (9 + 9 + 7) * EXTRA_HID_DESC_NUM + 9) -#else /* EXTRAKEY_ENABLE */ -# define EXTRA_HID_DESC_NUM (CONSOLE_HID_DESC_NUM + 0) -#endif /* EXTRAKEY_ENABLE */ - -#ifdef NKRO_ENABLE -# define NKRO_HID_DESC_NUM (EXTRA_HID_DESC_NUM + 1) -# define NKRO_HID_DESC_OFFSET (9 + (9 + 9 + 7) * EXTRA_HID_DESC_NUM + 9) -#else /* NKRO_ENABLE */ -# define NKRO_HID_DESC_NUM (EXTRA_HID_DESC_NUM + 0) -#endif /* NKRO_ENABLE */ - -#define NUM_INTERFACES (NKRO_HID_DESC_NUM + 1) -#define CONFIG1_DESC_SIZE (9 + (9 + 9 + 7) * NUM_INTERFACES) - -static const uint8_t hid_configuration_descriptor_data[] = { - /* Configuration Descriptor (9 bytes) USB spec 9.6.3, page 264-266, Table 9-10 */ - USB_DESC_CONFIGURATION(CONFIG1_DESC_SIZE, // wTotalLength - NUM_INTERFACES, // bNumInterfaces - 1, // bConfigurationValue - 0, // iConfiguration - 0xA0, // bmAttributes (RESERVED|REMOTEWAKEUP) - 50), // bMaxPower (50mA) - - /* Interface Descriptor (9 bytes) USB spec 9.6.5, page 267-269, Table 9-12 */ - USB_DESC_INTERFACE(KBD_INTERFACE, // bInterfaceNumber - 0, // bAlternateSetting - 1, // bNumEndpoints - 0x03, // bInterfaceClass: HID - 0x01, // bInterfaceSubClass: Boot - 0x01, // bInterfaceProtocol: Keyboard - 0), // iInterface - - /* HID descriptor (9 bytes) HID 1.11 spec, section 6.2.1 */ - USB_DESC_BYTE(9), // bLength - USB_DESC_BYTE(0x21), // bDescriptorType (HID class) - USB_DESC_BCD(0x0111), // bcdHID: HID version 1.11 - USB_DESC_BYTE(0), // bCountryCode - USB_DESC_BYTE(1), // bNumDescriptors - USB_DESC_BYTE(0x22), // bDescriptorType (report desc) - USB_DESC_WORD(sizeof(keyboard_hid_report_desc_data)), // wDescriptorLength - - /* Endpoint Descriptor (7 bytes) USB spec 9.6.6, page 269-271, Table 9-13 */ - USB_DESC_ENDPOINT(KBD_ENDPOINT | 0x80, // bEndpointAddress - 0x03, // bmAttributes (Interrupt) - KBD_EPSIZE,// wMaxPacketSize - 10), // bInterval - - #ifdef MOUSE_ENABLE - /* Interface Descriptor (9 bytes) USB spec 9.6.5, page 267-269, Table 9-12 */ - USB_DESC_INTERFACE(MOUSE_INTERFACE, // bInterfaceNumber - 0, // bAlternateSetting - 1, // bNumEndpoints - 0x03, // bInterfaceClass (0x03 = HID) - // ThinkPad T23 BIOS doesn't work with boot mouse. - 0x00, // bInterfaceSubClass (0x01 = Boot) - 0x00, // bInterfaceProtocol (0x02 = Mouse) - /* - 0x01, // bInterfaceSubClass (0x01 = Boot) - 0x02, // bInterfaceProtocol (0x02 = Mouse) - */ - 0), // iInterface - - /* HID descriptor (9 bytes) HID 1.11 spec, section 6.2.1 */ - USB_DESC_BYTE(9), // bLength - USB_DESC_BYTE(0x21), // bDescriptorType (HID class) - USB_DESC_BCD(0x0111), // bcdHID: HID version 1.11 - USB_DESC_BYTE(0), // bCountryCode - USB_DESC_BYTE(1), // bNumDescriptors - USB_DESC_BYTE(0x22), // bDescriptorType (report desc) - USB_DESC_WORD(sizeof(mouse_hid_report_desc_data)), // wDescriptorLength - - /* Endpoint Descriptor (7 bytes) USB spec 9.6.6, page 269-271, Table 9-13 */ - USB_DESC_ENDPOINT(MOUSE_ENDPOINT | 0x80, // bEndpointAddress - 0x03, // bmAttributes (Interrupt) - MOUSE_EPSIZE, // wMaxPacketSize - 1), // bInterval - #endif /* MOUSE_ENABLE */ - - #ifdef CONSOLE_ENABLE - /* Interface Descriptor (9 bytes) USB spec 9.6.5, page 267-269, Table 9-12 */ - USB_DESC_INTERFACE(CONSOLE_INTERFACE, // bInterfaceNumber - 0, // bAlternateSetting - 1, // bNumEndpoints - 0x03, // bInterfaceClass: HID - 0x00, // bInterfaceSubClass: None - 0x00, // bInterfaceProtocol: None - 0), // iInterface - - /* HID descriptor (9 bytes) HID 1.11 spec, section 6.2.1 */ - USB_DESC_BYTE(9), // bLength - USB_DESC_BYTE(0x21), // bDescriptorType (HID class) - USB_DESC_BCD(0x0111), // bcdHID: HID version 1.11 - USB_DESC_BYTE(0), // bCountryCode - USB_DESC_BYTE(1), // bNumDescriptors - USB_DESC_BYTE(0x22), // bDescriptorType (report desc) - USB_DESC_WORD(sizeof(console_hid_report_desc_data)), // wDescriptorLength - - /* Endpoint Descriptor (7 bytes) USB spec 9.6.6, page 269-271, Table 9-13 */ - USB_DESC_ENDPOINT(CONSOLE_ENDPOINT | 0x80, // bEndpointAddress - 0x03, // bmAttributes (Interrupt) - CONSOLE_EPSIZE, // wMaxPacketSize - 1), // bInterval - #endif /* CONSOLE_ENABLE */ - - #ifdef EXTRAKEY_ENABLE - /* Interface Descriptor (9 bytes) USB spec 9.6.5, page 267-269, Table 9-12 */ - USB_DESC_INTERFACE(EXTRA_INTERFACE, // bInterfaceNumber - 0, // bAlternateSetting - 1, // bNumEndpoints - 0x03, // bInterfaceClass: HID - 0x00, // bInterfaceSubClass: None - 0x00, // bInterfaceProtocol: None - 0), // iInterface - - /* HID descriptor (9 bytes) HID 1.11 spec, section 6.2.1 */ - USB_DESC_BYTE(9), // bLength - USB_DESC_BYTE(0x21), // bDescriptorType (HID class) - USB_DESC_BCD(0x0111), // bcdHID: HID version 1.11 - USB_DESC_BYTE(0), // bCountryCode - USB_DESC_BYTE(1), // bNumDescriptors - USB_DESC_BYTE(0x22), // bDescriptorType (report desc) - USB_DESC_WORD(sizeof(extra_hid_report_desc_data)), // wDescriptorLength - - /* Endpoint Descriptor (7 bytes) USB spec 9.6.6, page 269-271, Table 9-13 */ - USB_DESC_ENDPOINT(EXTRA_ENDPOINT | 0x80, // bEndpointAddress - 0x03, // bmAttributes (Interrupt) - EXTRA_EPSIZE, // wMaxPacketSize - 10), // bInterval - #endif /* EXTRAKEY_ENABLE */ - - #ifdef NKRO_ENABLE - /* Interface Descriptor (9 bytes) USB spec 9.6.5, page 267-269, Table 9-12 */ - USB_DESC_INTERFACE(NKRO_INTERFACE, // bInterfaceNumber - 0, // bAlternateSetting - 1, // bNumEndpoints - 0x03, // bInterfaceClass: HID - 0x00, // bInterfaceSubClass: None - 0x00, // bInterfaceProtocol: None - 0), // iInterface - - /* HID descriptor (9 bytes) HID 1.11 spec, section 6.2.1 */ - USB_DESC_BYTE(9), // bLength - USB_DESC_BYTE(0x21), // bDescriptorType (HID class) - USB_DESC_BCD(0x0111), // bcdHID: HID version 1.11 - USB_DESC_BYTE(0), // bCountryCode - USB_DESC_BYTE(1), // bNumDescriptors - USB_DESC_BYTE(0x22), // bDescriptorType (report desc) - USB_DESC_WORD(sizeof(nkro_hid_report_desc_data)), // wDescriptorLength - - /* Endpoint Descriptor (7 bytes) USB spec 9.6.6, page 269-271, Table 9-13 */ - USB_DESC_ENDPOINT(NKRO_ENDPOINT | 0x80, // bEndpointAddress - 0x03, // bmAttributes (Interrupt) - NKRO_EPSIZE, // wMaxPacketSize - 1), // bInterval - #endif /* NKRO_ENABLE */ -}; - -/* Configuration Descriptor wrapper */ -static const USBDescriptor hid_configuration_descriptor = { - sizeof hid_configuration_descriptor_data, - hid_configuration_descriptor_data -}; - -/* wrappers */ -#define HID_DESCRIPTOR_SIZE 9 -static const USBDescriptor keyboard_hid_descriptor = { - HID_DESCRIPTOR_SIZE, - &hid_configuration_descriptor_data[KBD_HID_DESC_OFFSET] -}; -#ifdef MOUSE_ENABLE -static const USBDescriptor mouse_hid_descriptor = { - HID_DESCRIPTOR_SIZE, - &hid_configuration_descriptor_data[MOUSE_HID_DESC_OFFSET] -}; -#endif /* MOUSE_ENABLE */ -#ifdef CONSOLE_ENABLE -static const USBDescriptor console_hid_descriptor = { - HID_DESCRIPTOR_SIZE, - &hid_configuration_descriptor_data[CONSOLE_HID_DESC_OFFSET] -}; -#endif /* CONSOLE_ENABLE */ -#ifdef EXTRAKEY_ENABLE -static const USBDescriptor extra_hid_descriptor = { - HID_DESCRIPTOR_SIZE, - &hid_configuration_descriptor_data[EXTRA_HID_DESC_OFFSET] -}; -#endif /* EXTRAKEY_ENABLE */ -#ifdef NKRO_ENABLE -static const USBDescriptor nkro_hid_descriptor = { - HID_DESCRIPTOR_SIZE, - &hid_configuration_descriptor_data[NKRO_HID_DESC_OFFSET] -}; -#endif /* NKRO_ENABLE */ - - -/* U.S. English language identifier */ -static const uint8_t usb_string_langid[] = { - USB_DESC_BYTE(4), // bLength - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), // bDescriptorType - USB_DESC_WORD(0x0409) // wLANGID (U.S. English) -}; - -/* ugly ugly hack */ -#define PP_NARG(...) \ - PP_NARG_(__VA_ARGS__,PP_RSEQ_N()) -#define PP_NARG_(...) \ - PP_ARG_N(__VA_ARGS__) -#define PP_ARG_N( \ - _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \ - _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \ - _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \ - _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \ - _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \ - _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \ - _61,_62,_63,N,...) N -#define PP_RSEQ_N() \ - 63,62,61,60, \ - 59,58,57,56,55,54,53,52,51,50, \ - 49,48,47,46,45,44,43,42,41,40, \ - 39,38,37,36,35,34,33,32,31,30, \ - 29,28,27,26,25,24,23,22,21,20, \ - 19,18,17,16,15,14,13,12,11,10, \ - 9,8,7,6,5,4,3,2,1,0 - -/* Vendor string = manufacturer */ -static const uint8_t usb_string_vendor[] = { - USB_DESC_BYTE(PP_NARG(USBSTR_MANUFACTURER)+2), // bLength - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), // bDescriptorType - USBSTR_MANUFACTURER -}; - -/* Device Description string = product */ -static const uint8_t usb_string_description[] = { - USB_DESC_BYTE(PP_NARG(USBSTR_PRODUCT)+2), // bLength - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), // bDescriptorType - USBSTR_PRODUCT -}; - -/* Serial Number string (will be filled by the function init_usb_serial_string) */ -static uint8_t usb_string_serial[] = { - USB_DESC_BYTE(22), // bLength - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), // bDescriptorType - '0', 0, 'x', 0, 'D', 0, 'E', 0, 'A', 0, 'D', 0, 'B', 0, 'E', 0, 'E', 0, 'F', 0 -}; - -/* Strings wrappers array */ -static const USBDescriptor usb_strings[] = { - { sizeof usb_string_langid, usb_string_langid } - , - { sizeof usb_string_vendor, usb_string_vendor } - , - { sizeof usb_string_description, usb_string_description } - , - { sizeof usb_string_serial, usb_string_serial } -}; - /* * Handles the GET_DESCRIPTOR callback * * Returns the proper descriptor */ -static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype, uint8_t dindex, uint16_t lang) { +static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype, uint8_t dindex, uint16_t wIndex) { (void)usbp; - (void)lang; - switch(dtype) { - /* Generic descriptors */ - case USB_DESCRIPTOR_DEVICE: /* Device Descriptor */ - return &usb_device_descriptor; - - case USB_DESCRIPTOR_CONFIGURATION: /* Configuration Descriptor */ - return &hid_configuration_descriptor; - - case USB_DESCRIPTOR_STRING: /* Strings */ - if(dindex < 4) - return &usb_strings[dindex]; - break; - - /* HID specific descriptors */ - case USB_DESCRIPTOR_HID: /* HID Descriptors */ - switch(lang) { /* yea, poor label, it's actually wIndex from the setup packet */ - case KBD_INTERFACE: - return &keyboard_hid_descriptor; - -#ifdef MOUSE_ENABLE - case MOUSE_INTERFACE: - return &mouse_hid_descriptor; -#endif /* MOUSE_ENABLE */ -#ifdef CONSOLE_ENABLE - case CONSOLE_INTERFACE: - return &console_hid_descriptor; -#endif /* CONSOLE_ENABLE */ -#ifdef EXTRAKEY_ENABLE - case EXTRA_INTERFACE: - return &extra_hid_descriptor; -#endif /* EXTRAKEY_ENABLE */ -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: - return &nkro_hid_descriptor; -#endif /* NKRO_ENABLE */ - } - - case USB_DESCRIPTOR_HID_REPORT: /* HID Report Descriptor */ - switch(lang) { - case KBD_INTERFACE: - return &keyboard_hid_report_descriptor; - -#ifdef MOUSE_ENABLE - case MOUSE_INTERFACE: - return &mouse_hid_report_descriptor; -#endif /* MOUSE_ENABLE */ -#ifdef CONSOLE_ENABLE - case CONSOLE_INTERFACE: - return &console_hid_report_descriptor; -#endif /* CONSOLE_ENABLE */ -#ifdef EXTRAKEY_ENABLE - case EXTRA_INTERFACE: - return &extra_hid_report_descriptor; -#endif /* EXTRAKEY_ENABLE */ -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: - return &nkro_hid_report_descriptor; -#endif /* NKRO_ENABLE */ - } - } - return NULL; + static USBDescriptor desc; + uint16_t wValue = ((uint16_t)dtype << 8) | dindex; + desc.ud_string = NULL; + desc.ud_size = get_usb_descriptor(wValue, wIndex, (const void** const)&desc.ud_string); + if (desc.ud_string == NULL) + return NULL; + else + return &desc; } /* keyboard endpoint state structure */ @@ -685,7 +102,7 @@ static const USBEndpointConfig kbd_ep_config = { NULL, /* SETUP packet notification callback */ kbd_in_cb, /* IN notification callback */ NULL, /* OUT notification callback */ - KBD_EPSIZE, /* IN maximum packet size */ + KEYBOARD_EPSIZE, /* IN maximum packet size */ 0, /* OUT maximum packet size */ &kbd_ep_state, /* IN Endpoint state */ NULL, /* OUT endpoint state */ @@ -712,25 +129,6 @@ static const USBEndpointConfig mouse_ep_config = { }; #endif /* MOUSE_ENABLE */ -#ifdef CONSOLE_ENABLE -/* console endpoint state structure */ -static USBInEndpointState console_ep_state; - -/* console endpoint initialization structure (IN) */ -static const USBEndpointConfig console_ep_config = { - USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ - NULL, /* SETUP packet notification callback */ - console_in_cb, /* IN notification callback */ - NULL, /* OUT notification callback */ - CONSOLE_EPSIZE, /* IN maximum packet size */ - 0, /* OUT maximum packet size */ - &console_ep_state, /* IN Endpoint state */ - NULL, /* OUT endpoint state */ - 2, /* IN multiplier */ - NULL /* SETUP buffer (not a SETUP endpoint) */ -}; -#endif /* CONSOLE_ENABLE */ - #ifdef EXTRAKEY_ENABLE /* extrakey endpoint state structure */ static USBInEndpointState extra_ep_state; @@ -741,7 +139,7 @@ static const USBEndpointConfig extra_ep_config = { NULL, /* SETUP packet notification callback */ extra_in_cb, /* IN notification callback */ NULL, /* OUT notification callback */ - EXTRA_EPSIZE, /* IN maximum packet size */ + EXTRAKEY_EPSIZE, /* IN maximum packet size */ 0, /* OUT maximum packet size */ &extra_ep_state, /* IN Endpoint state */ NULL, /* OUT endpoint state */ @@ -769,6 +167,129 @@ static const USBEndpointConfig nkro_ep_config = { }; #endif /* NKRO_ENABLE */ +typedef struct { + size_t queue_capacity_in; + size_t queue_capacity_out; + uint8_t* queue_buffer_in; + uint8_t* queue_buffer_out; + USBInEndpointState in_ep_state; + USBOutEndpointState out_ep_state; + USBInEndpointState int_ep_state; + USBEndpointConfig in_ep_config; + USBEndpointConfig out_ep_config; + USBEndpointConfig int_ep_config; + const SerialUSBConfig config; + SerialUSBDriver driver; +} stream_driver_t; + +#define STREAM_DRIVER(stream, notification) { \ + .queue_capacity_in = stream##_IN_CAPACITY, \ + .queue_capacity_out = stream##_OUT_CAPACITY, \ + .queue_buffer_in = (uint8_t[BQ_BUFFER_SIZE(stream##_IN_CAPACITY, stream##_EPSIZE)]) {}, \ + .queue_buffer_out = (uint8_t[BQ_BUFFER_SIZE(stream##_OUT_CAPACITY,stream##_EPSIZE)]) {}, \ + .in_ep_config = { \ + .ep_mode = stream##_IN_MODE, \ + .setup_cb = NULL, \ + .in_cb = sduDataTransmitted, \ + .out_cb = NULL, \ + .in_maxsize = stream##_EPSIZE, \ + .out_maxsize = 0, \ + /* The pointer to the states will be filled during initialization */ \ + .in_state = NULL, \ + .out_state = NULL, \ + .ep_buffers = 2, \ + .setup_buf = NULL \ + }, \ + .out_ep_config = { \ + .ep_mode = stream##_OUT_MODE, \ + .setup_cb = NULL, \ + .in_cb = NULL, \ + .out_cb = sduDataReceived, \ + .in_maxsize = 0, \ + .out_maxsize = stream##_EPSIZE, \ + /* The pointer to the states will be filled during initialization */ \ + .in_state = NULL, \ + .out_state = NULL, \ + .ep_buffers = 2, \ + .setup_buf = NULL, \ + }, \ + .int_ep_config = { \ + .ep_mode = USB_EP_MODE_TYPE_INTR, \ + .setup_cb = NULL, \ + .in_cb = sduInterruptTransmitted, \ + .out_cb = NULL, \ + .in_maxsize = CDC_NOTIFICATION_EPSIZE, \ + .out_maxsize = 0, \ + /* The pointer to the states will be filled during initialization */ \ + .in_state = NULL, \ + .out_state = NULL, \ + .ep_buffers = 2, \ + .setup_buf = NULL, \ + }, \ + .config = { \ + .usbp = &USB_DRIVER, \ + .bulk_in = stream##_IN_EPNUM, \ + .bulk_out = stream##_OUT_EPNUM, \ + .int_in = notification \ + } \ +} + +typedef struct { + union { + struct { +#ifdef CONSOLE_ENABLE + stream_driver_t console_driver; +#endif +#ifdef RAW_ENABLE + stream_driver_t raw_driver; +#endif +#ifdef MIDI_ENABLE + stream_driver_t midi_driver; +#endif +#ifdef VIRTSER_ENABLE + stream_driver_t serial_driver; +#endif + }; + stream_driver_t array[0]; + }; +} stream_drivers_t; + +static stream_drivers_t drivers = { +#ifdef CONSOLE_ENABLE + #define CONSOLE_IN_CAPACITY 4 + #define CONSOLE_OUT_CAPACITY 4 + #define CONSOLE_IN_MODE USB_EP_MODE_TYPE_INTR + #define CONSOLE_OUT_MODE USB_EP_MODE_TYPE_INTR + .console_driver = STREAM_DRIVER(CONSOLE, 0), +#endif +#ifdef RAW_ENABLE + #define RAW_IN_CAPACITY 4 + #define RAW_OUT_CAPACITY 4 + #define RAW_IN_MODE USB_EP_MODE_TYPE_INTR + #define RAW_OUT_MODE USB_EP_MODE_TYPE_INTR + .raw_driver = STREAM_DRIVER(RAW, 0), +#endif + +#ifdef MIDI_ENABLE + #define MIDI_STREAM_IN_CAPACITY 4 + #define MIDI_STREAM_OUT_CAPACITY 4 + #define MIDI_STREAM_IN_MODE USB_EP_MODE_TYPE_BULK + #define MIDI_STREAM_OUT_MODE USB_EP_MODE_TYPE_BULK + .midi_driver = STREAM_DRIVER(MIDI_STREAM, 0), +#endif + +#ifdef VIRTSER_ENABLE + #define CDC_IN_CAPACITY 4 + #define CDC_OUT_CAPACITY 4 + #define CDC_IN_MODE USB_EP_MODE_TYPE_BULK + #define CDC_OUT_MODE USB_EP_MODE_TYPE_BULK + .serial_driver = STREAM_DRIVER(CDC, CDC_NOTIFICATION_EPNUM), +#endif +}; + +#define NUM_STREAM_DRIVERS (sizeof(drivers) / sizeof(stream_driver_t)) + + /* --------------------------------------------------------- * USB driver functions * --------------------------------------------------------- @@ -784,24 +305,27 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { case USB_EVENT_CONFIGURED: osalSysLockFromISR(); /* Enable the endpoints specified into the configuration. */ - usbInitEndpointI(usbp, KBD_ENDPOINT, &kbd_ep_config); + usbInitEndpointI(usbp, KEYBOARD_IN_EPNUM, &kbd_ep_config); #ifdef MOUSE_ENABLE - usbInitEndpointI(usbp, MOUSE_ENDPOINT, &mouse_ep_config); + usbInitEndpointI(usbp, MOUSE_IN_EPNUM, &mouse_ep_config); #endif /* MOUSE_ENABLE */ -#ifdef CONSOLE_ENABLE - usbInitEndpointI(usbp, CONSOLE_ENDPOINT, &console_ep_config); - /* don't need to start the flush timer, it starts from console_in_cb automatically */ -#endif /* CONSOLE_ENABLE */ #ifdef EXTRAKEY_ENABLE - usbInitEndpointI(usbp, EXTRA_ENDPOINT, &extra_ep_config); + usbInitEndpointI(usbp, EXTRAKEY_IN_EPNUM, &extra_ep_config); #endif /* EXTRAKEY_ENABLE */ #ifdef NKRO_ENABLE - usbInitEndpointI(usbp, NKRO_ENDPOINT, &nkro_ep_config); + usbInitEndpointI(usbp, NKRO_IN_EPNUM, &nkro_ep_config); #endif /* NKRO_ENABLE */ + for (int i=0;isetup[1]) { /* bRequest */ case HID_GET_REPORT: switch(usbp->setup[4]) { /* LSB(wIndex) (check MSB==0?) */ - case KBD_INTERFACE: + case KEYBOARD_INTERFACE: #ifdef NKRO_ENABLE case NKRO_INTERFACE: #endif /* NKRO_ENABLE */ @@ -883,15 +419,8 @@ static bool usb_request_hook_cb(USBDriver *usbp) { break; #endif /* MOUSE_ENABLE */ -#ifdef CONSOLE_ENABLE - case CONSOLE_INTERFACE: - usbSetupTransfer(usbp, console_queue_buffer, CONSOLE_EPSIZE, NULL); - return TRUE; - break; -#endif /* CONSOLE_ENABLE */ - #ifdef EXTRAKEY_ENABLE - case EXTRA_INTERFACE: + case EXTRAKEY_INTERFACE: if(usbp->setup[3] == 1) { /* MSB(wValue) [Report Type] == 1 [Input Report] */ switch(usbp->setup[2]) { /* LSB(wValue) [Report ID] */ case REPORT_ID_SYSTEM: @@ -921,7 +450,7 @@ static bool usb_request_hook_cb(USBDriver *usbp) { break; case HID_GET_PROTOCOL: - if((usbp->setup[4] == KBD_INTERFACE) && (usbp->setup[5] == 0)) { /* wIndex */ + if((usbp->setup[4] == KEYBOARD_INTERFACE) && (usbp->setup[5] == 0)) { /* wIndex */ usbSetupTransfer(usbp, &keyboard_protocol, 1, NULL); return TRUE; } @@ -938,7 +467,7 @@ static bool usb_request_hook_cb(USBDriver *usbp) { switch(usbp->setup[1]) { /* bRequest */ case HID_SET_REPORT: switch(usbp->setup[4]) { /* LSB(wIndex) (check MSB==0 and wLength==1?) */ - case KBD_INTERFACE: + case KEYBOARD_INTERFACE: #ifdef NKRO_ENABLE case NKRO_INTERFACE: #endif /* NKRO_ENABLE */ @@ -951,7 +480,7 @@ static bool usb_request_hook_cb(USBDriver *usbp) { break; case HID_SET_PROTOCOL: - if((usbp->setup[4] == KBD_INTERFACE) && (usbp->setup[5] == 0)) { /* wIndex */ + if((usbp->setup[4] == KEYBOARD_INTERFACE) && (usbp->setup[5] == 0)) { /* wIndex */ keyboard_protocol = ((usbp->setup[2]) != 0x00); /* LSB(wValue) */ #ifdef NKRO_ENABLE keymap_config.nkro = !!keyboard_protocol; @@ -998,12 +527,24 @@ static bool usb_request_hook_cb(USBDriver *usbp) { return TRUE; } + for (int i=0;iibqueue.notify; + ibqObjectInit(&driver->ibqueue, false, drivers.array[i].queue_buffer_in, drivers.array[i].in_ep_config.in_maxsize, drivers.array[i].queue_capacity_in, notify, driver); + notify = driver->obqueue.notify; + ibqObjectInit(&driver->ibqueue, false, drivers.array[i].queue_buffer_out, drivers.array[i].out_ep_config.out_maxsize, drivers.array[i].queue_capacity_out, notify, driver); + sduStart(driver, &drivers.array[i].config); + } + /* * Activates the USB driver and then the USB bus pull-up on D+. * Note, a delay is inserted in order to not have to disconnect the cable @@ -1030,17 +584,12 @@ void init_usb_driver(USBDriver *usbp) { usbConnectBus(usbp); chVTObjectInit(&keyboard_idle_timer); -#ifdef CONSOLE_ENABLE - obqObjectInit(&console_buf_queue, false, console_queue_buffer, CONSOLE_EPSIZE, CONSOLE_QUEUE_CAPACITY, console_queue_onotify, (void*)usbp); - chVTObjectInit(&console_flush_timer); -#endif } /* --------------------------------------------------------- * Keyboard functions * --------------------------------------------------------- */ - /* keyboard IN callback hander (a kbd report has made it IN) */ void kbd_in_cb(USBDriver *usbp, usbep_t ep) { /* STUB */ @@ -1084,8 +633,8 @@ static void keyboard_idle_timer_cb(void *arg) { if(keyboard_idle) { #endif /* NKRO_ENABLE */ /* TODO: are we sure we want the KBD_ENDPOINT? */ - if(!usbGetTransmitStatusI(usbp, KBD_ENDPOINT)) { - usbStartTransmitI(usbp, KBD_ENDPOINT, (uint8_t *)&keyboard_report_sent, KBD_EPSIZE); + if(!usbGetTransmitStatusI(usbp, KEYBOARD_IN_EPNUM)) { + usbStartTransmitI(usbp, KEYBOARD_IN_EPNUM, (uint8_t *)&keyboard_report_sent, KEYBOARD_EPSIZE); } /* rearm the timer */ chVTSetI(&keyboard_idle_timer, 4*MS2ST(keyboard_idle), keyboard_idle_timer_cb, (void *)usbp); @@ -1119,14 +668,14 @@ void send_keyboard(report_keyboard_t *report) { * this is more efficient */ /* busy wait, should be short and not very common */ osalSysLock(); - if(usbGetTransmitStatusI(&USB_DRIVER, NKRO_ENDPOINT)) { + if(usbGetTransmitStatusI(&USB_DRIVER, NKRO_IN_EPNUM)) { /* Need to either suspend, or loop and call unlock/lock during * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - osalThreadSuspendS(&(&USB_DRIVER)->epc[NKRO_ENDPOINT]->in_state->thread); + osalThreadSuspendS(&(&USB_DRIVER)->epc[NKRO_IN_EPNUM]->in_state->thread); } - usbStartTransmitI(&USB_DRIVER, NKRO_ENDPOINT, (uint8_t *)report, sizeof(report_keyboard_t)); + usbStartTransmitI(&USB_DRIVER, NKRO_IN_EPNUM, (uint8_t *)report, sizeof(report_keyboard_t)); osalSysUnlock(); } else #endif /* NKRO_ENABLE */ @@ -1134,14 +683,14 @@ void send_keyboard(report_keyboard_t *report) { /* need to wait until the previous packet has made it through */ /* busy wait, should be short and not very common */ osalSysLock(); - if(usbGetTransmitStatusI(&USB_DRIVER, KBD_ENDPOINT)) { + if(usbGetTransmitStatusI(&USB_DRIVER, KEYBOARD_IN_EPNUM)) { /* Need to either suspend, or loop and call unlock/lock during * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - osalThreadSuspendS(&(&USB_DRIVER)->epc[KBD_ENDPOINT]->in_state->thread); + osalThreadSuspendS(&(&USB_DRIVER)->epc[KEYBOARD_IN_EPNUM]->in_state->thread); } - usbStartTransmitI(&USB_DRIVER, KBD_ENDPOINT, (uint8_t *)report, KBD_EPSIZE); + usbStartTransmitI(&USB_DRIVER, KEYBOARD_IN_EPNUM, (uint8_t *)report, KEYBOARD_EPSIZE); osalSysUnlock(); } keyboard_report_sent = *report; @@ -1174,7 +723,7 @@ void send_mouse(report_mouse_t *report) { */ osalSysLock(); - usbStartTransmitI(&USB_DRIVER, MOUSE_ENDPOINT, (uint8_t *)report, sizeof(report_mouse_t)); + usbStartTransmitI(&USB_DRIVER, MOUSE_IN_EPNUM, (uint8_t *)report, sizeof(report_mouse_t)); osalSysUnlock(); } @@ -1210,7 +759,7 @@ static void send_extra_report(uint8_t report_id, uint16_t data) { .usage = data }; - usbStartTransmitI(&USB_DRIVER, EXTRA_ENDPOINT, (uint8_t *)&report, sizeof(report_extra_t)); + usbStartTransmitI(&USB_DRIVER, EXTRAKEY_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); osalSysUnlock(); } @@ -1238,115 +787,28 @@ void send_consumer(uint16_t data) { #ifdef CONSOLE_ENABLE -/* console IN callback hander */ -void console_in_cb(USBDriver *usbp, usbep_t ep) { - (void)ep; /* should have ep == CONSOLE_ENDPOINT, so use that to save time/space */ - uint8_t *buf; - size_t n; - - osalSysLockFromISR(); - - /* rearm the timer */ - chVTSetI(&console_flush_timer, MS2ST(CONSOLE_FLUSH_MS), console_flush_cb, (void *)usbp); - - /* Freeing the buffer just transmitted, if it was not a zero size packet.*/ - if (usbp->epc[CONSOLE_ENDPOINT]->in_state->txsize > 0U) { - obqReleaseEmptyBufferI(&console_buf_queue); - } - - /* Checking if there is a buffer ready for transmission.*/ - buf = obqGetFullBufferI(&console_buf_queue, &n); - - if (buf != NULL) { - /* The endpoint cannot be busy, we are in the context of the callback, - so it is safe to transmit without a check.*/ - /* Should have n == CONSOLE_EPSIZE; check it? */ - usbStartTransmitI(usbp, CONSOLE_ENDPOINT, buf, CONSOLE_EPSIZE); - } else { - /* Nothing to transmit.*/ - } - - osalSysUnlockFromISR(); -} - -/* Callback when data is inserted into the output queue - * Called from a locked state */ -void console_queue_onotify(io_buffers_queue_t *bqp) { - size_t n; - USBDriver *usbp = bqGetLinkX(bqp); - - if(usbGetDriverStateI(usbp) != USB_ACTIVE) - return; - - /* Checking if there is already a transaction ongoing on the endpoint.*/ - if (!usbGetTransmitStatusI(usbp, CONSOLE_ENDPOINT)) { - /* Trying to get a full buffer.*/ - uint8_t *buf = obqGetFullBufferI(&console_buf_queue, &n); - if (buf != NULL) { - /* Buffer found, starting a new transaction.*/ - /* Should have n == CONSOLE_EPSIZE; check this? */ - usbStartTransmitI(usbp, CONSOLE_ENDPOINT, buf, CONSOLE_EPSIZE); - } - } -} - -/* Flush timer code - * callback (called from ISR, unlocked state) */ -static void console_flush_cb(void *arg) { - USBDriver *usbp = (USBDriver *)arg; - osalSysLockFromISR(); - - /* check that the states of things are as they're supposed to */ - if(usbGetDriverStateI(usbp) != USB_ACTIVE) { - /* rearm the timer */ - chVTSetI(&console_flush_timer, MS2ST(CONSOLE_FLUSH_MS), console_flush_cb, (void *)usbp); - osalSysUnlockFromISR(); - return; - } - - /* If there is already a transaction ongoing then another one cannot be - started.*/ - if (usbGetTransmitStatusI(usbp, CONSOLE_ENDPOINT)) { - /* rearm the timer */ - chVTSetI(&console_flush_timer, MS2ST(CONSOLE_FLUSH_MS), console_flush_cb, (void *)usbp); - osalSysUnlockFromISR(); - return; - } - - /* Checking if there only a buffer partially filled, if so then it is - enforced in the queue and transmitted.*/ - if(obqTryFlushI(&console_buf_queue)) { - size_t n,i; - uint8_t *buf = obqGetFullBufferI(&console_buf_queue, &n); - - osalDbgAssert(buf != NULL, "queue is empty"); - - /* zero the rest of the buffer (buf should point to allocated space) */ - for(i=n; i 0) { + console_receive(buffer, size); + } + } while(size > 0); } #else /* CONSOLE_ENABLE */ @@ -1360,3 +822,72 @@ void sendchar_pf(void *p, char c) { (void)p; sendchar((uint8_t)c); } + +#ifdef RAW_ENABLE +void raw_hid_send( uint8_t *data, uint8_t length ) { + // TODO: implement variable size packet + if ( length != RAW_EPSIZE ) + { + return; + + } + chnWrite(&drivers.raw_driver.driver, data, length); +} + +__attribute__ ((weak)) +void raw_hid_receive( uint8_t *data, uint8_t length ) { + // Users should #include "raw_hid.h" in their own code + // and implement this function there. Leave this as weak linkage + // so users can opt to not handle data coming in. +} + +void raw_hid_task(void) { + uint8_t buffer[RAW_EPSIZE]; + size_t size = 0; + do { + size_t size = chnReadTimeout(&drivers.raw_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE); + if (size > 0) { + raw_hid_receive(buffer, size); + } + } while(size > 0); +} + +#endif + +#ifdef MIDI_ENABLE + +void send_midi_packet(MIDI_EventPacket_t* event) { + chnWrite(&drivers.midi_driver.driver, (uint8_t*)event, sizeof(MIDI_EventPacket_t)); +} + +bool recv_midi_packet(MIDI_EventPacket_t* const event) { + size_t size = chnReadTimeout(&drivers.midi_driver.driver, (uint8_t*)event, sizeof(MIDI_EventPacket_t), TIME_IMMEDIATE); + return size == sizeof(MIDI_EventPacket_t); +} + +#endif + +#ifdef VIRTSER_ENABLE + +void virtser_send(const uint8_t byte) { + chnWrite(&drivers.serial_driver.driver, &byte, 1); +} + +__attribute__ ((weak)) +void virtser_recv(uint8_t c) +{ + // Ignore by default +} + +void virtser_task(void) { + uint8_t numBytesReceived = 0; + uint8_t buffer[16]; + do { + numBytesReceived = chnReadTimeout(&drivers.serial_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE); + for (int i=0;i 0); +} + +#endif diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index b4f894f2f..1f7eb12f8 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -41,20 +41,6 @@ void init_usb_driver(USBDriver *usbp); * --------------- */ -/* main keyboard (6kro) */ -#define KBD_INTERFACE 0 -#define KBD_ENDPOINT 1 -#define KBD_EPSIZE 8 -#define KBD_REPORT_KEYS (KBD_EPSIZE - 2) - -/* secondary keyboard */ -#ifdef NKRO_ENABLE -#define NKRO_INTERFACE 4 -#define NKRO_ENDPOINT 5 -#define NKRO_EPSIZE 16 -#define NKRO_REPORT_KEYS (NKRO_EPSIZE - 1) -#endif - /* extern report_keyboard_t keyboard_report_sent; */ /* keyboard IN request callback handler */ @@ -75,10 +61,6 @@ void nkro_in_cb(USBDriver *usbp, usbep_t ep); #ifdef MOUSE_ENABLE -#define MOUSE_INTERFACE 1 -#define MOUSE_ENDPOINT 2 -#define MOUSE_EPSIZE 8 - /* mouse IN request callback handler */ void mouse_in_cb(USBDriver *usbp, usbep_t ep); #endif /* MOUSE_ENABLE */ @@ -90,10 +72,6 @@ void mouse_in_cb(USBDriver *usbp, usbep_t ep); #ifdef EXTRAKEY_ENABLE -#define EXTRA_INTERFACE 3 -#define EXTRA_ENDPOINT 4 -#define EXTRA_EPSIZE 8 - /* extrakey IN request callback handler */ void extra_in_cb(USBDriver *usbp, usbep_t ep); @@ -111,24 +89,12 @@ typedef struct { #ifdef CONSOLE_ENABLE -#define CONSOLE_INTERFACE 2 -#define CONSOLE_ENDPOINT 3 -#define CONSOLE_EPSIZE 16 - -/* Number of IN reports that can be stored inside the output queue */ -#define CONSOLE_QUEUE_CAPACITY 4 - -/* Console flush time */ -#define CONSOLE_FLUSH_MS 50 - /* Putchar over the USB console */ int8_t sendchar(uint8_t c); /* Flush output (send everything immediately) */ void console_flush_output(void); -/* console IN request callback handler */ -void console_in_cb(USBDriver *usbp, usbep_t ep); #endif /* CONSOLE_ENABLE */ void sendchar_pf(void *p, char c); diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index 4d005debc..bb82a31e1 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa.mk @@ -15,7 +15,7 @@ else endif LUFA_SRC = lufa.c \ - descriptor.c \ + usb_descriptor.c \ outputselect.c \ $(LUFA_SRC_USB) @@ -64,7 +64,7 @@ LUFA_OPTS = -DUSB_DEVICE_ONLY LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT -LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 +LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1 diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index e3f8724e8..a1cab98a6 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -49,7 +49,7 @@ #endif #include "suspend.h" -#include "descriptor.h" +#include "usb_descriptor.h" #include "lufa.h" #include "quantum.h" #include @@ -83,7 +83,7 @@ #endif #ifdef MIDI_ENABLE - #include "sysex_tools.h" + #include "qmk_midi.h" #endif #ifdef RAW_ENABLE @@ -97,12 +97,6 @@ static uint8_t keyboard_led_stats = 0; static report_keyboard_t keyboard_report_sent; -#ifdef MIDI_ENABLE -static void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2); -static void usb_get_midi(MidiDevice * device); -static void midi_usb_init(MidiDevice * device); -#endif - /* Host driver */ static uint8_t keyboard_leds(void); static void send_keyboard(report_keyboard_t *report); @@ -115,48 +109,8 @@ host_driver_t lufa_driver = { send_mouse, send_system, send_consumer, -#ifdef MIDI_ENABLE - usb_send_func, - usb_get_midi, - midi_usb_init -#endif }; -/******************************************************************************* - * MIDI - ******************************************************************************/ - -#ifdef MIDI_ENABLE -USB_ClassInfo_MIDI_Device_t USB_MIDI_Interface = -{ - .Config = - { - .StreamingInterfaceNumber = AS_INTERFACE, - .DataINEndpoint = - { - .Address = MIDI_STREAM_IN_EPADDR, - .Size = MIDI_STREAM_EPSIZE, - .Banks = 1, - }, - .DataOUTEndpoint = - { - .Address = MIDI_STREAM_OUT_EPADDR, - .Size = MIDI_STREAM_EPSIZE, - .Banks = 1, - }, - }, -}; - -#define SYSEX_START_OR_CONT 0x40 -#define SYSEX_ENDS_IN_1 0x50 -#define SYSEX_ENDS_IN_2 0x60 -#define SYSEX_ENDS_IN_3 0x70 - -#define SYS_COMMON_1 0x50 -#define SYS_COMMON_2 0x20 -#define SYS_COMMON_3 0x30 -#endif - #ifdef VIRTSER_ENABLE USB_ClassInfo_CDC_Device_t cdc_device = { @@ -853,170 +807,32 @@ int8_t sendchar(uint8_t c) ******************************************************************************/ #ifdef MIDI_ENABLE -static void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2) { - MIDI_EventPacket_t event; - event.Data1 = byte0; - event.Data2 = byte1; - event.Data3 = byte2; - - uint8_t cable = 0; - -// Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM); - - //if the length is undefined we assume it is a SYSEX message - if (midi_packet_length(byte0) == UNDEFINED) { - switch(cnt) { - case 3: - if (byte2 == SYSEX_END) - event.Event = MIDI_EVENT(cable, SYSEX_ENDS_IN_3); - else - event.Event = MIDI_EVENT(cable, SYSEX_START_OR_CONT); - break; - case 2: - if (byte1 == SYSEX_END) - event.Event = MIDI_EVENT(cable, SYSEX_ENDS_IN_2); - else - event.Event = MIDI_EVENT(cable, SYSEX_START_OR_CONT); - break; - case 1: - if (byte0 == SYSEX_END) - event.Event = MIDI_EVENT(cable, SYSEX_ENDS_IN_1); - else - event.Event = MIDI_EVENT(cable, SYSEX_START_OR_CONT); - break; - default: - return; //invalid cnt - } - } else { - //deal with 'system common' messages - //TODO are there any more? - switch(byte0 & 0xF0){ - case MIDI_SONGPOSITION: - event.Event = MIDI_EVENT(cable, SYS_COMMON_3); - break; - case MIDI_SONGSELECT: - case MIDI_TC_QUARTERFRAME: - event.Event = MIDI_EVENT(cable, SYS_COMMON_2); - break; - default: - event.Event = MIDI_EVENT(cable, byte0); - break; - } - } - -// Endpoint_Write_Stream_LE(&event, sizeof(event), NULL); -// Endpoint_ClearIN(); - - MIDI_Device_SendEventPacket(&USB_MIDI_Interface, &event); - MIDI_Device_Flush(&USB_MIDI_Interface); - MIDI_Device_USBTask(&USB_MIDI_Interface); - USB_USBTask(); -} - -static void usb_get_midi(MidiDevice * device) { - MIDI_EventPacket_t event; - while (MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, &event)) { - - midi_packet_length_t length = midi_packet_length(event.Data1); - uint8_t input[3]; - input[0] = event.Data1; - input[1] = event.Data2; - input[2] = event.Data3; - if (length == UNDEFINED) { - //sysex - if (event.Event == MIDI_EVENT(0, SYSEX_START_OR_CONT) || event.Event == MIDI_EVENT(0, SYSEX_ENDS_IN_3)) { - length = 3; - } else if (event.Event == MIDI_EVENT(0, SYSEX_ENDS_IN_2)) { - length = 2; - } else if(event.Event == MIDI_EVENT(0, SYSEX_ENDS_IN_1)) { - length = 1; - } else { - //XXX what to do? - } - } - - //pass the data to the device input function - if (length != UNDEFINED) - midi_device_input(device, length, input); - } - MIDI_Device_USBTask(&USB_MIDI_Interface); - USB_USBTask(); -} - -static void midi_usb_init(MidiDevice * device){ - midi_device_init(device); - midi_device_set_send_func(device, usb_send_func); - midi_device_set_pre_input_process_func(device, usb_get_midi); - - // SetupHardware(); - sei(); -} - -void MIDI_Task(void) +USB_ClassInfo_MIDI_Device_t USB_MIDI_Interface = { - - /* Device must be connected and configured for the task to run */ - dprint("in MIDI_TASK\n"); - if (USB_DeviceState != DEVICE_STATE_Configured) - return; - dprint("continuing in MIDI_TASK\n"); - - Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPADDR); - - if (Endpoint_IsINReady()) + .Config = + { + .StreamingInterfaceNumber = AS_INTERFACE, + .DataINEndpoint = { - - dprint("Endpoint is ready\n"); - - uint8_t MIDICommand = 0; - uint8_t MIDIPitch; - - /* Get board button status - if pressed use channel 10 (percussion), otherwise use channel 1 */ - uint8_t Channel = MIDI_CHANNEL(1); - - MIDICommand = MIDI_COMMAND_NOTE_ON; - MIDIPitch = 0x3E; - - /* Check if a MIDI command is to be sent */ - if (MIDICommand) - { - dprint("Command exists\n"); - MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) - { - .Event = MIDI_EVENT(0, MIDICommand), - - .Data1 = MIDICommand | Channel, - .Data2 = MIDIPitch, - .Data3 = MIDI_STANDARD_VELOCITY, - }; - - /* Write the MIDI event packet to the endpoint */ - Endpoint_Write_Stream_LE(&MIDIEvent, sizeof(MIDIEvent), NULL); - - /* Send the data in the endpoint to the host */ - Endpoint_ClearIN(); - } - } - - - /* Select the MIDI OUT stream */ - Endpoint_SelectEndpoint(MIDI_STREAM_OUT_EPADDR); - - /* Check if a MIDI command has been received */ - if (Endpoint_IsOUTReceived()) + .Address = MIDI_STREAM_IN_EPADDR, + .Size = MIDI_STREAM_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = { - MIDI_EventPacket_t MIDIEvent; + .Address = MIDI_STREAM_OUT_EPADDR, + .Size = MIDI_STREAM_EPSIZE, + .Banks = 1, + }, + }, +}; - /* Read the MIDI event packet from the endpoint */ - Endpoint_Read_Stream_LE(&MIDIEvent, sizeof(MIDIEvent), NULL); +void send_midi_packet(MIDI_EventPacket_t* event) { + MIDI_Device_SendEventPacket(&USB_MIDI_Interface, event); +} - /* If the endpoint is now empty, clear the bank */ - if (!(Endpoint_BytesInEndpoint())) - { - /* Clear the endpoint ready for new packet */ - Endpoint_ClearOUT(); - } - } +bool recv_midi_packet(MIDI_EventPacket_t* const event) { + return MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, event); } #endif @@ -1105,26 +921,6 @@ static void setup_usb(void) print_set_sendchar(sendchar); } - -#ifdef MIDI_ENABLE -void fallthrough_callback(MidiDevice * device, - uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2); -void cc_callback(MidiDevice * device, - uint8_t chan, uint8_t num, uint8_t val); -void sysex_callback(MidiDevice * device, - uint16_t start, uint8_t length, uint8_t * data); - -void setup_midi(void) -{ -#ifdef MIDI_ADVANCED - midi_init(); -#endif - midi_device_init(&midi_device); - midi_device_set_send_func(&midi_device, usb_send_func); - midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); -} -#endif - int main(void) __attribute__ ((weak)); int main(void) { @@ -1137,18 +933,6 @@ int main(void) setup_usb(); sei(); -#ifdef MIDI_ENABLE - midi_register_fallthrough_callback(&midi_device, fallthrough_callback); - midi_register_cc_callback(&midi_device, cc_callback); - midi_register_sysex_callback(&midi_device, sysex_callback); - - // init_notes(); - // midi_send_cc(&midi_device, 0, 1, 2); - // midi_send_cc(&midi_device, 15, 1, 0); - // midi_send_noteon(&midi_device, 0, 64, 127); - // midi_send_noteoff(&midi_device, 0, 64, 127); -#endif - #if defined(MODULE_ADAFRUIT_EZKEY) || defined(MODULE_RN42) serial_init(); #endif @@ -1193,10 +977,7 @@ int main(void) keyboard_task(); #ifdef MIDI_ENABLE - midi_device_process(&midi_device); -#ifdef MIDI_ADVANCED - midi_task(); -#endif + MIDI_Device_USBTask(&USB_MIDI_Interface); #endif #if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE) @@ -1223,71 +1004,10 @@ int main(void) } } -#ifdef MIDI_ENABLE -void fallthrough_callback(MidiDevice * device, - uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2){ - -#ifdef AUDIO_ENABLE - if (cnt == 3) { - switch (byte0 & 0xF0) { - case MIDI_NOTEON: - play_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0), (byte2 & 0x7F) / 8); - break; - case MIDI_NOTEOFF: - stop_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0)); - break; - } - } - if (byte0 == MIDI_STOP) { - stop_all_notes(); - } -#endif +uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress) +{ + return get_usb_descriptor(wValue, wIndex, DescriptorAddress); } - -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 API_SYSEX_ENABLE -uint8_t midi_buffer[MIDI_SYSEX_BUFFER] = {0}; -#endif - -void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data) { - #ifdef API_SYSEX_ENABLE - // SEND_STRING("\n"); - // send_word(start); - // SEND_STRING(": "); - // Don't store the header - int16_t pos = start - 4; - for (uint8_t place = 0; place < length; place++) { - // send_byte(*data); - if (pos >= 0) { - if (*data == 0xF7) { - // SEND_STRING("\nRD: "); - // for (uint8_t i = 0; i < start + place + 1; i++){ - // send_byte(midi_buffer[i]); - // SEND_STRING(" "); - // } - const unsigned decoded_length = sysex_decoded_length(pos); - uint8_t decoded[API_SYSEX_MAX_SIZE]; - sysex_decode(decoded, midi_buffer, pos); - process_api(decoded_length, decoded); - return; - } - else if (pos >= MIDI_SYSEX_BUFFER) { - return; - } - midi_buffer[pos] = *data; - } - // SEND_STRING(" "); - data++; - pos++; - } - #endif -} - - -#endif diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index a51573786..7364cdf7c 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h @@ -1,4 +1,4 @@ -/* +/* * Copyright 2012 Jun Wako * This file is based on: * LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse @@ -48,9 +48,6 @@ #include #include #include "host.h" -#ifdef MIDI_ENABLE - #include "process_midi.h" -#endif #ifdef __cplusplus extern "C" { #endif @@ -67,11 +64,6 @@ typedef struct { uint16_t usage; } __attribute__ ((packed)) report_extra_t; -#ifdef MIDI_ENABLE - void MIDI_Task(void); - MidiDevice midi_device; -#endif - #ifdef API_ENABLE #include "api.h" #endif diff --git a/tmk_core/protocol/midi.mk b/tmk_core/protocol/midi.mk index 4855b23d3..a5f76b2d3 100644 --- a/tmk_core/protocol/midi.mk +++ b/tmk_core/protocol/midi.mk @@ -5,6 +5,7 @@ SRC += midi.c \ bytequeue/bytequeue.c \ bytequeue/interrupt_setting.c \ sysex_tools.c \ + qmk_midi.c \ $(LUFA_SRC_USBCLASS) -VPATH += $(TMK_PATH)/$(MIDI_DIR) \ No newline at end of file +VPATH += $(TMK_PATH)/$(MIDI_DIR) diff --git a/tmk_core/protocol/midi/bytequeue/interrupt_setting.c b/tmk_core/protocol/midi/bytequeue/interrupt_setting.c index eafef527c..0ab8b5462 100755 --- a/tmk_core/protocol/midi/bytequeue/interrupt_setting.c +++ b/tmk_core/protocol/midi/bytequeue/interrupt_setting.c @@ -1,5 +1,5 @@ //Copyright 20010 Alex Norman -//writen by Alex Norman +//writen by Alex Norman // //This file is part of avr-bytequeue. // @@ -22,6 +22,7 @@ //implementations of the typedef and these functions #include "interrupt_setting.h" +#if defined(__AVR__) #include interrupt_setting_t store_and_clear_interrupt(void) { @@ -33,4 +34,16 @@ interrupt_setting_t store_and_clear_interrupt(void) { void restore_interrupt_setting(interrupt_setting_t setting) { SREG = setting; } +#elif defined(__arm__) +#include "ch.h" + +interrupt_setting_t store_and_clear_interrupt(void) { + chSysLock(); + return 0; +} + +void restore_interrupt_setting(interrupt_setting_t setting) { + chSysUnlock(); +} +#endif diff --git a/tmk_core/protocol/midi/qmk_midi.c b/tmk_core/protocol/midi/qmk_midi.c new file mode 100644 index 000000000..d4de6caa7 --- /dev/null +++ b/tmk_core/protocol/midi/qmk_midi.c @@ -0,0 +1,184 @@ +#include +#include "qmk_midi.h" +#include "sysex_tools.h" +#include "midi.h" +#include "usb_descriptor.h" +#include "process_midi.h" +#if API_SYSEX_ENABLE +#include "api.h" +#endif + +/******************************************************************************* + * MIDI + ******************************************************************************/ + +MidiDevice midi_device; + +#define SYSEX_START_OR_CONT 0x40 +#define SYSEX_ENDS_IN_1 0x50 +#define SYSEX_ENDS_IN_2 0x60 +#define SYSEX_ENDS_IN_3 0x70 + +#define SYS_COMMON_1 0x50 +#define SYS_COMMON_2 0x20 +#define SYS_COMMON_3 0x30 + +static void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2) { + MIDI_EventPacket_t event; + event.Data1 = byte0; + event.Data2 = byte1; + event.Data3 = byte2; + + uint8_t cable = 0; + + //if the length is undefined we assume it is a SYSEX message + if (midi_packet_length(byte0) == UNDEFINED) { + switch(cnt) { + case 3: + if (byte2 == SYSEX_END) + event.Event = MIDI_EVENT(cable, SYSEX_ENDS_IN_3); + else + event.Event = MIDI_EVENT(cable, SYSEX_START_OR_CONT); + break; + case 2: + if (byte1 == SYSEX_END) + event.Event = MIDI_EVENT(cable, SYSEX_ENDS_IN_2); + else + event.Event = MIDI_EVENT(cable, SYSEX_START_OR_CONT); + break; + case 1: + if (byte0 == SYSEX_END) + event.Event = MIDI_EVENT(cable, SYSEX_ENDS_IN_1); + else + event.Event = MIDI_EVENT(cable, SYSEX_START_OR_CONT); + break; + default: + return; //invalid cnt + } + } else { + //deal with 'system common' messages + //TODO are there any more? + switch(byte0 & 0xF0){ + case MIDI_SONGPOSITION: + event.Event = MIDI_EVENT(cable, SYS_COMMON_3); + break; + case MIDI_SONGSELECT: + case MIDI_TC_QUARTERFRAME: + event.Event = MIDI_EVENT(cable, SYS_COMMON_2); + break; + default: + event.Event = MIDI_EVENT(cable, byte0); + break; + } + } + + send_midi_packet(&event); +} + +static void usb_get_midi(MidiDevice * device) { + MIDI_EventPacket_t event; + while (recv_midi_packet(&event)) { + + midi_packet_length_t length = midi_packet_length(event.Data1); + uint8_t input[3]; + input[0] = event.Data1; + input[1] = event.Data2; + input[2] = event.Data3; + if (length == UNDEFINED) { + //sysex + if (event.Event == MIDI_EVENT(0, SYSEX_START_OR_CONT) || event.Event == MIDI_EVENT(0, SYSEX_ENDS_IN_3)) { + length = 3; + } else if (event.Event == MIDI_EVENT(0, SYSEX_ENDS_IN_2)) { + length = 2; + } else if(event.Event == MIDI_EVENT(0, SYSEX_ENDS_IN_1)) { + length = 1; + } else { + //XXX what to do? + } + } + + //pass the data to the device input function + if (length != UNDEFINED) + midi_device_input(device, length, input); + } +} + +static void fallthrough_callback(MidiDevice * device, + uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2){ + +#ifdef AUDIO_ENABLE + if (cnt == 3) { + switch (byte0 & 0xF0) { + case MIDI_NOTEON: + play_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0), (byte2 & 0x7F) / 8); + break; + case MIDI_NOTEOFF: + stop_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0)); + break; + } + } + if (byte0 == MIDI_STOP) { + stop_all_notes(); + } +#endif +} + + +static 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 API_SYSEX_ENABLE +uint8_t midi_buffer[MIDI_SYSEX_BUFFER] = {0}; + +static void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data) { + // SEND_STRING("\n"); + // send_word(start); + // SEND_STRING(": "); + // Don't store the header + int16_t pos = start - 4; + for (uint8_t place = 0; place < length; place++) { + // send_byte(*data); + if (pos >= 0) { + if (*data == 0xF7) { + // SEND_STRING("\nRD: "); + // for (uint8_t i = 0; i < start + place + 1; i++){ + // send_byte(midi_buffer[i]); + // SEND_STRING(" "); + // } + const unsigned decoded_length = sysex_decoded_length(pos); + uint8_t decoded[API_SYSEX_MAX_SIZE]; + sysex_decode(decoded, midi_buffer, pos); + process_api(decoded_length, decoded); + return; + } + else if (pos >= MIDI_SYSEX_BUFFER) { + return; + } + midi_buffer[pos] = *data; + } + // SEND_STRING(" "); + data++; + pos++; + } +} +#endif + +void midi_init(void); + +void setup_midi(void) +{ +#ifdef MIDI_ADVANCED + midi_init(); +#endif + midi_device_init(&midi_device); + midi_device_set_send_func(&midi_device, usb_send_func); + midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); + midi_register_fallthrough_callback(&midi_device, fallthrough_callback); + midi_register_cc_callback(&midi_device, cc_callback); +#ifdef API_SYSEX_ENABLE + midi_register_sysex_callback(&midi_device, sysex_callback); +#endif +} diff --git a/tmk_core/protocol/midi/qmk_midi.h b/tmk_core/protocol/midi/qmk_midi.h new file mode 100644 index 000000000..7282a19d4 --- /dev/null +++ b/tmk_core/protocol/midi/qmk_midi.h @@ -0,0 +1,9 @@ +#pragma once + +#ifdef MIDI_ENABLE + #include "midi.h" + extern MidiDevice midi_device; + void setup_midi(void); + void send_midi_packet(MIDI_EventPacket_t* event); + bool recv_midi_packet(MIDI_EventPacket_t* const event); +#endif diff --git a/tmk_core/protocol/lufa/descriptor.c b/tmk_core/protocol/usb_descriptor.c similarity index 97% rename from tmk_core/protocol/lufa/descriptor.c rename to tmk_core/protocol/usb_descriptor.c index bfa91f255..cab344675 100644 --- a/tmk_core/protocol/lufa/descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -38,7 +38,7 @@ #include "util.h" #include "report.h" -#include "descriptor.h" +#include "usb_descriptor.h" #ifndef USB_MAX_POWER_CONSUMPTION #define USB_MAX_POWER_CONSUMPTION 500 @@ -571,6 +571,19 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = #endif #ifdef MIDI_ENABLE + .Audio_Interface_Association = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation}, + + .FirstInterfaceIndex = AC_INTERFACE, + .TotalInterfaces = 2, + + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, + + .IADStrIndex = NO_DESCRIPTOR, + }, .Audio_ControlInterface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, @@ -622,8 +635,9 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .AudioSpecification = VERSION_BCD(1,0,0), - .TotalLength = (sizeof(USB_Descriptor_Configuration_t) - - offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC)) + .TotalLength = offsetof(USB_Descriptor_Configuration_t, MIDI_Out_Jack_Endpoint_SPC) + + sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t) + - offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC) }, .MIDI_In_Jack_Emb = @@ -879,9 +893,9 @@ const USB_Descriptor_String_t PROGMEM SerialNumberString = * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the * USB host. */ -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint16_t wIndex, - const void** const DescriptorAddress) +uint16_t get_usb_descriptor(const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorIndex = (wValue & 0xFF); diff --git a/tmk_core/protocol/lufa/descriptor.h b/tmk_core/protocol/usb_descriptor.h similarity index 79% rename from tmk_core/protocol/lufa/descriptor.h rename to tmk_core/protocol/usb_descriptor.h index 61c42c9df..1eedfe5a5 100644 --- a/tmk_core/protocol/lufa/descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -45,8 +45,9 @@ #define _DESCRIPTORS_H_ #include -#include - +#ifdef PROTOCOL_CHIBIOS +#include "hal.h" +#endif typedef struct { @@ -95,25 +96,26 @@ typedef struct #endif #ifdef MIDI_ENABLE - // MIDI Audio Control Interface - USB_Descriptor_Interface_t Audio_ControlInterface; - USB_Audio_Descriptor_Interface_AC_t Audio_ControlInterface_SPC; + USB_Descriptor_Interface_Association_t Audio_Interface_Association; + // MIDI Audio Control Interface + USB_Descriptor_Interface_t Audio_ControlInterface; + USB_Audio_Descriptor_Interface_AC_t Audio_ControlInterface_SPC; - // MIDI Audio Streaming Interface - USB_Descriptor_Interface_t Audio_StreamInterface; - USB_MIDI_Descriptor_AudioInterface_AS_t Audio_StreamInterface_SPC; - USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Emb; - USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Ext; - USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Emb; - USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Ext; - USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_In_Jack_Endpoint; - USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC; - USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_Out_Jack_Endpoint; - USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; + // MIDI Audio Streaming Interface + USB_Descriptor_Interface_t Audio_StreamInterface; + USB_MIDI_Descriptor_AudioInterface_AS_t Audio_StreamInterface_SPC; + USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Emb; + USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Ext; + USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Emb; + USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Ext; + USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_In_Jack_Endpoint; + USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC; + USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_Out_Jack_Endpoint; + USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; #endif #ifdef VIRTSER_ENABLE - USB_Descriptor_Interface_Association_t CDC_Interface_Association; + USB_Descriptor_Interface_Association_t CDC_Interface_Association; // CDC Control Interface USB_Descriptor_Interface_t CDC_CCI_Interface; @@ -208,8 +210,14 @@ typedef struct #ifdef CONSOLE_ENABLE # define CONSOLE_IN_EPNUM (RAW_OUT_EPNUM + 1) -//# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 2) +#ifdef PROTOCOL_CHIBIOS +// ChibiOS has enough memory and descriptor to actually enable the endpoint +// It could use the same endpoint numbers, as that's supported by ChibiOS +// But the QMK code currently assumes that the endpoint numbers are different +# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 2) +#else # define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 1) +#endif #else # define CONSOLE_OUT_EPNUM RAW_OUT_EPNUM #endif @@ -241,27 +249,24 @@ typedef struct # define CDC_OUT_EPNUM MIDI_STREAM_OUT_EPNUM #endif -#if (defined(__AVR_ATmega32U2__) && CDC_OUT_EPNUM > 4) || \ - (defined(__AVR_ATmega32U4__) && CDC_OUT_EPNUM > 6) -# error "Endpoints are not available enough to support all functions. Remove some in Makefile.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL)" +#if (defined(PROTOCOL_LUFA) && CDC_OUT_EPNUM > (ENDPOINT_TOTAL_ENDPOINTS - 1)) || \ + (defined(PROTOCOL_CHIBIOS) && CDC_OUT_EPNUM > USB_MAX_ENDPOINTS) +# error "There are not enough available endpoints to support all functions. Remove some in the rules.mk file.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL, STENO)" #endif #define KEYBOARD_EPSIZE 8 #define MOUSE_EPSIZE 8 #define EXTRAKEY_EPSIZE 8 -#define RAW_EPSIZE 32 +#define RAW_EPSIZE 32 #define CONSOLE_EPSIZE 32 #define NKRO_EPSIZE 32 #define MIDI_STREAM_EPSIZE 64 -#define CDC_NOTIFICATION_EPSIZE 8 +#define CDC_NOTIFICATION_EPSIZE 32 #define CDC_EPSIZE 16 - -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint16_t wIndex, - const void** const DescriptorAddress) - ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); - +uint16_t get_usb_descriptor(const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress); /* new API */ #if LUFA_VERSION_INTEGER < 0x140302 From 361810dca80b31b2ba236df8fdea48b89fedfd4d Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 25 Jan 2018 16:36:01 -0500 Subject: [PATCH 134/556] Only search through newly detected devices and discard ones that disappeared --- tmk_core/avr.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 24722736e..e11ba2e23 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -175,10 +175,11 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size ls /dev/tty* > /tmp/1; \ echo -e "Detecting USB port, reset your controller now.\c"; \ while [ -z $$USB ]; do \ - sleep 1; \ echo -e ".\c"; \ + sleep 0.5; \ ls /dev/tty* > /tmp/2; \ - USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ + USB=`comm -13 /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ + mv /tmp/2 /tmp/1; \ done; \ echo ""; \ echo "Detected controller on USB port at $$USB"; \ From c5d81a84a0519c78de1b5e165f5f2c1eb773bc11 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Mon, 29 Jan 2018 10:49:26 -0500 Subject: [PATCH 135/556] Switch from echo to printf for output without newlines --- tmk_core/avr.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index e11ba2e23..106b77150 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -172,11 +172,11 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size if grep -q -s Microsoft /proc/version; then \ echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ else \ + printf "Detecting USB port, reset your controller now."; \ ls /dev/tty* > /tmp/1; \ - echo -e "Detecting USB port, reset your controller now.\c"; \ while [ -z $$USB ]; do \ - echo -e ".\c"; \ sleep 0.5; \ + printf "."; \ ls /dev/tty* > /tmp/2; \ USB=`comm -13 /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ mv /tmp/2 /tmp/1; \ From 6835ae82095427b2b5d5b3839a8d54845244169b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 8 Feb 2018 12:16:06 -0800 Subject: [PATCH 136/556] Add the ability to disable Music Mode completely (#2339) * Skip process_music in NO_MUSIC_MODE is defined * Skip matrix_scan_music if NO_MUSIC_MODE is defined * Skip music_all_notes_off if NO_MUSIC_MODE is defined * Leave matrix_scan_music in, because it reduces firmware size by 150b.... * Add docs for NO_MUSIC_MODE --- docs/feature_audio.md | 4 ++++ keyboards/orthodox/keymaps/drashna/config.h | 1 + quantum/quantum.c | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 6b991a9af..c7133b295 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -82,6 +82,10 @@ The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, a #define PITCH_STANDARD_A 432.0f +You can completely disable Music Mode as well. This is useful, if you're pressed for space on your controller. To disable it, add this to your `confid.h`: + + #define NO_MUSIC_MODE + ## MIDI Functionality This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index c83380bd0..107f16d58 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -69,6 +69,7 @@ along with this program. If not, see . #ifdef AUDIO_ENABLE #define C6_AUDIO #define STARTUP_SONG SONG(IMPERIAL_MARCH) +#define NO_MUSIC_MODE #endif #undef PRODUCT diff --git a/quantum/quantum.c b/quantum/quantum.c index bd95d5ea8..66feca2f2 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -147,7 +147,7 @@ void reset_keyboard(void) { #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) process_midi_all_notes_off(); #endif -#if defined(AUDIO_ENABLE) +#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) music_all_notes_off(); uint16_t timer_start = timer_read(); PLAY_SONG(goodbye_song); @@ -236,7 +236,7 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef STENO_ENABLE process_steno(keycode, record) && #endif - #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) + #if ( defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE) process_music(keycode, record) && #endif #ifdef TAP_DANCE_ENABLE @@ -834,7 +834,7 @@ void matrix_init_quantum() { } void matrix_scan_quantum() { - #ifdef AUDIO_ENABLE + #if defined(AUDIO_ENABLE) matrix_scan_music(); #endif From fae81322959a2e6877238ca4e542cac805a2e7c2 Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Tue, 6 Feb 2018 12:05:48 -0800 Subject: [PATCH 137/556] make check_size work across platforms --- tmk_core/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index a1df7fc28..18aef8d8c 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -371,7 +371,7 @@ show_path: @echo OBJ=$(OBJ) check-size: - $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | perl -ne 'print "$&\n" if /(?<=AVR_SIZE: ).+/'`; echo $$(($$n)) || echo 0)) + $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'`; echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ From fca31693df15f62cc3fd5851a0d1bae40eb179c2 Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Tue, 6 Feb 2018 16:32:31 -0800 Subject: [PATCH 138/556] add conditional to perform check-size only for supported architectures --- tmk_core/rules.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 18aef8d8c..ff6af4a88 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -370,6 +370,7 @@ show_path: @echo SRC=$(SRC) @echo OBJ=$(OBJ) +ifeq ($(CC),avr-gcc) check-size: $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'`; echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) @@ -377,6 +378,10 @@ check-size: $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then $(PRINT_WARNING_PLAIN); $(SILENT) || printf " * $(MSG_FILE_TOO_BIG)" ; else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \ fi +else +check-size: + echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)" +endif # Create build directory $(shell mkdir -p $(BUILD_DIR) 2>/dev/null) From 8c2ae4a4701439e98569dc2f2acee7016b4c0f20 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 10 Feb 2018 23:09:03 +0200 Subject: [PATCH 139/556] Fix reset for STM32 devices --- .../60/boards/GENERIC_STM32_F303XC/board.c | 4 ++- .../60/boards/GENERIC_STM32_F303XC/board.h | 4 +-- keyboards/clueboard/60/rules.mk | 2 +- tmk_core/common/chibios/bootloader.c | 34 +++++++++---------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.c b/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.c index 897f20a88..4331155df 100644 --- a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.c +++ b/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.c @@ -62,13 +62,15 @@ const PALConfig pal_default_config = { }; #endif +void enter_bootloader_mode_if_requested(void); + /** * @brief Early initialization code. * @details This initialization must be performed just after stack setup * and before any other initialization. */ void __early_init(void) { - + enter_bootloader_mode_if_requested(); stm32_clock_init(); } diff --git a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h b/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h index 7405c0ea9..e09112eb9 100644 --- a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h +++ b/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h @@ -1164,14 +1164,14 @@ /* * USB bus activation macro, required by the USB driver. */ -// #define usb_lld_connect_bus(usbp) +// #define usb_lld_connect_bus(usbp) #define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) // #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) /* * USB bus de-activation macro, required by the USB driver. */ // #define usb_lld_disconnect_bus(usbp) -#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)) +#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) // #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) #if !defined(_FROM_ASM_) diff --git a/keyboards/clueboard/60/rules.mk b/keyboards/clueboard/60/rules.mk index e0c4b8502..3664b6d2c 100644 --- a/keyboards/clueboard/60/rules.mk +++ b/keyboards/clueboard/60/rules.mk @@ -37,7 +37,7 @@ USE_FPU = yes OPT_DEFS = # Options to pass to dfu-util when flashing -DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000 -R +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave # Build Options # comment out to disable the options. diff --git a/tmk_core/common/chibios/bootloader.c b/tmk_core/common/chibios/bootloader.c index fc17fca1b..2dd3ade34 100644 --- a/tmk_core/common/chibios/bootloader.c +++ b/tmk_core/common/chibios/bootloader.c @@ -6,32 +6,32 @@ #ifdef STM32_BOOTLOADER_ADDRESS /* STM32 */ -#if defined(STM32F0XX) /* This code should be checked whether it runs correctly on platforms */ #define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) extern uint32_t __ram0_end__; +#define BOOTLOADER_MAGIC 0xDEADBEEF +#define MAGIC_ADDR (unsigned long*)(SYMVAL(__ram0_end__) - 4) + void bootloader_jump(void) { - *((unsigned long *)(SYMVAL(__ram0_end__) - 4)) = 0xDEADBEEF; // set magic flag => reset handler will jump into boot loader + *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader NVIC_SystemReset(); } -#elif defined(STM32F3XX) -/* This code should be checked whether it runs correctly on platforms. - * It was added for clueboard60 BUT HAS NOT BEEN TESTED. - * FIXME - Test this - */ -#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) -extern uint32_t __ram0_end__; +void enter_bootloader_mode_if_requested(void) { + unsigned long* check = MAGIC_ADDR; + if(*check == BOOTLOADER_MAGIC) { + *check = 0; + __set_CONTROL(0); + __set_MSP(*(__IO uint32_t*)STM32_BOOTLOADER_ADDRESS); + __enable_irq(); -void bootloader_jump(void) { - *((unsigned long *)(SYMVAL(__ram0_end__) - 4)) = 0xDEADBEEF; // set magic flag => reset handler will jump into boot loader - NVIC_SystemReset(); -} - -#else /* defined(STM32F0XX) */ -#error Check that the bootloader code works on your platform and add it to bootloader.c! -#endif /* defined(STM32F0XX) */ + typedef void (*BootJump_t)(void); + BootJump_t boot_jump = *(BootJump_t*)(STM32_BOOTLOADER_ADDRESS + 4); + boot_jump(); + while(1); + } + } #elif defined(KL2x) || defined(K20x) /* STM32_BOOTLOADER_ADDRESS */ /* Kinetis */ From a972b262748efe977d9a0f8f47fdc36dc9c787e3 Mon Sep 17 00:00:00 2001 From: Jason Barnachea Date: Sat, 10 Feb 2018 14:24:54 -0800 Subject: [PATCH 140/556] Add JC65 ps2avrGB keyboard (#2351) * Adds JC65 ps2avrGB keyboard * Adds default keymap * Adds personal keymap * Backlight On/off support Migrated code from the BFake. Functionality only on BL_ON, BL_OFF, BL_TOGG. * Backlighting config adjustment Only 1 level supported. * Personal keymap update BL toggle added and RGB layer updates. * Renamed jc65 ps2avrgb directory Renamed directory for more clarity. * Default keymap and default rules * Personal keymap and personal rules * Group JC65 QMK and PS2 versions Group JC65 QMK and PS2 versions, Split directories, Readme for parent folder. * Default keycaps and personal keymaps re-added Default and personal keymaps re-added. Keymaps, Readme, Rules.mk, and config.h * v32a default keymap rules Default to no. * RGB and Backlight default settings Set to yes. * Rules.mk defaults for personal keymap Rules.mk defaults for personal keymap * Revised keyboard readme make paths Revised. * Path correction * jc65 default folder set set default pcb to qmk version * default rules for v32a set to enable backlight and rgb by default. --- keyboards/jc65/jc65.c | 35 -- keyboards/jc65/jc65.h | 21 +- keyboards/jc65/readme.md | 18 +- keyboards/jc65/rules.mk | 69 +-- keyboards/jc65/v32a/config.h | 46 ++ keyboards/jc65/v32a/i2c.c | 106 +++++ keyboards/jc65/v32a/i2c.h | 27 ++ keyboards/jc65/v32a/keymaps/default/keymap.c | 11 + keyboards/jc65/v32a/keymaps/default/readme.md | 10 + keyboards/jc65/v32a/keymaps/default/rules.mk | 2 + keyboards/jc65/v32a/keymaps/naut/keymap.c | 81 ++++ keyboards/jc65/v32a/keymaps/naut/readme.md | 16 + keyboards/jc65/v32a/keymaps/naut/rules.mk | 2 + keyboards/jc65/v32a/matrix.c | 106 +++++ keyboards/jc65/v32a/readme.md | 24 ++ keyboards/jc65/v32a/rules.mk | 50 +++ keyboards/jc65/v32a/usbconfig.h | 396 ++++++++++++++++++ keyboards/jc65/v32a/v32a.c | 65 +++ keyboards/jc65/v32a/v32a.h | 58 +++ keyboards/jc65/{ => v32u4}/config.h | 0 .../jc65/{ => v32u4}/keymaps/coth/config.h | 0 .../jc65/{ => v32u4}/keymaps/coth/keymap.c | 2 +- .../jc65/{ => v32u4}/keymaps/coth/readme.md | 0 .../jc65/{ => v32u4}/keymaps/coth/rules.mk | 0 .../jc65/{ => v32u4}/keymaps/default/config.h | 0 .../jc65/{ => v32u4}/keymaps/default/keymap.c | 2 +- .../{ => v32u4}/keymaps/default/readme.md | 0 .../jc65/{ => v32u4}/keymaps/default/rules.mk | 0 .../keymaps/jetpacktuxedo/config.h | 0 .../keymaps/jetpacktuxedo/keymap.c | 2 +- .../keymaps/jetpacktuxedo/readme.md | 0 .../keymaps/jetpacktuxedo/rules.mk | 0 .../{ => v32u4}/keymaps/na7thana/config.h | 0 .../{ => v32u4}/keymaps/na7thana/keymap.c | 2 +- .../{ => v32u4}/keymaps/na7thana/readme.md | 0 .../{ => v32u4}/keymaps/na7thana/rules.mk | 0 keyboards/jc65/v32u4/readme.md | 22 + keyboards/jc65/v32u4/rules.mk | 68 +++ keyboards/jc65/v32u4/v32u4.c | 36 ++ keyboards/jc65/v32u4/v32u4.h | 21 + 40 files changed, 1164 insertions(+), 134 deletions(-) create mode 100644 keyboards/jc65/v32a/config.h create mode 100644 keyboards/jc65/v32a/i2c.c create mode 100644 keyboards/jc65/v32a/i2c.h create mode 100644 keyboards/jc65/v32a/keymaps/default/keymap.c create mode 100644 keyboards/jc65/v32a/keymaps/default/readme.md create mode 100644 keyboards/jc65/v32a/keymaps/default/rules.mk create mode 100644 keyboards/jc65/v32a/keymaps/naut/keymap.c create mode 100644 keyboards/jc65/v32a/keymaps/naut/readme.md create mode 100644 keyboards/jc65/v32a/keymaps/naut/rules.mk create mode 100644 keyboards/jc65/v32a/matrix.c create mode 100644 keyboards/jc65/v32a/readme.md create mode 100644 keyboards/jc65/v32a/rules.mk create mode 100644 keyboards/jc65/v32a/usbconfig.h create mode 100644 keyboards/jc65/v32a/v32a.c create mode 100644 keyboards/jc65/v32a/v32a.h rename keyboards/jc65/{ => v32u4}/config.h (100%) rename keyboards/jc65/{ => v32u4}/keymaps/coth/config.h (100%) rename keyboards/jc65/{ => v32u4}/keymaps/coth/keymap.c (99%) rename keyboards/jc65/{ => v32u4}/keymaps/coth/readme.md (100%) rename keyboards/jc65/{ => v32u4}/keymaps/coth/rules.mk (100%) rename keyboards/jc65/{ => v32u4}/keymaps/default/config.h (100%) rename keyboards/jc65/{ => v32u4}/keymaps/default/keymap.c (97%) rename keyboards/jc65/{ => v32u4}/keymaps/default/readme.md (100%) rename keyboards/jc65/{ => v32u4}/keymaps/default/rules.mk (100%) rename keyboards/jc65/{ => v32u4}/keymaps/jetpacktuxedo/config.h (100%) rename keyboards/jc65/{ => v32u4}/keymaps/jetpacktuxedo/keymap.c (99%) rename keyboards/jc65/{ => v32u4}/keymaps/jetpacktuxedo/readme.md (100%) rename keyboards/jc65/{ => v32u4}/keymaps/jetpacktuxedo/rules.mk (100%) rename keyboards/jc65/{ => v32u4}/keymaps/na7thana/config.h (100%) rename keyboards/jc65/{ => v32u4}/keymaps/na7thana/keymap.c (98%) rename keyboards/jc65/{ => v32u4}/keymaps/na7thana/readme.md (100%) rename keyboards/jc65/{ => v32u4}/keymaps/na7thana/rules.mk (100%) create mode 100644 keyboards/jc65/v32u4/readme.md create mode 100644 keyboards/jc65/v32u4/rules.mk create mode 100644 keyboards/jc65/v32u4/v32u4.c create mode 100644 keyboards/jc65/v32u4/v32u4.h diff --git a/keyboards/jc65/jc65.c b/keyboards/jc65/jc65.c index 6f51c0d6e..a4bd86874 100644 --- a/keyboards/jc65/jc65.c +++ b/keyboards/jc65/jc65.c @@ -1,36 +1 @@ #include "jc65.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - if (usb_led & (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5679 +#define MANUFACTURER winkeyless.kr +#define PRODUCT JC65 PS2AVRGB + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 16 + +#define NO_BACKLIGHT_CLOCK +#define BACKLIGHT_LEVELS 1 +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 + +#define NO_UART 1 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#endif diff --git a/keyboards/jc65/v32a/i2c.c b/keyboards/jc65/v32a/i2c.c new file mode 100644 index 000000000..a4f952135 --- /dev/null +++ b/keyboards/jc65/v32a/i2c.c @@ -0,0 +1,106 @@ +/* +Copyright 2016 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +// Please do not modify this file + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +// Please do not modify this file + +#ifndef __I2C_H__ +#define __I2C_H__ + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + +#endif diff --git a/keyboards/jc65/v32a/keymaps/default/keymap.c b/keyboards/jc65/v32a/keymaps/default/keymap.c new file mode 100644 index 000000000..de7a7135a --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/default/keymap.c @@ -0,0 +1,11 @@ +#include "v32a.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSLS,KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT,KC_NUHS, KC_ENT,KC_PGUP, + KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP,KC_PGDN, + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT,KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT + ), +}; diff --git a/keyboards/jc65/v32a/keymaps/default/readme.md b/keyboards/jc65/v32a/keymaps/default/readme.md new file mode 100644 index 000000000..61e55f3ce --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/default/readme.md @@ -0,0 +1,10 @@ +Default Keymap +======= + +Default plain keymap with only a base layer. + +Keymap Maintainer: [Jason Barnachea](https://github.com/nautxx) + +Difference from base layout: None. + +Intended usage: Reference layout. diff --git a/keyboards/jc65/v32a/keymaps/default/rules.mk b/keyboards/jc65/v32a/keymaps/default/rules.mk new file mode 100644 index 000000000..d7463419b --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/keyboards/jc65/v32a/keymaps/naut/keymap.c b/keyboards/jc65/v32a/keymaps/naut/keymap.c new file mode 100644 index 000000000..90c5a221b --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/naut/keymap.c @@ -0,0 +1,81 @@ +#include "v32a.h" + +// Define Layers +#define _BASE 0 +#define _FNX 1 +#define _MAC 2 +#define _RGB 3 + +// Define Macros +#define M_PRTS M(0) +#define M_PRTA M(1) +#define M_MSSN M(2) +#define M_APPS M(3) +#define M_SPOT M(4) +#define M_LEFT M(5) +#define M_RGHT M(6) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Base Layer + [_BASE] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSLS, KC_GRV, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC, KC_BSPC, KC_DEL, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_NO, KC_ENT,KC_PGUP, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP,KC_PGDN, + MO(1),KC_LALT,KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_NO,KC_RALT,KC_LEFT,KC_DOWN,KC_RGHT + ), + // Fn Layer + [_FNX] = KEYMAP( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,KC_TRNS,KC_TRNS, TG(3), + KC_CAPS,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_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, TG(2),KC_VOLU,KC_MPLY, + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_MRWD,KC_VOLD,KC_MFFD + ), + // Mac Layer + [_MAC] = KEYMAP( + TO(0), KC_F14, KC_F15, M_APPS, M_MSSN, KC_F11, KC_F12,KC_MRWD,KC_MPLY,KC_MFFD,KC_MUTE,KC_VOLD,KC_VOLU,KC_EJCT, KC_NO, KC_NO, + KC_TRNS, M_PRTS, M_PRTA,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_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, TO(0), M_MSSN,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, M_SPOT, M_SPOT, M_SPOT, KC_TRNS,KC_TRNS,KC_TRNS, M_LEFT, M_APPS, M_RGHT + ), + // RGB and BL Layer + [_RGB] = KEYMAP( + TO(0), 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, TO(0), + KC_NO,RGB_HUD,RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,BL_TOGG, + KC_NO,RGB_SAD,RGB_SAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,RGB_TOG, + KC_NO, KC_NO,RGB_VAD,RGB_VAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,RGB_MOD,RGB_RMOD, KC_NO,RGB_M_P,RGB_M_R, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,RGB_M_G,RGB_M_SW + ), +}; + +// The Macros +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + if (record->event.pressed) { + switch(id) { + case 0: + return MACRO(D(LGUI), D(LSFT), T(3), U(LSFT), U(LGUI), END); //Mac print screen + break; + case 1: + return MACRO(D(LGUI), D(LSFT), T(4), U(LSFT), U(LGUI), END); //Mac print area + break; + case 2: + return MACRO(D(LCTL), T(UP), U(LCTL), END); //Mac mission control + break; + case 3: + return MACRO(D(LCTL), T(DOWN), U(LCTL), END); //Mac applications + break; + case 4: + return MACRO(D(LGUI), T(SPC), U(LGUI), END); //Mac spotlight search + break; + case 5: + return MACRO(D(LCTL), T(LEFT), U(LCTL), END); //Mac mission left + break; + case 6: + return MACRO(D(LGUI), T(RGHT), U(LGUI), END); //Mac mission right + break; + } + } + return MACRO_NONE; +}; \ No newline at end of file diff --git a/keyboards/jc65/v32a/keymaps/naut/readme.md b/keyboards/jc65/v32a/keymaps/naut/readme.md new file mode 100644 index 000000000..e7d109666 --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/naut/readme.md @@ -0,0 +1,16 @@ +Naut's Keymap +======= + +Layer 1: HHKB Split backspace, 6.25u space, control on caps, Fn on L-Ctl. + +Layer 2: F Row on numrow, caps on tab, media shortcuts on arrows + +Layer 3: Mac Media buttons on numrow + +Layer 4: RGB control + +Keymap Maintainer: [Jason Barnachea](https://github.com/nautxx) + +Difference from base layout: HHKBish layout. HHKB Fn layer. Mac media layer. RGB control layer. + +Intended usage: Daily driver for keyboard peacocking. diff --git a/keyboards/jc65/v32a/keymaps/naut/rules.mk b/keyboards/jc65/v32a/keymaps/naut/rules.mk new file mode 100644 index 000000000..d7463419b --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/naut/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/keyboards/jc65/v32a/matrix.c b/keyboards/jc65/v32a/matrix.c new file mode 100644 index 000000000..57aa36b5f --- /dev/null +++ b/keyboards/jc65/v32a/matrix.c @@ -0,0 +1,106 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include + +#include "matrix.h" + +#ifndef DEBOUNCE +#define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +void matrix_init(void) { + // all outputs for rows high + DDRB = 0xFF; + PORTB = 0xFF; + // all inputs for columns + DDRA = 0x00; + DDRC &= ~(0x111111<<2); + DDRD &= ~(1<> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + +uint8_t matrix_scan(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + matrix_set_row_status(row); + _delay_us(5); + + matrix_row_t cols = ( + // cols 0..7, PORTA 0 -> 7 + (~PINA) & 0xFF + ) | ( + // cols 8..13, PORTC 7 -> 0 + bit_reverse((~PINC) & 0xFF) << 8 + ) | ( + // col 14, PORTD 7 + ((~PIND) & (1 << PIND7)) << 7 + ); + + if (matrix_debouncing[row] != cols) { + matrix_debouncing[row] = cols; + debouncing = DEBOUNCE; + } + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_user(); + + return 1; +} + +inline matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { +} diff --git a/keyboards/jc65/v32a/readme.md b/keyboards/jc65/v32a/readme.md new file mode 100644 index 000000000..976217f10 --- /dev/null +++ b/keyboards/jc65/v32a/readme.md @@ -0,0 +1,24 @@ +JC65 ps2avrGB +======= + +A 65% keyboard with RGB + +Keyboard Maintainer: [Jason Barnachea](https://github.com/nautxx) + +Hardware Supported: JC65 rev.ps2avrgb + +Hardware Availability: [keyclack.com](https://keyclack.com/) + +The JC65 PCB actually has two revisions: A QMK native version, and a PS2AVRGB version. Jchan offered both PCBs as options during the M65-A Round 1 group buy, and were also available choices for the 65% acrylic case group buy. In the near future both PCB versions should be available from keyclack.com when the storefront part opens. + +These docs are for the PS2AVRGB version of the PCB. More info on qmk.fm + +Make example for this keyboard (after setting up your build environment): + + make jc65/v32a:default + +Flash example for this keyboard: + + bootloadHID -r jc65_v32a_default.hex + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/jc65/v32a/rules.mk b/keyboards/jc65/v32a/rules.mk new file mode 100644 index 000000000..1ea19fe00 --- /dev/null +++ b/keyboards/jc65/v32a/rules.mk @@ -0,0 +1,50 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/jc65/v32a/usbconfig.h b/keyboards/jc65/v32a/usbconfig.h new file mode 100644 index 000000000..d2d848fcd --- /dev/null +++ b/keyboards/jc65/v32a/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/jc65/v32a/v32a.c b/keyboards/jc65/v32a/v32a.c new file mode 100644 index 000000000..621789423 --- /dev/null +++ b/keyboards/jc65/v32a/v32a.c @@ -0,0 +1,65 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "v32a.h" +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +#include + +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { + rgblight_task(); +} + +void backlight_init_ports(void) { + DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // Turn out the lights + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); + } else { + // Turn on the lights + PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + } +} \ No newline at end of file diff --git a/keyboards/jc65/v32a/v32a.h b/keyboards/jc65/v32a/v32a.h new file mode 100644 index 000000000..00464141b --- /dev/null +++ b/keyboards/jc65/v32a/v32a.h @@ -0,0 +1,58 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef V32A_H +#define V32A_H + +#include "quantum.h" + +#define KEYMAP( \ + K04,K14,K24,K34,K44,K54,K16,KB6,KB7,K17,KA4,KB4,KC4,KD4,KE4,KD0, \ + K03,K13,K23,K33,K43,K53,K26,KC6,KC7,K27,KA3,KB3,KC3, KD3,K67, \ + K02,K12,K22,K32,K42,K52,K36,KD6,KD7,K37,KA2,KB2,KC2, KD2,K87, \ + K01,K30,K11,K21,K31,K41,K51,K46,KE6,KE7,K47,KA1, KB1,K86,K77, \ + K00,K10,K20, K40,K56,K50, K57,KB0,KC0,K96,K76,K66 \ +){ \ + { K00, K10, K20, K30, K40, K50,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KB0, KC0, KD0,KC_NO,KC_NO }, \ + { K01, K11, K21, K31, K41, K51,KC_NO,KC_NO,KC_NO,KC_NO, KA1, KB1,KC_NO,KC_NO,KC_NO,KC_NO }, \ + { K02, K12, K22, K32, K42, K52,KC_NO,KC_NO,KC_NO,KC_NO, KA2, KB2, KC2, KD2,KC_NO,KC_NO }, \ + { K03, K13, K23, K33, K43, K53,KC_NO,KC_NO,KC_NO,KC_NO, KA3, KB3, KC3, KD3,KC_NO,KC_NO }, \ + { K04, K14, K24, K34, K44, K54,KC_NO,KC_NO,KC_NO,KC_NO, KA4, KB4, KC4, KD4, KE4,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,KC_NO,KC_NO,KC_NO }, \ + { KC_NO, K16, K26, K36, K46, K56, K66, K76, K86, K96,KC_NO, KB6, KC6, KD6, KE6,KC_NO }, \ + { KC_NO, K17, K27, K37, K47, K57, K67, K77, K87,KC_NO,KC_NO, KB7, KC7, KD7, KE7,KC_NO } \ +} + +#define KC_KEYMAP( \ + K04,K14,K24,K34,K44,K54,K16,KB6,KB7,K17,KA4,KB4,KC4,KD4,KE4,KD0, \ + K03,K13,K23,K33,K43,K53,K26,KC6,KC7,K27,KA3,KB3,KC3, KD3,K67, \ + K02,K12,K22,K32,K42,K52,K36,KD6,KD7,K37,KA2,KB2,KC2, KD2,K87, \ + K01,K30,K11,K21,K31,K41,K51,K46,KE6,KE7,K47,KA1, KB1,K86,K77, \ + K00,K10,K20, K40,K56,K50, K57,KB0,KC0,K96,K76,K66 \ +) \ +{ \ + { KC_##K00,KC_##K10,KC_##K20,KC_##K30,KC_##K40,KC_##K50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KB0,KC_##KC0,KC_##KD0, KC_NO,KC_NO }, \ + { KC_##K01,KC_##K11,KC_##K21,KC_##K31,KC_##K41,KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA1,KC_##KB1, KC_NO, KC_NO, KC_NO,KC_NO }, \ + { KC_##K02,KC_##K12,KC_##K22,KC_##K32,KC_##K42,KC_##K52, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA2,KC_##KB2,KC_##KC2,KC_##KD2, KC_NO,KC_NO }, \ + { KC_##K03,KC_##K13,KC_##K23,KC_##K33,KC_##K43,KC_##K53, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA3,KC_##KB3,KC_##KC3,KC_##KD3, KC_NO,KC_NO }, \ + { KC_##K04,KC_##K14,KC_##K24,KC_##K34,KC_##K44,KC_##K54, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA4,KC_##KB4,KC_##KC4,KC_##KD4,KC_##KE4,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, KC_NO, KC_NO,KC_NO }, \ + { KC_NO,KC_##K16,KC_##K26,KC_##K36,KC_##K46,KC_##K56,KC_##K66,KC_##K76,KC_##K86,KC_##K96, KC_NO,KC_##KB6,KC_##KC6,KC_##KD6,KC_##KE6,KC_NO }, \ + { KC_NO,KC_##K17,KC_##K27,KC_##K37,KC_##K47,KC_##K57,KC_##K67,KC_##K77,KC_##K87, KC_NO, KC_NO,KC_##KB7,KC_##KC7,KC_##KD7,KC_##KE7,KC_NO } \ +} + +#endif diff --git a/keyboards/jc65/config.h b/keyboards/jc65/v32u4/config.h similarity index 100% rename from keyboards/jc65/config.h rename to keyboards/jc65/v32u4/config.h diff --git a/keyboards/jc65/keymaps/coth/config.h b/keyboards/jc65/v32u4/keymaps/coth/config.h similarity index 100% rename from keyboards/jc65/keymaps/coth/config.h rename to keyboards/jc65/v32u4/keymaps/coth/config.h diff --git a/keyboards/jc65/keymaps/coth/keymap.c b/keyboards/jc65/v32u4/keymaps/coth/keymap.c similarity index 99% rename from keyboards/jc65/keymaps/coth/keymap.c rename to keyboards/jc65/v32u4/keymaps/coth/keymap.c index be7a98b85..d6c1dacf5 100644 --- a/keyboards/jc65/keymaps/coth/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/coth/keymap.c @@ -1,4 +1,4 @@ -#include "jc65.h" +#include "v32u4.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( diff --git a/keyboards/jc65/keymaps/coth/readme.md b/keyboards/jc65/v32u4/keymaps/coth/readme.md similarity index 100% rename from keyboards/jc65/keymaps/coth/readme.md rename to keyboards/jc65/v32u4/keymaps/coth/readme.md diff --git a/keyboards/jc65/keymaps/coth/rules.mk b/keyboards/jc65/v32u4/keymaps/coth/rules.mk similarity index 100% rename from keyboards/jc65/keymaps/coth/rules.mk rename to keyboards/jc65/v32u4/keymaps/coth/rules.mk diff --git a/keyboards/jc65/keymaps/default/config.h b/keyboards/jc65/v32u4/keymaps/default/config.h similarity index 100% rename from keyboards/jc65/keymaps/default/config.h rename to keyboards/jc65/v32u4/keymaps/default/config.h diff --git a/keyboards/jc65/keymaps/default/keymap.c b/keyboards/jc65/v32u4/keymaps/default/keymap.c similarity index 97% rename from keyboards/jc65/keymaps/default/keymap.c rename to keyboards/jc65/v32u4/keymaps/default/keymap.c index de787f389..9c9e0f1f8 100644 --- a/keyboards/jc65/keymaps/default/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "jc65.h" +#include "v32u4.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( diff --git a/keyboards/jc65/keymaps/default/readme.md b/keyboards/jc65/v32u4/keymaps/default/readme.md similarity index 100% rename from keyboards/jc65/keymaps/default/readme.md rename to keyboards/jc65/v32u4/keymaps/default/readme.md diff --git a/keyboards/jc65/keymaps/default/rules.mk b/keyboards/jc65/v32u4/keymaps/default/rules.mk similarity index 100% rename from keyboards/jc65/keymaps/default/rules.mk rename to keyboards/jc65/v32u4/keymaps/default/rules.mk diff --git a/keyboards/jc65/keymaps/jetpacktuxedo/config.h b/keyboards/jc65/v32u4/keymaps/jetpacktuxedo/config.h similarity index 100% rename from keyboards/jc65/keymaps/jetpacktuxedo/config.h rename to keyboards/jc65/v32u4/keymaps/jetpacktuxedo/config.h diff --git a/keyboards/jc65/keymaps/jetpacktuxedo/keymap.c b/keyboards/jc65/v32u4/keymaps/jetpacktuxedo/keymap.c similarity index 99% rename from keyboards/jc65/keymaps/jetpacktuxedo/keymap.c rename to keyboards/jc65/v32u4/keymaps/jetpacktuxedo/keymap.c index af02b6f10..451b43124 100644 --- a/keyboards/jc65/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/jetpacktuxedo/keymap.c @@ -1,4 +1,4 @@ -#include "jc65.h" +#include "v32u4.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( diff --git a/keyboards/jc65/keymaps/jetpacktuxedo/readme.md b/keyboards/jc65/v32u4/keymaps/jetpacktuxedo/readme.md similarity index 100% rename from keyboards/jc65/keymaps/jetpacktuxedo/readme.md rename to keyboards/jc65/v32u4/keymaps/jetpacktuxedo/readme.md diff --git a/keyboards/jc65/keymaps/jetpacktuxedo/rules.mk b/keyboards/jc65/v32u4/keymaps/jetpacktuxedo/rules.mk similarity index 100% rename from keyboards/jc65/keymaps/jetpacktuxedo/rules.mk rename to keyboards/jc65/v32u4/keymaps/jetpacktuxedo/rules.mk diff --git a/keyboards/jc65/keymaps/na7thana/config.h b/keyboards/jc65/v32u4/keymaps/na7thana/config.h similarity index 100% rename from keyboards/jc65/keymaps/na7thana/config.h rename to keyboards/jc65/v32u4/keymaps/na7thana/config.h diff --git a/keyboards/jc65/keymaps/na7thana/keymap.c b/keyboards/jc65/v32u4/keymaps/na7thana/keymap.c similarity index 98% rename from keyboards/jc65/keymaps/na7thana/keymap.c rename to keyboards/jc65/v32u4/keymaps/na7thana/keymap.c index 2f262efa9..2e61e95d3 100644 --- a/keyboards/jc65/keymaps/na7thana/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/na7thana/keymap.c @@ -1,4 +1,4 @@ -#include "jc65.h" +#include "v32u4.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( diff --git a/keyboards/jc65/keymaps/na7thana/readme.md b/keyboards/jc65/v32u4/keymaps/na7thana/readme.md similarity index 100% rename from keyboards/jc65/keymaps/na7thana/readme.md rename to keyboards/jc65/v32u4/keymaps/na7thana/readme.md diff --git a/keyboards/jc65/keymaps/na7thana/rules.mk b/keyboards/jc65/v32u4/keymaps/na7thana/rules.mk similarity index 100% rename from keyboards/jc65/keymaps/na7thana/rules.mk rename to keyboards/jc65/v32u4/keymaps/na7thana/rules.mk diff --git a/keyboards/jc65/v32u4/readme.md b/keyboards/jc65/v32u4/readme.md new file mode 100644 index 000000000..c6a2b2b8f --- /dev/null +++ b/keyboards/jc65/v32u4/readme.md @@ -0,0 +1,22 @@ +JC65 +=== + +![JC65](https://imgur.com/a/C2oa5) + +The JC65 PCB actually has two revisions: A QMK native version, and a PS2AVRGB version. Jchan offered both PCBs as options during the M65-A Round 1 group buy, and were also available choices for the 65% acrylic case group buy. In the near future both PCB versions should be available from keyclack.com when the storefront part opens. + +These docs are for the QMK version of the PCB. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Ethan Madden](https://github.com/jetpacktuxedo) +Hardware Supported: JC65 rev.qmk +Hardware Availability: [keyclack.com](https://keyclack.com/) + +Make example for this keyboard (after setting up your build environment): + + make jc65/v32u4:default + +Or to make and flash: + + make jc65/v32u4:default:dfu + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/jc65/v32u4/rules.mk b/keyboards/jc65/v32u4/rules.mk new file mode 100644 index 000000000..c2c02b614 --- /dev/null +++ b/keyboards/jc65/v32u4/rules.mk @@ -0,0 +1,68 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +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 +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 diff --git a/keyboards/jc65/v32u4/v32u4.c b/keyboards/jc65/v32u4/v32u4.c new file mode 100644 index 000000000..c69c5d531 --- /dev/null +++ b/keyboards/jc65/v32u4/v32u4.c @@ -0,0 +1,36 @@ +#include "v32u4.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (usb_led & (1< Date: Sun, 4 Feb 2018 15:05:22 -0800 Subject: [PATCH 141/556] Added raylas keymap for TADA68 --- keyboards/tada68/keymaps/raylas/keymap.c | 52 +++++++++++++++++++++++ keyboards/tada68/keymaps/raylas/readme.md | 6 +++ keyboards/tada68/keymaps/raylas/rules.mk | 21 +++++++++ 3 files changed, 79 insertions(+) create mode 100755 keyboards/tada68/keymaps/raylas/keymap.c create mode 100755 keyboards/tada68/keymaps/raylas/readme.md create mode 100644 keyboards/tada68/keymaps/raylas/rules.mk diff --git a/keyboards/tada68/keymaps/raylas/keymap.c b/keyboards/tada68/keymaps/raylas/keymap.c new file mode 100755 index 000000000..2f25a8619 --- /dev/null +++ b/keyboards/tada68/keymaps/raylas/keymap.c @@ -0,0 +1,52 @@ +#include "tada68.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Alt |Cmd | Space | FN|Ctrl|Alt|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = KEYMAP_ANSI( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS,KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,KC_UP,KC_PGDN, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, MO(_FL),KC_RCTRL,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | ~ | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | |<- |Dn | ->| | | | | | | | | |End | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |MsL|MsD|MsR | + * `----------------------------------------------------------------' + */ +[_FL] = KEYMAP_ANSI( + KC_TILDE,KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS , \ + _______,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_HOME, \ + _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,KC_VOLD,KC_VOLU,KC_MUTE,_______,KC_BTN1, KC_MS_U, KC_BTN2, \ + _______,_______,_______, _______, _______,_______,_______,KC_MS_L,KC_MS_D, KC_MS_R), +}; diff --git a/keyboards/tada68/keymaps/raylas/readme.md b/keyboards/tada68/keymaps/raylas/readme.md new file mode 100755 index 000000000..aaec1258e --- /dev/null +++ b/keyboards/tada68/keymaps/raylas/readme.md @@ -0,0 +1,6 @@ +![TADA68 layout image](https://i.imgur.com/cV9niMC.jpg) + +# raylas's TADA68 layout + +A layout with some bottom row key swapping to accomadate macOS a little more, whilst keeping the TADA68 quirks alive. +- Also added a function-accessed tilde to the Esc key diff --git a/keyboards/tada68/keymaps/raylas/rules.mk b/keyboards/tada68/keymaps/raylas/rules.mk new file mode 100644 index 000000000..2a7ff2779 --- /dev/null +++ b/keyboards/tada68/keymaps/raylas/rules.mk @@ -0,0 +1,21 @@ +# 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 = 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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From cd0c089b49c1b6e5b0fb13491935f278e9c1986f Mon Sep 17 00:00:00 2001 From: IslandMan93 Date: Sun, 4 Feb 2018 16:50:49 -0500 Subject: [PATCH 142/556] Diverge 3 initial commit woo it works use lets split code Final working. Uses serial Update license --- keyboards/diverge3/config.h | 192 +++++++++++++++++++ keyboards/diverge3/diverge3.c | 16 ++ keyboards/diverge3/diverge3.h | 51 +++++ keyboards/diverge3/keymaps/default/config.h | 27 +++ keyboards/diverge3/keymaps/default/keymap.c | 161 ++++++++++++++++ keyboards/diverge3/keymaps/default/readme.md | 6 + keyboards/diverge3/keymaps/default/rules.mk | 1 + keyboards/diverge3/readme.md | 16 ++ keyboards/diverge3/rules.mk | 73 +++++++ 9 files changed, 543 insertions(+) create mode 100644 keyboards/diverge3/config.h create mode 100644 keyboards/diverge3/diverge3.c create mode 100644 keyboards/diverge3/diverge3.h create mode 100644 keyboards/diverge3/keymaps/default/config.h create mode 100644 keyboards/diverge3/keymaps/default/keymap.c create mode 100644 keyboards/diverge3/keymaps/default/readme.md create mode 100644 keyboards/diverge3/keymaps/default/rules.mk create mode 100644 keyboards/diverge3/readme.md create mode 100644 keyboards/diverge3/rules.mk diff --git a/keyboards/diverge3/config.h b/keyboards/diverge3/config.h new file mode 100644 index 000000000..db3c6a6f7 --- /dev/null +++ b/keyboards/diverge3/config.h @@ -0,0 +1,192 @@ +/* +Copyright 2017 IslandMan93 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1257 +#define DEVICE_VER 0x0001 +#define MANUFACTURER UniKeyboard +#define PRODUCT diverge3 +#define DESCRIPTION Split 72 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 +// SERIAL is the only supported +#define USE_SERIAL + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/diverge3/diverge3.c b/keyboards/diverge3/diverge3.c new file mode 100644 index 000000000..4143b1427 --- /dev/null +++ b/keyboards/diverge3/diverge3.c @@ -0,0 +1,16 @@ +/* Copyright 2017 IslandMan93 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "diverge3.h" diff --git a/keyboards/diverge3/diverge3.h b/keyboards/diverge3/diverge3.h new file mode 100644 index 000000000..0d5086778 --- /dev/null +++ b/keyboards/diverge3/diverge3.h @@ -0,0 +1,51 @@ +/* Copyright 2017 IslandMan93 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef DIVERGE3_H +#define DIVERGE3_H + +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +// This a shortcut to help you visually see your layout. +// The second converts the arguments into a two-dimensional array +// Used to create a keymap using only KC_ prefixed keys +#define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, LT0, LT1, LT2, RT2, RT1, RT0, R40, R41, R42, R43, R44 \ + ) \ + { \ + { KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_NO }, \ + { KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_NO }, \ + { KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_NO }, \ + { KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_NO }, \ + { KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##LT0, KC_##LT1, KC_##LT2 }, \ + { KC_##R06, KC_##R05, KC_##R04, KC_##R03, KC_##R02, KC_##R01, KC_##R00, KC_NO }, \ + { KC_##R16, KC_##R15, KC_##R14, KC_##R13, KC_##R12, KC_##R11, KC_##R10, KC_NO }, \ + { KC_##R26, KC_##R25, KC_##R24, KC_##R23, KC_##R22, KC_##R21, KC_##R20, KC_NO }, \ + { KC_##R36, KC_##R35, KC_##R34, KC_##R33, KC_##R32, KC_##R31, KC_##R30, KC_NO }, \ + { KC_##R44, KC_##R43, KC_##R42, KC_##R41, KC_##R40, KC_##RT0, KC_##RT1, KC_##RT2 } \ + } +#endif diff --git a/keyboards/diverge3/keymaps/default/config.h b/keyboards/diverge3/keymaps/default/config.h new file mode 100644 index 000000000..87ce06b3b --- /dev/null +++ b/keyboards/diverge3/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* Copyright 2017 IslandMan93 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here +#define MASTER_RIGHT +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 + +#endif diff --git a/keyboards/diverge3/keymaps/default/keymap.c b/keyboards/diverge3/keymaps/default/keymap.c new file mode 100644 index 000000000..c24a6328e --- /dev/null +++ b/keyboards/diverge3/keymaps/default/keymap.c @@ -0,0 +1,161 @@ +/* Copyright 2017 IslandMan93 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "diverge3.h" +#include "action_layer.h" +#include "eeconfig.h" + +//**************** Definitions needed for quad function to work *********************// +enum { + SE_TAP_DANCE = 0 +}; +//Enums used to clearly convey the state of the tap dance +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP + // Add more enums here if you want for triple, quadruple, etc. +}; + +typedef struct { + bool is_press_action; + int state; +} tap; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP + if (state->interrupted || state->pressed==0) return SINGLE_TAP; + else return SINGLE_HOLD; + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. In example below, that means to send `xx` instead of `Escape`. + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else return 6; //magic number. At some point this method will expand to work for more presses +} + +//**************** Definitions needed for quad function to work *********************// +// Backspace Shift TD +//instanalize an instance of 'tap' for the 'x' tap dance. +static tap se_tap_state = { + .is_press_action = true, + .state = 0 +}; + +void se_finished (qk_tap_dance_state_t *state, void *user_data) { + se_tap_state.state = cur_dance(state); + switch (se_tap_state.state) { + case SINGLE_TAP: register_code(KC_SPC); break; + case SINGLE_HOLD: register_code(KC_ENT); break; + default: register_code(KC_SPC); unregister_code(KC_SPC); register_code(KC_SPC); + //Last case is for fast typing. Assuming your key is `f`: + //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`. + //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms. + } +} + +void se_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (se_tap_state.state) { + case SINGLE_TAP: unregister_code(KC_SPC); break; + case SINGLE_HOLD: unregister_code(KC_ENT); break; + default: unregister_code(KC_SPC); + } + se_tap_state.state = 0; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [SE_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, se_finished, se_reset) +}; + +// KEYMAP +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 + +enum custom_keycodes { + PAREN_MACRO = SAFE_RANGE, + ARROW_MACRO, + PSELF_MACRO +}; + +// Make layer undefined do nothing +#define KC_ KC_TRNS + +// Macros +#define KC_PMAC PAREN_MACRO +#define KC_AMAC ARROW_MACRO + +// Holds for layer +#define KC_DEL1 LT(_LOWER, KC_DEL) +#define KC_TAB1 LT(_LOWER, KC_TAB) + +// Space on tap, enter on hold. +#define KC_SPNT TD(SE_TAP_DANCE) + +#define KC_BSHT SFT_T(KC_BSPC) + +// Jumps the cursor a word right or left +#define KC_WRDRT LCTL(KC_RIGHT) +#define KC_WRDLT LCTL(KC_LEFT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = KC_KEYMAP( + //,----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ESC, 1 , 2 , 3 , 4 , 5 ,MUTE, MPLY, 6 , 7 , 8 , 9 , 0 ,PSCR, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + GRV, Q , W , E , R , T ,VOLD, VOLU, Y , U , I , O , P ,CAPS, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + TAB, A , S , D , F , G ,PGDN, PGUP, H , J , K , L ,SCLN,BSLS, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,WRDLT, WRDRT, N , M ,COMM,DOT ,SLSH,QUOT, + //|----+----+----+----+----+----+----+----|||----+----+----+----+----+----+----+----| + LCTL,LGUI, APP,LALT,HOME,SPNT,DEL1,BSHT , ENT ,TAB1,BSHT,END ,DOWN, UP ,LEFT,RIGHT + ), + + [_LOWER] = KC_KEYMAP( + //,----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , F1 , F2 , F3 , F4 , F5 ,F11 , F12, F6 , F7 , F8 , F9 , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + TILD,EXLM, AT ,HASH,DLR ,PERC, , ,CIRC,AMPR,ASTR, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,LBRC,LPRN,UNDS,LCBR, , ,RCBR, EQL,RPRN,RBRC,COLN, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , ,PMAC,MINS,AMAC, , , ,PLUS, , , , , + //|----+----+----+----+----+----+----+----|||----+----+----+----+----+----+----+----| + , , , , , , , , , , , , , , , + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case PAREN_MACRO: + SEND_STRING("()"); + return false; break; + case ARROW_MACRO: + SEND_STRING("->"); + return false; break; + } + } + return true; +}; diff --git a/keyboards/diverge3/keymaps/default/readme.md b/keyboards/diverge3/keymaps/default/readme.md new file mode 100644 index 000000000..c2e698b3c --- /dev/null +++ b/keyboards/diverge3/keymaps/default/readme.md @@ -0,0 +1,6 @@ +# The default keymap for diverge3 + +Just a keymap that I use for programming. + +The focus is to have the thumbs do all the work for spacing/backspacing, shifting, and symbols. +Also there is some duplicated functionality on the left hand for when editing with a mouse. diff --git a/keyboards/diverge3/keymaps/default/rules.mk b/keyboards/diverge3/keymaps/default/rules.mk new file mode 100644 index 000000000..e5ddcae8d --- /dev/null +++ b/keyboards/diverge3/keymaps/default/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/diverge3/readme.md b/keyboards/diverge3/readme.md new file mode 100644 index 000000000..f8ad69a2e --- /dev/null +++ b/keyboards/diverge3/readme.md @@ -0,0 +1,16 @@ +# diverge3 + +A split 5x7 keyboard with 3 thumb keys. Made by [Unikeyboard](https://unikeyboard.io). + +Keyboard Maintainer: [IslandMan93](https://github.com/islandman93) +Hardware Supported: Pro Micro +Hardware Availability: [Diverge 3](https://unikeyboard.io/product/diverge/) + +Make example for this keyboard (after setting up your build environment): + + make diverge3:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +# Reflashing Animus +Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST) during the upload step. Then reapply your keymap through Arbites. \ No newline at end of file diff --git a/keyboards/diverge3/rules.mk b/keyboards/diverge3/rules.mk new file mode 100644 index 000000000..aa7453054 --- /dev/null +++ b/keyboards/diverge3/rules.mk @@ -0,0 +1,73 @@ +SRC += ../lets_split/matrix.c \ + ../lets_split/serial.c \ + ../lets_split/split_util.c + +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +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 = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +CUSTOM_MATRIX = yes From 88a7fa762f0b6b696b15334dde4851fdc601b558 Mon Sep 17 00:00:00 2001 From: yiancar Date: Sat, 10 Feb 2018 23:47:15 +0100 Subject: [PATCH 143/556] New keyboard: Cu75 (#2374) * Added Modular keyboards L,R and NUM Created code modules for the 3 modules of the modular keyboard. Original idea by MechboardsUK. Uses i2c implementation similar to lets split * Remove modular from master This is to fix incorrect branching * Addition of cu75 Addition of cu75 keyboard, uses libraries from LFKeyboards directory which are path linked to reduce file duplication. Minor fix on cu24 readme * Minor Readme Fix --- keyboards/cu24/readme.md | 2 +- keyboards/cu75/config.h | 151 ++++++++++++++++++++ keyboards/cu75/cu75.c | 179 ++++++++++++++++++++++++ keyboards/cu75/cu75.h | 110 +++++++++++++++ keyboards/cu75/keymaps/default/config.h | 8 ++ keyboards/cu75/keymaps/default/keymap.c | 91 ++++++++++++ keyboards/cu75/keymaps/default/rules.mk | 53 +++++++ keyboards/cu75/keymaps/iso/config.h | 8 ++ keyboards/cu75/keymaps/iso/keymap.c | 91 ++++++++++++ keyboards/cu75/keymaps/iso/rules.mk | 53 +++++++ keyboards/cu75/readme.md | 17 +++ keyboards/cu75/rules.mk | 41 ++++++ 12 files changed, 803 insertions(+), 1 deletion(-) create mode 100644 keyboards/cu75/config.h create mode 100644 keyboards/cu75/cu75.c create mode 100644 keyboards/cu75/cu75.h create mode 100644 keyboards/cu75/keymaps/default/config.h create mode 100644 keyboards/cu75/keymaps/default/keymap.c create mode 100644 keyboards/cu75/keymaps/default/rules.mk create mode 100644 keyboards/cu75/keymaps/iso/config.h create mode 100644 keyboards/cu75/keymaps/iso/keymap.c create mode 100644 keyboards/cu75/keymaps/iso/rules.mk create mode 100644 keyboards/cu75/readme.md create mode 100644 keyboards/cu75/rules.mk diff --git a/keyboards/cu24/readme.md b/keyboards/cu24/readme.md index a017cd665..4624c1aa9 100644 --- a/keyboards/cu24/readme.md +++ b/keyboards/cu24/readme.md @@ -6,7 +6,7 @@ A luxurious 24 key keypad with various layouts. Includes RGB underglow, backligh Keyboard Maintainer: [Yiancar](https://github.com/yiancar) Hardware Supported: PCB v1.0 (uses a 32u4) -Hardware Availability: http://caps-unlocked.com/ +Hardware Availability: [caps-unlocked.com](http://caps-unlocked.com/) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/cu75/config.h b/keyboards/cu75/config.h new file mode 100644 index 000000000..c21e1da01 --- /dev/null +++ b/keyboards/cu75/config.h @@ -0,0 +1,151 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6062 +#define DEVICE_VER 0x0001 +#define MANUFACTURER LFKeyboards/CapsUnlocked +#define PRODUCT CU75 +#define DESCRIPTION A luxurious fully customisable 75% + +#define DIODE_DIRECTION COL2ROW +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 +#define MATRIX_ROW_PINS {F1, B7, B3, D2, D3, B2} +#define MATRIX_COL_PINS {F4, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, B1, B0, F0} +#define UNUSED_PINS {} + +#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile +#define RGBLED_NUM 24 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 8 +#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255} + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/cu75/cu75.c b/keyboards/cu75/cu75.c new file mode 100644 index 000000000..6dc289845 --- /dev/null +++ b/keyboards/cu75/cu75.c @@ -0,0 +1,179 @@ +#include +#include +#include +#include "cu75.h" +#include "keymap.h" +#include "debug.h" +#include "../lfkeyboards/issi.h" +#include "../lfkeyboards/TWIlib.h" +#include "../lfkeyboards/lighting.h" + +#ifdef AUDIO_ENABLE +float test_sound[][2] = SONG(STARTUP_SOUND); +#include