From ff9cd1dd0c2cc3be2a25b388eab183f6ff20b5b6 Mon Sep 17 00:00:00 2001 From: William Chang Date: Sat, 20 Apr 2019 17:38:33 -0700 Subject: [PATCH 001/129] Added keymap/userspace for dz60 build 4 with readme (#5668) * Initial commit * Modified keymap and updated readme. * fixed numbering in readme * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Made requested changes in PR. * Rename README.md to readme.md --- .../dz60/keymaps/billiams/build_flash.sh | 9 +++ keyboards/dz60/keymaps/billiams/config.h | 1 + keyboards/dz60/keymaps/billiams/keymap.c | 48 ++++++++++++ keyboards/dz60/keymaps/billiams/readme.md | 73 +++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 keyboards/dz60/keymaps/billiams/build_flash.sh create mode 100644 keyboards/dz60/keymaps/billiams/config.h create mode 100644 keyboards/dz60/keymaps/billiams/keymap.c create mode 100644 keyboards/dz60/keymaps/billiams/readme.md diff --git a/keyboards/dz60/keymaps/billiams/build_flash.sh b/keyboards/dz60/keymaps/billiams/build_flash.sh new file mode 100644 index 00000000000..e7a81114415 --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/build_flash.sh @@ -0,0 +1,9 @@ +# dfu-programmer atmega32u4 erase --force +# dfu-programmer atmega32u4 flash /path/to/firmware.hex +# dfu-programmer atmega32u4 reset + +# run this in the qmk_firmware directory +make dz60:billiams +dfu-programmer atmega32u4 erase --force && \ +dfu-programmer atmega32u4 flash dz60_billiams.hex && \ +dfu-programmer atmega32u4 reset \ No newline at end of file diff --git a/keyboards/dz60/keymaps/billiams/config.h b/keyboards/dz60/keymaps/billiams/config.h new file mode 100644 index 00000000000..9560d51a6f9 --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/config.h @@ -0,0 +1 @@ +#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed diff --git a/keyboards/dz60/keymaps/billiams/keymap.c b/keyboards/dz60/keymaps/billiams/keymap.c new file mode 100644 index 00000000000..88ce0f329ca --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +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 | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . |Tap(/) Shft| U | ESC | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Cmd | Fn | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_GRAVE, 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, + MO(1), 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, _______, RSFT_T(KC_SLSH) , KC_UP, KC_ESCAPE, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue-| Hue+| Sat-| Sat+| Val-| Val+| | | MUTE | Vol- | Vol+ | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | Prev | Next | Play/Pause | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | |Scr- |Scr+ | |PG_UP|RESET| + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | HOME|PG_DN| END | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + _______, 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, + _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, KC_MUTE, KC__VOLDOWN, KC__VOLUP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MRWD, KC_MFFD, + KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, KC_BRIU, _______, _______, KC_PGUP, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END + ), +}; diff --git a/keyboards/dz60/keymaps/billiams/readme.md b/keyboards/dz60/keymaps/billiams/readme.md new file mode 100644 index 00000000000..5a3a7213f86 --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/readme.md @@ -0,0 +1,73 @@ +## Billiam's DZ60 layout + +This layout is optimized for MacOS and is for a Build 4 DZ60 with a 2U left shift, 2U right shift and an arrow +cluster in the bottom right. Don't use this layout if you didn't get Build 4, you will enter a world of pain Donny. + +Settings: + +* The `CAPS LOCK` key is replaced with a second function key. +* The `ALT` and `CMD` keys are swapped to replicate the Mac layout. +* Del is available as `Fn` + `Backspace` +* `/ ?` are available when you tap the right shift. Otherwise RShift is shift when held down +* RESET is available as `Fn`+ ` ESC` +* Underglow toggle and mode selection are available as `Fn` + `Q` and `Fn` + `S`. Yes your keyboard has lights even if you didn't get the LEDs. Bonus! +* Media play/pause doesn't seem to work with anything but iTunes at the moment. FML + + +### Initial Installation + +I found the instructions to be longer than they had to be, and I ended up having to Google some steps anyway. These are the steps I took to get my keyboard setup, in case you are new to the process. + +1. Clone the qmk_firmware repo locally +``` +# Choose one: +git clone git@github.com:qmk/qmk_firmware.git # OR +git clone https://github.com/qmk/qmk_firmware.git +``` +2. Customize your layout by starting with a [keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dz60/keymaps). I copied [StephenGrier](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dz60/keymaps/stephengrier)'s and modified it for DZ60 Build 4 and changed a few things, like the `grave` key, `ESC` and `/`. + +3. Build your hex file +``` +make dz60:billiams # be in the qmk_firmware directory to do this +``` +A hex file `dz60_billiams.hex` will be created in the base qmk_firmware directory + +4. Before plugging in your keyboard into your computer, hold `SPACE` and `B` keys down +5. Holding those keys down, plug the keyboard into your computer, which will put the keyboard in bootlegger mode +6. If you are using [QMK toolbox](https://github.com/qmk/qmk_toolbox/releases), upload the .hex file you made above, select it and hit the flash button. For the love of all that is good and holy on Earth, don't hit the load button, that will load the default keymap and that's not what you want! Unless it is, in which case click away. + +Note: If you didn't follow my instructions in 4 and accidentally loaded the default keymap, then to `RESET` the keyboard and kick it into bootleg mode again, hold the `down arrow` key and `\`. The default layout is Build 1 and sets the `MENU` key on that build to `Fn`. `MENU` corresponds to `down arrow` in build 4. Note that you don't have to unplug the keyboard. + +Hope this helps! + +### 0 Qwerty +``` +,-----------------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | +|-----------------------------------------------------------------------------------------+ +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +|-----------------------------------------------------------------------------------------+ +| Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +|-----------------------------------------------------------------------------------------+ +| Shift | Z | X | C | V | B | N | M | , | . | Tap:/ RSh | U | ESC | +|-----------------------------------------------------------------------------------------+ +| Ctrl | Alt | Cmd | Space | Cmd | Fn | L | D | R | +`-----------------------------------------------------------------------------------------' +``` + +### 1 Fn Layer +``` +FN Layer +,-----------------------------------------------------------------------------------------. +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | +|-----------------------------------------------------------------------------------------+ +| |RBB T|RGB M| Hue-| Hue+| Sat-| Sat+| Val-| Val+| | | MUTE | Vol- | Vol+ | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | | Prev | Next | Play/Pause | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | |Scr- |Scr+ | | PG_UP |RESET| +|-----------------------------------------------------------------------------------------+ +| | | | | | | HOME | PG_DN | END | +`-----------------------------------------------------------------------------------------' +``` + From 829ccd3491ca43be79e110b12bdabe96d6e76b0f Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Sat, 20 Apr 2019 20:21:22 -0500 Subject: [PATCH 002/129] RGB Matrix docs update from mechmerlin discussion (#5667) * RGB Matrix docs update from mechmerlin discussion * alignment * Apply suggestions from code review Co-Authored-By: XScorpion2 --- docs/feature_rgb_matrix.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 05c1ebba815..acef4717dde 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -124,7 +124,7 @@ Configure the hardware via your `config.h`: --- -From this point forward the configuration is the same for all the drivers. +From this point forward the configuration is the same for all the drivers. The struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example: ```C const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { @@ -138,14 +138,14 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { } ``` -The format for the matrix position used in this array is `{row | (col << 4)}`. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64. The easiest way to calculate these positions is: +The first part, `{row | col << 4}`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `{x=0..224, y=0..64}` represents the LED's physical position on the keyboard. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64 as the effects are based on this range. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position: ```C -x = 224 / ( NUMBER_OF_COLS - 1 ) * ROW_POSITION -y = 64 / (NUMBER_OF_ROWS - 1 ) * COL_POSITION +x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION +y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION ``` -Where all variables are decimels/floats. +Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. `modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects). From b27ddf1edbc5baa317507d7c91054abd2e14de8a Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Sun, 21 Apr 2019 11:13:44 -0500 Subject: [PATCH 003/129] [Keyboard] Updated rules.mk for Sol to use the correct feature flag (#5672) --- keyboards/sol/keymaps/default/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/sol/keymaps/default/rules.mk b/keyboards/sol/keymaps/default/rules.mk index 40167b37557..526b72fe7f3 100644 --- a/keyboards/sol/keymaps/default/rules.mk +++ b/keyboards/sol/keymaps/default/rules.mk @@ -19,7 +19,7 @@ UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) -OLED_ENABLE = no # OLED_ENABLE (+5000) +OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here From e2843c25ceb35ab8c1e22ec16605ee6a854b59d9 Mon Sep 17 00:00:00 2001 From: Rys Sommefeldt Date: Sun, 21 Apr 2019 17:15:19 +0100 Subject: [PATCH 004/129] [Keymap] Shuffle FL1 some more to match keycap legends (#5673) --- keyboards/tada68/keymaps/mattgemmell/keymap.c | 12 ++++++------ keyboards/tada68/keymaps/mattgemmell/readme.md | 7 +++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/keyboards/tada68/keymaps/mattgemmell/keymap.c b/keyboards/tada68/keymaps/mattgemmell/keymap.c index 1a8021ea402..f2afd3cd48d 100644 --- a/keyboards/tada68/keymaps/mattgemmell/keymap.c +++ b/keyboards/tada68/keymaps/mattgemmell/keymap.c @@ -29,20 +29,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,----------------------------------------------------------------. * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |BR↑ | * |----------------------------------------------------------------| - * | | | | | | | | | | | | | | |BR↓ | + * | | | | | | | | |Prn|Scl|Pau|Up | | |BR↓ | * |------------------------------------------------------- -----| - * | | | | | | | | | | | | | | |Home| + * | | V+| V-|Mut| | | | |Hom|PgU|Lft|Rig| | |Home| * |----------------------------------------------------------------| - * | | | | | L+|LED| L-| | | V↓| V↑|Mut| | ↑ | End| + * | | | | | L+|LED| L-| | |End|PgDn|Dow| | ↑ | End| * |----------------------------------------------------------------| * | | | | | | | | ← | ↓ | → | * `----------------------------------------------------------------' */ [_FL] = LAYOUT_iso( _______, 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_BRMU, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRMD, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, \ - _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_MS_U, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BRMD, \ + _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, _______, KC_HOME, \ + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, KC_MS_U, KC_END, \ _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), }; diff --git a/keyboards/tada68/keymaps/mattgemmell/readme.md b/keyboards/tada68/keymaps/mattgemmell/readme.md index a67e25ae27b..de8e0c4980a 100644 --- a/keyboards/tada68/keymaps/mattgemmell/readme.md +++ b/keyboards/tada68/keymaps/mattgemmell/readme.md @@ -1,9 +1,8 @@ -# Custom Tada68 layout for ISO UK with Apple-y tweaks +# Custom TADA68 layout for ISO UK with Apple-specific tweaks -This layout is based on the [ISO UK](../iso-uk) layout, with the following -changes: +This layout is based on the [ISO UK](../iso-uk) layout, with changes to make it +more user friendly when used on Apple devices, like iPads and the Mac. -Swap Win and Alt on the left side (Option and Command on macOS) ## Installation From 50e0bdab0012c96736f2a9fe7ef88802c6839e20 Mon Sep 17 00:00:00 2001 From: moyi4681 Date: Mon, 22 Apr 2019 00:33:36 +0800 Subject: [PATCH 005/129] [Keyboard] dz60rgb: update default keymap (#5661) * Update keymap.c * Update config.h * Update dz60rgb.c * Update keymap.c --- keyboards/dztech/dz60rgb/config.h | 2 +- keyboards/dztech/dz60rgb/dz60rgb.c | 113 ++---------------- .../dztech/dz60rgb/keymaps/default/keymap.c | 58 +++------ 3 files changed, 28 insertions(+), 145 deletions(-) diff --git a/keyboards/dztech/dz60rgb/config.h b/keyboards/dztech/dz60rgb/config.h index f43b39810f8..0c04acce3fd 100644 --- a/keyboards/dztech/dz60rgb/config.h +++ b/keyboards/dztech/dz60rgb/config.h @@ -22,7 +22,7 @@ #define DEBOUNCE 3 #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_LED_PROCESS_LIMIT 4 #define RGB_MATRIX_LED_FLUSH_LIMIT 26 diff --git a/keyboards/dztech/dz60rgb/dz60rgb.c b/keyboards/dztech/dz60rgb/dz60rgb.c index 99e3b5646fa..a6825e750fd 100644 --- a/keyboards/dztech/dz60rgb/dz60rgb.c +++ b/keyboards/dztech/dz60rgb/dz60rgb.c @@ -1,14 +1,7 @@ #include "dz60rgb.h" #include "config.h" #if defined (dzrgb60_iso) - const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, {0, K_12, J_12, L_12}, @@ -23,7 +16,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_3, J_3, L_3}, {0, K_2, J_2, L_2}, {0, K_1, J_1, L_1}, - {0, H_15, G_15, I_15}, {0, H_13, G_13, I_13}, {0, H_12, G_12, I_12}, @@ -38,7 +30,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_3, G_3, I_3}, {0, H_2, G_2, I_2}, {0, H_1, G_1, I_1}, - {0, B_14, A_14, C_14}, {0, E_12, D_12, F_12}, {0, E_11, D_11, F_11}, @@ -52,7 +43,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_3, D_3, F_3}, {0, E_2, D_2, F_2}, {0, E_1, D_1, F_1}, - {0, B_13, A_13, C_13}, {0, B_11, A_11, C_11}, {0, B_10, A_10, C_10}, @@ -65,7 +55,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_3, A_3, C_3}, {0, B_2, A_2, C_2}, {0, B_1, A_1, C_1}, - {0, B_15, A_15, C_15}, {0, E_13, D_13, F_13}, {0, B_12, A_12, C_12}, @@ -73,9 +62,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_16, A_16, C_16}, {0, E_16, D_16, F_16}, {0, H_16, G_16, I_16}, - {0, K_16, J_16, L_16} + {0, K_16, J_16, L_16}, }; - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {16*13.5, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, @@ -91,7 +79,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(2<<4)}, {16*2, 0}, 1}, {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, - {{2|(13<<4)}, {16*13.75, 24}, 1}, {{1|(12<<4)}, {16*12.5, 16}, 0}, {{1|(11<<4)}, {16*11.5, 16}, 0}, @@ -106,7 +93,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{1|(2<<4)}, { 16*2.5, 16}, 0}, {{1|(1<<4)}, { 16*1.5, 16}, 0}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{1|(13<<4)}, {16*12.75, 32}, 1}, {{2|(11<<4)}, {16*11.75, 32}, 0}, {{2|(10<<4)}, {16*10.75, 32}, 0}, @@ -120,7 +106,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(2<<4)}, { 16*2.75, 32}, 0}, {{2|(1<<4)}, { 16*1.75, 32}, 0}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(11<<4)}, {16*13.125, 48}, 1}, {{3|(10<<4)}, {16*11.25, 48}, 0}, {{3|(9<<4)}, {16*10.25, 48}, 0}, @@ -133,7 +118,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {16*3.25, 48}, 0}, {{3|(1<<4)}, {16*1.25, 48}, 0}, {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.875, 64}, 1}, {{4|(11<<4)}, {16*12.625, 64}, 1}, {{4|(10<<4)}, {16*11.375, 64}, 1}, @@ -141,21 +125,10 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{4|(5<<4)}, { 16*6.375, 64}, 0}, {{4|(2<<4)}, { 16*2.625, 64}, 1}, {{4|(1<<4)}, { 16*1.375, 64}, 1}, - {{4|(0<<4)}, { 16*0.125, 64}, 1} - + {{4|(0<<4)}, { 16*0.125, 64}, 1}, }; - - - #elif defined (dzrgb60_hhkb) - const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ {0, H_15, G_15, I_15}, {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, @@ -171,7 +144,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_3, J_3, L_3}, {0, K_2, J_2, L_2}, {0, K_1, J_1, L_1}, - {0, H_14, G_14, I_14}, {0, H_13, G_13, I_13}, {0, H_12, G_12, I_12}, @@ -186,7 +158,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_3, G_3, I_3}, {0, H_2, G_2, I_2}, {0, H_1, G_1, I_1}, - {0, E_14, D_14, F_14}, {0, E_12, D_12, F_12}, {0, E_11, D_11, F_11}, @@ -200,7 +171,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_3, D_3, F_3}, {0, E_2, D_2, F_2}, {0, E_1, D_1, F_1}, - {0, B_14, A_14, C_14}, {0, B_13, A_13, C_13}, {0, B_11, A_11, C_11}, @@ -214,16 +184,14 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_3, A_3, C_3}, {0, B_2, A_2, C_2}, {0, B_1, A_1, C_1}, - {0, B_15, A_15, C_15}, {0, E_13, D_13, F_13}, {0, B_12, A_12, C_12}, {0, B_16, A_16, C_16}, {0, E_16, D_16, F_16}, {0, H_16, G_16, I_16}, - {0, K_16, J_16, L_16} + {0, K_16, J_16, L_16}, }; - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(12<<4)}, {16*14, 0}, 1}, {{0|(13<<4)}, {16*13, 0}, 1}, @@ -240,7 +208,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(2<<4)}, {16*2, 0}, 1}, {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, - {{1|(13<<4)}, {16*13.75, 16}, 1}, {{1|(12<<4)}, {16*12.5, 16}, 0}, {{1|(11<<4)}, {16*11.5, 16}, 0}, @@ -255,7 +222,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{1|(2<<4)}, { 16*2.5, 16}, 0}, {{1|(1<<4)}, { 16*1.5, 16}, 0}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{2|(13<<4)}, {16*12.75, 32}, 1}, {{2|(11<<4)}, {16*11.75, 32}, 0}, {{2|(10<<4)}, {16*10.75, 32}, 0}, @@ -269,7 +235,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(2<<4)}, { 16*2.75, 32}, 0}, {{2|(1<<4)}, { 16*1.75, 32}, 0}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(13<<4)}, {16*14, 48}, 1}, {{3|(11<<4)}, {16*12.625, 48}, 0}, {{3|(10<<4)}, {16*11.25, 48}, 0}, @@ -283,24 +248,16 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {16*3.25, 48}, 0}, {{3|(1<<4)}, {16*1.25, 48}, 0}, {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.625, 64}, 1}, {{4|(11<<4)}, {16*12.375, 64}, 1}, {{4|(10<<4)}, {16*11.125, 64}, 1}, {{4|(5<<4)}, { 16*7, 64}, 0}, {{4|(2<<4)}, { 16*2.875, 64}, 1}, {{4|(1<<4)}, { 16*1.625, 64}, 1}, - {{4|(0<<4)}, { 16*0.375, 64}, 1} - + {{4|(0<<4)}, { 16*0.375, 64}, 1}, }; #elif defined (dzrgb60_hhkb_iso) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ {0, H_15, G_15, I_15}, {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, @@ -316,7 +273,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_3, J_3, L_3}, {0, K_2, J_2, L_2}, {0, K_1, J_1, L_1}, - {0, K_15, J_15, L_15}, {0, H_13, G_13, I_13}, {0, H_12, G_12, I_12}, @@ -331,7 +287,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_3, G_3, I_3}, {0, H_2, G_2, I_2}, {0, H_1, G_1, I_1}, - {0, E_15, D_15, F_15}, {0, E_12, D_12, F_12}, {0, E_11, D_11, F_11}, @@ -345,7 +300,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_3, D_3, F_3}, {0, E_2, D_2, F_2}, {0, E_1, D_1, F_1}, - {0, B_14, A_14, C_14}, {0, B_13, A_13, C_13}, {0, B_11, A_11, C_11}, @@ -359,16 +313,14 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_3, A_3, C_3}, {0, B_2, A_2, C_2}, {0, B_1, A_1, C_1}, - {0, B_15, A_15, C_15}, {0, E_13, D_13, F_13}, {0, B_12, A_12, C_12}, {0, B_16, A_16, C_16}, {0, E_16, D_16, F_16}, {0, H_16, G_16, I_16}, - {0, K_16, J_16, L_16} + {0, K_16, J_16, L_16}, }; - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(12<<4)}, {16*14, 0}, 1}, {{0|(13<<4)}, {16*13, 0}, 1}, @@ -385,7 +337,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(2<<4)}, {16*2, 0}, 1}, {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, - {{2|(13<<4)}, {16*13.75, 24}, 1}, {{1|(12<<4)}, {16*12.5, 16}, 0}, {{1|(11<<4)}, {16*11.5, 16}, 0}, @@ -400,7 +351,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{1|(2<<4)}, { 16*2.5, 16}, 0}, {{1|(1<<4)}, { 16*1.5, 16}, 0}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{1|(13<<4)}, {16*12.75, 32}, 1}, {{2|(11<<4)}, {16*11.75, 32}, 0}, {{2|(10<<4)}, {16*10.75, 32}, 0}, @@ -414,7 +364,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(2<<4)}, { 16*2.75, 32}, 0}, {{2|(1<<4)}, { 16*1.75, 32}, 0}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(13<<4)}, {16*14, 48}, 1}, {{3|(11<<4)}, {16*12.625, 48}, 0}, {{3|(10<<4)}, {16*11.25, 48}, 0}, @@ -428,24 +377,16 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {16*3.25, 48}, 0}, {{3|(1<<4)}, {16*1.25, 48}, 0}, {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.625, 64}, 1}, {{4|(11<<4)}, {16*12.375, 64}, 1}, {{4|(10<<4)}, {16*11.125, 64}, 1}, {{4|(5<<4)}, { 16*7, 64}, 0}, {{4|(2<<4)}, { 16*2.875, 64}, 1}, {{4|(1<<4)}, { 16*1.625, 64}, 1}, - {{4|(0<<4)}, { 16*0.375, 64}, 1} - + {{4|(0<<4)}, { 16*0.375, 64}, 1}, }; #elif defined (dzrgb60_ansi) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, {0, K_12, J_12, L_12}, @@ -460,7 +401,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_3, J_3, L_3}, {0, K_2, J_2, L_2}, {0, K_1, J_1, L_1}, - {0, H_14, G_14, I_14}, {0, H_13, G_13, I_13}, {0, H_12, G_12, I_12}, @@ -475,7 +415,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_3, G_3, I_3}, {0, H_2, G_2, I_2}, {0, H_1, G_1, I_1}, - {0, E_14, D_14, F_14}, {0, E_12, D_12, F_12}, {0, E_11, D_11, F_11}, @@ -489,7 +428,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_3, D_3, F_3}, {0, E_2, D_2, F_2}, {0, E_1, D_1, F_1}, - {0, B_13, A_13, C_13}, {0, B_11, A_11, C_11}, {0, B_10, A_10, C_10}, @@ -502,7 +440,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_3, A_3, C_3}, {0, B_2, A_2, C_2}, {0, B_1, A_1, C_1}, - {0, B_15, A_15, C_15}, {0, E_13, D_13, F_13}, {0, B_12, A_12, C_12}, @@ -510,9 +447,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_16, A_16, C_16}, {0, E_16, D_16, F_16}, {0, H_16, G_16, I_16}, - {0, K_16, J_16, L_16} + {0, K_16, J_16, L_16}, }; - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {16*13.5, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, @@ -528,7 +464,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(2<<4)}, {16*2, 0}, 1}, {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, - {{1|(13<<4)}, {16*13.75, 16}, 1}, {{1|(12<<4)}, {16*12.5, 16}, 0}, {{1|(11<<4)}, {16*11.5, 16}, 0}, @@ -543,7 +478,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{1|(2<<4)}, { 16*2.5, 16}, 0}, {{1|(1<<4)}, { 16*1.5, 16}, 0}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{2|(13<<4)}, {16*13.375, 24}, 1}, {{2|(11<<4)}, {16*11.75, 32}, 0}, {{2|(10<<4)}, {16*10.75, 32}, 0}, @@ -557,7 +491,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(2<<4)}, { 16*2.75, 32}, 0}, {{2|(1<<4)}, { 16*1.75, 32}, 0}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(11<<4)}, {16*13.125, 48}, 1}, {{3|(10<<4)}, {16*11.25, 48}, 0}, {{3|(9<<4)}, {16*10.25, 48}, 0}, @@ -570,7 +503,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {16*3.25, 48}, 0}, {{3|(1<<4)}, {16*1.25, 48}, 0}, {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.875, 64}, 1}, {{4|(11<<4)}, {16*12.625, 64}, 1}, {{4|(10<<4)}, {16*11.375, 64}, 1}, @@ -578,17 +510,10 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{4|(5<<4)}, { 16*6.375, 64}, 0}, {{4|(2<<4)}, { 16*2.625, 64}, 1}, {{4|(1<<4)}, { 16*1.375, 64}, 1}, - {{4|(0<<4)}, { 16*0.125, 64}, 1} + {{4|(0<<4)}, { 16*0.125, 64}, 1}, }; #else - const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, {0, K_12, J_12, L_12}, @@ -603,7 +528,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_3, J_3, L_3}, {0, K_2, J_2, L_2}, {0, K_1, J_1, L_1}, - {0, H_14, G_14, I_14}, {0, H_13, G_13, I_13}, {0, H_12, G_12, I_12}, @@ -618,7 +542,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_3, G_3, I_3}, {0, H_2, G_2, I_2}, {0, H_1, G_1, I_1}, - {0, E_14, D_14, F_14}, {0, E_12, D_12, F_12}, {0, E_11, D_11, F_11}, @@ -632,7 +555,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_3, D_3, F_3}, {0, E_2, D_2, F_2}, {0, E_1, D_1, F_1}, - {0, B_14, A_14, C_14}, {0, B_13, A_13, C_13}, {0, B_11, A_11, C_11}, @@ -646,7 +568,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_3, A_3, C_3}, {0, B_2, A_2, C_2}, {0, B_1, A_1, C_1}, - {0, B_15, A_15, C_15}, {0, E_13, D_13, F_13}, {0, B_12, A_12, C_12}, @@ -655,9 +576,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, B_16, A_16, C_16}, {0, E_16, D_16, F_16}, {0, H_16, G_16, I_16}, - {0, K_16, J_16, L_16} + {0, K_16, J_16, L_16}, }; - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {17.23*13, 0}, 1}, {{0|(12<<4)}, {17.23*12, 0}, 1}, @@ -673,7 +593,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(2<<4)}, { 17.23*2, 0}, 1}, {{0|(1<<4)}, { 17.23*1, 0}, 1}, {{0|(0<<4)}, { 17.23*0, 0}, 1}, - {{1|(13<<4)}, {17.23*13, 16}, 1}, {{1|(12<<4)}, {17.23*12, 16}, 0}, {{1|(11<<4)}, {17.23*11, 16}, 0}, @@ -688,7 +607,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{1|(2<<4)}, { 17.23*2, 16}, 0}, {{1|(1<<4)}, { 17.23*1, 16}, 0}, {{1|(0<<4)}, { 17.23*0, 16}, 1}, - {{2|(13<<4)}, {17.23*13, 32}, 1}, {{2|(11<<4)}, {17.23*11, 32}, 0}, {{2|(10<<4)}, {17.23*10, 32}, 0}, @@ -702,7 +620,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(2<<4)}, { 17.23*2, 32}, 0}, {{2|(1<<4)}, { 17.23*1, 32}, 0}, {{2|(0<<4)}, { 17.23*0, 32}, 1}, - {{3|(13<<4)}, {17.23*13, 48}, 1}, {{3|(11<<4)}, {17.23*11, 48}, 0}, {{3|(10<<4)}, {17.23*10, 48}, 0}, @@ -716,7 +633,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, { 17.23*2, 48}, 0}, {{3|(1<<4)}, { 17.23*1, 48}, 0}, {{3|(0<<4)}, { 17.23*0, 48}, 1}, - {{4|(13<<4)}, {17.23*13, 64}, 1}, {{4|(11<<4)}, {17.23*11, 64}, 1}, {{4|(10<<4)}, {17.23*10, 64}, 1}, @@ -725,32 +641,27 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{4|(5<<4)}, { 17.23*5, 64}, 0}, {{4|(2<<4)}, { 17.23*2, 64}, 1}, {{4|(1<<4)}, { 17.23*1, 64}, 1}, - {{4|(0<<4)}, { 17.23*0, 64}, 1} - + {{4|(0<<4)}, { 17.23*0, 64}, 1}, }; #endif void matrix_init_kb(void) { matrix_init_user(); } - - void matrix_scan_kb(void) { matrix_scan_user(); } - - bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } - - void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); } void suspend_wakeup_init_kb(void) { rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); } diff --git a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c index 0eff4ca8a37..c0bc1b89b1d 100644 --- a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c @@ -5,26 +5,23 @@ extern bool g_suspend_state; #define _LAYER2 2 #define _LAYER3 3 #define _LAYER4 4 -#define _LAYER5 5 -#define _LAYER6 6 -#define _LAYER7 7 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LAYER0] = LAYOUT( /* Base */ - 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_BSLASH,\ - CTL_T(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, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\ - KC_LCTL, KC_LGUI, LM(1, MOD_LALT), KC_SPC, KC_RALT, MO(1) , KC_LEFT, KC_DOWN, KC_RIGHT), + 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_BSLASH,\ + CTL_T(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, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\ + KC_LCTL, KC_LGUI, LM(1, MOD_LALT), KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT), [_LAYER1] = LAYOUT( /* FN */ TO(3), 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_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET ,\ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, EEP_RST,\ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN,KC_VOLU, KC_MUTE,\ KC_TRNS, KC_TRNS, KC_TRNS, TO(4), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), [_LAYER2] = LAYOUT( /* LIGHT */ 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_DEL ,\ KC_TRNS, RGB_TOG, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, RESET ,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS, EEP_RST,\ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_LAYER3] = LAYOUT( /* NUMPAD */ @@ -33,38 +30,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_PENT,\ KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS,\ KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_P0, KC_PDOT, KC_TRNS, KC_TRNS, KC_TRNS), - [_LAYER4] = LAYOUT( /* MAC */ - 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_BSLASH,\ - CTL_T(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, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(5) , KC_LEFT, KC_DOWN, KC_RIGHT), + [_LAYER4] = LAYOUT( /* SWITCH LALT AND LGUI */ + 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_BSLASH,\ + CTL_T(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, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, TO(0), KC_LEFT, KC_DOWN, KC_RIGHT), }; - - -void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } - } - } -} - void rgb_matrix_indicators_user(void) { uint8_t this_led = host_keyboard_leds(); if (!g_suspend_state) { switch (biton32(layer_state)) { - case _LAYER1: - rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); - break; - case _LAYER2: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); - break; case _LAYER3: if ( this_led & (1< Date: Sun, 21 Apr 2019 19:43:23 +0300 Subject: [PATCH 006/129] [Keymap] Add keymap for keebio/quefrency 65% version (#5666) * add keymap * fix readme title * renamed README.md to lowercase, fix typo * renamed README.md to lowercase, for real * add double spaces for github * lowercase name in readme * rename directory to lowercase --- .../quefrency/keymaps/georgepetri/config.h | 24 ++++++++++ .../quefrency/keymaps/georgepetri/keymap.c | 44 +++++++++++++++++ .../quefrency/keymaps/georgepetri/readme.md | 48 +++++++++++++++++++ .../quefrency/keymaps/georgepetri/rules.mk | 0 4 files changed, 116 insertions(+) create mode 100644 keyboards/keebio/quefrency/keymaps/georgepetri/config.h create mode 100644 keyboards/keebio/quefrency/keymaps/georgepetri/keymap.c create mode 100644 keyboards/keebio/quefrency/keymaps/georgepetri/readme.md create mode 100644 keyboards/keebio/quefrency/keymaps/georgepetri/rules.mk diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/config.h b/keyboards/keebio/quefrency/keymaps/georgepetri/config.h new file mode 100644 index 00000000000..d72d7760ef9 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/georgepetri/config.h @@ -0,0 +1,24 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 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 . +*/ + +#pragma once + +#define USE_I2C \ No newline at end of file diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/keymap.c b/keyboards/keebio/quefrency/keymaps/georgepetri/keymap.c new file mode 100644 index 00000000000..f08ab4f8343 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/georgepetri/keymap.c @@ -0,0 +1,44 @@ +#include QMK_KEYBOARD_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 _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65( +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + 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_DEL, 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_END, \ +// ├─────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┐ └─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┼────────┤ + 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_PGDN,\ +// ├──────────┬──────────┴┬───────┴──┬─────┴─────┬──┴────────┴────────┤ ├────────┴────────┴────┬───┴────┬───┴────┬───┴────┬────────┬────────┼────────┤ + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN1), KC_SPC, KC_SPC ,_______, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +// └──────────┴───────────┴──────────┴───────────┴────────────────────┘ └──────────────────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + + [_FN1] = LAYOUT_65( +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + 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_BSPC, KC_DEL, KC_INS, \ +// ├────────┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┘ ┌───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS,\ +// ├─────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┐ └─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ +// ├───────────────┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┐ └─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴───────────────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ +// ├──────────┬──────────┴┬───────┴──┬─────┴─────┬──┴────────┴────────┤ ├────────┴────────┴────┬───┴────┬───┴────┬───┴────┬────────┬────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// └──────────┴───────────┴──────────┴───────────┴────────────────────┘ └──────────────────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ) +}; diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/readme.md b/keyboards/keebio/quefrency/keymaps/georgepetri/readme.md new file mode 100644 index 00000000000..425190d198d --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/georgepetri/readme.md @@ -0,0 +1,48 @@ +# George Petri's Quefrency 65 layout + +``` +make keebio/quefrency:georgepetri +``` + +Based on the default querty layout with minor tweaks. +The position of the arrow keys in a line in the bottom right. +The backspace key is 1u and to the left of the delete key. +Grave, pause and insert are on the function layer. + +### Base Layer +``` +┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ ESC ││ 1 ││ 2 ││ 3 ││ 4 ││ 5 ││ 6 │ │ 7 ││ 8 ││ 9 ││ 0 ││ MINS││ EQL ││ BSPC││ DEL ││ HOME│ +└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +┌──────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────────┐┌──────┐ +│ TAB ││ Q ││ W ││ E ││ R ││ T │ │ Y ││ U ││ I ││ O ││ P ││ LBRC││ RBRC││ BSLS ││ END │ +└──────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────────┘└──────┘ +┌────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────┐┌──────┐ +│ CAPS ││ A ││ S ││ D ││ F ││ G │ │ H ││ J ││ K ││ L ││ SCLN││ QUOT││ ENT ││ PGUP│ +└────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└────────────────┘└──────┘ +┌────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────────┐┌──────┐ +│ LSFT ││ Z ││ X ││ C ││ V ││ B │ │ N ││ M ││ COMM││ DOT ││ SLSH││ RSFT ││ PGDN│ +└────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└────────────────────┘└──────┘ +┌────────┐┌────────┐┌────────┐┌────────┐┌────────────────┐ ┌────────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ LCTL ││ LGUI ││ LALT ││MO(_FN1)││ SPC │ │ SPC ││ RALT││ RCTL││ LEFT││ DOWN││ UP ││ RGHT│ +└────────┘└────────┘└────────┘└────────┘└────────────────┘ └────────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +``` + +### Function +``` +┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ GRV ││ F1 ││ F2 ││ F3 ││ F4 ││ F5 ││ F6 │ │ F7 ││ F8 ││ F9 ││ F10 ││ F11 ││ F12 ││ BSPC││ DEL ││ INS │ +└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +┌──────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────────┐┌──────┐ +│ ││ ││ ││ ││ ││ │ │ ││ ││ ││ ││ ││ ││ ││ ││ PAUS│ +└──────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────────┘└──────┘ +┌────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────┐┌──────┐ +│ ││ ││ ││ ││ ││ │ │ ││ ││ ││ ││ ││ ││ ││ │ +└────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└────────────────┘└──────┘ +┌────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────────┐┌──────┐ +│ ││ ││ ││ ││ ││ │ │ ││ ││ ││ ││ ││ ││ │ +└────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└────────────────────┘└──────┘ +┌────────┐┌────────┐┌────────┐┌────────┐┌────────────────┐ ┌────────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ ││ ││ ││ ││ │ │ ││ ││ ││ ││ ││ ││ │ +└────────┘└────────┘└────────┘└────────┘└────────────────┘ └────────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +``` \ No newline at end of file diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/rules.mk b/keyboards/keebio/quefrency/keymaps/georgepetri/rules.mk new file mode 100644 index 00000000000..e69de29bb2d From 81d8e6ef3e4d69dba8e9ba40db525ab4181ab3e3 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 21 Apr 2019 19:59:39 -0700 Subject: [PATCH 007/129] [Keyboard] Doro67 RGB PCB (#5677) * initial commit * get rid of some of the vanilla code * set up matrix and pins * Create LAYOUT macro and an appropriate keymap * support for caps lock LED * add some documentation to the doro67 parent readme * align the language used in the several readme files * initial commit * get rid of some of the vanilla code * set up matrix and pins * Create LAYOUT macro and an appropriate keymap * support for caps lock LED * add some documentation to the doro67 parent readme * align the language used in the several readme files * Use RGB Matrix and fix enter key bug * fix formatting * remove merge conflict artifacts * make a more useful default keymap * add configurator support for the RGB pcb * fix rgb matrix based on new info. Multipler should be reversed * forgot to actually set the pin output for caps lock led * fix offset keys in layer 1 keymap * code cleanup * use macros for the rgb_led calculations struct * set RGB led num to 67 as I mistakenly counted the caps lock led * cleanup config.h file * add RGB note in readme * get consistent naming in config file * fix some inconsistencies * readjust matrix and get rid of macros based on drashna's suggestions --- keyboards/doro67/multi/readme.md | 7 +- keyboards/doro67/readme.md | 12 ++ keyboards/doro67/regular/config.h | 4 +- keyboards/doro67/regular/readme.md | 6 +- keyboards/doro67/rgb/config.h | 71 ++++++++++ keyboards/doro67/rgb/info.json | 82 +++++++++++ keyboards/doro67/rgb/keymaps/default/config.h | 19 +++ keyboards/doro67/rgb/keymaps/default/keymap.c | 62 +++++++++ .../doro67/rgb/keymaps/default/readme.md | 1 + keyboards/doro67/rgb/readme.md | 17 +++ keyboards/doro67/rgb/rgb.c | 127 ++++++++++++++++++ keyboards/doro67/rgb/rgb.h | 41 ++++++ keyboards/doro67/rgb/rules.mk | 83 ++++++++++++ 13 files changed, 522 insertions(+), 10 deletions(-) create mode 100644 keyboards/doro67/rgb/config.h create mode 100644 keyboards/doro67/rgb/info.json create mode 100644 keyboards/doro67/rgb/keymaps/default/config.h create mode 100644 keyboards/doro67/rgb/keymaps/default/keymap.c create mode 100644 keyboards/doro67/rgb/keymaps/default/readme.md create mode 100644 keyboards/doro67/rgb/readme.md create mode 100644 keyboards/doro67/rgb/rgb.c create mode 100644 keyboards/doro67/rgb/rgb.h create mode 100644 keyboards/doro67/rgb/rules.mk diff --git a/keyboards/doro67/multi/readme.md b/keyboards/doro67/multi/readme.md index ac1484cd743..40fd53ee11a 100644 --- a/keyboards/doro67/multi/readme.md +++ b/keyboards/doro67/multi/readme.md @@ -1,9 +1,6 @@ -Doro67 Multi PCB -=== +# Doro67 Multi PCB -A custom 65% keyboard with multiple layout support. - -Do not flash RGB firmware for this board. +65% custom keyboard made by 80ultraman/Alf/Backprop Studios with multiple layout support. Despite the layout options available, layout is dictated by the selected integrated plate. Keyboard Maintainer: [ShadeDream](https://github.com/shadedream) Hardware Supported: Doro67 Multi PCB diff --git a/keyboards/doro67/readme.md b/keyboards/doro67/readme.md index e69de29bb2d..1648fbde577 100644 --- a/keyboards/doro67/readme.md +++ b/keyboards/doro67/readme.md @@ -0,0 +1,12 @@ +# Doro67 + +The Doro67 is a 65% USB C, integrated plate keyboard with blocker based on the M65-a by Keyclack/Rama. + +The [Group Buy](https://geekhack.org/index.php?topic=97265.0) was run by 80ultraman in coordination with Alf for machining and Backprop Studios for PCB design. + +There were 3 different PCBs available for this group buy. +## **Please be aware of which PCB you own and flash the correct firmware on it.** + +**Regular:** PCB made for the China GB which only had 1 layout. +**Multi:** PCB made for the international GB comprising of multiple layouts. While several layouts were possible, layout was determined by the integrated plate layout chosen by the customer. +**RGB:** PCB made for the international GB which had an identical switch matrix and layout to the regular PCB, with the addition of per key RGB LEDs. \ No newline at end of file diff --git a/keyboards/doro67/regular/config.h b/keyboards/doro67/regular/config.h index 9ba591cdd94..8c5c670da92 100644 --- a/keyboards/doro67/regular/config.h +++ b/keyboards/doro67/regular/config.h @@ -6,8 +6,8 @@ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0000 #define DEVICE_VER 0x0001 -#define MANUFACTURER 80ultraman -#define PRODUCT doro67 +#define MANUFACTURER Backprop Studio +#define PRODUCT Doro67 Regular PCB #define DESCRIPTION 65% custom keyboard /* key matrix size */ diff --git a/keyboards/doro67/regular/readme.md b/keyboards/doro67/regular/readme.md index 71d27ceb527..7635a40f95e 100644 --- a/keyboards/doro67/regular/readme.md +++ b/keyboards/doro67/regular/readme.md @@ -1,8 +1,8 @@ -# Regular PCB for the Doro67 +# Doro67 Regular PCB -Regular PCB for the Doro67 having ONLY one layout. This is not the PCB with RGB support. +65% custom keyboard made by 80ultraman/Alf/Backprop Studios available during the China Group Buy. -Do not flash RGB firmware for this board. +This is not the PCB with RGB support. Do not flash RGB firmware for this board. Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: Doro67 Regular PCB diff --git a/keyboards/doro67/rgb/config.h b/keyboards/doro67/rgb/config.h new file mode 100644 index 00000000000..87a30e08472 --- /dev/null +++ b/keyboards/doro67/rgb/config.h @@ -0,0 +1,71 @@ +/* +Copyright 2019 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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Backprop Studio +#define PRODUCT Doro67 RGB PCB +#define DESCRIPTION 65% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * 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 { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// The pin connected to the data pin of the LEDs +#define RGB_DI_PIN B7 +// The number of LEDs connected +#define DRIVER_LED_TOTAL 67 + +#define RGB_MATRIX_KEYPRESSES + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define RGBLED_NUM 67 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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 diff --git a/keyboards/doro67/rgb/info.json b/keyboards/doro67/rgb/info.json new file mode 100644 index 00000000000..2d9b79a23e1 --- /dev/null +++ b/keyboards/doro67/rgb/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Doro 67 RGB", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 67, + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K07", "x":7, "y":0}, + {"label":"K08", "x":8, "y":0}, + {"label":"K09", "x":9, "y":0}, + {"label":"K0A", "x":10, "y":0}, + {"label":"K0B", "x":11, "y":0}, + {"label":"K0C", "x":12, "y":0}, + {"label":"K0D", "x":13, "y":0, "w":2}, + {"label":"K0E", "x":15, "y":0}, + {"label":"K10", "x":0, "y":1, "w":1.5}, + {"label":"K11", "x":1.5, "y":1}, + {"label":"K12", "x":2.5, "y":1}, + {"label":"K13", "x":3.5, "y":1}, + {"label":"K14", "x":4.5, "y":1}, + {"label":"K15", "x":5.5, "y":1}, + {"label":"K16", "x":6.5, "y":1}, + {"label":"K17", "x":7.5, "y":1}, + {"label":"K18", "x":8.5, "y":1}, + {"label":"K19", "x":9.5, "y":1}, + {"label":"K1A", "x":10.5, "y":1}, + {"label":"K1B", "x":11.5, "y":1}, + {"label":"K1C", "x":12.5, "y":1}, + {"label":"K1D", "x":13.5, "y":1, "w":1.5}, + {"label":"K1E", "x":15, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.75}, + {"label":"K21", "x":1.75, "y":2}, + {"label":"K22", "x":2.75, "y":2}, + {"label":"K23", "x":3.75, "y":2}, + {"label":"K24", "x":4.75, "y":2}, + {"label":"K25", "x":5.75, "y":2}, + {"label":"K26", "x":6.75, "y":2}, + {"label":"K27", "x":7.75, "y":2}, + {"label":"K28", "x":8.75, "y":2}, + {"label":"K29", "x":9.75, "y":2}, + {"label":"K2A", "x":10.75, "y":2}, + {"label":"K2B", "x":11.75, "y":2}, + {"label":"K2D", "x":12.75, "y":2, "w":2.25}, + {"label":"K2E", "x":15, "y":2}, + {"label":"K30", "x":0, "y":3, "w":2.25}, + {"label":"K32", "x":2.25, "y":3}, + {"label":"K33", "x":3.25, "y":3}, + {"label":"K34", "x":4.25, "y":3}, + {"label":"K35", "x":5.25, "y":3}, + {"label":"K36", "x":6.25, "y":3}, + {"label":"K37", "x":7.25, "y":3}, + {"label":"K38", "x":8.25, "y":3}, + {"label":"K39", "x":9.25, "y":3}, + {"label":"K3A", "x":10.25, "y":3}, + {"label":"K3B", "x":11.25, "y":3}, + {"label":"K3C", "x":12.25, "y":3, "w":1.75}, + {"label":"K3D", "x":14, "y":3}, + {"label":"K3E", "x":15, "y":3}, + {"label":"K40", "x":0, "y":4, "w":1.25}, + {"label":"K41", "x":1.25, "y":4, "w":1.25}, + {"label":"K42", "x":2.5, "y":4, "w":1.25}, + {"label":"K43", "x":3.75, "y":4, "w":6.25}, + {"label":"K49", "x":10, "y":4, "w":1.25}, + {"label":"K4A", "x":11.25, "y":4, "w":1.25}, + {"label":"K4C", "x":13, "y":4}, + {"label":"K4D", "x":14, "y":4}, + {"label":"K4E", "x":15, "y":4} + ] + } + } + } + \ No newline at end of file diff --git a/keyboards/doro67/rgb/keymaps/default/config.h b/keyboards/doro67/rgb/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/doro67/rgb/keymaps/default/keymap.c b/keyboards/doro67/rgb/keymaps/default/keymap.c new file mode 100644 index 00000000000..d02665ae768 --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/keymap.c @@ -0,0 +1,62 @@ +/* Copyright 2019 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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + 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_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_PGUP, \ + 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_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + [1] = LAYOUT( \ + 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, \ + QMKBEST, QMKURL, 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, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/doro67/rgb/keymaps/default/readme.md b/keyboards/doro67/rgb/keymaps/default/readme.md new file mode 100644 index 00000000000..4ba5eb30fde --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for rgb diff --git a/keyboards/doro67/rgb/readme.md b/keyboards/doro67/rgb/readme.md new file mode 100644 index 00000000000..3a527c933c5 --- /dev/null +++ b/keyboards/doro67/rgb/readme.md @@ -0,0 +1,17 @@ +# Doro67 RGB PCB + +65% custom keyboard made by 80ultraman/Alf/Backprop Studios with in switch RGB featuring the same switch matrix and layout as the regular PCB. + +Flashing the regular PCB firmware on this board will work, but will disable RGB lighting. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Doro 67 RGB PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) + +Make example for this keyboard (after setting up your build environment): + + make doro67/rgb:default + +**RGB Note:** The WS2812 string of LEDs starts from the `K00` key connected to pin `B7` and is connected from left to right, top to bottom, following the physical layout of the board. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c new file mode 100644 index 00000000000..6f39e00c615 --- /dev/null +++ b/keyboards/doro67/rgb/rgb.c @@ -0,0 +1,127 @@ +/* Copyright 2019 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 "rgb.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(E6); + 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 (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + led_set_user(usb_led); +} + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0|(0<<4)}, {15*0, 0}, 0}, // Esc + {{0|(1<<4)}, {15*1, 0}, 0}, // 1 + {{0|(2<<4)}, {15*2, 0}, 0}, // 2 + {{0|(3<<4)}, {15*3, 0}, 0}, // 3 + {{0|(4<<4)}, {15*4, 0}, 0}, // 4 + {{0|(5<<4)}, {15*5, 0}, 0}, // 5 + {{0|(6<<4)}, {15*6, 0}, 0}, // 6 + {{0|(7<<4)}, {15*7, 0}, 0}, // 7 + {{0|(8<<4)}, {15*8, 0}, 0}, // 8 + {{0|(9<<4)}, {15*9, 0}, 0}, // 9 + {{0|(10<<4)}, {15*10, 0}, 0}, // 0 + {{0|(11<<4)}, {15*11, 0}, 0}, // - + {{0|(12<<4)}, {15*12, 0}, 0}, // = + {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace + {{0|(14<<4)}, {15*15, 0}, 1}, // Ins + + {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab + {{1|(1<<4)}, {15*1.5, 16}, 0}, // Q + {{1|(2<<4)}, {15*2.5, 16}, 0}, // W + {{1|(3<<4)}, {15*3.5, 16}, 0}, // E + {{1|(4<<4)}, {15*4.5, 16}, 0}, // R + {{1|(5<<4)}, {15*5.5, 16}, 0}, // T + {{1|(6<<4)}, {15*6.5, 16}, 0}, // Y + {{1|(7<<4)}, {15*7.5, 16}, 0}, // U + {{1|(8<<4)}, {15*8.5, 16}, 0}, // I + {{1|(9<<4)}, {15*9.5, 16}, 0}, // O + {{1|(10<<4)}, {15*10.5, 16}, 0}, // P + {{1|(11<<4)}, {15*11.5, 16}, 0}, // [ + {{1|(12<<4)}, {15*12.5, 16}, 0}, // ] + {{1|(13<<4)}, {15*13.75, 16}, 1}, // + {{1|(14<<4)}, {15*15, 16}, 1}, // Del + + {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock + {{2|(1<<4)}, {15*1.75, 32}, 0}, // A + {{2|(2<<4)}, {15*2.75, 32}, 0}, // S + {{2|(3<<4)}, {15*3.75, 32}, 0}, // D + {{2|(4<<4)}, {15*4.75, 32}, 0}, // F + {{2|(5<<4)}, {15*5.75, 32}, 0}, // G + {{2|(6<<4)}, {15*6.75, 32}, 0}, // H + {{2|(7<<4)}, {15*7.75, 32}, 0}, // J + {{2|(8<<4)}, {15*8.75, 32}, 0}, // K + {{2|(9<<4)}, {15*9.75, 32}, 0}, // L + {{2|(10<<4)}, {15*10.75, 32}, 0}, // ; + {{2|(11<<4)}, {15*11.75, 32}, 0}, // ' + {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter + {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup + + {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift + {{3|(2<<4)}, {15*2, 48}, 0}, // Z + {{3|(3<<4)}, {15*3, 48}, 0}, // X + {{3|(4<<4)}, {15*4, 48}, 0}, // C + {{3|(5<<4)}, {15*5, 48}, 0}, // V + {{3|(6<<4)}, {15*6, 48}, 0}, // B + {{3|(7<<4)}, {15*7, 48}, 0}, // N + {{3|(8<<4)}, {15*8, 48}, 0}, // M + {{3|(9<<4)}, {15*9, 48}, 0}, // , + {{3|(10<<4)}, {15*10, 48}, 0}, // . + {{3|(11<<4)}, {15*11, 48}, 0}, // / + {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift + {{3|(13<<4)}, {15*14, 48}, 1}, // Up + {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn + + {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl + {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI + {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt + {{4|(3<<4)}, {15*6.75, 64}, 0}, // Space + {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt + {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN + {{4|(12<<4)}, {15*13, 64}, 1}, // Left + {{4|(13<<4)}, {15*14, 64}, 1}, // Down + {{4|(14<<4)}, {15*15, 64}, 1}, // Right +}; diff --git a/keyboards/doro67/rgb/rgb.h b/keyboards/doro67/rgb/rgb.h new file mode 100644 index 00000000000..aafba11d0e6 --- /dev/null +++ b/keyboards/doro67/rgb/rgb.h @@ -0,0 +1,41 @@ +/* Copyright 2019 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2E, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k43, k49, k4A, k4C, k4D, k4E \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, k2E }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \ + { k40, k41, k42, k43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4A, KC_NO, k4C, k4D, k4E }, \ +} diff --git a/keyboards/doro67/rgb/rules.mk b/keyboards/doro67/rgb/rules.mk new file mode 100644 index 00000000000..6438868dc03 --- /dev/null +++ b/keyboards/doro67/rgb/rules.mk @@ -0,0 +1,83 @@ +# 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 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +RGB_MATRIX_ENABLE = WS2812 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) From 4ecaa25f3e9ae1bd1b61bab52f6a46cbaf512ae8 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Mon, 22 Apr 2019 10:14:57 -0500 Subject: [PATCH 008/129] forgot to update the define usage when 90 degree rotation was moved to a runtime switch (#5676) --- keyboards/zen/rev2/rev2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/zen/rev2/rev2.c b/keyboards/zen/rev2/rev2.c index 7bd8efbdd07..3f4a92c63d6 100644 --- a/keyboards/zen/rev2/rev2.c +++ b/keyboards/zen/rev2/rev2.c @@ -41,7 +41,7 @@ void render_status(void) { // Host Keyboard LED Status uint8_t led_usb_state = host_keyboard_leds(); - oled_set_cursor(0, OLED_MAX_LINES - 4); // Line 13 + oled_set_cursor(0, oled_max_lines() - 4); // Line 13 oled_write_P(led_usb_state & (1< Date: Tue, 23 Apr 2019 01:15:56 +1000 Subject: [PATCH 009/129] Atreus rules.mk and readme (#5678) * Update rules and readme to reflect new make usage. * Minor edit. * Minor edit. --- keyboards/atreus/readme.md | 21 +++++---- keyboards/atreus/rules.mk | 89 ++++++++++++++++++++------------------ 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/keyboards/atreus/readme.md b/keyboards/atreus/readme.md index 50901ee328a..5cd797da96f 100644 --- a/keyboards/atreus/readme.md +++ b/keyboards/atreus/readme.md @@ -1,21 +1,24 @@ Atreus -=== +====== A small mechanical keyboard that is based around the shape of the human hand. -These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2, (usually hand-wired) one powered by an A-Star. (usually using a PCB) This repository currently assumes that you have an A-Star powered Atreus. If you are using a Teensy2, specify that by adding `TEENSY2=yes` to your `make` commands. - Keyboard Maintainer: [Phil Hagelberg](https://github.com/technomancy) Hardware Supported: Atreus, PCB-based or hand-wired Hardware Availability: https://atreus.technomancy.us -Make example for this keyboard (after setting up your build environment): +These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2 (usually hand-wired), one powered by an A-Star (usually using a PCB). You will need to use different `make` commands depending on the variant you have; see examples below. - make atreus:default:avrdude +A-Star:\ +`make atreus:default:avrdude` -Unlike the TMK firmware, this command should be run from the root of -the repository, not the directory containing this readme. +Teensy:\ +`make TEENSY2=yes atreus:default:teensy` + +If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands, e.g. -If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands. +`make PCBDOWN=yes atreus:default:avrdude` -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +*Unlike the TMK firmware, these commands should be run from the root of the repository, not the directory containing this readme.* + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools), then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/atreus/rules.mk b/keyboards/atreus/rules.mk index 2488fd5e874..eda77404a02 100644 --- a/keyboards/atreus/rules.mk +++ b/keyboards/atreus/rules.mk @@ -1,19 +1,4 @@ - - -ifdef TEENSY2 - OPT_DEFS += -DATREUS_TEENSY2 - ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex -else - OPT_DEFS += -DATREUS_ASTAR -ifdef PCBDOWN - OPT_DEFS += -DPCBDOWN -endif - ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) -endif - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -48,34 +33,56 @@ ARCH = AVR8 # 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. -ifdef TEENSY2 - BOOTLOADER = halfkay -else - BOOTLOADER = caterina -endif - # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# 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 = 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 = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls -UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +ifdef TEENSY2 + BOOTLOADER = halfkay + OPT_DEFS += -DATREUS_TEENSY2 +else + BOOTLOADER = caterina + OPT_DEFS += -DATREUS_ASTAR + ifdef PCBDOWN + OPT_DEFS += -DPCBDOWN + endif +endif -USB = /dev/cu.usbmodem1411 + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = yes # 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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) From c7583d181a2cae24af60efa93caa3d662e5d48f4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Apr 2019 08:25:21 -0700 Subject: [PATCH 010/129] Update handwired/frenchdev keyboard (#5443) --- keyboards/handwired/frenchdev/config.h | 5 +- keyboards/handwired/frenchdev/frenchdev.c | 54 +++-- keyboards/handwired/frenchdev/frenchdev.h | 8 +- keyboards/handwired/frenchdev/i2cmaster.h | 178 --------------- .../frenchdev/keymaps/default/keymap.c | 152 +++++-------- keyboards/handwired/frenchdev/matrix.c | 29 +-- keyboards/handwired/frenchdev/rules.mk | 6 +- keyboards/handwired/frenchdev/twimaster.c | 208 ------------------ 8 files changed, 115 insertions(+), 525 deletions(-) delete mode 100644 keyboards/handwired/frenchdev/i2cmaster.h delete mode 100644 keyboards/handwired/frenchdev/twimaster.c diff --git a/keyboards/handwired/frenchdev/config.h b/keyboards/handwired/frenchdev/config.h index b01eec7aa08..eca66909052 100644 --- a/keyboards/handwired/frenchdev/config.h +++ b/keyboards/handwired/frenchdev/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef FRENCHDEV_V1_CONFIG_H -#define FRENCHDEV_V1_CONFIG_H +#pragma once #include "config_common.h" @@ -81,5 +80,3 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION //#define DEBUG_MATRIX_SCAN_RATE - -#endif //FRENCHDEV_V1_CONFIG_H diff --git a/keyboards/handwired/frenchdev/frenchdev.c b/keyboards/handwired/frenchdev/frenchdev.c index 6d5883a3a82..6eed4de5ff0 100644 --- a/keyboards/handwired/frenchdev/frenchdev.c +++ b/keyboards/handwired/frenchdev/frenchdev.c @@ -1,5 +1,26 @@ #include "frenchdev.h" -#include "i2cmaster.h" + +extern inline void frenchdev_board_led_on(void); +extern inline void frenchdev_led_1_on(void); +extern inline void frenchdev_led_2_on(void); +extern inline void frenchdev_led_3_on(void); +extern inline void frenchdev_led_on(uint8_t led); + +extern inline void frenchdev_board_led_off(void); +extern inline void frenchdev_led_1_off(void); +extern inline void frenchdev_led_2_off(void); +extern inline void frenchdev_led_3_off(void); +extern inline void frenchdev_led_off(uint8_t led); + +extern inline void frenchdev_led_all_on(void); +extern inline void frenchdev_led_all_off(void); + +extern inline void frenchdev_led_1_set(uint8_t n); +extern inline void frenchdev_led_2_set(uint8_t n); +extern inline void frenchdev_led_3_set(uint8_t n); +extern inline void frenchdev_led_set(uint8_t led, uint8_t n); + +extern inline void frenchdev_led_all_set(uint8_t n); bool i2c_initialized = 0; uint8_t mcp23018_status = 0x20; @@ -31,15 +52,15 @@ void frenchdev_blink_all_leds(void) frenchdev_led_all_off(); frenchdev_led_all_set(LED_BRIGHTNESS_HI); frenchdev_led_1_on(); - _delay_ms(50); + wait_ms(50); frenchdev_led_2_on(); - _delay_ms(50); + wait_ms(50); frenchdev_led_3_on(); - _delay_ms(50); + wait_ms(50); frenchdev_led_1_off(); - _delay_ms(50); + wait_ms(50); frenchdev_led_2_off(); - _delay_ms(50); + wait_ms(50); frenchdev_led_3_off(); frenchdev_led_all_off(); } @@ -54,28 +75,28 @@ uint8_t init_mcp23018(void) { // cli(); if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) - i2c_initialized++; - _delay_ms(1000); + i2c_initialized = true;; + wait_ms(1000); } // set pin direction // - unused : input : 1 // - input : input : 1 // - driving : output : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111, I2C_TIMEOUT); if (mcp23018_status) goto out; i2c_stop(); // set pull-up // - unused : on : 1 // - input : on : 1 // - driving : off : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111, I2C_TIMEOUT); if (mcp23018_status) goto out; out: i2c_stop(); @@ -84,4 +105,3 @@ out: return mcp23018_status; } - diff --git a/keyboards/handwired/frenchdev/frenchdev.h b/keyboards/handwired/frenchdev/frenchdev.h index 82dbe18b89f..1df39908879 100644 --- a/keyboards/handwired/frenchdev/frenchdev.h +++ b/keyboards/handwired/frenchdev/frenchdev.h @@ -1,10 +1,9 @@ -#ifndef FRENCHDEV_V1_H -#define FRENCHDEV_V1_H +#pragma once #include "quantum.h" #include #include -#include "i2cmaster.h" +#include "i2c_master.h" #include #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) @@ -24,6 +23,7 @@ #define OLATB 0x15 extern uint8_t mcp23018_status; +#define I2C_TIMEOUT 100 void init_frenchdev(void); void frenchdev_blink_all_leds(void); @@ -111,5 +111,3 @@ inline void frenchdev_led_all_set(uint8_t n) { k51, k41, k31, k21, k11, k01 }, \ { k50, k40, k30, k20, k10, KC_NO } \ } - -#endif diff --git a/keyboards/handwired/frenchdev/i2cmaster.h b/keyboards/handwired/frenchdev/i2cmaster.h deleted file mode 100644 index 3917b9e6c00..00000000000 --- a/keyboards/handwired/frenchdev/i2cmaster.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef _I2CMASTER_H -#define _I2CMASTER_H 1 -/************************************************************************* -* Title: C include file for the I2C master interface -* (i2cmaster.S or twimaster.c) -* Author: Peter Fleury http://jump.to/fleury -* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device -* Usage: see Doxygen manual -**************************************************************************/ - -#ifdef DOXYGEN -/** - @defgroup pfleury_ic2master I2C Master library - @code #include @endcode - - @brief I2C (TWI) Master Software Library - - Basic routines for communicating with I2C slave devices. This single master - implementation is limited to one bus master on the I2C bus. - - This I2c library is implemented as a compact assembler software implementation of the I2C protocol - which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). - Since the API for these two implementations is exactly the same, an application can be linked either against the - software I2C implementation or the hardware I2C implementation. - - Use 4.7k pull-up resistor on the SDA and SCL pin. - - Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module - i2cmaster.S to your target when using the software I2C implementation ! - - Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. - - @note - The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted - to GNU assembler and AVR-GCC C call interface. - Replaced the incorrect quarter period delays found in AVR300 with - half period delays. - - @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury - - @par API Usage Example - The following code shows typical usage of this library, see example test_i2cmaster.c - - @code - - #include - - - #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet - - int main(void) - { - unsigned char ret; - - i2c_init(); // initialize I2C library - - // write 0x75 to EEPROM address 5 (Byte Write) - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - i2c_write(0x05); // write address = 5 - i2c_write(0x75); // write value 0x75 to EEPROM - i2c_stop(); // set stop conditon = release bus - - - // read previously written value back from EEPROM address 5 - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - - i2c_write(0x05); // write address = 5 - i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode - - ret = i2c_readNak(); // read one byte from EEPROM - i2c_stop(); - - for(;;); - } - @endcode - -*/ -#endif /* DOXYGEN */ - -/**@{*/ - -#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 -#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" -#endif - -#include - -/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_READ 1 - -/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_WRITE 0 - - -/** - @brief initialize the I2C master interace. Need to be called only once - @param void - @return none - */ -extern void i2c_init(void); - - -/** - @brief Terminates the data transfer and releases the I2C bus - @param void - @return none - */ -extern void i2c_stop(void); - - -/** - @brief Issues a start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_start(unsigned char addr); - - -/** - @brief Issues a repeated start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_rep_start(unsigned char addr); - - -/** - @brief Issues a start condition and sends address and transfer direction - - If device is busy, use ack polling to wait until device ready - @param addr address and transfer direction of I2C device - @return none - */ -extern void i2c_start_wait(unsigned char addr); - - -/** - @brief Send one byte to I2C device - @param data byte to be transfered - @retval 0 write successful - @retval 1 write failed - */ -extern unsigned char i2c_write(unsigned char data); - - -/** - @brief read one byte from the I2C device, request more data from device - @return byte read from I2C device - */ -extern unsigned char i2c_readAck(void); - -/** - @brief read one byte from the I2C device, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_readNak(void); - -/** - @brief read one byte from the I2C device - - Implemented as a macro, which calls either i2c_readAck or i2c_readNak - - @param ack 1 send ack, request more data from device
- 0 send nak, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_read(unsigned char ack); -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - - -/**@}*/ -#endif diff --git a/keyboards/handwired/frenchdev/keymaps/default/keymap.c b/keyboards/handwired/frenchdev/keymaps/default/keymap.c index 506383a1bba..7b82f36e360 100644 --- a/keyboards/handwired/frenchdev/keymaps/default/keymap.c +++ b/keyboards/handwired/frenchdev/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "mousekey.h" #include "keymap_bepo.h" @@ -14,7 +13,7 @@ #define KEY_DELAY 130 enum macros { - M_LP, // left pedal + M_LP = SAFE_RANGE, // left pedal M_RP, // right pedal M_SF, // shift M_SFS, // shift and space @@ -63,19 +62,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------| / |------| , | space|------|------|------ .. ------|------|------| L1/sp| LEFT |------| UP |------+------| * * | CTRL | win |------/ \-------------| L1 | alt | .. | CAPS | L1 |-------------/ \------| : | CTRL | * * `-------------/ \-------------/ .. \-------------/ \-------------/ * - *M(M_LP) */ [_BASE] = LAYOUT( 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_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \ KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \ BP_GRV, BP_A, BP_U, BP_E, BP_I, BP_F, BP_SCLN, BP_EXLM, BP_C, BP_T, BP_S, BP_R, BP_N, BP_APOS, \ - M(M_SF), BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRACKET, M(M_SFS), BP_CBSP, M(L2INS), M(L2LOC), BP_CDEL, M(M_SFS),BP_M, BP_G, KC_UP, BP_H, BP_Q, M(M_SF), \ - KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M(M_L1E), KC_LALT, KC_CAPS, M(M_L1E),KC_SPACE,KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \ + M_SF, BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRC, M_SFS, BP_CBSP, L2INS, L2LOC, BP_CDEL, M_SFS, BP_M, BP_G, KC_UP, BP_H, BP_Q, M_SF, \ + KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M_L1E, KC_LALT, KC_CAPS, M_L1E, KC_SPACE, KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \ //left pedals - M(M_LP), M(M_RP), KC_TRNS, \ + M_LP, M_RP, KC_TRNS, \ //right pedals - M(M_LP), M(M_RP), KC_TRNS \ + M_LP, M_RP, KC_TRNS \ ), /* Larer 1 for symbols. @@ -102,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \ KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \ KC_TRNS, BP_EQL, BP_UGRV, BP_LPRN, BP_RPRN, BP_PLUS, BP_COLN, BP_QEST, BP_CCED, BP_LESS, BP_GRTR, BP_AMPR, BP_UNDS, KC_TRNS, \ - KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), M(M_SE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \ + KC_TRNS, M_UN, M_CUT, M_CP, M_PS, M_SE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \ KC_TRNS, KC_TRNS, BP_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, \ //left pedals KC_TRNS, KC_BTN1, KC_TRNS, \ @@ -134,12 +132,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, KC_TRNS, \ - KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, KC_TRNS, \ + KC_TRNS, M_UN, M_CUT, M_CP, M_PS, KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_PDOT, BP_DOT, BP_COMM, KC_TRNS, \ //left pedals - KC_BTN3, M(M_RP), KC_TRNS, \ + KC_BTN3, M_RP, KC_TRNS, \ //right pedals - KC_BTN3, M(M_RP), KC_TRNS \ + KC_BTN3, M_RP, KC_TRNS \ ), /* TRNS - skeleton for laters @@ -169,9 +167,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ //left pedals - KC_BTN3, M(M_RP), KC_TRNS, \ + KC_BTN3, M_RP, KC_TRNS, \ //right pedals - KC_BTN3, M(M_RP), KC_TRNS \ + KC_BTN3, M_RP, KC_TRNS \ ), }; @@ -191,28 +189,52 @@ void release_shift(void) { void press_space(void) { if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code (KC_SPACE); - unregister_code (KC_SPACE); + tap_code(KC_SPACE); if(shift_count > 0) register_code (KC_LSHIFT); } void press_enter(void) { if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code (KC_ENT); - unregister_code (KC_ENT); + tap_code (KC_ENT); if(shift_count > 0) register_code (KC_LSHIFT); } void press_underscore(void) { if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code ((unsigned char) BP_UNDS); - unregister_code ((unsigned char) BP_UNDS); + tap_code ((unsigned char) BP_UNDS); if(shift_count > 0) register_code (KC_LSHIFT); } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { +void matrix_init_user(void) { +} + +// Bleah globals need to be initialized. +uint8_t old_layer=_BASE; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + frenchdev_led_1_off(); + frenchdev_led_2_off(); + switch (layer) { + case _BASE: + frenchdev_led_2_on(); + break; + case _SYMBOLS: + frenchdev_led_1_on(); + break; + case _MEDIA: + frenchdev_led_1_on(); + frenchdev_led_2_on(); + default: + // none + break; + } +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { case M_LP: //left pedal if (record->event.pressed) { layer_on(1); @@ -220,25 +242,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) key_timer_left_pedal = timer_read(); // if the key is being pressed, we start the timer. } else { if (timer_elapsed(key_timer_left_pedal) < KEY_DELAY) { - mousekey_on (KC_BTN2); - mousekey_send(); - mousekey_off (KC_BTN2); - mousekey_send(); + tap_code (KC_BTN2); } unregister_code (KC_SLCK); layer_off(1); } - break; + break; case M_RP: //right pedal if (record->event.pressed) { layer_on(2); key_timer_right_pedal = timer_read(); // if the key is being pressed, we start the timer. } else { if (timer_elapsed(key_timer_right_pedal) < PEDAL_DELAY) { - mousekey_on (KC_BTN1); - mousekey_send(); - mousekey_off (KC_BTN1); - mousekey_send(); + tap_code (KC_BTN1); } layer_off(2); } @@ -289,13 +305,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. } else { if (timer_elapsed(key_timer_2) < KEY_DELAY) { - register_code (KC_INS); - unregister_code (KC_INS); + tap_code (KC_INS); } l2_locked = 0; layer_off(2); } - break; + break; case L2LOC: //lock L2 if (record->event.pressed) { key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. @@ -309,80 +324,33 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) layer_off(2); } } - break; + break; case M_UN: // undo if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_Z); - unregister_code(BP_Z); - unregister_code(KC_LCTL); + tap_code16(C(BP_Z)); } - break; + break; case M_CUT: // cut if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_X); - unregister_code(BP_X); - unregister_code(KC_LCTL); + tap_code16(C(BP_X)); } - break; + break; case M_CP: // copy if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_C); - unregister_code(BP_C); - unregister_code(KC_LCTL); + tap_code16(C(BP_C)); } - break; + break; case M_PS: // paste if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_V); - unregister_code(BP_V); - unregister_code(KC_LCTL); + tap_code16(C(BP_V)); } - break; + break; case M_SE: // search if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_F); - unregister_code(BP_F); - unregister_code(KC_LCTL); + tap_code16(C(BP_F)); } - break; + break; } - return MACRO_NONE; -}; - -void matrix_init_user(void) { -} - -// Bleah globals need to be initialized. -uint8_t old_layer=_BASE; - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - frenchdev_led_1_off(); - frenchdev_led_2_off(); - switch (layer) { - case _BASE: - frenchdev_led_2_on(); - break; - case _SYMBOLS: - frenchdev_led_1_on(); - break; - case _MEDIA: - frenchdev_led_1_on(); - frenchdev_led_2_on(); - default: - // none - break; - } -} - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } diff --git a/keyboards/handwired/frenchdev/matrix.c b/keyboards/handwired/frenchdev/matrix.c index 7fe3d0bbf24..4263555e951 100644 --- a/keyboards/handwired/frenchdev/matrix.c +++ b/keyboards/handwired/frenchdev/matrix.c @@ -40,7 +40,6 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "frenchdev.h" -#include "i2cmaster.h" #ifdef DEBUG_MATRIX_SCAN_RATE #include "timer.h" #endif @@ -280,11 +279,12 @@ static matrix_row_t read_cols(uint8_t row) return 0; } else { uint8_t data = 0; - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOB); if (mcp23018_status) goto out; - mcp23018_status = i2c_start(I2C_ADDR_READ); if (mcp23018_status) goto out; - data = i2c_readNak(); - data = ~data; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOB, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT); if (mcp23018_status) goto out; + data = i2c_read_nack(I2C_TIMEOUT); if (mcp23018_status < 0) goto out; + data = ~((uint8_t)mcp23018_status); + mcp23018_status = I2C_STATUS_SUCCESS; out: i2c_stop(); return data; @@ -318,11 +318,9 @@ static void unselect_rows(void) // do nothing } else { // set all rows hi-Z : 1 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write( 0xFF - & ~(0<<8) - ); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write( 0xFF & ~(0<<8), I2C_TIMEOUT); if (mcp23018_status) goto out; out: i2c_stop(); } @@ -346,11 +344,9 @@ static void select_row(uint8_t row) } else { // set active row low : 0 // set other rows hi-Z : 1 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write( 0xFF & ~(1< http://jump.to/fleury -* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device with hardware TWI -* Usage: API compatible with I2C Software Library i2cmaster.h -**************************************************************************/ -#include -#include - -#include - - -/* define CPU frequency in Mhz here if not defined in Makefile */ -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -/* I2C clock in Hz */ -#define SCL_CLOCK 400000L - - -/************************************************************************* - Initialization of the I2C bus interface. Need to be called only once -*************************************************************************/ -void i2c_init(void) -{ - /* initialize TWI clock - * minimal values in Bit Rate Register (TWBR) and minimal Prescaler - * bits in the TWI Status Register should give us maximal possible - * I2C bus speed - about 444 kHz - * - * for more details, see 20.5.2 in ATmega16/32 secification - */ - - TWSR = 0; /* no prescaler */ - TWBR = 10; /* must be >= 10 for stable operation */ - -}/* i2c_init */ - - -/************************************************************************* - Issues a start condition and sends address and transfer direction. - return 0 = device accessible, 1= failed to access device -*************************************************************************/ -unsigned char i2c_start(unsigned char address) -{ - uint8_t twst; - - // send START condition - TWCR = (1< Date: Mon, 22 Apr 2019 17:26:41 +0200 Subject: [PATCH 011/129] Define RGB colors (#5300) * Define RGB colors Define RGB colors and pass them to the rgblight functions, instead of defining multiple macros. * Add new color definitions support for RGB Matrix * Add/clarify info about new color definitions in Docs * Add deprecation warning banner to rgblight_list.h --- docs/feature_rgb_matrix.md | 29 +++++ docs/feature_rgblight.md | 35 +++++- quantum/rgb_matrix.h | 1 + quantum/rgblight_list.h | 240 ++++++++++++++++++++++--------------- 4 files changed, 210 insertions(+), 95 deletions(-) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index acef4717dde..5309e749cb7 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -236,6 +236,35 @@ void rgb_matrix_indicators_kb(void) { A similar function works in the keymap as `rgb_matrix_indicators_user`. + +## Colors + +These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. + +|RGB |HSV | +|-------------------|-------------------| +|`RGB_WHITE` |`HSV_WHITE` | +|`RGB_RED` |`HSV_RED` | +|`RGB_CORAL` |`HSV_CORAL` | +|`RGB_ORANGE` |`HSV_ORANGE` | +|`RGB_GOLDENROD` |`HSV_GOLDENROD` | +|`RGB_GOLD` |`HSV_GOLD` | +|`RGB_YELLOW` |`HSV_YELLOW` | +|`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | +|`RGB_GREEN` |`HSV_GREEN` | +|`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | +|`RGB_TURQUOISE` |`HSV_TURQUOISE` | +|`RGB_TEAL` |`HSV_TEAL` | +|`RGB_CYAN` |`HSV_CYAN` | +|`RGB_AZURE` |`HSV_AZURE` | +|`RGB_BLUE` |`HSV_BLUE` | +|`RGB_PURPLE` |`HSV_PURPLE` | +|`RGB_MAGENTA` |`HSV_MAGENTA` | +|`RGB_PINK` |`HSV_PINK` | + +These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! + + ## Additional `config.h` Options ```C diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 97a99599468..48277373a51 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -191,7 +191,40 @@ If you need to change your RGB lighting in code, for example in a macro to chang |`rgblight_decrease_val_noeeprom()` |Decrease the value for all LEDs. This wraps around at minimum value (not written to EEPROM) | |`rgblight_set_clipping_range(pos, num)` |Set clipping Range | -Additionally, [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h) defines several predefined shortcuts for various colors. Feel free to add to this list! +## Colors + +These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. + +|RGB |HSV | +|-------------------|-------------------| +|`RGB_WHITE` |`HSV_WHITE` | +|`RGB_RED` |`HSV_RED` | +|`RGB_CORAL` |`HSV_CORAL` | +|`RGB_ORANGE` |`HSV_ORANGE` | +|`RGB_GOLDENROD` |`HSV_GOLDENROD` | +|`RGB_GOLD` |`HSV_GOLD` | +|`RGB_YELLOW` |`HSV_YELLOW` | +|`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | +|`RGB_GREEN` |`HSV_GREEN` | +|`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | +|`RGB_TURQUOISE` |`HSV_TURQUOISE` | +|`RGB_TEAL` |`HSV_TEAL` | +|`RGB_CYAN` |`HSV_CYAN` | +|`RGB_AZURE` |`HSV_AZURE` | +|`RGB_BLUE` |`HSV_BLUE` | +|`RGB_PURPLE` |`HSV_PURPLE` | +|`RGB_MAGENTA` |`HSV_MAGENTA` | +|`RGB_PINK` |`HSV_PINK` | + +```c +rgblight_setrgb(RGB_ORANGE); +rgblight_sethsv_noeeprom(HSV_GREEN); +rgblight_setrgb_at(RGB_GOLD, 3); +rgblight_sethsv_range(HSV_WHITE, 0, 6); +``` + +These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! + ## Changing the order of the LEDs diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 0a11f269205..f5be494354f 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -24,6 +24,7 @@ #include "rgb_matrix_types.h" #include "color.h" #include "quantum.h" +#include "rgblight_list.h" #ifdef IS31FL3731 #include "is31fl3731.h" diff --git a/quantum/rgblight_list.h b/quantum/rgblight_list.h index 407fd8e9d31..7b831338087 100644 --- a/quantum/rgblight_list.h +++ b/quantum/rgblight_list.h @@ -13,111 +13,163 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef RGBLIGHT_LIST_H -#define RGBLIGHT_LIST_H +#pragma once + +/* RGB COLORS */ +#define RGB_WHITE 0xFF, 0xFF, 0xFF +#define RGB_RED 0xFF, 0x00, 0x00 +#define RGB_CORAL 0xFF, 0x7C, 0x4D +#define RGB_ORANGE 0xFF, 0x80, 0x00 +#define RGB_GOLDENROD 0xD9, 0xA5, 0x21 +#define RGB_GOLD 0xFF, 0xD9, 0x00 +#define RGB_YELLOW 0xFF, 0xFF, 0x00 +#define RGB_CHARTREUSE 0x80, 0xFF, 0x00 +#define RGB_GREEN 0x00, 0xFF, 0x00 +#define RGB_SPRINGGREEN 0x00, 0xFF, 0x80 +#define RGB_TURQUOISE 0x47, 0x6E, 0x6A +#define RGB_TEAL 0x00, 0x80, 0x80 +#define RGB_CYAN 0x00, 0xFF, 0xFF +#define RGB_AZURE 0x99, 0xf5, 0xFF +#define RGB_BLUE 0x00, 0x00, 0xFF +#define RGB_PURPLE 0x7A, 0x00, 0xFF +#define RGB_MAGENTA 0xFF, 0x00, 0xFF +#define RGB_PINK 0xFF, 0x80, 0xBF + +/* HSV COLORS */ +#define HSV_WHITE 0, 0, 255 +#define HSV_RED 0, 255, 255 +#define HSV_CORAL 16, 176, 255 +#define HSV_ORANGE 39, 255, 255 +#define HSV_GOLDENROD 43, 218, 218 +#define HSV_GOLD 51, 255, 255 +#define HSV_YELLOW 60, 255, 255 +#define HSV_CHARTREUSE 90, 255, 255 +#define HSV_GREEN 120, 255, 255 +#define HSV_SPRINGGREEN 150, 255, 255 +#define HSV_TURQUOISE 174, 90, 112 +#define HSV_TEAL 180, 255, 128 +#define HSV_CYAN 180, 255, 255 +#define HSV_AZURE 186, 102, 255 +#define HSV_BLUE 240, 255, 255 +#define HSV_PURPLE 270, 255, 255 +#define HSV_MAGENTA 300, 255, 255 +#define HSV_PINK 330, 128, 255 + + +/* +######################################################################################## +## ## +## ## +## ## +## The functions below have been deprecated and may be removed in a future release. ## +## ## +## Please use the values above with the RGB functions. ## +## ## +## ## +## ## +######################################################################################## +*/ /* SET RGB List */ -#define rgblight_setrgb_white() rgblight_setrgb (0xFF, 0xFF, 0xFF) -#define rgblight_setrgb_red() rgblight_setrgb (0xFF, 0x00, 0x00) -#define rgblight_setrgb_coral() rgblight_setrgb (0xFF, 0x7C, 0x4D) -#define rgblight_setrgb_orange() rgblight_setrgb (0xFF, 0x80, 0x00) -#define rgblight_setrgb_goldenrod() rgblight_setrgb (0xD9, 0xA5, 0x21) -#define rgblight_setrgb_gold() rgblight_setrgb (0xFF, 0xD9, 0x00) -#define rgblight_setrgb_yellow() rgblight_setrgb (0xFF, 0xFF, 0x00) -#define rgblight_setrgb_chartreuse() rgblight_setrgb (0x80, 0xFF, 0x00) -#define rgblight_setrgb_green() rgblight_setrgb (0x00, 0xFF, 0x00) -#define rgblight_setrgb_springgreen() rgblight_setrgb (0x00, 0xFF, 0x80) -#define rgblight_setrgb_turquoise() rgblight_setrgb (0x47, 0x6E, 0x6A) -#define rgblight_setrgb_teal() rgblight_setrgb (0x00, 0x80, 0x80) -#define rgblight_setrgb_cyan() rgblight_setrgb (0x00, 0xFF, 0xFF) -#define rgblight_setrgb_azure() rgblight_setrgb (0x99, 0xf5, 0xFF) -#define rgblight_setrgb_blue() rgblight_setrgb (0x00, 0x00, 0xFF) -#define rgblight_setrgb_purple() rgblight_setrgb (0x7A, 0x00, 0xFF) -#define rgblight_setrgb_magenta() rgblight_setrgb (0xFF, 0x00, 0xFF) -#define rgblight_setrgb_pink() rgblight_setrgb (0xFF, 0x80, 0xBF) +#define rgblight_setrgb_white() rgblight_setrgb (RGB_WHITE) +#define rgblight_setrgb_red() rgblight_setrgb (RGB_RED) +#define rgblight_setrgb_coral() rgblight_setrgb (RGB_CORAL) +#define rgblight_setrgb_orange() rgblight_setrgb (RGB_ORANGE) +#define rgblight_setrgb_goldenrod() rgblight_setrgb (RGB_GOLDENROD) +#define rgblight_setrgb_gold() rgblight_setrgb (RGB_GOLD) +#define rgblight_setrgb_yellow() rgblight_setrgb (RGB_YEllOW) +#define rgblight_setrgb_chartreuse() rgblight_setrgb (RGB_CHARTREUSE) +#define rgblight_setrgb_green() rgblight_setrgb (RGB_GREEN) +#define rgblight_setrgb_springgreen() rgblight_setrgb (RGB_SPRINGGREEN) +#define rgblight_setrgb_turquoise() rgblight_setrgb (RGB_TURQUOISE) +#define rgblight_setrgb_teal() rgblight_setrgb (RGB_TEAL) +#define rgblight_setrgb_cyan() rgblight_setrgb (RGB_CYAN) +#define rgblight_setrgb_azure() rgblight_setrgb (RGB_AZURE) +#define rgblight_setrgb_blue() rgblight_setrgb (RGB_BLUE) +#define rgblight_setrgb_purple() rgblight_setrgb (RGB_PURPLE) +#define rgblight_setrgb_magenta() rgblight_setrgb (RGB_MAGENTA) +#define rgblight_setrgb_pink() rgblight_setrgb (RGB_PINK) /* SET RGB List */ -#define rgblight_setrgb_white_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0xFF, at) -#define rgblight_setrgb_red_at(at) rgblight_setrgb_at (0xFF, 0x00, 0x00, at) -#define rgblight_setrgb_coral_at(at) rgblight_setrgb_at (0xFF, 0x7C, 0x4D, at) -#define rgblight_setrgb_orange_at(at) rgblight_setrgb_at (0xFF, 0x80, 0x00, at) -#define rgblight_setrgb_goldenrod_at(at) rgblight_setrgb_at (0xD9, 0xA5, 0x21, at) -#define rgblight_setrgb_gold_at(at) rgblight_setrgb_at (0xFF, 0xD9, 0x00, at) -#define rgblight_setrgb_yellow_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0x00, at) -#define rgblight_setrgb_chartreuse_at(at) rgblight_setrgb_at (0x80, 0xFF, 0x00, at) -#define rgblight_setrgb_green_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x00, at) -#define rgblight_setrgb_springgreen_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x80, at) -#define rgblight_setrgb_turquoise_at(at) rgblight_setrgb_at (0x47, 0x6E, 0x6A, at) -#define rgblight_setrgb_teal_at(at) rgblight_setrgb_at (0x00, 0x80, 0x80, at) -#define rgblight_setrgb_cyan_at(at) rgblight_setrgb_at (0x00, 0xFF, 0xFF, at) -#define rgblight_setrgb_azure_at(at) rgblight_setrgb_at (0x99, 0xf5, 0xFF, at) -#define rgblight_setrgb_blue_at(at) rgblight_setrgb_at (0x00, 0x00, 0xFF, at) -#define rgblight_setrgb_purple_at(at) rgblight_setrgb_at (0x7A, 0x00, 0xFF, at) -#define rgblight_setrgb_magenta_at(at) rgblight_setrgb_at (0xFF, 0x00, 0xFF, at) -#define rgblight_setrgb_pink_at(at) rgblight_setrgb_at (0xFF, 0x80, 0xBF, at) +#define rgblight_setrgb_white_at(at) rgblight_setrgb_at (RGB_WHITE, at) +#define rgblight_setrgb_red_at(at) rgblight_setrgb_at (RGB_RED, at) +#define rgblight_setrgb_coral_at(at) rgblight_setrgb_at (RGB_CORAL, at) +#define rgblight_setrgb_orange_at(at) rgblight_setrgb_at (RGB_ORANGE at) +#define rgblight_setrgb_goldenrod_at(at) rgblight_setrgb_at (RGB_GOLDENROD, at) +#define rgblight_setrgb_gold_at(at) rgblight_setrgb_at (RGB_GOLD, at) +#define rgblight_setrgb_yellow_at(at) rgblight_setrgb_at (RGB_YELLOW, at) +#define rgblight_setrgb_chartreuse_at(at) rgblight_setrgb_at (RGB_CHARTREUSE, at) +#define rgblight_setrgb_green_at(at) rgblight_setrgb_at (RGB_GREEN, at) +#define rgblight_setrgb_springgreen_at(at) rgblight_setrgb_at (RGB_SPRINGGREEN, at) +#define rgblight_setrgb_turquoise_at(at) rgblight_setrgb_at (RGB_TURQUOISE, at) +#define rgblight_setrgb_teal_at(at) rgblight_setrgb_at (RGB_TEAL, at) +#define rgblight_setrgb_cyan_at(at) rgblight_setrgb_at (RGB_CYAN, at) +#define rgblight_setrgb_azure_at(at) rgblight_setrgb_at (RGB_AZURE, at) +#define rgblight_setrgb_blue_at(at) rgblight_setrgb_at (RGB_BLUE, at) +#define rgblight_setrgb_purple_at(at) rgblight_setrgb_at (RGB_PURPLE, at) +#define rgblight_setrgb_magenta_at(at) rgblight_setrgb_at (RGB_MAGENTA, at) +#define rgblight_setrgb_pink_at(at) rgblight_setrgb_at (RGB_PINK, at) /* SET HSV List */ -#define rgblight_sethsv_white() rgblight_sethsv ( 0, 0, 255) -#define rgblight_sethsv_red() rgblight_sethsv ( 0, 255, 255) -#define rgblight_sethsv_coral() rgblight_sethsv ( 16, 176, 255) -#define rgblight_sethsv_orange() rgblight_sethsv ( 39, 255, 255) -#define rgblight_sethsv_goldenrod() rgblight_sethsv ( 43, 218, 218) -#define rgblight_sethsv_gold() rgblight_sethsv ( 51, 255, 255) -#define rgblight_sethsv_yellow() rgblight_sethsv ( 60, 255, 255) -#define rgblight_sethsv_chartreuse() rgblight_sethsv ( 90, 255, 255) -#define rgblight_sethsv_green() rgblight_sethsv (120, 255, 255) -#define rgblight_sethsv_springgreen() rgblight_sethsv (150, 255, 255) -#define rgblight_sethsv_turquoise() rgblight_sethsv (174, 90, 112) -#define rgblight_sethsv_teal() rgblight_sethsv (180, 255, 128) -#define rgblight_sethsv_cyan() rgblight_sethsv (180, 255, 255) -#define rgblight_sethsv_azure() rgblight_sethsv (186, 102, 255) -#define rgblight_sethsv_blue() rgblight_sethsv (240, 255, 255) -#define rgblight_sethsv_purple() rgblight_sethsv (270, 255, 255) -#define rgblight_sethsv_magenta() rgblight_sethsv (300, 255, 255) -#define rgblight_sethsv_pink() rgblight_sethsv (330, 128, 255) +#define rgblight_sethsv_white() rgblight_sethsv (HSV_WHITE) +#define rgblight_sethsv_red() rgblight_sethsv (HSV_RED) +#define rgblight_sethsv_coral() rgblight_sethsv (HSV_CORAL) +#define rgblight_sethsv_orange() rgblight_sethsv (HSV_ORANGE) +#define rgblight_sethsv_goldenrod() rgblight_sethsv (HSV_GOLDENROD) +#define rgblight_sethsv_gold() rgblight_sethsv (HSV_GOLD) +#define rgblight_sethsv_yellow() rgblight_sethsv (HSV_YELLOW) +#define rgblight_sethsv_chartreuse() rgblight_sethsv (HSV_CHARTREUSE) +#define rgblight_sethsv_green() rgblight_sethsv (HSV_GREEN) +#define rgblight_sethsv_springgreen() rgblight_sethsv (HSV_SPRINGGREEN) +#define rgblight_sethsv_turquoise() rgblight_sethsv (HSV_TURQUOISE) +#define rgblight_sethsv_teal() rgblight_sethsv (HSV_TEAL) +#define rgblight_sethsv_cyan() rgblight_sethsv (HSV_CYAN) +#define rgblight_sethsv_azure() rgblight_sethsv (HSV_AZURE) +#define rgblight_sethsv_blue() rgblight_sethsv (HSV_BLUE) +#define rgblight_sethsv_purple() rgblight_sethsv (HSV_PURPLE) +#define rgblight_sethsv_magenta() rgblight_sethsv (HSV_MAGENTA) +#define rgblight_sethsv_pink() rgblight_sethsv (HSV_PINK) /* SET HSV List */ /* If you're doing layer indication, this is best, as it won't */ /* write to the eeprom, since it's limited (very high value). */ /* If you want to use modes with this (since you can), then you */ /* want to use rgblight_mode_noeeprom(x) instead. */ -#define rgblight_sethsv_noeeprom_white() rgblight_sethsv_noeeprom ( 0, 0, 255) -#define rgblight_sethsv_noeeprom_red() rgblight_sethsv_noeeprom ( 0, 255, 255) -#define rgblight_sethsv_noeeprom_coral() rgblight_sethsv_noeeprom ( 16, 176, 255) -#define rgblight_sethsv_noeeprom_orange() rgblight_sethsv_noeeprom ( 39, 255, 255) -#define rgblight_sethsv_noeeprom_goldenrod() rgblight_sethsv_noeeprom ( 43, 218, 218) -#define rgblight_sethsv_noeeprom_gold() rgblight_sethsv_noeeprom ( 51, 255, 255) -#define rgblight_sethsv_noeeprom_yellow() rgblight_sethsv_noeeprom ( 60, 255, 255) -#define rgblight_sethsv_noeeprom_chartreuse() rgblight_sethsv_noeeprom ( 90, 255, 255) -#define rgblight_sethsv_noeeprom_green() rgblight_sethsv_noeeprom (120, 255, 255) -#define rgblight_sethsv_noeeprom_springgreen() rgblight_sethsv_noeeprom (150, 255, 255) -#define rgblight_sethsv_noeeprom_turquoise() rgblight_sethsv_noeeprom (174, 90, 112) -#define rgblight_sethsv_noeeprom_teal() rgblight_sethsv_noeeprom (180, 255, 128) -#define rgblight_sethsv_noeeprom_cyan() rgblight_sethsv_noeeprom (180, 255, 255) -#define rgblight_sethsv_noeeprom_azure() rgblight_sethsv_noeeprom (186, 102, 255) -#define rgblight_sethsv_noeeprom_blue() rgblight_sethsv_noeeprom (240, 255, 255) -#define rgblight_sethsv_noeeprom_purple() rgblight_sethsv_noeeprom (270, 255, 255) -#define rgblight_sethsv_noeeprom_magenta() rgblight_sethsv_noeeprom (300, 255, 255) -#define rgblight_sethsv_noeeprom_pink() rgblight_sethsv_noeeprom (330, 128, 255) +#define rgblight_sethsv_noeeprom_white() rgblight_sethsv_noeeprom (HSV_WHITE) +#define rgblight_sethsv_noeeprom_red() rgblight_sethsv_noeeprom (HSV_RED) +#define rgblight_sethsv_noeeprom_coral() rgblight_sethsv_noeeprom (HSV_CORAL) +#define rgblight_sethsv_noeeprom_orange() rgblight_sethsv_noeeprom (HSV_ORANGE) +#define rgblight_sethsv_noeeprom_goldenrod() rgblight_sethsv_noeeprom (HSV_GOLDENROD) +#define rgblight_sethsv_noeeprom_gold() rgblight_sethsv_noeeprom (HSV_GOLD) +#define rgblight_sethsv_noeeprom_yellow() rgblight_sethsv_noeeprom (HSV_YELLOW) +#define rgblight_sethsv_noeeprom_chartreuse() rgblight_sethsv_noeeprom (HSV_CHARTREUSE) +#define rgblight_sethsv_noeeprom_green() rgblight_sethsv_noeeprom (HSV_GREEN) +#define rgblight_sethsv_noeeprom_springgreen() rgblight_sethsv_noeeprom (HSV_SPRINGGREEN) +#define rgblight_sethsv_noeeprom_turquoise() rgblight_sethsv_noeeprom (HSV_TURQUOISE) +#define rgblight_sethsv_noeeprom_teal() rgblight_sethsv_noeeprom (HSV_TEAL) +#define rgblight_sethsv_noeeprom_cyan() rgblight_sethsv_noeeprom (HSV_CYAN) +#define rgblight_sethsv_noeeprom_azure() rgblight_sethsv_noeeprom (HSV_AZURE) +#define rgblight_sethsv_noeeprom_blue() rgblight_sethsv_noeeprom (HSV_BLUE) +#define rgblight_sethsv_noeeprom_purple() rgblight_sethsv_noeeprom (HSV_PURPLE) +#define rgblight_sethsv_noeeprom_magenta() rgblight_sethsv_noeeprom (HSV_MAGENTA) +#define rgblight_sethsv_noeeprom_pink() rgblight_sethsv_noeeprom (HSV_PINK) /* SET HSV List */ -#define rgblight_sethsv_white_at(at) rgblight_sethsv_at ( 0, 0, 255, at) -#define rgblight_sethsv_red_at(at) rgblight_sethsv_at ( 0, 255, 255, at) -#define rgblight_sethsv_coral_at(at) rgblight_sethsv_at ( 16, 176, 255, at) -#define rgblight_sethsv_orange_at(at) rgblight_sethsv_at ( 39, 255, 255, at) -#define rgblight_sethsv_goldenrod_at(at) rgblight_sethsv_at ( 43, 218, 218, at) -#define rgblight_sethsv_gold_at(at) rgblight_sethsv_at ( 51, 255, 255, at) -#define rgblight_sethsv_yellow_at(at) rgblight_sethsv_at ( 60, 255, 255, at) -#define rgblight_sethsv_chartreuse_at(at) rgblight_sethsv_at ( 90, 255, 255, at) -#define rgblight_sethsv_green_at(at) rgblight_sethsv_at (120, 255, 255, at) -#define rgblight_sethsv_springgreen_at(at) rgblight_sethsv_at (150, 255, 255, at) -#define rgblight_sethsv_turquoise_at(at) rgblight_sethsv_at (174, 90, 112, at) -#define rgblight_sethsv_teal_at(at) rgblight_sethsv_at (180, 255, 128, at) -#define rgblight_sethsv_cyan_at(at) rgblight_sethsv_at (180, 255, 255, at) -#define rgblight_sethsv_azure_at(at) rgblight_sethsv_at (186, 102, 255, at) -#define rgblight_sethsv_blue_at(at) rgblight_sethsv_at (240, 255, 255, at) -#define rgblight_sethsv_purple_at(at) rgblight_sethsv_at (270, 255, 255, at) -#define rgblight_sethsv_magenta_at(at) rgblight_sethsv_at (300, 255, 255, at) -#define rgblight_sethsv_pink_at(at) rgblight_sethsv_at (330, 128, 255, at) - -#endif +#define rgblight_sethsv_white_at(at) rgblight_sethsv_at (HSV_WHITE, at) +#define rgblight_sethsv_red_at(at) rgblight_sethsv_at (HSV_RED, at) +#define rgblight_sethsv_coral_at(at) rgblight_sethsv_at (HSV_CORAL, at) +#define rgblight_sethsv_orange_at(at) rgblight_sethsv_at (HSV_ORANGE, at) +#define rgblight_sethsv_goldenrod_at(at) rgblight_sethsv_at (HSV_GOLDENROD, at) +#define rgblight_sethsv_gold_at(at) rgblight_sethsv_at (HSV_GOLD, at) +#define rgblight_sethsv_yellow_at(at) rgblight_sethsv_at (HSV_YELLOW, at) +#define rgblight_sethsv_chartreuse_at(at) rgblight_sethsv_at (HSV_CHARTREUSE, at) +#define rgblight_sethsv_green_at(at) rgblight_sethsv_at (HSV_GREEN, at) +#define rgblight_sethsv_springgreen_at(at) rgblight_sethsv_at (HSV_SPRINGGREEN, at) +#define rgblight_sethsv_turquoise_at(at) rgblight_sethsv_at (HSV_TURQUOISE, at) +#define rgblight_sethsv_teal_at(at) rgblight_sethsv_at (HSV_TEAL, at) +#define rgblight_sethsv_cyan_at(at) rgblight_sethsv_at (HSV_CYAN, at) +#define rgblight_sethsv_azure_at(at) rgblight_sethsv_at (HSV_AZURE, at) +#define rgblight_sethsv_blue_at(at) rgblight_sethsv_at (HSV_BLUE, at) +#define rgblight_sethsv_purple_at(at) rgblight_sethsv_at (HSV_PURPLE, at) +#define rgblight_sethsv_magenta_at(at) rgblight_sethsv_at (HSV_MAGENTA, at) +#define rgblight_sethsv_pink_at(at) rgblight_sethsv_at (HSV_PINK, at) From c28a4321123131b6ff1e6c6b302fba764255623b Mon Sep 17 00:00:00 2001 From: Harshit Goel Date: Mon, 22 Apr 2019 20:58:17 +0530 Subject: [PATCH 012/129] added info.json for ymd96 (#4982) * added info.json for ymd96 * fix layout for keymap_custom macrom, correct info.json for default layout * add info layout for iso * add info layout for iso * align layout name, added maintainer username * layout case fix * layout case fix * fix overlapping keys * match layouts to keymaps. --- keyboards/ymd96/info.json | 19 +++++++++++++++++++ keyboards/ymd96/keymaps/default/keymap.c | 2 +- keyboards/ymd96/keymaps/epx/keymap.c | 2 +- keyboards/ymd96/keymaps/hgoel89/keymap.c | 6 +++--- keyboards/ymd96/ymd96.h | 10 +++++----- 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 keyboards/ymd96/info.json diff --git a/keyboards/ymd96/info.json b/keyboards/ymd96/info.json new file mode 100644 index 00000000000..73edfd894f0 --- /dev/null +++ b/keyboards/ymd96/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "ymd96", + "url": "", + "maintainer": "sparkyman215", + + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_default": { + "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":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Print Screen", "x":13, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15, "y":0}, {"label":"Insert", "x":16, "y":0}, {"label":"Delete", "x":17, "y":0}, {"label":"Page Up", "x":18, "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":7, "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":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"PgDn", "x":18, "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":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"+", "x":18, "y":2}, {"label":"Caps Lock", "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":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "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":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":2.75}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"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}, {"x":3.75, "y":5, "w":6.25}, {"label":"Fn", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"\u2190", "x":12, "y":5}, {"label":"\u2193", "x":13, "y":5}, {"label":"\u2191", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] + }, + "LAYOUT_custom": { + "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":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Print Screen", "x":13, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15, "y":0}, {"label":"Insert", "x":16, "y":0}, {"label":"Delete", "x":17, "y":0}, {"label":"Page Up", "x":18, "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":7, "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":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"PgDn", "x":18, "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":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"-", "x":18, "y":2}, {"label":"Caps Lock", "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":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "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":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Fn", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"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}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Menu", "x":11, "y":5}, {"label":"Prnt Scr", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"label":"Scroll Lock", "x":14, "y":5}, {"label":"0", "x":15, "y":5, "w":2}, {"label":".", "x":17, "y":5}] + }, + "LAYOUT_iso": { + "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":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15, "y":0}, {"label":"Insert", "x":16, "y":0}, {"label":"Delete", "x":17, "y":0}, {"label":"PgUp", "x":18, "y":0}, {"label":"\u00ac", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"\"", "x":2, "y":1}, {"label":"\u00a3", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "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":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"PgDn", "x":18, "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":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"-", "x":18, "y":2}, {"label":"Caps Lock", "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":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"@", "x":11.75, "y":3}, {"label":"~", "x":12.75, "y":3}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"label":"|", "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":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Up", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"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}, {"x":3.75, "y":5, "w":6.25}, {"label":"AltGr", "x":10, "y":5, "w":1.5}, {"label":"Win", "x":11.5, "y":5, "w":1.5}, {"label":"Left", "x":13, "y":5}, {"label":"Down", "x":14, "y":5}, {"label":"Right", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] + } + } +} \ No newline at end of file diff --git a/keyboards/ymd96/keymaps/default/keymap.c b/keyboards/ymd96/keymaps/default/keymap.c index 3d54c7395c0..c540972f10a 100644 --- a/keyboards/ymd96/keymaps/default/keymap.c +++ b/keyboards/ymd96/keymaps/default/keymap.c @@ -22,7 +22,7 @@ along with this program. If not, see . #define _DEFLT 0 #define _RAISE 1 -#define KEYMAP KEYMAP_DEFAULT +#define KEYMAP LAYOUT_default const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/ymd96/keymaps/epx/keymap.c b/keyboards/ymd96/keymaps/epx/keymap.c index b9d3f6df228..09ec665a3a7 100644 --- a/keyboards/ymd96/keymaps/epx/keymap.c +++ b/keyboards/ymd96/keymaps/epx/keymap.c @@ -24,7 +24,7 @@ along with this program. If not, see . #define _AR 1 #define _RAISE 2 -#define KEYMAP KEYMAP_DEFAULT +#define KEYMAP LAYOUT_default const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0, default layer diff --git a/keyboards/ymd96/keymaps/hgoel89/keymap.c b/keyboards/ymd96/keymaps/hgoel89/keymap.c index 81addf69f4d..f612f79bafc 100644 --- a/keyboards/ymd96/keymaps/hgoel89/keymap.c +++ b/keyboards/ymd96/keymaps/hgoel89/keymap.c @@ -27,7 +27,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { #define _DEFLT 0 #define _RAISE 1 -#define KEYMAP KEYMAP_CUSTOM +#define KEYMAP LAYOUT_custom const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -45,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_PMNS, \ 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_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_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - 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_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RGUI , KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MO(_RAISE), KC_P0, KC_PDOT \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(_RAISE), KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RGUI , KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_P0, KC_PDOT \ ), /* Layer 1, raise layer * | | | | | | | | | | | | | | | | | | | | diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymd96/ymd96.h index 9c25f221928..ebf01b1d612 100644 --- a/keyboards/ymd96/ymd96.h +++ b/keyboards/ymd96/ymd96.h @@ -26,7 +26,7 @@ along with this program. If not, see . void matrix_init_user(void); // TODO port this to other PS2AVRGB boards -#define KEYMAP_DEFAULT( \ +#define LAYOUT_default( \ K500, K502, K503, K504, K505, K600, K610, K710, K700, K511, K512, K513, K514, K113, K214, K013, K706, K709, K708, \ K400, K401, K402, K403, K404, K405, K601, K611, K711, K701, K410, K411, K412, K414, K406, K407, K408, K409, \ K300, K301, K302, K303, K304, K305, K602, K612, K712, K702, K310, K311, K312, K313, K306, K307, K308, K309, \ @@ -44,13 +44,13 @@ void matrix_init_user(void); // TODO port this to other PS2AVRGB boards { K700, K701, K702, K703, K704, K705, K706, KC_NO, K708, K709, K710, K711, K712, K713, K714 } \ } -#define KEYMAP_CUSTOM( \ +#define LAYOUT_custom( \ K500, K502, K503, K504, K505, K600, K610, K710, K700, K511, K512, K513, K514, K113, K214, K013, K706, K709, K708, \ K400, K401, K402, K403, K404, K405, K601, K611, K711, K701, K410, K411, K412, K414, K406, K407, K408, K409, \ K300, K301, K302, K303, K304, K305, K602, K612, K712, K702, K310, K311, K312, K313, K306, K307, K308, K309, \ K200, K201, K202, K203, K204, K205, K603, K613, K713, K703, K210, K211, K213, K206, K207, K208, K209, \ - K100, K101, K102, K103, K104, K105, K604, K614, K714, K704, K110, K111, K106, K107, K108, K009, \ - K000, K001, K002, K605, K705, K010, K011, K606, K607, KC_NO, K006, K008 \ + K100, K101, K102, K103, K104, K105, K604, K614, K714, K704, K110, K111, K608,K106, K107, K108, K009, \ + K000, K001, K002, K605, K705, K010, K011, K606, K607, K006, K008 \ ) { \ { K000, K001, K002, KC_NO, KC_NO, KC_NO, K006, KC_NO, K008, K009, K010, K011, KC_NO, K013, KC_NO, }, \ { K100, K101, K102, K103, K104, K105, K106, K107, K108, KC_NO, K110, K111, KC_NO, K113, KC_NO, }, \ @@ -58,7 +58,7 @@ void matrix_init_user(void); // TODO port this to other PS2AVRGB boards { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, }, \ { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO, K414, }, \ { K500, KC_NO, K502, K503, K504, K505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K511, K512, K513, K514, }, \ - { K600, K601, K602, K603, K604, K605, K606, K607, KC_NO, KC_NO, K610, K611, K612, K613, K614, }, \ + { K600, K601, K602, K603, K604, K605, K606, K607, K608, KC_NO, K610, K611, K612, K613, K614, }, \ { K700, K701, K702, K703, K704, K705, K706, KC_NO, K708, K709, K710, K711, K712, K713, K714 } \ } From b61baf4281bde34bfe28aaa1109bd5d5c6471116 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Mon, 22 Apr 2019 11:34:13 -0400 Subject: [PATCH 013/129] Fix #3566 use an hardware timer for software PWM stability (#3615) With my XD60, I noticed that when typing the backlight was flickering. The XD60 doesn't have the backlight wired to a hardware PWM pin. I assumed it was a timing issue in the matrix scan that made the PWM lit the LED a bit too longer. I verified it because the more keys that were pressed, the more lighting I observed. This patch makes the software PWM be called during CPU interruptions. It works almost like the hardware PWM, except instead of using the CPU waveform generation, the CPU will fire interruption when the LEDs need be turned on or off. Using the same timer system as for hardware PWM, when the counter will reach OCRxx (the current backlight level), an Output Compare match interrupt will be fired and we'll turn the LEDs off. When the counter reaches its maximum value, an overflow interrupt will be triggered in which we turn the LEDs on. This way we replicate the hardware backlight PWM duty cycle. This gives a better time stability of the PWM computation than pure software PWM, leading to a flicker free backlight. Since this is reusing the hardware PWM code, software PWM also supports backlight breathing. Note that if timer1 is used for audio, backlight will use timer3, and if timer3 is used for audio backlight will use timer1. If both timers are used for audio, then this feature is disabled and we revert to the matrix scan based PWM computation. Signed-off-by: Brice Figureau --- docs/feature_backlight.md | 52 +++++++- quantum/quantum.c | 256 +++++++++++++++++++++++++++++++------- quantum/quantum.h | 4 + 3 files changed, 267 insertions(+), 45 deletions(-) diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index c7a1f131ed7..048d75390df 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -30,7 +30,31 @@ You should then be able to use the keycodes below to change the backlight level. This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard. -Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software implementation will be used, and backlight breathing will not be available. Currently the supported pins are `B5`, `B6`, `B7`, and `C6`. +Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software PWM implementation triggered by hardware timer interrupts will be used. + +Hardware PWM is supported according to the following table: + +| Backlight Pin | Hardware timer | +|---------------|----------------| +|`B5` | Timer 1 | +|`B6` | Timer 1 | +|`B7` | Timer 1 | +|`C6` | Timer 3 | +| other | Software PWM | + +The [audio feature](feature_audio.md) also uses hardware timers. Please refer to the following table to know what hardware timer the software PWM will use depending on the audio configuration: + +| Audio Pin(s) | Audio Timer | Software PWM Timer | +|--------------|-------------|--------------------| +| `C4` | Timer 3 | Timer 1 | +| `C5` | Timer 3 | Timer 1 | +| `C6` | Timer 3 | Timer 1 | +| `B5` | Timer 1 | Timer 3 | +| `B6` | Timer 1 | Timer 3 | +| `B7` | Timer 1 | Timer 3 | +| `Bx` & `Cx` | Timer 1 & 3 | None | + +When all timers are in use for [audio](feature_audio.md), the backlight software PWM will not use a hardware timer, but instead will be triggered during the matrix scan. In this case the backlight doesn't support breathing and might show lighting artifacts (for instance flickering), because the PWM computation might not be called with enough timing precision. ## Configuration @@ -39,11 +63,26 @@ To change the behaviour of the backlighting, `#define` these in your `config.h`: |Define |Default |Description | |---------------------|-------------|-------------------------------------------------------------------------------------------------------------| |`BACKLIGHT_PIN` |`B7` |The pin that controls the LEDs. Unless you are designing your own keyboard, you shouldn't need to change this| +|`BACKLIGHT_PINS` |*Not defined*|experimental: see below for more information| |`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 15 excluding off) | |`BACKLIGHT_CAPS_LOCK`|*Not defined*|Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) | -|`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if hardware PWM is used | +|`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if supported | |`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds | +## Multiple backlight pins + +Most keyboards have only one backlight pin which control all backlight LEDs (especially if the backlight is connected to an hardware PWM pin). +In software PWM, it is possible to define multiple backlight pins. All those pins will be turned on and off at the same time during the PWM duty cycle. +This feature allows to set for instance the Caps Lock LED (or any other controllable LED) brightness at the same level as the other LEDs of the backlight. This is useful if you have mapped LCTRL in place of Caps Lock and you need the Caps Lock LED to be part of the backlight instead of being activated when Caps Lock is on. + +To activate multiple backlight pins, you need to add something like this to your user `config.h`: + +~~~c +#define BACKLIGHT_LED_COUNT 2 +#undef BACKLIGHT_PIN +#define BACKLIGHT_PINS { F5, B2 } +~~~ + ## Hardware PWM Implementation When using the supported pins for backlighting, QMK will use a hardware timer configured to output a PWM signal. This timer will count up to `ICRx` (by default `0xFFFF`) before resetting to 0. @@ -53,6 +92,15 @@ In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus th The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second. In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM. +## Software PWM Implementation + +When `BACKLIGHT_PIN` is not set to a hardware backlight pin, QMK will use a hardware timer configured to trigger software interrupts. This time will count up to `ICRx` (by default `0xFFFF`) before resetting to 0. +When resetting to 0, the CPU will fire an OVF (overflow) interrupt that will turn the LEDs on, starting the duty cycle. +The desired brightness is calculated and stored in the `OCRxx` register. When the counter reaches this value, the CPU will fire a Compare Output match interrupt, which will turn the LEDs off. +In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus the brightness, where `0x0000` is completely off and `0xFFFF` is completely on. + +The breathing effect is the same as in the hardware PWM implementation. + ## Backlight Functions |Function |Description | diff --git a/quantum/quantum.c b/quantum/quantum.c index 9aa498dadb9..0fb798a7488 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -1138,30 +1138,38 @@ void matrix_scan_quantum() { matrix_scan_kb(); } -#if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN) +#if defined(BACKLIGHT_ENABLE) && (defined(BACKLIGHT_PIN) || defined(BACKLIGHT_PINS)) -static const uint8_t backlight_pin = BACKLIGHT_PIN; +// The logic is a bit complex, we support 3 setups: +// 1. hardware PWM when backlight is wired to a PWM pin +// depending on this pin, we use a different output compare unit +// 2. software PWM with hardware timers, but the used timer depends +// on the audio setup (audio wins other backlight) +// 3. full software PWM -// depending on the pin, we use a different output compare unit #if BACKLIGHT_PIN == B7 +# define HARDWARE_PWM # define TCCRxA TCCR1A # define TCCRxB TCCR1B # define COMxx1 COM1C1 # define OCRxx OCR1C # define ICRx ICR1 #elif BACKLIGHT_PIN == B6 +# define HARDWARE_PWM # define TCCRxA TCCR1A # define TCCRxB TCCR1B # define COMxx1 COM1B1 # define OCRxx OCR1B # define ICRx ICR1 #elif BACKLIGHT_PIN == B5 +# define HARDWARE_PWM # define TCCRxA TCCR1A # define TCCRxB TCCR1B # define COMxx1 COM1A1 # define OCRxx OCR1A # define ICRx ICR1 #elif BACKLIGHT_PIN == C6 +# define HARDWARE_PWM # define TCCRxA TCCR3A # define TCCRxB TCCR3B # define COMxx1 COM1A1 @@ -1175,28 +1183,115 @@ static const uint8_t backlight_pin = BACKLIGHT_PIN; # define ICRx ICR1 # define TIMSK1 TIMSK #else -# define NO_HARDWARE_PWM +# if !defined(BACKLIGHT_CUSTOM_DRIVER) +# if !defined(B5_AUDIO) && !defined(B6_AUDIO) && !defined(B7_AUDIO) + // timer 1 is not used by audio , backlight can use it +#pragma message "Using hardware timer 1 with software PWM" +# define HARDWARE_PWM +# define BACKLIGHT_PWM_TIMER +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define OCRxx OCR1A +# define OCRxAH OCR1AH +# define OCRxAL OCR1AL +# define TIMERx_COMPA_vect TIMER1_COMPA_vect +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define OCIExA OCIE1A +# define TOIEx TOIE1 +# define ICRx ICR1 +# ifndef TIMSK +# define TIMSK TIMSK1 +# endif +# elif !defined(C6_AUDIO) && !defined(C5_AUDIO) && !defined(C4_AUDIO) +#pragma message "Using hardware timer 3 with software PWM" +// timer 3 is not used by audio, backlight can use it +# define HARDWARE_PWM +# define BACKLIGHT_PWM_TIMER +# define TCCRxA TCCR3A +# define TCCRxB TCCR3B +# define OCRxx OCR3A +# define OCRxAH OCR3AH +# define OCRxAL OCR3AL +# define TIMERx_COMPA_vect TIMER3_COMPA_vect +# define TIMERx_OVF_vect TIMER3_OVF_vect +# define OCIExA OCIE3A +# define TOIEx TOIE3 +# define ICRx ICR1 +# ifndef TIMSK +# define TIMSK TIMSK3 +# endif +# else +#pragma message "Audio in use - using pure software PWM" +#define NO_HARDWARE_PWM +# endif +# else +#pragma message "Custom driver defined - using pure software PWM" +#define NO_HARDWARE_PWM +# endif #endif #ifndef BACKLIGHT_ON_STATE #define BACKLIGHT_ON_STATE 0 #endif -#ifdef NO_HARDWARE_PWM // pwm through software +void backlight_on(uint8_t backlight_pin) { +#if BACKLIGHT_ON_STATE == 0 + writePinLow(backlight_pin); +#else + writePinHigh(backlight_pin); +#endif +} -__attribute__ ((weak)) +void backlight_off(uint8_t backlight_pin) { +#if BACKLIGHT_ON_STATE == 0 + writePinHigh(backlight_pin); +#else + writePinLow(backlight_pin); +#endif +} + + +#if defined(NO_HARDWARE_PWM) || defined(BACKLIGHT_PWM_TIMER) // pwm through software + +// we support multiple backlight pins +#ifndef BACKLIGHT_LED_COUNT +#define BACKLIGHT_LED_COUNT 1 +#endif + +#if BACKLIGHT_LED_COUNT == 1 +#define BACKLIGHT_PIN_INIT { BACKLIGHT_PIN } +#else +#define BACKLIGHT_PIN_INIT BACKLIGHT_PINS +#endif + +#define FOR_EACH_LED(x) \ + for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) \ + { \ + uint8_t backlight_pin = backlight_pins[i]; \ + { \ + x \ + } \ + } + +static const uint8_t backlight_pins[BACKLIGHT_LED_COUNT] = BACKLIGHT_PIN_INIT; + +#else // full hardware PWM + +// we support only one backlight pin +static const uint8_t backlight_pin = BACKLIGHT_PIN; +#define FOR_EACH_LED(x) x + +#endif + +#ifdef NO_HARDWARE_PWM +__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 + FOR_EACH_LED( + setPinOutput(backlight_pin); + backlight_on(backlight_pin); + ) } __attribute__ ((weak)) @@ -1207,21 +1302,14 @@ 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 - // 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 - } 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 + FOR_EACH_LED( + backlight_on(backlight_pin); + ) + } + else { + FOR_EACH_LED( + backlight_off(backlight_pin); + ) } backlight_tick = (backlight_tick + 1) % 16; } @@ -1233,7 +1321,52 @@ void backlight_task(void) { #endif #endif -#else // pwm through timer +#else // hardware pwm through timer + +#ifdef BACKLIGHT_PWM_TIMER + +// The idea of software PWM assisted by hardware timers is the following +// we use the hardware timer in fast PWM mode like for hardware PWM, but +// instead of letting the Output Match Comparator control the led pin +// (which is not possible since the backlight is not wired to PWM pins on the +// CPU), we do the LED on/off by oursleves. +// The timer is setup to count up to 0xFFFF, and we set the Output Compare +// register to the current 16bits backlight level (after CIE correction). +// This means the CPU will trigger a compare match interrupt when the counter +// reaches the backlight level, where we turn off the LEDs, +// but also an overflow interrupt when the counter rolls back to 0, +// in which we're going to turn on the LEDs. +// The LED will then be on for OCRxx/0xFFFF time, adjusted every 244Hz. + +// Triggered when the counter reaches the OCRx value +ISR(TIMERx_COMPA_vect) { + FOR_EACH_LED( + backlight_off(backlight_pin); + ) +} + +// Triggered when the counter reaches the TOP value +// this one triggers at F_CPU/65536 =~ 244 Hz +ISR(TIMERx_OVF_vect) { +#ifdef BACKLIGHT_BREATHING + breathing_task(); +#endif + // for very small values of OCRxx (or backlight level) + // we can't guarantee this whole code won't execute + // at the same time as the compare match interrupt + // which means that we might turn on the leds while + // trying to turn them off, leading to flickering + // artifacts (especially while breathing, because breathing_task + // takes many computation cycles). + // so better not turn them on while the counter TOP is very low. + if (OCRxx > 256) { + FOR_EACH_LED( + backlight_on(backlight_pin); + ) + } +} + +#endif #define TIMER_TOP 0xFFFFU @@ -1265,11 +1398,28 @@ void backlight_set(uint8_t level) { level = BACKLIGHT_LEVELS; if (level == 0) { + #ifdef BACKLIGHT_PWM_TIMER + if (OCRxx) { + TIMSK &= ~(_BV(OCIExA)); + TIMSK &= ~(_BV(TOIEx)); + FOR_EACH_LED( + backlight_off(backlight_pin); + ) + } + #else // Turn off PWM control on backlight pin TCCRxA &= ~(_BV(COMxx1)); + #endif } else { + #ifdef BACKLIGHT_PWM_TIMER + if (!OCRxx) { + TIMSK |= _BV(OCIExA); + TIMSK |= _BV(TOIEx); + } + #else // Turn on PWM control of backlight pin TCCRxA |= _BV(COMxx1); + #endif } // Set the brightness set_pwm(cie_lightness(TIMER_TOP * (uint32_t)level / BACKLIGHT_LEVELS)); @@ -1289,12 +1439,25 @@ static uint8_t breathing_period = BREATHING_PERIOD; static uint8_t breathing_halt = BREATHING_NO_HALT; static uint16_t breathing_counter = 0; +#ifdef BACKLIGHT_PWM_TIMER +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +#define breathing_interrupt_enable() do { breathing = true; } while (0) +#define breathing_interrupt_disable() do { breathing = false; } while (0) +#else + 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) +#endif + #define breathing_min() do {breathing_counter = 0;} while (0) #define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) @@ -1368,10 +1531,14 @@ static inline uint16_t scale_backlight(uint16_t v) { return v / BACKLIGHT_LEVELS * get_backlight_level(); } +#ifdef BACKLIGHT_PWM_TIMER +void breathing_task(void) +#else /* 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) +#endif { uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; // resetting after one period to prevent ugly reset at overflow. @@ -1393,19 +1560,21 @@ __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 + FOR_EACH_LED( + setPinOutput(backlight_pin); + backlight_on(backlight_pin); + ) + // 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 +#ifdef BACKLIGHT_PWM_TIMER + // TimerX setup, Fast PWM mode count to TOP set in ICRx + TCCRxA = _BV(WGM11); // = 0b00000010; + // clock select clk/1 + TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; +#else // hardware PWM // 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.) @@ -1417,8 +1586,9 @@ void backlight_init_ports(void) "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)." */ - TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; + TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; +#endif // Use full 16-bit resolution. Counter counts to ICR1 before reset to 0. ICRx = TIMER_TOP; @@ -1428,9 +1598,9 @@ void backlight_init_ports(void) #endif } -#endif // NO_HARDWARE_PWM +#endif // hardware backlight -#else // backlight +#else // no backlight __attribute__ ((weak)) void backlight_init_ports(void) {} diff --git a/quantum/quantum.h b/quantum/quantum.h index 987516dedbd..17cb902740d 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -260,8 +260,12 @@ void tap_code16(uint16_t code); #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); void backlight_task(void); +void backlight_task_internal(void); +void backlight_on(uint8_t backlight_pin); +void backlight_off(uint8_t backlight_pin); #ifdef BACKLIGHT_BREATHING +void breathing_task(void); void breathing_enable(void); void breathing_pulse(void); void breathing_disable(void); From bb52119a6dfe9c6f0314d1bcd948efda59626a70 Mon Sep 17 00:00:00 2001 From: M-AS Date: Mon, 22 Apr 2019 11:37:40 -0400 Subject: [PATCH 014/129] RGB Matrix Animations: Three/six new reactive effects (wide, cross, nexus) (#5602) * added 3 new RGB_Matrix effects * made cross effect behavior smoother * removed dead code * added effect descriptions --- docs/feature_rgb_matrix.md | 54 +++++++++++-------- quantum/rgb_matrix.c | 33 ++++++++++++ quantum/rgb_matrix.h | 18 +++++++ .../solid_reactive_cross.h | 50 +++++++++++++++++ .../solid_reactive_nexus.h | 48 +++++++++++++++++ .../solid_reactive_wide.h | 42 +++++++++++++++ 6 files changed, 224 insertions(+), 21 deletions(-) create mode 100644 quantum/rgb_matrix_animations/solid_reactive_cross.h create mode 100644 quantum/rgb_matrix_animations/solid_reactive_nexus.h create mode 100644 quantum/rgb_matrix_animations/solid_reactive_wide.h diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 5309e749cb7..f2168ab16ef 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -189,6 +189,12 @@ enum rgb_matrix_effects { #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) RGB_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit to hue & value then fades value out RGB_MATRIX_SOLID_REACTIVE, // Static single hue, pulses keys hit to shifted hue then fades to current hue + RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out + RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out + RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out + RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out + RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out + RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out RGB_MATRIX_SPLASH, // Full gradient & value pulse away from a single key hit then fades value out RGB_MATRIX_MULTISPLASH, // Full gradient & value pulse away from multiple key hits then fades value out RGB_MATRIX_SOLID_SPLASH, // Hue & value pulse away from a single key hit then fades value out @@ -201,27 +207,33 @@ enum rgb_matrix_effects { You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`: -|Define |Description | -|---------------------------------------------------|--------------------------------------------| -|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | -|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | -|`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` | -|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | -|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | -|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | -|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON`| -|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | -|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | -|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | -|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | -|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | -|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | -|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | -|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLEE`| -|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | -|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | -|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | -|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | +|Define |Description | +|-------------------------------------------------------|-----------------------------------------------| +|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | +|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` | +|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | +|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | +|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` | +|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | +|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_WIDE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_CROSS` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`| +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`| +|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | +|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | ## Custom layer effects diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index a1193d4c072..41ed8983eff 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -41,6 +41,9 @@ #include "rgb_matrix_animations/digital_rain_anim.h" #include "rgb_matrix_animations/solid_reactive_simple_anim.h" #include "rgb_matrix_animations/solid_reactive_anim.h" +#include "rgb_matrix_animations/solid_reactive_wide.h" +#include "rgb_matrix_animations/solid_reactive_cross.h" +#include "rgb_matrix_animations/solid_reactive_nexus.h" #include "rgb_matrix_animations/splash_anim.h" #include "rgb_matrix_animations/solid_splash_anim.h" #include "rgb_matrix_animations/breathing_anim.h" @@ -380,6 +383,36 @@ static void rgb_task_render(uint8_t effect) { rendering = rgb_matrix_solid_reactive(&rgb_effect_params); // Max 4ms Avg 3ms break; #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE + case RGB_MATRIX_SOLID_REACTIVE_WIDE: + rendering = rgb_matrix_solid_reactive_wide(&rgb_effect_params); // Max ?? ms Avg ?? ms + break; +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE + case RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE: + rendering = rgb_matrix_solid_reactive_multiwide(&rgb_effect_params); // Max ?? ms Avg ?? ms + break; +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS + case RGB_MATRIX_SOLID_REACTIVE_CROSS: + rendering = rgb_matrix_solid_reactive_cross(&rgb_effect_params); // Max ?? ms Avg ?? ms + break; +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS + case RGB_MATRIX_SOLID_REACTIVE_MULTICROSS: + rendering = rgb_matrix_solid_reactive_multicross(&rgb_effect_params); // Max ?? ms Avg ?? ms + break; +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS + case RGB_MATRIX_SOLID_REACTIVE_NEXUS: + rendering = rgb_matrix_solid_reactive_nexus(&rgb_effect_params); // Max ?? ms Avg ?? ms + break; +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + case RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS: + rendering = rgb_matrix_solid_reactive_multinexus(&rgb_effect_params); // Max ?? ms Avg ?? ms + break; +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS #ifndef DISABLE_RGB_MATRIX_SPLASH case RGB_MATRIX_SPLASH: rendering = rgb_matrix_splash(&rgb_effect_params); // Max 5ms Avg 3ms diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index f5be494354f..5fdc854f08c 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -111,6 +111,24 @@ enum rgb_matrix_effects { #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE RGB_MATRIX_SOLID_REACTIVE, #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE + RGB_MATRIX_SOLID_REACTIVE_WIDE, +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE + RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE, +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS + RGB_MATRIX_SOLID_REACTIVE_CROSS, +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS + RGB_MATRIX_SOLID_REACTIVE_MULTICROSS, +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS + RGB_MATRIX_SOLID_REACTIVE_NEXUS, +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS, +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS #ifndef DISABLE_RGB_MATRIX_SPLASH RGB_MATRIX_SPLASH, #endif // DISABLE_RGB_MATRIX_SPLASH diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h new file mode 100644 index 00000000000..af602cba15a --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h @@ -0,0 +1,50 @@ +#pragma once +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) + +extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_config_t rgb_matrix_config; +extern last_hit_t g_last_hit_tracker; + +static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; + uint8_t count = g_last_hit_tracker.count; + for (uint8_t i = led_min; i < led_max; i++) { + hsv.v = 0; + point_t point = g_rgb_leds[i].point; + for (uint8_t j = start; j < count; j++) { + int16_t dx = point.x - g_last_hit_tracker.x[j]; + int16_t dy = point.y - g_last_hit_tracker.y[j]; + uint8_t dist = sqrt16(dx * dx + dy * dy); + int16_t dist2 = 16; + uint8_t dist3; + uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) + dist; + dx = dx < 0 ? dx * -1 : dx; + dy = dy < 0 ? dy * -1 : dy; + dx = dx * dist2 > 255 ? 255 : dx * dist2; + dy = dy * dist2 > 255 ? 255 : dy * dist2; + dist3 = dx > dy ? dy : dx; + effect += dist3; + if (effect > 255) + effect = 255; + hsv.v = qadd8(hsv.v, 255 - effect); + } + hsv.v = scale8(hsv.v, rgb_matrix_config.val); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +bool rgb_matrix_solid_reactive_multicross(effect_params_t* params) { + return rgb_matrix_solid_reactive_multicross_range(0, params); +} + +bool rgb_matrix_solid_reactive_cross(effect_params_t* params) { + return rgb_matrix_solid_reactive_multicross_range(qsub8(g_last_hit_tracker.count, 1), params); +} + +#endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h new file mode 100644 index 00000000000..8b4a139dc9c --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h @@ -0,0 +1,48 @@ +#pragma once +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) + +extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_config_t rgb_matrix_config; +extern last_hit_t g_last_hit_tracker; + +static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; + uint8_t count = g_last_hit_tracker.count; + for (uint8_t i = led_min; i < led_max; i++) { + hsv.v = 0; + point_t point = g_rgb_leds[i].point; + for (uint8_t j = start; j < count; j++) { + int16_t dx = point.x - g_last_hit_tracker.x[j]; + int16_t dy = point.y - g_last_hit_tracker.y[j]; + uint8_t dist = sqrt16(dx * dx + dy * dy); + int16_t dist2 = 8; + uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; + if (effect > 255) + effect = 255; + if (dist > 72) + effect = 255; + if ((dx > dist2 || dx < -dist2) && (dy > dist2 || dy < -dist2)) + effect = 255; + hsv.v = qadd8(hsv.v, 255 - effect); + hsv.h = rgb_matrix_config.hue + dy / 4; + } + hsv.v = scale8(hsv.v, rgb_matrix_config.val); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +bool rgb_matrix_solid_reactive_multinexus(effect_params_t* params) { + return rgb_matrix_solid_reactive_multinexus_range(0, params); +} + +bool rgb_matrix_solid_reactive_nexus(effect_params_t* params) { + return rgb_matrix_solid_reactive_multinexus_range(qsub8(g_last_hit_tracker.count, 1), params); +} + +#endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h new file mode 100644 index 00000000000..abb01892edb --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h @@ -0,0 +1,42 @@ +#pragma once +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) + +extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_config_t rgb_matrix_config; +extern last_hit_t g_last_hit_tracker; + +static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; + uint8_t count = g_last_hit_tracker.count; + for (uint8_t i = led_min; i < led_max; i++) { + hsv.v = 0; + point_t point = g_rgb_leds[i].point; + for (uint8_t j = start; j < count; j++) { + int16_t dx = point.x - g_last_hit_tracker.x[j]; + int16_t dy = point.y - g_last_hit_tracker.y[j]; + uint8_t dist = sqrt16(dx * dx + dy * dy); + uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) + dist * 5; + if (effect > 255) + effect = 255; + hsv.v = qadd8(hsv.v, 255 - effect); + } + hsv.v = scale8(hsv.v, rgb_matrix_config.val); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +bool rgb_matrix_solid_reactive_multiwide(effect_params_t* params) { + return rgb_matrix_solid_reactive_multiwide_range(0, params); +} + +bool rgb_matrix_solid_reactive_wide(effect_params_t* params) { + return rgb_matrix_solid_reactive_multiwide_range(qsub8(g_last_hit_tracker.count, 1), params); +} + +#endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED From 6d73fe12779d6e8527d404572810ea95e714dce7 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Tue, 23 Apr 2019 03:20:13 +0900 Subject: [PATCH 015/129] fix LIB_SRC and QUANTUM_LIB_SRC for ARM (#5623) * fix LIB_SRC and QUANTUM_LIB_SRC for ARM(chibios) * remove ARFLAGS * tmk_core/arm_atsam.mk:AR: remove 'rcs' --- tmk_core/arm_atsam.mk | 2 +- tmk_core/avr.mk | 2 +- tmk_core/rules.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tmk_core/arm_atsam.mk b/tmk_core/arm_atsam.mk index 06823fb629f..25a3411f4f9 100644 --- a/tmk_core/arm_atsam.mk +++ b/tmk_core/arm_atsam.mk @@ -6,7 +6,7 @@ CC = arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy OBJDUMP = arm-none-eabi-objdump SIZE = arm-none-eabi-size -AR = arm-none-eabi-ar rcs +AR = arm-none-eabi-ar NM = arm-none-eabi-nm HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index f6af3f5e290..6bf86d58a8c 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -6,7 +6,7 @@ CC = avr-gcc OBJCOPY = avr-objcopy OBJDUMP = avr-objdump SIZE = avr-size -AR = avr-ar rcs +AR = avr-ar NM = avr-nm HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 3a322cee4f2..6d2bb51f075 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -331,7 +331,7 @@ $1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN) $1/%.a : $1/%.o @mkdir -p $$(@D) @$(SILENT) || printf "Archiving: $$<" | $$(AWK_CMD) - $$(eval CMD=$$(AR) $$@ $$<) + $$(eval CMD=$$(AR) rcs $$@ $$<) @$$(BUILD_CMD) $1/force: From a2cec0594b15dc667adf7f1b0e35cb698dc1758d Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Apr 2019 11:55:55 -0700 Subject: [PATCH 016/129] [Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed --- keyboards/crkbd/keymaps/drashna/config.h | 11 +- keyboards/crkbd/keymaps/drashna/glcdfont.c | 240 ++++++++++++++++++ keyboards/crkbd/keymaps/drashna/keymap.c | 123 +++++++++ keyboards/crkbd/keymaps/drashna/rules.mk | 37 ++- .../woodpad/keymaps/drashna/README.md | 25 -- .../woodpad/keymaps/drashna/config.h | 45 ---- .../woodpad/keymaps/drashna/keymap.c | 95 ------- .../woodpad/keymaps/drashna/rules.mk | 10 - .../keebio/iris/keymaps/drashna/config.h | 8 +- .../keebio/iris/keymaps/drashna/keymap.c | 11 + .../keebio/iris/keymaps/drashna/rules.mk | 5 +- .../keebio/iris/keymaps/drashna_lp/config.h | 48 ++++ .../keebio/iris/keymaps/drashna_lp/keymap.c | 1 + .../keebio/iris/keymaps/drashna_lp/rules.mk | 7 + .../keebio/iris/keymaps/drashna_old/config.h | 4 +- keyboards/orthodox/keymaps/drashna/config.h | 5 +- keyboards/orthodox/keymaps/drashna/keymap.c | 2 +- keyboards/orthodox/keymaps/drashna/rules.mk | 4 +- layouts/community/ergodox/drashna/config.h | 1 - layouts/community/ergodox/drashna/keymap.c | 16 +- layouts/community/ergodox/drashna/rules.mk | 3 + .../community/ergodox/drashna_glow/config.h | 8 +- .../community/ergodox/drashna_glow/rules.mk | 7 +- layouts/community/numpad_5x6/drashna/config.h | 6 +- layouts/community/numpad_5x6/drashna/rules.mk | 1 + layouts/community/ortho_4x12/drashna/config.h | 13 +- layouts/community/ortho_4x12/drashna/keymap.c | 2 - layouts/community/ortho_4x12/drashna/rules.mk | 12 +- layouts/community/ortho_5x12/drashna/config.h | 6 + users/drashna/.gitignore | 3 + users/drashna/.gitlab-ci.yml | 30 +-- users/drashna/config.h | 2 +- users/drashna/drashna.c | 18 +- users/drashna/drashna.h | 6 +- users/drashna/process_records.c | 20 +- users/drashna/process_records.h | 2 + users/drashna/rgb_stuff.c | 25 +- users/drashna/rules.mk | 7 +- 38 files changed, 569 insertions(+), 300 deletions(-) create mode 100644 keyboards/crkbd/keymaps/drashna/glcdfont.c delete mode 100644 keyboards/handwired/woodpad/keymaps/drashna/README.md delete mode 100644 keyboards/handwired/woodpad/keymaps/drashna/config.h delete mode 100644 keyboards/handwired/woodpad/keymaps/drashna/keymap.c delete mode 100644 keyboards/handwired/woodpad/keymaps/drashna/rules.mk create mode 100644 keyboards/keebio/iris/keymaps/drashna_lp/config.h create mode 100644 keyboards/keebio/iris/keymaps/drashna_lp/keymap.c create mode 100644 keyboards/keebio/iris/keymaps/drashna_lp/rules.mk create mode 100644 users/drashna/.gitignore diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index cbc3feeb616..6f2665f3acb 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h @@ -27,7 +27,7 @@ along with this program. If not, see . // #define MASTER_RIGHT #define EE_HANDS -#define SSD1306OLED +// #define SSD1306OLED #define USE_SERIAL_PD2 @@ -48,3 +48,12 @@ along with this program. If not, see . #define B6_AUDIO // #define NO_MUSIC_MODE #endif + +#undef PRODUCT +#define PRODUCT Drashna Hacked Corne Keyboard + +#define OLED_FONT_H "keyboards/crkbd/keymaps/drashna/glcdfont.c" +// #define OLED_FONT_WIDTH 5 +// #define OLED_FONT_HEIGHT 7 + +#define TAPPING_TERM_PER_KEY diff --git a/keyboards/crkbd/keymaps/drashna/glcdfont.c b/keyboards/crkbd/keymaps/drashna/glcdfont.c new file mode 100644 index 00000000000..28521b42892 --- /dev/null +++ b/keyboards/crkbd/keymaps/drashna/glcdfont.c @@ -0,0 +1,240 @@ +#pragma once + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Helidox 8x6 font with QMK Firmware Logo +// Online editor: http://teripom.x0.com/ + +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, 0x24, 0x24, 0x1C, 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, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 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, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, +0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, +0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, +0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, +0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, +0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 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, 0x00, 0x00, +0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, +0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x81, +0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, +0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, +0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, +0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +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, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, +0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, +0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, +0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x03, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x03, 0x01, 0x00, 0x00, 0x00, 0x00, +0x01, 0x03, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x03, 0x01, +0x00, 0x00, 0x00, 0x07, 0x07, 0x07, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x07, 0x07, 0x07, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x07, 0x07, +0x07, 0x00, 0x00, 0x00, 0x01, 0x03, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x03, 0x01, 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, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 91f0ebfa270..aaace9483aa 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -7,6 +7,9 @@ #ifdef SSD1306OLED #include "ssd1306.h" #endif +#ifdef OLED_DRIVER_ENABLE + #include "oled_driver.h" +#endif extern keymap_config_t keymap_config; extern uint8_t is_master; @@ -288,3 +291,123 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } #endif + + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_master) { + return OLED_ROTATION_270; + } else { + return rotation; + } +} + +void render_crkbd_logo(void) { + static const char PROGMEM crkbd_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}; + oled_write_P(crkbd_logo, false); +} + + +void render_status(void) { + + oled_write_P(PSTR("Layer"), false); + switch (biton32(layer_state)) { + case 0: + oled_write_P(PSTR("Base "), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjst"), false); + break; + default: + oled_write_P(PSTR("Unkn "), false); + break; + } + oled_write_P(PSTR("Lyout"), false); + switch (biton32(default_layer_state)) { + case _QWERTY: + oled_write_P(PSTR("QWRTY"), false); + break; + case _COLEMAK: + oled_write_P(PSTR("COLMK"), false); + break; + case _DVORAK: + oled_write_P(PSTR("DVRAK"), false); + break; + case _WORKMAN: + oled_write_P(PSTR("WRKMN"), false); + break; + case _NORMAN: + oled_write_P(PSTR("NORMN"), false); + break; + case _MALTRON: + oled_write_P(PSTR("MLTRN"), false); + break; + case _EUCALYN: + oled_write_P(PSTR("ECLYN"), false); + break; + case _CARPLAX: + oled_write_P(PSTR("CRPLX"), false); + break; + } + + uint8_t modifiers = get_mods(); + uint8_t one_shot = get_oneshot_mods(); + + oled_write_P(PSTR("Mods:"), false); + oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false); + oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false); + oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false); + oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false); + + + oled_write_P(PSTR("BTMGK"), false); + static const char PROGMEM mode_logo[4][4] = { + {0x95,0x96,0x0a,0}, + {0xb5,0xb6,0x0a,0}, + {0x97,0x98,0x0a,0}, + {0xb7,0xb8,0x0a,0} }; + + if (keymap_config.swap_lalt_lgui != false) { + oled_write_P(mode_logo[0], false); + oled_write_P(mode_logo[1], false); + } else { + oled_write_P(mode_logo[2], false); + oled_write_P(mode_logo[3], false); + } + + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(PSTR("Lock:"), false); + oled_write_P(led_usb_state & (1<. - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H - -#if (defined(TAP_DANCE_ENABLE) && !defined(TAPPING_TERM)) -#define TAPPING_TERM 200 -#endif // TAP_DANCE_ENABLE - - -#define B5_AUDIO - - -#ifdef RGBLIGHT_ENABLE -#define RGB_DI_PIN D3 -#define RGBLED_NUM 14 // Number of LEDs -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#define RGBLIGHT_SLEEP -#endif // RGBLIGHT_ENABLE - -#define FORCE_NKRO - -#endif diff --git a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c deleted file mode 100644 index 20b4e064eb3..00000000000 --- a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c +++ /dev/null @@ -1,95 +0,0 @@ -/* 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 QMK_KEYBOARD_H -#include "drashna.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. - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_NUMLOCK] = KEYMAP( /* Base */ - TG(_NAV), TG(_DIABLO), TG(_MACROS), KC_PSLS,\ - KC_P7, KC_P8, KC_P9, KC_PAST, \ - KC_P4, KC_P5, KC_P6, KC_PMNS, \ - KC_P1, KC_P2, KC_P3, KC_PPLS, \ - LT(_MEDIA,KC_P0), KC_PDOT, KC_COLN, KC_PENT \ -), -[_NAV] = KEYMAP( /* Base */ - _______, _______, _______, _______,\ - KC_HOME, KC_UP, KC_PGUP, _______, \ - KC_LEFT, XXXXXXX, KC_RIGHT, _______, \ - KC_END, KC_DOWN, KC_PGDN, _______, \ - KC_INS, KC_DEL, _______, _______ \ -), -[_DIABLO] = KEYMAP( /* Base */ - KC_ESC, _______, XXXXXXX, _______,\ - KC_S, KC_I, KC_F, KC_M, \ - KC_1, KC_2, KC_3, KC_4, \ - KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, \ - XXXXXXX, KC_DIABLO_CLEAR, KC_Q, SFT_T(KC_SPACE) \ -), - -[_MACROS] = KEYMAP( /* Base */ - KC_OVERWATCH, XXXXXXX, _______, XXXXXXX,\ - KC_JUSTGAME, XXXXXXX, XXXXXXX, KC_C9, \ - XXXXXXX, XXXXXXX, KC_AIM, KC_GGEZ, \ - KC_SYMM, KC_TORB, XXXXXXX, KC_GOODGAME, \ - KC_SALT, KC_MORESALT, KC_SALTHARD, KC_GLHF \ -), -[_MEDIA] = KEYMAP( /* Base */ - KC_RESET, KC_MUTE, KC_VOLD, KC_VOLU,\ - KC_MAKE, _______, RGB_HUI, RGB_HUD, \ - KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, \ - RGB_TOG, RGB_MOD, RGB_SAI, RGB_VAI, \ - _______, KC_RGB_T, RGB_SAD, RGB_VAD \ -), - -}; - - -void numlock_led_on(void) { - PORTF |= (1 << 7); -} - -void numlock_led_off(void) { - PORTF &= ~(1 << 7); -} - - - -void matrix_init_keymap(void) { - // set Numlock LED to output and low - DDRF |= (1 << 7); - PORTF &= ~(1 << 7); -} - -void matrix_scan_keymap(void) { - numlock_led_off(); - if ((is_overwatch && biton32(layer_state) == _MACROS) || (biton32(layer_state) == _NUMLOCK)) { - numlock_led_on(); - } - - // Run Diablo 3 macro checking code. -} - -void led_set_keymap(uint8_t usb_led) { - if (!(usb_led & (1<. /* Use I2C or Serial, not both */ -#define USE_SERIAL -#undef USE_I2C +// #define USE_SERIAL +#define USE_I2C /* Select hand configuration */ @@ -31,7 +31,7 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM #define RGBLED_NUM 18 // Number of LEDs - +#define RGBLED_SPLIT { 9, 9 } #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 12 #define RGBLIGHT_VAL_STEP 12 @@ -55,7 +55,7 @@ along with this program. If not, see . #define QMK_SPEAKER C6 #undef PRODUCT -#ifdef KEYBOARD_iris_rev2 +#ifdef KEYBOARD_keebio_iris_rev2 #define PRODUCT Drashna Hacked Iris Rev.2 #endif diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index 0c3b0d6d443..b306b6928a2 100644 --- a/keyboards/keebio/iris/keymaps/drashna/keymap.c +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c @@ -121,3 +121,14 @@ void matrix_init_keymap(void) { writePinHigh(B0); #endif } + + +void keyboard_post_init_keymap(void) { +#if BACKLIGHT_ENABLE + backlight_enable(); + backlight_level(5); + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +#endif +} diff --git a/keyboards/keebio/iris/keymaps/drashna/rules.mk b/keyboards/keebio/iris/keymaps/drashna/rules.mk index e8035176efb..bac5f95f3a1 100644 --- a/keyboards/keebio/iris/keymaps/drashna/rules.mk +++ b/keyboards/keebio/iris/keymaps/drashna/rules.mk @@ -5,13 +5,14 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes +AUDIO_ENABLE = no NKRO_ENABLE = yes BACKLIGHT_ENABLE = no SWAP_HANDS_ENABLE = no -INDICATOR_LIGHTS = yes +INDICATOR_LIGHTS = no MACROS_ENABLED = no RGBLIGHT_TWINKLE = no +RGBLIGHT_STARTUP_ANIMATION = yes BOOTLOADER = qmk-dfu diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/config.h b/keyboards/keebio/iris/keymaps/drashna_lp/config.h new file mode 100644 index 00000000000..4e2bf729f22 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna_lp/config.h @@ -0,0 +1,48 @@ +/* +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 . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#include "../drashna/config.h" + +#ifdef RGBLIGHT_ENABLE +#undef RGBLED_NUM +#define RGBLED_NUM 16 // Number of LEDs +#undef RGBLED_SPLIT +#define RGBLED_SPLIT { 8, 8 } +#endif + +#undef PRODUCT +#ifdef KEYBOARD_keebio_iris_rev2 +#define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) +#endif + +#undef SHFT_LED1 +#define SHFT_LED1 5 +#undef SHFT_LED2 +#define SHFT_LED2 10 + +#undef CTRL_LED1 +#define CTRL_LED1 6 +#undef CTRL_LED2 +#define CTRL_LED2 9 + +#undef ALT_LED1 +#define ALT_LED1 7 +#undef GUI_LED1 +#define GUI_LED1 8 diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/keymap.c b/keyboards/keebio/iris/keymaps/drashna_lp/keymap.c new file mode 100644 index 00000000000..ff7bd09c0cf --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna_lp/keymap.c @@ -0,0 +1 @@ +// placeholder diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/rules.mk b/keyboards/keebio/iris/keymaps/drashna_lp/rules.mk new file mode 100644 index 00000000000..d3f6f5550f9 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna_lp/rules.mk @@ -0,0 +1,7 @@ +USER_NAME := drashna +SRC += ../drashna/keymap.c + +include $(KEYBOARD_PATH_2)/keymaps/drashna/rules.mk + +AUDIO_ENABLE = no +BACKLIGHT_ENABLE = yes diff --git a/keyboards/keebio/iris/keymaps/drashna_old/config.h b/keyboards/keebio/iris/keymaps/drashna_old/config.h index b985c4dfc12..1b462d8cad6 100644 --- a/keyboards/keebio/iris/keymaps/drashna_old/config.h +++ b/keyboards/keebio/iris/keymaps/drashna_old/config.h @@ -23,10 +23,12 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM #define RGBLED_NUM 16 // Number of LEDs +#undef RGBLED_SPLIT +#define RGBLED_SPLIT { 8, 8 } #endif #undef PRODUCT -#ifdef KEYBOARD_iris_rev2 +#ifdef KEYBOARD_keebio_iris_rev2 #define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) #endif diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index a2eaf63c302..1f04d5298c9 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -23,8 +23,8 @@ along with this program. If not, see . /* Use I2C or Serial, not both */ -#define USE_SERIAL -#undef USE_I2C +// #define USE_SERIAL +#define USE_I2C /* Select hand configuration */ @@ -41,6 +41,7 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 #define RGBLED_NUM 16 // Number of LEDs +#define RGBLED_SPLIT { 8, 8 } #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 12 diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 0f23bd9aa0c..b1d40690558 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -38,7 +38,7 @@ uint8_t last_osm; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, OS_RGUI, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \ ) #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index a826c664a7b..fdbfc94c9ba 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -5,11 +5,13 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes +AUDIO_ENABLE = no NKRO_ENABLE = yes INDICATOR_LIGHTS = yes MACROS_ENABLED = no RGBLIGHT_TWINKLE = no +RGBLIGHT_STARTUP_ANIMATION = yes + BOOTLOADER = qmk-dfu diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 089441e52c2..7b2ad4fa1ca 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -14,4 +14,3 @@ #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine #undef DEBOUNCE -#define DEBOUNCE 5 diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 428706e2d58..e7f43ad6696 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -44,10 +44,10 @@ bool skip_leds = false; KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ - KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ - OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ - KC_HOME, KC_PGUP, \ - LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ + KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ + OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ + KC_APP, KC_MENU, \ + KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \ ) #define LAYOUT_ergodox_pretty_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__) @@ -270,8 +270,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_ergodox_pretty_wrapper( KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, _______, - _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE, + KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, KC_PIPE, + _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_DQUO, _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, @@ -281,8 +281,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_ergodox_pretty_wrapper( KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, _______, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, KC_BSLS, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_QUOT, _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, KC_PSCR, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_SLCK, _______, _______, _______, _______, diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index 31488108b98..ee231321e3b 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -14,3 +14,6 @@ UNICDOEMAP_ENABLE = no MACROS_ENABLED = no RGBLIGHT_TWINKLE = no INDICATOR_LIGHTS = no +RGBLIGHT_STARTUP_ANIMATION = yes + +DEBOUNCE_TYPE = eager_pk diff --git a/layouts/community/ergodox/drashna_glow/config.h b/layouts/community/ergodox/drashna_glow/config.h index a10c4bb297c..e2d95942675 100644 --- a/layouts/community/ergodox/drashna_glow/config.h +++ b/layouts/community/ergodox/drashna_glow/config.h @@ -5,17 +5,11 @@ #undef PRODUCT #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow -#undef DEBOUNCE -#define DEBOUNCE 5 - #ifdef RGB_MATRIX_ENABLE -// #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) +#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 // #define EECONFIG_RGB_MATRIX (uint32_t *)16 #endif - -#undef DEBOUNCE -#define DEBOUNCE 1 diff --git a/layouts/community/ergodox/drashna_glow/rules.mk b/layouts/community/ergodox/drashna_glow/rules.mk index 5cb47dae4e3..ae9a2fb16c2 100644 --- a/layouts/community/ergodox/drashna_glow/rules.mk +++ b/layouts/community/ergodox/drashna_glow/rules.mk @@ -1,7 +1,10 @@ USER_NAME := drashna -SRC += ../drashna/keymap.c --include $(LAYOUT_KEYMAP_PATH)/../drashna/rules.mk +CORRECTED_LAYOUT := $(LAYOUTS_REPO)/$(LAYOUT)/drashna + +SRC += $(CORRECTED_LAYOUT)/keymap.c + +-include $(CORRECTED_LAYOUT)/rules.mk ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) RGBLIGHT_ENABLE = no diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h index ec66940e022..e3a70694a78 100644 --- a/layouts/community/numpad_5x6/drashna/config.h +++ b/layouts/community/numpad_5x6/drashna/config.h @@ -14,5 +14,7 @@ #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 #endif // RGBLIGHT_ENABLE - -#define TAP_CODE_DELAY 10 +#if defined(KEYBOARD_primekb_prime_m) +#undef PRODUCT +#define PRODUCT Drashna Hacked Prime_M Macro Pad +#endif diff --git a/layouts/community/numpad_5x6/drashna/rules.mk b/layouts/community/numpad_5x6/drashna/rules.mk index ed6fa8c7919..62bbc365d17 100644 --- a/layouts/community/numpad_5x6/drashna/rules.mk +++ b/layouts/community/numpad_5x6/drashna/rules.mk @@ -7,3 +7,4 @@ INDICATOR_LIGHTS = no RGBLIGHT_TWINKLE = yes MACROS_ENABLED = no MAKE_BOOTLOADER = yes +RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 1858ee3a4f5..f8e12f33d7e 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -36,6 +36,17 @@ #endif // KEYBOARD_planck_light +#if defined(KEYBOARD_planck) +#undef PRODUCT +#if defined(KEYBOARD_planck_light) +#define PRODUCT Drashna Hacked RGB Beacon (Planck Light) +#elif defined(KEYBOARD_planck_rev6) +#define PRODUCT Drashna Hacked Planck Rev6 +#elif defined(KEYBOARD_planck_EZ) +#define PRODUCT Drashna Hacked Planck EZ +#endif +#endif + /* * MIDI options */ @@ -59,5 +70,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#define TAP_CODE_DELAY 10 diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 28da1b20427..16defede967 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -139,10 +139,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { #ifdef BACKLIGHT_ENABLE backlight_step(); #endif - PORTE &= ~(1<<6); } else { unregister_code(KC_RSFT); - PORTE |= (1<<6); } return false; break; diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index f8804326745..89acba9eb81 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -6,13 +6,15 @@ COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no AUDIO_ENABLE = yes ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6 - RGBLIGHT_ENABLE = yes - INDICATOR_LIGHTS = yes - RGBLIGHT_TWINKLE = yes + RGBLIGHT_ENABLE = yes + INDICATOR_LIGHTS = yes + RGBLIGHT_TWINKLE = yes + RGBLIGHT_STARTUP_ANIMATION = yes endif ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light - RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = yes + RGBLIGHT_ENABLE = no + RGBLIGHT_STARTUP_ANIMATION = no endif ifeq ($(strip $(PROTOCOL)), VUSB) diff --git a/layouts/community/ortho_5x12/drashna/config.h b/layouts/community/ortho_5x12/drashna/config.h index e41dadc6015..480bf658c36 100644 --- a/layouts/community/ortho_5x12/drashna/config.h +++ b/layouts/community/ortho_5x12/drashna/config.h @@ -13,4 +13,10 @@ #define RGBLIGHT_SAT_STEP 8 #undef RGBLIGHT_VAL_STEP #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 175 + #define RGBLIGHT_SLEEP + + #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 + #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 + #endif diff --git a/users/drashna/.gitignore b/users/drashna/.gitignore new file mode 100644 index 00000000000..f84d34d9079 --- /dev/null +++ b/users/drashna/.gitignore @@ -0,0 +1,3 @@ +secrets.c +secrets.h +drashna_song_list.h \ No newline at end of file diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml index 9b18d44fb32..92813a27d3e 100644 --- a/users/drashna/.gitlab-ci.yml +++ b/users/drashna/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - build - deploy -Tests: +Preliminary Test: stage: test variables: GIT_SUBMODULE_STRATEGY: recursive @@ -12,12 +12,12 @@ Tests: image: ubuntu:18.10 before_script: - apt-get update -qy - - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr unzip wget zip - avr-gcc --version - uname -a script: - make test:all - - make planck/rev6:default + - make planck/rev6:default planck/rev5:default QMK Firmware Defaults: stage: deploy @@ -47,29 +47,7 @@ Drashna Firmware: - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip - avr-gcc --version script: - - make iris/rev2:drashna iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - paths: - - ./*.hex - - ./*.bin - expire_in: 1 month - -Firmware Deploy: - stage: deploy - dependencies: - - Drashna Firmware - variables: - GIT_SUBMODULE_STRATEGY: recursive - tags: - - linux - image: ubuntu:18.10 - before_script: - - apt-get update -qy - - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip - - avr-gcc --version - script: - - make iris/rev2:drashna:production iris/rev2:drashna_old:production ergodox_ez:drashna ergodox_ez:drashna_glow viterbi/rev1:drashna:production orthodox/rev1:drashna:production orthodox/rev3:drashna:production crkbd:drashna:production planck/light:drashna planck/rev6:drashna fractal:drashna:production + - make keebio/iris/rev2:drashna keebio/iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow keebio/viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna primekb/prime_m:drashna -j16 --output-sync artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" paths: diff --git a/users/drashna/config.h b/users/drashna/config.h index 2abd326dac9..1680eb4cb11 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -82,4 +82,4 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define MACRO_TIMER 5 +#define TAP_CODE_DELAY 5 diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 6968a4b9285..ec249dd2244 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -38,9 +38,9 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { } clear_keyboard(); tap_code(keycode); - wait_ms(50); - send_string_with_delay(str, MACRO_TIMER); - wait_ms(50); + wait_ms(TAP_CODE_DELAY); + send_string_with_delay(str, TAP_CODE_DELAY); + wait_ms(TAP_CODE_DELAY); tap_code(KC_ENTER); } if (override) wait_ms(3000); @@ -53,12 +53,10 @@ bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { this_timer= timer_read(); } else { if (timer_elapsed(this_timer) < TAPPING_TERM){ - register_code(code); - unregister_code(code); + tap_code(code); } else { register_code(mod_code); - register_code(code); - unregister_code(code); + tap_code(code); unregister_code(mod_code); } } @@ -70,12 +68,10 @@ bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t thi this_timer= timer_read(); } else { if (timer_elapsed(this_timer) < TAPPING_TERM){ - register_code(code); - unregister_code(code); + tap_code(code); } else { register_code(mod_code); - register_code(code); - unregister_code(code); + tap_code(code); unregister_code(mod_code); } } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index c19b1894346..6645626d981 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -27,7 +27,11 @@ along with this program. If not, see . #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) #include "rgb_stuff.h" #endif - +#if defined(AUDIO_ENABLE) && __GNUC__ > 7 + #if __has_include("drashna_song_list.h") + #include "drashna_song_list.h" + #endif +#endif /* Define layer names */ enum userspace_layers { diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 2d9025b375b..2b6ccf510cb 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -18,7 +18,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // If console is enabled, it will print the matrix position and status of each key pressed #ifdef KEYLOGGER_ENABLE - #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_iris_rev2) + #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); #else xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); @@ -37,31 +37,29 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { uint8_t temp_mod = get_mods(); uint8_t temp_osm = get_oneshot_mods(); clear_mods(); clear_oneshot_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); #ifndef MAKE_BOOTLOADER if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) #endif { #if defined(__arm__) - send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); + send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); + send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); + send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); + send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); #endif // bootloader options } - if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); - set_mods(temp_mod); - set_oneshot_mods(temp_osm); + if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); } break; case VRSN: // Prints firmware version if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); } break; diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index f7f2193ec6b..5e3374d3f2c 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h @@ -56,6 +56,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define ADJUST MO(_ADJUST) #define TG_MODS TG(_MODS) #define TG_GAME TG(_GAMEPAD) +#define OS_LWR OSL(_LOWER) +#define OS_RSE OSL(_RAISE) #define KC_SEC1 KC_SECRET_1 #define KC_SEC2 KC_SECRET_2 diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index a98ad590cc7..b5e145842f6 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -247,17 +247,20 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { void keyboard_post_init_rgb(void) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - layer_state_set_user(layer_state); - uint16_t old_hue = rgblight_config.hue; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 360; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); - wait_ms(10); - } - layer_state_set_user(layer_state); +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) + if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } + if (rgblight_config.enable) { + layer_state_set_user(layer_state); + uint16_t old_hue = rgblight_config.hue; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 360; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); + matrix_scan(); + wait_ms(10); + } + } #endif + layer_state_set_user(layer_state); } void matrix_scan_rgb(void) { @@ -278,7 +281,7 @@ uint32_t layer_state_set_rgb(uint32_t state) { switch (biton32(state)) { case _MACROS: rgblight_sethsv_noeeprom_orange(); - userspace_config.is_overwatch ? rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 2) : rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 3); + userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); break; case _MEDIA: rgblight_sethsv_noeeprom_chartreuse(); diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 5050704a53b..bef25e25948 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -9,7 +9,9 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) SRC += tap_dances.c endif -EXTRAFLAGS += -flto +ifeq ($(PLATFORM),AVR) + EXTRAFLAGS += -flto +endif ifeq ($(strip $(NO_SECRETS)), yes) OPT_DEFS += -DNO_SECRETS @@ -26,6 +28,9 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) OPT_DEFS += -DRGBLIGHT_NOEEPROM endif + ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) + OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION + endif endif ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) From ce8fb1eab923a8ce37022a898597048e5893b078 Mon Sep 17 00:00:00 2001 From: ishtob Date: Mon, 22 Apr 2019 23:26:51 -0400 Subject: [PATCH 017/129] Boston meetup 2019 (#5611) * Add boston_meetup folder for community meetup macropads * Modify OLED indicators to match macropad * PR cleanup * Spelling fix Co-Authored-By: ishtob * convert custom matrix to standard matrix defines * refactor layer define with enum * Remove un-used files * remove "\" in keymap --- keyboards/boston_meetup/2019/2019.c | 217 ++++++++++++++++++ keyboards/boston_meetup/2019/2019.h | 19 ++ keyboards/boston_meetup/2019/config.h | 196 ++++++++++++++++ keyboards/boston_meetup/2019/info.json | 12 + .../2019/keymaps/default/keymap.c | 166 ++++++++++++++ .../2019/keymaps/default/readme.md | 51 ++++ .../boston_meetup/2019/keymaps/readme.md | 22 ++ keyboards/boston_meetup/2019/readme.md | 13 ++ keyboards/boston_meetup/2019/rules.mk | 24 ++ keyboards/boston_meetup/boston_meetup.c | 2 + keyboards/boston_meetup/boston_meetup.h | 19 ++ keyboards/boston_meetup/config.h | 60 +++++ keyboards/boston_meetup/readme.md | 14 ++ keyboards/boston_meetup/rules.mk | 2 + 14 files changed, 817 insertions(+) create mode 100644 keyboards/boston_meetup/2019/2019.c create mode 100644 keyboards/boston_meetup/2019/2019.h create mode 100644 keyboards/boston_meetup/2019/config.h create mode 100644 keyboards/boston_meetup/2019/info.json create mode 100644 keyboards/boston_meetup/2019/keymaps/default/keymap.c create mode 100644 keyboards/boston_meetup/2019/keymaps/default/readme.md create mode 100644 keyboards/boston_meetup/2019/keymaps/readme.md create mode 100644 keyboards/boston_meetup/2019/readme.md create mode 100644 keyboards/boston_meetup/2019/rules.mk create mode 100644 keyboards/boston_meetup/boston_meetup.c create mode 100644 keyboards/boston_meetup/boston_meetup.h create mode 100644 keyboards/boston_meetup/config.h create mode 100644 keyboards/boston_meetup/readme.md create mode 100644 keyboards/boston_meetup/rules.mk diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c new file mode 100644 index 00000000000..9baed223bc8 --- /dev/null +++ b/keyboards/boston_meetup/2019/2019.c @@ -0,0 +1,217 @@ +/* Copyright 2019 ishtob + * + * 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 "2019.h" +#include "qwiic.h" +#include "action_layer.h" +#include "haptic.h" + +#ifdef RGB_MATRIX_ENABLE +#include "rgblight.h" + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + /*{row | col << 4} + | {x=0..224, y=0..64} + | | modifier + | | | */ + {{1|(3<<4)}, {188, 16}, 0}, + {{3|(3<<4)}, {187, 48}, 0}, + {{4|(2<<4)}, {149, 64}, 0}, + {{4|(1<<4)}, {112, 64}, 0}, + {{3|(0<<4)}, {37, 48}, 0}, + {{1|(0<<4)}, {38, 16}, 0} +}; +#endif + +uint8_t *o_fb; + +uint16_t counterst = 0; + + + +#ifdef QWIIC_MICRO_OLED_ENABLE + +/* screen off after this many milliseconds */ +#include "timer.h" +#define ScreenOffInterval 60000 /* milliseconds */ +static uint16_t last_flush; + +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; +volatile uint8_t led_scrolllock = false; + +static uint8_t layer; +static bool queue_for_send = false; +static uint8_t encoder_value = 32; + +__attribute__ ((weak)) +void draw_ui(void) { + clear_buffer(); + last_flush = timer_read(); + send_command(DISPLAYON); + +/* Boston MK title is 55 x 10 pixels */ +#define NAME_X 0 +#define NAME_Y 0 + + draw_string(NAME_X + 1, NAME_Y + 2, "BOSTON MK", PIXEL_ON, NORM, 0); + +/* Layer indicator is 41 x 10 pixels */ +#define LAYER_INDICATOR_X 60 +#define LAYER_INDICATOR_Y 0 + + draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); + draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); + draw_char(LAYER_INDICATOR_X + 34, LAYER_INDICATOR_Y + 2, layer + 0x30, PIXEL_ON, XOR, 0); + +/* Matrix display is 12 x 12 pixels */ +#define MATRIX_DISPLAY_X 8 +#define MATRIX_DISPLAY_Y 16 + + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + for (uint8_t y = 0; y < MATRIX_COLS; y++) { + draw_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); + draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); + draw_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM); + draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM); + + } + } + draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 12, 12, PIXEL_ON, NORM); + /* hadron oled location on thumbnail */ + draw_rect_filled_soft(MATRIX_DISPLAY_X + 5, MATRIX_DISPLAY_Y + 2, 6, 2, PIXEL_ON, NORM); +/* + draw_rect_soft(0, 13, 64, 6, PIXEL_ON, NORM); + draw_line_vert(encoder_value, 13, 6, PIXEL_ON, NORM); + +*/ + +/* Mod display is 41 x 16 pixels */ +#define MOD_DISPLAY_X 60 +#define MOD_DISPLAY_Y 20 + + uint8_t mods = get_mods(); + if (mods & MOD_LSFT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 0, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LCTL) { + draw_rect_filled_soft(MOD_DISPLAY_X + 10, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LALT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 20, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LGUI) { + draw_rect_filled_soft(MOD_DISPLAY_X + 30, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_ON, NORM, 0); + } + +/* Lock display is 23 x 32 */ +#define LOCK_DISPLAY_X 104 +#define LOCK_DISPLAY_Y 0 + + if (led_numlock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X, LOCK_DISPLAY_Y, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_OFF, NORM, 0); + } else if (led_numlock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_ON, NORM, 0); + } + if (led_capslock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 11, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_OFF, NORM, 0); + } else if (led_capslock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_ON, NORM, 0); + } + + if (led_scrolllock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 22, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_OFF, NORM, 0); + } else if (led_scrolllock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_ON, NORM, 0); + } + send_buffer(); +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + if (led_numlock == false){led_numlock = true;} + } else { + if (led_numlock == true){led_numlock = false;} + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + if (led_capslock == false){led_capslock = true;} + } else { + if (led_capslock == true){led_capslock = false;} + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + if (led_scrolllock == false){led_scrolllock = true;} + } else { + if (led_scrolllock == true){led_scrolllock = false;} + } +} + +uint32_t layer_state_set_kb(uint32_t state) { + state = layer_state_set_user(state); + layer = biton32(state); + queue_for_send = true; + return state; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + queue_for_send = true; + return process_record_user(keycode, record); +} + +void encoder_update_kb(uint8_t index, bool clockwise) { + encoder_value = (encoder_value + (clockwise ? 1 : -1)) % 64; + queue_for_send = true; +} + +#endif + +void matrix_init_kb(void) { + queue_for_send = true; + matrix_init_user(); +} + +void matrix_scan_kb(void) { +if (queue_for_send) { +#ifdef QWIIC_MICRO_OLED_ENABLE + draw_ui(); +#endif + queue_for_send = false; + } +#ifdef QWIIC_MICRO_OLED_ENABLE + if (timer_elapsed(last_flush) > ScreenOffInterval) { + send_command(DISPLAYOFF); /* 0xAE */ + } +#endif + if (counterst == 0) { + //testPatternFB(o_fb); + } + counterst = (counterst + 1) % 1024; + //rgblight_task(); + matrix_scan_user(); +} diff --git a/keyboards/boston_meetup/2019/2019.h b/keyboards/boston_meetup/2019/2019.h new file mode 100644 index 00000000000..fbba5c3154f --- /dev/null +++ b/keyboards/boston_meetup/2019/2019.h @@ -0,0 +1,19 @@ +/* Copyright 2019 ishtob + * + * 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 . + */ +#pragma once + +#include "boston_meetup.h" + diff --git a/keyboards/boston_meetup/2019/config.h b/keyboards/boston_meetup/2019/config.h new file mode 100644 index 00000000000..5652816446c --- /dev/null +++ b/keyboards/boston_meetup/2019/config.h @@ -0,0 +1,196 @@ +#pragma once + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x07E3 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 4 +#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) + * +*/ + +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS + +#define MATRIX_ROW_PINS { A3, B8, B9, B1 } +#define MATRIX_COL_PINS { A7, A8, B2, B10 } + +#define NUMBER_OF_ENCODERS 1 +#define ENCODERS_PAD_A { B13 } +#define ENCODERS_PAD_B { B14 } + +//Audio +#undef AUDIO_VOICES +#undef C6_AUDIO + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(ONE_UP_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + +#define AUDIO_CLICKY + /* to enable clicky on startup */ + //#define AUDIO_CLICKY_ON +#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f +#endif + +//configure qwiic micro_oled driver for the 128x32 oled +#ifdef QWIIC_MICRO_OLED_ENABLE + +#undef I2C_ADDRESS_SA0_1 +#define I2C_ADDRESS_SA0_1 0b0111100 +#define LCDWIDTH 128 +#define LCDHEIGHT 32 +#define micro_oled_rotate_180 + +#endif +/* + * 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) + * +*/ + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 6 + +/* 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 + +/* + * 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 2 + +/* Haptic Driver initialization settings + * Feedback Control Settings */ +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ + +/* default 3V ERM vibration motor voltage and library*/ +#if FB_ERM_LRA == 0 +#define RATED_VOLTAGE 3 +#define V_RMS 2.3 +#define V_PEAK 3.30 +/* Library Selection */ +#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +/* default 2V LRA voltage and library */ +#elif FB_ERM_LRA == 1 +#define RATED_VOLTAGE 2 +#define V_RMS 2.0 +#define V_PEAK 2.85 +#define F_LRA 200 +/* Library Selection */ +#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +#endif + +/* Control 1 register settings */ +#define DRIVE_TIME 25 +#define AC_COUPLE 0 +#define STARTUP_BOOST 1 + +/* Control 2 Settings */ +#define BIDIR_INPUT 1 +#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ +#define SAMPLE_TIME 3 +#define BLANKING_TIME 1 +#define IDISS_TIME 1 + +/* Control 3 settings */ +#define NG_THRESH 2 +#define ERM_OPEN_LOOP 1 +#define SUPPLY_COMP_DIS 0 +#define DATA_FORMAT_RTO 0 +#define LRA_DRIVE_MODE 0 +#define N_PWM_ANALOG 0 +#define LRA_OPEN_LOOP 0 +/* Control 4 settings */ +#define ZC_DET_TIME 0 +#define AUTO_CAL_TIME 3 + +#define RGBLIGHT_ANIMATIONS + +#define RGBLED_NUM 10 +#define RGB_DI_PIN B5 +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define RGB_MATRIX_KEYPRESSES + +#define SOLENOID_PIN A14 + diff --git a/keyboards/boston_meetup/2019/info.json b/keyboards/boston_meetup/2019/info.json new file mode 100644 index 00000000000..15ab72935c2 --- /dev/null +++ b/keyboards/boston_meetup/2019/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Boston Meetup 2019", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 13, + "layout": [{"label":"K00", "x":0, "y":0}, {"label":"K10", "x":0, "y":1}, {"label":"K11", "x":1, "y":1}, {"label":"K12", "x":2, "y":1}, {"label":"K13", "x":3, "y":1}, {"label":"K20", "x":0, "y":2}, {"label":"K21", "x":1, "y":2}, {"label":"K22", "x":2, "y":2}, {"label":"K23", "x":3, "y":2}, {"label":"K30", "x":0, "y":3}, {"label":"K31", "x":1, "y":3}, {"label":"K32", "x":2, "y":3}, {"label":"K33", "x":3, "y":3}] } + } +} diff --git a/keyboards/boston_meetup/2019/keymaps/default/keymap.c b/keyboards/boston_meetup/2019/keymaps/default/keymap.c new file mode 100644 index 00000000000..52d67273e37 --- /dev/null +++ b/keyboards/boston_meetup/2019/keymaps/default/keymap.c @@ -0,0 +1,166 @@ +#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. + +enum custom_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + BASE = SAFE_RANGE, + LOWER, + RAISE, + KC_DEMOMACRO +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise +#define DEMOMACRO KC_DEMOMACRO // Sample for macros + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base + * ,------. + * | Esc | + * |------+------+-------------. + * | : | 7 | 8 | 9 | + * |------+------+------+------| + * | RAISE| 4 | 5 | 6 | + * |------+------+------+------| + * | LOWER| 1 | 2 | 3 | + * `---------------------------' + */ +[_BASE] = LAYOUT( + KC_ESC, + KC_COLN, KC_P7, KC_P8, KC_P9, + RAISE, KC_P4, KC_P5, KC_P6, + LOWER, KC_P1, KC_P2, KC_P3 +), + +/* Lower + * ,------. + * | Nmlk | + * |------+------+-------------. + * | : | / | * | - | + * |------+------+------+------| + * | | | = | + | + * |------+------+------+------| + * | | 0 | . | ENT | + * `---------------------------' + */ +[_LOWER] = LAYOUT( + KC_NLCK, + KC_COLN, KC_PSLS, KC_PAST, KC_PMNS, + _______, XXXXXXX, KC_EQL, KC_PPLS, + _______, KC_P0, KC_PDOT, KC_PENT +), + +/* Raise + * ,------. + * | Esc | + * |------+------+-------------. + * |RGB TG|RGB M+|RGB M-| | + * |------+------+------+------| + * | |RGB H+|RGB S+|RGB V+| + * |------+------+------+------| + * | ` |RGB H-|RGB S-|RGB V-| + * `---------------------------' + */ +[_RAISE] = LAYOUT( + KC_NLCK, + RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX, + _______, RGB_HUI, RGB_SAI, RGB_VAI, + _______, RGB_HUD, RGB_SAD, RGB_VAD + +), + +/* Adjust + * ,------. + * | DFU | + * |------+------+-------------. + * |HPT TG|HPT FB|HPT RS| BKSP | + * |------+------+------+------| + * | |HPT M+| | | + * |------+------+------+------| + * | |HPT M-|Clk TG| Del | + * `---------------------------' + */ +[_ADJUST] = LAYOUT( + RESET, + HPT_TOG, HPT_FBK, HPT_RST, KC_BSPC, + _______, HPT_MODI, XXXXXXX, XXXXXXX, + _______, HPT_MODD, CK_TOGG, KC_DEL +), + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_DEMOMACRO: + if (record->event.pressed) { + // when keycode KC_DEMOMACRO is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode KC_DEMOMACRO is released + } + 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. + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + 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. + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +void matrix_init_user(void) { +} + + +void matrix_scan_user(void) { +} + diff --git a/keyboards/boston_meetup/2019/keymaps/default/readme.md b/keyboards/boston_meetup/2019/keymaps/default/readme.md new file mode 100644 index 00000000000..75f80b51914 --- /dev/null +++ b/keyboards/boston_meetup/2019/keymaps/default/readme.md @@ -0,0 +1,51 @@ +# The Default Boston Meetup 2019 board Layout + +Keymap: +``` +Base +,------. +| Esc | +|------+------+-------------. +| : | 7 | 8 | 9 | +|------+------+------+------| +| RAISE| 4 | 5 | 6 | +|------+------+------+------| +| LOWER| 1 | 2 | 3 | +`---------------------------' + +Lower +,------. +| Nmlk | +|------+------+-------------. +| : | / | * | - | +|------+------+------+------| +| | | = | + | +|------+------+------+------| +| | 0 | . | ENT | +`---------------------------' + +Raise +,------. +| Esc | +|------+------+-------------. +|RGB TG|RGB M+|RGB M-| | +|------+------+------+------| +| |RGB H+|RGB S+|RGB V+| +|------+------+------+------| +| |RGB H-|RGB S-|RGB V-| +`---------------------------' + +Adjust: +,------. +| DFU | +|------+------+-------------. +|HPT TG|HPT FB|HPT RS| BKSP | +|------+------+------+------| +| |HPT M+| | | +|------+------+------+------| +| |HPT M-|Clk TG| Del | +`---------------------------' + +``` + +RGB still work in progress \ No newline at end of file diff --git a/keyboards/boston_meetup/2019/keymaps/readme.md b/keyboards/boston_meetup/2019/keymaps/readme.md new file mode 100644 index 00000000000..c10a49f7d03 --- /dev/null +++ b/keyboards/boston_meetup/2019/keymaps/readme.md @@ -0,0 +1,22 @@ +# How to add your own keymap + +Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: + + _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] + +\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements + +and contain the following files: + +* `keymap.c` +* `readme.md` *recommended* +* `config.h` *optional*, found automatically when compiling +* `Makefile` *optional*, found automatically when compling + +When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: + + * **folder_name** description + +# List of 2019 keymaps + +* **default** default 2019 macropad layout \ No newline at end of file diff --git a/keyboards/boston_meetup/2019/readme.md b/keyboards/boston_meetup/2019/readme.md new file mode 100644 index 00000000000..2bdac9dcde1 --- /dev/null +++ b/keyboards/boston_meetup/2019/readme.md @@ -0,0 +1,13 @@ +# Boston Meetup 2019 Macropad + +![Boston Meetup 2019](https://i.imgur.com/6LgBc4g.jpg) + +Limited-run board designed for Boston MK community meetup 2019. + +Keyboard Maintainer: [ishtob](https://github.com/ishtob), [QMK](https://github.com/qmk) + +Make example for this keyboard (after setting up your build environment): + + make boston_meetup/2019:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/boston_meetup/2019/rules.mk b/keyboards/boston_meetup/2019/rules.mk new file mode 100644 index 00000000000..7c03a025eef --- /dev/null +++ b/keyboards/boston_meetup/2019/rules.mk @@ -0,0 +1,24 @@ +# project specific files + +# Cortex version +MCU = STM32F303 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no # 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 = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = no #WS2812 +HAPTIC_ENABLE += DRV2605L +QWIIC_ENABLE += MICRO_OLED +# SERIAL_LINK_ENABLE = yes diff --git a/keyboards/boston_meetup/boston_meetup.c b/keyboards/boston_meetup/boston_meetup.c new file mode 100644 index 00000000000..a9201ac8520 --- /dev/null +++ b/keyboards/boston_meetup/boston_meetup.c @@ -0,0 +1,2 @@ +#include "boston_meetup.h" + diff --git a/keyboards/boston_meetup/boston_meetup.h b/keyboards/boston_meetup/boston_meetup.h new file mode 100644 index 00000000000..e1d9d920603 --- /dev/null +++ b/keyboards/boston_meetup/boston_meetup.h @@ -0,0 +1,19 @@ +#pragma once + +#ifdef KEYBOARD_boston_meetup_2019 + #include "2019.h" +#define LAYOUT( \ + K00, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ + ) \ +{ \ + { K00, KC_NO, KC_NO, KC_NO }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} +#endif + +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/boston_meetup/config.h b/keyboards/boston_meetup/config.h new file mode 100644 index 00000000000..b025e18df56 --- /dev/null +++ b/keyboards/boston_meetup/config.h @@ -0,0 +1,60 @@ +/* +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFB30 +#define PRODUCT_ID 0x26BE +#define MANUFACTURER ishtob +#define PRODUCT Boston Meetup Board +#define DESCRIPTION A limited-run community meetup board + +//#define AUDIO_VOICES + +//#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#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 + +/* + * 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 diff --git a/keyboards/boston_meetup/readme.md b/keyboards/boston_meetup/readme.md new file mode 100644 index 00000000000..2fa1ec9583f --- /dev/null +++ b/keyboards/boston_meetup/readme.md @@ -0,0 +1,14 @@ +# Boston Meetup Macropads + +![Boston Meetup Macropads](https://i.imgur.com/yQcBF8g.jpg) + +Limited-run boards designed for Boston MK community meetups. + +Keyboard Maintainer: [ishtob](https://github.com/ishtob), [QMK](https://github.com/qmk) +Hardware Supported: Boston Meetup PCB 2018, 2019 + +Make example for this keyboard (after setting up your build environment): + + make boston_meetup/YYYY:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/boston_meetup/rules.mk b/keyboards/boston_meetup/rules.mk new file mode 100644 index 00000000000..6dd899edc85 --- /dev/null +++ b/keyboards/boston_meetup/rules.mk @@ -0,0 +1,2 @@ + +DEFAULT_FOLDER = boston_meetup/2019 From d48a5b29d764ee6ac925daf2500bb6101e8b23ca Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Mon, 22 Apr 2019 21:52:05 -0700 Subject: [PATCH 018/129] [Keymap] Fix my userspace RGB bug (#5686) * fix bug that enabled RGBLIGHT_ENABLE on all my boards regardless if it was supported or not * update changelog with new changes for 0.2.2 --- users/mechmerlin/changelog.md | 4 ++++ users/mechmerlin/config.h | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/users/mechmerlin/changelog.md b/users/mechmerlin/changelog.md index ec4b20108f7..f1116b2d2b1 100644 --- a/users/mechmerlin/changelog.md +++ b/users/mechmerlin/changelog.md @@ -1,6 +1,10 @@ # Changelog All notable changes to my userspace will be documented in this file. +## [0.2.2] - 2019-04-22 +### Fixed +- `config.h` usage of turning on `RGBLIGHT_ENABLE` when it is not enabled on boards other than my two clueboards were causing issues with boards that didn't have RGB underglow on it. + ## [0.2.1] - 2019-03-01 ### Fixed - `config.h` usage of `#ifdef RGBLIGHT_ENABLE` caused problems for other of my boards that had `RGBLIGHT_ENABLE`. diff --git a/users/mechmerlin/config.h b/users/mechmerlin/config.h index 9ca39a12ac6..fe8f9c9ffb2 100644 --- a/users/mechmerlin/config.h +++ b/users/mechmerlin/config.h @@ -21,17 +21,11 @@ #ifndef RGBLIGHT_ENABLE #define RGBLIGHT_ENABLE #endif - #ifndef AUDIO_CLICKY #define AUDIO_CLICKY #endif - #elif defined(KEYBOARD_clueboard_66_hotswap_gen1) #ifndef AUDIO_CLICKY #define AUDIO_CLICKY #endif -#else - #ifndef RGBLIGHT_ENABLE - #define RGBLIGHT_ENABLE - #endif #endif From 7ae2ded5901bedf2014e254db2b5292cdb72ffe4 Mon Sep 17 00:00:00 2001 From: ymzcdg <49898694+ymzcdg@users.noreply.github.com> Date: Wed, 24 Apr 2019 03:37:20 +0800 Subject: [PATCH 019/129] Translate docs into Chinese (#5693) * Docs translate Translate some docs to Standard Chinese for Chinese Developers. * fix translate fix translate --- docs/zh-cn/README.md | 32 +++++++++++++ docs/zh-cn/_summary.md | 106 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 docs/zh-cn/README.md create mode 100644 docs/zh-cn/_summary.md diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md new file mode 100644 index 00000000000..9eb4ea777ae --- /dev/null +++ b/docs/zh-cn/README.md @@ -0,0 +1,32 @@ +# QMK机械键盘固件 + +[![当前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) +[![开发状态](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) +[![异议](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) +[![文档状态](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) +[![GitHub贡献者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) +[![GitHub分支](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) + +## 什么是 QMK 固件? + +QMK (*Quantum Mechanical Keyboard*) 是一个社区维护的开源软件,包括 QMK 固件, QMK 工具箱, qmk.fm网站, 和这些文档。QMK 固件是一个基于[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)的键盘固件,它在爱特梅尔AVR微控制器实现一些有用的功能,确切地说, 是在 [OLKB product line](http://olkb.com), 在 [ErgoDox EZ](http://www.ergodox-ez.com) 键盘, 和 [Clueboard product line](http://clueboard.co/). 上。它被移植到使用ChibiOS的ARM芯片上. 它可以在飞线键盘或定制PCB键盘中发挥功能. + +## 如何得到它 + +如果你打算贡献布局, 键盘, 或者其他QMK特性, 一下是最简单的方法:[从Github获得repo分支](https://github.com/qmk/qmk_firmware#fork-destination-box), 并克隆你的repo到本地进行编辑,推送,然后从你的分支打开 [Pull Request](https://github.com/qmk/qmk_firmware/pulls). + +此外, 你也可以直接下载 ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), 或者从git克隆 (`git@github.com:qmk/qmk_firmware.git`), 或 https (`https://github.com/qmk/qmk_firmware.git`). + +## 如何编译 + +在你能编译之前, 你需要[部署环境](getting_started_build_tools.md) 用于 AVR or/and ARM 开发。完成后, 你可以使用 `make` 命令来编译一个键盘和布局使用以下命令: + + make planck/rev4:default + +这将建立 `planck`的`rev4` 修订版本并使用 `default`布局。并非所有键盘都有修订版本 (也叫做子项目或文件夹),在此情况下,修订版本可以省略,如下: + + make preonic:default + +## 如何定制 + +QMK 有许多 [特性](features.md)来探索,也有很多 [参考文档](http://docs.qmk.fm) 供您发掘。你可以通过修改 [布局](keymap.md)和[键码](keycodes.md)来利用许多特性。 diff --git a/docs/zh-cn/_summary.md b/docs/zh-cn/_summary.md new file mode 100644 index 00000000000..df25a3ccd14 --- /dev/null +++ b/docs/zh-cn/_summary.md @@ -0,0 +1,106 @@ +* [完全菜鸟指南](newbs.md) + * [入门](newbs_getting_started.md) + * [构建你的第一个固件](newbs_building_firmware.md) + * [刷新固件](newbs_flashing.md) + * [测试和调试](newbs_testing_debugging.md) + * [Git最佳实践](newbs_best_practices.md) + * [学习资源](newbs_learn_more_resources.md) + +* [QMK基础](README.md) + * [QMK 简介](getting_started_introduction.md) + * [贡献 QMK](contributing.md) + * [如何使用Github](getting_started_github.md) + * [获得帮助](getting_started_getting_help.md) + +* [问题解答](faq.md) + * [一般问题](faq_general.md) + * [构建/编译QMK](faq_build.md) + * [调试/故障排除 QMK](faq_debug.md) + * [键盘布局](faq_keymap.md) + +* 详细指南 + * [安装构建工具](getting_started_build_tools.md) + * [流浪者指南](getting_started_vagrant.md) + * [构建/编译指令](getting_started_make_guide.md) + * [刷新固件](flashing.md) + * [定制功能](custom_quantum_functions.md) + * [布局概述](keymap.md) + +* [硬件](hardware.md) + * [AVR 处理器](hardware_avr.md) + * [驱动](hardware_drivers.md) + +* 参考 + * [键盘指南](hardware_keyboard_guidelines.md) + * [配置选项](config_options.md) + * [键码](keycodes.md) + * [记录最佳实践](documentation_best_practices.md) + * [文档指南](documentation_templates.md) + * [词汇表](reference_glossary.md) + * [单元测试](unit_testing.md) + * [有用的功能](ref_functions.md) + * [配置器支持](reference_configurator_support.md) + * [info.json 格式](reference_info_json.md) + +* [特性](features.md) + * [基本键码](keycodes_basic.md) + * [US ANSI 控制键](keycodes_us_ansi_shifted.md) + * [量子键码](quantum_keycodes.md) + * [高级键码](feature_advanced_keycodes.md) + * [音频](feature_audio.md) + * [自动控制](feature_auto_shift.md) + * [背光](feature_backlight.md) + * [蓝牙](feature_bluetooth.md) + * [Bootmagic](feature_bootmagic.md) + * [组合](feature_combo) + * [命令](feature_command.md) + * [动态宏指令](feature_dynamic_macros.md) + * [编码器](feature_encoders.md) + * [Grave Escape](feature_grave_esc.md) + * [键锁](feature_key_lock.md) + * [层](feature_layouts.md) + * [引导键](feature_leader_key.md) + * [LED 阵列](feature_led_matrix.md) + * [宏指令](feature_macros.md) + * [鼠标键](feature_mouse_keys.md) + * [一键功能](feature_advanced_keycodes.md#one-shot-keys) + * [指针设备](feature_pointing_device.md) + * [PS/2 鼠标](feature_ps2_mouse.md) + * [RGB 光](feature_rgblight.md) + * [RGB 矩阵](feature_rgb_matrix.md) + * [空格候补换挡](feature_space_cadet_shift.md) + * [空格候补换挡回车](feature_space_cadet_shift_enter.md) + * [速录机](feature_stenography.md) + * [换手](feature_swap_hands.md) + * [踢踏舞](feature_tap_dance.md) + * [终端](feature_terminal.md) + * [热敏打印机](feature_thermal_printer.md) + * [Unicode](feature_unicode.md) + * [用户空间](feature_userspace.md) + * [速度键](feature_velocikey.md) + +* 针对制造者和定制者 + * [飞线指南](hand_wire.md) + * [ISP 刷新指南](isp_flashing_guide.md) + * [ARM 调试指南](arm_debugging.md) + * [I2C 驱动](i2c_driver.md) + * [GPIO 控制器](internals_gpio_control.md) + * [Proton C 转换](proton_c_conversion.md) + +* 深入了解 + * [键盘如何工作](how_keyboards_work.md) + * [理解 QMK](understanding_qmk.md) + +* 其他话题 + * [使用Eclipse开发QMK](other_eclipse.md) + * [使用VSCode开发QMK](other_vscode.md) + * [支持](support.md) + +* QMK 内构 (正在编写) + * [定义](internals_defines.md) + * [输入回调寄存器](internals_input_callback_reg.md) + * [Midi 设备](internals_midi_device.md) + * [Midi 设备设置过程](internals_midi_device_setup_process.md) + * [Midi 工具库](internals_midi_util.md) + * [发送函数](internals_send_functions.md) + * [Sysex 工具](internals_sysex_tools.md) From d4a5402aeb856bba25943e954585d56cf7230910 Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Wed, 24 Apr 2019 11:10:28 +0900 Subject: [PATCH 020/129] [Keyboard] Fix red an green leds location (#5698) --- keyboards/planck/ez/ez.c | 94 ++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index b859af6c15b..c3b7e26170c 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -22,60 +22,60 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { * | | G location * | | | B location * | | | | */ - {0, A_12, B_12, C_12}, - {0, A_11, B_11, C_11}, - {0, A_10, B_10, C_10}, - {0, A_9, B_9, C_9}, - {0, A_8, B_8, C_8}, - {0, A_7, B_7, C_7}, + {0, B_12, A_12, C_12}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, - {0, G_12, H_12, I_12}, - {0, G_11, H_11, I_11}, - {0, G_10, H_10, I_10}, - {0, G_9, H_9, I_9}, - {0, G_8, H_8, I_8}, - {0, G_7, H_7, I_7}, + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, - {0, A_6, B_6, C_6}, - {0, A_5, B_5, C_5}, - {0, A_4, B_4, C_4}, - {0, A_3, B_3, C_3}, - {0, A_2, B_2, C_2}, - {0, A_1, B_1, C_1}, + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, - {0, G_6, H_6, I_6}, - {0, G_5, H_5, I_5}, - {0, G_4, H_4, I_4}, - {0, G_3, H_3, I_3}, - {0, G_2, H_2, I_2}, - {0, G_1, H_1, I_1}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, - {0, D_12, E_12, F_12}, - {0, D_11, E_11, F_11}, - {0, D_10, E_10, F_10}, - {0, D_9, E_9, F_9}, - {0, D_8, E_8, F_8}, - {0, D_7, E_7, F_7}, + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, - {0, J_12, K_12, L_12}, - {0, J_11, K_11, L_11}, - {0, J_10, K_10, L_10}, - {0, J_9, K_9, L_9}, - {0, J_8, K_8, L_8}, - {0, J_7, K_7, L_7}, + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, - {0, D_6, E_6, F_6}, - {0, D_5, E_5, F_5}, - {0, D_4, E_4, F_4}, - {0, D_3, E_3, F_3}, - {0, D_2, E_2, F_2}, - {0, D_1, E_1, F_1}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, - {0, J_6, K_6, L_6}, - {0, J_5, K_5, L_5}, - {0, J_4, K_4, L_4}, - {0, J_3, K_3, L_3}, - {0, J_2, K_2, L_2}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, }; From 703699b81fa499072c17fd63795444e6ef1bfe40 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 23 Apr 2019 19:11:18 -0700 Subject: [PATCH 021/129] [Keyboard] forgot to omit k05 from the electrical matrix in hhkb layout (#5684) --- keyboards/exclusive/e6v2/bmc/bmc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/exclusive/e6v2/bmc/bmc.h b/keyboards/exclusive/e6v2/bmc/bmc.h index 06d23fbe690..44c02c8600f 100644 --- a/keyboards/exclusive/e6v2/bmc/bmc.h +++ b/keyboards/exclusive/e6v2/bmc/bmc.h @@ -72,7 +72,7 @@ k01, k02, k75, k08, k09 \ ) \ { \ - { KC_NO, k01, k02, KC_NO, KC_NO, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { KC_NO, k01, k02, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k08, k09, KC_NO }, \ { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ From 978074e4170c254a6f2cd684c9f695024a5a3e0b Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Wed, 24 Apr 2019 04:26:49 +0200 Subject: [PATCH 022/129] [Keymap] Fix broken Shift-Insert binding (#5689) --- keyboards/signum/3_0/elitec/keymaps/default/keymap.c | 2 +- keyboards/signum/3_0/elitec/keymaps/default/layout.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c index 22d60085f4c..4b3a9439d44 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c +++ b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c @@ -707,7 +707,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- */ LAYOUT_ortho_4x12( - KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), CTL_T(KC_PGDN), CTL_T(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, SFT_T(KC_INS), KC_ESC, + KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), CTL_T(KC_PGDN), CTL_T(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, LSFT(KC_INS), KC_ESC, KC_TRNS, KC_CAPS, LGUI_T(KC_LEFT), LGUI_T(KC_TAB), LGUI_T(KC_RIGHT), LGUI_T(KC_RIGHT), KC_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, KC_PSCR, KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, CTL_T(KC_PGUP), CTL_T(KC_PGUP), KC_PGUP, XXXXXXX, KC_DOWN, XXXXXXX, KC_APP, KC_TRNS, TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS diff --git a/keyboards/signum/3_0/elitec/keymaps/default/layout.py b/keyboards/signum/3_0/elitec/keymaps/default/layout.py index 323a5832126..bc744593b6d 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/layout.py +++ b/keyboards/signum/3_0/elitec/keymaps/default/layout.py @@ -348,7 +348,7 @@ qmk_dict = { ":": "S(KC_SCLN)", "'": "KC_QUOT", "\"": "S(KC_QUOT)", "`": "KC_GRV", "~": "S(KC_GRV)", ",": "KC_COMM", "<": "S(KC_COMM)", ".": "KC_DOT", ">": "S(KC_DOT)", "/": "KC_SLSH", "?": "S(KC_SLSH)", "Caps": "KC_CAPS", - "Pr Scr": "KC_PSCR", "Scr Lck": "KC_SLCK", "Pause": "KC_BRK", "Insert": "KC_INS", "SInsert": "SFT_T(KC_INS)", + "Pr Scr": "KC_PSCR", "Scr Lck": "KC_SLCK", "Pause": "KC_BRK", "Insert": "KC_INS", "SInsert": "LSFT(KC_INS)", "Home": "KC_HOME", "Pg Up": "KC_PGUP", "Del": "KC_DEL", "End": "KC_END", "Pg Down": "KC_PGDN", "> Arrow": "KC_RIGHT", "< Arrow": "KC_LEFT", "v Arrow": "KC_DOWN", "^ Arrow": "KC_UP", From 479baf98e093b83339c9c1a628d9d25d3d0ab034 Mon Sep 17 00:00:00 2001 From: Rockman18 Date: Wed, 24 Apr 2019 04:27:29 +0200 Subject: [PATCH 023/129] [FIX] Misspelled RGB_YELLOW (#5692) --- quantum/rgblight_list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/rgblight_list.h b/quantum/rgblight_list.h index 7b831338087..e024364f056 100644 --- a/quantum/rgblight_list.h +++ b/quantum/rgblight_list.h @@ -77,7 +77,7 @@ #define rgblight_setrgb_orange() rgblight_setrgb (RGB_ORANGE) #define rgblight_setrgb_goldenrod() rgblight_setrgb (RGB_GOLDENROD) #define rgblight_setrgb_gold() rgblight_setrgb (RGB_GOLD) -#define rgblight_setrgb_yellow() rgblight_setrgb (RGB_YEllOW) +#define rgblight_setrgb_yellow() rgblight_setrgb (RGB_YELLOW) #define rgblight_setrgb_chartreuse() rgblight_setrgb (RGB_CHARTREUSE) #define rgblight_setrgb_green() rgblight_setrgb (RGB_GREEN) #define rgblight_setrgb_springgreen() rgblight_setrgb (RGB_SPRINGGREEN) From dafdb5f9aee5444691c09388575b23b76bb49cb0 Mon Sep 17 00:00:00 2001 From: Bob Date: Tue, 23 Apr 2019 22:29:54 -0400 Subject: [PATCH 024/129] [Keyboard] fix project zen rev1 bootloader declaration (#5695) --- keyboards/zen/rev1/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/zen/rev1/rules.mk b/keyboards/zen/rev1/rules.mk index e69de29bb2d..58e9a76b230 100644 --- a/keyboards/zen/rev1/rules.mk +++ b/keyboards/zen/rev1/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = caterina From eda924d7dc71bd5bc229cc64dcd89a8703ed8582 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Wed, 24 Apr 2019 03:31:42 +0100 Subject: [PATCH 025/129] [Keymap] update (mouse emulation, rev 6 compatibility) (#5696) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mess with mouse emulation some more * reverse scrolling * mouse speed 20 * ndash and £ on symbol layer * rev6 compatibility --- keyboards/planck/keymaps/callum/config.h | 8 +- keyboards/planck/keymaps/callum/keymap.c | 262 ++++++++++------------- keyboards/planck/keymaps/callum/rules.mk | 1 - 3 files changed, 120 insertions(+), 151 deletions(-) diff --git a/keyboards/planck/keymaps/callum/config.h b/keyboards/planck/keymaps/callum/config.h index 49f61dee551..e66db1d7e80 100644 --- a/keyboards/planck/keymaps/callum/config.h +++ b/keyboards/planck/keymaps/callum/config.h @@ -1,7 +1,7 @@ #define MOUSEKEY_DELAY 0 #define MOUSEKEY_INTERVAL 16 -#define MOUSEKEY_MAX_SPEED 10 -#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 20 +#define MOUSEKEY_TIME_TO_MAX 100 #define MOUSEKEY_WHEEL_DELAY 0 -#define MOUSEKEY_WHEEL_MAX_SPEED 8 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 100 diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 02456aa7d8b..08d0c69b88d 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -1,4 +1,3 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" @@ -38,28 +37,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Func |Ctrl | Alt |Super|Symb |Enter|Space|Move |Super| Alt |Ctrl |Func | * `-----------------------------------------------------------------------' */ - [_COLEMAK] = { - { - KC_TAB, KC_Q, KC_W, KC_F, - KC_P, KC_G, KC_J, KC_L, - KC_U, KC_Y, KC_SCLN, KC_MINS - }, - { - 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, KC_RSFT - }, - { - FUNC, KC_LCTL, KC_LALT, KC_LGUI, - SYMB, KC_ENT, KC_SPC, MOVE, - KC_RGUI, KC_RALT, KC_RCTL, FUNC - } - }, + [_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, + KC_P, KC_G, KC_J, KC_L, + KC_U, KC_Y, KC_SCLN, KC_MINS, + + 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, KC_RSFT, + + FUNC, KC_LCTL, KC_LALT, KC_LGUI, + SYMB, KC_ENT, KC_SPC, MOVE, + KC_RGUI, KC_RALT, KC_RCTL, FUNC + ), /* QWERTY * ,-----------------------------------------------------------------------. @@ -72,96 +66,81 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Func |Ctrl | Alt |Super|Symb |Enter|Space|Move |Super| Alt |Ctrl |Func | * `-----------------------------------------------------------------------' */ - [_QWERTY] = { - { - KC_TAB, KC_Q, KC_W, KC_E, - KC_R, KC_T, KC_Y, KC_U, - KC_I, KC_O, KC_P, KC_MINS - }, - { - 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, KC_RSFT - }, - { - FUNC, KC_LCTL, KC_LALT, KC_LGUI, - SYMB, KC_ENT, KC_SPC, MOVE, - KC_RGUI, KC_RALT, KC_RCTL, FUNC - } - }, + [_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, + KC_R, KC_T, KC_Y, KC_U, + KC_I, KC_O, KC_P, KC_MINS, + + 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, KC_RSFT, + + FUNC, KC_LCTL, KC_LALT, KC_LGUI, + SYMB, KC_ENT, KC_SPC, MOVE, + KC_RGUI, KC_RALT, KC_RCTL, FUNC + ), /* SYMB * ,-----------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |ndash| * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | £ | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |Mouse| | | | | + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------' */ - [_SYMB] = { - { - KC_ESC, KC_1, KC_2, KC_3, - KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, KC_0, _______ - }, - { - KC_DEL, KC_EXLM, KC_AT, KC_HASH, - KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, - KC_ASTR, KC_LPRN, KC_RPRN, _______ - }, - { - _______, KC_TILD, KC_GRV, KC_PLUS, - KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, - KC_RBRC, KC_LCBR, KC_RCBR, _______ - }, - { - _______, _______, _______, _______, - _______, _______, _______, MOUSE, - _______, _______, _______, _______ - } - }, + [_SYMB] = LAYOUT_planck_grid( + KC_ESC, KC_1, KC_2, KC_3, + KC_4, KC_5, KC_6, KC_7, + KC_8, KC_9, KC_0, A(KC_MINS), + + KC_DEL, KC_EXLM, KC_AT, KC_HASH, + KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, + KC_ASTR, KC_LPRN, KC_RPRN, A(KC_3), + + _______, KC_TILD, KC_GRV, KC_PLUS, + KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, + KC_RBRC, KC_LCBR, KC_RCBR, _______, + + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), /* MOVE * ,-----------------------------------------------------------------------. - * | | | | | | |CtrUp|Home | Up | End |Caps | Esc | + * | | | | | | |CtrUp|Home | Up | End |Caps |Mouse| * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | |SpaL |Left |Down |Right|SpaR | Del | + * | | | | | | |CtrL |Left |Down |Right|CtrR | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * | | | | | | |CtrDn|PgDn |PgUp |TabL |TabR | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | |Mouse| | | | | | | | + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------' */ - [_MOVE] = { - { - AC(KC_A), AC(KC_B), AC(KC_C), AC(KC_D), - AC(KC_E), AC(KC_F), C(KC_UP), KC_HOME, - KC_UP, KC_END, KC_CAPS, KC_ESC - }, - { - AC(KC_G), AC(KC_H), AC(KC_I), AC(KC_J), - AC(KC_K), AC(KC_L), C(KC_LEFT), KC_LEFT, - KC_DOWN, KC_RGHT, C(KC_RIGHT), KC_DEL - }, - { - _______, AC(KC_M), AC(KC_N), AC(KC_O), - AC(KC_P), AC(KC_Q), C(KC_DOWN), KC_PGDN, - KC_PGUP, SC(KC_TAB), C(KC_TAB), _______ - }, - { - _______, _______, _______, _______, - MOUSE, _______, _______, _______, - _______, _______, _______, _______ - } - }, + [_MOVE] = LAYOUT_planck_grid( + AC(KC_A), AC(KC_B), AC(KC_C), AC(KC_D), + AC(KC_E), AC(KC_F), C(KC_UP), KC_HOME, + KC_UP, KC_END, KC_CAPS, MOUSE, + + AC(KC_G), AC(KC_H), AC(KC_I), AC(KC_J), + AC(KC_K), AC(KC_L), C(KC_LEFT), KC_LEFT, + KC_DOWN, KC_RGHT, C(KC_RIGHT), XXXXXXX, + + _______, AC(KC_M), AC(KC_N), AC(KC_O), + AC(KC_P), AC(KC_Q), C(KC_DOWN), KC_PGDN, + KC_PGUP, SC(KC_TAB), C(KC_TAB), _______, + + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), /* FUNC * ,-----------------------------------------------------------------------. @@ -169,67 +148,57 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | |Home |TabL |TabR |End | | | |Clmak|Qwrty| | + * | | | | | | | | | |Clmak|Qwrty| | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * | | | | |Prev |Mute |Play |Next | | | | | * `-----------------------------------------------------------------------' */ - [_FUNC] = { - { - RESET, KC_F1, KC_F2, KC_F3, - KC_F4, KC_F5, KC_F6, KC_F7, - KC_F8, KC_F9, KC_F10, KC_VOLU - }, - { - KC_POWER, KC_F11, KC_F12, KC_F13, - KC_F14, KC_F15, KC_F16, KC_F17, - KC_F18, KC_F19, KC_F20, KC_VOLD - }, - { - _______, XXXXXXX, KC_HOME, SC(KC_TAB), - C(KC_TAB), KC_END, XXXXXXX, XXXXXXX, - XXXXXXX, COLEMAK, QWERTY, _______ - }, - { - _______, _______, _______, _______, - KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, - _______, _______, _______, _______ - } - }, + [_FUNC] = LAYOUT_planck_grid( + RESET, KC_F1, KC_F2, KC_F3, + KC_F4, KC_F5, KC_F6, KC_F7, + KC_F8, KC_F9, KC_F10, KC_VOLU, + + KC_POWER, KC_F11, KC_F12, KC_F13, + KC_F14, KC_F15, KC_F16, KC_F17, + KC_F18, KC_F19, KC_F20, KC_VOLD, + + _______, XXXXXXX, KC_HOME, SC(KC_TAB), + C(KC_TAB), KC_END, XXXXXXX, XXXXXXX, + XXXXXXX, COLEMAK, QWERTY, _______, + + _______, _______, _______, _______, + KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, + _______, _______, _______, _______ + ), /* MOUSE * ,-----------------------------------------------------------------------. - * | | | | | | | | ScL |Up | ScR | | | + * | | |CtrL |CtrU |CtrR | B5 |CtrU | ScL |Up | ScR | | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | B4 | B3 | B2 | B1 | | |Left |Down |Right| | | + * | | | Ac0 | Ac1 | Ac2 | B4 |CtrL |Left |Down |Right|CtrR | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | Ac0 | Ac1 | Ac2 | | | ScD | ScU | | | | + * | | | |Home | End | B3 |CtrD | ScD | ScU |TabL |TabR | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | + * | | | | | | B2 | B1 | | | | | | * `-----------------------------------------------------------------------' */ - [_MOUSE] = { - { - _______, _______, C(KC_LEFT), C(KC_UP), - C(KC_RIGHT), _______, _______, KC_WH_L, - KC_MS_U, KC_WH_R, _______, _______ - }, - { - _______, KC_BTN4, KC_BTN3, KC_BTN2, - KC_BTN1, _______, _______, KC_MS_L, - KC_MS_D, KC_MS_R, _______, _______ - }, - { - _______, _______, KC_ACL0, KC_ACL1, - KC_ACL2, _______, _______, KC_WH_D, - KC_WH_U, _______, _______, _______ - }, - { - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______ - } - } + [_MOUSE] = LAYOUT_planck_grid( + _______, XXXXXXX, C(KC_LEFT), C(KC_UP), + C(KC_RIGHT), KC_BTN5, C(KC_UP), KC_WH_R, + KC_MS_U, KC_WH_L, XXXXXXX, XXXXXXX, + + _______, XXXXXXX, KC_ACL0, KC_ACL1, + KC_ACL2, KC_BTN4, C(KC_LEFT), KC_MS_L, + KC_MS_D, KC_MS_R, C(KC_RIGHT), XXXXXXX, + + _______, XXXXXXX, XXXXXXX, KC_HOME, + KC_END, KC_BTN3, C(KC_DOWN), KC_WH_U, + KC_WH_D, SC(KC_TAB), C(KC_TAB), _______, + + _______, _______, _______, _______, + _______, KC_BTN2, KC_BTN1, _______, + _______, _______, _______, _______ + ) }; #ifdef AUDIO_ENABLE @@ -267,6 +236,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; case SYMB: if (record->event.pressed) { + layer_off(_MOUSE); layer_on(_SYMB); } else { layer_off(_SYMB); @@ -274,6 +244,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; case MOVE: if (record->event.pressed) { + layer_off(_MOUSE); layer_on(_MOVE); } else { layer_off(_MOVE); @@ -281,6 +252,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; case FUNC: if (record->event.pressed) { + layer_off(_MOUSE); layer_on(_FUNC); } else { layer_off(_FUNC); @@ -289,8 +261,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case MOUSE: if (record->event.pressed) { layer_on(_MOUSE); - } else { - layer_off(_MOUSE); } return false; diff --git a/keyboards/planck/keymaps/callum/rules.mk b/keyboards/planck/keymaps/callum/rules.mk index 4774c2c4178..182322ae230 100644 --- a/keyboards/planck/keymaps/callum/rules.mk +++ b/keyboards/planck/keymaps/callum/rules.mk @@ -17,4 +17,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - From e6f4173aecaedabe3b2550340321520f45227c7f Mon Sep 17 00:00:00 2001 From: zvecr Date: Wed, 24 Apr 2019 19:13:07 +0100 Subject: [PATCH 026/129] Refactor cospad to current standards and enable support for backlight keycodes (#5582) --- keyboards/cospad/config.h | 50 ++++----- keyboards/cospad/cospad.c | 58 +++++----- keyboards/cospad/cospad.h | 126 ++++++++++++---------- keyboards/cospad/info.json | 76 ++++++++----- keyboards/cospad/keymaps/default/keymap.c | 124 +++++++++------------ keyboards/cospad/rules.mk | 43 +++++--- 6 files changed, 253 insertions(+), 224 deletions(-) diff --git a/keyboards/cospad/config.h b/keyboards/cospad/config.h index 1f7c174e6e4..b7e7ec384cc 100644 --- a/keyboards/cospad/config.h +++ b/keyboards/cospad/config.h @@ -15,8 +15,7 @@ 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 +#pragma once #include "config_common.h" @@ -32,42 +31,43 @@ along with this program. If not, see . #define MATRIX_ROWS 6 #define MATRIX_COLS 4 -// ROWS: Top to bottom, COLS: Left to right - +/* + * 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 { D0, D1, D2, D3, D4, D5 } #define MATRIX_COL_PINS { F0, F1, E6, C7 } #define UNUSED_PINS -#define BACKLIGHT_PIN F7 - /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST +/* Backlight configuration */ +#define BACKLIGHT_PIN F7 +#define BACKLIGHT_LEVELS 1 -/* Set 0 if debouncing isn't needed */ +/* Underlight configuration */ +#define RGB_DI_PIN F6 +#define RGBLED_NUM 4 +#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 -/* Backlight configuration - */ -#define BACKLIGHT_LEVELS 4 - -/* Underlight configuration - */ - -#define RGB_DI_PIN F6 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 4 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -86,4 +86,6 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#endif +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/cospad/cospad.c b/keyboards/cospad/cospad.c index 48d752a84b1..e7ef71f874b 100644 --- a/keyboards/cospad/cospad.c +++ b/keyboards/cospad/cospad.c @@ -1,37 +1,33 @@ + +/* Copyright 2019 + * + * 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 "cospad.h" -#include "led.h" -extern inline void cospad_bl_led_on(void); -extern inline void cospad_bl_led_off(void); -extern inline void cospad_bl_led_togg(void); +#ifdef BACKLIGHT_ENABLE -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<<2); - DDRF |= (1<<7); - // * Setting BL LEDs to init as off - PORTF |= (1<<7); +void backlight_init_ports(void) { + setPinOutput(F7); } -void led_set_kb(uint8_t usb_led) { - if (usb_led & (1<. + */ +#pragma once #include "quantum.h" +#define ___ KC_NO -// readability -#define XXX KC_NO +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ /* COSPAD ortho matrix layout * ,-------------------. @@ -21,40 +43,6 @@ * | 50 | 51 | 52 | 53 | * `-------------------' */ - -/* COSPAD gamepad matrix layout - * ,-------------------. - * | 00 | 01 | 02 | 03 | - * |----|----|----|----| - * | 10 | 11 | 12 | 13 | - * |----|----|----|----| - * | 20 | 21 | 22 | | - * |----|----|----| 23 | - * | 30 | 31 | 32 | | - * |----|----|----|----| - * | 40 | 41 | 42 | 43 | - * |----|----|----|----| - * | 50 | 51 | 52 | 53 | - * `-------------------' - */ - -/* COSPAD numpad matrix layout - * ,-------------------. - * | 00 | 01 | 02 | 03 | - * |----|----|----|----| - * | 10 | 11 | 12 | 13 | - * |----|----|----|----| - * | 20 | 21 | 22 | | - * |----|----|----| 23 | - * | 30 | 31 | 32 | | - * |----|----|----|----| - * | 40 | 41 | 42 | | - * |----|----|----| 43 | - * | 50 | 52 | | - * `-------------------' - */ -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array #define LAYOUT_ortho_6x4( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ @@ -72,6 +60,21 @@ {k50, k51, k52, k53} \ } +/* COSPAD gamepad matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | 13 | + * |----|----|----|----| + * | 20 | 21 | 22 | | + * |----|----|----| 23 | + * | 30 | 31 | 32 | | + * |----|----|----|----| + * | 40 | 41 | 42 | 43 | + * |----|----|----|----| + * | 50 | 51 | 52 | 53 | + * `-------------------' + */ #define LAYOUT_gamepad_6x4( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ @@ -84,11 +87,26 @@ {k00, k01, k02, k03}, \ {k10, k11, k12, k13}, \ {k20, k21, k22, k23}, \ - {k30, k31, k32, KC_NO}, \ + {k30, k31, k32, ___}, \ {k40, k41, k42, k43}, \ {k50, k51, k52, k53} \ } +/* COSPAD numpad matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | 13 | + * |----|----|----|----| + * | 20 | 21 | 22 | | + * |----|----|----| 23 | + * | 30 | 31 | 32 | | + * |----|----|----|----| + * | 40 | 41 | 42 | | + * |----|----|----| 43 | + * | 50 | 52 | | + * `-------------------' + */ #define LAYOUT_numpad_6x4( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ @@ -98,25 +116,15 @@ k50, k52, k43 \ ) \ { \ - {k00, k01, k02, k03}, \ - {k10, k11, k12, k13}, \ - {k20, k21, k22, k23}, \ - {k30, k31, k32, KC_NO}, \ - {k40, k41, k42, k43}, \ - {k50, KC_NO, k52, KC_NO} \ + {k00, k01, k02, k03}, \ + {k10, k11, k12, k13}, \ + {k20, k21, k22, k23}, \ + {k30, k31, k32, ___}, \ + {k40, k41, k42, k43}, \ + {k50, ___, k52, ___} \ } -void matrix_init_user(void); -void matrix_scan_user(void); -inline void cospad_bl_led_on(void) { PORTF &= ~(1<<7); } -inline void cospad_bl_led_off(void) { PORTF |= (1<<7); } - -inline void cospad_bl_led_togg(void) { - uint8_t bl_mask = PORTF&(1<<7); - if (bl_mask) { - PORTF &= ~(1<<7); - } else { - PORTF |= (1<<7); - } -} -#endif +// Add backwards compatibility for existing keymaps +#define cospad_bl_led_on backlight_enable +#define cospad_bl_led_off backlight_disable +#define cospad_bl_led_togg backlight_toggle diff --git a/keyboards/cospad/info.json b/keyboards/cospad/info.json index b34013a47af..c17f44f5259 100644 --- a/keyboards/cospad/info.json +++ b/keyboards/cospad/info.json @@ -7,6 +7,7 @@ "height": 6, "layouts": { "LAYOUT_numpad_6x4": { + "key_count": 21, "layout": [ {"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, @@ -33,35 +34,62 @@ }, "LAYOUT_gamepad_6x4": { + "key_count": 23, "layout": [ - {"label":"k00", "x":5, "y":0}, - {"label":"k01", "x":5, "y":1}, - {"label":"k02", "x":5, "y":2}, - {"label":"k03", "x":5, "y":3}, - {"label":"k10", "x":4, "y":0}, - {"label":"k11", "x":4, "y":1}, - {"label":"k12", "x":4, "y":2}, - {"label":"k13", "x":4, "y":3}, - {"label":"k20", "x":3, "y":0}, - {"label":"k21", "x":3, "y":1}, - {"label":"k22", "x":3, "y":2}, - {"label":"k30", "x":2, "y":0}, - {"label":"k31", "x":2, "y":1}, - {"label":"k32", "x":2, "y":2}, - {"label":"k23", "x":2, "y":3, "w":2}, - {"label":"k40", "x":1, "y":0}, - {"label":"k41", "x":1, "y":1}, - {"label":"k42", "x":1, "y":2}, - {"label":"k43", "x":1, "y":3}, - {"label":"k50", "x":0, "y":0}, - {"label":"k51", "x":0, "y":1}, - {"label":"k52", "x":0, "y":2}, - {"label":"k53", "x":0, "y":3} + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k23", "x":3, "y":2, "h":2}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k50", "x":0, "y":5}, + {"label":"k51", "x":1, "y":5}, + {"label":"k52", "x":2, "y":5}, + {"label":"k53", "x":3, "y":5} ] }, "LAYOUT_ortho_6x4": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"x":3, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}, {"label":"0", "x":0, "y":5}, {"x":1, "y":5}, {"label":".", "x":2, "y":5}, {"x":3, "y":5}] + "key_count": 24, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k50", "x":0, "y":5}, + {"label":"k51", "x":1, "y":5}, + {"label":"k52", "x":2, "y":5}, + {"label":"k53", "x":3, "y":5} + ] } } } diff --git a/keyboards/cospad/keymaps/default/keymap.c b/keyboards/cospad/keymaps/default/keymap.c index 345e9699624..adcca112d23 100644 --- a/keyboards/cospad/keymaps/default/keymap.c +++ b/keyboards/cospad/keymaps/default/keymap.c @@ -1,80 +1,60 @@ #include QMK_KEYBOARD_H -#include "led.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 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: (Base Layer) Default Layer - * ,-------------------. - * |Esc |TAB | FN | BS | - * |----|----|----|----| - * | NL | / | * | - | - * |----|----|----|----| - * | 7 | 8 | 9 | | - * |----|----|----| + | - * | 4 | 5 | 6 | | - * |----|----|----|----| - * | 1 | 2 | 3 | | - * |----|----|----| En | - * | 0 | . | | - * `-------------------' - */ - -[_BL] = LAYOUT_numpad_6x4( - KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \ - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, \ - KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_P1, KC_P2, KC_P3, \ - KC_P0, KC_PDOT, KC_PENT), - - /* Keymap _FL: Function Layer - * ,-------------------. - * |RGBT|TAB | FN | BS | - * |----|----|----|----| - * |RGBM|RGBP|BTOG| - | - * |----|----|----|----| - * |HUD |HUI |BON | | - * |----|----|----| + | - * |SAD |SAI |BOFF| | - * |----|----|----|----| - * |VAD |VAS | 3 | | - * |----|----|----| En | - * | 0 |RST | | - * `-------------------' - */ -[_FL] = LAYOUT_numpad_6x4( - RGB_TOG, KC_TAB, KC_TRNS, KC_BSPC, \ - RGB_MOD, RGB_M_P, BL_TOGG, KC_PMNS, \ - RGB_HUD, RGB_HUI, BL_ON, \ - RGB_SAD, RGB_SAI, BL_OFF, KC_PPLS, \ - RGB_VAD, RGB_VAI, KC_P3, \ - KC_P0, RESET, KC_PENT), +enum layers { + _BL = 0, + _FL }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case BL_TOGG: - if (record->event.pressed) { - cospad_bl_led_togg(); - } - return false; - case BL_ON: - if (record->event.pressed) { - cospad_bl_led_on(); - } - return false; - case BL_OFF: - if(record->event.pressed) { - cospad_bl_led_off(); - } - return false; - default: - return true; - } -} +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap _BL: (Base Layer) Default Layer + * ,-------------------. + * |Esc |TAB | FN | BS | + * |----|----|----|----| + * | NL | / | * | - | + * |----|----|----|----| + * | 7 | 8 | 9 | | + * |----|----|----| + | + * | 4 | 5 | 6 | | + * |----|----|----|----| + * | 1 | 2 | 3 | | + * |----|----|----| En | + * | 0 | . | | + * `-------------------' + */ + [_BL] = LAYOUT_numpad_6x4( + KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT + ), + +/* Keymap _FL: Function Layer + * ,-------------------. + * |RGBT| | | | + * |----|----|----|----| + * |RGBM|RGBP|BTOG| | + * |----|----|----|----| + * |HUD |HUI |BON | | + * |----|----|----| | + * |SAD |SAI |BOFF| | + * |----|----|----|----| + * |VAD |VAS |BSTP| | + * |----|----|----| | + * | |RST | | + * `-------------------' + */ + [_FL] = LAYOUT_numpad_6x4( + RGB_TOG, _______, _______, _______, \ + RGB_MOD, RGB_M_P, BL_TOGG, _______, \ + RGB_HUD, RGB_HUI, BL_ON, \ + RGB_SAD, RGB_SAI, BL_OFF, _______, \ + RGB_VAD, RGB_VAI, BL_STEP, \ + _______, RESET, _______ + ), +}; diff --git a/keyboards/cospad/rules.mk b/keyboards/cospad/rules.mk index 3c5913d0d91..61c7a5182ce 100644 --- a/keyboards/cospad/rules.mk +++ b/keyboards/cospad/rules.mk @@ -1,6 +1,5 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -40,27 +39,43 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + # 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 +# 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 = yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE = no # 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 +BOOTMAGIC_ENABLE = lite # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BACKLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + + +LAYOUTS = numpad_6x4 ortho_6x4 From 5312131d35ee389231bfc596625ac5915264cc16 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Wed, 24 Apr 2019 02:38:54 +0900 Subject: [PATCH 027/129] add RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; to eeconfig_update_rgblight_default() --- quantum/rgblight.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 5ec11bc0777..0b90b79eaf6 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -38,11 +38,13 @@ /* for split keyboard */ #define RGBLIGHT_SPLIT_SET_CHANGE_MODE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_MODE #define RGBLIGHT_SPLIT_SET_CHANGE_HSVS rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_HSVS + #define RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS rgblight_status.change_flags |= (RGBLIGHT_STATUS_CHANGE_MODE|RGBLIGHT_STATUS_CHANGE_HSVS) #define RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_TIMER #define RGBLIGHT_SPLIT_ANIMATION_TICK rgblight_status.change_flags |= RGBLIGHT_STATUS_ANIMATION_TICK #else #define RGBLIGHT_SPLIT_SET_CHANGE_MODE #define RGBLIGHT_SPLIT_SET_CHANGE_HSVS + #define RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS #define RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE #define RGBLIGHT_SPLIT_ANIMATION_TICK #endif @@ -221,6 +223,7 @@ void eeconfig_update_rgblight_default(void) { rgblight_config.sat = 255; rgblight_config.val = RGBLIGHT_LIMIT_VAL; rgblight_config.speed = 0; + RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; eeconfig_update_rgblight(rgblight_config.raw); } @@ -249,7 +252,7 @@ void rgblight_init(void) { eeconfig_update_rgblight_default(); } rgblight_config.raw = eeconfig_read_rgblight(); - RGBLIGHT_SPLIT_SET_CHANGE_HSVS; + RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; if (!rgblight_config.mode) { dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); eeconfig_update_rgblight_default(); From 9f8c8c53a51ec6bb8acd55683b1d024558b071ab Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Wed, 24 Apr 2019 02:43:44 +0900 Subject: [PATCH 028/129] add RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; to rgblight_update_dword() --- quantum/rgblight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 0b90b79eaf6..2f23768ed7f 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -279,6 +279,7 @@ uint32_t rgblight_read_dword(void) { } void rgblight_update_dword(uint32_t dword) { + RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; rgblight_config.raw = dword; if (rgblight_config.enable) rgblight_mode_noeeprom(rgblight_config.mode); From 9c98fef4f6d35d9e07865b119550f6e7e9e6610d Mon Sep 17 00:00:00 2001 From: skullY Date: Thu, 25 Apr 2019 10:29:12 -0700 Subject: [PATCH 029/129] test commit From 4322c7177168c6622a891bfb14ad4c969e3f8be9 Mon Sep 17 00:00:00 2001 From: kit-bto <42862131+kit-bto@users.noreply.github.com> Date: Fri, 26 Apr 2019 15:11:21 +0900 Subject: [PATCH 030/129] [Keyboard] Add a new keyboard ADKB96 (#5685) * New Keyboard ADKB96 http://bit-trade-one.co.jp/selfmadekb/adkb96/ * New Keyboard ADKB96 http://bit-trade-one.co.jp/selfmadekb/adkb96/ * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Rename Readme.md to readme.md * Update keyboards/adkb96/adkb96.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update readme.md * Update readme.md * Update keyboards/adkb96/adkb96.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/adkb96.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keymap.c * Update keyboards/adkb96/rev1/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/rev1/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update config.h * Update keyboards/adkb96/rev1/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/rev1/rev1.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/rev1/rev1.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/rev1/rev1.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update rules.mk * Delete rules.mk * Update rules.mk * Update keyboards/adkb96/rules.mk Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/rules.mk Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/rev1/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update config.h * Update rules.mk * Update config.h * Delete i2c.c * Delete i2c.h * Delete matrix.c * Delete serial.c * Delete serial.h * Delete split_util.c * Delete split_util.h * Update keymap.c * Update keymap.c * Update keymap.c * Update keymap.c * Update rev1.c * Update keyboards/adkb96/rev1/config.h Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update keyboards/adkb96/rules.mk Co-Authored-By: kit-bto <42862131+kit-bto@users.noreply.github.com> * Update rev1.h --- keyboards/adkb96/adkb96.c | 19 + keyboards/adkb96/adkb96.h | 28 ++ keyboards/adkb96/config.h | 22 + keyboards/adkb96/info.json | 494 ++++++++++++++++++++++ keyboards/adkb96/keymaps/default/config.h | 34 ++ keyboards/adkb96/keymaps/default/keymap.c | 15 + keyboards/adkb96/readme.md | 17 + keyboards/adkb96/rev1/config.h | 78 ++++ keyboards/adkb96/rev1/rev1.c | 15 + keyboards/adkb96/rev1/rev1.h | 44 ++ keyboards/adkb96/rules.mk | 78 ++++ 11 files changed, 844 insertions(+) create mode 100644 keyboards/adkb96/adkb96.c create mode 100644 keyboards/adkb96/adkb96.h create mode 100644 keyboards/adkb96/config.h create mode 100644 keyboards/adkb96/info.json create mode 100644 keyboards/adkb96/keymaps/default/config.h create mode 100644 keyboards/adkb96/keymaps/default/keymap.c create mode 100644 keyboards/adkb96/readme.md create mode 100644 keyboards/adkb96/rev1/config.h create mode 100644 keyboards/adkb96/rev1/rev1.c create mode 100644 keyboards/adkb96/rev1/rev1.h create mode 100644 keyboards/adkb96/rules.mk diff --git a/keyboards/adkb96/adkb96.c b/keyboards/adkb96/adkb96.c new file mode 100644 index 00000000000..9a1c85a2ce4 --- /dev/null +++ b/keyboards/adkb96/adkb96.c @@ -0,0 +1,19 @@ +#include "adkb96.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}, {7, 6}}, + {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}, {7, 7}}, + {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}, {6, 8}, {7, 8}}, + {{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}, {5, 9}, {6, 9}, {7, 9}}, + {{0,10}, {1,10}, {2,10}, {3,10}, {4,10}, {5,10}, {6,10}, {7,10}}, + {{0,11}, {1,11}, {2,11}, {3,11}, {4,11}, {5,11}, {6,11}, {7,11}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}, {7, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}, {7, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}, {7, 3}}, + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {6, 4}, {7, 4}}, + {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}, {7, 5}} +}; +#endif diff --git a/keyboards/adkb96/adkb96.h b/keyboards/adkb96/adkb96.h new file mode 100644 index 00000000000..4b28775006d --- /dev/null +++ b/keyboards/adkb96/adkb96.h @@ -0,0 +1,28 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_adkb96_rev1 + #include "rev1.h" +#endif + + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc_ortho_6x16( \ + L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \ + L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47, \ + L50, L51, L52, L53, L54, L55, L56, L57, R50, R51, R52, R53, R54, R55, R56, R57 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##L07, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, KC_##R07, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##L17, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, KC_##R17, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, KC_##R27, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, KC_##R37, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##L47, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46, KC_##R47, \ + KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, KC_##L56, KC_##L57, KC_##R50, KC_##R51, KC_##R52, KC_##R53, KC_##R54, KC_##R55, KC_##R56 ,KC_##R57 \ + ) + +#define LAYOUT_kc LAYOUT_kc_ortho_6x16 diff --git a/keyboards/adkb96/config.h b/keyboards/adkb96/config.h new file mode 100644 index 00000000000..93fd2261b18 --- /dev/null +++ b/keyboards/adkb96/config.h @@ -0,0 +1,22 @@ +/* +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 . +*/ + +#pragma once + +#include "config_common.h" + diff --git a/keyboards/adkb96/info.json b/keyboards/adkb96/info.json new file mode 100644 index 00000000000..3b914d56b17 --- /dev/null +++ b/keyboards/adkb96/info.json @@ -0,0 +1,494 @@ +{ + "keyboard_name": "adkb96", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT_ortho_6x16": { + "key_count": 96, + "layout": [ + { + "label": "L00", + "x": 0, + "y": 0 + }, + { + "label": "L01", + "x": 1, + "y": 0 + }, + { + "label": "L02", + "x": 2, + "y": 0 + }, + { + "label": "L03", + "x": 3, + "y": 0 + }, + { + "label": "L04", + "x": 4, + "y": 0 + }, + { + "label": "L05", + "x": 5, + "y": 0 + }, + { + "label": "L06", + "x": 6, + "y": 0 + }, + { + "label": "L07", + "x": 7, + "y": 0 + }, + { + "label": "R00", + "x": 8, + "y": 0 + }, + { + "label": "R01", + "x": 9, + "y": 0 + }, + { + "label": "R02", + "x": 10, + "y": 0 + }, + { + "label": "R03", + "x": 11, + "y": 0 + }, + { + "label": "R04", + "x": 12, + "y": 0 + }, + { + "label": "R05", + "x": 13, + "y": 0 + }, + { + "label": "R06", + "x": 14, + "y": 0 + }, + { + "label": "R07", + "x": 15, + "y": 0 + }, + { + "label": "L10", + "x": 0, + "y": 1 + }, + { + "label": "L11", + "x": 1, + "y": 1 + }, + { + "label": "L12", + "x": 2, + "y": 1 + }, + { + "label": "L13", + "x": 3, + "y": 1 + }, + { + "label": "L14", + "x": 4, + "y": 1 + }, + { + "label": "L15", + "x": 5, + "y": 1 + }, + { + "label": "L16", + "x": 6, + "y": 1 + }, + { + "label": "L17", + "x": 7, + "y": 1 + }, + { + "label": "R10", + "x": 8, + "y": 1 + }, + { + "label": "R11", + "x": 9, + "y": 1 + }, + { + "label": "R12", + "x": 10, + "y": 1 + }, + { + "label": "R13", + "x": 11, + "y": 1 + }, + { + "label": "R14", + "x": 12, + "y": 1 + }, + { + "label": "R15", + "x": 13, + "y": 1 + }, + { + "label": "R16", + "x": 14, + "y": 1 + }, + { + "label": "R17", + "x": 15, + "y": 1 + }, + { + "label": "L20", + "x": 0, + "y": 2 + }, + { + "label": "L21", + "x": 1, + "y": 2 + }, + { + "label": "L22", + "x": 2, + "y": 2 + }, + { + "label": "L23", + "x": 3, + "y": 2 + }, + { + "label": "L24", + "x": 4, + "y": 2 + }, + { + "label": "L25", + "x": 5, + "y": 2 + }, + { + "label": "L26", + "x": 6, + "y": 2 + }, + { + "label": "L27", + "x": 7, + "y": 2 + }, + { + "label": "R20", + "x": 8, + "y": 2 + }, + { + "label": "R21", + "x": 9, + "y": 2 + }, + { + "label": "R22", + "x": 10, + "y": 2 + }, + { + "label": "R23", + "x": 11, + "y": 2 + }, + { + "label": "R24", + "x": 12, + "y": 2 + }, + { + "label": "R25", + "x": 13, + "y": 2 + }, + { + "label": "R26", + "x": 14, + "y": 2 + }, + { + "label": "R27", + "x": 15, + "y": 2 + }, + { + "label": "L30", + "x": 0, + "y": 3 + }, + { + "label": "L31", + "x": 1, + "y": 3 + }, + { + "label": "L32", + "x": 2, + "y": 3 + }, + { + "label": "L33", + "x": 3, + "y": 3 + }, + { + "label": "L34", + "x": 4, + "y": 3 + }, + { + "label": "L35", + "x": 5, + "y": 3 + }, + { + "label": "L36", + "x": 6, + "y": 3 + }, + { + "label": "L37", + "x": 7, + "y": 3 + }, + { + "label": "R30", + "x": 8, + "y": 3 + }, + { + "label": "R31", + "x": 9, + "y": 3 + }, + { + "label": "R32", + "x": 10, + "y": 3 + }, + { + "label": "R33", + "x": 11, + "y": 3 + }, + { + "label": "R34", + "x": 12, + "y": 3 + }, + { + "label": "R35", + "x": 13, + "y": 3 + }, + { + "label": "R36", + "x": 14, + "y": 3 + }, + { + "label": "R37", + "x": 15, + "y": 3 + }, + { + "label": "L40", + "x": 0, + "y": 4 + }, + { + "label": "L41", + "x": 1, + "y": 4 + }, + { + "label": "L42", + "x": 2, + "y": 4 + }, + { + "label": "L43", + "x": 3, + "y": 4 + }, + { + "label": "L44", + "x": 4, + "y": 4 + }, + { + "label": "L45", + "x": 5, + "y": 4 + }, + { + "label": "L46", + "x": 6, + "y": 4 + }, + { + "label": "L47", + "x": 7, + "y": 4 + }, + { + "label": "R40", + "x": 8, + "y": 4 + }, + { + "label": "R41", + "x": 9, + "y": 4 + }, + { + "label": "R42", + "x": 10, + "y": 4 + }, + { + "label": "R43", + "x": 11, + "y": 4 + }, + { + "label": "R44", + "x": 12, + "y": 4 + }, + { + "label": "R45", + "x": 13, + "y": 4 + }, + { + "label": "R46", + "x": 14, + "y": 4 + }, + { + "label": "R47", + "x": 15, + "y": 4 + }, + { + "label": "L50", + "x": 0, + "y": 5 + }, + { + "label": "L51", + "x": 1, + "y": 5 + }, + { + "label": "L52", + "x": 2, + "y": 5 + }, + { + "label": "L53", + "x": 3, + "y": 5 + }, + { + "label": "L54", + "x": 4, + "y": 5 + }, + { + "label": "L55", + "x": 5, + "y": 5 + }, + { + "label": "L56", + "x": 6, + "y": 5 + }, + { + "label": "L57", + "x": 7, + "y": 5 + }, + { + "label": "R50", + "x": 8, + "y": 5 + }, + { + "label": "R51", + "x": 9, + "y": 5 + }, + { + "label": "R52", + "x": 10, + "y": 5 + }, + { + "label": "R53", + "x": 11, + "y": 5 + }, + { + "label": "R54", + "x": 12, + "y": 5 + }, + { + "label": "R55", + "x": 13, + "y": 5 + }, + { + "label": "R56", + "x": 14, + "y": 5 + }, + { + "label": "R57", + "x": 15, + "y": 5 + } + ] + } + } +} \ No newline at end of file diff --git a/keyboards/adkb96/keymaps/default/config.h b/keyboards/adkb96/keymaps/default/config.h new file mode 100644 index 00000000000..bef279a6d03 --- /dev/null +++ b/keyboards/adkb96/keymaps/default/config.h @@ -0,0 +1,34 @@ +/* +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 . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +//#define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define FORCE_NKRO diff --git a/keyboards/adkb96/keymaps/default/keymap.c b/keyboards/adkb96/keymaps/default/keymap.c new file mode 100644 index 00000000000..c8198ab3359 --- /dev/null +++ b/keyboards/adkb96/keymaps/default/keymap.c @@ -0,0 +1,15 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, XXXXXXX,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_DELT, + KC_ZKHK,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_JYEN,KC_BSPC,KC_BSPC, + KC_TAB, 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_ENT, KC_ENT, + KC_CAPS,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_BSLS,KC_ENT, KC_ENT, + KC_LSFT,KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RO, KC_UP, KC_RSFT,KC_RSFT, + KC_LCTL,KC_LALT,KC_LGUI,KC_MHEN,KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_HENK,KC_KANA,KC_RALT,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT,XXXXXXX + ) +}; diff --git a/keyboards/adkb96/readme.md b/keyboards/adkb96/readme.md new file mode 100644 index 00000000000..fa5187966bb --- /dev/null +++ b/keyboards/adkb96/readme.md @@ -0,0 +1,17 @@ +# ADKB96 + +![ADKB96](http://btoshop.jp/wp-content/uploads/sites/3/2019/04/ADKB96_ALL.png) + +A 16x6 ortholinear keyboard kit made and sold by Bit Trade One Ltd. [More info on Web](http://bit-trade-one.co.jp/selfmadekb/adkb96/) + +Keyboard Maintainer: [Bit Trade One Ltd.](http://bit-trade-one.co.jp/) +Hardware Supported: ADKB96 PCB, Pro Micro +Hardware Availability: [PCB & case Data](https://github.com/bit-trade-one/ADKB96-hardware), [BTOS Shop](http://btoshop.jp/2019/04/11/4562469772424/) + +Make example for this keyboard (after setting up your build environment): + +```sh + make adkb96/rev1:default +``` + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/adkb96/rev1/config.h b/keyboards/adkb96/rev1/config.h new file mode 100644 index 00000000000..8bdacb4cb30 --- /dev/null +++ b/keyboards/adkb96/rev1/config.h @@ -0,0 +1,78 @@ +/* +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 . +*/ + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x00a5 +#define PRODUCT_ID 0xad96 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Bit Trade One +#define PRODUCT ADKB96 +#define DESCRIPTION + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 8 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } + +#define SOFT_SERIAL_PIN D0 + +/* define tapping term */ +#define TAPPING_TERM 100 + +/* 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 + +/* ws2812 RGB LED */ +/* +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 12 // Number of LEDs +*/ +/* + * 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 + diff --git a/keyboards/adkb96/rev1/rev1.c b/keyboards/adkb96/rev1/rev1.c new file mode 100644 index 00000000000..872a7e08ff0 --- /dev/null +++ b/keyboards/adkb96/rev1/rev1.c @@ -0,0 +1,15 @@ +#include "adkb96.h" + +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/adkb96/rev1/rev1.h b/keyboards/adkb96/rev1/rev1.h new file mode 100644 index 00000000000..0ec70c5d5c9 --- /dev/null +++ b/keyboards/adkb96/rev1/rev1.h @@ -0,0 +1,44 @@ +#pragma once + +#include "adkb96.h" + +//void promicro_bootloader_jmp(bool program); + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT_ortho_6x16( \ + L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \ + L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47, \ + L50, L51, L52, L53, L54, L55, L56, L57, R50, R51, R52, R53, R54, R55, R56, R57 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07 }, \ + { L10, L11, L12, L13, L14, L15, L16, L17 }, \ + { L20, L21, L22, L23, L24, L25, L26, L27 }, \ + { L30, L31, L32, L33, L34, L35, L36, L37 }, \ + { L40, L41, L42, L43, L44, L45, L46, L47 }, \ + { L50, L51, L52, L53, L54, L55, L56, L57 }, \ + { R00, R01, R02, R03, R04, R05, R06, R07 }, \ + { R10, R11, R12, R13, R14, R15, R16, R17 }, \ + { R20, R21, R22, R23, R24, R25, R26, R27 }, \ + { R30, R31, R32, R33, R34, R35, R36, R37 }, \ + { R40, R41, R42, R43, R44, R45, R46, R47 }, \ + { R50, R51, R52, R53, R54, R55, R56, R57 } \ + } + +#define LAYOUT LAYOUT_ortho_6x16 + diff --git a/keyboards/adkb96/rules.mk b/keyboards/adkb96/rules.mk new file mode 100644 index 00000000000..04986eb6788 --- /dev/null +++ b/keyboards/adkb96/rules.mk @@ -0,0 +1,78 @@ +# 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 + + # Bootloader selection + # Teensy halfkay + # Pro Micro caterina + # Atmel DFU atmel-dfu + # LUFA DFU lufa-dfu + # QMK DFU qmk-dfu + # atmega32a bootloadHID +BOOTLOADER = caterina + +# 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 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 = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = adkb96/rev1 From 5c302fad215f4488e6f4f0bb5d7088f573fe0d56 Mon Sep 17 00:00:00 2001 From: moyi4681 Date: Fri, 26 Apr 2019 21:54:44 +0800 Subject: [PATCH 031/129] Update rules.mk (#5710) --- keyboards/dztech/dz60rgb/rules.mk | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/keyboards/dztech/dz60rgb/rules.mk b/keyboards/dztech/dz60rgb/rules.mk index cf89c4949ea..98e95c88dfe 100644 --- a/keyboards/dztech/dz60rgb/rules.mk +++ b/keyboards/dztech/dz60rgb/rules.mk @@ -33,17 +33,10 @@ USE_FPU = yes # OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 OPT_DEFS = -# Do not put the microcontroller into power saving mode -# when we get USB suspend event. We want it to keep updating -# backlight effects. -OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave -# Build Options -# comment out to disable the options. -# + BACKLIGHT_ENABLE = no BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = yes # Mouse keys From f0599542eae4e2a7423d4a3786e15a0b6664021d Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 26 Apr 2019 06:55:27 -0700 Subject: [PATCH 032/129] QMK Configurator support for the emptystring studio NQG (#5711) * NQG Configurator support * Fix line break in readme file --- keyboards/emptystring/NQG/info.json | 50 +++++++++++++++++++++++++++++ keyboards/emptystring/NQG/readme.md | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 keyboards/emptystring/NQG/info.json diff --git a/keyboards/emptystring/NQG/info.json b/keyboards/emptystring/NQG/info.json new file mode 100644 index 00000000000..008dbbe98d9 --- /dev/null +++ b/keyboards/emptystring/NQG/info.json @@ -0,0 +1,50 @@ +{ + "keyboard_name": "NQG (Not Quite Gherkin)", + "url": "", + "maintainer": "culturalsnow", + "width": 11, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"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":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"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":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":"; '", "x":10, "y":1}, + {"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":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"/ Enter", "x":10, "y":2}, + {"label":"Shift / Tab", "x":0, "y":2}, + {"label":"LT(_LOWER, KC_ESC)", "x":3, "y":3}, + {"label":"Ctrl / Backspace", "x":4, "y":3}, + {"label":"Ctrl / Backspace", "x":5, "y":3}, + {"label":"Space", "x":6, "y":3}, + {"label":"Space", "x":7, "y":3}, + {"label":"MO(_RAISE)", "x":8, "y":3} + ] + } + } +} diff --git a/keyboards/emptystring/NQG/readme.md b/keyboards/emptystring/NQG/readme.md index a8c89986342..5e78420e2b0 100644 --- a/keyboards/emptystring/NQG/readme.md +++ b/keyboards/emptystring/NQG/readme.md @@ -4,7 +4,7 @@ NQG (Not Quite Gherkin) is a 30% ortholinear keyboard with a macro key and dedicated row for thumb keys, made by emptystring studio. -Keyboard Maintainer: [Culturalsnow](http://github.com/culturalsnow) +Keyboard Maintainer: [Culturalsnow](http://github.com/culturalsnow) Hardware Supported: NQG PCB, Pro Micro Hardware Availability: Kits are available from [SA_EndlessGame](http://twitter.com/SA_EndlessGame) From 6caaf69357504299cc8c8f44414581d87fbec0b4 Mon Sep 17 00:00:00 2001 From: jotix <47826561+jotix@users.noreply.github.com> Date: Fri, 26 Apr 2019 15:02:19 -0300 Subject: [PATCH 033/129] jotix ortho_4x12 keymap tweakings (#5715) --- layouts/community/ortho_4x12/jotix/keymap.c | 14 +++++++------- layouts/community/ortho_4x12/jotix/readme.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/layouts/community/ortho_4x12/jotix/keymap.c b/layouts/community/ortho_4x12/jotix/keymap.c index 02fc79ec7fd..12aa5ea88af 100644 --- a/layouts/community/ortho_4x12/jotix/keymap.c +++ b/layouts/community/ortho_4x12/jotix/keymap.c @@ -28,14 +28,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | lshift | Z | X | C | V | B | N | M | , | . | / | enter | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | lctrl | lgui | lalt | ralt | lower | space | space | raise | left | down | up | right | + * | lctrl | lalt | ralt | lgui | lower | space | space | raise | left | down | up | right | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ */ [_QWERTY] = LAYOUT_ortho_4x12 ( 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, - KC_LCTL, KC_LGUI, KC_LALT, KC_RALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + KC_LCTL, KC_LALT, KC_RALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | | - | = | [ | ] | \ | | | | | | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | vol- | mute | vol+ | | | | | | | | | + * | | _ | + | { | } | | | | | | | | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | | | | | | | | | | | | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_ortho_4x12 ( 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_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, _______, _______, _______, - _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | del | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | | F7 | F8 | F9 | F10 | F11 | F12 | _ | + | { | } | | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ @@ -69,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_RAISE] = LAYOUT_ortho_4x12 ( 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_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, 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_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END ), @@ -78,7 +78,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ortho_4x12 ( _______, RESET, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, + _______, _______, _______, KC_CAPS, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; diff --git a/layouts/community/ortho_4x12/jotix/readme.md b/layouts/community/ortho_4x12/jotix/readme.md index 11af9ed1ee8..dafc22ecfe3 100644 --- a/layouts/community/ortho_4x12/jotix/readme.md +++ b/layouts/community/ortho_4x12/jotix/readme.md @@ -1,6 +1,6 @@ # Jotix ortho 4x12 keymap -![keymap](https://i.imgur.com/1NxoqW6.png) +![keymap](https://i.imgur.com/aQQo4eb.jpg) Tested on: From 90cd383d4622b7d4603e05ad101916df47775d7c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 26 Apr 2019 11:03:51 -0700 Subject: [PATCH 034/129] Fix wakeup function on ChibiOS (#5707) Somebody was a very, very bad boy, and did a poor job of copy-pasting --- tmk_core/common/chibios/suspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 4a119ccefee..6027d69b78e 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c @@ -82,7 +82,7 @@ void suspend_wakeup_init_user(void) { } */ __attribute__ ((weak)) void suspend_wakeup_init_kb(void) { - suspend_power_down_user(); + suspend_wakeup_init_user(); } /** \brief suspend wakeup condition From ffd10d41168a7bf3eb2631490c61fb7a552fa6a6 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 26 Apr 2019 11:21:40 -0700 Subject: [PATCH 035/129] [Keyboard] Eagle/Viper V2 Cleanups (#5709) * cleanup matrix of unused row and column, and add more documentation * update matrix notes * update readmes * update readmes * fix comments E2 to E3 --- keyboards/duck/eagle_viper/readme.md | 6 +-- keyboards/duck/eagle_viper/v2/matrix.c | 60 ++++++++++++------------- keyboards/duck/eagle_viper/v2/readme.md | 2 +- 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/keyboards/duck/eagle_viper/readme.md b/keyboards/duck/eagle_viper/readme.md index 3fec11bc0a8..63623940bec 100644 --- a/keyboards/duck/eagle_viper/readme.md +++ b/keyboards/duck/eagle_viper/readme.md @@ -2,10 +2,6 @@ Non official firmware for custom Korean keyboard with 60% key layout made by Duck. -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) 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 duck/eagle_viper/v2:default +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/duck/eagle_viper/v2/matrix.c b/keyboards/duck/eagle_viper/v2/matrix.c index a6bc5634225..b705ae49ff3 100644 --- a/keyboards/duck/eagle_viper/v2/matrix.c +++ b/keyboards/duck/eagle_viper/v2/matrix.c @@ -123,31 +123,27 @@ void matrix_print(void) { } } -/* Row pin configuration - * row: 0 1 2 3 4 5 - * pin: PB7 PD0 PD1 PD2 PD3 PD5 +/* Row pin configuration - diode connected + * row: 0 1 2 3 4 + * pin: PD0 PD1 PD2 PD3 PD5 * - * Esc uses its own pin PE2 + * Caps Lock uses its own pin PE2 on the column pin, row pin is grounded */ static void init_rows(void) { DDRD &= ~0b00101111; PORTD &= ~0b00101111; - DDRB &= ~0b10000000; - PORTB &= ~0b10000000; - DDRE &= ~0b00000100; PORTE |= 0b00000100; } static uint8_t read_rows(uint8_t col) { - return (PIND&(1<<0) ? (1<<0) : 0) | + return (PIND&(1<<0) ? (1<<0) : 0) | (PIND&(1<<1) ? (1<<1) : 0) | (PIND&(1<<2) ? (1<<2) : 0) | (PIND&(1<<3) ? (1<<3) : 0) | (PIND&(1<<5) ? (1<<4) : 0) | - (PINB&(1<<7) ? (1<<5) : 0) | (col==0 ? ((PINE&(1<<2) ? 0 : (1<<2))) : 0); } @@ -158,24 +154,31 @@ uint8_t read_fwkey(void) } /* Columns 0 - 15 + * + * atmega32u4 decoder pin + * PC6 U1 E3 + * PB6 U2 E3 + * PF0 U1, U2 A0 + * PF1 U1, U2 A1 + * PC7 U1, U2 A2 + * * These columns uses two 74HC237D 3 to 8 bit demultiplexers. - * col / pin: PC6 PB6 PF0 PF1 PC7 - * 0: 1 0 0 0 0 - * 1: 1 0 1 0 0 - * 2: 1 0 0 1 0 - * 3: 1 0 1 1 0 - * 4: 1 0 0 0 1 - * 5: 1 0 1 0 1 - * 6: 1 0 0 1 1 - * 7: 1 0 1 1 1 - * 8: 0 1 0 0 0 - * 9: 0 1 1 0 0 - * 10: 0 1 0 1 0 - * 11: 0 1 1 1 0 - * 12: 0 1 0 0 1 - * 13: 0 1 1 0 1 - * 14: 0 1 0 1 1 - * 15: 0 1 1 1 1 + * col / pin: PC6 PB6 PF0 PF1 PC7 Decoder Pin + * 0: 1 0 0 0 0 U1 Y0 + * 1: 1 0 1 0 0 U1 Y1 + * 2: 1 0 0 1 0 U1 Y2 + * 3: 1 0 1 1 0 U1 Y3 + * 4: 1 0 0 0 1 U1 Y4 + * 5: 1 0 1 0 1 U1 Y5 + * 6: 1 0 0 1 1 U1 Y6 + * 7: 1 0 1 1 1 U1 Y7 + * 8: 0 1 0 0 0 U2 Y0 + * 9: 0 1 1 0 0 U2 Y1 + * 10: 0 1 0 1 0 U2 Y2 + * 11: 0 1 1 1 0 U2 Y3 + * 12: 0 1 0 0 1 U2 Y4 + * 13: 0 1 1 0 1 U2 Y5 + * 14: 0 1 0 1 1 U2 Y6 * */ static void unselect_cols(void) { @@ -251,10 +254,5 @@ static void select_col(uint8_t col) { PORTF |= 0b00000010; PORTC |= 0b10000000; break; - case 15: - PORTB |= 0b01000000; - PORTF |= 0b00000011; - PORTC |= 0b10000000; - break; } } diff --git a/keyboards/duck/eagle_viper/v2/readme.md b/keyboards/duck/eagle_viper/v2/readme.md index 31f70b93b9c..2dca0b5b76a 100644 --- a/keyboards/duck/eagle_viper/v2/readme.md +++ b/keyboards/duck/eagle_viper/v2/readme.md @@ -13,7 +13,7 @@ Make example for this keyboard (after setting up your build environment): **Reset Key:** To put the Eagle/Viper V2 into reset, hold caps lock key (`K2A`) while plugging in. -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). ## Hardware Notes From 8faee5c9f67e9a5389754f90ded6983e669aae15 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 26 Apr 2019 17:24:00 -0700 Subject: [PATCH 036/129] [Keyboard] Update Gergo to use newer Ergodox Matrix code (#5703) * [Keyboard] Update Gergo to use newer Ergodox Matrix code And update layout macros to be correct * Almost forgot the json file * Remove board specific defines for i2c timeout --- keyboards/gergo/gergo.c | 16 +- keyboards/gergo/gergo.h | 18 +- keyboards/gergo/i2cmaster.h | 178 ----------------- keyboards/gergo/info.json | 42 ++--- keyboards/gergo/keymaps/default/config.h | 3 + keyboards/gergo/keymaps/default/keymap.c | 75 +++----- keyboards/gergo/keymaps/drashna/keymap.c | 119 ++++++++++++ keyboards/gergo/keymaps/drashna/rules.mk | 0 keyboards/gergo/keymaps/germ/config.h | 3 + keyboards/gergo/keymaps/germ/keymap.c | 75 +++----- keyboards/gergo/matrix.c | 231 ++++++++++------------- keyboards/gergo/rules.mk | 2 + 12 files changed, 313 insertions(+), 449 deletions(-) delete mode 100644 keyboards/gergo/i2cmaster.h create mode 100644 keyboards/gergo/keymaps/default/config.h create mode 100644 keyboards/gergo/keymaps/drashna/keymap.c create mode 100644 keyboards/gergo/keymaps/drashna/rules.mk create mode 100644 keyboards/gergo/keymaps/germ/config.h diff --git a/keyboards/gergo/gergo.c b/keyboards/gergo/gergo.c index cc0bef391d9..fab8d0f44c9 100644 --- a/keyboards/gergo/gergo.c +++ b/keyboards/gergo/gergo.c @@ -43,20 +43,20 @@ uint8_t init_mcp23018(void) { // - unused : input : 1 // - input : input : 1 // - driving : output : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT); if (mcp23018_status) goto out; i2c_stop(); // set pull-up // - unused : on : 1 // - input : on : 1 // - driving : off : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT); if (mcp23018_status) goto out; out: i2c_stop(); diff --git a/keyboards/gergo/gergo.h b/keyboards/gergo/gergo.h index 0292c512ac4..1370325f28a 100644 --- a/keyboards/gergo/gergo.h +++ b/keyboards/gergo/gergo.h @@ -1,14 +1,14 @@ #pragma once -#include + +#include "quantum.h" #include #include -#include "quantum.h" #include "i2c_master.h" -#include "matrix.h" +#include extern i2c_status_t mcp23018_status; -#define ERGODOX_EZ_I2C_TIMEOUT 1000 +#define I2C_TIMEOUT 1000 #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) #define CPU_16MHz 0x00 @@ -26,18 +26,14 @@ extern i2c_status_t mcp23018_status; #define OLATA 0x14 // output latch register #define OLATB 0x15 -void init_ergodox(void); uint8_t init_mcp23018(void); /* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ -#define LAYOUT_GERGO( \ +#define LAYOUT_gergo( \ L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05, \ 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, \ - L31,L32, R33,R34, \ - L30, R30, \ - L33,L34, R31,R32) \ - \ + L20,L21,L22,L23,L24,L25,L26,L30, R30,R20,R21,R22,R23,R24,R25,R26, \ + L31,L32,L33,L34, R31,R32,R33,R34) \ /* matrix positions */ \ { \ { KC_NO, L16, L26, L30}, \ diff --git a/keyboards/gergo/i2cmaster.h b/keyboards/gergo/i2cmaster.h deleted file mode 100644 index 72e05084942..00000000000 --- a/keyboards/gergo/i2cmaster.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef _I2CMASTER_H -#define _I2CMASTER_H 1 -/************************************************************************* -* Title: C include file for the I2C master interface -* (i2cmaster.S or twimaster.c) -* Author: Peter Fleury http://jump.to/fleury -* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device -* Usage: see Doxygen manual -**************************************************************************/ - -#ifdef DOXYGEN -/** - @defgroup pfleury_ic2master I2C Master library - @code #include @endcode - - @brief I2C (TWI) Master Software Library - - Basic routines for communicating with I2C slave devices. This single master - implementation is limited to one bus master on the I2C bus. - - This I2c library is implemented as a compact assembler software implementation of the I2C protocol - which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). - Since the API for these two implementations is exactly the same, an application can be linked either against the - software I2C implementation or the hardware I2C implementation. - - Use 4.7k pull-up resistor on the SDA and SCL pin. - - Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module - i2cmaster.S to your target when using the software I2C implementation ! - - Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. - - @note - The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted - to GNU assembler and AVR-GCC C call interface. - Replaced the incorrect quarter period delays found in AVR300 with - half period delays. - - @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury - - @par API Usage Example - The following code shows typical usage of this library, see example test_i2cmaster.c - - @code - - #include - - - #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet - - int main(void) - { - unsigned char ret; - - i2c_init(); // initialize I2C library - - // write 0x75 to EEPROM address 5 (Byte Write) - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - i2c_write(0x05); // write address = 5 - i2c_write(0x75); // write value 0x75 to EEPROM - i2c_stop(); // set stop conditon = release bus - - - // read previously written value back from EEPROM address 5 - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - - i2c_write(0x05); // write address = 5 - i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode - - ret = i2c_readNak(); // read one byte from EEPROM - i2c_stop(); - - for(;;); - } - @endcode - -*/ -#endif /* DOXYGEN */ - -/**@{*/ - -#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 -#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" -#endif - -#include - -/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_READ 1 - -/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_WRITE 0 - - -/** - @brief initialize the I2C master interace. Need to be called only once - @param void - @return none - */ -void i2c_init(void); - - -/** - @brief Terminates the data transfer and releases the I2C bus - @param void - @return none - */ -void i2c_stop(void); - - -/** - @brief Issues a start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -unsigned char i2c_start(unsigned char addr); - - -/** - @brief Issues a repeated start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -unsigned char i2c_rep_start(unsigned char addr); - - -/** - @brief Issues a start condition and sends address and transfer direction - - If device is busy, use ack polling to wait until device ready - @param addr address and transfer direction of I2C device - @return none - */ -void i2c_start_wait(unsigned char addr); - - -/** - @brief Send one byte to I2C device - @param data byte to be transfered - @retval 0 write successful - @retval 1 write failed - */ -unsigned char i2c_write(unsigned char data); - - -/** - @brief read one byte from the I2C device, request more data from device - @return byte read from I2C device - */ -unsigned char i2c_readAck(void); - -/** - @brief read one byte from the I2C device, read is followed by a stop condition - @return byte read from I2C device - */ -unsigned char i2c_readNak(void); - -/** - @brief read one byte from the I2C device - - Implemented as a macro, which calls either i2c_readAck or i2c_readNak - - @param ack 1 send ack, request more data from device
- 0 send nak, read is followed by a stop condition - @return byte read from I2C device - */ -unsigned char i2c_read(unsigned char ack); -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - - -/**@}*/ -#endif diff --git a/keyboards/gergo/info.json b/keyboards/gergo/info.json index cacbda42390..586b9c90812 100644 --- a/keyboards/gergo/info.json +++ b/keyboards/gergo/info.json @@ -5,7 +5,7 @@ "keyboard_name": "Gergo", "url": "http://gboards.ca", "layouts": { - "LAYOUT_GERGO": { + "LAYOUT_gergo": { "layout": [ { "label": "L00", @@ -180,6 +180,16 @@ "x": 6.5, "y": 1.75 }, + { + "label": "L30", + "x": 8.25, + "y": 2.75 + }, + { + "label": "R30", + "x": 10.25, + "y": 2.75 + }, { "h": 1.5, "label": "R20", @@ -227,26 +237,6 @@ "x": 6, "y": 3.63 }, - { - "label": "R33", - "x": 12.5, - "y": 3.63 - }, - { - "label": "R34", - "x": 13.75, - "y": 3.25 - }, - { - "label": "L30", - "x": 8.25, - "y": 2.75 - }, - { - "label": "R30", - "x": 10.25, - "y": 2.75 - }, { "h": 2, "label": "L33", @@ -270,6 +260,16 @@ "label": "R32", "x": 11.25, "y": 3.75 + }, + { + "label": "R33", + "x": 12.5, + "y": 3.63 + }, + { + "label": "R34", + "x": 13.75, + "y": 3.25 } ] } diff --git a/keyboards/gergo/keymaps/default/config.h b/keyboards/gergo/keymaps/default/config.h new file mode 100644 index 00000000000..6393d46f14b --- /dev/null +++ b/keyboards/gergo/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/gergo/keymaps/default/keymap.c b/keyboards/gergo/keymaps/default/keymap.c index fabd945fef6..8e26223f17d 100644 --- a/keyboards/gergo/keymaps/default/keymap.c +++ b/keyboards/gergo/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Good on you for modifying your layout! if you don't have +/* Good on you for modifying your layout! if you don't have * time to read the QMK docs, a list of keycodes can be found at * * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md @@ -8,7 +8,6 @@ #include QMK_KEYBOARD_H -#define IGNORE_MOD_TAP_INTERRUPT #define BASE 0 // default layer #define SYMB 1 // symbols #define NUMB 2 // numbers/motion @@ -41,15 +40,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * `--------------' `--------------' */ -[BASE] = LAYOUT_GERGO( -LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, -MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, -KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), KC_TAB, KC_BSPC, - - KC_BTN3, KC_PGDN, - LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC)), +[BASE] = LAYOUT_gergo( + LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN3, KC_PGDN, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC), KC_TAB, KC_BSPC + ), /* Keymap 1: Symbols layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -70,14 +66,12 @@ KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSP * | | | | | | * `--------------' `--------------' */ -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_EXLM, KC_AT, KC_LCBR,KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, -KC_TRNS, KC_HASH, KC_DLR, KC_LPRN,KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, -KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_DEL, - KC_TRNS, KC_TRNS, - KC_SCLN, KC_EQL, KC_EQL, KC_SCLN), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_TRNS, KC_TRNS, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_PGUP, KC_DEL + ), /* Keymap 2: Pad/Function layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -98,17 +92,15 @@ KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_ * | | | | | | * `--------------' `--------------' */ -[NUMB] = LAYOUT_GERGO( -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, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, -KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +[NUMB] = LAYOUT_gergo( + 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, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), }; -/* Keymap template +/* Keymap template * * ,-------------------------------------------. ,-------------------------------------------. * | | | | | | | | | | | | | | @@ -127,25 +119,10 @@ KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, K * | | | | | | * | | | | | | * `--------------' `--------------' -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) */ - -// 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); - biton32(layer_state); -}; - - diff --git a/keyboards/gergo/keymaps/drashna/keymap.c b/keyboards/gergo/keymaps/drashna/keymap.c new file mode 100644 index 00000000000..a882ff72d97 --- /dev/null +++ b/keyboards/gergo/keymaps/drashna/keymap.c @@ -0,0 +1,119 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H +#include "drashna.h" + +// Blank template at the bottom + +enum customKeycodes { + URL = 1 +}; + +#define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__) +#define LAYOUT_gergo_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_gergo_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ + _______, _______, KC_SPC, LT(_LOWER, KC_BSPC), LT(_RAISE, KC_DEL), KC_ENT, _______, _______ \ + ) + +#define LAYOUT_gergo_base_wrapper(...) LAYOUT_gergo_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_gergo_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + [_COLEMAK] = LAYOUT_gergo_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_gergo_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_gergo_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_gergo_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_gergo_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_gergo_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_gergo_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + [_MODS] = LAYOUT_gergo_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, _______, _______, _______, ___________________BLANK___________________, KC_RSFT, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_LOWER] = LAYOUT_gergo_wrapper( + KC_F12, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, + _______, _________________LOWER_L2__________________, _______, _______, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _______, _______, _______, _______, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT_gergo_wrapper( + _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _______, _______, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT_gergo_wrapper( + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _______, KC_NUKE, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, _______, _______, _______, _______, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +/* Keymap template + + [SYMB] = LAYOUT_gergo_wrapper( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + */ diff --git a/keyboards/gergo/keymaps/drashna/rules.mk b/keyboards/gergo/keymaps/drashna/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/gergo/keymaps/germ/config.h b/keyboards/gergo/keymaps/germ/config.h new file mode 100644 index 00000000000..6393d46f14b --- /dev/null +++ b/keyboards/gergo/keymaps/germ/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/gergo/keymaps/germ/keymap.c b/keyboards/gergo/keymaps/germ/keymap.c index fabd945fef6..8e26223f17d 100644 --- a/keyboards/gergo/keymaps/germ/keymap.c +++ b/keyboards/gergo/keymaps/germ/keymap.c @@ -1,4 +1,4 @@ -/* Good on you for modifying your layout! if you don't have +/* Good on you for modifying your layout! if you don't have * time to read the QMK docs, a list of keycodes can be found at * * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md @@ -8,7 +8,6 @@ #include QMK_KEYBOARD_H -#define IGNORE_MOD_TAP_INTERRUPT #define BASE 0 // default layer #define SYMB 1 // symbols #define NUMB 2 // numbers/motion @@ -41,15 +40,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * `--------------' `--------------' */ -[BASE] = LAYOUT_GERGO( -LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, -MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, -KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), KC_TAB, KC_BSPC, - - KC_BTN3, KC_PGDN, - LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC)), +[BASE] = LAYOUT_gergo( + LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN3, KC_PGDN, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC), KC_TAB, KC_BSPC + ), /* Keymap 1: Symbols layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -70,14 +66,12 @@ KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSP * | | | | | | * `--------------' `--------------' */ -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_EXLM, KC_AT, KC_LCBR,KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, -KC_TRNS, KC_HASH, KC_DLR, KC_LPRN,KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, -KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_DEL, - KC_TRNS, KC_TRNS, - KC_SCLN, KC_EQL, KC_EQL, KC_SCLN), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_TRNS, KC_TRNS, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_PGUP, KC_DEL + ), /* Keymap 2: Pad/Function layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -98,17 +92,15 @@ KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_ * | | | | | | * `--------------' `--------------' */ -[NUMB] = LAYOUT_GERGO( -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, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, -KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +[NUMB] = LAYOUT_gergo( + 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, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), }; -/* Keymap template +/* Keymap template * * ,-------------------------------------------. ,-------------------------------------------. * | | | | | | | | | | | | | | @@ -127,25 +119,10 @@ KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, K * | | | | | | * | | | | | | * `--------------' `--------------' -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) */ - -// 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); - biton32(layer_state); -}; - - diff --git a/keyboards/gergo/matrix.c b/keyboards/gergo/matrix.c index 9886ecf1536..aa1dc4842e4 100644 --- a/keyboards/gergo/matrix.c +++ b/keyboards/gergo/matrix.c @@ -29,10 +29,11 @@ along with this program. If not, see . #include "print.h" #include "debug.h" #include "util.h" +#include "debounce.h" #include "pointing_device.h" #include QMK_KEYBOARD_H #ifdef DEBUG_MATRIX_SCAN_RATE -#include "timer.h" +# include "timer.h" #endif #ifdef BALLER @@ -117,12 +118,11 @@ static matrix_row_t raw_matrix[MATRIX_ROWS]; // Debouncing: store for each key the number of scans until it's eligible to // change. When scanning the matrix, ignore any changes in keys that have // already changed in the last DEBOUNCE scans. -static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; static matrix_row_t read_cols(uint8_t row); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); static void enableInterrupts(void); static uint8_t mcp23018_reset_loop; @@ -134,11 +134,9 @@ uint32_t matrix_scan_count; #endif -__attribute__ ((weak)) -void matrix_init_user(void) {} +__attribute__ ((weak)) void matrix_init_user(void) {} -__attribute__ ((weak)) -void matrix_scan_user(void) {} +__attribute__ ((weak)) void matrix_scan_user(void) {} __attribute__ ((weak)) void matrix_init_kb(void) { @@ -150,39 +148,28 @@ void matrix_scan_kb(void) { matrix_scan_user(); } -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } -void matrix_init(void) -{ +void matrix_init(void) { // initialize row and col mcp23018_status = init_mcp23018(); unselect_rows(); init_cols(); - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - raw_matrix[i] = 0; - for (uint8_t j=0; j < MATRIX_COLS; ++j) { - debounce_matrix[i * MATRIX_COLS + j] = 0; - } - } + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); + matrix_timer = timer_read32(); matrix_scan_count = 0; #endif + debounce_init(MATRIX_ROWS); matrix_init_quantum(); } @@ -198,130 +185,120 @@ void matrix_power_up(void) { } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); + matrix_timer = timer_read32(); matrix_scan_count = 0; #endif } -// Returns a matrix_row_t whose bits are set if the corresponding key should be -// eligible to change in this scan. -matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) { - matrix_row_t result = 0; - matrix_row_t change = rawcols ^ raw_matrix[row]; - raw_matrix[row] = rawcols; - for (uint8_t i = 0; i < MATRIX_COLS; ++i) { - if (debounce_matrix[row * MATRIX_COLS + i]) { - --debounce_matrix[row * MATRIX_COLS + i]; - } else { - result |= (1 << i); - } - if (change & (1 << i)) { - debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; - } +// Reads and stores a row, returning +// whether a change occurred. +static inline bool store_raw_matrix_row(uint8_t index) { + matrix_row_t temp = read_cols(index); + if (raw_matrix[index] != temp) { + raw_matrix[index] = temp; + return true; } - return result; + return false; } -matrix_row_t debounce_read_cols(uint8_t row) { - // Read the row without debouncing filtering and store it for later usage. - matrix_row_t cols = read_cols(row); - // Get the Debounce mask. - matrix_row_t mask = debounce_mask(cols, row); - // debounce the row and return the result. - return (cols & mask) | (matrix[row] & ~mask);; -} -uint8_t matrix_scan(void) -{ - // TODO: Find what is trashing interrupts - enableInterrupts(); - // First we handle the mouse inputs - #ifdef BALLER - uint8_t pBtn = PINE & TRKBTN; +uint8_t matrix_scan(void) { + // TODO: Find what is trashing interrupts + enableInterrupts(); - #ifdef DEBUG_BALLER - // Compare to previous, mod report - if (tbUpCnt + tbDnCnt + tbLtCnt + tbRtCnt != 0) - xprintf("U: %d D: %d L: %d R: %d B: %d\n", tbUpCnt, tbDnCnt, tbLtCnt, tbRtCnt, (trkBtnState >> 6)); - #endif + // First we handle the mouse inputs +#ifdef BALLER + uint8_t pBtn = PINE & TRKBTN; - // Modify the report - report_mouse_t pRprt = pointing_device_get_report(); + #ifdef DEBUG_BALLER + // Compare to previous, mod report + if (tbUpCnt + tbDnCnt + tbLtCnt + tbRtCnt != 0) + xprintf("U: %d D: %d L: %d R: %d B: %d\n", tbUpCnt, tbDnCnt, tbLtCnt, tbRtCnt, (trkBtnState >> 6)); + #endif - // Scroll by default, move on layer - if (layer_state == 0) { + // Modify the report + report_mouse_t pRprt = pointing_device_get_report(); + + // Scroll by default, move on layer + if (layer_state == 0) { pRprt.h += tbLtCnt * SCROLLSTEP; tbLtCnt = 0; pRprt.h -= tbRtCnt * SCROLLSTEP; tbRtCnt = 0; pRprt.v -= tbUpCnt * SCROLLSTEP; tbUpCnt = 0; pRprt.v += tbDnCnt * SCROLLSTEP; tbDnCnt = 0; - } else { + } else { pRprt.x -= tbLtCnt * TRKSTEP * (layer_state - 1); tbLtCnt = 0; pRprt.x += tbRtCnt * TRKSTEP * (layer_state - 1); tbRtCnt = 0; pRprt.y -= tbUpCnt * TRKSTEP * (layer_state - 1); tbUpCnt = 0; pRprt.y += tbDnCnt * TRKSTEP * (layer_state - 1); tbDnCnt = 0; - } + } - #ifdef DEBUG_BALLER - if (pRprt.x != 0 || pRprt.y != 0) - xprintf("X: %d Y: %d\n", pRprt.x, pRprt.y); - #endif +#ifdef DEBUG_BALLER + if (pRprt.x != 0 || pRprt.y != 0) + xprintf("X: %d Y: %d\n", pRprt.x, pRprt.y); +#endif - if ((pBtn != trkBtnState) && ((pBtn >> 6) == 0)) pRprt.buttons |= MOUSE_BTN1; - if ((pBtn != trkBtnState) && ((pBtn >> 6) == 1)) pRprt.buttons &= ~MOUSE_BTN1; + if ((pBtn != trkBtnState) && ((pBtn >> 6) == 0)) pRprt.buttons |= MOUSE_BTN1; + if ((pBtn != trkBtnState) && ((pBtn >> 6) == 1)) pRprt.buttons &= ~MOUSE_BTN1; - // Save state, push update - if (pRprt.x != 0 || pRprt.y != 0 || pRprt.h != 0 || pRprt.v != 0 || (trkBtnState != pBtn)) - pointing_device_set_report(pRprt); + // Save state, push update + if (pRprt.x != 0 || pRprt.y != 0 || pRprt.h != 0 || pRprt.v != 0 || (trkBtnState != pBtn)) + pointing_device_set_report(pRprt); - trkBtnState = pBtn; - #endif + trkBtnState = pBtn; +#endif - // Then the keyboard - if (mcp23018_status) { // if there was an error - if (++mcp23018_reset_loop == 0) { - // if (++mcp23018_reset_loop >= 1300) { - // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans - // this will be approx bit more frequent than once per second - print("trying to reset mcp23018\n"); - mcp23018_status = init_mcp23018(); - if (mcp23018_status) { - print("left side not responding\n"); - } else { - print("left side attached\n"); - } - } - } + // Then the keyboard + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + } + } + } #ifdef DEBUG_MATRIX_SCAN_RATE matrix_scan_count++; + uint32_t timer_now = timer_read32(); - if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + if (TIMER_DIFF_32(timer_now, matrix_timer) > 1000) { print("matrix scan frequency: "); pdec(matrix_scan_count); print("\n"); - matrix_timer = timer_now; + matrix_timer = timer_now; matrix_scan_count = 0; } #endif + + bool changed = false; for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { - select_row(i); - // and select on left hand - select_row(i + MATRIX_ROWS_PER_SIDE); + // select rows from left and right hands + uint8_t left_index = i; + uint8_t right_index = i + MATRIX_ROWS_PER_SIDE; + select_row(left_index); + select_row(right_index); + // we don't need a 30us delay anymore, because selecting a // left-hand row requires more than 30us for i2c. - // grab cols from left hand - matrix[i] = debounce_read_cols(i); - // grab cols from right hand - matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE); + changed |= store_raw_matrix_row(left_index); + changed |= store_raw_matrix_row(right_index); unselect_rows(); } + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); matrix_scan_quantum(); + enableInterrupts(); #ifdef DEBUG_MATRIX @@ -338,20 +315,11 @@ bool matrix_is_modified(void) // deprecated and evidently not called. return true; } -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< Date: Fri, 26 Apr 2019 22:48:26 -0500 Subject: [PATCH 037/129] [Keymap] New keymap for Quefrency 65% with split backspace, RGB, media keys, mouse keys (#5717) * Add initial keyboard layout for Quefrency * Add RGB config and keybindings for Quefrency * Move Quefrency wheel keys to more convenient place * Actually switch from serial to I2C Commit 64708c6 updated the comment, not the #define. D'oh! --- .../keebio/quefrency/keymaps/bcat/config.h | 24 +++++++++++ .../keebio/quefrency/keymaps/bcat/keymap.c | 42 +++++++++++++++++++ .../keebio/quefrency/keymaps/bcat/readme.md | 17 ++++++++ .../keebio/quefrency/keymaps/bcat/rules.mk | 1 + 4 files changed, 84 insertions(+) create mode 100644 keyboards/keebio/quefrency/keymaps/bcat/config.h create mode 100644 keyboards/keebio/quefrency/keymaps/bcat/keymap.c create mode 100644 keyboards/keebio/quefrency/keymaps/bcat/readme.md create mode 100644 keyboards/keebio/quefrency/keymaps/bcat/rules.mk diff --git a/keyboards/keebio/quefrency/keymaps/bcat/config.h b/keyboards/keebio/quefrency/keymaps/bcat/config.h new file mode 100644 index 00000000000..528cfd39ad1 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/config.h @@ -0,0 +1,24 @@ +#pragma once + +/* Use I2C rather than serial communicaiton to reduce latency. */ +#define USE_I2C + +/* Turn off RGB lighting when the host goes to sleep. */ +#define RGBLIGHT_SLEEP + +/* Use an extra LED on the right side since it's wider on the 65% PCB. */ +#undef RGBLED_NUM +#define RGBLED_NUM 17 + +/* Set up RGB lighting so it works with either side as master. */ +#define RGBLED_SPLIT { 8, 9 } + +/* Make mouse operation smoother. */ +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 + +/* Lower mouse speed to adjust for reduced MOUSEKEY_INTERVAL. */ +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 150 +#define MOUSEKEY_WHEEL_MAX_SPEED 4 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 150 diff --git a/keyboards/keebio/quefrency/keymaps/bcat/keymap.c b/keyboards/keebio/quefrency/keymaps/bcat/keymap.c new file mode 100644 index 00000000000..1aac62ac063 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + +enum layer { + LAYER_DEFAULT, + LAYER_FUNCTION, + LAYER_MOUSE, +}; + +/* Switch to mouse function layer when held. */ +#define LY_FUNC MO(LAYER_FUNCTION) + +/* Switch to mouse layer when held; send menu key when tapped. */ +#define LY_MOUSE LT(LAYER_MOUSE, KC_APP) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default layer: http://www.keyboard-layout-editor.com/#/gists/60a262432bb340b37d364a4424f3037b */ + [LAYER_DEFAULT] = LAYOUT_65( + 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_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_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, LY_FUNC, KC_SPC, KC_SPC, XXXXXXX, KC_RALT, LY_FUNC, LY_MOUSE, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Function layer: http://www.keyboard-layout-editor.com/#/gists/59636898946da51f91fb290f8e078b4d */ + [LAYER_FUNCTION] = LAYOUT_65( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_HUI, \ + _______, KC_MPLY, KC_VOLU, KC_MSTP, _______, _______, EEP_RST, _______, _______, KC_INS, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, RGB_SAI, \ + KC_CAPS, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_SAD, \ + _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_HUD, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD \ + ), + + /* Mouse layer: http://www.keyboard-layout-editor.com/#/gists/05b9fbe8a34f65ed85ded659b3941152 */ + [LAYER_MOUSE] = LAYOUT_65( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN3, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_U, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_D, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN3, KC_BTN1, KC_MS_U, KC_BTN2, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R \ + ), +}; diff --git a/keyboards/keebio/quefrency/keymaps/bcat/readme.md b/keyboards/keebio/quefrency/keymaps/bcat/readme.md new file mode 100644 index 00000000000..f637c3821fc --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/readme.md @@ -0,0 +1,17 @@ +# bcat's Quefrency 65% layout + +This is pretty much a stock 65% split keyboard layout, with an HHKB-style +(split) backspace, media keys in the function layer centered around the WASD +cluster, and mouse keys on their own layer centered around the arrow cluster. + +## Default layer + +![Default layer layout](https://i.imgur.com/3riRFev.png) + +## Function layer + +![Function layer layout](https://i.imgur.com/eucGFjL.png) + +## Mouse layer + +![Mouse layer layout](https://i.imgur.com/LmGgJEG.png) diff --git a/keyboards/keebio/quefrency/keymaps/bcat/rules.mk b/keyboards/keebio/quefrency/keymaps/bcat/rules.mk new file mode 100644 index 00000000000..6c605daecf5 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/rules.mk @@ -0,0 +1 @@ +MOUSEKEY_ENABLE = yes From e2d141582c367e0865abf19700eb50361b9fc2c0 Mon Sep 17 00:00:00 2001 From: Jonathan Rascher Date: Sat, 27 Apr 2019 01:55:58 -0500 Subject: [PATCH 038/129] [Keymap] Initial keyboard layout for KBD67 (#5720) --- .../kbd67/hotswap/keymaps/bcat/keymap.c | 29 +++++++++++++++++++ .../kbd67/hotswap/keymaps/bcat/readme.md | 13 +++++++++ 2 files changed, 42 insertions(+) create mode 100644 keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/keymap.c create mode 100644 keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/readme.md diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/keymap.c b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/keymap.c new file mode 100644 index 00000000000..de18f2ff4ff --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +enum layer { + LAYER_DEFAULT, + LAYER_FUNCTION, +}; + +/* Switch to function layer when held. */ +#define LY_FUNC MO(LAYER_FUNCTION) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default layer: http://www.keyboard-layout-editor.com/#/gists/dd675b40cc4df2c7bb78847ac29f5988 */ + [LAYER_DEFAULT] = LAYOUT( + 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_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_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_RALT, LY_FUNC, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Function layer: http://www.keyboard-layout-editor.com/#/gists/f29128427f674c43777f045e363d1b44 */ + [LAYER_FUNCTION] = LAYOUT( + _______, 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_MPLY, KC_VOLU, KC_MSTP, _______, _______, EEP_RST, _______, _______, KC_INS, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, _______, \ + KC_CAPS, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_APP, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/readme.md b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/readme.md new file mode 100644 index 00000000000..88b9742a6fe --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/readme.md @@ -0,0 +1,13 @@ +# bcat's Quefrency 65% layout + +This is pretty much a stock 65% split keyboard layout, with an HHKB-style +(split) backspace and media keys in the function layer centered around the WASD +cluster. + +## Default layer + +![Default layer layout](https://i.imgur.com/stwELz3.png) + +## Function layer + +![Function layer layout](https://i.imgur.com/K5Z5qbw.png) From 27cff473e0a584ea0c9b70ae58127545ddc41475 Mon Sep 17 00:00:00 2001 From: Jonathan Rascher Date: Sat, 27 Apr 2019 13:01:39 -0500 Subject: [PATCH 039/129] [Keymap] Fix typo and function layer image for Quefrency (#5719) --- keyboards/keebio/quefrency/keymaps/bcat/keymap.c | 2 +- keyboards/keebio/quefrency/keymaps/bcat/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keebio/quefrency/keymaps/bcat/keymap.c b/keyboards/keebio/quefrency/keymaps/bcat/keymap.c index 1aac62ac063..28818c96f85 100644 --- a/keyboards/keebio/quefrency/keymaps/bcat/keymap.c +++ b/keyboards/keebio/quefrency/keymaps/bcat/keymap.c @@ -6,7 +6,7 @@ enum layer { LAYER_MOUSE, }; -/* Switch to mouse function layer when held. */ +/* Switch to function layer when held. */ #define LY_FUNC MO(LAYER_FUNCTION) /* Switch to mouse layer when held; send menu key when tapped. */ diff --git a/keyboards/keebio/quefrency/keymaps/bcat/readme.md b/keyboards/keebio/quefrency/keymaps/bcat/readme.md index f637c3821fc..1ecf42c2959 100644 --- a/keyboards/keebio/quefrency/keymaps/bcat/readme.md +++ b/keyboards/keebio/quefrency/keymaps/bcat/readme.md @@ -10,7 +10,7 @@ cluster, and mouse keys on their own layer centered around the arrow cluster. ## Function layer -![Function layer layout](https://i.imgur.com/eucGFjL.png) +![Function layer layout](https://i.imgur.com/Hu5wNpl.png) ## Mouse layer From 0250cad4208e0d2679fb49afc4d0b97e819eb29f Mon Sep 17 00:00:00 2001 From: Wilba Date: Sun, 28 Apr 2019 04:03:36 +1000 Subject: [PATCH 040/129] [Keyboard] Added WT69-A PCB (#5721) * Added WT69-A * Tweaked some things before PR * Update keyboards/wilba_tech/wt69_a/info.json Co-Authored-By: Wilba6582 * Update keyboards/wilba_tech/wt69_a/readme.md Co-Authored-By: Wilba6582 * Update keyboards/wilba_tech/wt69_a/wt69_a.h Co-Authored-By: Wilba6582 * Update keyboards/wilba_tech/wt69_a/readme.md Co-Authored-By: Wilba6582 * PR fixes * Fixed readme.md * Fixed keymaps --- keyboards/wilba_tech/wt60_a/readme.md | 2 +- keyboards/wilba_tech/wt65_a/readme.md | 4 +- keyboards/wilba_tech/wt69_a/config.h | 203 ++++++++++++++++++ keyboards/wilba_tech/wt69_a/info.json | 13 ++ .../wt69_a/keymaps/default/keymap.c | 36 ++++ .../wilba_tech/wt69_a/keymaps/via/keymap.c | 36 ++++ .../wilba_tech/wt69_a/keymaps/via/rules.mk | 68 ++++++ keyboards/wilba_tech/wt69_a/readme.md | 15 ++ keyboards/wilba_tech/wt69_a/rules.mk | 65 ++++++ keyboards/wilba_tech/wt69_a/wt69_a.c | 17 ++ keyboards/wilba_tech/wt69_a/wt69_a.h | 36 ++++ 11 files changed, 492 insertions(+), 3 deletions(-) create mode 100644 keyboards/wilba_tech/wt69_a/config.h create mode 100644 keyboards/wilba_tech/wt69_a/info.json create mode 100644 keyboards/wilba_tech/wt69_a/keymaps/default/keymap.c create mode 100644 keyboards/wilba_tech/wt69_a/keymaps/via/keymap.c create mode 100644 keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk create mode 100644 keyboards/wilba_tech/wt69_a/readme.md create mode 100644 keyboards/wilba_tech/wt69_a/rules.mk create mode 100644 keyboards/wilba_tech/wt69_a/wt69_a.c create mode 100644 keyboards/wilba_tech/wt69_a/wt69_a.h diff --git a/keyboards/wilba_tech/wt60_a/readme.md b/keyboards/wilba_tech/wt60_a/readme.md index d7a73165d4a..bf9da9ada14 100644 --- a/keyboards/wilba_tech/wt60_a/readme.md +++ b/keyboards/wilba_tech/wt60_a/readme.md @@ -1,6 +1,6 @@ # WILBA.TECH WT60-A -![WILBA.TECH WT60-A](https://wilba.tech) +![WILBA.TECH WT60-A](https://cdn.shopify.com/s/files/1/0015/5084/3975/products/no.160_PCB_1_of_1_2d7414ed-7cc5-46a5-b245-6fb7a197232d_720x.jpg?v=1546475122) WT60-A is a keyboard PCB supporting 60% layout. [More info at wilba.tech](https://wilba.tech/) diff --git a/keyboards/wilba_tech/wt65_a/readme.md b/keyboards/wilba_tech/wt65_a/readme.md index 1551b55b57a..9e0c630c0e0 100644 --- a/keyboards/wilba_tech/wt65_a/readme.md +++ b/keyboards/wilba_tech/wt65_a/readme.md @@ -1,8 +1,8 @@ # WILBA.TECH WT65-A -![WILBA.TECH WT65-A](https://wilba.tech) +![WILBA.TECH WT65-A](https://cdn.shopify.com/s/files/1/0015/5084/3975/products/no.165_PCB_1_of_1_a85e9af1-174f-497a-aadb-bb53ce74ef8c_720x.jpg?v=1546475185) -WT65-A is a keyboard PCB supporting 65% layout with 0.25U blocker. [More info at wilba.tech](https://wilba.tech/) +WT65-A is a keyboard PCB supporting 65% layout with 0.5U blocker. [More info at wilba.tech](https://wilba.tech/) Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) Hardware Supported: WILBA.TECH WT65-A diff --git a/keyboards/wilba_tech/wt69_a/config.h b/keyboards/wilba_tech/wt69_a/config.h new file mode 100644 index 00000000000..69425e8e4cb --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/config.h @@ -0,0 +1,203 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x069A // 69-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT69-A +#define DESCRIPTION wilba.tech WT69-A + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 17 + +/* + * 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 { F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { B7, B0, F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#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. + * + */ + +/* 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 + +// Does not use WT_MONO_BACKLIGHT +//#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*17*2)) = (35+680) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 715 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 309 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt69_a/info.json b/keyboards/wilba_tech/wt69_a/info.json new file mode 100644 index 00000000000..df7af63c294 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT69-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 18.25, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"BkSp", "x":15.25, "y":0}, {"label":"BkSp", "x":16.25, "y":0}, {"label":"Home", "x":17.25, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"PgUp", "x":17.25, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"PgDn", "x":17.25, "y":2}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":1.75}, {"label":"\u2191", "x":16.25, "y":3}, {"label":"End", "x":17.25, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Control", "x":2.25, "y":4, "w":1.5}, {"label":"Win", "x":3.75, "y":4}, {"label":"Alt", "x":4.75, "y":4, "w":1.5}, {"x":6.25, "y":4, "w":7}, {"label":"Fn", "x":13.25, "y":4, "w":1.5}, {"label":"\u2190", "x":15.25, "y":4}, {"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}] + } + } +} diff --git a/keyboards/wilba_tech/wt69_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt69_a/keymaps/default/keymap.c new file mode 100644 index 00000000000..c9fc5dd0716 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_F1, KC_F2, 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_BSPC, KC_HOME, + KC_F3, KC_F4, 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_F5, KC_F6, 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_F7, KC_F8, 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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + 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_F11, KC_F12, KC_DEL, KC_DEL, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; \ No newline at end of file diff --git a/keyboards/wilba_tech/wt69_a/keymaps/via/keymap.c b/keyboards/wilba_tech/wt69_a/keymaps/via/keymap.c new file mode 100644 index 00000000000..c9fc5dd0716 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/keymaps/via/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_F1, KC_F2, 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_BSPC, KC_HOME, + KC_F3, KC_F4, 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_F5, KC_F6, 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_F7, KC_F8, 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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + 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_F11, KC_F12, KC_DEL, KC_DEL, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; \ No newline at end of file diff --git a/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk new file mode 100644 index 00000000000..f072c67198c --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# 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 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +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 +# 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 = 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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt69_a/readme.md b/keyboards/wilba_tech/wt69_a/readme.md new file mode 100644 index 00000000000..03ab90d0984 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/readme.md @@ -0,0 +1,15 @@ +# WILBA.TECH WT69-A + +![WILBA.TECH WT69-A](https://images.squarespace-cdn.com/content/5b267e429772ae4372e3b65f/1556352502542-AKHBF9R6CP5HVHOZYJHM/i69_g.png?content-type=image%2Fpng) + +WT69-A is a keyboard PCB supporting 65% layout with 0.5U blocker and left side function keys. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: WILBA.TECH WT69-A +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt69_a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/wilba_tech/wt69_a/rules.mk b/keyboards/wilba_tech/wt69_a/rules.mk new file mode 100644 index 00000000000..f1c632289cc --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/rules.mk @@ -0,0 +1,65 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# 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 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +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 +# 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 = 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 diff --git a/keyboards/wilba_tech/wt69_a/wt69_a.c b/keyboards/wilba_tech/wt69_a/wt69_a.c new file mode 100644 index 00000000000..ccff6d62c94 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/wt69_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt69_a/wt69_a.h b/keyboards/wilba_tech/wt69_a/wt69_a.h new file mode 100644 index 00000000000..057936094d3 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/wt69_a.h @@ -0,0 +1,36 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K215, 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, K216, \ + K300, K301, K302, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, \ + K400, K401, K402, K403, K404, K408, K413, K414, K415, K416 \ +) { \ + { 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, ____, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316 }, \ + { K400, K401, K402, K403, K404, ____, ____, ____, K408, ____, ____, ____, ____, K413, K414, K415, K416 } \ +} + From c3be0520c4c6d4799670ab3639a3de561b4c6c1d Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sun, 28 Apr 2019 04:04:28 +1000 Subject: [PATCH 041/129] =?UTF-8?q?Fix=20sendstring=20"#"=20producing=20"?= =?UTF-8?q?=C2=A3"=20instead=20(#5724)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quantum/keymap_extras/sendstring_uk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/keymap_extras/sendstring_uk.h b/quantum/keymap_extras/sendstring_uk.h index 3c71f97640c..2824e5d444a 100644 --- a/quantum/keymap_extras/sendstring_uk.h +++ b/quantum/keymap_extras/sendstring_uk.h @@ -25,7 +25,7 @@ const bool ascii_to_shift_lut[0x80] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, + 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, @@ -45,7 +45,7 @@ const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, KC_ESC, 0, 0, 0, 0, - KC_SPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_7, KC_QUOT, + KC_SPC, KC_1, KC_2, KC_NUHS, KC_4, KC_5, KC_7, KC_QUOT, KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, From 53c51f1d16b40fdd3e68a6afc5844917d3d58640 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sun, 28 Apr 2019 09:42:16 +1000 Subject: [PATCH 042/129] A better new_project.sh (#5191) * A better new_project.sh * Fix docstrings * Use single quotes for anything not shown to user * Missed this docstring * Simplify get_git_username() Thanks @vomindoraan * chmod +x * Add docstring for print_error() * Break up git username call into multiple lines * Use with statement here * Conform to PEP 8 even more * Turn it back into a shell script * chmod +x again * Update docs to reflect new keyboard generator usage * Tweak wording slightly * Trim trailing whitespace * Don't actually need to escape the newlines here * As I suspected, you can pass shift a number * Prepend ./ to match the other code block * Minor syntax tweaks * The username token has changed * Replace name in the readme too * Make some reasonable assumptions about the presence of Git --- docs/hand_wire.md | 12 +- docs/hardware_avr.md | 26 ++- ...ard_to_qmk_(arm_and_other_chibios_cpus).md | 26 ++- util/new_keyboard.sh | 159 ++++++++++++++++++ util/new_project.sh | 70 -------- 5 files changed, 203 insertions(+), 90 deletions(-) create mode 100755 util/new_keyboard.sh delete mode 100755 util/new_project.sh diff --git a/docs/hand_wire.md b/docs/hand_wire.md index d2cba770e27..25db9341b88 100644 --- a/docs/hand_wire.md +++ b/docs/hand_wire.md @@ -198,15 +198,17 @@ From here, you should have a working keyboard once you program a firmware. Befor To start out, download [the firmware](https://github.com/qmk/qmk_firmware/) - we'll be using my (Jack's) fork of TMK called QMK/Quantum. We'll be doing a lot from the Terminal/command prompt, so get that open, along with a decent text editor like [Sublime Text](http://www.sublimetext.com/) (paid) or [Visual Studio Code](https://code.visualstudio.com) (free). -The first thing we're going to do is create a new project using the script in the root directory of the firmware. In your terminal, run this command with `` replaced by the name of your project - it'll need to be different from any other project in the `keyboards/` folder: +The first thing we're going to do is create a new keyboard. In your terminal, run this command, which will ask you some questions and generate a basic keyboard project: ``` - util/new_project.sh +./util/new_keyboard.sh ``` You'll want to navigate to the `keyboards//` folder by typing, like the print-out from the script specifies: - cd keyboards/ +``` +cd keyboards/ +``` ### `config.h` @@ -326,7 +328,7 @@ Carefully flip your keyboard over, open up a new text document, and try typing - 2. Check the solder joints on the diode - if the diode is loose, part of your row may register, while the other may not. 3. Check the solder joints on the columns - if your column wiring is loose, part or all of the column may not work. 4. Check the solder joints on both sides of the wires going to/from the Teensy - the wires need to be fully soldered and connect to both sides. -5. Check the .h file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable. +5. Check the `.h` file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable. 6. Check to make sure you actually compiled the firmware and flashed the Teensy correctly. Unless you got error messages in the terminal, or a pop-up during flashing, you probably did everything correctly. If you've done all of these things, keep in mind that sometimes you might have had multiple things affecting the keyswitch, so it doesn't hurt to test the keyswitch by shorting it out at the end. @@ -335,4 +337,4 @@ If you've done all of these things, keep in mind that sometimes you might have h Now that you have a working board, it's time to get things in their permanent positions. I've often used liberal amounts of hot glue to secure and insulate things, so if that's your style, start spreading that stuff like butter. Otherwise, double-sided tape is always an elegant solution, and electrical tape is a distant second. Due to the nature of these builds, a lot of this part is up to you and how you planned (or didn't plan) things out. -There are a lot of possibilities inside the firmware - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different project (Planck, Clueboard, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb) +There are a lot of possibilities inside the firmware - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different keyboards (Planck, Clueboard, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb) diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md index acf7088a396..7c28ab6dbcc 100644 --- a/docs/hardware_avr.md +++ b/docs/hardware_avr.md @@ -6,14 +6,26 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_ ## Adding Your AVR Keyboard to QMK -QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script: +QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started, run the `util/new_keyboard.sh` script: -```bash -$ util/new_project.sh my_awesome_keyboard -###################################################### -# /keyboards/my_awesome_keyboard project created. To start -# working on things, cd into keyboards/my_awesome_keyboard -###################################################### +``` +$ ./util/new_keyboard.sh +Generating a new QMK keyboard directory + +Keyboard Name: mycoolkb +Keyboard Type [avr]: +Your Name [John Smith]: + +Copying base template files... done +Copying avr template files... done +Renaming keyboard files... done +Replacing %KEYBOARD% with mycoolkb... done +Replacing %YOUR_NAME% with John Smith... done + +Created a new keyboard called mycoolkb. + +To start working on things, cd into keyboards/mycoolkb, +or open the directory in your favourite text editor. ``` This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard. diff --git a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md index d8e084f466c..979eafbc80f 100644 --- a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md +++ b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md @@ -1,15 +1,25 @@ -Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by using `util/new_project.sh ` to create a new project: +Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by running `util/new_keyboard.sh`: ``` -$ util/new_project.sh simontester -###################################################### -# /keyboards/simontester project created. To start -# working on things, cd into keyboards/simontester -###################################################### +$ ./util/new_keyboard.sh +Generating a new QMK keyboard directory + +Keyboard Name: mycoolkb +Keyboard Type [avr]: +Your Name [John Smith]: + +Copying base template files... done +Copying avr template files... done +Renaming keyboard files... done +Replacing %KEYBOARD% with mycoolkb... done +Replacing %YOUR_NAME% with John Smith... done + +Created a new keyboard called mycoolkb. + +To start working on things, cd into keyboards/mycoolkb, +or open the directory in your favourite text editor. ``` - - # END OF NEW ARM DOC, OLD ATMEL DOC FOLLOWS ## `/keyboards//config.h` diff --git a/util/new_keyboard.sh b/util/new_keyboard.sh new file mode 100755 index 00000000000..e9ce3097845 --- /dev/null +++ b/util/new_keyboard.sh @@ -0,0 +1,159 @@ +#!/bin/bash + +# This script generates a new keyboard directory under keyboards/, +# and copies the template files from quantum/template/ into it. + +# Print an error message with the word "ERROR" in red. +echo_error() { + echo -e "[\033[0;91mERROR\033[m]: $1" +} + +# Print a message in bold. +echo_bold() { + echo -e "\033[1m$1\033[m" +} + +# Prompt the user for information, showing the default value in brackets. +prompt() { + local message="$1" + local default="$2" + + [ -n "$default" ] && message+=" [$default]" + message+=": " + + read -rp "$message" prompt_return + [ -z "$prompt_return" ] && prompt_return="$default" +} + +# Grab a username from Git config. +set_git_username() { + git_username="$(git config --get user.name)" +} + +# Copy the template files to the new keyboard directory. +copy_templates() { + echo -n "Copying base template files..." + cp -r "quantum/template/base" "${keyboard_dir}" + echo " done" + + echo -n "Copying $keyboard_type template files..." + cp -r "quantum/template/${keyboard_type}/." "${keyboard_dir}" + echo " done" + + echo -n "Renaming keyboard files..." + mv "${keyboard_dir}/template.c" "${keyboard_dir}/${keyboard_name}.c" + mv "${keyboard_dir}/template.h" "${keyboard_dir}/${keyboard_name}.h" + echo " done" +} + +# Set the inplace editing parameter for sed. +# macOS/BSD sed expects a file extension immediately following -i. +set_sed_i() { + sed_i=(-i) + + case $(uname -a) in + *Darwin*) sed_i=(-i "") + esac +} + +# Replace a token with a value in the given list of files. +replace_placeholders() { + local replace_token="$1" + local replace_value="$2" + shift 2 + local replace_filenames=("$@") + + echo -n "Replacing $replace_token with $replace_value..." + for replace_filename in "${replace_filenames[@]}"; do + sed "${sed_i[@]}" -e "s/${replace_token}/${replace_value}/g" "$replace_filename" + done + echo " done" +} + +# Replace %KEYBOARD% with the keyboard name. +replace_keyboard_placeholders() { + local replace_keyboard_filenames=( + "${keyboard_dir}/config.h" + "${keyboard_dir}/readme.md" + "${keyboard_dir}/${keyboard_name}.c" + "${keyboard_dir}/keymaps/default/readme.md" + ) + replace_placeholders "%KEYBOARD%" "$keyboard_name" "${replace_keyboard_filenames[@]}" +} + +# Replace %YOUR_NAME% with the username. +replace_name_placeholders() { + local replace_name_filenames=( + "${keyboard_dir}/config.h" + "${keyboard_dir}/readme.md" + "${keyboard_dir}/${keyboard_name}.c" + "${keyboard_dir}/${keyboard_name}.h" + "${keyboard_dir}/keymaps/default/config.h" + "${keyboard_dir}/keymaps/default/keymap.c" + ) + replace_placeholders "%YOUR_NAME%" "$username" "${replace_name_filenames[@]}" +} + +# Check if an array contains an element. +array_contains() { + local e match="$1" + shift + for e; do + [[ "$e" == "$match" ]] && return 0; + done + + return 1 +} + +# If we've been started from util/, we want to be in qmk_firmware/ +[[ "$PWD" == *util ]] && cd .. + +# The root qmk_firmware/ directory should have a subdirectory called quantum/ +if [ ! -d "quantum" ]; then + echo_error "Could not detect the QMK firmware directory!" + echo_error "Are you sure you're in the right place?" + exit 1 +fi + +echo_bold "Generating a new QMK keyboard directory" +echo + +# Keyboard name is required, so keep prompting until we get one +while [ -z "$keyboard_name" ]; do + prompt "Keyboard Name" "" + keyboard_name=$prompt_return +done + +keyboard_dir="keyboards/$keyboard_name" + +if [ -d "$keyboard_dir" ]; then + echo_error "Keyboard $keyboard_name already exists!" + exit 1 +fi + +KEYBOARD_TYPES=("avr" "ps2avrgb") + +prompt "Keyboard Type" "avr" +keyboard_type=$prompt_return + +if ! array_contains "$keyboard_type" "${KEYBOARD_TYPES[@]}"; then + echo_error "Keyboard type must be one of: ${KEYBOARD_TYPES[*]}" + exit 1 +fi + +set_git_username +prompt "Your Name" "$git_username" +username=$prompt_return + +echo + +copy_templates +set_sed_i +replace_keyboard_placeholders +[ -n "$username" ] && replace_name_placeholders + +echo +echo_bold "Created a new keyboard called $keyboard_name." +echo +echo_bold "To start working on things, cd into keyboards/$keyboard_name," +echo_bold "or open the directory in your favourite text editor." diff --git a/util/new_project.sh b/util/new_project.sh deleted file mode 100755 index 9dec714b02a..00000000000 --- a/util/new_project.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# Script to make a new quantum project -# Jack Humbert 2015 - -KEYBOARD=$1 -KEYBOARD_TYPE=$2 - -if [ -z "$KEYBOARD" ]; then - echo "Usage: $0 " - echo "Example: $0 gh60 avr" - echo "Example: $0 bfake ps2avrgb" - exit 1 -elif [ -z "$KEYBOARD_TYPE" ]; then - KEYBOARD_TYPE=avr -fi - -if [ "$KEYBOARD_TYPE" != "avr" ] && [ "$KEYBOARD_TYPE" != "ps2avrgb" ]; then - echo "Invalid keyboard type target" - exit 1 -fi - -if [ -e "keyboards/$1" ]; then - echo "Error! keyboards/$1 already exists!" - exit 1 -fi - -cd "$(dirname "$0")/.." || exit - -KEYBOARD_NAME=$(basename "$1") -KEYBOARD_NAME_UPPERCASE=$(echo "$KEYBOARD_NAME" | awk '{print toupper($0)}') -NEW_KBD=keyboards/${KEYBOARD} - - -cp -r quantum/template/base "$NEW_KBD" -cp -r "quantum/template/$KEYBOARD_TYPE/." "$NEW_KBD" - -mv "${NEW_KBD}/template.c" "${NEW_KBD}/${KEYBOARD_NAME}.c" -mv "${NEW_KBD}/template.h" "${NEW_KBD}/${KEYBOARD_NAME}.h" -find "${NEW_KBD}" -type f -exec sed -i '' -e "s;%KEYBOARD%;${KEYBOARD_NAME};g" {} \; -find "${NEW_KBD}" -type f -exec sed -i '' -e "s;%KEYBOARD_UPPERCASE%;${KEYBOARD_NAME_UPPERCASE};g" {} \; - -GIT=$(whereis git) -if [ "$GIT" != "" ]; then - IS_GIT_REPO=$($GIT log >>/dev/null 2>&1; echo $?) - if [ "$IS_GIT_REPO" -eq 0 ]; then - ID="$($GIT config --get user.name)" - read -rp "What is your name? [$ID] " YOUR_NAME - if [ -n "$YOUR_NAME" ]; then - ID=$YOUR_NAME - fi - echo "Using $ID as user name" - - for i in "$NEW_KBD/config.h" \ - "$NEW_KBD/$KEYBOARD_NAME.c" \ - "$NEW_KBD/$KEYBOARD_NAME.h" \ - "$NEW_KBD/keymaps/default/config.h" \ - "$NEW_KBD/keymaps/default/keymap.c" - do - awk -v id="$ID" '{sub(/%YOUR_NAME%/,id); print}' < "$i" > "$i.$$" - mv "$i.$$" "$i" - done - fi -fi - -cat <<-EOF -###################################################### -# $NEW_KBD project created. To start -# working on things, cd into $NEW_KBD -###################################################### -EOF From b23c3b0fd61c311b429fb1b3391248bf9df2e25d Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Sat, 27 Apr 2019 23:35:31 -0400 Subject: [PATCH 043/129] [Keyboard] Satisfaction75 i2c fix and VIA layout (#5726) --- keyboards/cannonkeys/satisfaction75/config.h | 2 +- .../cannonkeys/satisfaction75/i2c_master.c | 12 +++--- .../satisfaction75/keymaps/jae/keymap.c | 37 +++++++++++++++++++ .../satisfaction75/keymaps/via/keymap.c | 22 ++++++----- 4 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h index e3d44990efc..092b372577b 100644 --- a/keyboards/cannonkeys/satisfaction75/config.h +++ b/keyboards/cannonkeys/satisfaction75/config.h @@ -76,7 +76,7 @@ along with this program. If not, see . // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x0F +#define EEPROM_VERSION 0x01 #define EEPROM_VERSION_ADDR 34 // Dynamic keymap starts after EEPROM version diff --git a/keyboards/cannonkeys/satisfaction75/i2c_master.c b/keyboards/cannonkeys/satisfaction75/i2c_master.c index ce0e0a7ba16..56e810d32a1 100644 --- a/keyboards/cannonkeys/satisfaction75/i2c_master.c +++ b/keyboards/cannonkeys/satisfaction75/i2c_master.c @@ -42,8 +42,8 @@ static const I2CConfig i2cconfig = { 0 }; -static i2c_status_t chibios_to_qmk(const msg_t* status) { - switch (*status) { +static i2c_status_t chibios_to_qmk(const msg_t status) { + switch (status) { case I2C_NO_ERROR: return I2C_STATUS_SUCCESS; case I2C_TIMEOUT: @@ -83,7 +83,7 @@ i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, i2cAcquireBus(&I2C_DRIVER); msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); i2cReleaseBus(&I2C_DRIVER); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) @@ -91,7 +91,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16 i2c_address = address; i2cStart(&I2C_DRIVER, &i2cconfig); msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) @@ -107,7 +107,7 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, complete_packet[0] = regaddr; msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) @@ -115,7 +115,7 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint1 i2c_address = devaddr; i2cStart(&I2C_DRIVER, &i2cconfig); msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } void i2c_stop(void) diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c new file mode 100644 index 00000000000..733ba8cd673 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c @@ -0,0 +1,37 @@ +/* +Copyright 2012,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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + 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_DEL, ENC_PRESS, + 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_NUHS, KC_ENTER, 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_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, OLED_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c index e76c79a71b3..296fd7da6aa 100644 --- a/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c +++ b/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c @@ -17,25 +17,27 @@ along with this program. If not, see . #include QMK_KEYBOARD_H + const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_default( + [0] = LAYOUT_all( 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, ENC_PRESS, + 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_DEL, ENC_PRESS, 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_ENTER, 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, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + 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_ENTER, 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, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [1] = LAYOUT_default( + [1] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; + void matrix_init_user(void) { //user initialization } From 36e950a13fb0368a89c644fdfb28263326018cdd Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 29 Apr 2019 23:33:13 +0700 Subject: [PATCH 044/129] [Keymap] Added compatibility for Planck rev6 (#5706) * Update code for compatibility with latest QMK * Added compatibility with Planck rev6 * use wait_ms instead of _delay_ms * removed unnecessary rules * disable audio on rev4 only --- .../promethium/keymaps/default/keymap.c | 2 +- .../promethium/keymaps/priyadi/keymap.c | 4 +++- keyboards/planck/keymaps/priyadi/config.h | 22 ++++++++++++++++++- keyboards/planck/keymaps/priyadi/rules.mk | 11 ++++++++-- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/keyboards/handwired/promethium/keymaps/default/keymap.c b/keyboards/handwired/promethium/keymaps/default/keymap.c index 179b411ee8f..b09e30457cc 100644 --- a/keyboards/handwired/promethium/keymaps/default/keymap.c +++ b/keyboards/handwired/promethium/keymaps/default/keymap.c @@ -1277,7 +1277,7 @@ void set_output_user(uint8_t output) { } void matrix_init_user() { - _delay_ms(500); // give time for usb to initialize + wait_ms(500); // give time for usb to initialize set_unicode_input_mode(UC_LNX); diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 179b411ee8f..fbb1ae1d69f 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -53,7 +53,9 @@ along with this program. If not, see . } while (0) #endif #endif +#ifdef __AVR__ #include "outputselect.h" +#endif #include "led.h" #define COUNT(x) (sizeof (x) / sizeof (*(x))) @@ -1277,7 +1279,7 @@ void set_output_user(uint8_t output) { } void matrix_init_user() { - _delay_ms(500); // give time for usb to initialize + wait_ms(500); // give time for usb to initialize set_unicode_input_mode(UC_LNX); diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h index 876d057bf2a..c85e8656e6f 100644 --- a/keyboards/planck/keymaps/priyadi/config.h +++ b/keyboards/planck/keymaps/priyadi/config.h @@ -21,7 +21,8 @@ #define DOUBLESPACE_LAYER_ENABLE // #define TOLELOT_ENABLE -#define KEYMAP_CUSTOM( \ +#ifdef __AVR__ +#define LAYOUT( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ @@ -34,5 +35,24 @@ {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c}, \ {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c} \ } +#elif KEYBOARD_planck_rev6 +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + tp1, tp2, tp3 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} +#endif #endif diff --git a/keyboards/planck/keymaps/priyadi/rules.mk b/keyboards/planck/keymaps/priyadi/rules.mk index a999eb00f63..17617b0b7cb 100644 --- a/keyboards/planck/keymaps/priyadi/rules.mk +++ b/keyboards/planck/keymaps/priyadi/rules.mk @@ -8,15 +8,22 @@ 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 = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes # Unicode map BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no + +ifeq ($(strip $(KEYBOARD)), planck/rev4) FAUXCLICKY_ENABLE = yes +BACKLIGHT_ENABLE = yes +AUDIO_ENABLE = no +endif + +ifeq ($(strip $(KEYBOARD)), planck/rev6) +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend From 6806398246c7201b84c3af508aa09b6735973d11 Mon Sep 17 00:00:00 2001 From: loChris <44450518+loChris@users.noreply.github.com> Date: Mon, 29 Apr 2019 12:34:43 -0400 Subject: [PATCH 045/129] [Keymap] dz60 keymap w/ hhkb-esque default layer (#5708) * hello world * Update keyboards/dz60/keymaps/zepol_layout/keymap.c Co-Authored-By: loChris <44450518+loChris@users.noreply.github.com> --- keyboards/dz60/keymaps/zepol_layout/keymap.c | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 keyboards/dz60/keymaps/zepol_layout/keymap.c diff --git a/keyboards/dz60/keymaps/zepol_layout/keymap.c b/keyboards/dz60/keymaps/zepol_layout/keymap.c new file mode 100644 index 00000000000..4caf83b67e5 --- /dev/null +++ b/keyboards/dz60/keymaps/zepol_layout/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + 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_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_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(2), KC_NO, MO(1), KC_RCTL), + + LAYOUT( + 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, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_SCROLLLOCK, KC_PAUSE, KC_HOME, KC_END, KC_INSERT, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT( + 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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; From e337bb82a3b418dfd6c60b8c615322c854e5995d Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 29 Apr 2019 11:04:56 -0700 Subject: [PATCH 046/129] Fix Planck and Preonic builds (#5658) * Planck: Copy contents of Planck rules.mk to each revision * Planck: Delete Planck rules.mk * Planck: Concatenate duplicate rules Concatenate rules that are set and then overridden into one setting. * Preonic: Copy contents of Preonic rules.mk to each revision * Preonic: Delete Preonic rules.mk * Preonic: Concatenate duplicate rules Concatenate rules that are set and then overridden into one setting. * Planck: Delete non-specific Bootloader settings from revs. 1 and 2 Deleted BOOTLOADER setting code block, as the checks were only valid for revs. 3-5 and the Planck Light. Neither Planck rev1 or rev2 set the bootloader via rules.mk, so there's no setting of BOOTLOADER in their rules.mk files. * Preonic: Fix BOOTLOADER settings code blocks * Preonic: delete extra blank lines from rules.mk files * Preonic: delete AVR-type hardware config blocks from rev3 * Update Planck and Preonic readme files - update Hardware Supported - update/add Install Examples - update Docs paragraph * Enable Bootmagic Lite where it is disabled Enabled Bootmagic Lite for: - Planck Light - Planck revs. 1-5 - Preonic revs. 1 and 2 * Remove `planck_grid` from LAYOUTS rule for all Planck revisions Community has landed on `ortho_4x12`, which is already set; `planck_grid` is redundant. --- keyboards/planck/ez/rules.mk | 38 +++++++++++------ keyboards/planck/light/rules.mk | 39 +++++++++++++++-- keyboards/planck/readme.md | 7 ++-- keyboards/planck/rev1/rules.mk | 30 ++++++++++++- keyboards/planck/rev2/rules.mk | 30 ++++++++++++- keyboards/planck/rev3/rules.mk | 36 +++++++++++++++- keyboards/planck/rev4/rules.mk | 34 +++++++++++++++ keyboards/planck/rev5/rules.mk | 34 +++++++++++++++ keyboards/planck/rev6/rules.mk | 35 +++++++++++----- keyboards/planck/rules.mk | 46 -------------------- keyboards/preonic/readme.md | 11 +++-- keyboards/preonic/rev1/rules.mk | 67 +++++++++++++++++++++++++++++ keyboards/preonic/rev2/rules.mk | 67 +++++++++++++++++++++++++++++ keyboards/preonic/rev3/rules.mk | 34 +++++++++------ keyboards/preonic/rules.mk | 74 --------------------------------- 15 files changed, 414 insertions(+), 168 deletions(-) delete mode 100644 keyboards/planck/rules.mk delete mode 100644 keyboards/preonic/rules.mk diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk index c6fb52d2b5b..4aa431fdaa5 100644 --- a/keyboards/planck/ez/rules.mk +++ b/keyboards/planck/ez/rules.mk @@ -1,24 +1,36 @@ -# project specific files -LAYOUTS += ortho_4x12 - # Cortex version MCU = STM32F303 +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + # Build Options -# comment out to disable the options. +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically # -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) ## (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 +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 +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 = 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. +API_SYSEX_ENABLE = 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 #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover + CUSTOM_MATRIX = no # Custom matrix file -AUDIO_ENABLE = yes -RGBLIGHT_ENABLE = no # SERIAL_LINK_ENABLE = yes ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = IS31FL3737 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/light/rules.mk b/keyboards/planck/light/rules.mk index c10b8fd1da5..b621a9abb0f 100644 --- a/keyboards/planck/light/rules.mk +++ b/keyboards/planck/light/rules.mk @@ -1,5 +1,36 @@ -MIDI_ENABLE = yes -AUDIO_ENABLE = yes # Audio output on port C6 -RGB_MATRIX_ENABLE = yes +# MCU name +MCU = at90usb1286 -MCU = at90usb1286 \ No newline at end of file +# 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 + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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 +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. +RGB_MATRIX_ENABLE = yes +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/readme.md b/keyboards/planck/readme.md index 083279e8a62..94b256c7451 100644 --- a/keyboards/planck/readme.md +++ b/keyboards/planck/readme.md @@ -6,7 +6,7 @@ Planck A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) -Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, Teensy 2.0 +Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, rev5, rev6; Planck Light Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): @@ -15,6 +15,7 @@ Make example for this keyboard (after setting up your build environment): Install examples: - make planck/rev6:default:dfu-util + make planck/rev5:default:dfu # For Planck rev5 or earlier and Planck Light + make planck/rev6:default:dfu-util # For Planck rev6 -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev1/rules.mk b/keyboards/planck/rev1/rules.mk index e51af55c668..be03e4515ef 100644 --- a/keyboards/planck/rev1/rules.mk +++ b/keyboards/planck/rev1/rules.mk @@ -1 +1,29 @@ -AUDIO_ENABLE = no # Audio output on port C6 +# MCU name +MCU = atmega32u4 + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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 = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev2/rules.mk b/keyboards/planck/rev2/rules.mk index e51af55c668..be03e4515ef 100644 --- a/keyboards/planck/rev2/rules.mk +++ b/keyboards/planck/rev2/rules.mk @@ -1 +1,29 @@ -AUDIO_ENABLE = no # Audio output on port C6 +# MCU name +MCU = atmega32u4 + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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 = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev3/rules.mk b/keyboards/planck/rev3/rules.mk index e51af55c668..3de40a66c58 100644 --- a/keyboards/planck/rev3/rules.mk +++ b/keyboards/planck/rev3/rules.mk @@ -1 +1,35 @@ -AUDIO_ENABLE = no # Audio output on port C6 +# MCU name +MCU = atmega32u4 + +# 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 + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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 = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev4/rules.mk b/keyboards/planck/rev4/rules.mk index 7e64e7edc4f..390f5824948 100644 --- a/keyboards/planck/rev4/rules.mk +++ b/keyboards/planck/rev4/rules.mk @@ -1 +1,35 @@ +# MCU name +MCU = atmega32u4 + +# 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 + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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 = 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. +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev5/rules.mk b/keyboards/planck/rev5/rules.mk index 7e64e7edc4f..ca63b39acf5 100644 --- a/keyboards/planck/rev5/rules.mk +++ b/keyboards/planck/rev5/rules.mk @@ -1 +1,35 @@ +# MCU name +MCU = atmega32u4 + +# 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 = qmk-dfu + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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 = 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. +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev6/rules.mk b/keyboards/planck/rev6/rules.mk index 1f3d1dfe584..c582750025c 100644 --- a/keyboards/planck/rev6/rules.mk +++ b/keyboards/planck/rev6/rules.mk @@ -5,20 +5,35 @@ LAYOUTS += ortho_4x12 # Cortex version MCU = STM32F303 +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + # Build Options -# comment out to disable the options. +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically # -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) ## (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 +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 +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 = 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. +API_SYSEX_ENABLE = 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 #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 -RGBLIGHT_ENABLE = no # SERIAL_LINK_ENABLE = yes ENCODER_ENABLE = yes + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk deleted file mode 100644 index 520a2d5c7ba..00000000000 --- a/keyboards/planck/rules.mk +++ /dev/null @@ -1,46 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# 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. -ifeq ($(strip $(KEYBOARD)), planck/rev3) - BOOTLOADER = atmel-dfu -endif -ifeq ($(strip $(KEYBOARD)), planck/rev4) - BOOTLOADER = atmel-dfu -endif -ifeq ($(strip $(KEYBOARD)), planck/rev5) - BOOTLOADER = qmk-dfu -endif -ifeq ($(strip $(KEYBOARD)), planck/light) - BOOTLOADER = atmel-dfu -endif - -# 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 = yes # Audio control and System control(+450) -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 = 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. -API_SYSEX_ENABLE = 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 - -LAYOUTS = ortho_4x12 planck_mit planck_grid -LAYOUTS_HAS_RGB = no diff --git a/keyboards/preonic/readme.md b/keyboards/preonic/readme.md index 5b3c0ec588b..85adf635d74 100644 --- a/keyboards/preonic/readme.md +++ b/keyboards/preonic/readme.md @@ -6,11 +6,16 @@ Preonic A compact 50% (12x5) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/preonic/) Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) -Hardware Supported: Preonic PCB rev1, Teensy 2.0 +Hardware Supported: Preonic PCB rev1, rev2, rev3 Hardware Availability: [OLKB.com](https://olkb.com/preonic/), [Massdrop](https://www.massdrop.com/buy/preonic-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): - make preonic:default + make preonic/rev2:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file +Install examples: + + make preonic/rev2:default:dfu # For Preonic rev1 or rev2 + make preonic/rev3:default:dfu-util # For Preonic rev3 + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/preonic/rev1/rules.mk b/keyboards/preonic/rev1/rules.mk index e69de29bb2d..b0d44db82b7 100644 --- a/keyboards/preonic/rev1/rules.mk +++ b/keyboards/preonic/rev1/rules.mk @@ -0,0 +1,67 @@ +# 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 = atmel-dfu + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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. +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_5x12 diff --git a/keyboards/preonic/rev2/rules.mk b/keyboards/preonic/rev2/rules.mk index e69de29bb2d..748979c7905 100644 --- a/keyboards/preonic/rev2/rules.mk +++ b/keyboards/preonic/rev2/rules.mk @@ -0,0 +1,67 @@ +# 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 = qmk-dfu + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 = 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. +API_SYSEX_ENABLE = 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 + +LAYOUTS = ortho_5x12 diff --git a/keyboards/preonic/rev3/rules.mk b/keyboards/preonic/rev3/rules.mk index 0c171b2fb09..39e69872c9a 100644 --- a/keyboards/preonic/rev3/rules.mk +++ b/keyboards/preonic/rev3/rules.mk @@ -1,24 +1,34 @@ # project specific files SRC = matrix.c -LAYOUTS += ortho_5x12 # Cortex version MCU = STM32F303 # Build Options -# comment out to disable the options. +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically # -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) ## (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 +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 +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 = 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. +API_SYSEX_ENABLE = 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 +#SLEEP_LED_ENABLE = yes + CUSTOM_MATRIX = yes # Custom matrix file -AUDIO_ENABLE = yes -RGBLIGHT_ENABLE = no # SERIAL_LINK_ENABLE = yes ENCODER_ENABLE = yes + +LAYOUTS = ortho_5x12 diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk deleted file mode 100644 index e646f2493f0..00000000000 --- a/keyboards/preonic/rules.mk +++ /dev/null @@ -1,74 +0,0 @@ - - -# 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. -ifeq ($(strip $(KEYBOARD)), preonic/rev1) - BOOTLOADER = atmel-dfu -endif -ifeq ($(strip $(KEYBOARD)), preonic/rev2) - BOOTLOADER = qmk-dfu -endif - -# 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 = 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 = 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. -API_SYSEX_ENABLE = 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 - -LAYOUTS = ortho_5x12 From 1d784f0f9575b70e35c9c8338b0ff80dc7316d7e Mon Sep 17 00:00:00 2001 From: Daniel Prilik Date: Mon, 29 Apr 2019 17:48:41 -0400 Subject: [PATCH 047/129] RGB Matrix: Custom effects on a kb/user level (#5338) * Revamped custom effects approach See docs for example usage * push-up RGB Matrix default mode Override default effect using RGB_MATRIX_STARTUP_MODE. Useful on boards without EEPROM support (*cough* Massdrop ALT/CTRL *cough*) * update docs --- common_features.mk | 8 ++++++ docs/feature_rgb_matrix.md | 57 +++++++++++++++++++++++++++++++++----- quantum/rgb_matrix.c | 43 ++++++++++++++++++++++++---- quantum/rgb_matrix.h | 12 ++++++++ 4 files changed, 107 insertions(+), 13 deletions(-) diff --git a/common_features.mk b/common_features.mk index fbfbc3ebc60..8e9bcf0b98d 100644 --- a/common_features.mk +++ b/common_features.mk @@ -178,6 +178,14 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812) SRC += ws2812.c endif +ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes) + OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB +endif + +ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes) + OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER +endif + ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) OPT_DEFS += -DTAP_DANCE_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index f2168ab16ef..4ce9d15f0f6 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -177,7 +177,7 @@ enum rgb_matrix_effects { RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes RGB_MATRIX_BREATHING, // Single hue brightness cycling animation RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient - RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right + RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard @@ -203,7 +203,7 @@ enum rgb_matrix_effects { RGB_MATRIX_EFFECT_MAX }; ``` - + You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`: @@ -236,17 +236,60 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con |`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | -## Custom layer effects +## Custom RGB Matrix Effects -Custom layer effects can be done by defining this in your `.c`: +By setting `RGB_MATRIX_CUSTOM_USER` (and/or `RGB_MATRIX_CUSTOM_KB`) in `rule.mk`, new effects can be defined directly from userspace, without having to edit any QMK core files. + +To declare new effects, create a new `rgb_matrix_user/kb.inc` that looks something like this: + +`rgb_matrix_user.inc` should go in the root of the keymap directory. +`rgb_matrix_kb.inc` should go in the root of the keyboard directory. ```C -void rgb_matrix_indicators_kb(void) { - rgb_matrix_set_color(index, red, green, blue); +// !!! DO NOT ADD #pragma once !!! // + +// Step 1. +// Declare custom effects using the RGB_MATRIX_EFFECT macro +// (note the lack of semicolon after the macro!) +RGB_MATRIX_EFFECT(my_cool_effect) +RGB_MATRIX_EFFECT(my_cool_effect2) + +// Step 2. +// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +// e.g: A simple effect, self-contained within a single method +static bool my_cool_effect(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + rgb_matrix_set_color(i, 0xff, 0xff, 0x00); + } + return led_max < DRIVER_LED_TOTAL; } + +// e.g: A more complex effect, relying on external methods and state, with +// dedicated init and run methods +static uint8_t some_global_state; +static void my_cool_effect2_complex_init(effect_params_t* params) { + some_global_state = 1; +} +static bool my_cool_effect2_complex_run(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + rgb_matrix_set_color(i, 0xff, some_global_state++, 0xff); + } + + return led_max < DRIVER_LED_TOTAL; +} +static bool my_cool_effect2(effect_params_t* params) { + if (params->init) my_cool_effect2_complex_init(params); + return my_cool_effect2_complex_run(params); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS ``` -A similar function works in the keymap as `rgb_matrix_indicators_user`. +For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animation/` ## Colors diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 41ed8983eff..5ca9b87a637 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -48,6 +48,19 @@ #include "rgb_matrix_animations/solid_splash_anim.h" #include "rgb_matrix_animations/breathing_anim.h" +#if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) + #define RGB_MATRIX_CUSTOM_EFFECT_IMPLS + #define RGB_MATRIX_EFFECT(name, ...) + #ifdef RGB_MATRIX_CUSTOM_KB + #include "rgb_matrix_kb.inc" + #endif + #ifdef RGB_MATRIX_CUSTOM_USER + #include "rgb_matrix_user.inc" + #endif + #undef RGB_MATRIX_EFFECT + #undef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif + #ifndef RGB_DISABLE_AFTER_TIMEOUT #define RGB_DISABLE_AFTER_TIMEOUT 0 #endif @@ -81,6 +94,15 @@ #define RGB_MATRIX_SPD_STEP 16 #endif +#if !defined(RGB_MATRIX_STARTUP_MODE) + #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT + #else + // fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR + #endif +#endif + bool g_suspend_state = false; rgb_config_t rgb_matrix_config; @@ -104,12 +126,7 @@ void eeconfig_update_rgb_matrix(uint32_t val) { void eeconfig_update_rgb_matrix_default(void) { dprintf("eeconfig_update_rgb_matrix_default\n"); rgb_matrix_config.enable = 1; -#ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT - rgb_matrix_config.mode = RGB_MATRIX_CYCLE_LEFT_RIGHT; -#else - // fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace - rgb_matrix_config.mode = RGB_MATRIX_SOLID_COLOR; -#endif + rgb_matrix_config.mode = RGB_MATRIX_STARTUP_MODE; rgb_matrix_config.hue = 0; rgb_matrix_config.sat = UINT8_MAX; rgb_matrix_config.val = RGB_MATRIX_MAXIMUM_BRIGHTNESS; @@ -435,6 +452,20 @@ static void rgb_task_render(uint8_t effect) { #endif // DISABLE_RGB_MATRIX_SOLID_MULTISPLASH #endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) + #define RGB_MATRIX_EFFECT(name, ...) \ + case RGB_MATRIX_CUSTOM_##name: \ + rendering = name(&rgb_effect_params); \ + break; + #ifdef RGB_MATRIX_CUSTOM_KB + #include "rgb_matrix_kb.inc" + #endif + #ifdef RGB_MATRIX_CUSTOM_USER + #include "rgb_matrix_user.inc" + #endif + #undef RGB_MATRIX_EFFECT +#endif + // Factory default magic value case UINT8_MAX: { rgb_matrix_test(); diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 5fdc854f08c..775cbeac034 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -142,6 +142,18 @@ enum rgb_matrix_effects { RGB_MATRIX_SOLID_MULTISPLASH, #endif // DISABLE_RGB_MATRIX_SOLID_MULTISPLASH #endif // RGB_MATRIX_KEYREACTIVE_ENABLED + +#if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) + #define RGB_MATRIX_EFFECT(name, ...) RGB_MATRIX_CUSTOM_##name, + #ifdef RGB_MATRIX_CUSTOM_KB + #include "rgb_matrix_kb.inc" + #endif + #ifdef RGB_MATRIX_CUSTOM_USER + #include "rgb_matrix_user.inc" + #endif + #undef RGB_MATRIX_EFFECT +#endif + RGB_MATRIX_EFFECT_MAX }; From a7113c8ed090d0ac647f30ee9b8ef41252e568ed Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 30 Apr 2019 00:18:50 +0200 Subject: [PATCH 048/129] Updated rgb_led struct field modifier to flags (#5619) Updated effects to test led flags Updated massdrop to use new flags field for led toggle --- docs/feature_rgb_matrix.md | 20 +- keyboards/boston_meetup/2019/2019.c | 14 +- keyboards/crkbd/rev1/rev1.c | 88 ++--- keyboards/doro67/rgb/rgb.c | 100 ++--- keyboards/dztech/dz40rgb/dz40rgb.c | 84 ++-- .../dztech/dz40rgb/keymaps/default/keymap.c | 6 +- .../dz40rgb/keymaps/split_space/keymap.c | 6 +- keyboards/dztech/dz60rgb/dz60rgb.c | 361 +++++++++--------- .../dztech/dz60rgb/keymaps/ansi/keymap.c | 6 +- .../dztech/dz60rgb/keymaps/hhkb/keymap.c | 6 +- .../dztech/dz60rgb/keymaps/hhkb_iso/keymap.c | 6 +- keyboards/dztech/dz60rgb/keymaps/iso/keymap.c | 6 +- .../dztech/dz60rgb/keymaps/mekanist/keymap.c | 8 +- keyboards/ergodox_ez/ergodox_ez.c | 84 ++-- keyboards/exclusive/e6_rgb/e6_rgb.c | 100 ++--- keyboards/hadron/ver3/ver3.c | 22 +- keyboards/hs60/v1/v1.c | 198 +++++----- keyboards/massdrop/alt/config.h | 1 - keyboards/massdrop/alt/config_led.c | 210 +++++----- .../massdrop/alt/keymaps/abishalom/keymap.c | 26 ++ .../massdrop/alt/keymaps/default/keymap.c | 26 ++ keyboards/massdrop/alt/keymaps/mac/keymap.c | 26 ++ keyboards/massdrop/ctrl/config.h | 1 - keyboards/massdrop/ctrl/config_led.c | 236 ++++++------ .../massdrop/ctrl/keymaps/default/keymap.c | 26 ++ keyboards/massdrop/ctrl/keymaps/mac/keymap.c | 26 ++ keyboards/model01/leds.c | 110 +++--- keyboards/planck/ez/ez.c | 66 ++-- keyboards/planck/keymaps/tom/keymap.c | 4 +- keyboards/planck/light/light.c | 70 ++-- keyboards/sol/rev1/rev1.c | 82 ++-- layouts/community/ergodox/drashna/keymap.c | 6 +- layouts/community/ortho_4x12/drashna/keymap.c | 6 +- quantum/rgb_matrix.c | 45 +-- quantum/rgb_matrix.h | 6 +- .../rgb_matrix_animations/alpha_mods_anim.h | 5 +- .../rgb_matrix_animations/breathing_anim.h | 1 + .../rgb_matrix_animations/cycle_all_anim.h | 6 +- .../cycle_left_right_anim.h | 3 +- .../cycle_up_down_anim.h | 3 +- .../rgb_matrix_animations/dual_beacon_anim.h | 3 +- .../gradient_up_down_anim.h | 3 +- .../jellybean_raindrops_anim.h | 9 +- .../rainbow_beacon_anim.h | 3 +- .../rainbow_moving_chevron_anim.h | 3 +- .../rainbow_pinwheels_anim.h | 3 +- .../rgb_matrix_animations/raindrops_anim.h | 7 +- .../rgb_matrix_animations/solid_color_anim.h | 1 + .../solid_reactive_anim.h | 1 + .../solid_reactive_cross.h | 3 +- .../solid_reactive_nexus.h | 3 +- .../solid_reactive_simple_anim.h | 1 + .../solid_reactive_wide.h | 3 +- .../rgb_matrix_animations/solid_splash_anim.h | 3 +- quantum/rgb_matrix_animations/splash_anim.h | 3 +- quantum/rgb_matrix_types.h | 24 +- tmk_core/protocol/arm_atsam/led_matrix.c | 4 +- 57 files changed, 1164 insertions(+), 1019 deletions(-) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 4ce9d15f0f6..91ec77ace08 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -127,13 +127,13 @@ Configure the hardware via your `config.h`: From this point forward the configuration is the same for all the drivers. The struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example: ```C -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 1}, + {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, .... } ``` @@ -147,7 +147,19 @@ y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. -`modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects). +`flags` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. + +## Flags + +|Define |Description | +|------------------------------------|-------------------------------------------| +|`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.| +|`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.| +|`#define LED_FLAG_NONE 0x00` |If thes LED has no flags. | +|`#define LED_FLAG_ALL 0xFF` |If thes LED has all flags. | +|`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. | +|`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. | +|`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. | ## Keycodes diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c index 9baed223bc8..45c18554915 100644 --- a/keyboards/boston_meetup/2019/2019.c +++ b/keyboards/boston_meetup/2019/2019.c @@ -21,17 +21,17 @@ #ifdef RGB_MATRIX_ENABLE #include "rgblight.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} | | modifier | | | */ - {{1|(3<<4)}, {188, 16}, 0}, - {{3|(3<<4)}, {187, 48}, 0}, - {{4|(2<<4)}, {149, 64}, 0}, - {{4|(1<<4)}, {112, 64}, 0}, - {{3|(0<<4)}, {37, 48}, 0}, - {{1|(0<<4)}, {38, 16}, 0} + {{1|(3<<4)}, {188, 16}, 4}, + {{3|(3<<4)}, {187, 48}, 4}, + {{4|(2<<4)}, {149, 64}, 4}, + {{4|(1<<4)}, {112, 64}, 4}, + {{3|(0<<4)}, {37, 48}, 4}, + {{1|(0<<4)}, {38, 16}, 4} }; #endif diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c index 0104adf1513..2345028d2c9 100644 --- a/keyboards/crkbd/rev1/rev1.c +++ b/keyboards/crkbd/rev1/rev1.c @@ -56,70 +56,70 @@ void led_set_kb(uint8_t usb_led) { * | | | modifier * | | | */ #define RGB_MATRIX_LEFT_LEDS \ - { { 0xFF }, { 85, 16 }, 0 }, /* 1 */ \ - { { 0xFF }, { 50, 13 }, 0 }, /* 2 */ \ - { { 0xFF }, { 16, 20 }, 0 }, /* 3 */ \ - { { 0xFF }, { 16, 38 }, 0 }, /* 4 */ \ - { { 0xFF }, { 50, 48 }, 0 }, /* 5 */ \ - { { 0xFF }, { 85, 52 }, 0 }, /* 6 */ \ + { { 0xFF }, { 85, 16 }, 2 }, /* 1 */ \ + { { 0xFF }, { 50, 13 }, 2 }, /* 2 */ \ + { { 0xFF }, { 16, 20 }, 2 }, /* 3 */ \ + { { 0xFF }, { 16, 38 }, 2 }, /* 4 */ \ + { { 0xFF }, { 50, 48 }, 2 }, /* 5 */ \ + { { 0xFF }, { 85, 52 }, 2 }, /* 6 */ \ { { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, /* 7 */ \ - { { 2 | ( 5 << 4 ) }, { 85, 39 }, 0 }, /* 8 */ \ - { { 1 | ( 5 << 4 ) }, { 85, 21 }, 0 }, /* 9 */ \ - { { 0 | ( 5 << 4 ) }, { 85, 4 }, 0 }, /* 10 */ \ - { { 0 | ( 4 << 4 ) }, { 68, 02 }, 0 }, /* 11 */ \ - { { 1 | ( 4 << 4 ) }, { 68, 19 }, 0 }, /* 12 */ \ - { { 2 | ( 4 << 4 ) }, { 68, 37 }, 0 }, /* 13 */ \ + { { 2 | ( 5 << 4 ) }, { 85, 39 }, 4 }, /* 8 */ \ + { { 1 | ( 5 << 4 ) }, { 85, 21 }, 4 }, /* 9 */ \ + { { 0 | ( 5 << 4 ) }, { 85, 4 }, 4 }, /* 10 */ \ + { { 0 | ( 4 << 4 ) }, { 68, 02 }, 4 }, /* 11 */ \ + { { 1 | ( 4 << 4 ) }, { 68, 19 }, 4 }, /* 12 */ \ + { { 2 | ( 4 << 4 ) }, { 68, 37 }, 4 }, /* 13 */ \ { { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, /* 14 */ \ { { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, /* 15 */ \ - { { 2 | ( 3 << 4 ) }, { 50, 35 }, 0 }, /* 16 */ \ - { { 1 | ( 3 << 4 ) }, { 50, 13 }, 0 }, /* 17 */ \ - { { 0 | ( 3 << 4 ) }, { 50, 0 }, 0 }, /* 18 */ \ - { { 0 | ( 2 << 4 ) }, { 33, 3 }, 0 }, /* 19 */ \ - { { 1 | ( 2 << 4 ) }, { 33, 20 }, 0 }, /* 20 */ \ - { { 2 | ( 2 << 4 ) }, { 33, 37 }, 0 }, /* 21 */ \ - { { 2 | ( 1 << 4 ) }, { 16, 42 }, 0 }, /* 22 */ \ - { { 1 | ( 1 << 4 ) }, { 16, 24 }, 0 }, /* 23 */ \ - { { 0 | ( 1 << 4 ) }, { 16, 7 }, 0 }, /* 24 */ \ + { { 2 | ( 3 << 4 ) }, { 50, 35 }, 4 }, /* 16 */ \ + { { 1 | ( 3 << 4 ) }, { 50, 13 }, 4 }, /* 17 */ \ + { { 0 | ( 3 << 4 ) }, { 50, 0 }, 4 }, /* 18 */ \ + { { 0 | ( 2 << 4 ) }, { 33, 3 }, 4 }, /* 19 */ \ + { { 1 | ( 2 << 4 ) }, { 33, 20 }, 4 }, /* 20 */ \ + { { 2 | ( 2 << 4 ) }, { 33, 37 }, 4 }, /* 21 */ \ + { { 2 | ( 1 << 4 ) }, { 16, 42 }, 4 }, /* 22 */ \ + { { 1 | ( 1 << 4 ) }, { 16, 24 }, 4 }, /* 23 */ \ + { { 0 | ( 1 << 4 ) }, { 16, 7 }, 4 }, /* 24 */ \ { { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, /* 25 */ \ { { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, /* 26 */ \ { { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, /* 27 */ #define RGB_MATRIX_RIGHT_LEDS \ - { { 0xFF }, { 139, 16 }, 0 }, /* 1 */ \ - { { 0xFF }, { 174, 13 }, 0 }, /* 2 */ \ - { { 0xFF }, { 208, 20 }, 0 }, /* 3 */ \ - { { 0xFF }, { 208, 38 }, 0 }, /* 4 */ \ - { { 0xFF }, { 174, 48 }, 0 }, /* 5 */ \ - { { 0xFF }, { 139, 52 }, 0 }, /* 6 */ \ + { { 0xFF }, { 139, 16 }, 2 }, /* 1 */ \ + { { 0xFF }, { 174, 13 }, 2 }, /* 2 */ \ + { { 0xFF }, { 208, 20 }, 2 }, /* 3 */ \ + { { 0xFF }, { 208, 38 }, 2 }, /* 4 */ \ + { { 0xFF }, { 174, 48 }, 2 }, /* 5 */ \ + { { 0xFF }, { 139, 52 }, 2 }, /* 6 */ \ { { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, /* 7 */ \ - { { 6 | ( 5 << 4 ) }, { 139, 39 }, 0 }, /* 8 */ \ - { { 5 | ( 5 << 4 ) }, { 139, 21 }, 0 }, /* 9 */ \ - { { 4 | ( 5 << 4 ) }, { 139, 4 }, 0 }, /* 10 */ \ - { { 4 | ( 4 << 4 ) }, { 156, 02 }, 0 }, /* 11 */ \ - { { 5 | ( 4 << 4 ) }, { 156, 19 }, 0 }, /* 12 */ \ - { { 6 | ( 4 << 4 ) }, { 156, 37 }, 0 }, /* 13 */ \ + { { 6 | ( 5 << 4 ) }, { 139, 39 }, 4 }, /* 8 */ \ + { { 5 | ( 5 << 4 ) }, { 139, 21 }, 4 }, /* 9 */ \ + { { 4 | ( 5 << 4 ) }, { 139, 4 }, 4 }, /* 10 */ \ + { { 4 | ( 4 << 4 ) }, { 156, 02 }, 4 }, /* 11 */ \ + { { 5 | ( 4 << 4 ) }, { 156, 19 }, 4 }, /* 12 */ \ + { { 6 | ( 4 << 4 ) }, { 156, 37 }, 4 }, /* 13 */ \ { { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, /* 14 */ \ { { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, /* 15 */ \ - { { 6 | ( 3 << 4 ) }, { 174, 35 }, 0 }, /* 16 */ \ - { { 5 | ( 3 << 4 ) }, { 174, 13 }, 0 }, /* 17 */ \ - { { 4 | ( 3 << 4 ) }, { 174, 0 }, 0 }, /* 18 */ \ - { { 4 | ( 2 << 4 ) }, { 191, 3 }, 0 }, /* 19 */ \ - { { 5 | ( 2 << 4 ) }, { 191, 20 }, 0 }, /* 20 */ \ - { { 6 | ( 2 << 4 ) }, { 191, 37 }, 0 }, /* 21 */ \ - { { 6 | ( 1 << 4 ) }, { 208, 42 }, 0 }, /* 22 */ \ - { { 5 | ( 1 << 4 ) }, { 208, 24 }, 0 }, /* 23 */ \ - { { 4 | ( 1 << 4 ) }, { 208, 7 }, 0 }, /* 24 */ \ + { { 6 | ( 3 << 4 ) }, { 174, 35 }, 4 }, /* 16 */ \ + { { 5 | ( 3 << 4 ) }, { 174, 13 }, 4 }, /* 17 */ \ + { { 4 | ( 3 << 4 ) }, { 174, 0 }, 4 }, /* 18 */ \ + { { 4 | ( 2 << 4 ) }, { 191, 3 }, 4 }, /* 19 */ \ + { { 5 | ( 2 << 4 ) }, { 191, 20 }, 4 }, /* 20 */ \ + { { 6 | ( 2 << 4 ) }, { 191, 37 }, 4 }, /* 21 */ \ + { { 6 | ( 1 << 4 ) }, { 208, 42 }, 4 }, /* 22 */ \ + { { 5 | ( 1 << 4 ) }, { 208, 24 }, 4 }, /* 23 */ \ + { { 4 | ( 1 << 4 ) }, { 208, 7 }, 4 }, /* 24 */ \ { { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, /* 25 */ \ { { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, /* 26 */ \ { { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, /* 27 */ #ifdef RGB_MATRIX_SPLIT_RIGHT -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { RGB_MATRIX_RIGHT_LEDS RGB_MATRIX_LEFT_LEDS }; #else -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { RGB_MATRIX_LEFT_LEDS RGB_MATRIX_RIGHT_LEDS }; diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c index 6f39e00c615..8aaf6ef4ad3 100644 --- a/keyboards/doro67/rgb/rgb.c +++ b/keyboards/doro67/rgb/rgb.c @@ -52,73 +52,73 @@ void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(0<<4)}, {15*0, 0}, 0}, // Esc - {{0|(1<<4)}, {15*1, 0}, 0}, // 1 - {{0|(2<<4)}, {15*2, 0}, 0}, // 2 - {{0|(3<<4)}, {15*3, 0}, 0}, // 3 - {{0|(4<<4)}, {15*4, 0}, 0}, // 4 - {{0|(5<<4)}, {15*5, 0}, 0}, // 5 - {{0|(6<<4)}, {15*6, 0}, 0}, // 6 - {{0|(7<<4)}, {15*7, 0}, 0}, // 7 - {{0|(8<<4)}, {15*8, 0}, 0}, // 8 - {{0|(9<<4)}, {15*9, 0}, 0}, // 9 - {{0|(10<<4)}, {15*10, 0}, 0}, // 0 - {{0|(11<<4)}, {15*11, 0}, 0}, // - - {{0|(12<<4)}, {15*12, 0}, 0}, // = +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0|(0<<4)}, {15*0, 0}, 4}, // Esc + {{0|(1<<4)}, {15*1, 0}, 4}, // 1 + {{0|(2<<4)}, {15*2, 0}, 4}, // 2 + {{0|(3<<4)}, {15*3, 0}, 4}, // 3 + {{0|(4<<4)}, {15*4, 0}, 4}, // 4 + {{0|(5<<4)}, {15*5, 0}, 4}, // 5 + {{0|(6<<4)}, {15*6, 0}, 4}, // 6 + {{0|(7<<4)}, {15*7, 0}, 4}, // 7 + {{0|(8<<4)}, {15*8, 0}, 4}, // 8 + {{0|(9<<4)}, {15*9, 0}, 4}, // 9 + {{0|(10<<4)}, {15*10, 0}, 4}, // 0 + {{0|(11<<4)}, {15*11, 0}, 4}, // - + {{0|(12<<4)}, {15*12, 0}, 4}, // = {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace {{0|(14<<4)}, {15*15, 0}, 1}, // Ins {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab - {{1|(1<<4)}, {15*1.5, 16}, 0}, // Q - {{1|(2<<4)}, {15*2.5, 16}, 0}, // W - {{1|(3<<4)}, {15*3.5, 16}, 0}, // E - {{1|(4<<4)}, {15*4.5, 16}, 0}, // R - {{1|(5<<4)}, {15*5.5, 16}, 0}, // T - {{1|(6<<4)}, {15*6.5, 16}, 0}, // Y - {{1|(7<<4)}, {15*7.5, 16}, 0}, // U - {{1|(8<<4)}, {15*8.5, 16}, 0}, // I - {{1|(9<<4)}, {15*9.5, 16}, 0}, // O - {{1|(10<<4)}, {15*10.5, 16}, 0}, // P - {{1|(11<<4)}, {15*11.5, 16}, 0}, // [ - {{1|(12<<4)}, {15*12.5, 16}, 0}, // ] - {{1|(13<<4)}, {15*13.75, 16}, 1}, // + {{1|(1<<4)}, {15*1.5, 16}, 4}, // Q + {{1|(2<<4)}, {15*2.5, 16}, 4}, // W + {{1|(3<<4)}, {15*3.5, 16}, 4}, // E + {{1|(4<<4)}, {15*4.5, 16}, 4}, // R + {{1|(5<<4)}, {15*5.5, 16}, 4}, // T + {{1|(6<<4)}, {15*6.5, 16}, 4}, // Y + {{1|(7<<4)}, {15*7.5, 16}, 4}, // U + {{1|(8<<4)}, {15*8.5, 16}, 4}, // I + {{1|(9<<4)}, {15*9.5, 16}, 4}, // O + {{1|(10<<4)}, {15*10.5, 16}, 4}, // P + {{1|(11<<4)}, {15*11.5, 16}, 4}, // [ + {{1|(12<<4)}, {15*12.5, 16}, 4}, // ] + {{1|(13<<4)}, {15*13.75, 16}, 1}, // {{1|(14<<4)}, {15*15, 16}, 1}, // Del {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock - {{2|(1<<4)}, {15*1.75, 32}, 0}, // A - {{2|(2<<4)}, {15*2.75, 32}, 0}, // S - {{2|(3<<4)}, {15*3.75, 32}, 0}, // D - {{2|(4<<4)}, {15*4.75, 32}, 0}, // F - {{2|(5<<4)}, {15*5.75, 32}, 0}, // G - {{2|(6<<4)}, {15*6.75, 32}, 0}, // H - {{2|(7<<4)}, {15*7.75, 32}, 0}, // J - {{2|(8<<4)}, {15*8.75, 32}, 0}, // K - {{2|(9<<4)}, {15*9.75, 32}, 0}, // L - {{2|(10<<4)}, {15*10.75, 32}, 0}, // ; - {{2|(11<<4)}, {15*11.75, 32}, 0}, // ' + {{2|(1<<4)}, {15*1.75, 32}, 4}, // A + {{2|(2<<4)}, {15*2.75, 32}, 4}, // S + {{2|(3<<4)}, {15*3.75, 32}, 4}, // D + {{2|(4<<4)}, {15*4.75, 32}, 4}, // F + {{2|(5<<4)}, {15*5.75, 32}, 4}, // G + {{2|(6<<4)}, {15*6.75, 32}, 4}, // H + {{2|(7<<4)}, {15*7.75, 32}, 4}, // J + {{2|(8<<4)}, {15*8.75, 32}, 4}, // K + {{2|(9<<4)}, {15*9.75, 32}, 4}, // L + {{2|(10<<4)}, {15*10.75, 32}, 4}, // ; + {{2|(11<<4)}, {15*11.75, 32}, 4}, // ' {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift - {{3|(2<<4)}, {15*2, 48}, 0}, // Z - {{3|(3<<4)}, {15*3, 48}, 0}, // X - {{3|(4<<4)}, {15*4, 48}, 0}, // C - {{3|(5<<4)}, {15*5, 48}, 0}, // V - {{3|(6<<4)}, {15*6, 48}, 0}, // B - {{3|(7<<4)}, {15*7, 48}, 0}, // N - {{3|(8<<4)}, {15*8, 48}, 0}, // M - {{3|(9<<4)}, {15*9, 48}, 0}, // , - {{3|(10<<4)}, {15*10, 48}, 0}, // . - {{3|(11<<4)}, {15*11, 48}, 0}, // / + {{3|(2<<4)}, {15*2, 48}, 4}, // Z + {{3|(3<<4)}, {15*3, 48}, 4}, // X + {{3|(4<<4)}, {15*4, 48}, 4}, // C + {{3|(5<<4)}, {15*5, 48}, 4}, // V + {{3|(6<<4)}, {15*6, 48}, 4}, // B + {{3|(7<<4)}, {15*7, 48}, 4}, // N + {{3|(8<<4)}, {15*8, 48}, 4}, // M + {{3|(9<<4)}, {15*9, 48}, 4}, // , + {{3|(10<<4)}, {15*10, 48}, 4}, // . + {{3|(11<<4)}, {15*11, 48}, 4}, // / {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift {{3|(13<<4)}, {15*14, 48}, 1}, // Up {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn - + {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt - {{4|(3<<4)}, {15*6.75, 64}, 0}, // Space + {{4|(3<<4)}, {15*6.75, 64}, 4}, // Space {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN {{4|(12<<4)}, {15*13, 64}, 1}, // Left diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c index b1a03760f85..34bfc4366f3 100644 --- a/keyboards/dztech/dz40rgb/dz40rgb.c +++ b/keyboards/dztech/dz40rgb/dz40rgb.c @@ -71,7 +71,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(11<<4)}, {20.36*11, 0}, 1}, {{0|(10<<4)}, {20.36*10, 0}, 1}, @@ -90,32 +90,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33}, 0}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 0}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 0}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 0}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 0}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 0}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 0}, + {{1|(10<<4)}, {20.36*10, 21.33}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33}, 4}, + {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, + {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, + {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, + {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, + {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, + {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0}, + {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, + {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, + {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, + {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, + {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, + {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, @@ -205,7 +205,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(11<<4)}, {20.36*11, 0}, 1}, {{0|(10<<4)}, {20.36*10, 0}, 1}, @@ -224,32 +224,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33}, 0}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 0}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 0}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 0}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 0}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 0}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 0}, + {{1|(10<<4)}, {20.36*10, 21.33}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33}, 4}, + {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, + {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, + {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, + {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, + {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, + {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0}, + {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, + {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, + {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, + {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, + {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, + {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c index 6ea7421c928..59b917121c6 100644 --- a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c @@ -35,10 +35,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c index bbbe5a8f0c0..5613e350003 100644 --- a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c @@ -58,10 +58,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/dz60rgb.c b/keyboards/dztech/dz60rgb/dz60rgb.c index a6825e750fd..10b2ea7a83d 100644 --- a/keyboards/dztech/dz60rgb/dz60rgb.c +++ b/keyboards/dztech/dz60rgb/dz60rgb.c @@ -64,7 +64,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {16*13.5, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, {{0|(11<<4)}, {16*11, 0}, 1}, @@ -80,49 +81,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.875, 64}, 1}, {{4|(11<<4)}, {16*12.625, 64}, 1}, {{4|(10<<4)}, {16*11.375, 64}, 1}, {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 0}, + {{4|(5<<4)}, { 16*6.375, 64}, 4}, {{4|(2<<4)}, { 16*2.625, 64}, 1}, {{4|(1<<4)}, { 16*1.375, 64}, 1}, {{4|(0<<4)}, { 16*0.125, 64}, 1}, @@ -192,7 +193,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(12<<4)}, {16*14, 0}, 1}, {{0|(13<<4)}, {16*13, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, @@ -209,49 +211,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{2|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 0}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(11<<4)}, {16*12.625, 48}, 4}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.625, 64}, 1}, {{4|(11<<4)}, {16*12.375, 64}, 1}, {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 0}, + {{4|(5<<4)}, { 16*7, 64}, 4}, {{4|(2<<4)}, { 16*2.875, 64}, 1}, {{4|(1<<4)}, { 16*1.625, 64}, 1}, {{4|(0<<4)}, { 16*0.375, 64}, 1}, @@ -321,7 +323,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(12<<4)}, {16*14, 0}, 1}, {{0|(13<<4)}, {16*13, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, @@ -338,49 +341,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 0}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(11<<4)}, {16*12.625, 48}, 4}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.625, 64}, 1}, {{4|(11<<4)}, {16*12.375, 64}, 1}, {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 0}, + {{4|(5<<4)}, { 16*7, 64}, 4}, {{4|(2<<4)}, { 16*2.875, 64}, 1}, {{4|(1<<4)}, { 16*1.625, 64}, 1}, {{4|(0<<4)}, { 16*0.375, 64}, 1}, @@ -449,7 +452,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {16*13.5, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, {{0|(11<<4)}, {16*11, 0}, 1}, @@ -465,49 +469,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{2|(13<<4)}, {16*13.375, 24}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.875, 64}, 1}, {{4|(11<<4)}, {16*12.625, 64}, 1}, {{4|(10<<4)}, {16*11.375, 64}, 1}, {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 0}, + {{4|(5<<4)}, { 16*6.375, 64}, 4}, {{4|(2<<4)}, { 16*2.625, 64}, 1}, {{4|(1<<4)}, { 16*1.375, 64}, 1}, {{4|(0<<4)}, { 16*0.125, 64}, 1}, @@ -578,7 +582,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {17.23*13, 0}, 1}, {{0|(12<<4)}, {17.23*12, 0}, 1}, {{0|(11<<4)}, {17.23*11, 0}, 1}, @@ -594,51 +599,51 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, { 17.23*1, 0}, 1}, {{0|(0<<4)}, { 17.23*0, 0}, 1}, {{1|(13<<4)}, {17.23*13, 16}, 1}, - {{1|(12<<4)}, {17.23*12, 16}, 0}, - {{1|(11<<4)}, {17.23*11, 16}, 0}, - {{1|(10<<4)}, {17.23*10, 16}, 0}, - {{1|(9<<4)}, {17.23*9, 16}, 0}, - {{1|(8<<4)}, {17.23*8, 16}, 0}, - {{1|(7<<4)}, {17.23*7, 16}, 0}, - {{1|(6<<4)}, { 17.23*6, 16}, 0}, - {{1|(5<<4)}, { 17.23*5, 16}, 0}, - {{1|(4<<4)}, { 17.23*4, 16}, 0}, - {{1|(3<<4)}, { 17.23*3, 16}, 0}, - {{1|(2<<4)}, { 17.23*2, 16}, 0}, - {{1|(1<<4)}, { 17.23*1, 16}, 0}, + {{1|(12<<4)}, {17.23*12, 16}, 4}, + {{1|(11<<4)}, {17.23*11, 16}, 4}, + {{1|(10<<4)}, {17.23*10, 16}, 4}, + {{1|(9<<4)}, {17.23*9, 16}, 4}, + {{1|(8<<4)}, {17.23*8, 16}, 4}, + {{1|(7<<4)}, {17.23*7, 16}, 4}, + {{1|(6<<4)}, { 17.23*6, 16}, 4}, + {{1|(5<<4)}, { 17.23*5, 16}, 4}, + {{1|(4<<4)}, { 17.23*4, 16}, 4}, + {{1|(3<<4)}, { 17.23*3, 16}, 4}, + {{1|(2<<4)}, { 17.23*2, 16}, 4}, + {{1|(1<<4)}, { 17.23*1, 16}, 4}, {{1|(0<<4)}, { 17.23*0, 16}, 1}, {{2|(13<<4)}, {17.23*13, 32}, 1}, - {{2|(11<<4)}, {17.23*11, 32}, 0}, - {{2|(10<<4)}, {17.23*10, 32}, 0}, - {{2|(9<<4)}, {17.23*9, 32}, 0}, - {{2|(8<<4)}, {17.23*8, 32}, 0}, - {{2|(7<<4)}, {17.23*7, 32}, 0}, - {{2|(6<<4)}, { 17.23*6, 32}, 0}, - {{2|(5<<4)}, { 17.23*5, 32}, 0}, - {{2|(4<<4)}, { 17.23*4, 32}, 0}, - {{2|(3<<4)}, { 17.23*3, 32}, 0}, - {{2|(2<<4)}, { 17.23*2, 32}, 0}, - {{2|(1<<4)}, { 17.23*1, 32}, 0}, + {{2|(11<<4)}, {17.23*11, 32}, 4}, + {{2|(10<<4)}, {17.23*10, 32}, 4}, + {{2|(9<<4)}, {17.23*9, 32}, 4}, + {{2|(8<<4)}, {17.23*8, 32}, 4}, + {{2|(7<<4)}, {17.23*7, 32}, 4}, + {{2|(6<<4)}, { 17.23*6, 32}, 4}, + {{2|(5<<4)}, { 17.23*5, 32}, 4}, + {{2|(4<<4)}, { 17.23*4, 32}, 4}, + {{2|(3<<4)}, { 17.23*3, 32}, 4}, + {{2|(2<<4)}, { 17.23*2, 32}, 4}, + {{2|(1<<4)}, { 17.23*1, 32}, 4}, {{2|(0<<4)}, { 17.23*0, 32}, 1}, {{3|(13<<4)}, {17.23*13, 48}, 1}, - {{3|(11<<4)}, {17.23*11, 48}, 0}, - {{3|(10<<4)}, {17.23*10, 48}, 0}, - {{3|(9<<4)}, {17.23*9, 48}, 0}, - {{3|(8<<4)}, {17.23*8, 48}, 0}, - {{3|(7<<4)}, {17.23*7, 48}, 0}, - {{3|(6<<4)}, { 17.23*6, 48}, 0}, - {{3|(5<<4)}, { 17.23*5, 48}, 0}, - {{3|(4<<4)}, { 17.23*4, 48}, 0}, - {{3|(3<<4)}, { 17.23*3, 48}, 0}, - {{3|(2<<4)}, { 17.23*2, 48}, 0}, - {{3|(1<<4)}, { 17.23*1, 48}, 0}, + {{3|(11<<4)}, {17.23*11, 48}, 4}, + {{3|(10<<4)}, {17.23*10, 48}, 4}, + {{3|(9<<4)}, {17.23*9, 48}, 4}, + {{3|(8<<4)}, {17.23*8, 48}, 4}, + {{3|(7<<4)}, {17.23*7, 48}, 4}, + {{3|(6<<4)}, { 17.23*6, 48}, 4}, + {{3|(5<<4)}, { 17.23*5, 48}, 4}, + {{3|(4<<4)}, { 17.23*4, 48}, 4}, + {{3|(3<<4)}, { 17.23*3, 48}, 4}, + {{3|(2<<4)}, { 17.23*2, 48}, 4}, + {{3|(1<<4)}, { 17.23*1, 48}, 4}, {{3|(0<<4)}, { 17.23*0, 48}, 1}, {{4|(13<<4)}, {17.23*13, 64}, 1}, {{4|(11<<4)}, {17.23*11, 64}, 1}, {{4|(10<<4)}, {17.23*10, 64}, 1}, {{4|(9<<4)}, {17.23*9, 64}, 1}, {{4|(8<<4)}, {17.23*8, 64}, 1}, - {{4|(5<<4)}, { 17.23*5, 64}, 0}, + {{4|(5<<4)}, { 17.23*5, 64}, 4}, {{4|(2<<4)}, { 17.23*2, 64}, 1}, {{4|(1<<4)}, { 17.23*1, 64}, 1}, {{4|(0<<4)}, { 17.23*0, 64}, 1}, diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c index fcdf29e4ee2..741fc55fb9e 100644 --- a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c @@ -42,10 +42,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c index 6ba3ac7e6c8..1f3807c3b7e 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c @@ -43,10 +43,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c index 772eddf07c9..4575eb19d58 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c @@ -43,10 +43,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c index a78e23703be..5e388480359 100644 --- a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c @@ -42,10 +42,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index 2784f6fa672..3dfa7837444 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -56,11 +56,9 @@ void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool defa for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color(i, red, green, blue); - } + + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 6f4ae9fed17..13ea843022d 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -269,64 +269,64 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} - | | modifier + | | flags | | | */ - {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 0}, // LED 1 on right > Key 6 - {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 0}, // LED 2 > Key 7 - {{10|(0<<4)}, {17.2*10, 12.8*0}, 0}, // LED 3 > Key 8 - {{11|(0<<4)}, {17.2*11, 12.8*0}, 0}, // LED 4 > Key 9 - {{12|(0<<4)}, {17.2*12, 12.8*0}, 0}, // LED 5 > Key 0 + {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 4}, // LED 1 on right > Key 6 + {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 4}, // LED 2 > Key 7 + {{10|(0<<4)}, {17.2*10, 12.8*0}, 4}, // LED 3 > Key 8 + {{11|(0<<4)}, {17.2*11, 12.8*0}, 4}, // LED 4 > Key 9 + {{12|(0<<4)}, {17.2*12, 12.8*0}, 4}, // LED 5 > Key 0 - {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 0}, // LED 6 - {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 0}, // LED 7 - {{10|(1<<4)}, {17.2*10, 12.8*1}, 0}, // LED 8 - {{11|(1<<4)}, {17.2*11, 12.8*1}, 0}, // LED 9 - {{12|(1<<4)}, {17.2*12, 12.8*1}, 0}, // LED 10 + {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 4}, // LED 6 + {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 4}, // LED 7 + {{10|(1<<4)}, {17.2*10, 12.8*1}, 4}, // LED 8 + {{11|(1<<4)}, {17.2*11, 12.8*1}, 4}, // LED 9 + {{12|(1<<4)}, {17.2*12, 12.8*1}, 4}, // LED 10 - {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 0}, // LED 11 - {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 0}, // LED 12 - {{10|(2<<4)}, {17.2*10, 12.8*2}, 0}, // LED 13 - {{11|(2<<4)}, {17.2*11, 12.8*2}, 0}, // LED 14 - {{12|(2<<4)}, {17.2*12, 12.8*2}, 0}, // LED 15 + {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 4}, // LED 11 + {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 4}, // LED 12 + {{10|(2<<4)}, {17.2*10, 12.8*2}, 4}, // LED 13 + {{11|(2<<4)}, {17.2*11, 12.8*2}, 4}, // LED 14 + {{12|(2<<4)}, {17.2*12, 12.8*2}, 4}, // LED 15 - {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 0}, // LED 16 - {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 0}, // LED 17 - {{10|(3<<4)}, {17.2*10, 12.8*3}, 0}, // LED 18 - {{11|(3<<4)}, {17.2*11, 12.8*3}, 0}, // LED 19 - {{12|(3<<4)}, {17.2*12, 12.8*3}, 0}, // LED 20 + {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 4}, // LED 16 + {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 4}, // LED 17 + {{10|(3<<4)}, {17.2*10, 12.8*3}, 4}, // LED 18 + {{11|(3<<4)}, {17.2*11, 12.8*3}, 4}, // LED 19 + {{12|(3<<4)}, {17.2*12, 12.8*3}, 4}, // LED 20 {{ 9|(4<<4)}, {17.2* 9, 12.8*4}, 1}, // LED 21 {{10|(4<<4)}, {17.2*10, 12.8*4}, 1}, // LED 22 {{11|(4<<4)}, {17.2*11, 12.8*4}, 1}, // LED 23 {{12|(4<<4)}, {17.2*12, 12.8*4}, 1}, // LED 24 - {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 0}, // LED 1 on left > Key 5 - {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 0}, // LED 2 > Key 4 - {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 0}, // LED 3 > Key 3 - {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 0}, // LED 4 > Key 2 - {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 0}, // LED 5 > Key 1 + {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 4}, // LED 1 on left > Key 5 + {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 4}, // LED 2 > Key 4 + {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 4}, // LED 3 > Key 3 + {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 4}, // LED 4 > Key 2 + {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 4}, // LED 5 > Key 1 - {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 0}, // LED 6 - {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 0}, // LED 7 - {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 0}, // LED 8 - {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 0}, // LED 9 - {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 0}, // LED 10 + {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 4}, // LED 6 + {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 4}, // LED 7 + {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 4}, // LED 8 + {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 4}, // LED 9 + {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 4}, // LED 10 - {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 0}, // LED 11 - {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 0}, // LED 12 - {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 0}, // LED 13 - {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 0}, // LED 14 - {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 0}, // LED 15 + {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 4}, // LED 11 + {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 4}, // LED 12 + {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 4}, // LED 13 + {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 4}, // LED 14 + {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 4}, // LED 15 - {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 0}, // LED 16 - {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 0}, // LED 17 - {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 0}, // LED 18 - {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 0}, // LED 19 - {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 0}, // LED 20 + {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 4}, // LED 16 + {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 4}, // LED 17 + {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 4}, // LED 18 + {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 4}, // LED 19 + {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 4}, // LED 20 {{ 4|(4<<4)}, {17.2* 4, 12.8*4}, 1}, // LED 21 {{ 3|(4<<4)}, {17.2* 3, 12.8*4}, 1}, // LED 22 diff --git a/keyboards/exclusive/e6_rgb/e6_rgb.c b/keyboards/exclusive/e6_rgb/e6_rgb.c index d50af86b51b..42f8799904f 100644 --- a/keyboards/exclusive/e6_rgb/e6_rgb.c +++ b/keyboards/exclusive/e6_rgb/e6_rgb.c @@ -114,80 +114,80 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_16, D_16, F_16}, {0, B_16, A_16, C_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ //cs1 {{0|(0<<4)}, { 0, 0}, 1}, - {{0|(1<<4)}, { 17, 0}, 0}, + {{0|(1<<4)}, { 17, 0}, 4}, {{1|(0<<4)}, { 0, 16}, 1}, {{2|(0<<4)}, { 0, 32}, 1}, //cs2 - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, + {{0|(2<<4)}, { 34, 0}, 4}, + {{0|(3<<4)}, { 51, 0}, 4}, + {{1|(1<<4)}, { 17, 16}, 4}, + {{1|(2<<4)}, { 34, 16}, 4}, //cs3 - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{3|(1<<4)}, { 17, 48}, 0}, - {{3|(2<<4)}, { 34, 48}, 0}, + {{2|(1<<4)}, { 17, 32}, 4}, + {{2|(2<<4)}, { 34, 32}, 4}, + {{3|(1<<4)}, { 17, 48}, 4}, + {{3|(2<<4)}, { 34, 48}, 4}, //cs4 - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(5<<4)}, { 85, 0}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, + {{0|(4<<4)}, { 68, 0}, 4}, + {{0|(5<<4)}, { 85, 0}, 4}, + {{1|(3<<4)}, { 51, 16}, 4}, + {{1|(4<<4)}, { 68, 16}, 4}, //cs5 - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(12<<4)}, {204, 0}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, + {{0|(11<<4)}, {187, 0}, 4}, + {{0|(12<<4)}, {204, 0}, 4}, + {{1|(11<<4)}, {187, 16}, 4}, + {{1|(12<<4)}, {204, 16}, 4}, //cs6 - {{0|(7<<4)}, {119, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, + {{0|(7<<4)}, {119, 0}, 4}, + {{0|(8<<4)}, {136, 0}, 4}, + {{1|(7<<4)}, {119, 16}, 4}, + {{1|(8<<4)}, {136, 16}, 4}, //cs7 - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, + {{0|(9<<4)}, {153, 0}, 4}, + {{0|(10<<4)}, {170, 0}, 4}, + {{1|(9<<4)}, {153, 16}, 4}, + {{1|(10<<4)}, {170, 16}, 4}, //cs8 - {{0|(13<<4)}, {221, 0}, 0}, - {{0|(14<<4)}, {221, 0}, 0}, + {{0|(13<<4)}, {221, 0}, 4}, + {{0|(14<<4)}, {221, 0}, 4}, {{1|(13<<4)}, {221, 32}, 1}, {{2|(12<<4)}, {221, 16}, 1}, //cs9 - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, + {{2|(3<<4)}, { 51, 32}, 4}, + {{2|(4<<4)}, { 68, 32}, 4}, + {{3|(3<<4)}, { 51, 48}, 4}, + {{3|(4<<4)}, { 68, 48}, 4}, //cs10 - {{0|(6<<4)}, {102, 0}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, + {{0|(6<<4)}, {102, 0}, 4}, + {{1|(5<<4)}, { 85, 16}, 4}, + {{1|(6<<4)}, {102, 16}, 4}, + {{2|(5<<4)}, { 85, 32}, 4}, //cs11 - {{2|(6<<4)}, {102, 32}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(5<<4)}, {102, 64}, 0}, + {{2|(6<<4)}, {102, 32}, 4}, + {{3|(5<<4)}, { 85, 48}, 4}, + {{3|(6<<4)}, {102, 48}, 4}, + {{4|(5<<4)}, {102, 64}, 4}, //cs12 - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, + {{2|(7<<4)}, {119, 32}, 4}, + {{2|(8<<4)}, {136, 32}, 4}, + {{3|(7<<4)}, {119, 48}, 4}, + {{3|(8<<4)}, {136, 48}, 4}, //cs13 - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(9<<4)}, {153, 48}, 0}, + {{2|(9<<4)}, {153, 32}, 4}, + {{2|(10<<4)}, {170, 32}, 4}, + {{3|(9<<4)}, {153, 48}, 4}, {{4|(6<<4)}, {136, 48}, 1}, //cs14 - {{2|(11<<4)}, {187, 32}, 0}, - {{3|(10<<4)}, {170, 48}, 0}, + {{2|(11<<4)}, {187, 32}, 4}, + {{3|(10<<4)}, {170, 48}, 4}, {{3|(11<<4)}, {187, 48}, 1}, {{4|(7<<4)}, {153, 48}, 1}, //cs15 diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c index e99ed11a779..5827b42e20f 100644 --- a/keyboards/hadron/ver3/ver3.c +++ b/keyboards/hadron/ver3/ver3.c @@ -21,21 +21,21 @@ #ifdef RGB_MATRIX_ENABLE #include "rgblight.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} | | modifier | | | */ - {{1|(13<<4)}, {195, 3}, 0}, - {{4|(13<<4)}, {195, 16}, 0}, - {{4|(10<<4)}, {150, 16}, 0}, - {{4|(7<<4)}, {105, 16}, 0}, - {{4|(4<<4)}, {60, 16}, 0}, - {{4|(1<<4)}, {15, 16}, 0}, - {{1|(1<<4)}, {15, 3}, 0}, - {{1|(4<<4)}, {60, 3}, 0}, - {{1|(7<<4)}, {105, 3}, 0}, - {{1|(10<<4)}, {150, 3}, 0} + {{1|(13<<4)}, {195, 3}, 4}, + {{4|(13<<4)}, {195, 16}, 4}, + {{4|(10<<4)}, {150, 16}, 4}, + {{4|(7<<4)}, {105, 16}, 4}, + {{4|(4<<4)}, {60, 16}, 4}, + {{4|(1<<4)}, {15, 16}, 4}, + {{1|(1<<4)}, {15, 3}, 4}, + {{1|(4<<4)}, {60, 3}, 4}, + {{1|(7<<4)}, {105, 3}, 4}, + {{1|(10<<4)}, {150, 3}, 4} }; #endif diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c index 882611030b6..bd6dd19b2a7 100644 --- a/keyboards/hs60/v1/v1.c +++ b/keyboards/hs60/v1/v1.c @@ -165,7 +165,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // // C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, // C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, A15, @@ -174,70 +174,70 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, + {{0|(12<<4)}, {204, 0}, 4}, + {{0|(11<<4)}, {187, 0}, 4}, + {{0|(10<<4)}, {170, 0}, 4}, + {{0|(9<<4)}, {153, 0}, 4}, + {{0|(8<<4)}, {136, 0}, 4}, + {{0|(7<<4)}, {119, 0}, 4}, + {{1|(7<<4)}, {119, 16}, 4}, + {{1|(8<<4)}, {136, 16}, 4}, + {{1|(9<<4)}, {153, 16}, 4}, + {{1|(10<<4)}, {170, 16}, 4}, + {{1|(11<<4)}, {187, 16}, 4}, + {{1|(12<<4)}, {204, 16}, 4}, {{2|(13<<4)}, {224, 32}, 1}, - {{2|(12<<4)}, {224, 16}, 0}, - {{2|(11<<4)}, {197, 32}, 0}, + {{2|(12<<4)}, {224, 16}, 4}, + {{2|(11<<4)}, {197, 32}, 4}, - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, + {{3|(10<<4)}, {170, 48}, 4}, //B1-B14 + {{3|(9<<4)}, {153, 48}, 4}, + {{3|(8<<4)}, {136, 48}, 4}, + {{3|(7<<4)}, {119, 48}, 4}, + {{2|(7<<4)}, {119, 32}, 4}, + {{2|(8<<4)}, {136, 32}, 4}, + {{2|(9<<4)}, {153, 32}, 4}, + {{2|(10<<4)}, {170, 32}, 4}, + {{3|(11<<4)}, {187, 48}, 4}, {{3|(13<<4)}, {214, 48}, 1}, {{4|(13<<4)}, {224, 64}, 1}, {{4|(12<<4)}, {204, 64}, 1}, {{4|(11<<4)}, {187, 64}, 1}, {{4|(10<<4)}, {170, 64}, 1}, - {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, + {{0|(6<<4)}, {102, 0}, 4}, //C1-C16 + {{0|(5<<4)}, { 85, 0}, 4}, + {{0|(4<<4)}, { 68, 0}, 4}, + {{0|(3<<4)}, { 51, 0}, 4}, + {{0|(2<<4)}, { 34, 0}, 4}, + {{0|(1<<4)}, { 17, 0}, 4}, {{0|(0<<4)}, { 0, 0}, 1}, {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, + {{1|(1<<4)}, { 17, 16}, 4}, + {{1|(2<<4)}, { 34, 16}, 4}, + {{1|(3<<4)}, { 51, 16}, 4}, + {{1|(4<<4)}, { 68, 16}, 4}, + {{1|(5<<4)}, { 85, 16}, 4}, + {{1|(6<<4)}, {102, 16}, 4}, + {{2|(6<<4)}, {102, 32}, 4}, + {{2|(5<<4)}, { 85, 32}, 4}, - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 + {{3|(2<<4)}, { 32, 48}, 4}, //D1-D16 //D2 {{3|(0<<4)}, { 10, 48}, 1}, {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, + {{2|(1<<4)}, { 17, 32}, 4}, + {{2|(2<<4)}, { 34, 32}, 4}, + {{2|(3<<4)}, { 51, 32}, 4}, + {{2|(4<<4)}, { 68, 32}, 4}, + {{3|(3<<4)}, { 51, 48}, 4}, + {{3|(4<<4)}, { 68, 48}, 4}, + {{3|(5<<4)}, { 85, 48}, 4}, + {{3|(6<<4)}, {102, 48}, 4}, + {{4|(3<<4)}, {102, 64}, 4}, {{4|(2<<4)}, { 34, 68}, 1}, {{4|(1<<4)}, { 17, 68}, 1}, {{4|(0<<4)}, { 0, 68}, 1} @@ -319,7 +319,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // // C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, // C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, ---, @@ -328,70 +328,70 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, + {{0|(12<<4)}, {204, 0}, 4}, + {{0|(11<<4)}, {187, 0}, 4}, + {{0|(10<<4)}, {170, 0}, 4}, + {{0|(9<<4)}, {153, 0}, 4}, + {{0|(8<<4)}, {136, 0}, 4}, + {{0|(7<<4)}, {119, 0}, 4}, + {{1|(7<<4)}, {119, 16}, 4}, + {{1|(8<<4)}, {136, 16}, 4}, + {{1|(9<<4)}, {153, 16}, 4}, + {{1|(10<<4)}, {170, 16}, 4}, + {{1|(11<<4)}, {187, 16}, 4}, + {{1|(12<<4)}, {204, 16}, 4}, {{2|(13<<4)}, {224, 8}, 1}, - {{2|(12<<4)}, {204, 32}, 0}, - {{2|(11<<4)}, {187, 32}, 0}, + {{2|(12<<4)}, {204, 32}, 4}, + {{2|(11<<4)}, {187, 32}, 4}, - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, + {{3|(10<<4)}, {170, 48}, 4}, //B1-B14 + {{3|(9<<4)}, {153, 48}, 4}, + {{3|(8<<4)}, {136, 48}, 4}, + {{3|(7<<4)}, {119, 48}, 4}, + {{2|(7<<4)}, {119, 32}, 4}, + {{2|(8<<4)}, {136, 32}, 4}, + {{2|(9<<4)}, {153, 32}, 4}, + {{2|(10<<4)}, {170, 32}, 4}, + {{3|(11<<4)}, {187, 48}, 4}, {{3|(13<<4)}, {214, 48}, 1}, {{4|(13<<4)}, {224, 64}, 1}, {{4|(12<<4)}, {204, 64}, 1}, {{4|(11<<4)}, {187, 64}, 1}, {{4|(10<<4)}, {170, 64}, 1}, - {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, + {{0|(6<<4)}, {102, 0}, 4}, //C1-C16 + {{0|(5<<4)}, { 85, 0}, 4}, + {{0|(4<<4)}, { 68, 0}, 4}, + {{0|(3<<4)}, { 51, 0}, 4}, + {{0|(2<<4)}, { 34, 0}, 4}, + {{0|(1<<4)}, { 17, 0}, 4}, {{0|(0<<4)}, { 0, 0}, 1}, {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, + {{1|(1<<4)}, { 17, 16}, 4}, + {{1|(2<<4)}, { 34, 16}, 4}, + {{1|(3<<4)}, { 51, 16}, 4}, + {{1|(4<<4)}, { 68, 16}, 4}, + {{1|(5<<4)}, { 85, 16}, 4}, + {{1|(6<<4)}, {102, 16}, 4}, + {{2|(6<<4)}, {102, 32}, 4}, + {{2|(5<<4)}, { 85, 32}, 4}, - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 - {{3|(1<<4)}, { 17, 48}, 0}, + {{3|(2<<4)}, { 32, 48}, 4}, //D1-D16 + {{3|(1<<4)}, { 17, 48}, 4}, {{3|(0<<4)}, { 0, 48}, 1}, {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, + {{2|(1<<4)}, { 17, 32}, 4}, + {{2|(2<<4)}, { 34, 32}, 4}, + {{2|(3<<4)}, { 51, 32}, 4}, + {{2|(4<<4)}, { 68, 32}, 4}, + {{3|(3<<4)}, { 51, 48}, 4}, + {{3|(4<<4)}, { 68, 48}, 4}, + {{3|(5<<4)}, { 85, 48}, 4}, + {{3|(6<<4)}, {102, 48}, 4}, + {{4|(3<<4)}, {102, 64}, 4}, {{4|(2<<4)}, { 34, 68}, 1}, {{4|(1<<4)}, { 17, 68}, 1}, {{4|(0<<4)}, { 0, 68}, 1} diff --git a/keyboards/massdrop/alt/config.h b/keyboards/massdrop/alt/config.h index f63c38bf6f8..59e66e13307 100644 --- a/keyboards/massdrop/alt/config.h +++ b/keyboards/massdrop/alt/config.h @@ -123,6 +123,5 @@ along with this program. If not, see . #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_LED_PROCESS_LIMIT 15 #define RGB_MATRIX_LED_FLUSH_LIMIT 10 -#define RGB_MATRIX_EXTRA_TOG #include "config_led.h" diff --git a/keyboards/massdrop/alt/config_led.c b/keyboards/massdrop/alt/config_led.c index 7d98e47c907..1a9a539a076 100644 --- a/keyboards/massdrop/alt/config_led.c +++ b/keyboards/massdrop/alt/config_led.c @@ -20,122 +20,122 @@ // // There is a quick-and-dirty implementation of this under ledvis.html -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /* 0 */ { { (0)|(0 << 4) }, { 8, 56 }, 0 }, // KC_ESC - /* 1 */ { { (0)|(1 << 4) }, { 22, 56 }, 0 }, // KC_1 - /* 2 */ { { (0)|(2 << 4) }, { 35, 56 }, 0 }, // KC_2 - /* 3 */ { { (0)|(3 << 4) }, { 49, 56 }, 0 }, // KC_3 - /* 4 */ { { (0)|(4 << 4) }, { 63, 56 }, 0 }, // KC_4 - /* 5 */ { { (0)|(5 << 4) }, { 77, 56 }, 0 }, // KC_5 - /* 6 */ { { (0)|(6 << 4) }, { 91, 56 }, 0 }, // KC_6 - /* 7 */ { { (0)|(7 << 4) }, { 105, 56 }, 0 }, // KC_7 - /* 8 */ { { (0)|(8 << 4) }, { 118, 56 }, 0 }, // KC_8 - /* 9 */ { { (0)|(9 << 4) }, { 132, 56 }, 0 }, // KC_9 - /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 0 }, // KC_0 - /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 0 }, // KC_MINS - /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 0 }, // KC_EQL - /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 0 }, // KC_BSPC - /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 0 }, // KC_DEL - /* 15 */ { { (1)|(0 << 4) }, { 11, 44 }, 0 }, // KC_TAB - /* 16 */ { { (1)|(1 << 4) }, { 28, 44 }, 0 }, // KC_Q - /* 17 */ { { (1)|(2 << 4) }, { 42, 44 }, 0 }, // KC_W - /* 18 */ { { (1)|(3 << 4) }, { 56, 44 }, 0 }, // KC_E - /* 19 */ { { (1)|(4 << 4) }, { 70, 44 }, 0 }, // KC_R - /* 20 */ { { (1)|(5 << 4) }, { 84, 44 }, 0 }, // KC_T - /* 21 */ { { (1)|(6 << 4) }, { 98, 44 }, 0 }, // KC_Y - /* 22 */ { { (1)|(7 << 4) }, { 112, 44 }, 0 }, // KC_U - /* 23 */ { { (1)|(8 << 4) }, { 125, 44 }, 0 }, // KC_I - /* 24 */ { { (1)|(9 << 4) }, { 139, 44 }, 0 }, // KC_O - /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 0 }, // KC_P - /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 0 }, // KC_LBRC - /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 0 }, // KC_RBRC - /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 0 }, // KC_BSLS - /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 0 }, // KC_HOME +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + /* 0 */ { { (0)|(0 << 4) }, { 8, 56 }, 4 }, // KC_ESC + /* 1 */ { { (0)|(1 << 4) }, { 22, 56 }, 4 }, // KC_1 + /* 2 */ { { (0)|(2 << 4) }, { 35, 56 }, 4 }, // KC_2 + /* 3 */ { { (0)|(3 << 4) }, { 49, 56 }, 4 }, // KC_3 + /* 4 */ { { (0)|(4 << 4) }, { 63, 56 }, 4 }, // KC_4 + /* 5 */ { { (0)|(5 << 4) }, { 77, 56 }, 4 }, // KC_5 + /* 6 */ { { (0)|(6 << 4) }, { 91, 56 }, 4 }, // KC_6 + /* 7 */ { { (0)|(7 << 4) }, { 105, 56 }, 4 }, // KC_7 + /* 8 */ { { (0)|(8 << 4) }, { 118, 56 }, 4 }, // KC_8 + /* 9 */ { { (0)|(9 << 4) }, { 132, 56 }, 4 }, // KC_9 + /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 4 }, // KC_0 + /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 4 }, // KC_MINS + /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 4 }, // KC_EQL + /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 4 }, // KC_BSPC + /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 4 }, // KC_DEL + /* 15 */ { { (1)|(0 << 4) }, { 11, 44 }, 4 }, // KC_TAB + /* 16 */ { { (1)|(1 << 4) }, { 28, 44 }, 4 }, // KC_Q + /* 17 */ { { (1)|(2 << 4) }, { 42, 44 }, 4 }, // KC_W + /* 18 */ { { (1)|(3 << 4) }, { 56, 44 }, 4 }, // KC_E + /* 19 */ { { (1)|(4 << 4) }, { 70, 44 }, 4 }, // KC_R + /* 20 */ { { (1)|(5 << 4) }, { 84, 44 }, 4 }, // KC_T + /* 21 */ { { (1)|(6 << 4) }, { 98, 44 }, 4 }, // KC_Y + /* 22 */ { { (1)|(7 << 4) }, { 112, 44 }, 4 }, // KC_U + /* 23 */ { { (1)|(8 << 4) }, { 125, 44 }, 4 }, // KC_I + /* 24 */ { { (1)|(9 << 4) }, { 139, 44 }, 4 }, // KC_O + /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 4 }, // KC_P + /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 4 }, // KC_LBRC + /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 4 }, // KC_RBRC + /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 4 }, // KC_BSLS + /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 4 }, // KC_HOME /* 30 */ { { (2)|(0 << 4) }, { 13, 32 }, 1 }, // KC_CAPS - /* 31 */ { { (2)|(1 << 4) }, { 32, 32 }, 0 }, // KC_A - /* 32 */ { { (2)|(2 << 4) }, { 46, 32 }, 0 }, // KC_S - /* 33 */ { { (2)|(3 << 4) }, { 60, 32 }, 0 }, // KC_D - /* 34 */ { { (2)|(4 << 4) }, { 73, 32 }, 0 }, // KC_F - /* 35 */ { { (2)|(5 << 4) }, { 87, 32 }, 0 }, // KC_G - /* 36 */ { { (2)|(6 << 4) }, { 101, 32 }, 0 }, // KC_H - /* 37 */ { { (2)|(7 << 4) }, { 115, 32 }, 0 }, // KC_J - /* 38 */ { { (2)|(8 << 4) }, { 129, 32 }, 0 }, // KC_K - /* 39 */ { { (2)|(9 << 4) }, { 143, 32 }, 0 }, // KC_L - /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 0 }, // KC_SCLN - /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 0 }, // KC_QUOT + /* 31 */ { { (2)|(1 << 4) }, { 32, 32 }, 4 }, // KC_A + /* 32 */ { { (2)|(2 << 4) }, { 46, 32 }, 4 }, // KC_S + /* 33 */ { { (2)|(3 << 4) }, { 60, 32 }, 4 }, // KC_D + /* 34 */ { { (2)|(4 << 4) }, { 73, 32 }, 4 }, // KC_F + /* 35 */ { { (2)|(5 << 4) }, { 87, 32 }, 4 }, // KC_G + /* 36 */ { { (2)|(6 << 4) }, { 101, 32 }, 4 }, // KC_H + /* 37 */ { { (2)|(7 << 4) }, { 115, 32 }, 4 }, // KC_J + /* 38 */ { { (2)|(8 << 4) }, { 129, 32 }, 4 }, // KC_K + /* 39 */ { { (2)|(9 << 4) }, { 143, 32 }, 4 }, // KC_L + /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 4 }, // KC_SCLN + /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 4 }, // KC_QUOT /* _________________________________________ */ // ____ - /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 0 }, // KC_ENT - /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 0 }, // KC_PGUP - /* 44 */ { { (3)|(0 << 4) }, { 16, 19 }, 0 }, // KC_LSFT - /* 45 */ { { (3)|(2 << 4) }, { 39, 19 }, 0 }, // KC_Z - /* 46 */ { { (3)|(3 << 4) }, { 53, 19 }, 0 }, // KC_X - /* 47 */ { { (3)|(4 << 4) }, { 67, 19 }, 0 }, // KC_C - /* 48 */ { { (3)|(5 << 4) }, { 80, 19 }, 0 }, // KC_V - /* 49 */ { { (3)|(6 << 4) }, { 94, 19 }, 0 }, // KC_B - /* 50 */ { { (3)|(7 << 4) }, { 108, 19 }, 0 }, // KC_N - /* 51 */ { { (3)|(8 << 4) }, { 122, 19 }, 0 }, // KC_M - /* 52 */ { { (3)|(9 << 4) }, { 136, 19 }, 0 }, // KC_COMM - /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 0 }, // KC_DOT - /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 0 }, // KC_SLSH - /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 0 }, // KC_RSFT + /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 4 }, // KC_ENT + /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 4 }, // KC_PGUP + /* 44 */ { { (3)|(0 << 4) }, { 16, 19 }, 4 }, // KC_LSFT + /* 45 */ { { (3)|(2 << 4) }, { 39, 19 }, 4 }, // KC_Z + /* 46 */ { { (3)|(3 << 4) }, { 53, 19 }, 4 }, // KC_X + /* 47 */ { { (3)|(4 << 4) }, { 67, 19 }, 4 }, // KC_C + /* 48 */ { { (3)|(5 << 4) }, { 80, 19 }, 4 }, // KC_V + /* 49 */ { { (3)|(6 << 4) }, { 94, 19 }, 4 }, // KC_B + /* 50 */ { { (3)|(7 << 4) }, { 108, 19 }, 4 }, // KC_N + /* 51 */ { { (3)|(8 << 4) }, { 122, 19 }, 4 }, // KC_M + /* 52 */ { { (3)|(9 << 4) }, { 136, 19 }, 4 }, // KC_COMM + /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 4 }, // KC_DOT + /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 4 }, // KC_SLSH + /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 4 }, // KC_RSFT /* _________________________________________ */ // ____ - /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 0 }, // KC_UP - /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 0 }, // KC_PGDN - /* 58 */ { { (4)|(0 << 4) }, { 9, 7 }, 0 }, // KC_LCTL - /* 59 */ { { (4)|(1 << 4) }, { 27, 7 }, 0 }, // KC_LGUI - /* 60 */ { { (4)|(2 << 4) }, { 44, 7 }, 0 }, // KC_LALT + /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 4 }, // KC_UP + /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 4 }, // KC_PGDN + /* 58 */ { { (4)|(0 << 4) }, { 9, 7 }, 4 }, // KC_LCTL + /* 59 */ { { (4)|(1 << 4) }, { 27, 7 }, 4 }, // KC_LGUI + /* 60 */ { { (4)|(2 << 4) }, { 44, 7 }, 4 }, // KC_LALT /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ - /* 61 */ { { (4)|(6 << 4) }, { 96, 7 }, 0 }, // KC_SPC + /* 61 */ { { (4)|(6 << 4) }, { 96, 7 }, 4 }, // KC_SPC /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ - /* 62 */ { { (4)|(10 << 4) }, { 148, 7 }, 0 }, // KC_RALT - /* 63 */ { { (4)|(11 << 4) }, { 165, 7 }, 0 }, // MO(1) - /* 64 */ { { (4)|(12 << 4) }, { 188, 7 }, 0 }, // KC_LEFT - /* 65 */ { { (4)|(13 << 4) }, { 201, 7 }, 0 }, // KC_DOWN - /* 66 */ { { (4)|(14 << 4) }, { 215, 7 }, 0 }, // KC_RGHT + /* 62 */ { { (4)|(10 << 4) }, { 148, 7 }, 4 }, // KC_RALT + /* 63 */ { { (4)|(11 << 4) }, { 165, 7 }, 4 }, // MO(1) + /* 64 */ { { (4)|(12 << 4) }, { 188, 7 }, 4 }, // KC_LEFT + /* 65 */ { { (4)|(13 << 4) }, { 201, 7 }, 4 }, // KC_DOWN + /* 66 */ { { (4)|(14 << 4) }, { 215, 7 }, 4 }, // KC_RGHT // Underglow LEDs - { { 255 }, { 1, 1 }, 0 }, - { { 255 }, { 15, 0 }, 0 }, - { { 255 }, { 31, 0 }, 0 }, - { { 255 }, { 47, 0 }, 0 }, - { { 255 }, { 63, 0 }, 0 }, - { { 255 }, { 79, 0 }, 0 }, - { { 255 }, { 95, 0 }, 0 }, - { { 255 }, { 112, 0 }, 0 }, - { { 255 }, { 128, 0 }, 0 }, - { { 255 }, { 144, 0 }, 0 }, - { { 255 }, { 160, 0 }, 0 }, - { { 255 }, { 176, 0 }, 0 }, - { { 255 }, { 192, 0 }, 0 }, - { { 255 }, { 208, 0 }, 0 }, - { { 255 }, { 222, 1 }, 0 }, - { { 255 }, { 224, 13 }, 0 }, - { { 255 }, { 224, 25 }, 0 }, - { { 255 }, { 224, 38 }, 0 }, - { { 255 }, { 224, 50 }, 0 }, - { { 255 }, { 222, 62 }, 0 }, - { { 255 }, { 191, 64 }, 0 }, - { { 255 }, { 179, 64 }, 0 }, - { { 255 }, { 167, 64 }, 0 }, - { { 255 }, { 153, 64 }, 0 }, - { { 255 }, { 139, 64 }, 0 }, - { { 255 }, { 125, 64 }, 0 }, - { { 255 }, { 112, 64 }, 0 }, - { { 255 }, { 98, 64 }, 0 }, - { { 255 }, { 84, 64 }, 0 }, - { { 255 }, { 70, 64 }, 0 }, - { { 255 }, { 56, 64 }, 0 }, - { { 255 }, { 42, 64 }, 0 }, - { { 255 }, { 28, 64 }, 0 }, - { { 255 }, { 1, 62 }, 0 }, - { { 255 }, { 0, 50 }, 0 }, - { { 255 }, { 0, 38 }, 0 }, - { { 255 }, { 0, 25 }, 0 }, - { { 255 }, { 0, 13 }, 0 }, + { { 255 }, { 1, 1 }, 2 }, + { { 255 }, { 15, 0 }, 2 }, + { { 255 }, { 31, 0 }, 2 }, + { { 255 }, { 47, 0 }, 2 }, + { { 255 }, { 63, 0 }, 2 }, + { { 255 }, { 79, 0 }, 2 }, + { { 255 }, { 95, 0 }, 2 }, + { { 255 }, { 112, 0 }, 2 }, + { { 255 }, { 128, 0 }, 2 }, + { { 255 }, { 144, 0 }, 2 }, + { { 255 }, { 160, 0 }, 2 }, + { { 255 }, { 176, 0 }, 2 }, + { { 255 }, { 192, 0 }, 2 }, + { { 255 }, { 208, 0 }, 2 }, + { { 255 }, { 222, 1 }, 2 }, + { { 255 }, { 224, 13 }, 2 }, + { { 255 }, { 224, 25 }, 2 }, + { { 255 }, { 224, 38 }, 2 }, + { { 255 }, { 224, 50 }, 2 }, + { { 255 }, { 222, 62 }, 2 }, + { { 255 }, { 191, 64 }, 2 }, + { { 255 }, { 179, 64 }, 2 }, + { { 255 }, { 167, 64 }, 2 }, + { { 255 }, { 153, 64 }, 2 }, + { { 255 }, { 139, 64 }, 2 }, + { { 255 }, { 125, 64 }, 2 }, + { { 255 }, { 112, 64 }, 2 }, + { { 255 }, { 98, 64 }, 2 }, + { { 255 }, { 84, 64 }, 2 }, + { { 255 }, { 70, 64 }, 2 }, + { { 255 }, { 56, 64 }, 2 }, + { { 255 }, { 42, 64 }, 2 }, + { { 255 }, { 28, 64 }, 2 }, + { { 255 }, { 1, 62 }, 2 }, + { { 255 }, { 0, 50 }, 2 }, + { { 255 }, { 0, 38 }, 2 }, + { { 255 }, { 0, 25 }, 2 }, + { { 255 }, { 0, 13 }, 2 }, }; #ifdef USB_LED_INDICATOR_ENABLE diff --git a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c index a4519d40490..f6f79ad91ef 100644 --- a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c +++ b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c @@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index a4519d40490..f6f79ad91ef 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c index 26a1c6d0148..222d7e2c504 100644 --- a/keyboards/massdrop/alt/keymaps/mac/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/config.h b/keyboards/massdrop/ctrl/config.h index df2e5092163..9b9f98f5fe1 100644 --- a/keyboards/massdrop/ctrl/config.h +++ b/keyboards/massdrop/ctrl/config.h @@ -123,6 +123,5 @@ along with this program. If not, see . #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_LED_PROCESS_LIMIT 15 #define RGB_MATRIX_LED_FLUSH_LIMIT 10 -#define RGB_MATRIX_EXTRA_TOG #include "config_led.h" diff --git a/keyboards/massdrop/ctrl/config_led.c b/keyboards/massdrop/ctrl/config_led.c index afdbf3a2227..20d9c649ec0 100644 --- a/keyboards/massdrop/ctrl/config_led.c +++ b/keyboards/massdrop/ctrl/config_led.c @@ -5,133 +5,133 @@ #include "rgb_matrix.h" #include "config_led.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // 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 - { { 0|(0<<4) }, { 7, 5 }, 0 }, - { { 0|(1<<4) }, { 31, 5 }, 0 }, - { { 0|(2<<4) }, { 43, 5 }, 0 }, - { { 0|(3<<4) }, { 55, 5 }, 0 }, - { { 0|(4<<4) }, { 67, 5 }, 0 }, - { { 0|(5<<4) }, { 85, 5 }, 0 }, - { { 0|(6<<4) }, { 97, 5 }, 0 }, - { { 0|(7<<4) }, { 109, 5 }, 0 }, - { { 6|(0<<4) }, { 121, 5 }, 0 }, - { { 6|(1<<4) }, { 139, 5 }, 0 }, - { { 6|(2<<4) }, { 151, 5 }, 0 }, - { { 6|(3<<4) }, { 163, 5 }, 0 }, - { { 6|(4<<4) }, { 175, 5 }, 0 }, - { { 6|(5<<4) }, { 193, 5 }, 0 }, + { { 0|(0<<4) }, { 7, 5 }, 4 }, + { { 0|(1<<4) }, { 31, 5 }, 4 }, + { { 0|(2<<4) }, { 43, 5 }, 4 }, + { { 0|(3<<4) }, { 55, 5 }, 4 }, + { { 0|(4<<4) }, { 67, 5 }, 4 }, + { { 0|(5<<4) }, { 85, 5 }, 4 }, + { { 0|(6<<4) }, { 97, 5 }, 4 }, + { { 0|(7<<4) }, { 109, 5 }, 4 }, + { { 6|(0<<4) }, { 121, 5 }, 4 }, + { { 6|(1<<4) }, { 139, 5 }, 4 }, + { { 6|(2<<4) }, { 151, 5 }, 4 }, + { { 6|(3<<4) }, { 163, 5 }, 4 }, + { { 6|(4<<4) }, { 175, 5 }, 4 }, + { { 6|(5<<4) }, { 193, 5 }, 4 }, { { 6|(6<<4) }, { 205, 5 }, 1 }, - { { 6|(7<<4) }, { 217, 5 }, 0 }, + { { 6|(7<<4) }, { 217, 5 }, 4 }, // 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 - { { 1|(0<<4) }, { 7, 20 }, 0 }, - { { 1|(1<<4) }, { 19, 20 }, 0 }, - { { 1|(2<<4) }, { 31, 20 }, 0 }, - { { 1|(3<<4) }, { 43, 20 }, 0 }, - { { 1|(4<<4) }, { 55, 20 }, 0 }, - { { 1|(5<<4) }, { 67, 20 }, 0 }, - { { 1|(6<<4) }, { 79, 20 }, 0 }, - { { 1|(7<<4) }, { 91, 20 }, 0 }, - { { 7|(0<<4) }, { 103, 20 }, 0 }, - { { 7|(1<<4) }, { 115, 20 }, 0 }, - { { 7|(2<<4) }, { 127, 20 }, 0 }, - { { 7|(3<<4) }, { 139, 20 }, 0 }, - { { 7|(4<<4) }, { 151, 20 }, 0 }, - { { 7|(5<<4) }, { 169, 20 }, 0 }, - { { 7|(6<<4) }, { 193, 20 }, 0 }, - { { 7|(7<<4) }, { 205, 20 }, 0 }, - { { 9|(7<<4) }, { 217, 20 }, 0 }, + { { 1|(0<<4) }, { 7, 20 }, 4 }, + { { 1|(1<<4) }, { 19, 20 }, 4 }, + { { 1|(2<<4) }, { 31, 20 }, 4 }, + { { 1|(3<<4) }, { 43, 20 }, 4 }, + { { 1|(4<<4) }, { 55, 20 }, 4 }, + { { 1|(5<<4) }, { 67, 20 }, 4 }, + { { 1|(6<<4) }, { 79, 20 }, 4 }, + { { 1|(7<<4) }, { 91, 20 }, 4 }, + { { 7|(0<<4) }, { 103, 20 }, 4 }, + { { 7|(1<<4) }, { 115, 20 }, 4 }, + { { 7|(2<<4) }, { 127, 20 }, 4 }, + { { 7|(3<<4) }, { 139, 20 }, 4 }, + { { 7|(4<<4) }, { 151, 20 }, 4 }, + { { 7|(5<<4) }, { 169, 20 }, 4 }, + { { 7|(6<<4) }, { 193, 20 }, 4 }, + { { 7|(7<<4) }, { 205, 20 }, 4 }, + { { 9|(7<<4) }, { 217, 20 }, 4 }, // 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 - { { 2|(0<<4) }, { 10, 30 }, 0 }, - { { 2|(1<<4) }, { 25, 30 }, 0 }, - { { 2|(2<<4) }, { 37, 30 }, 0 }, - { { 2|(3<<4) }, { 49, 30 }, 0 }, - { { 2|(4<<4) }, { 61, 30 }, 0 }, - { { 2|(5<<4) }, { 73, 30 }, 0 }, - { { 2|(6<<4) }, { 85, 30 }, 0 }, - { { 2|(7<<4) }, { 97, 30 }, 0 }, - { { 8|(0<<4) }, { 109, 30 }, 0 }, - { { 8|(1<<4) }, { 121, 30 }, 0 }, - { { 8|(2<<4) }, { 133, 30 }, 0 }, - { { 8|(3<<4) }, { 145, 30 }, 0 }, - { { 8|(4<<4) }, { 157, 30 }, 0 }, - { { 8|(5<<4) }, { 172, 30 }, 0 }, - { { 8|(6<<4) }, { 193, 30 }, 0 }, - { { 8|(7<<4) }, { 205, 30 }, 0 }, - { { 9|(6<<4) }, { 217, 30 }, 0 }, + { { 2|(0<<4) }, { 10, 30 }, 4 }, + { { 2|(1<<4) }, { 25, 30 }, 4 }, + { { 2|(2<<4) }, { 37, 30 }, 4 }, + { { 2|(3<<4) }, { 49, 30 }, 4 }, + { { 2|(4<<4) }, { 61, 30 }, 4 }, + { { 2|(5<<4) }, { 73, 30 }, 4 }, + { { 2|(6<<4) }, { 85, 30 }, 4 }, + { { 2|(7<<4) }, { 97, 30 }, 4 }, + { { 8|(0<<4) }, { 109, 30 }, 4 }, + { { 8|(1<<4) }, { 121, 30 }, 4 }, + { { 8|(2<<4) }, { 133, 30 }, 4 }, + { { 8|(3<<4) }, { 145, 30 }, 4 }, + { { 8|(4<<4) }, { 157, 30 }, 4 }, + { { 8|(5<<4) }, { 172, 30 }, 4 }, + { { 8|(6<<4) }, { 193, 30 }, 4 }, + { { 8|(7<<4) }, { 205, 30 }, 4 }, + { { 9|(6<<4) }, { 217, 30 }, 4 }, // 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 { { 3|(0<<4) }, { 11, 39 }, 1 }, - { { 3|(1<<4) }, { 28, 39 }, 0 }, - { { 3|(2<<4) }, { 40, 39 }, 0 }, - { { 3|(3<<4) }, { 52, 39 }, 0 }, - { { 3|(4<<4) }, { 64, 39 }, 0 }, - { { 3|(5<<4) }, { 76, 39 }, 0 }, - { { 3|(6<<4) }, { 88, 39 }, 0 }, - { { 3|(7<<4) }, { 100, 39 }, 0 }, - { { 9|(0<<4) }, { 112, 39 }, 0 }, - { { 9|(1<<4) }, { 124, 39 }, 0 }, - { { 9|(2<<4) }, { 136, 39 }, 0 }, - { { 9|(3<<4) }, { 148, 39 }, 0 }, - { { 9|(4<<4) }, { 168, 39 }, 0 }, + { { 3|(1<<4) }, { 28, 39 }, 4 }, + { { 3|(2<<4) }, { 40, 39 }, 4 }, + { { 3|(3<<4) }, { 52, 39 }, 4 }, + { { 3|(4<<4) }, { 64, 39 }, 4 }, + { { 3|(5<<4) }, { 76, 39 }, 4 }, + { { 3|(6<<4) }, { 88, 39 }, 4 }, + { { 3|(7<<4) }, { 100, 39 }, 4 }, + { { 9|(0<<4) }, { 112, 39 }, 4 }, + { { 9|(1<<4) }, { 124, 39 }, 4 }, + { { 9|(2<<4) }, { 136, 39 }, 4 }, + { { 9|(3<<4) }, { 148, 39 }, 4 }, + { { 9|(4<<4) }, { 168, 39 }, 4 }, // 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 - { { 4|(0<<4) }, { 14, 49 }, 0 }, - { { 4|(1<<4) }, { 34, 49 }, 0 }, - { { 4|(2<<4) }, { 46, 49 }, 0 }, - { { 4|(3<<4) }, { 58, 49 }, 0 }, - { { 4|(4<<4) }, { 70, 49 }, 0 }, - { { 4|(5<<4) }, { 82, 49 }, 0 }, - { { 4|(6<<4) }, { 94, 49 }, 0 }, - { { 4|(7<<4) }, { 106, 49 }, 0 }, - { { 10|(0<<4) }, { 118, 49 }, 0 }, - { { 10|(1<<4) }, { 130, 49 }, 0 }, - { { 10|(2<<4) }, { 142, 49 }, 0 }, - { { 10|(3<<4) }, { 165, 49 }, 0 }, - { { 9|(5<<4) }, { 205, 49 }, 0 }, + { { 4|(0<<4) }, { 14, 49 }, 4 }, + { { 4|(1<<4) }, { 34, 49 }, 4 }, + { { 4|(2<<4) }, { 46, 49 }, 4 }, + { { 4|(3<<4) }, { 58, 49 }, 4 }, + { { 4|(4<<4) }, { 70, 49 }, 4 }, + { { 4|(5<<4) }, { 82, 49 }, 4 }, + { { 4|(6<<4) }, { 94, 49 }, 4 }, + { { 4|(7<<4) }, { 106, 49 }, 4 }, + { { 10|(0<<4) }, { 118, 49 }, 4 }, + { { 10|(1<<4) }, { 130, 49 }, 4 }, + { { 10|(2<<4) }, { 142, 49 }, 4 }, + { { 10|(3<<4) }, { 165, 49 }, 4 }, + { { 9|(5<<4) }, { 205, 49 }, 4 }, // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - { { 5|(0<<4) }, { 8, 59 }, 0 }, - { { 5|(1<<4) }, { 23, 59 }, 0 }, - { { 5|(2<<4) }, { 38, 59 }, 0 }, - { { 5|(3<<4) }, { 83, 59 }, 0 }, - { { 5|(4<<4) }, { 129, 59 }, 0 }, - { { 5|(5<<4) }, { 144, 59 }, 0 }, - { { 5|(6<<4) }, { 159, 59 }, 0 }, - { { 5|(7<<4) }, { 174, 59 }, 0 }, - { { 10|(4<<4) }, { 193, 59 }, 0 }, - { { 10|(5<<4) }, { 205, 59 }, 0 }, - { { 10|(6<<4) }, { 217, 59 }, 0 }, + { { 5|(0<<4) }, { 8, 59 }, 4 }, + { { 5|(1<<4) }, { 23, 59 }, 4 }, + { { 5|(2<<4) }, { 38, 59 }, 4 }, + { { 5|(3<<4) }, { 83, 59 }, 4 }, + { { 5|(4<<4) }, { 129, 59 }, 4 }, + { { 5|(5<<4) }, { 144, 59 }, 4 }, + { { 5|(6<<4) }, { 159, 59 }, 4 }, + { { 5|(7<<4) }, { 174, 59 }, 4 }, + { { 10|(4<<4) }, { 193, 59 }, 4 }, + { { 10|(5<<4) }, { 205, 59 }, 4 }, + { { 10|(6<<4) }, { 217, 59 }, 4 }, // Underglow / Border - { { 0xFF }, { 222, 64 }, 0 }, - { { 0xFF }, { 204, 64 }, 0 }, - { { 0xFF }, { 186, 64 }, 0 }, - { { 0xFF }, { 167, 64 }, 0 }, - { { 0xFF }, { 149, 64 }, 0 }, - { { 0xFF }, { 130, 64 }, 0 }, - { { 0xFF }, { 112, 64 }, 0 }, - { { 0xFF }, { 94, 64 }, 0 }, - { { 0xFF }, { 75, 64 }, 0 }, - { { 0xFF }, { 57, 64 }, 0 }, - { { 0xFF }, { 38, 64 }, 0 }, - { { 0xFF }, { 20, 64 }, 0 }, - { { 0xFF }, { 0, 64 }, 0 }, - { { 0xFF }, { 0, 47 }, 0 }, - { { 0xFF }, { 0, 32 }, 0 }, - { { 0xFF }, { 0, 17 }, 0 }, - { { 0xFF }, { 0, 0 }, 0 }, - { { 0xFF }, { 20, 0 }, 0 }, - { { 0xFF }, { 38, 0 }, 0 }, - { { 0xFF }, { 57, 0 }, 0 }, - { { 0xFF }, { 75, 0 }, 0 }, - { { 0xFF }, { 94, 0 }, 0 }, - { { 0xFF }, { 112, 0 }, 0 }, - { { 0xFF }, { 130, 0 }, 0 }, - { { 0xFF }, { 149, 0 }, 0 }, - { { 0xFF }, { 167, 0 }, 0 }, - { { 0xFF }, { 186, 0 }, 0 }, - { { 0xFF }, { 204, 0 }, 0 }, - { { 0xFF }, { 222, 1 }, 0 }, - { { 0xFF }, { 224, 17 }, 0 }, - { { 0xFF }, { 224, 32 }, 0 }, - { { 0xFF }, { 224, 47 }, 0 }, + { { 0xFF }, { 222, 64 }, 2 }, + { { 0xFF }, { 204, 64 }, 2 }, + { { 0xFF }, { 186, 64 }, 2 }, + { { 0xFF }, { 167, 64 }, 2 }, + { { 0xFF }, { 149, 64 }, 2 }, + { { 0xFF }, { 130, 64 }, 2 }, + { { 0xFF }, { 112, 64 }, 2 }, + { { 0xFF }, { 94, 64 }, 2 }, + { { 0xFF }, { 75, 64 }, 2 }, + { { 0xFF }, { 57, 64 }, 2 }, + { { 0xFF }, { 38, 64 }, 2 }, + { { 0xFF }, { 20, 64 }, 2 }, + { { 0xFF }, { 0, 64 }, 2 }, + { { 0xFF }, { 0, 47 }, 2 }, + { { 0xFF }, { 0, 32 }, 2 }, + { { 0xFF }, { 0, 17 }, 2 }, + { { 0xFF }, { 0, 0 }, 2 }, + { { 0xFF }, { 20, 0 }, 2 }, + { { 0xFF }, { 38, 0 }, 2 }, + { { 0xFF }, { 57, 0 }, 2 }, + { { 0xFF }, { 75, 0 }, 2 }, + { { 0xFF }, { 94, 0 }, 2 }, + { { 0xFF }, { 112, 0 }, 2 }, + { { 0xFF }, { 130, 0 }, 2 }, + { { 0xFF }, { 149, 0 }, 2 }, + { { 0xFF }, { 167, 0 }, 2 }, + { { 0xFF }, { 186, 0 }, 2 }, + { { 0xFF }, { 204, 0 }, 2 }, + { { 0xFF }, { 222, 1 }, 2 }, + { { 0xFF }, { 224, 17 }, 2 }, + { { 0xFF }, { 224, 32 }, 2 }, + { { 0xFF }, { 224, 47 }, 2 }, }; #ifdef USB_LED_INDICATOR_ENABLE diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c index 182abbbad4f..53c96d95d0e 100644 --- a/keyboards/massdrop/ctrl/keymaps/default/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c index 41cf8275724..79fe7388af6 100644 --- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/model01/leds.c b/keyboards/model01/leds.c index 7a62c7424c6..0abc1f0da80 100644 --- a/keyboards/model01/leds.c +++ b/keyboards/model01/leds.c @@ -46,34 +46,34 @@ void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b) { #ifdef RGB_MATRIX_ENABLE __attribute__ ((weak)) -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0x73}, { 3, 35}, 0}, - {{0x72}, { 0, 26}, 0}, - {{0x71}, { 0, 17}, 0}, - {{0x70}, { 0, 6}, 0}, - {{0x60}, { 14, 5}, 0}, - {{0x61}, { 15, 16}, 0}, - {{0x62}, { 16, 25}, 0}, - {{0x63}, { 17, 34}, 0}, - {{0x53}, { 31, 29}, 0}, - {{0x52}, { 31, 19}, 0}, - {{0x51}, { 30, 11}, 0}, - {{0x50}, { 30, 1}, 0}, - {{0x40}, { 45, 0}, 0}, - {{0x41}, { 45, 8}, 0}, - {{0x42}, { 46, 17}, 0}, - {{0x43}, { 46, 27}, 0}, - {{0x33}, { 60, 27}, 0}, - {{0x32}, { 60, 18}, 0}, - {{0x31}, { 60, 9}, 0}, - {{0x30}, { 60, 0}, 0}, - {{0x20}, { 74, 2}, 0}, - {{0x21}, { 74, 11}, 0}, - {{0x22}, { 75, 20}, 0}, - {{0x23}, { 74, 28}, 0}, - {{0x12}, { 89, 30}, 0}, - {{0x11}, { 89, 19}, 0}, - {{0x10}, { 89, 7}, 0}, +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0x73}, { 3, 35}, 4}, + {{0x72}, { 0, 26}, 4}, + {{0x71}, { 0, 17}, 4}, + {{0x70}, { 0, 6}, 4}, + {{0x60}, { 14, 5}, 4}, + {{0x61}, { 15, 16}, 4}, + {{0x62}, { 16, 25}, 4}, + {{0x63}, { 17, 34}, 4}, + {{0x53}, { 31, 29}, 4}, + {{0x52}, { 31, 19}, 4}, + {{0x51}, { 30, 11}, 4}, + {{0x50}, { 30, 1}, 4}, + {{0x40}, { 45, 0}, 4}, + {{0x41}, { 45, 8}, 4}, + {{0x42}, { 46, 17}, 4}, + {{0x43}, { 46, 27}, 4}, + {{0x33}, { 60, 27}, 4}, + {{0x32}, { 60, 18}, 4}, + {{0x31}, { 60, 9}, 4}, + {{0x30}, { 60, 0}, 4}, + {{0x20}, { 74, 2}, 4}, + {{0x21}, { 74, 11}, 4}, + {{0x22}, { 75, 20}, 4}, + {{0x23}, { 74, 28}, 4}, + {{0x12}, { 89, 30}, 4}, + {{0x11}, { 89, 19}, 4}, + {{0x10}, { 89, 7}, 4}, {{0x00}, { 70, 38}, 1}, {{0x01}, { 82, 41}, 1}, {{0x02}, { 93, 45}, 1}, @@ -84,33 +84,33 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0x76}, {130, 45}, 1}, {{0x75}, {141, 41}, 1}, {{0x74}, {153, 38}, 1}, - {{0x64}, {134, 7}, 0}, - {{0x65}, {134, 19}, 0}, - {{0x66}, {134, 30}, 0}, - {{0x57}, {149, 28}, 0}, - {{0x56}, {148, 20}, 0}, - {{0x55}, {149, 11}, 0}, - {{0x54}, {149, 2}, 0}, - {{0x44}, {163, 0}, 0}, - {{0x45}, {163, 9}, 0}, - {{0x46}, {163, 18}, 0}, - {{0x47}, {163, 27}, 0}, - {{0x37}, {177, 27}, 0}, - {{0x36}, {177, 17}, 0}, - {{0x35}, {178, 8}, 0}, - {{0x34}, {178, 0}, 0}, - {{0x24}, {193, 1}, 0}, - {{0x25}, {193, 11}, 0}, - {{0x26}, {192, 19}, 0}, - {{0x27}, {192, 29}, 0}, - {{0x17}, {206, 34}, 0}, - {{0x16}, {207, 25}, 0}, - {{0x15}, {208, 16}, 0}, - {{0x14}, {209, 5}, 0}, - {{0x04}, {224, 6}, 0}, - {{0x05}, {223, 17}, 0}, - {{0x06}, {223, 26}, 0}, - {{0x07}, {220, 35}, 0}, + {{0x64}, {134, 7}, 4}, + {{0x65}, {134, 19}, 4}, + {{0x66}, {134, 30}, 4}, + {{0x57}, {149, 28}, 4}, + {{0x56}, {148, 20}, 4}, + {{0x55}, {149, 11}, 4}, + {{0x54}, {149, 2}, 4}, + {{0x44}, {163, 0}, 4}, + {{0x45}, {163, 9}, 4}, + {{0x46}, {163, 18}, 4}, + {{0x47}, {163, 27}, 4}, + {{0x37}, {177, 27}, 4}, + {{0x36}, {177, 17}, 4}, + {{0x35}, {178, 8}, 4}, + {{0x34}, {178, 0}, 4}, + {{0x24}, {193, 1}, 4}, + {{0x25}, {193, 11}, 4}, + {{0x26}, {192, 19}, 4}, + {{0x27}, {192, 29}, 4}, + {{0x17}, {206, 34}, 4}, + {{0x16}, {207, 25}, 4}, + {{0x15}, {208, 16}, 4}, + {{0x14}, {209, 5}, 4}, + {{0x04}, {224, 6}, 4}, + {{0x05}, {223, 17}, 4}, + {{0x06}, {223, 26}, 4}, + {{0x07}, {220, 35}, 4}, }; static struct { diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index c3b7e26170c..94f50718964 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -79,49 +79,49 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} - | | modifier + | | flags | | | */ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 0}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 0}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 0}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 0}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 0}, - {{4|(0<<4)}, {20.36*6, 21.33*0}, 0}, - {{4|(1<<4)}, {20.36*7, 21.33*0}, 0}, - {{4|(2<<4)}, {20.36*8, 21.33*0}, 0}, - {{4|(3<<4)}, {20.36*9, 21.33*0}, 0}, - {{4|(4<<4)}, {20.36*10,21.33*0}, 0}, + {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, + {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, + {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, + {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, + {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, + {{4|(0<<4)}, {20.36*6, 21.33*0}, 4}, + {{4|(1<<4)}, {20.36*7, 21.33*0}, 4}, + {{4|(2<<4)}, {20.36*8, 21.33*0}, 4}, + {{4|(3<<4)}, {20.36*9, 21.33*0}, 4}, + {{4|(4<<4)}, {20.36*10,21.33*0}, 4}, {{4|(5<<4)}, {20.36*11,21.33*0}, 1}, {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 0}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 0}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 0}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 0}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 0}, - {{5|(0<<4)}, {20.36*6, 21.33*1}, 0}, - {{5|(1<<4)}, {20.36*7, 21.33*1}, 0}, - {{5|(2<<4)}, {20.36*8, 21.33*1}, 0}, - {{5|(3<<4)}, {20.36*9, 21.33*1}, 0}, - {{5|(4<<4)}, {20.36*10,21.33*1}, 0}, + {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, + {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, + {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, + {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, + {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, + {{5|(0<<4)}, {20.36*6, 21.33*1}, 4}, + {{5|(1<<4)}, {20.36*7, 21.33*1}, 4}, + {{5|(2<<4)}, {20.36*8, 21.33*1}, 4}, + {{5|(3<<4)}, {20.36*9, 21.33*1}, 4}, + {{5|(4<<4)}, {20.36*10,21.33*1}, 4}, {{5|(5<<4)}, {20.36*11,21.33*1}, 1}, {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 0}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 0}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 0}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 0}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 0}, - {{6|(0<<4)}, {20.36*6, 21.33*2}, 0}, - {{6|(1<<4)}, {20.36*7, 21.33*2}, 0}, - {{6|(2<<4)}, {20.36*8, 21.33*2}, 0}, - {{6|(3<<4)}, {20.36*9, 21.33*2}, 0}, - {{6|(4<<4)}, {20.36*10,21.33*2}, 0}, + {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, + {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, + {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, + {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, + {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, + {{6|(0<<4)}, {20.36*6, 21.33*2}, 4}, + {{6|(1<<4)}, {20.36*7, 21.33*2}, 4}, + {{6|(2<<4)}, {20.36*8, 21.33*2}, 4}, + {{6|(3<<4)}, {20.36*9, 21.33*2}, 4}, + {{6|(4<<4)}, {20.36*10,21.33*2}, 4}, {{6|(5<<4)}, {20.36*11,21.33*2}, 1}, {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, @@ -129,7 +129,7 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, {{7|(3<<4)}, {20.36*3, 21.33*3}, 1}, {{7|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{7|(5<<4)}, {20.36*5.5,21.33*3}, 0}, + {{7|(5<<4)}, {20.36*5.5,21.33*3}, 4}, {{7|(0<<4)}, {20.36*7, 21.33*3}, 1}, {{7|(1<<4)}, {20.36*8, 21.33*3}, 1}, {{7|(2<<4)}, {20.36*9, 21.33*3}, 1}, diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c index 6e3b08938fa..5b7177c6c99 100644 --- a/keyboards/planck/keymaps/tom/keymap.c +++ b/keyboards/planck/keymaps/tom/keymap.c @@ -231,7 +231,7 @@ void rgb_matrix_indicators_user(void) { case _RAISE: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if ( led.modifier ) { + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); } else { rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); @@ -242,7 +242,7 @@ void rgb_matrix_indicators_user(void) { case _LOWER: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if ( led.modifier ) { + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); } else { rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c index f463090dd0b..178d28274c4 100644 --- a/keyboards/planck/light/light.c +++ b/keyboards/planck/light/light.c @@ -77,49 +77,49 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_14, C8_14, C7_14} }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} - | | modifier + | | flags | | | */ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 0}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 0}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 0}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 0}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 0}, - {{0|(6<<4)}, {20.36*6, 21.33*0}, 0}, - {{0|(7<<4)}, {20.36*7, 21.33*0}, 0}, - {{0|(8<<4)}, {20.36*8, 21.33*0}, 0}, - {{0|(9<<4)}, {20.36*9, 21.33*0}, 0}, - {{0|(10<<4)}, {20.36*10,21.33*0}, 0}, + {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, + {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, + {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, + {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, + {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, + {{0|(6<<4)}, {20.36*6, 21.33*0}, 4}, + {{0|(7<<4)}, {20.36*7, 21.33*0}, 4}, + {{0|(8<<4)}, {20.36*8, 21.33*0}, 4}, + {{0|(9<<4)}, {20.36*9, 21.33*0}, 4}, + {{0|(10<<4)}, {20.36*10,21.33*0}, 4}, {{0|(11<<4)}, {20.36*11,21.33*0}, 1}, {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 0}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 0}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 0}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 0}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 0}, - {{1|(6<<4)}, {20.36*6, 21.33*1}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33*1}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33*1}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33*1}, 0}, - {{1|(10<<4)}, {20.36*10,21.33*1}, 0}, + {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, + {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, + {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, + {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, + {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, + {{1|(6<<4)}, {20.36*6, 21.33*1}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33*1}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33*1}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33*1}, 4}, + {{1|(10<<4)}, {20.36*10,21.33*1}, 4}, {{1|(11<<4)}, {20.36*11,21.33*1}, 1}, {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 0}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 0}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 0}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 0}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 0}, - {{2|(6<<4)}, {20.36*6, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(10<<4)}, {20.36*10,21.33*2}, 0}, + {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, + {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, + {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, + {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, + {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, + {{2|(6<<4)}, {20.36*6, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(10<<4)}, {20.36*10,21.33*2}, 4}, {{2|(11<<4)}, {20.36*11,21.33*2}, 1}, {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, @@ -127,9 +127,9 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, {{3|(3<<4)}, {20.36*3, 21.33*3}, 1}, {{3|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{3|(5<<4)}, {20.36*5, 21.33*3}, 0}, - {{3|(5<<4)}, {20.36*5.5,21.33*3}, 0}, - {{3|(6<<4)}, {20.36*6, 21.33*3}, 0}, + {{3|(5<<4)}, {20.36*5, 21.33*3}, 4}, + {{3|(5<<4)}, {20.36*5.5,21.33*3}, 4}, + {{3|(6<<4)}, {20.36*6, 21.33*3}, 4}, {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, diff --git a/keyboards/sol/rev1/rev1.c b/keyboards/sol/rev1/rev1.c index 049b5c21869..b668b02e994 100644 --- a/keyboards/sol/rev1/rev1.c +++ b/keyboards/sol/rev1/rev1.c @@ -1,35 +1,35 @@ #include "sol.h" #ifdef RGB_MATRIX_ENABLE - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // Left Hand Mapped Left to Right { { 0 | (0 << 4) }, { 0, 0 }, 1}, - { { 0 | (1 << 4) }, { 22, 0 }, 0}, - { { 0 | (2 << 4) }, { 37, 0 }, 0}, - { { 0 | (3 << 4) }, { 37, 0 }, 0}, - { { 0 | (4 << 4) }, { 67, 0 }, 0}, - { { 0 | (5 << 4) }, { 82, 0 }, 0}, + { { 0 | (1 << 4) }, { 22, 0 }, 4}, + { { 0 | (2 << 4) }, { 37, 0 }, 4}, + { { 0 | (3 << 4) }, { 37, 0 }, 4}, + { { 0 | (4 << 4) }, { 67, 0 }, 4}, + { { 0 | (5 << 4) }, { 82, 0 }, 4}, { { 0 | (6 << 4) }, { 104, 0 }, 1}, { { 1 | (0 << 4) }, { 0, 16 }, 1}, - { { 1 | (1 << 4) }, { 22, 16 }, 0}, - { { 1 | (2 << 4) }, { 37, 16 }, 0}, - { { 1 | (3 << 4) }, { 37, 16 }, 0}, - { { 1 | (4 << 4) }, { 67, 16 }, 0}, - { { 1 | (5 << 4) }, { 82, 16 }, 0}, + { { 1 | (1 << 4) }, { 22, 16 }, 4}, + { { 1 | (2 << 4) }, { 37, 16 }, 4}, + { { 1 | (3 << 4) }, { 37, 16 }, 4}, + { { 1 | (4 << 4) }, { 67, 16 }, 4}, + { { 1 | (5 << 4) }, { 82, 16 }, 4}, { { 1 | (6 << 4) }, { 104, 16 }, 1}, { { 2 | (0 << 4) }, { 0, 32 }, 1}, - { { 2 | (1 << 4) }, { 22, 32 }, 0}, - { { 2 | (2 << 4) }, { 37, 32 }, 0}, - { { 2 | (3 << 4) }, { 37, 32 }, 0}, - { { 2 | (4 << 4) }, { 67, 32 }, 0}, - { { 2 | (5 << 4) }, { 82, 32 }, 0}, + { { 2 | (1 << 4) }, { 22, 32 }, 4}, + { { 2 | (2 << 4) }, { 37, 32 }, 4}, + { { 2 | (3 << 4) }, { 37, 32 }, 4}, + { { 2 | (4 << 4) }, { 67, 32 }, 4}, + { { 2 | (5 << 4) }, { 82, 32 }, 4}, { { 2 | (6 << 4) }, { 104, 32 }, 1}, { { 3 | (0 << 4) }, { 0, 48 }, 1}, - { { 3 | (1 << 4) }, { 22, 48 }, 0}, - { { 3 | (2 << 4) }, { 37, 48 }, 0}, - { { 3 | (3 << 4) }, { 37, 48 }, 0}, - { { 3 | (4 << 4) }, { 67, 48 }, 0}, - { { 3 | (5 << 4) }, { 82, 48 }, 0}, + { { 3 | (1 << 4) }, { 22, 48 }, 4}, + { { 3 | (2 << 4) }, { 37, 48 }, 4}, + { { 3 | (3 << 4) }, { 37, 48 }, 4}, + { { 3 | (4 << 4) }, { 67, 48 }, 4}, + { { 3 | (5 << 4) }, { 82, 48 }, 4}, { { 3 | (6 << 4) }, { 104, 48 }, 1}, { { 4 | (0 << 4) }, { 0, 64 }, 1}, { { 4 | (1 << 4) }, { 22, 64 }, 1}, @@ -42,32 +42,32 @@ { { 5 | (6 << 4) }, { 97, 55 }, 1}, // Left Hand Mapped Right to Left { { 6 | (0 << 4) }, { 224, 0 }, 1}, - { { 6 | (1 << 4) }, { 202, 0 }, 0}, - { { 6 | (2 << 4) }, { 187, 0 }, 0}, - { { 6 | (3 << 4) }, { 172, 0 }, 0}, - { { 6 | (4 << 4) }, { 157, 0 }, 0}, - { { 6 | (5 << 4) }, { 142, 0 }, 0}, + { { 6 | (1 << 4) }, { 202, 0 }, 4}, + { { 6 | (2 << 4) }, { 187, 0 }, 4}, + { { 6 | (3 << 4) }, { 172, 0 }, 4}, + { { 6 | (4 << 4) }, { 157, 0 }, 4}, + { { 6 | (5 << 4) }, { 142, 0 }, 4}, { { 6 | (6 << 4) }, { 120, 0 }, 1}, { { 7 | (0 << 4) }, { 224, 16 }, 1}, - { { 7 | (1 << 4) }, { 202, 16 }, 0}, - { { 7 | (2 << 4) }, { 187, 16 }, 0}, - { { 7 | (3 << 4) }, { 172, 16 }, 0}, - { { 7 | (4 << 4) }, { 157, 16 }, 0}, - { { 7 | (5 << 4) }, { 142, 16 }, 0}, + { { 7 | (1 << 4) }, { 202, 16 }, 4}, + { { 7 | (2 << 4) }, { 187, 16 }, 4}, + { { 7 | (3 << 4) }, { 172, 16 }, 4}, + { { 7 | (4 << 4) }, { 157, 16 }, 4}, + { { 7 | (5 << 4) }, { 142, 16 }, 4}, { { 7 | (6 << 4) }, { 120, 16 }, 1}, { { 8 | (0 << 4) }, { 224, 32 }, 1}, - { { 8 | (1 << 4) }, { 202, 32 }, 0}, - { { 8 | (2 << 4) }, { 187, 32 }, 0}, - { { 8 | (3 << 4) }, { 172, 32 }, 0}, - { { 8 | (4 << 4) }, { 157, 32 }, 0}, - { { 8 | (5 << 4) }, { 142, 32 }, 0}, + { { 8 | (1 << 4) }, { 202, 32 }, 4}, + { { 8 | (2 << 4) }, { 187, 32 }, 4}, + { { 8 | (3 << 4) }, { 172, 32 }, 4}, + { { 8 | (4 << 4) }, { 157, 32 }, 4}, + { { 8 | (5 << 4) }, { 142, 32 }, 4}, { { 8 | (6 << 4) }, { 120, 32 }, 1}, { { 9 | (0 << 4) }, { 224, 48 }, 1}, - { { 9 | (1 << 4) }, { 202, 48 }, 0}, - { { 9 | (2 << 4) }, { 187, 48 }, 0}, - { { 9 | (3 << 4) }, { 172, 48 }, 0}, - { { 9 | (4 << 4) }, { 157, 48 }, 0}, - { { 9 | (5 << 4) }, { 142, 48 }, 0}, + { { 9 | (1 << 4) }, { 202, 48 }, 4}, + { { 9 | (2 << 4) }, { 187, 48 }, 4}, + { { 9 | (3 << 4) }, { 172, 48 }, 4}, + { { 9 | (4 << 4) }, { 157, 48 }, 4}, + { { 9 | (5 << 4) }, { 142, 48 }, 4}, { { 9 | (6 << 4) }, { 120, 48 }, 1}, { { 10 | (0 << 4) }, { 224, 64 }, 1}, { { 10 | (1 << 4) }, { 202, 64 }, 1}, diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index e7f43ad6696..26c2e33040c 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -405,10 +405,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 16defede967..f82b4e7da7a 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -179,10 +179,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 5ca9b87a637..8c16c7790ea 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -162,28 +162,11 @@ void rgb_matrix_update_pwm_buffers(void) { } void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { -#ifdef RGB_MATRIX_EXTRA_TOG - const bool is_key = g_rgb_leds[index].matrix_co.raw != 0xff; - if ( - (rgb_matrix_config.enable == RGB_ZONE_KEYS && !is_key) || - (rgb_matrix_config.enable == RGB_ZONE_UNDER && is_key) - ) { - rgb_matrix_driver.set_color(index, 0, 0, 0); - return; - } -#endif - rgb_matrix_driver.set_color(index, red, green, blue); } void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { -#ifdef RGB_MATRIX_EXTRA_TOG - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -#else rgb_matrix_driver.set_color_all(red, green, blue); -#endif } bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { @@ -262,7 +245,7 @@ static bool rgb_matrix_none(effect_params_t* params) { static uint8_t rgb_last_enable = UINT8_MAX; static uint8_t rgb_last_effect = UINT8_MAX; -static effect_params_t rgb_effect_params = { 0, 0 }; +static effect_params_t rgb_effect_params = { 0, 0xFF }; static rgb_task_states rgb_task_state = SYNCING; static void rgb_task_timers(void) { @@ -575,29 +558,31 @@ void rgb_matrix_set_suspend_state(bool state) { } void rgb_matrix_toggle(void) { - rgb_matrix_config.enable++; - if (!rgb_matrix_config.enable) { - rgb_task_state = STARTING; - } + rgb_matrix_config.enable ^= 1; + rgb_task_state = STARTING; eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } void rgb_matrix_enable(void) { - rgb_matrix_config.enable = 1; + rgb_matrix_enable_noeeprom(); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } void rgb_matrix_enable_noeeprom(void) { - rgb_matrix_config.enable = 1; + if (!rgb_matrix_config.enable) + rgb_task_state = STARTING; + rgb_matrix_config.enable = 1; } void rgb_matrix_disable(void) { - rgb_matrix_config.enable = 0; + rgb_matrix_disable_noeeprom(); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } void rgb_matrix_disable_noeeprom(void) { - rgb_matrix_config.enable = 0; + if (rgb_matrix_config.enable) + rgb_task_state = STARTING; + rgb_matrix_config.enable = 0; } void rgb_matrix_step(void) { @@ -658,6 +643,14 @@ void rgb_matrix_decrease_speed(void) { eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this } +led_flags_t rgb_matrix_get_flags(void) { + return rgb_effect_params.flags; +} + +void rgb_matrix_set_flags(led_flags_t flags) { + rgb_effect_params.flags = flags; +} + void rgb_matrix_mode(uint8_t mode) { rgb_matrix_config.mode = mode; rgb_task_state = STARTING; diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 775cbeac034..33665ffff2a 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -54,7 +54,9 @@ uint8_t max = DRIVER_LED_TOTAL; #endif -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) continue + +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; typedef struct { @@ -209,6 +211,8 @@ void rgb_matrix_increase_val(void); void rgb_matrix_decrease_val(void); void rgb_matrix_increase_speed(void); void rgb_matrix_decrease_speed(void); +led_flags_t rgb_matrix_get_flags(void); +void rgb_matrix_set_flags(led_flags_t flags); void rgb_matrix_mode(uint8_t mode); void rgb_matrix_mode_noeeprom(uint8_t mode); uint8_t rgb_matrix_get_mode(void); diff --git a/quantum/rgb_matrix_animations/alpha_mods_anim.h b/quantum/rgb_matrix_animations/alpha_mods_anim.h index cc1914d7f4f..4bd01c4fc83 100644 --- a/quantum/rgb_matrix_animations/alpha_mods_anim.h +++ b/quantum/rgb_matrix_animations/alpha_mods_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; // alphas = color1, mods = color2 @@ -14,7 +14,8 @@ bool rgb_matrix_alphas_mods(effect_params_t* params) { RGB rgb2 = hsv_to_rgb(hsv); for (uint8_t i = led_min; i < led_max; i++) { - if (g_rgb_leds[i].modifier) { + RGB_MATRIX_TEST_LED_FLAGS(); + if (HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); } else { rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); diff --git a/quantum/rgb_matrix_animations/breathing_anim.h b/quantum/rgb_matrix_animations/breathing_anim.h index 4a9a1dcdb24..54d60f927d6 100644 --- a/quantum/rgb_matrix_animations/breathing_anim.h +++ b/quantum/rgb_matrix_animations/breathing_anim.h @@ -12,6 +12,7 @@ bool rgb_matrix_breathing(effect_params_t* params) { HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, val }; RGB rgb = hsv_to_rgb(hsv); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } return led_max < DRIVER_LED_TOTAL; diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h index 5c18cfa0c91..513dff12812 100644 --- a/quantum/rgb_matrix_animations/cycle_all_anim.h +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h @@ -2,16 +2,16 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_all(effect_params_t* params) { RGB_MATRIX_USE_LIMITS(led_min, led_max); HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; - uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); + hsv.h = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { - hsv.h = time; + RGB_MATRIX_TEST_LED_FLAGS(); RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/cycle_left_right_anim.h b/quantum/rgb_matrix_animations/cycle_left_right_anim.h index f519aeb476f..428adea2235 100644 --- a/quantum/rgb_matrix_animations/cycle_left_right_anim.h +++ b/quantum/rgb_matrix_animations/cycle_left_right_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_left_right(effect_params_t* params) { @@ -11,6 +11,7 @@ bool rgb_matrix_cycle_left_right(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = point.x - time; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/cycle_up_down_anim.h b/quantum/rgb_matrix_animations/cycle_up_down_anim.h index 8b91d890de3..ea63095d2e3 100644 --- a/quantum/rgb_matrix_animations/cycle_up_down_anim.h +++ b/quantum/rgb_matrix_animations/cycle_up_down_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_up_down(effect_params_t* params) { @@ -11,6 +11,7 @@ bool rgb_matrix_cycle_up_down(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = point.y - time; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/dual_beacon_anim.h b/quantum/rgb_matrix_animations/dual_beacon_anim.h index dda31578094..00f6e508801 100644 --- a/quantum/rgb_matrix_animations/dual_beacon_anim.h +++ b/quantum/rgb_matrix_animations/dual_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_dual_beacon(effect_params_t* params) { @@ -13,6 +13,7 @@ bool rgb_matrix_dual_beacon(effect_params_t* params) { int8_t cos_value = cos8(time) - 128; int8_t sin_value = sin8(time) - 128; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/gradient_up_down_anim.h b/quantum/rgb_matrix_animations/gradient_up_down_anim.h index 11498e22f5c..05117540aeb 100644 --- a/quantum/rgb_matrix_animations/gradient_up_down_anim.h +++ b/quantum/rgb_matrix_animations/gradient_up_down_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_gradient_up_down(effect_params_t* params) { @@ -10,6 +10,7 @@ bool rgb_matrix_gradient_up_down(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t scale = scale8(64, rgb_matrix_config.speed); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; // The y range will be 0..64, map this to 0..4 // Relies on hue being 8-bit and wrapping diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h index 01ff5c23060..dffa5326433 100644 --- a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h @@ -2,10 +2,11 @@ #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; -static void jellybean_raindrops_set_color(int i) { +static void jellybean_raindrops_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.val }; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); @@ -15,14 +16,14 @@ bool rgb_matrix_jellybean_raindrops(effect_params_t* params) { if (!params->init) { // Change one LED every tick, make sure speed is not 0 if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { - jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL); + jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); } return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (int i = led_min; i < led_max; i++) { - jellybean_raindrops_set_color(i); + jellybean_raindrops_set_color(i, params); } return led_max < DRIVER_LED_TOTAL; } diff --git a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h index 3c15e64ab66..89f6965c33d 100644 --- a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_beacon(effect_params_t* params) { @@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_beacon(effect_params_t* params) { int16_t cos_value = 2 * (cos8(time) - 128); int16_t sin_value = 2 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h index 0d11d52802b..0d57aef57bd 100644 --- a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { @@ -11,6 +11,7 @@ bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = abs8(point.y - 32) + (point.x - time) + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h index d7cd42cbe84..03652758c65 100644 --- a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { @@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { int16_t cos_value = 3 * (cos8(time) - 128); int16_t sin_value = 3 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = ((point.y - 32) * cos_value + (56 - abs8(point.x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index fc721375b05..0e3a878642b 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h @@ -5,7 +5,8 @@ extern rgb_counters_t g_rgb_counters; extern rgb_config_t rgb_matrix_config; -static void raindrops_set_color(int i) { +static void raindrops_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; // Take the shortest path between hues @@ -25,14 +26,14 @@ bool rgb_matrix_raindrops(effect_params_t* params) { if (!params->init) { // Change one LED every tick, make sure speed is not 0 if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { - raindrops_set_color(rand() % DRIVER_LED_TOTAL); + raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); } return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (int i = led_min; i < led_max; i++) { - raindrops_set_color(i); + raindrops_set_color(i, params); } return led_max < DRIVER_LED_TOTAL; } diff --git a/quantum/rgb_matrix_animations/solid_color_anim.h b/quantum/rgb_matrix_animations/solid_color_anim.h index 24a197beb34..033c1f93334 100644 --- a/quantum/rgb_matrix_animations/solid_color_anim.h +++ b/quantum/rgb_matrix_animations/solid_color_anim.h @@ -8,6 +8,7 @@ bool rgb_matrix_solid_color(effect_params_t* params) { HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; RGB rgb = hsv_to_rgb(hsv); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } return led_max < DRIVER_LED_TOTAL; diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h index 220e542331a..836409dd60b 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h @@ -13,6 +13,7 @@ bool rgb_matrix_solid_reactive(effect_params_t* params) { uint16_t max_tick = 65535 / rgb_matrix_config.speed; // Relies on hue being 8-bit and wrapping for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); uint16_t tick = max_tick; for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h index af602cba15a..1dec1886d17 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_par hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { + RGB_MATRIX_TEST_LED_FLAGS(); int16_t dx = point.x - g_last_hit_tracker.x[j]; int16_t dy = point.y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h index 8b4a139dc9c..8952a1e2bff 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { + RGB_MATRIX_TEST_LED_FLAGS(); int16_t dx = point.x - g_last_hit_tracker.x[j]; int16_t dy = point.y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h index e84cd693924..d7bdb414ec1 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h @@ -12,6 +12,7 @@ bool rgb_matrix_solid_reactive_simple(effect_params_t* params) { // Max tick based on speed scale ensures results from scale16by8 with rgb_matrix_config.speed are no greater than 255 uint16_t max_tick = 65535 / rgb_matrix_config.speed; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); uint16_t tick = max_tick; for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h index abb01892edb..d86cb128449 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_para hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { + RGB_MATRIX_TEST_LED_FLAGS(); int16_t dx = point.x - g_last_hit_tracker.x[j]; int16_t dy = point.y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); diff --git a/quantum/rgb_matrix_animations/solid_splash_anim.h b/quantum/rgb_matrix_animations/solid_splash_anim.h index 82ac055b88d..14312f33dae 100644 --- a/quantum/rgb_matrix_animations/solid_splash_anim.h +++ b/quantum/rgb_matrix_animations/solid_splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -12,6 +12,7 @@ static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* p HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { diff --git a/quantum/rgb_matrix_animations/splash_anim.h b/quantum/rgb_matrix_animations/splash_anim.h index 829d30eef51..3c96d451e1a 100644 --- a/quantum/rgb_matrix_animations/splash_anim.h +++ b/quantum/rgb_matrix_animations/splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -12,6 +12,7 @@ static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) HSV hsv = { 0, rgb_matrix_config.sat, 0 }; uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); hsv.h = rgb_matrix_config.hue; hsv.v = 0; point_t point = g_rgb_leds[i].point; diff --git a/quantum/rgb_matrix_types.h b/quantum/rgb_matrix_types.h index 908e96da56d..7a3bc6714f5 100644 --- a/quantum/rgb_matrix_types.h +++ b/quantum/rgb_matrix_types.h @@ -67,18 +67,20 @@ typedef union { }; } matrix_co_t; -typedef struct PACKED { - matrix_co_t matrix_co; - point_t point; - uint8_t modifier:1; -} rgb_led; +#define HAS_FLAGS(bits, flags) ((bits & flags) == flags) +#define HAS_ANY_FLAGS(bits, flags) ((bits & flags) != 0x00) -typedef enum { - RGB_ZONE_OFF = 0, - RGB_ZONE_ALL, - RGB_ZONE_KEYS, - RGB_ZONE_UNDER, -} rgb_zone_t; +#define LED_FLAG_ALL 0xFF +#define LED_FLAG_NONE 0x00 +#define LED_FLAG_MODIFIER 0x01 +#define LED_FLAG_UNDERGLOW 0x02 +#define LED_FLAG_KEYLIGHT 0x04 + +typedef struct PACKED { + matrix_co_t matrix_co; + point_t point; + uint8_t flags; +} rgb_led; typedef union { uint32_t raw; diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index e29fb6587c9..a2eab1b563e 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -443,9 +443,9 @@ static void led_matrix_massdrop_config_override(int i) uint8_t highest_active_layer = biton32(layer_state); - if (led_lighting_mode == LED_MODE_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw == 0xff) { + if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { //Do not act on this LED - } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw != 0xff) { + } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { //Do not act on this LED } else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) { //Do not act on this LED (Only show indicators) From 1f0a2d555044e0979c58d4993b4383afa61e7669 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 29 Apr 2019 17:23:02 -0700 Subject: [PATCH 049/129] [Keyboard] Minor fixes for Baguette (#5737) * Fix Baguette ISO layout in QMK Configurator Corrected the position of the ISO Enter key. * Fix readme markdown Was missing a line break. --- keyboards/baguette/info.json | 2 +- keyboards/baguette/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/baguette/info.json b/keyboards/baguette/info.json index f3c9b308fb6..2e845cdda59 100644 --- a/keyboards/baguette/info.json +++ b/keyboards/baguette/info.json @@ -123,7 +123,7 @@ {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"ISO #", "x":12.75, "y":2}, - {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, + {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"ISO \\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, diff --git a/keyboards/baguette/readme.md b/keyboards/baguette/readme.md index d211af16a54..e6188cc9904 100644 --- a/keyboards/baguette/readme.md +++ b/keyboards/baguette/readme.md @@ -6,7 +6,7 @@ Baguette This is a custom keyboard with backlight inspired by France. Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) -Hardware Supported: ATMEGA 32u4 MCU with backlight support. +Hardware Supported: ATMEGA 32u4 MCU with backlight support. Hardware Availability: Closed group-buy please contact the runners (Tesletron and Enjoy) Make example for this keyboard (after setting up your build environment): From e77e46f4bf049c33bcb982325bf5e5bf27994550 Mon Sep 17 00:00:00 2001 From: David Dai Date: Mon, 29 Apr 2019 17:27:49 -0700 Subject: [PATCH 050/129] [Keyboard] Adding ortho_4x12 & planck_mit layouts for KBD4X (#5729) * Adding ortho_4x12 & planck_mit layouts for KBD4X. * Adding LAYOUT_kc_ortho_4x12 macro to KBD4x. * Turn off console for KBD4X so firmware size falls within limit. --- keyboards/kbdfans/kbd4x/kbd4x.h | 21 +++++++++++++++++---- keyboards/kbdfans/kbd4x/rules.mk | 4 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/keyboards/kbdfans/kbd4x/kbd4x.h b/keyboards/kbdfans/kbd4x/kbd4x.h index df0251fa420..ab31d3657f8 100644 --- a/keyboards/kbdfans/kbd4x/kbd4x.h +++ b/keyboards/kbdfans/kbd4x/kbd4x.h @@ -21,13 +21,13 @@ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ ) \ { \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ + { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ } // The PCB does support a grid layout, but the case does not. @@ -35,11 +35,24 @@ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ ) \ { \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_kc_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b } \ } diff --git a/keyboards/kbdfans/kbd4x/rules.mk b/keyboards/kbdfans/kbd4x/rules.mk index de03b833ce2..639546d6c23 100644 --- a/keyboards/kbdfans/kbd4x/rules.mk +++ b/keyboards/kbdfans/kbd4x/rules.mk @@ -65,7 +65,7 @@ BOOTLOADER = atmel-dfu BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) +CONSOLE_ENABLE = no # 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 @@ -79,3 +79,5 @@ 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 HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_4x12 planck_mit From 507805cd106ca5b5c739e08d37e9c689973b3b30 Mon Sep 17 00:00:00 2001 From: Jeremy Bernhardt Date: Mon, 29 Apr 2019 18:29:00 -0600 Subject: [PATCH 051/129] [Keyboard] Fixing drag-and-drop (#5728) * Fixing drag-and-drop * Forgot to rtfm and do a full build. Added colemak * What --- keyboards/gergo/keymaps/colemak/keymap.c | 174 ++++++++++++++++++++++ keyboards/gergo/keymaps/colemak/readme.md | 16 ++ keyboards/gergo/keymaps/colemak/rules.mk | 36 +++++ keyboards/gergo/keymaps/default/rules.mk | 3 +- keyboards/gergo/keymaps/germ/rules.mk | 1 + keyboards/gergo/matrix.c | 2 +- keyboards/gergo/rules.mk | 1 - 7 files changed, 230 insertions(+), 3 deletions(-) create mode 100644 keyboards/gergo/keymaps/colemak/keymap.c create mode 100644 keyboards/gergo/keymaps/colemak/readme.md create mode 100644 keyboards/gergo/keymaps/colemak/rules.mk diff --git a/keyboards/gergo/keymaps/colemak/keymap.c b/keyboards/gergo/keymaps/colemak/keymap.c new file mode 100644 index 00000000000..b2e79114f23 --- /dev/null +++ b/keyboards/gergo/keymaps/colemak/keymap.c @@ -0,0 +1,174 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H + +#define IGNORE_MOD_TAP_INTERRUPT +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define NUMB 2 // numbers/motion + +enum custom_keycodes { + M1_STRING = SAFE_RANGE, + M2_URL, +}; + +// Blank template at the bottom + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | TAB | Q | W | F | P | G | | J | L | U | Y | ; : | | \ | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | Ctrl | A | R | S | T | D |O(CMD)| |O(CTL)| H | N | E | I | O | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B |O(ALT)| | | K | M | , < | . > | / ? | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .----------. .-------. .------. .--------. + * | alt/del | | BKSP | | Space| |cmd/del | + * '----------' '-------' `------. '--------' + * ,-------. ,-------. + * | MMB | | : | + * ,------|-------| |-------|------. + * | NUMB | SYMB | | SYMB | NUMB | + * | Esc | F13 | | F14 | Enter| + * | | | | | | + * `--------------' `--------------' + */ +[BASE] = LAYOUT_gergo( +KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y,KC_SCLN, KC_BSLS, +KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, OSM(MOD_LGUI), OSM(MOD_LCTL), KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, +KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, OSM(MOD_LALT), KC_TRNS, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + + ALT_T(KC_DEL), KC_BSPC, KC_SPC, CMD_T(KC_DEL), + + KC_BTN3, KC_COLON, + LT(SYMB, KC_ESC), LT(NUMB, KC_F13), LT(NUMB, KC_F14), LT(SYMB, KC_ENT)), +/* Keymap 1: Symbols layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | VolUp | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | [ | ] | { | } | ` | M1 | | | | - | _ | + | = | VolDn | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | ` | ~ | | | ~ | M2 | | | | | Prev |Pl/Pau| Next | Mute | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' + */ +[SYMB] = LAYOUT_gergo( +KC_TRNS, KC_EXLM, KC_AT, KC_HASH,KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC__VOLUP, +KC_TRNS, KC_LBRC, KC_RBRC, KC_LCBR,KC_RCBR, KC_PLUS, M1_STRING, KC_TRNS, KC_TRNS, KC_MINS, KC_UNDERSCORE, KC_PLUS, KC_EQL, KC__VOLDOWN, +KC_TRNS, KC_GRV, KC_TILD,KC_TRNS,KC_TRNS, KC_EQL, M2_URL, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_REWIND, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_FAST_FORWARD, KC__MUTE, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +/* Keymap 2: Pad/Function layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | PgUp | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | F1 | F2 | F3 | F4 | F5 | F6 | BTN1 | | Home | LEFT | DOWN | UP | RIGHT| End | PgDn | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | F7 | F8 | F9 | F10 | F11 | F12 | BTN2 | | | MLFT | MDWN | MUP | MRGHT| | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | ALT | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' + */ +[NUMB] = LAYOUT_gergo( +KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGUP, +KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_BTN1, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_PGDN, +KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BTN2, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +/* Keymap template + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' +[SYMB] = LAYOUT_gergo( +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + */ + +// 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); + biton32(layer_state); +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M1_STRING: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("Hi!" SS_TAP(X_ENTER)); + } else { + // when keycode QMKBEST is released + } + break; + + case M2_URL: + if (record->event.pressed) { + SEND_STRING("https://ddg.gg" SS_TAP(X_ENTER)); + } + break; + + } + return true; +}; + diff --git a/keyboards/gergo/keymaps/colemak/readme.md b/keyboards/gergo/keymaps/colemak/readme.md new file mode 100644 index 00000000000..1c1cc7bdea2 --- /dev/null +++ b/keyboards/gergo/keymaps/colemak/readme.md @@ -0,0 +1,16 @@ +# [Gergo! By g Heavy Industries](http://gboards.ca) + +![Gergo image](https://4.bp.blogspot.com/-889nMXxgSM0/XCNxwnO5kUI/AAAAAAAA6mI/tZbWgZVCBW0dyZOCGJDkjN06DVax7j8XwCLcBGAs/s1600/48422820_967732713413298_485744639215665152_n.jpg) + +This is a [Colemak](https://colemak.com/) mapping for the Gergo, + +Unlike the default mapping, most symbols are at their original place on the number row to ease in the +learning curve. + +You can view this layout over at +[keyboad-layout-editor.com](http://www.keyboard-layout-editor.com/#/gists/f04d6a3b0cd3db91407c51f7ba36aeb3). + +## Settings +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/colemak/rules.mk b/keyboards/gergo/keymaps/colemak/rules.mk new file mode 100644 index 00000000000..ddec12d1b14 --- /dev/null +++ b/keyboards/gergo/keymaps/colemak/rules.mk @@ -0,0 +1,36 @@ +#---------------------------------------------------------------------------- +# make gergo:germ:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- +# Firmware options +BALLER = no # Enable to ball out +BALLSTEP = 20 # Multiple in px to move, multiplied by layer number +SCROLLSTEP = 1 # Lines to scroll with ball +MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller + +#Debug options +VERBOSE = no +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_BALLER = no +DEBUG_MATRIX = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifneq ($(strip $(BALLSTEP)),) + OPT_DEFS += -DTRKSTEP=$(strip $(BALLSTEP)) +endif +ifneq ($(strip $(SCROLLSTEP)),) + OPT_DEFS += -DSCROLLSTEP=$(strip $(SCROLLSTEP)) +endif +ifeq ($(strip $(BALLER)), yes) + OPT_DEFS += -DBALLER +endif +ifeq ($(strip $(DEBUG_BALLER)), yes) + OPT_DEFS += -DDEBUG_BALLER +endif +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif diff --git a/keyboards/gergo/keymaps/default/rules.mk b/keyboards/gergo/keymaps/default/rules.mk index 507cc97b7b6..da2d03af2c4 100644 --- a/keyboards/gergo/keymaps/default/rules.mk +++ b/keyboards/gergo/keymaps/default/rules.mk @@ -3,7 +3,7 @@ # Make sure you have dfu-programmer installed! #---------------------------------------------------------------------------- # Firmware options -BALLER = yes # Enable to ball out +BALLER = no # Enable to ball out BALLSTEP = 20 # Multiple in px to move, multiplied by layer number SCROLLSTEP = 1 # Lines to scroll with ball MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller @@ -26,6 +26,7 @@ ifneq ($(strip $(SCROLLSTEP)),) OPT_DEFS += -DSCROLLSTEP=$(strip $(SCROLLSTEP)) endif ifeq ($(strip $(BALLER)), yes) + POINTING_DEVICE_ENABLE = yes OPT_DEFS += -DBALLER endif ifeq ($(strip $(DEBUG_BALLER)), yes) diff --git a/keyboards/gergo/keymaps/germ/rules.mk b/keyboards/gergo/keymaps/germ/rules.mk index 2f825a76639..badfe7bb998 100644 --- a/keyboards/gergo/keymaps/germ/rules.mk +++ b/keyboards/gergo/keymaps/germ/rules.mk @@ -27,6 +27,7 @@ ifneq ($(strip $(SCROLLSTEP)),) endif ifeq ($(strip $(BALLER)), yes) OPT_DEFS += -DBALLER + POINTING_DEVICE_ENABLE = yes endif ifeq ($(strip $(DEBUG_BALLER)), yes) OPT_DEFS += -DDEBUG_BALLER diff --git a/keyboards/gergo/matrix.c b/keyboards/gergo/matrix.c index aa1dc4842e4..234160326a5 100644 --- a/keyboards/gergo/matrix.c +++ b/keyboards/gergo/matrix.c @@ -30,7 +30,6 @@ along with this program. If not, see . #include "debug.h" #include "util.h" #include "debounce.h" -#include "pointing_device.h" #include QMK_KEYBOARD_H #ifdef DEBUG_MATRIX_SCAN_RATE # include "timer.h" @@ -38,6 +37,7 @@ along with this program. If not, see . #ifdef BALLER #include +#include "pointing_device.h" #endif #ifndef DEBOUNCE diff --git a/keyboards/gergo/rules.mk b/keyboards/gergo/rules.mk index 2ce9e01e6d4..a33bfcec8df 100644 --- a/keyboards/gergo/rules.mk +++ b/keyboards/gergo/rules.mk @@ -14,7 +14,6 @@ BOOTLOADER = atmel-dfu F_USB = $(F_CPU) CUSTOM_MATRIX = yes -POINTING_DEVICE_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes From 75d72c221d333982d01a7d99ba4f108dc927ea50 Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Tue, 30 Apr 2019 08:44:36 +0800 Subject: [PATCH 052/129] Change lib8tion library to be usable in user keymaps (#5598) * Move lib8tion header-defined constant into implementation file, add to build * Move b_m16_interleave initializtion to lib8tion.c, change build to include lib8tion.c in QUANTUM_LIB_SRC * Remove left-over whitespace * Move lib8tion include by RGB_MATRIX_ENABLE code in makefile * Revert build changes and change lib8tion b_m16_interleave constant to static --- lib/lib8tion/trig8.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib8tion/trig8.h b/lib/lib8tion/trig8.h index 4907c6ff30a..6ef3ce625f4 100644 --- a/lib/lib8tion/trig8.h +++ b/lib/lib8tion/trig8.h @@ -147,7 +147,7 @@ LIB8STATIC int16_t cos16( uint16_t theta) #endif -const uint8_t b_m16_interleave[] = { 0, 49, 49, 41, 90, 27, 117, 10 }; +static const uint8_t b_m16_interleave[8] = { 0, 49, 49, 41, 90, 27, 117, 10 }; /// Fast 8-bit approximation of sin(x). This approximation never varies more than /// 2% from the floating point value you'd get by doing From 7d4ae3e66ebe1e9ff52ad4eb87da8cd9f01c142a Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Mon, 29 Apr 2019 19:45:42 -0500 Subject: [PATCH 053/129] Removed forced in lining for lib8tion functions (#5670) --- lib/lib8tion/lib8tion.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lib8tion/lib8tion.h b/lib/lib8tion/lib8tion.h index d93c748e6a4..4c770cbcb5e 100644 --- a/lib/lib8tion/lib8tion.h +++ b/lib/lib8tion/lib8tion.h @@ -167,8 +167,8 @@ Lib8tion is pronounced like 'libation': lie-BAY-shun #include -#define LIB8STATIC __attribute__ ((unused)) static inline -#define LIB8STATIC_ALWAYS_INLINE __attribute__ ((always_inline)) static inline +#define LIB8STATIC static inline +#define LIB8STATIC_ALWAYS_INLINE static inline #if !defined(__AVR__) #include From c745d9b82e3f2047feb97a7a8937f27c6e989fd7 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Mon, 29 Apr 2019 22:21:46 -0500 Subject: [PATCH 054/129] Simple extended space cadet (#5277) * Simplifying and Extending Space Cadet to work on Ctrl and Alt keys * PR Review feedback * Reverting back to keycodes --- common_features.mk | 6 + docs/_summary.md | 3 +- docs/feature_space_cadet.md | 59 +++++++ docs/feature_space_cadet_shift.md | 37 ----- docs/feature_space_cadet_shift_enter.md | 31 ---- quantum/process_keycode/process_space_cadet.c | 146 ++++++++++++++++++ quantum/process_keycode/process_space_cadet.h | 21 +++ quantum/quantum.c | 123 +-------------- quantum/quantum.h | 4 + quantum/quantum_keycodes.h | 12 ++ 10 files changed, 252 insertions(+), 190 deletions(-) create mode 100644 docs/feature_space_cadet.md delete mode 100644 docs/feature_space_cadet_shift.md delete mode 100644 docs/feature_space_cadet_shift_enter.md create mode 100644 quantum/process_keycode/process_space_cadet.c create mode 100644 quantum/process_keycode/process_space_cadet.h diff --git a/common_features.mk b/common_features.mk index 8e9bcf0b98d..6dffe31ff8d 100644 --- a/common_features.mk +++ b/common_features.mk @@ -351,3 +351,9 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) QUANTUM_LIB_SRC += i2c_master.c SRC += oled_driver.c endif + +SPACE_CADET_ENABLE ?= yes +ifeq ($(strip $(SPACE_CADET_ENABLE)), yes) + SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c + OPT_DEFS += -DSPACE_CADET_ENABLE +endif diff --git a/docs/_summary.md b/docs/_summary.md index c9d6c2bb14e..d3108701920 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -68,8 +68,7 @@ * [PS/2 Mouse](feature_ps2_mouse.md) * [RGB Lighting](feature_rgblight.md) * [RGB Matrix](feature_rgb_matrix.md) - * [Space Cadet Shift](feature_space_cadet_shift.md) - * [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md) + * [Space Cadet](feature_space_cadet.md) * [Stenography](feature_stenography.md) * [Swap Hands](feature_swap_hands.md) * [Tap Dance](feature_tap_dance.md) diff --git a/docs/feature_space_cadet.md b/docs/feature_space_cadet.md new file mode 100644 index 00000000000..3e4665cde68 --- /dev/null +++ b/docs/feature_space_cadet.md @@ -0,0 +1,59 @@ +# Space Cadet: The Future, Built In + +Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds, and now even cooler supporting Control and Alt as well! + +## Usage + +Firstly, in your keymap, do one of the following: +- Replace the Left Shift key with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close). +- Replace the Left Control key with `KC_LCPO` (Left Control, Parenthesis Open), and Right Control with `KC_RCPC` (Right Control, Parenthesis Close). +- Replace the Left Alt key with `KC_LAPO` (Left Alt, Parenthesis Open), and Right Alt with `KC_RAPC` (Right Alt, Parenthesis Close). +- Replace any Shift key in your keymap with `KC_SFTENT` (Right Shift, Enter). + +## Keycodes + +|Keycode |Description | +|-----------|-------------------------------------------| +|`KC_LSPO` |Left Shift when held, `(` when tapped | +|`KC_RSPC` |Right Shift when held, `)` when tapped | +|`KC_LCPO` |Left Control when held, `(` when tapped | +|`KC_RCPC` |Right Control when held, `)` when tapped | +|`KC_LAPO` |Left Alt when held, `(` when tapped | +|`KC_RAPC` |Right Alt when held, `)` when tapped | +|`KC_SFTENT`|Right Shift when held, `Enter` when tapped | + +## Caveats + +Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. See the [Command feature](feature_command.md) for info on how to change it, or make sure that Command is disabled in your `rules.mk` with: + +```make +COMMAND_ENABLE = no +``` + +## Configuration + +By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. In addition, you can redefine the modifier to send on tap, or even send no modifier at all. The new configuration defines bundle all options up into a single define of 3 key codes in this order: the `Modifier` when held or when used with other keys, the `Tap Modifer` sent when tapped (no modifier if `KC_TRNS`), finally the `Keycode` sent when tapped. Now keep in mind, mods from other keys will still apply to the `Keycode` if say `KC_RSFT` is held while tapping `KC_LSPO` key with `KC_TRNS` as the `Tap Modifer`. + +|Define |Default |Description | +|----------------|-------------------------------|---------------------------------------------------------------------------------| +|`LSPO_KEYS` |`KC_LSFT, LSPO_MOD, LSPO_KEY` |Send `KC_LSFT` when held, the mod and key defined by `LSPO_MOD` and `LSPO_KEY`. | +|`RSPC_KEYS` |`KC_RSFT, RSPC_MOD, RSPC_KEY` |Send `KC_RSFT` when held, the mod and key defined by `RSPC_MOD` and `RSPC_KEY`. | +|`LCPO_KEYS` |`KC_LCTL, KC_LCTL, KC_9` |Send `KC_LCTL` when held, the mod `KC_LCTL` with the key `KC_9` when tapped. | +|`RCPO_KEYS` |`KC_RCTL, KC_RCTL, KC_0` |Send `KC_RCTL` when held, the mod `KC_RCTL` with the key `KC_0` when tapped. | +|`LAPO_KEYS` |`KC_LALT, KC_LALT, KC_9` |Send `KC_LALT` when held, the mod `KC_LALT` with the key `KC_9` when tapped. | +|`RAPO_KEYS` |`KC_RALT, KC_RALT, KC_0` |Send `KC_RALT` when held, the mod `KC_RALT` with the key `KC_0` when tapped. | +|`SFTENT_KEYS` |`KC_RSFT, KC_TRNS, SFTENT_KEY` |Send `KC_RSFT` when held, no mod with the key `SFTENT_KEY` when tapped. | + + +## Obsolete Configuration + +These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just `KC_LSPO`, with the old defines you had an all or nothing choice of using the `DISABLE_SPACE_CADET_MODIFIER` define. Now you can define that key as: `#define KC_LSPO_KEYS KC_LSFT, KC_TRNS, KC_9`. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the `KC_9` + +|Define |Default |Description | +|------------------------------|-------------|------------------------------------------------------------------| +|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped | +|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped | +|`LSPO_MOD` |`KC_LSFT` |The modifier to apply to `LSPO_KEY` | +|`RSPC_MOD` |`KC_RSFT` |The modifier to apply to `RSPC_KEY` | +|`SFTENT_KEY` |`KC_ENT` |The keycode to send when the Shift key is tapped | +|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet from applying a modifier | diff --git a/docs/feature_space_cadet_shift.md b/docs/feature_space_cadet_shift.md deleted file mode 100644 index 427d2a58127..00000000000 --- a/docs/feature_space_cadet_shift.md +++ /dev/null @@ -1,37 +0,0 @@ -# Space Cadet Shift: The Future, Built In - -Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds. - -## Usage - -Replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close). - -## Keycodes - -|Keycode |Description | -|---------|--------------------------------------| -|`KC_LSPO`|Left Shift when held, `(` when tapped | -|`KC_RSPC`|Right Shift when held, `)` when tapped| - -## Caveats - -Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. Make sure that Command is disabled in your `rules.mk` with: - -```make -COMMAND_ENABLE = no -``` - -## Configuration - -By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. -You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released. -Also, by default, the Space Cadet applies modifiers LSPO_MOD and RSPC_MOD to keys defined by LSPO_KEY and RSPC_KEY. You can override this behavior by redefining those variables in your `config.h`. You can also prevent the Space Cadet to apply a modifier by defining DISABLE_SPACE_CADET_MODIFIER in your `config.h`. - -|Define |Default |Description | -|------------------------------|-------------|--------------------------------------------------------------------------------| -|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped | -|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped | -|`LSPO_MOD` |`KC_LSFT` |The keycode to send when Left Shift is tapped | -|`RSPC_MOD` |`KC_RSFT` |The keycode to send when Right Shift is tapped | -|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet | -|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet to apply a modifier to LSPO_KEY and RSPC_KEY| diff --git a/docs/feature_space_cadet_shift_enter.md b/docs/feature_space_cadet_shift_enter.md deleted file mode 100644 index 56a569b1392..00000000000 --- a/docs/feature_space_cadet_shift_enter.md +++ /dev/null @@ -1,31 +0,0 @@ -# Space Cadet Shift Enter - -Based on the [Space Cadet Shift](feature_space_cadet_shift.md) feature. Tap the Shift key on its own, and it behaves like Enter. When held, the Shift functions as normal. - -## Usage - -Replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done. - -## Keycodes - -|Keycode |Description | -|-----------|----------------------------------------| -|`KC_SFTENT`|Right Shift when held, Enter when tapped| - -## Caveats - -As with Space Cadet Shift, this feature may conflict with Command, so it should be disabled in your `rules.mk` with: - -```make -COMMAND_ENABLE = no -``` - -This feature also uses the same timers as Space Cadet Shift, so using them in tandem may produce strange results. - -## Configuration - -By default Space Cadet assumes a US ANSI layout, but if you'd like to use a different key for Enter, you can redefine it in your `config.h`: - -|Define |Default |Description | -|------------|--------|------------------------------------------------| -|`SFTENT_KEY`|`KC_ENT`|The keycode to send when the Shift key is tapped| diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c new file mode 100644 index 00000000000..a9c506168d6 --- /dev/null +++ b/quantum/process_keycode/process_space_cadet.c @@ -0,0 +1,146 @@ +/* Copyright 2019 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 "process_space_cadet.h" + +#ifndef TAPPING_TERM + #define TAPPING_TERM 200 +#endif + +// ********** OBSOLETE DEFINES, STOP USING! (pls?) ********** +// Shift / paren setup +#ifndef LSPO_KEY + #define LSPO_KEY KC_9 +#endif +#ifndef RSPC_KEY + #define RSPC_KEY KC_0 +#endif + +// Shift / Enter setup +#ifndef SFTENT_KEY + #define SFTENT_KEY KC_ENT +#endif + +#ifdef DISABLE_SPACE_CADET_MODIFIER + #ifndef LSPO_MOD + #define LSPO_MOD KC_TRNS + #endif + #ifndef RSPC_MOD + #define RSPC_MOD KC_TRNS + #endif +#else + #ifndef LSPO_MOD + #define LSPO_MOD KC_LSFT + #endif + #ifndef RSPC_MOD + #define RSPC_MOD KC_RSFT + #endif +#endif +// ********************************************************** + +// Shift / paren setup +#ifndef LSPO_KEYS + #define LSPO_KEYS KC_LSFT, LSPO_MOD, LSPO_KEY +#endif +#ifndef RSPC_KEYS + #define RSPC_KEYS KC_RSFT, RSPC_MOD, RSPC_KEY +#endif + +// Control / paren setup +#ifndef LCPO_KEYS + #define LCPO_KEYS KC_LCTL, KC_LCTL, KC_9 +#endif +#ifndef RCPO_KEYS + #define RCPO_KEYS KC_RCTL, KC_RCTL, KC_0 +#endif + +// Alt / paren setup +#ifndef LAPO_KEYS + #define LAPO_KEYS KC_LALT, KC_LALT, KC_9 +#endif +#ifndef RAPO_KEYS + #define RAPO_KEYS KC_RALT, KC_RALT, KC_0 +#endif + +// Shift / Enter setup +#ifndef SFTENT_KEYS + #define SFTENT_KEYS KC_RSFT, KC_TRNS, SFTENT_KEY +#endif + +static uint8_t sc_last = 0; +static uint16_t sc_timer = 0; + +void perform_space_cadet(keyrecord_t *record, uint8_t normalMod, uint8_t tapMod, uint8_t keycode) { + if (record->event.pressed) { + sc_last = normalMod; + sc_timer = timer_read (); + if (IS_MOD(normalMod)) { + register_mods(MOD_BIT(normalMod)); + } + } + else { + if (IS_MOD(normalMod)) { + unregister_mods(MOD_BIT(normalMod)); + } + + if (sc_last == normalMod && timer_elapsed(sc_timer) < TAPPING_TERM) { + if (IS_MOD(tapMod)) { + register_mods(MOD_BIT(tapMod)); + } + tap_code(keycode); + if (IS_MOD(tapMod)) { + unregister_mods(MOD_BIT(tapMod)); + } + } + } +} + +bool process_space_cadet(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case KC_LSPO: { + perform_space_cadet(record, LSPO_KEYS); + return false; + } + case KC_RSPC: { + perform_space_cadet(record, RSPC_KEYS); + return false; + } + case KC_LCPO: { + perform_space_cadet(record, LCPO_KEYS); + return false; + } + case KC_RCPC: { + perform_space_cadet(record, RCPO_KEYS); + return false; + } + case KC_LAPO: { + perform_space_cadet(record, LAPO_KEYS); + return false; + } + case KC_RAPC: { + perform_space_cadet(record, RAPO_KEYS); + return false; + } + case KC_SFTENT: { + perform_space_cadet(record, SFTENT_KEYS); + return false; + } + default: { + sc_last = 0; + break; + } + } + return true; +} diff --git a/quantum/process_keycode/process_space_cadet.h b/quantum/process_keycode/process_space_cadet.h new file mode 100644 index 00000000000..3f08b8002ad --- /dev/null +++ b/quantum/process_keycode/process_space_cadet.h @@ -0,0 +1,21 @@ +/* Copyright 2019 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 . + */ +#pragma once + +#include "quantum.h" + +void perform_space_cadet(keyrecord_t *record, uint8_t normalMod, uint8_t tapMod, uint8_t keycode); +bool process_space_cadet(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/quantum.c b/quantum/quantum.c index 0fb798a7488..fcedf0bc18b 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -24,10 +24,6 @@ #include "outputselect.h" #endif -#ifndef TAPPING_TERM -#define TAPPING_TERM 200 -#endif - #ifndef BREATHING_PERIOD #define BREATHING_PERIOD 6 #endif @@ -196,30 +192,6 @@ void reset_keyboard(void) { bootloader_jump(); } -// Shift / paren setup - -#ifndef LSPO_KEY - #define LSPO_KEY KC_9 -#endif -#ifndef RSPC_KEY - #define RSPC_KEY KC_0 -#endif - -#ifndef LSPO_MOD - #define LSPO_MOD KC_LSFT -#endif -#ifndef RSPC_MOD - #define RSPC_MOD KC_RSFT -#endif - -// Shift / Enter setup -#ifndef SFTENT_KEY - #define SFTENT_KEY KC_ENT -#endif - -static bool shift_interrupted[2] = {0, 0}; -static uint16_t scs_timer[2] = {0, 0}; - /* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise. * Used to ensure that the correct keycode is released if the key is released. */ @@ -328,6 +300,9 @@ bool process_record_quantum(keyrecord_t *record) { #endif #ifdef TERMINAL_ENABLE process_terminal(keycode, record) && + #endif + #ifdef SPACE_CADET_ENABLE + process_space_cadet(keycode, record) && #endif true)) { return false; @@ -685,92 +660,6 @@ bool process_record_quantum(keyrecord_t *record) { return false; } break; - case KC_LSPO: { - if (record->event.pressed) { - shift_interrupted[0] = false; - scs_timer[0] = timer_read (); - register_mods(MOD_BIT(KC_LSFT)); - } - else { - #ifdef DISABLE_SPACE_CADET_ROLLOVER - if (get_mods() & MOD_BIT(RSPC_MOD)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } - #endif - if (!shift_interrupted[0] && timer_elapsed(scs_timer[0]) < TAPPING_TERM) { - #ifdef DISABLE_SPACE_CADET_MODIFIER - unregister_mods(MOD_BIT(KC_LSFT)); - #else - if( LSPO_MOD != KC_LSFT ){ - unregister_mods(MOD_BIT(KC_LSFT)); - register_mods(MOD_BIT(LSPO_MOD)); - } - #endif - register_code(LSPO_KEY); - unregister_code(LSPO_KEY); - #ifndef DISABLE_SPACE_CADET_MODIFIER - if( LSPO_MOD != KC_LSFT ){ - unregister_mods(MOD_BIT(LSPO_MOD)); - } - #endif - } - unregister_mods(MOD_BIT(KC_LSFT)); - } - return false; - } - - case KC_RSPC: { - if (record->event.pressed) { - shift_interrupted[1] = false; - scs_timer[1] = timer_read (); - register_mods(MOD_BIT(KC_RSFT)); - } - else { - #ifdef DISABLE_SPACE_CADET_ROLLOVER - if (get_mods() & MOD_BIT(LSPO_MOD)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } - #endif - if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) { - #ifdef DISABLE_SPACE_CADET_MODIFIER - unregister_mods(MOD_BIT(KC_RSFT)); - #else - if( RSPC_MOD != KC_RSFT ){ - unregister_mods(MOD_BIT(KC_RSFT)); - register_mods(MOD_BIT(RSPC_MOD)); - } - #endif - register_code(RSPC_KEY); - unregister_code(RSPC_KEY); - #ifndef DISABLE_SPACE_CADET_MODIFIER - if ( RSPC_MOD != KC_RSFT ){ - unregister_mods(MOD_BIT(RSPC_MOD)); - } - #endif - } - unregister_mods(MOD_BIT(KC_RSFT)); - } - return false; - } - - case KC_SFTENT: { - if (record->event.pressed) { - shift_interrupted[1] = false; - scs_timer[1] = timer_read (); - register_mods(MOD_BIT(KC_RSFT)); - } - else if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) { - unregister_mods(MOD_BIT(KC_RSFT)); - register_code(SFTENT_KEY); - unregister_code(SFTENT_KEY); - } - else { - unregister_mods(MOD_BIT(KC_RSFT)); - } - return false; - } case GRAVE_ESC: { uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) @@ -825,12 +714,6 @@ bool process_record_quantum(keyrecord_t *record) { return false; } #endif - - default: { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - break; - } } return process_action_kb(record); diff --git a/quantum/quantum.h b/quantum/quantum.h index 17cb902740d..208268df658 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -131,6 +131,10 @@ extern uint32_t default_layer_state; #include "process_terminal_nop.h" #endif +#ifdef SPACE_CADET_ENABLE + #include "process_space_cadet.h" +#endif + #ifdef HD44780_ENABLE #include "hd44780.h" #endif diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index fe2e3510d63..19bd7c21658 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -475,6 +475,18 @@ enum quantum_keycodes { HPT_DWLI, HPT_DWLD, + // Left control, open paren + KC_LCPO, + + // Right control, close paren + KC_RCPC, + + // Left control, open paren + KC_LAPO, + + // Right control, close paren + KC_RAPC, + // always leave at the end SAFE_RANGE }; From 4c2453aa1b71d269f67a25c89848965f9a6d2925 Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Tue, 30 Apr 2019 06:35:34 +0200 Subject: [PATCH 055/129] [Keyboard] Signum3.0 remove sortedcontainers (#5679) * Remove dependency on sortedcontainers * Sort dictionary on output --- keyboards/signum/3_0/elitec/keymaps/default/generate_km.py | 3 +-- keyboards/signum/3_0/elitec/keymaps/default/layout.py | 6 ++---- keyboards/signum/3_0/elitec/keymaps/default/readme.md | 4 ---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py index 7778da8f554..05996d06cab 100755 --- a/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py +++ b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -from sortedcontainers import SortedDict import layout import re @@ -11,7 +10,7 @@ import re def gen_uc_iter(): length = len(layout.uc_dict) - for key, value in layout.uc_dict.items(): + for key, value in sorted(layout.uc_dict.items()): length -= 1 if length: yield (key, value, False) diff --git a/keyboards/signum/3_0/elitec/keymaps/default/layout.py b/keyboards/signum/3_0/elitec/keymaps/default/layout.py index bc744593b6d..5a796c86237 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/layout.py +++ b/keyboards/signum/3_0/elitec/keymaps/default/layout.py @@ -1,11 +1,9 @@ -from sortedcontainers import SortedDict - # Add all used Unicode symbols to this list. # The key (e.g. "SNEK") is used in keymap.c for "enum", "unicode_map" and "keymaps", so it needs to be a valid C variable name. # The key is also used in this file to define the layout, so use recognizeable names. # The value (e.g. "0x1f40d") is used in keymap.c for "unicode_map" and to automatically generate the "ASCII"-art comments. # When adding new Unicode names, use "0x1f40d" until you looked up the correct Unicode code point. -uc_dict = SortedDict({ +uc_dict = { "SNEK": "0x1f40d", ## Error ## qwertz "ACUTE": "0x00b4", @@ -329,7 +327,7 @@ uc_dict = SortedDict({ "NOT_PARA": "0x2226", "TIMES_OP": "0x2297", "NOT_DIV": "0x2224" -}) +} # Add all used Keycodes to this list. # The key (e.g. "a") is used in keymap.c to automatically generate the comments. The first 7 chars will show as a keycap legend. diff --git a/keyboards/signum/3_0/elitec/keymaps/default/readme.md b/keyboards/signum/3_0/elitec/keymaps/default/readme.md index efd43a9bf9e..54db18cd315 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/readme.md +++ b/keyboards/signum/3_0/elitec/keymaps/default/readme.md @@ -11,10 +11,6 @@ starting point to create your own layouts for the Signum 3.0 with # Customization -- Install `python3` and [Sorted Containers - Library](http://www.grantjenks.com/docs/sortedcontainers/), `pip - install sortedcontainers`. - - Customize `layout.py` to your liking. - Attention 1: keycodes are either translated into symbols and function calls via the `translate()` function in `generate_km.py` From 483ad4e3e041084977bc128622aa49c637524b77 Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Tue, 30 Apr 2019 07:06:24 +0200 Subject: [PATCH 056/129] [Keyboard] Signum 3.0 Fix key order in layout (#5687) * Fix key order in layout * Reduce keyboard dimensions * Reduce space around keys --- keyboards/signum/3_0/elitec/info.json | 110 ++++++++++++-------------- 1 file changed, 50 insertions(+), 60 deletions(-) diff --git a/keyboards/signum/3_0/elitec/info.json b/keyboards/signum/3_0/elitec/info.json index e414d15967b..53b88d55347 100644 --- a/keyboards/signum/3_0/elitec/info.json +++ b/keyboards/signum/3_0/elitec/info.json @@ -2,74 +2,64 @@ "keyboard_name": "Signum 3.0", "url": "http://troyfletcher.net/", "maintainer": "jceb", - "width": 17, - "height": 8, + "width": 15, + "height": 6, "layouts": { "LAYOUT_ortho_4x12": { "key_count": 48, "layout": [ - { "x": 1.25, "y": 0.75, "r": 15 }, - { "x": 1.25, "y": 1.75, "r": 15 }, - { "x": 1.25, "y": 2.75, "r": 15 }, - { "x": 1.25, "y": 4.25, "r": 15 }, + { "x": 0, "y": 0.5, "r": 15 }, + { "x": 1, "y": 0.5, "r": 15 }, + { "x": 2, "y": 0.25, "r": 15 }, + { "x": 3, "y": 0, "r": 15 }, + { "x": 4, "y": 0.25, "r": 15 }, + { "x": 5, "y": 0.5, "r": 15 }, + { "x": 9, "y": 0.5, "r": -15 }, + { "x": 10, "y": 0.25, "r": -15 }, + { "x": 11, "y": 0, "r": -15 }, + { "x": 12, "y": 0.25, "r": -15 }, + { "x": 13, "y": 0.5, "r": -15 }, + { "x": 14, "y": 0.5, "r": -15 }, - { "x": 2.25, "y": 0.75, "r": 15 }, - { "x": 2.25, "y": 1.75, "r": 15 }, - { "x": 2.25, "y": 2.75, "r": 15 }, - { "x": 2.25, "y": 3.75, "r": 15 }, + { "x": 0, "y": 1.5, "r": 15 }, + { "x": 1, "y": 1.5, "r": 15 }, + { "x": 2, "y": 1.25, "r": 15 }, + { "x": 3, "y": 1, "r": 15 }, + { "x": 4, "y": 1.25, "r": 15 }, + { "x": 5, "y": 1.5, "r": 15 }, + { "x": 9, "y": 1.5, "r": -15 }, + { "x": 10, "y": 1.25, "r": -15 }, + { "x": 11, "y": 1, "r": -15 }, + { "x": 12, "y": 1.25, "r": -15 }, + { "x": 13, "y": 1.5, "r": -15 }, + { "x": 14, "y": 1.5, "r": -15 }, - { "x": 3.25, "y": 0.5, "r": 15 }, - { "x": 3.25, "y": 1.5, "r": 15 }, - { "x": 3.25, "y": 2.5, "r": 15 }, - { "x": 3.25, "y": 3.5, "r": 15 }, + { "x": 0, "y": 2.5, "r": 15 }, + { "x": 1, "y": 2.5, "r": 15 }, + { "x": 2, "y": 2.25, "r": 15 }, + { "x": 3, "y": 2, "r": 15 }, + { "x": 4, "y": 2.25, "r": 15 }, + { "x": 5, "y": 2.5, "r": 15 }, + { "x": 9, "y": 2.5, "r": -15 }, + { "x": 10, "y": 2.25, "r": -15 }, + { "x": 11, "y": 2, "r": -15 }, + { "x": 12, "y": 2.25, "r": -15 }, + { "x": 13, "y": 2.5, "r": -15 }, + { "x": 14, "y": 2.5, "r": -15 }, - { "x": 4.25, "y": 0.25, "r": 15 }, - { "x": 4.25, "y": 1.25, "r": 15 }, - { "x": 4.25, "y": 2.25, "r": 15 }, - - { "x": 5.25, "y": 0.5, "r": 15 }, - { "x": 5.25, "y": 1.5, "r": 15 }, - { "x": 5.25, "y": 2.5, "r": 15 }, - { "x": 5.25, "y": 4.5, "r": 15, "h": 1.5 }, - - { "x": 6.25, "y": 0.75, "r": 15 }, - { "x": 6.25, "y": 1.75, "r": 15 }, - { "x": 6.25, "y": 2.75, "r": 15 }, - { "x": 6.25, "y": 4.25, "r": 15, "h": 2 }, - - { "x": 7.25, "y": 4.5, "r": 15, "h": 1.5 }, - - { "x": 8.25, "y": 4.5, "r": -15, "h": 1.5 }, - - { "x": 9.25, "y": 0.75, "r": -15 }, - { "x": 9.25, "y": 1.75, "r": -15 }, - { "x": 9.25, "y": 2.75, "r": -15 }, - { "x": 9.25, "y": 4.25, "r": -15, "h": 2 }, - - { "x": 10.25, "y": 0.5, "r": -15 }, - { "x": 10.25, "y": 1.5, "r": -15 }, - { "x": 10.25, "y": 2.5, "r": -15 }, - { "x": 10.25, "y": 4.5, "r": -15, "h": 1.5 }, - - { "x": 11.25, "y": 0.25, "r": -15 }, - { "x": 11.25, "y": 1.25, "r": -15 }, - { "x": 11.25, "y": 2.25, "r": -15 }, - - { "x": 12.25, "y": 0.5, "r": -15 }, - { "x": 12.25, "y": 1.5, "r": -15 }, - { "x": 12.25, "y": 2.5, "r": -15 }, - { "x": 12.25, "y": 3.5, "r": -15 }, - - { "x": 13.25, "y": 0.75, "r": -15 }, - { "x": 13.25, "y": 1.75, "r": -15 }, - { "x": 13.25, "y": 2.75, "r": -15 }, - { "x": 13.25, "y": 3.75, "r": -15 }, - - { "x": 14.25, "y": 0.75, "r": -15 }, - { "x": 14.25, "y": 1.75, "r": -15 }, - { "x": 14.25, "y": 2.75, "r": -15 }, - { "x": 14.25, "y": 4.25, "r": -15 } + { "x": 0, "y": 4, "r": 15 }, + { "x": 1, "y": 3.5, "r": 15 }, + { "x": 2, "y": 3.25, "r": 15 }, + { "x": 4, "y": 4.25, "r": 15, "h": 1.5 }, + { "x": 5, "y": 4, "r": 15, "h": 2 }, + { "x": 6, "y": 4.25, "r": 15, "h": 1.5 }, + { "x": 8, "y": 4.25, "r": -15, "h": 1.5 }, + { "x": 9, "y": 4, "r": -15, "h": 2 }, + { "x": 10, "y": 4.25, "r": -15, "h": 1.5 }, + { "x": 12, "y": 3.25, "r": -15 }, + { "x": 13, "y": 3.5, "r": -15 }, + { "x": 14, "y": 4, "r": -15 } ] } From bb208f3e3b69fb154f4f78d7538ffa28482f232f Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 30 Apr 2019 09:55:53 -0500 Subject: [PATCH 057/129] Implement kb function for rgb matrix to led lookup (#5738) --- keyboards/sol/sol.c | 19 +++++++++++++++++++ quantum/rgb_matrix.c | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/keyboards/sol/sol.c b/keyboards/sol/sol.c index 5945cc60a4f..a65d4c15fc7 100644 --- a/keyboards/sol/sol.c +++ b/keyboards/sol/sol.c @@ -1 +1,20 @@ #include "sol.h" + +#if defined(RGB_MATRIX_ENABLE) +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + if (row == 4 && column == 5) { + led_i[0] = 33; + return 1; + } else if (row == 4 && column == 6) { + led_i[0] = 34; + return 1; + } else if (row == 10 && column == 5) { + led_i[0] = 68; + return 1; + } else if (row == 10 && column == 6) { + led_i[0] = 69; + return 1; + } + return 0; +} +#endif diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 8c16c7790ea..5528a083473 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -144,9 +144,14 @@ void eeconfig_debug_rgb_matrix(void) { dprintf("rgb_matrix_config.speed = %d\n", rgb_matrix_config.speed); } +__attribute__ ((weak)) +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + return 0; +} + uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { // TODO: This is kinda expensive, fix this soonish - uint8_t led_count = 0; + uint8_t led_count = rgb_matrix_map_row_column_to_led_kb(row, column, led_i); for (uint8_t i = 0; i < DRIVER_LED_TOTAL && led_count < LED_HITS_TO_REMEMBER; i++) { matrix_co_t matrix_co = g_rgb_leds[i].matrix_co; if (row == matrix_co.row && column == matrix_co.col) { From b09dc19d3209a0e08f3d534b14d75d144b698558 Mon Sep 17 00:00:00 2001 From: motform <30436214+motform@users.noreply.github.com> Date: Tue, 30 Apr 2019 17:25:31 +0200 Subject: [PATCH 058/129] [Keymap] Add motform planck keymap (swedish colemak) (#5734) * [Keymap] Add motform planck keymap (swedish colemak) * Add readme and remove unused enums (thanks @drasha!) --- keyboards/planck/keymaps/motform/config.h | 39 ++++ keyboards/planck/keymaps/motform/keymap.c | 211 +++++++++++++++++++++ keyboards/planck/keymaps/motform/readme.md | 11 ++ keyboards/planck/keymaps/motform/rules.mk | 1 + 4 files changed, 262 insertions(+) create mode 100644 keyboards/planck/keymaps/motform/config.h create mode 100644 keyboards/planck/keymaps/motform/keymap.c create mode 100644 keyboards/planck/keymaps/motform/readme.md create mode 100644 keyboards/planck/keymaps/motform/rules.mk diff --git a/keyboards/planck/keymaps/motform/config.h b/keyboards/planck/keymaps/motform/config.h new file mode 100644 index 00000000000..6fa31cc8a76 --- /dev/null +++ b/keyboards/planck/keymaps/motform/config.h @@ -0,0 +1,39 @@ +#pragma once + +#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 + +/* + * 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 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/motform/keymap.c b/keyboards/planck/keymaps/motform/keymap.c new file mode 100644 index 00000000000..15f0e05fb60 --- /dev/null +++ b/keyboards/planck/keymaps/motform/keymap.c @@ -0,0 +1,211 @@ +/* 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 QMK_KEYBOARD_H +#include "muse.h" +#include "keymap_swedish.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +/* These definitions can be removed once keymap_swe is properly vetted against MacOS */ +#define NO_DLR_MAC_V ALGR(LALT(KC_4)) +#define NO_AT_MAC_V ALGR(LALT(KC_2)) + +/* Esc when pressed, ctrl when used as a modifier */ +#define KC_ECTL MT(MOD_LCTL, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak_se + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | Ö | Å | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ECTR | A | R | S | T | D | H | N | E | I | O | Ä | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | SCSHE| Z | X | C | V | B | K | M | , | . | - |SCSHE | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | esc | CTRL | Alt | CMD |Lower |Space |Bksp |Raise | CMD | RALT | HYPER| MEH | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid +( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, NO_OSLH, NO_AA, + KC_ECTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, NO_AE, + KC_SFTENT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_SFTENT, + KC_ESC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_RGUI, KC_RALT, KC_HYPR, KC_MEH + ), + +/* Lower +* ,-----------------------------------------------------------------------------------. +* | | PIPE | ' | @ | & | | DOWN | | RIGHT| ` | ´ | ~ | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | | ! | " | # | ? | % | LEFT | / | \ | = | + | * | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | [ | { | | UP | } | ] | | | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | DEL | | Next | Vol- | Vol+ | Play | +* `-----------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_planck_grid +( + _______, NO_PIPE_MAC, NO_APOS, NO_AT_MAC_V, NO_AMPR, _______, KC_DOWN, KC_NO, KC_RGHT, NO_GRV, NO_GRV, NO_TILD, + _______, KC_EXLM, NO_QUO2, KC_HASH, NO_QUES, KC_PERC, KC_LEFT, NO_SLSH, NO_BSLS_MAC, NO_EQL, KC_PPLS, KC_PAST, + _______, KC_NO, KC_NO, NO_LBRC, NO_LCBR_MAC, KC_NO, KC_UP, NO_RCBR_MAC, NO_RBRC, KC_NO, KC_NO, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Raise +* ,-----------------------------------------------------------------------------------. +* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | $ | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | < | ( | | | ) | > |Pg Up |Pg Dn | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | | Next | Vol- | Vol+ | Play | +* `-----------------------------------------------------------------------------------' +*/ +[_RAISE] = LAYOUT_planck_grid +( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + NO_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_DLR_MAC_V, + _______, KC_NO, KC_NO, NO_LESS_MAC, NO_LPRN, KC_NO, KC_NO, NO_RPRN, NO_GRTR_MAC, KC_PGUP, KC_PGDN, KC_NO, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug| | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TRMon |TRMoff| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid +( + _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/motform/readme.md b/keyboards/planck/keymaps/motform/readme.md new file mode 100644 index 00000000000..47091c0aa8a --- /dev/null +++ b/keyboards/planck/keymaps/motform/readme.md @@ -0,0 +1,11 @@ +# Motform Planck Layout + +This layout is based off the [colemak-se](github.com/motform/colemak-se) +layout and features many tweaks to make working with Emacs and +evil-mode more ergonomi. As with the colemak layout itself, the idea +is to concentrate as much movement as possible to the home row. + +To properly use the layout in Emacs, set Super to LGUI and Meta to RGUI. +Unless you are running a permutation of the MacOS Swedish QWERTY-layout, +modifiers will probably not work. For future develoment, I’m planning +to add support for MS Windows SE-QWERTY in the form of a secondary layer. diff --git a/keyboards/planck/keymaps/motform/rules.mk b/keyboards/planck/keymaps/motform/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/motform/rules.mk @@ -0,0 +1 @@ +SRC += muse.c From 0cde8807476d0a7e855124b3145e6dfa1a55de12 Mon Sep 17 00:00:00 2001 From: Jeremy Bernhardt Date: Tue, 30 Apr 2019 09:28:01 -0600 Subject: [PATCH 059/129] =?UTF-8?q?=F0=9F=90=AE=F0=9F=A5=9B=20Butterstick?= =?UTF-8?q?=20Support=20=F0=9F=A5=9B=F0=9F=90=AE=20(#5742)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Working on chording * Working on chording * Got layouts in order * Initial Georgi support * forgot to add keymaps * Updated readme * Update keyboards/georgi/keymaps/template/readme.md Co-Authored-By: germ * Update keyboards/georgi/georgi.h Co-Authored-By: germ * Update keyboards/georgi/keymaps/default/keymap.c Co-Authored-By: germ * Update keyboards/georgi/keymaps/default/keymap.c Co-Authored-By: germ * Update keyboards/georgi/rules.mk Co-Authored-By: germ * Update keyboards/georgi/rules.mk Co-Authored-By: germ * Update keyboards/georgi/matrix.c Co-Authored-By: germ * Update keyboards/georgi/georgi.c Co-Authored-By: germ * Update keyboards/georgi/georgi.c Co-Authored-By: germ * Update keyboards/georgi/rules.mk Co-Authored-By: germ * Update keyboards/georgi/keymaps/default/keymap.c Co-Authored-By: germ * Update keyboards/georgi/keymaps/template/keymap.c Co-Authored-By: germ * Update keyboards/georgi/matrix.c Co-Authored-By: germ * Disabled features, updated info * Update keyboards/georgi/config.h Co-Authored-By: germ * Update keyboards/georgi/config.h Co-Authored-By: germ * Fixed info.json * Split the number button and fixed gaming mode. * started work on history feature * Working history/multikeyfuckery * type * inital code reduction refactor * Got multikey patched up, optimizing for size * Forgot to remove stuff * fixed key repeat * Key repeat added. * Symshift locking * Midchord Sym shenanigans. * Added only QWERTY mode * Split out header * Added stickybits, minimal layour * Fixing user layout * Whitespace fixing * Fixing Version name * Starting work on BS * Fixing default layout and rules * Updated Butter fw * Copy-paste rebase * more fixing from merge. Fuck * Forgot to roll version * Added revisions as per @mechmerlin --- keyboards/butterstick/butterstick.c | 56 +++ keyboards/butterstick/butterstick.h | 11 + keyboards/butterstick/config.h | 26 ++ .../butterstick/keymaps/default/keymap.c | 183 +++++++++ .../butterstick/keymaps/default/rules.mk | 0 keyboards/butterstick/readme.md | 14 + keyboards/butterstick/rules.mk | 19 + keyboards/butterstick/sten.c | 367 ++++++++++++++++++ keyboards/butterstick/sten.h | 77 ++++ 9 files changed, 753 insertions(+) create mode 100644 keyboards/butterstick/butterstick.c create mode 100644 keyboards/butterstick/butterstick.h create mode 100644 keyboards/butterstick/config.h create mode 100644 keyboards/butterstick/keymaps/default/keymap.c create mode 100644 keyboards/butterstick/keymaps/default/rules.mk create mode 100644 keyboards/butterstick/readme.md create mode 100644 keyboards/butterstick/rules.mk create mode 100644 keyboards/butterstick/sten.c create mode 100644 keyboards/butterstick/sten.h diff --git a/keyboards/butterstick/butterstick.c b/keyboards/butterstick/butterstick.c new file mode 100644 index 00000000000..6c00bbe5dfd --- /dev/null +++ b/keyboards/butterstick/butterstick.c @@ -0,0 +1,56 @@ +/* Copyright 2019 Jeremy Bernhardt + * + * 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 "butterstick.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +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) { +#ifdef DEBUG_MATRIX + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) + if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); +#endif + + 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/butterstick/butterstick.h b/keyboards/butterstick/butterstick.h new file mode 100644 index 00000000000..f97488c3f58 --- /dev/null +++ b/keyboards/butterstick/butterstick.h @@ -0,0 +1,11 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_butter( \ + k09, k08, k07, k06, k05, k04, k03, k02, k01, k00, \ + k19, k18, k17, k16, k15, k14, k13, k12, k11, k10 \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09}, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19}, \ +} diff --git a/keyboards/butterstick/config.h b/keyboards/butterstick/config.h new file mode 100644 index 00000000000..4c104deb220 --- /dev/null +++ b/keyboards/butterstick/config.h @@ -0,0 +1,26 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER g Heavy Industries +#define PRODUCT Butter Stick +#define DESCRIPTION Its a stick of butter +#define VERSION "Paula Deen" + +#define DEBOUNCING_DELAY 5 +#define FORCE_NKRO + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 10 +#define MATRIX_ROW_PINS { F4, F5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7, C6, C7} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + diff --git a/keyboards/butterstick/keymaps/default/keymap.c b/keyboards/butterstick/keymaps/default/keymap.c new file mode 100644 index 00000000000..faabbef793b --- /dev/null +++ b/keyboards/butterstick/keymaps/default/keymap.c @@ -0,0 +1,183 @@ +#include QMK_KEYBOARD_H + +#include "sten.h" +/* + * Key names are inherited from steno machines + * .-----------------------------------------------------. + * | LSU | LFT | LP | LH | ST1 | RF | RP | RL | RT | RD | + * |-----------------------------------------------------| + * | LSD | LK | LW | LR | ST2 | RR | RB | RG | RS | RZ | + * '-----------------------------------------------------' + */ + +// Function prefixes +#define MEDIA (LSD | LK | LW | LR) +#define FUNCT (LSD | LK | LP | LH) +#define MOVE (LSU | LFT | LP | LH) +#define SYMB (RD | RZ) +#define NUMA (LW | LR) +#define NUMB (RR | RB) + +// QMK Layer Numbers + #define BASE 0 + #define GAME 1 + +// Do not change QMK Layer 0! This is your main keyboard. +// Make your QMK modifications to the later layers, to add +// keys/customize on the first layer modify processQwerty(): +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_butter( + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR + ), + // I don't game don't roast me thanks + [GAME] = LAYOUT_butter( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_ENT, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(BASE) + ) +}; + +// Note: You can only use basic keycodes here! +// P() is just a wrapper to make your life easier, any C code can be executed. +// Only the longest matched chord is run! +// +// http://docs.gboards.ca +uint32_t processQwerty(bool lookup) { + // SECRET AGENT CHORDS + P( LSU | LK | RS | RD, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( LSD | RZ, SEND(KC_SPC)); + + // Dual chords + P( LP | LH, CLICK_MOUSE(KC_MS_BTN2)); + P( ST1 | RF, CLICK_MOUSE(KC_MS_BTN1)); + P( LSU | LFT, SEND(KC_ESC)); + P( LSD | LK, SEND(KC_LSFT)); + P( RZ | RS, SEND(KC_LSFT)); + P( ST2 | RR, SEND(KC_SPC)); + P( RP | RL, SEND(KC_LGUI)); + P( RT | RD, SEND(KC_LCTL)); + P( RL | RT, SEND(KC_LALT)); + P( LSU | LSD | LFT | LK, SEND(KC_LCTL)); + P( RS | RT | RD | RZ, SEND(KC_ENT)); + + // Function Layer + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RB, SEND(KC_F10)); + P( FUNCT | RG, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + P( MOVE | ST1, SEND(KC_PGUP)); + P( MOVE | ST2, SEND(KC_PGDN)); + + // Media Layer + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RG, SEND(KC_VOLU)); + P( MEDIA | RB, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + + // Number Row, Right + P( NUMB | LSU, SEND(KC_1)); + P( NUMB | LFT, SEND(KC_2)); + P( NUMB | LP, SEND(KC_3)); + P( NUMB | LH, SEND(KC_4)); + P( NUMB | ST1, SEND(KC_5)); + P( NUMB | RF, SEND(KC_6)); + P( NUMB | RP, SEND(KC_7)); + P( NUMB | RL, SEND(KC_8)); + P( NUMB | RT, SEND(KC_9)); + P( NUMB | RD, SEND(KC_0)); + + // Number Row, Left + P( NUMA | LSU, SEND(KC_1)); + P( NUMA | LFT, SEND(KC_2)); + P( NUMA | LP, SEND(KC_3)); + P( NUMA | LH, SEND(KC_4)); + P( NUMA | ST1, SEND(KC_5)); + P( NUMA | RF, SEND(KC_6)); + P( NUMA | RP, SEND(KC_7)); + P( NUMA | RL, SEND(KC_8)); + P( NUMA | RT, SEND(KC_9)); + P( NUMA | RD, SEND(KC_0)); + + + // Symbols and Numbers + P( SYMB | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( SYMB | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( SYMB | ST1 | ST2, SEND(KC_GRV)); // ` + P( SYMB | RR | RF, SEND(KC_LSFT); SEND(KC_3)); // # + P( SYMB | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( SYMB | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( SYMB | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( SYMB | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( SYMB | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( SYMB | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( SYMB | LW, SEND(KC_LBRC)); + P( SYMB | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( SYMB | LR, SEND(KC_RBRC)); + P( SYMB | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( SYMB | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( SYMB | RP | RB, SEND(KC_QUOT)); + P( SYMB | RP | RG, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( SYMB | RF, SEND(KC_KP_PLUS)); + P( SYMB | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( SYMB | RP, SEND(KC_MINS)); + P( SYMB | RB, SEND(KC_EQL)); + P( SYMB | RL, SEND(KC_SLSH)); + P( SYMB | RG, SEND(KC_COMM)); + P( SYMB | RT, SEND(KC_PAST)); + P( SYMB | RS, SEND(KC_DOT)); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_D)); + P( LH | LR, SEND(KC_F)); + P( ST1 | ST2, SEND(KC_G)); + P( RF | RR, SEND(KC_H)); + P( RT | RS, SEND(KC_L)); + P( RD | RZ, SEND(KC_SCLN)); + P( RG | RL, SEND(KC_K)); + P( RP | RB, SEND(KC_J)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_E)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_R)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_T)); + P( ST2, SEND(KC_B)); + P( RF, SEND(KC_Y)); + P( RR, SEND(KC_N)); + P( RP, SEND(KC_U)); + P( RB, SEND(KC_M)); + P( RL, SEND(KC_I)); + P( RG, SEND(KC_COMM)); + P( RT, SEND(KC_O)); + P( RS, SEND(KC_DOT)); + P( RD, SEND(KC_P)); + P( RZ, SEND(KC_SLSH)); + + return 0; +} + + +// Don't fuck with this, thanks. +size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); diff --git a/keyboards/butterstick/keymaps/default/rules.mk b/keyboards/butterstick/keymaps/default/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/butterstick/readme.md b/keyboards/butterstick/readme.md new file mode 100644 index 00000000000..8bae8ba5a05 --- /dev/null +++ b/keyboards/butterstick/readme.md @@ -0,0 +1,14 @@ +# Butter Stick + +![Butter Stick](https://i.redd.it/mvteaomko7s21.jpg) + +A chorded 20% keyboard packing full sized useage into your pocket. More info on [gboards.ca](http://docs.gboards.ca/Meet-Butter-Stick)! + +Keyboard Maintainer: [Germ](https://github.com/germ) +Hardware Availability: [g Heavy Industries](https://www.gboards.ca/product/butter-stick-limited-edition) + +Make example for this keyboard (after setting up your build environment): + + make butterstick:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/butterstick/rules.mk b/keyboards/butterstick/rules.mk new file mode 100644 index 00000000000..68b117bf590 --- /dev/null +++ b/keyboards/butterstick/rules.mk @@ -0,0 +1,19 @@ +# MCU name +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) + +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -DONLYQWERTY -DDEBUG_MATRIX +SRC += sten.c +EXTRAFLAGS += -flto + + +BOOTLOADER = atmel-dfu +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +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 = yes # USB Nkey Rollover +STENO_ENABLE = yes # Needed for chording + diff --git a/keyboards/butterstick/sten.c b/keyboards/butterstick/sten.c new file mode 100644 index 00000000000..a239e388421 --- /dev/null +++ b/keyboards/butterstick/sten.c @@ -0,0 +1,367 @@ +#include "sten.h" + +// Chord state +uint32_t cChord = 0; // Current Chord +int chordIndex = 0; // Keys in previousachord +int32_t chordState[32]; // Full Chord history +#define QWERBUF 24 // Size of chords to buffer for output + +bool repeatFlag = false; // Should we repeat? +uint32_t pChord = 0; // Previous Chord +int pChordIndex = 0; // Keys in previousachord +uint32_t pChordState[32]; // Previous chord sate +uint32_t stickyBits = 0; // Or'd with every incoming press + +// Mode state +enum MODE { STENO = 0, QWERTY, COMMAND }; +enum MODE pMode; +bool QWERSTENO = false; +#ifdef ONLYQWERTY +enum MODE cMode = QWERTY; +#else +enum MODE cMode = STENO; +#endif + +// Command State +#define MAX_CMD_BUF 20 +uint8_t CMDLEN = 0; +uint8_t CMDBUF[MAX_CMD_BUF]; + +// Key Repeat state +bool inChord = false; +bool repEngaged = false; +uint16_t repTimer = 0; +#define REP_INIT_DELAY 750 +#define REP_DELAY 25 + +// Mousekeys state +bool inMouse = false; +int8_t mousePress; + +// All processing done at chordUp goes through here +// Note, this is a gutted version of the Georgi sten.h +bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { + // Check for mousekeys, this is release +#ifdef MOUSEKEY_ENABLE + if (inMouse) { + inMouse = false; + mousekey_off(mousePress); + mousekey_send(); + } +#endif + + // handle command mode + if (cChord == (LSU | LSD | RD | RZ)) { + if (cMode != COMMAND) { // Entering Command Mode + CMDLEN = 0; + pMode = cMode; + cMode = COMMAND; + } else { // Exiting Command Mode + cMode = pMode; + + // Press all and release all + for (int i = 0; i < CMDLEN; i++) { + register_code(CMDBUF[i]); + } + clear_keyboard(); + } + + goto out; + } + + // Handle Gaming Toggle, + if (cChord == (LSU | LSD | LFT | LK | RT | RS | RD | RZ) && keymapsCount > 1) { +#ifndef NO_DEBUG + uprintf("Switching to QMK\n"); +#endif + layer_on(1); + goto out; + } + + // Do QWERTY and Momentary QWERTY + if (cMode == QWERTY || (cMode == COMMAND)) { + processChord(false); + goto out; + } + +out: + cChord = 0; + inChord = false; + chordIndex = 0; + clear_keyboard(); + repEngaged = false; + for (int i = 0; i < 32; i++) + chordState[i] = 0xFFFF; + + return false; +} + +// Update Chord State +bool process_steno_user(uint16_t keycode, keyrecord_t *record) { + // Everything happens in here when steno keys come in. + // Bail on keyup + if (!record->event.pressed) return true; + + // Update key repeat timers + repTimer = timer_read(); + inChord = true; + + // Switch on the press adding to chord + bool pr = record->event.pressed; + switch (keycode) { + // Mods and stuff + case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break; + case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break; + case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break; + case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break; + case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break; + case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break; + case STN_N1...STN_N6: pr ? (cChord |= (LNO)): (cChord &= ~(LNO)); break; + case STN_N7...STN_NC: pr ? (cChord |= (RNO)): (cChord &= ~(RNO)); break; + + // All the letter keys + case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break; + case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break; + case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break; + case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break; + case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break; + case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break; + case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break; + case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break; + case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break; + case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break; + case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break; + case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break; + case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break; + case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break; + case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break; + case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break; + case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break; + case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break; + case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break; + case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break; + case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break; + case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break; + } + + // Store previous state for fastQWER + if (pr) { + chordState[chordIndex] = cChord; + chordIndex++; + } + + return true; +} +void matrix_scan_user(void) { + // We abuse this for early sending of key + // Key repeat only on QWER/SYMB layers + if (cMode != QWERTY || !inChord) return; + + // Check timers +#ifndef NO_REPEAT + if (repEngaged && timer_elapsed(repTimer) > REP_DELAY) { + // Process Key for report + processChord(false); + + // Send report to host + send_keyboard_report(); + clear_keyboard(); + repTimer = timer_read(); + } + + if (!repEngaged && timer_elapsed(repTimer) > REP_INIT_DELAY) { + repEngaged = true; + } +#endif +}; + +// For Plover NKRO +uint32_t processFakeSteno(bool lookup) { + P( LSU, SEND(KC_Q);); + P( LSD, SEND(KC_A);); + P( LFT, SEND(KC_W);); + P( LP, SEND(KC_E);); + P( LH, SEND(KC_R);); + P( LK, SEND(KC_S);); + P( LW, SEND(KC_D);); + P( LR, SEND(KC_F);); + P( ST1, SEND(KC_T);); + P( ST2, SEND(KC_G);); + P( LA, SEND(KC_C);); + P( LO, SEND(KC_V);); + P( RE, SEND(KC_N);); + P( RU, SEND(KC_M);); + P( ST3, SEND(KC_Y);); + P( ST4, SEND(KC_H);); + P( RF, SEND(KC_U);); + P( RP, SEND(KC_I);); + P( RL, SEND(KC_O);); + P( RT, SEND(KC_P);); + P( RD, SEND(KC_LBRC);); + P( RR, SEND(KC_J);); + P( RB, SEND(KC_K);); + P( RG, SEND(KC_L);); + P( RS, SEND(KC_SCLN);); + P( RZ, SEND(KC_COMM);); + P( LNO, SEND(KC_1);); + P( RNO, SEND(KC_1);); + + return 0; +} + +// Traverse the chord history to a given point +// Returns the mask to use +void processChord(bool useFakeSteno) { + // Save the clean chord state + uint32_t savedChord = cChord; + + // Apply Stick Bits if needed + if (stickyBits != 0) { + cChord |= stickyBits; + for (int i = 0; i <= chordIndex; i++) + chordState[i] |= stickyBits; + } + + // Strip FN + if (cChord & FN) cChord ^= FN; + + // First we test if a whole chord was passsed + // If so we just run it handling repeat logic + if (useFakeSteno && processFakeSteno(true) == cChord) { + processFakeSteno(false); + return; + } else if (processQwerty(true) == cChord) { + processQwerty(false); + // Repeat logic + if (repeatFlag) { + restoreState(); + repeatFlag = false; + processChord(false); + } else { + saveState(cChord); + } + return; + } + + // Iterate through chord picking out the individual + // and longest chords + uint32_t bufChords[QWERBUF]; + int bufLen = 0; + uint32_t mask = 0; + + // We iterate over it multiple times to catch the longest + // chord. Then that gets addded to the mask and re run. + while (savedChord != mask) { + uint32_t test = 0; + uint32_t longestChord = 0; + + for (int i = 0; i <= chordIndex; i++) { + cChord = chordState[i] & ~mask; + if (cChord == 0) + continue; + + // Assume mid parse Sym is new chord + if (i != 0 && test != 0 && (cChord ^ test) == PWR) { + longestChord = test; + break; + } + + // Lock SYM layer in once detected + if (mask & PWR) + cChord |= PWR; + + + // Testing for keycodes + if (useFakeSteno) { + test = processFakeSteno(true); + } else { + test = processQwerty(true); + } + + if (test != 0) { + longestChord = test; + } + } + + mask |= longestChord; + bufChords[bufLen] = longestChord; + bufLen++; + + // That's a loop of sorts, halt processing + if (bufLen >= QWERBUF) { + return; + } + } + + // Now that the buffer is populated, we run it + for (int i = 0; i < bufLen ; i++) { + cChord = bufChords[i]; + if (useFakeSteno) { + processFakeSteno(false); + } else { + processQwerty(false); + } + } + + // Save state in case of repeat + if (!repeatFlag) { + saveState(savedChord); + } + + // Restore cChord for held repeat + cChord = savedChord; + + return; +} +void saveState(uint32_t cleanChord) { + pChord = cleanChord; + pChordIndex = chordIndex; + for (int i = 0; i < 32; i++) + pChordState[i] = chordState[i]; +} +void restoreState() { + cChord = pChord; + chordIndex = pChordIndex; + for (int i = 0; i < 32; i++) + chordState[i] = pChordState[i]; +} + +// Macros for calling from keymap.c +void SEND(uint8_t kc) { + // Send Keycode, Does not work for Quantum Codes + if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) { +#ifndef NO_DEBUG + uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF); +#endif + CMDBUF[CMDLEN] = kc; + CMDLEN++; + } + + if (cMode != COMMAND) register_code(kc); + return; +} +void REPEAT(void) { + if (cMode != QWERTY) + return; + + repeatFlag = true; + return; +} +void SET_STICKY(uint32_t stick) { + stickyBits = stick; + return; +} +void SWITCH_LAYER(int layer) { + if (keymapsCount >= layer) + layer_on(layer); +} +void CLICK_MOUSE(uint8_t kc) { +#ifdef MOUSEKEY_ENABLE + mousekey_on(kc); + mousekey_send(); + + // Store state for later use + inMouse = true; + mousePress = kc; +#endif +} diff --git a/keyboards/butterstick/sten.h b/keyboards/butterstick/sten.h new file mode 100644 index 00000000000..5a9771d9a02 --- /dev/null +++ b/keyboards/butterstick/sten.h @@ -0,0 +1,77 @@ +// 2019, g Heavy Industries +// Blessed mother of Christ, please keep this readable +// and protect us from segfaults. For thine is the clock, +// the slave and the master. Until we return from main. +// +// Amen. + +#include QMK_KEYBOARD_H +#include "mousekey.h" +#include "keymap.h" +#include "keymap_steno.h" +#include "wait.h" + +extern size_t keymapsCount; // Total keymaps +extern uint32_t cChord; // Current Chord + +// Function defs +void processChord(bool useFakeSteno); +uint32_t processQwerty(bool lookup); +uint32_t processFakeSteno(bool lookup); +void saveState(uint32_t cChord); +void restoreState(void); + +// Macros for use in keymap.c +void SEND(uint8_t kc); +void REPEAT(void); +void SET_STICKY(uint32_t); +void SWITCH_LAYER(int); +void CLICK_MOUSE(uint8_t); + +// Keymap helper +#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;} + +// Shift to internal representation +// i.e) S(teno)R(ight)F +#define STN(n) (1L< Date: Tue, 30 Apr 2019 09:18:11 -0700 Subject: [PATCH 060/129] Ignore VSCode ipsh folder (#5741) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b1f9277078a..7cd7fa8015e 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ util/Win_Check_Output.txt .vscode/tasks.json .vscode/last.sql .vscode/temp.sql +.vscode/ipch/ .stfolder .tags From 7c2a7ab817becfef88025b9bef80c4e212cc0913 Mon Sep 17 00:00:00 2001 From: Daniel Peregolise Date: Tue, 30 Apr 2019 15:11:57 -0400 Subject: [PATCH 061/129] [Keyboard] doro67 readme clarification (#5736) * readme clarification * Apply suggestions from code review verbiage updates Co-Authored-By: dperegolise * mechmerlin suggested verbiage --- keyboards/doro67/multi/keymaps/default/readme.md | 7 +++++++ keyboards/doro67/multi/keymaps/default_iso/readme.md | 7 +++++++ keyboards/doro67/multi/keymaps/default_multi/readme.md | 7 +++++++ keyboards/doro67/multi/readme.md | 7 +++++++ keyboards/doro67/regular/keymaps/default/readme.md | 4 ++++ keyboards/doro67/regular/readme.md | 4 ++++ keyboards/doro67/rgb/keymaps/default/readme.md | 6 ++++++ keyboards/doro67/rgb/readme.md | 6 ++++++ 8 files changed, 48 insertions(+) diff --git a/keyboards/doro67/multi/keymaps/default/readme.md b/keyboards/doro67/multi/keymaps/default/readme.md index 6e63cde3a16..9b9136b3441 100644 --- a/keyboards/doro67/multi/keymaps/default/readme.md +++ b/keyboards/doro67/multi/keymaps/default/readme.md @@ -1,5 +1,12 @@ # Default Doro67 ANSI layout. +**THIS IS THE DEFAULT ANSI KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + This is the default ANSI layout that comes flashed on the Doro67 multi PCB with the exception of adding backtick as it was not mapped. diff --git a/keyboards/doro67/multi/keymaps/default_iso/readme.md b/keyboards/doro67/multi/keymaps/default_iso/readme.md index d375f0cc5d2..4b3d2ba4ad4 100644 --- a/keyboards/doro67/multi/keymaps/default_iso/readme.md +++ b/keyboards/doro67/multi/keymaps/default_iso/readme.md @@ -1,5 +1,12 @@ # Default Doro67 ISO layout. +**THIS IS THE DEFAULT ISO KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + This is the default ISO layout that comes flashed on the Doro67 multi PCB with the exception of adding backtick and UK ISO specific keycodes as they were not mapped. diff --git a/keyboards/doro67/multi/keymaps/default_multi/readme.md b/keyboards/doro67/multi/keymaps/default_multi/readme.md index e32f820c289..5761c006bfb 100644 --- a/keyboards/doro67/multi/keymaps/default_multi/readme.md +++ b/keyboards/doro67/multi/keymaps/default_multi/readme.md @@ -1,5 +1,12 @@ # Default Doro67 Multi layout. +**THIS IS THE DEFAULT MULTI-LAYOUT (SPLIT BACKSPACE) KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + This is the default Multi layout that comes flashed on the Doro67 multi PCB with the exception of adding backtick as it was not mapped. diff --git a/keyboards/doro67/multi/readme.md b/keyboards/doro67/multi/readme.md index 40fd53ee11a..80465c3ac97 100644 --- a/keyboards/doro67/multi/readme.md +++ b/keyboards/doro67/multi/readme.md @@ -2,6 +2,13 @@ 65% custom keyboard made by 80ultraman/Alf/Backprop Studios with multiple layout support. Despite the layout options available, layout is dictated by the selected integrated plate. +**MULTI-LAYOUT PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + Keyboard Maintainer: [ShadeDream](https://github.com/shadedream) Hardware Supported: Doro67 Multi PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) diff --git a/keyboards/doro67/regular/keymaps/default/readme.md b/keyboards/doro67/regular/keymaps/default/readme.md index 7443a357f3c..0af057d7800 100644 --- a/keyboards/doro67/regular/keymaps/default/readme.md +++ b/keyboards/doro67/regular/keymaps/default/readme.md @@ -1 +1,5 @@ # The default keymap for doro67 + +**THIS IS THE DEFAULT KEYMAP DIRECTORY (AVAILABILITY: CHINA GB ONLY)** +If you are a non-china buyer, you probably have the multi PCB or rgb PCB. +Please look at the "multi" and "rgb" readme files. \ No newline at end of file diff --git a/keyboards/doro67/regular/readme.md b/keyboards/doro67/regular/readme.md index 7635a40f95e..e2ef7bc646b 100644 --- a/keyboards/doro67/regular/readme.md +++ b/keyboards/doro67/regular/readme.md @@ -4,6 +4,10 @@ This is not the PCB with RGB support. Do not flash RGB firmware for this board. +**REGULAR PCB (AVAILABILITY: CHINA GB ONLY)* +If you are a non-china buyer, you probably have the multi PCB or rgb PCB. +Please look at the "multi" and "rgb" readme files. + Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: Doro67 Regular PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) diff --git a/keyboards/doro67/rgb/keymaps/default/readme.md b/keyboards/doro67/rgb/keymaps/default/readme.md index 4ba5eb30fde..eb5c49419d8 100644 --- a/keyboards/doro67/rgb/keymaps/default/readme.md +++ b/keyboards/doro67/rgb/keymaps/default/readme.md @@ -1 +1,7 @@ # The default keymap for rgb + +**RGB PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "rgb" directory includes the keymap for the RGB PCB. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased a non-rgb PCB, please see the 'multi' directory. \ No newline at end of file diff --git a/keyboards/doro67/rgb/readme.md b/keyboards/doro67/rgb/readme.md index 3a527c933c5..61c82d0d146 100644 --- a/keyboards/doro67/rgb/readme.md +++ b/keyboards/doro67/rgb/readme.md @@ -4,6 +4,12 @@ Flashing the regular PCB firmware on this board will work, but will disable RGB lighting. +**THIS IS THE RGB PCB DIRECTORY (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "rgb" directory includes the keymap for the RGB PCB. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased a non-rgb PCB, please see the 'multi' directory. + Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: Doro 67 RGB PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) From d67b99ff3c2cfca63add546ad6d052e2487aa26a Mon Sep 17 00:00:00 2001 From: Ryan Caltabiano Date: Tue, 30 Apr 2019 19:54:22 -0500 Subject: [PATCH 062/129] Added OLED Driver to the summary --- docs/_summary.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_summary.md b/docs/_summary.md index d3108701920..043943f1d83 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -63,6 +63,7 @@ * [LED Matrix](feature_led_matrix.md) * [Macros](feature_macros.md) * [Mouse Keys](feature_mouse_keys.md) + * [OLED Driver](feature_oled_driver) * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) * [Pointing Device](feature_pointing_device.md) * [PS/2 Mouse](feature_ps2_mouse.md) From 8725197ad679647d2eb7876aee3f9df32edb5766 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Tue, 30 Apr 2019 19:29:51 -0700 Subject: [PATCH 063/129] [Keyboard] Adds support for BM16S keyboard (#5659) * Added support for BM16S keyboard. * Update keyboards/bm16s/bm16s.h Co-Authored-By: bontakun * Update keyboards/bm16s/bm16s.h Co-Authored-By: bontakun * Cleaned up a bunch of unneeded stuff. * Made layout name match. * Changed rules file to have correct bootloader and indention. Updated readme to reflect availability on krepublic. Updated keymap to have more obvious RGB controls. * Removed unnecessary file. * Fixed grammar in readme. Co-Authored-By: bontakun * Migrated to autogenerated layout config, without issue. * Renamed LAYOUT to match community standards. --- keyboards/bm16s/bm16s.h | 15 +++++ keyboards/bm16s/config.h | 46 +++++++++++++++ keyboards/bm16s/info.json | 30 ++++++++++ keyboards/bm16s/keymaps/default/keymap.c | 16 ++++++ keyboards/bm16s/keymaps/media/keymap.c | 20 +++++++ keyboards/bm16s/readme.md | 13 +++++ keyboards/bm16s/rules.mk | 72 ++++++++++++++++++++++++ 7 files changed, 212 insertions(+) create mode 100755 keyboards/bm16s/bm16s.h create mode 100755 keyboards/bm16s/config.h create mode 100644 keyboards/bm16s/info.json create mode 100755 keyboards/bm16s/keymaps/default/keymap.c create mode 100755 keyboards/bm16s/keymaps/media/keymap.c create mode 100644 keyboards/bm16s/readme.md create mode 100755 keyboards/bm16s/rules.mk diff --git a/keyboards/bm16s/bm16s.h b/keyboards/bm16s/bm16s.h new file mode 100755 index 00000000000..9aca8c0e373 --- /dev/null +++ b/keyboards/bm16s/bm16s.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} diff --git a/keyboards/bm16s/config.h b/keyboards/bm16s/config.h new file mode 100755 index 00000000000..568e80b3964 --- /dev/null +++ b/keyboards/bm16s/config.h @@ -0,0 +1,46 @@ +#pragma once +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KPrepublic +#define PRODUCT bm16s +#define DESCRIPTION KPrepublic bm16s + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D0, D3, D2 } +#define MATRIX_COL_PINS { F7, F6, D4, D6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#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 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN + #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/bm16s/info.json b/keyboards/bm16s/info.json new file mode 100644 index 00000000000..706453561e7 --- /dev/null +++ b/keyboards/bm16s/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "bm16s", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2}, + {"x":3, "y":2}, + {"x":0, "y":3}, + {"x":1, "y":3}, + {"x":2, "y":3}, + {"x":3, "y":3} + ] + } + } + } \ No newline at end of file diff --git a/keyboards/bm16s/keymaps/default/keymap.c b/keyboards/bm16s/keymaps/default/keymap.c new file mode 100755 index 00000000000..9dd697a0d97 --- /dev/null +++ b/keyboards/bm16s/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x4( + KC_KP_7, KC_KP_8, KC_KP_9, MO(1), \ + KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, \ + KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, \ + KC_KP_0, KC_PDOT, KC_PCMM, KC_PENT \ + ), + [1] = LAYOUT_ortho_4x4( + RESET, BL_STEP, _______, KC_VOLU, \ + BL_TOGG, BL_DEC, BL_INC, KC_VOLD, \ + RGB_TOG, RGB_MOD, RGB_HUI, KC_MUTE, \ + RGB_SAI, RGB_SAD, RGB_HUD, _______ \ + ), +}; \ No newline at end of file diff --git a/keyboards/bm16s/keymaps/media/keymap.c b/keyboards/bm16s/keymaps/media/keymap.c new file mode 100755 index 00000000000..082879320a2 --- /dev/null +++ b/keyboards/bm16s/keymaps/media/keymap.c @@ -0,0 +1,20 @@ +#include QMK_KEYBOARD_H + +#define RGB_BRU RGB_VAI +#define RGB_BRD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_ortho_4x4( + KC_BRIU, _______, _______, KC_VOLU, \ + KC_BRID, _______, _______, KC_VOLD, \ + _______, _______, _______, KC_MUTE, \ + KC_MPRV, KC_MPLY, KC_MNXT, MO(1) \ + ), + [1] = LAYOUT_ortho_4x4( + RESET, _______, _______, _______, \ + RGB_SPD, RGB_BRU, RGB_SPI, _______, \ + RGB_RMOD, RGB_BRD, RGB_MOD, _______, \ + RGB_TOG, _______, _______, _______ \ + ), +}; \ No newline at end of file diff --git a/keyboards/bm16s/readme.md b/keyboards/bm16s/readme.md new file mode 100644 index 00000000000..097a3800803 --- /dev/null +++ b/keyboards/bm16s/readme.md @@ -0,0 +1,13 @@ +# bm16s + +A 16-key macropad, with USB C and per-key RGB backlighting. This is a variant of the BM16A, but with low profile Choc switches. + +Keyboard Maintainer: QMK Community +Hardware Supported: The PCBs, controllers supported +Hardware Availability: [KPrepublic](https://kprepublic.com/collections/pcb/products/bm16s-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch-leds-choc-switch); [AliExpress](https://www.aliexpress.com/item/bm16s-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch/32999247908.html); [Massdrop](https://www.massdrop.com/buy/78169) + +Make example for this keyboard (after setting up your build environment): + + make bm16s:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/bm16s/rules.mk b/keyboards/bm16s/rules.mk new file mode 100755 index 00000000000..f4f1dfd639b --- /dev/null +++ b/keyboards/bm16s/rules.mk @@ -0,0 +1,72 @@ +# 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 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +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 = yes + +LAYOUTS = ortho_4x4 \ No newline at end of file From e95283b54512eda893b9d43a9f1b72bf8c03970b Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 30 Apr 2019 22:55:01 -0500 Subject: [PATCH 064/129] [Keymap] Xulkal keymap tweeks (#5746) * Minor keymap tweeks and more oled data * Update keymap.c --- keyboards/sol/keymaps/xulkal/keymap.c | 20 +++++++++++++++++--- users/xulkal/config.h | 14 ++++++++++++++ users/xulkal/process_records.c | 12 ++++++++++-- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/keyboards/sol/keymaps/xulkal/keymap.c b/keyboards/sol/keymaps/xulkal/keymap.c index be64d9e7c3a..4591034d21f 100644 --- a/keyboards/sol/keymaps/xulkal/keymap.c +++ b/keyboards/sol/keymaps/xulkal/keymap.c @@ -92,15 +92,29 @@ static void render_logo(void) { oled_write_P(sol_logo, false); } +extern rgb_config_t rgb_matrix_config; + static void render_status(void) { // Render to mode icon - static const char PROGMEM mode_logo[2][4] = { - {0x97,0x98,0x0a,0}, - {0xb7,0xb8,0x0a,0} }; + static const char PROGMEM mode_logo[2][3] = { + {0x97,0x98,0}, + {0xb7,0xb8,0} }; oled_write_P(mode_logo[0], false); + +#if defined(RGB_MATRIX_ENABLE) + static char buffer[20] = {0}; + snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val); + oled_write(buffer, false); +#endif + oled_write_P(mode_logo[1], false); +#if defined(RGB_MATRIX_ENABLE) + snprintf(buffer, sizeof(buffer), " s%3d m%3d\n", rgb_matrix_config.speed, rgb_matrix_config.mode); + oled_write(buffer, false); +#endif + // 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 oled_write_P(PSTR("Layer: "), false); switch (biton32(layer_state)) { diff --git a/users/xulkal/config.h b/users/xulkal/config.h index 5f56f7a14b1..6ff4ca49df4 100644 --- a/users/xulkal/config.h +++ b/users/xulkal/config.h @@ -11,3 +11,17 @@ #define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC #define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS #define RCPO_KEYS KC_RCTL, KC_TRNS, KC_EQL + +// No need for the single versions when multi performance isn't a problem =D +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_SOLID_SPLASH + +// Don't like or feel to identical to other effects +#define DISABLE_RGB_MATRIX_RAINBOW_BEACON +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define DISABLE_RGB_MATRIX_DIGITAL_RAIN +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS diff --git a/users/xulkal/process_records.c b/users/xulkal/process_records.c index af849a07296..531f99eb065 100644 --- a/users/xulkal/process_records.c +++ b/users/xulkal/process_records.c @@ -11,6 +11,10 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; #endif +#if defined(RGB_MATRIX_ENABLE) +extern void eeconfig_update_rgb_matrix_default(void); +#endif + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: @@ -56,12 +60,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; case RGBRST: - #ifdef RGBLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) if (record->event.pressed) { eeconfig_update_rgblight_default(); rgblight_enable(); } - #endif +#elif defined(RGB_MATRIX_ENABLE) + if (record->event.pressed) { + eeconfig_update_rgb_matrix_default(); + } +#endif return false; break; } From 670ff2d19f76f4558ccdd317ab362ccfe5e45642 Mon Sep 17 00:00:00 2001 From: mikethetiger <30720424+mikethetiger@users.noreply.github.com> Date: Tue, 30 Apr 2019 23:35:21 -0500 Subject: [PATCH 065/129] [Keymap] Made adjustment to my Preonic keymap (#5733) * Added my Preonic keymap * Update keyboards/preonic/keymaps/mikethetiger/keymap.c Co-Authored-By: mikethetiger <30720424+mikethetiger@users.noreply.github.com> * Update keyboards/preonic/keymaps/mikethetiger/keymap.c Co-Authored-By: mikethetiger <30720424+mikethetiger@users.noreply.github.com> * Added my Preonic keymap * Added my Preonic keymap --- .../preonic/keymaps/mikethetiger/config.h | 38 +++ .../preonic/keymaps/mikethetiger/keymap.c | 289 ++++++++++++++++++ .../preonic/keymaps/mikethetiger/readme.md | 1 + .../preonic/keymaps/mikethetiger/rules.mk | 1 + 4 files changed, 329 insertions(+) create mode 100644 keyboards/preonic/keymaps/mikethetiger/config.h create mode 100644 keyboards/preonic/keymaps/mikethetiger/keymap.c create mode 100644 keyboards/preonic/keymaps/mikethetiger/readme.md create mode 100644 keyboards/preonic/keymaps/mikethetiger/rules.mk diff --git a/keyboards/preonic/keymaps/mikethetiger/config.h b/keyboards/preonic/keymaps/mikethetiger/config.h new file mode 100644 index 00000000000..9e5eb83a64e --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_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 +#define TAP_CODE_DELAY 10 + +/* 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 diff --git a/keyboards/preonic/keymaps/mikethetiger/keymap.c b/keyboards/preonic/keymaps/mikethetiger/keymap.c new file mode 100644 index 00000000000..2f3963f7152 --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/keymap.c @@ -0,0 +1,289 @@ +/* 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 QMK_KEYBOARD_H +#include "muse.h" + +enum preonic_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_preonic_grid( + KC_ESC, 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, \ + 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, \ + BACKLIT, 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_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, \ + BACKLIT, 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_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, \ + BACKLIT, 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 | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_preonic_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_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_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 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_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_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, 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| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_preonic_grid( + 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, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + 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 + #ifdef __AVR__ + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef __AVR__ + PORTE |= (1<<6); + #endif + } + return false; + break; + } + return true; +}; + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/preonic/keymaps/mikethetiger/readme.md b/keyboards/preonic/keymaps/mikethetiger/readme.md new file mode 100644 index 00000000000..6da54ebbb54 --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/readme.md @@ -0,0 +1 @@ +# mikethetiger's Preonic layout - largely based on the Planck's \ No newline at end of file diff --git a/keyboards/preonic/keymaps/mikethetiger/rules.mk b/keyboards/preonic/keymaps/mikethetiger/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/rules.mk @@ -0,0 +1 @@ +SRC += muse.c From 074be4fe5e8a783c0147e6fa57182c1a6b61418d Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Wed, 1 May 2019 06:53:29 +0200 Subject: [PATCH 066/129] [Keyboard] Signum3.0 generate json keymap (#5688) * Remove dependency on sortedcontainers * Sort dictionary on output * Externalize writing of keymap.c into function - serialize layers into one flat list * Add encoding * Generate JSON keymap in addition to keymap.c * Replace XXXXXX with KC_NO --- .../3_0/elitec/keymaps/default/generate_km.py | 126 +++++++++++------- .../3_0/elitec/keymaps/default/keymap.c | 24 ++-- .../3_0/elitec/keymaps/default/layout.py | 60 +++++---- .../3_0/elitec/keymaps/default/readme.md | 3 +- 4 files changed, 125 insertions(+), 88 deletions(-) diff --git a/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py index 05996d06cab..9517a2f1f07 100755 --- a/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py +++ b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py @@ -1,12 +1,11 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import json import layout +import os import re -# TODO: auto-generate mutex layers -# TODO: auto-generate update_tri_layer (_state) - def gen_uc_iter(): length = len(layout.uc_dict) @@ -18,7 +17,7 @@ def gen_uc_iter(): yield (key, value, True) -def translate(s): +def _translate(s): if re.match("^[0-9]$", s): return ("KC_{0}".format(s), " {0} ".format(s)) elif re.match("^[a-z]$", s): @@ -50,80 +49,115 @@ def translate(s): def toKC(s): - (kc, lgd) = translate(s) - return kc + return _translate(s)[0] def toLgd(s): - (kc, lgd) = translate(s) - return lgd + return _translate(s)[1] -if __name__ == "__main__": - - template = open("km_template.txt", mode="r") - output = open("keymap.c", mode="w", encoding='utf-8') - +def writeKeymap(f_template, f_keymap, columns, rows): doCopy = False - for line in template: + for line in f_template: doCopy = True if line.startswith("//"): doCopy = False -# output.write(str(layout.uc_dict)) + # f_keymap.write(str(layout.uc_dict)) for k, v, isLast in gen_uc_iter(): if isLast: - output.write(k + "\n") + f_keymap.write(k + "\n") else: - output.write(k + ",\n") - if line.startswith("//"): + f_keymap.write(k + ",\n") + elif line.startswith("//"): doCopy = False for k, v, isLast in gen_uc_iter(): if isLast: - output.write(u"\t[{0}] = {1} // {2}\n".format(k, v, chr(int(v, 0)))) + f_keymap.write(u"\t[{0}] = {1} // {2}\n".format(k, v, chr(int(v, 0)))) else: - output.write(u"\t[{0}] = {1}, // {2}\n".format(k, v, chr(int(v, 0)))) - if line.startswith("//"): + f_keymap.write(u"\t[{0}] = {1}, // {2}\n".format(k, v, chr(int(v, 0)))) + elif line.startswith("//"): doCopy = False - counter = len(layout.layers) - layer = 0 - S = layout.static - for L in layout.layers: - counter -= 1 - r_counter = 4 - output.write("/* Layer %d\n" % layer) - output.write(" * ------------------------------------------------- -------------------------------------------------\n") - output.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(toLgd(L[0][0]), toLgd(L[0][1]), toLgd(L[0][2]), toLgd(L[0][3]), toLgd(L[0][4]), toLgd(L[0][5]), toLgd(L[0][6]), toLgd(L[0][7]), toLgd(L[0][8]), toLgd(L[0][9]), toLgd(L[0][10]), toLgd(L[0][11]))) - output.write(" * ------------------------------------------------- -------------------------------------------------\n") - output.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(toLgd(L[1][0]), toLgd(L[1][1]), toLgd(L[1][2]), toLgd(L[1][3]), toLgd(L[1][4]), toLgd(L[1][5]), toLgd(L[1][6]), toLgd(L[1][7]), toLgd(L[1][8]), toLgd(L[1][9]), toLgd(L[1][10]), toLgd(L[1][11]))) - output.write(" * ------------------------------------------------- -------------------------------------------------\n") - output.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(toLgd(L[2][0]), toLgd(L[2][1]), toLgd(L[2][2]), toLgd(L[2][3]), toLgd(L[2][4]), toLgd(L[2][5]), toLgd(L[2][6]), toLgd(L[2][7]), toLgd(L[2][8]), toLgd(L[2][9]), toLgd(L[2][10]), toLgd(L[2][11]))) - output.write(" * -----------------------------------------------------------------------------------------------------------------\n") - output.write(" * {0} {1} {2} |{3}|{4}|{5}|{6}|{7}|{8}| {9} {10} {11}".format(toLgd(L[3][0]), toLgd(L[3][1]), toLgd(L[3][2]), toLgd(L[3][3]), toLgd(L[3][4]), toLgd(L[3][5]), toLgd(L[3][6]), toLgd(L[3][7]), toLgd(L[3][8]), toLgd(L[3][9]), toLgd(L[3][10]), toLgd(L[3][11])).rstrip()+"\n") - output.write(" * -------------------------------------------------\n") - output.write(" */\n") + for layer, L in enumerate(layout.layers): + r_counter = rows + f_keymap.write("/* Layer %d\n" % layer) + f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n") + f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[:12]))) + f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n") + f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[12:24]))) + f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n") + f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[24:36]))) + f_keymap.write(" * -----------------------------------------------------------------------------------------------------------------\n") + f_keymap.write(" * {0} {1} {2} |{3}|{4}|{5}|{6}|{7}|{8}| {9} {10} {11}".format(*map(toLgd, L[36:48])).rstrip()+"\n") + f_keymap.write(" * -------------------------------------------------\n") + f_keymap.write(" */\n") l_code = '\tLAYOUT_ortho_4x12(\n' for r in range(r_counter): r_counter -= 1 - c_counter = 12 + c_counter = columns l_code += '\t\t' for c in range(c_counter): c_counter -= 1 if c != 0: l_code += " " - l_code += "%s" % toKC(L[r][c]) + l_code += "%s" % toKC(L[r*columns + columns-c_counter-1]) if r_counter or c_counter: l_code += "," l_code += '\n' - if counter: + if layer + 1 != len(layout.layers): l_code += "\t),\n\n" else: l_code += "\t)\n" - output.write(l_code) - layer += 1 + f_keymap.write(l_code) if doCopy: - output.write(line) + f_keymap.write(line) - template.close() - output.close() + +def getKeymapJSON(keyboard, keymap, layout, layers): + return json.dumps({ + 'keyboard': keyboard, + 'keymap': keymap, + 'layout': layout, + 'layers': layers + }, sort_keys=True, indent=4) + + +def layersToKC(layers): + return [list(map(toKC, layer)) for layer in layers] + + +def pathToKeymap(path): + head, keymap = os.path.split(path) + _, keymapsdir = os.path.split(head) + if keymapsdir == 'keymaps': + return keymap + + +def pathToKeyboard(path): + head, keymap = os.path.split(path) + head, keymapsdir = os.path.split(head) + if keymapsdir == 'keymaps': + head, dir = os.path.split(head) + while dir not in ('/', 'keyboards'): + yield dir + head, dir = os.path.split(head) + + +if __name__ == "__main__": + with open("km_template.txt", mode="r") as f_template: + with open("keymap.c", mode="w", encoding='utf-8') as f_keymap: + writeKeymap(f_template, f_keymap, columns=12, rows=4) + + abspath = os.path.dirname(os.path.abspath(__file__)) + keyboard = list(reversed(list(pathToKeyboard(abspath)))) + keymap = pathToKeymap(abspath) + keyboard_layout = 'LAYOUT_ortho_4x12' + with open("%s_%s.json" % ('_'.join(keyboard), keymap), mode="w") as f_keymapjson: + f_keymapjson.write( + getKeymapJSON( + '/'.join(keyboard), + keymap, + keyboard_layout, + layersToKC(layout.layers)) + ) diff --git a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c index 4b3a9439d44..c94890edae5 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c +++ b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c @@ -672,8 +672,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ LAYOUT_ortho_4x12( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, - KC_TRNS, DF(0), DF(1), XXXXXXX, XXXXXXX, MO(3), KC_4, KC_4, KC_5, KC_6, KC_MINS, KC_EQL, - KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MO(5), KC_1, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS, DF(0), DF(1), KC_NO, KC_NO, MO(3), KC_4, KC_4, KC_5, KC_6, KC_MINS, KC_EQL, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, MO(5), KC_1, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_0, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -689,9 +689,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- */ LAYOUT_ortho_4x12( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, - KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MO(3), KC_F4, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, - KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F1, KC_F2, KC_F3, XXXXXXX, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, MO(3), KC_F4, KC_F4, KC_F5, KC_F6, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F1, KC_F2, KC_F3, KC_NO, KC_TRNS, TG(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -709,7 +709,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_4x12( KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), CTL_T(KC_PGDN), CTL_T(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, LSFT(KC_INS), KC_ESC, KC_TRNS, KC_CAPS, LGUI_T(KC_LEFT), LGUI_T(KC_TAB), LGUI_T(KC_RIGHT), LGUI_T(KC_RIGHT), KC_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, KC_PSCR, - KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, CTL_T(KC_PGUP), CTL_T(KC_PGUP), KC_PGUP, XXXXXXX, KC_DOWN, XXXXXXX, KC_APP, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, CTL_T(KC_PGUP), CTL_T(KC_PGUP), KC_PGUP, KC_NO, KC_DOWN, KC_NO, KC_APP, KC_TRNS, TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -725,9 +725,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- */ LAYOUT_ortho_4x12( - KC_TRNS, XXXXXXX, KC_MPLY, KC_VOLU, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, KC_PWR, - KC_TRNS, XXXXXXX, KC_MPRV, KC_MUTE, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLEP, - KC_TRNS, XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLD, MO(5), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_TRNS, KC_NO, KC_MPLY, KC_VOLU, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_PWR, + KC_TRNS, KC_NO, KC_MPRV, KC_MUTE, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP, + KC_TRNS, KC_NO, KC_NO, KC_VOLD, KC_VOLD, MO(5), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TG(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -743,9 +743,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- */ LAYOUT_ortho_4x12( - KC_TRNS, KC_ACL1, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX, - KC_TRNS, KC_ACL2, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_MS_L, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX, - KC_TRNS, KC_ACL0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_D, XXXXXXX, KC_MS_D, XXXXXXX, XXXXXXX, KC_TRNS, + KC_TRNS, KC_ACL1, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, KC_NO, KC_NO, + KC_TRNS, KC_ACL2, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_MS_L, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, + KC_TRNS, KC_ACL0, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_D, KC_NO, KC_MS_D, KC_NO, KC_NO, KC_TRNS, TG(6), 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/signum/3_0/elitec/keymaps/default/layout.py b/keyboards/signum/3_0/elitec/keymaps/default/layout.py index 5a796c86237..69cc059f189 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/layout.py +++ b/keyboards/signum/3_0/elitec/keymaps/default/layout.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Add all used Unicode symbols to this list. # The key (e.g. "SNEK") is used in keymap.c for "enum", "unicode_map" and "keymaps", so it needs to be a valid C variable name. # The key is also used in this file to define the layout, so use recognizeable names. @@ -336,7 +338,7 @@ qmk_dict = { # If you find "BAD" in your keymaps, then something went wrong.) "a": "BAD", "A": "BAD", "0": "BAD", # Basic Keycodes - "XXX": "XXXXXXX", "": "KC_TRNS", + "XXX": "KC_NO", "": "KC_TRNS", "!": "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)", "Enter": "KC_ENT", "Esc": "KC_ESC", "BSpace": "KC_BSPC", "Tab": "KC_TAB", @@ -426,58 +428,58 @@ static = ["NEO", "GREEK", "GREEK", "GREEK", "GREEK", "MOUSE"] # 0 qwerty = [ - ["Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "["], - ["LCtrl", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'"], - ["LShift(", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "RShift)"], - ["MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl"], + "Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", + "LCtrl", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", + "LShift(", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "RShift)", + "MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl", ] # 1 colemak = [ - ["Tab", "q", "w", "f", "p", "g", "j", "l", "u", "y", ";", "["], - ["LCtrl", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'"], - ["LShift(", "z", "x", "c", "v", "b", "k", "m", ",", ".", "/", "RShift)"], - ["MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl"], + "Tab", "q", "w", "f", "p", "g", "j", "l", "u", "y", ";", "[", + "LCtrl", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'", + "LShift(", "z", "x", "c", "v", "b", "k", "m", ",", ".", "/", "RShift)", + "MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl", ] # 2 numpad = [ - ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "]"], - ["", "DF0", "DF1", "XXX", "XXX", "MO3", "4", "4", "5", "6", "-", "="], - ["", "XXX", "XXX", "XXX", "XXX", "MO5", "1", "1", "2", "3", "\\", ""], - ["TG2", "", "", "", "Del", "", "", "BSpace", "0", "", "", ""], + "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "]", + "", "DF0", "DF1", "XXX", "XXX", "MO3", "4", "4", "5", "6", "-", "=", + "", "XXX", "XXX", "XXX", "XXX", "MO5", "1", "1", "2", "3", "\\", "", + "TG2", "", "", "", "Del", "", "", "BSpace", "0", "", "", "", ] # 3 fpad = [ - ["", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "XXX"], - ["", "XXX", "XXX", "XXX", "XXX", "MO3", "F4", "F4", "F5", "F6", "XXX", "XXX"], - ["", "XXX", "XXX", "XXX", "XXX", "XXX", "F1", "F1", "F2", "F3", "XXX", ""], - ["TG3", "", "", "", "", "", "F10", "F11", "F12", "", "", ""], + "", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "XXX", + "", "XXX", "XXX", "XXX", "XXX", "MO3", "F4", "F4", "F5", "F6", "XXX", "XXX", + "", "XXX", "XXX", "XXX", "XXX", "XXX", "F1", "F1", "F2", "F3", "XXX", "", + "TG3", "", "", "", "", "", "F10", "F11", "F12", "", "", "", ] # 4 movement = [ - ["Esc", "Esc", "Tab x", "Tab n", "CPg Dn", "CPg Dn", "Pg Down", "Home", "^ Arrow", "Insert", "SInsert", "Esc"], - ["", "Caps", "< Gui", "Gui Tab", "> Gui", "> Gui", "< Arrow", "< Arrow", "v Arrow", "> Arrow", "End", "Pr Scr"], - ["", "XXX", "XXX", "XXX", "CPg Up", "CPg Up", "Pg Up", "XXX", "v Arrow", "XXX", "App", ""], - ["TG4", "", "", "", "Del", "", "", "BSpace", "", "", "", ""], + "Esc", "Esc", "Tab x", "Tab n", "CPg Dn", "CPg Dn", "Pg Down", "Home", "^ Arrow", "Insert", "SInsert", "Esc", + "", "Caps", "< Gui", "Gui Tab", "> Gui", "> Gui", "< Arrow", "< Arrow", "v Arrow", "> Arrow", "End", "Pr Scr", + "", "XXX", "XXX", "XXX", "CPg Up", "CPg Up", "Pg Up", "XXX", "v Arrow", "XXX", "App", "", + "TG4", "", "", "", "Del", "", "", "BSpace", "", "", "", "", ] # 5 media = [ - ["", "XXX", "play/ps", "Vol +", "Vol +", "XXX", "XXX", "XXX", "XXX", "XXX", "_reset", "Power"], - ["", "XXX", "|<<", "Vol 0", ">>|", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "Sleep"], - ["", "XXX", "XXX", "Vol -", "Vol -", "MO5", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX"], - ["TG5", "", "", "", "", "", "", "", "", "", "", ""], + "", "XXX", "play/ps", "Vol +", "Vol +", "XXX", "XXX", "XXX", "XXX", "XXX", "_reset", "Power", + "", "XXX", "|<<", "Vol 0", ">>|", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "Sleep", + "", "XXX", "XXX", "Vol -", "Vol -", "MO5", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", + "TG5", "", "", "", "", "", "", "", "", "", "", "", ] # 6 mouse = [ - ["", "acc1", "XXX", "XXX", "XXX", "XXX", "^ Wheel", "< Wheel", "^ Mouse", "> Wheel", "XXX", "XXX"], - ["", "acc2", "Mouse 3", "Mouse 2", "Mouse 1", "Mouse 1", "< Mouse", "< Mouse", "v Mouse", "> Mouse", "XXX", "XXX"], - ["", "acc0", "XXX", "XXX", "XXX", "XXX", "v Wheel", "XXX", "v Mouse", "XXX", "XXX", ""], - ["TG6", "", "", "", "", "", "", "", "", "", "", ""], + "", "acc1", "XXX", "XXX", "XXX", "XXX", "^ Wheel", "< Wheel", "^ Mouse", "> Wheel", "XXX", "XXX", + "", "acc2", "Mouse 3", "Mouse 2", "Mouse 1", "Mouse 1", "< Mouse", "< Mouse", "v Mouse", "> Mouse", "XXX", "XXX", + "", "acc0", "XXX", "XXX", "XXX", "XXX", "v Wheel", "XXX", "v Mouse", "XXX", "XXX", "", + "TG6", "", "", "", "", "", "", "", "", "", "", "", ] layers = [ diff --git a/keyboards/signum/3_0/elitec/keymaps/default/readme.md b/keyboards/signum/3_0/elitec/keymaps/default/readme.md index 54db18cd315..be8cc30e8a0 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/readme.md +++ b/keyboards/signum/3_0/elitec/keymaps/default/readme.md @@ -20,4 +20,5 @@ starting point to create your own layouts for the Signum 3.0 with - Attention 2: additional C functions need to be put into `km_template.txt` -Run `./generate_km.py` to regenerate `keymap.c`. +Run `./generate_km.py` to regenerate `keymap.c` and the JSON keymap +definition that should be copied to `qmk_configurator/public/keymaps`. From e4b5c4426285d4e987fdbcc0c0bb6f7169c72c2e Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 1 May 2019 14:54:52 +1000 Subject: [PATCH 067/129] [Docs] Use HTTPS for qmk.fm link (#5506) * Use HTTPS for qmk.fm link * Fix the rest of the HTTP links --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 6e6cfaa1bd1..86cce5a995e 100644 --- a/readme.md +++ b/readme.md @@ -7,7 +7,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) [![GitHub forks](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) -This is a keyboard firmware based on the [tmk\_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). +This is a keyboard firmware based on the [tmk\_keyboard firmware](https://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](https://ergodox-ez.com) keyboard, and the [Clueboard product line](https://clueboard.co). ## Documentation @@ -30,6 +30,6 @@ The project also includes community support for [lots of other keyboards](/keybo QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), the Clueboard by [Zach White](https://github.com/skullydazed), and the Atreus by [Phil Hagelberg](https://github.com/technomancy). -## Official website +## Official Website -[http://qmk.fm](http://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK. +[qmk.fm](https://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK. From 61ce41ae13242adb113f61ec03dd9ed26acee26b Mon Sep 17 00:00:00 2001 From: Josh Hinnebusch Date: Wed, 1 May 2019 01:35:49 -0400 Subject: [PATCH 068/129] [Keyboard] Update hineybush keyboard projects (#5554) * Add H87a keymap and info * Create readme.md * Add h87a .json for kbfirmware.com use * Update readme.md * Update readme.md * Update h87a files * Delete Makefile * Update readme.md * Delete desktop.ini * update files to match new QMK framework * Update files to match new QMK structure * Update files to match new QMK structure * add layout name information * Add info.json * update keymap to support layout_all * update keymap to support layout_all * update rules.mk to fix filesize * Update readme.md * Update config.h * Update readme.md * Update config.h * Update config.h Add "define CONFIG_H and include "config_common.h" back to file * update config.h to include RGB turnoff when PC goes to sleep * update info.json * update info.json * Update readme.md Add project link * Update readme.md * refactor hineybush projects into single folder. update hineyg80 to modern code * updated layout file to reflect new keymap changes * actually updated all layout names this time, verified make * Update keyboards/hineybush/h87a/h87a.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/default/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/readme.md Co-Authored-By: hineybush * edit based on PR edit requests * update hiney80 files to avoid confusion * update hineyg80.h to reflect matrix * Update keyboards/hineybush/hineyg80/info.json Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/info.json Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/info.json Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/info.json Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/default/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/keymaps/wkl/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/default/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/readme.md Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/readme.md Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/readme.md Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/readme.md Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/default/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/keymaps/default/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/readme.md Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/readme.md Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * update hineyg80 config.h * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/h87a/keymaps/wkl/keymap.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/hineyg80.c Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/config.h Co-Authored-By: hineybush * Update keyboards/hineybush/hineyg80/config.h Co-Authored-By: hineybush --- keyboards/h87a/h87a.h | 47 ---------- keyboards/h87a/info.json | 12 --- keyboards/{ => hineybush}/h87a/config.h | 1 + keyboards/{ => hineybush}/h87a/h87a.c | 0 keyboards/hineybush/h87a/h87a.h | 90 +++++++++++++++++++ keyboards/hineybush/h87a/info.json | 20 +++++ .../hineybush/h87a/keymaps/default/config.h | 21 +++++ .../h87a/keymaps/default/keymap.c | 2 +- .../hineybush/h87a/keymaps/default/readme.md | 1 + .../h87a/keymaps/gam3cat/config.h | 0 .../h87a/keymaps/gam3cat/keymap.c | 0 .../h87a/keymaps/gam3cat/readme.md | 0 .../h87a/keymaps/gam3cat/rules.mk | 0 keyboards/hineybush/h87a/keymaps/wkl/config.h | 21 +++++ keyboards/hineybush/h87a/keymaps/wkl/keymap.c | 73 +++++++++++++++ .../hineybush/h87a/keymaps/wkl/readme.md | 1 + keyboards/{ => hineybush}/h87a/readme.md | 17 ++-- keyboards/{ => hineybush}/h87a/rules.mk | 0 keyboards/hineybush/hineyg80/config.h | 47 ++++++++++ keyboards/hineybush/hineyg80/hineyg80.c | 63 +++++++++++++ keyboards/hineybush/hineyg80/hineyg80.h | 89 ++++++++++++++++++ keyboards/hineybush/hineyg80/info.json | 19 ++++ .../hineyg80/keymaps/default/config.h | 19 ++++ .../hineyg80/keymaps/default/keymap.c | 58 ++++++++++++ .../hineyg80/keymaps/default/readme.md | 1 + .../hineybush/hineyg80/keymaps/wkl/config.h | 19 ++++ .../hineybush/hineyg80/keymaps/wkl/keymap.c | 60 +++++++++++++ .../hineybush/hineyg80/keymaps/wkl/readme.md | 1 + keyboards/hineybush/hineyg80/readme.md | 16 ++++ keyboards/hineybush/hineyg80/rules.mk | 81 +++++++++++++++++ 30 files changed, 712 insertions(+), 67 deletions(-) delete mode 100644 keyboards/h87a/h87a.h delete mode 100644 keyboards/h87a/info.json rename keyboards/{ => hineybush}/h87a/config.h (97%) rename keyboards/{ => hineybush}/h87a/h87a.c (100%) create mode 100644 keyboards/hineybush/h87a/h87a.h create mode 100644 keyboards/hineybush/h87a/info.json create mode 100644 keyboards/hineybush/h87a/keymaps/default/config.h rename keyboards/{ => hineybush}/h87a/keymaps/default/keymap.c (98%) create mode 100644 keyboards/hineybush/h87a/keymaps/default/readme.md rename keyboards/{ => hineybush}/h87a/keymaps/gam3cat/config.h (100%) rename keyboards/{ => hineybush}/h87a/keymaps/gam3cat/keymap.c (100%) rename keyboards/{ => hineybush}/h87a/keymaps/gam3cat/readme.md (100%) rename keyboards/{ => hineybush}/h87a/keymaps/gam3cat/rules.mk (100%) create mode 100644 keyboards/hineybush/h87a/keymaps/wkl/config.h create mode 100644 keyboards/hineybush/h87a/keymaps/wkl/keymap.c create mode 100644 keyboards/hineybush/h87a/keymaps/wkl/readme.md rename keyboards/{ => hineybush}/h87a/readme.md (67%) rename keyboards/{ => hineybush}/h87a/rules.mk (100%) create mode 100644 keyboards/hineybush/hineyg80/config.h create mode 100644 keyboards/hineybush/hineyg80/hineyg80.c create mode 100644 keyboards/hineybush/hineyg80/hineyg80.h create mode 100644 keyboards/hineybush/hineyg80/info.json create mode 100644 keyboards/hineybush/hineyg80/keymaps/default/config.h create mode 100644 keyboards/hineybush/hineyg80/keymaps/default/keymap.c create mode 100644 keyboards/hineybush/hineyg80/keymaps/default/readme.md create mode 100644 keyboards/hineybush/hineyg80/keymaps/wkl/config.h create mode 100644 keyboards/hineybush/hineyg80/keymaps/wkl/keymap.c create mode 100644 keyboards/hineybush/hineyg80/keymaps/wkl/readme.md create mode 100644 keyboards/hineybush/hineyg80/readme.md create mode 100644 keyboards/hineybush/hineyg80/rules.mk diff --git a/keyboards/h87a/h87a.h b/keyboards/h87a/h87a.h deleted file mode 100644 index 8aa3e160e67..00000000000 --- a/keyboards/h87a/h87a.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2018 Josh Hinnebusch - * - * 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 H87A_H -#define H87A_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 LAYOUT_all(\ - K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ - K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K036, K027, K037, K028, K038, \ - K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ - K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K066, K076, \ - K080, K090, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K096, K088, \ - K100, K110, K101, K113, K105, K115, K106, K116, K117, K108, K118 \ -) { \ - { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ - { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ - { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ - { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ - { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ - { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ - { K060, K061, K062, K063, K064, K065, K066, KC_NO, KC_NO }, \ - { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ - { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ - { K090, K091, K092, K093, K094, K095, K096, KC_NO, KC_NO }, \ - { K100, K101, KC_NO, KC_NO, KC_NO, K105, K106, KC_NO, K108 }, \ - { K110, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ -} - -#endif diff --git a/keyboards/h87a/info.json b/keyboards/h87a/info.json deleted file mode 100644 index cf3e81dd3a4..00000000000 --- a/keyboards/h87a/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "h87a", - "url": "", - "maintainer": "hineybush", - "width": 18.25, - "height": 6.5, - "layouts": { - "LAYOUT_all": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] - } - } -} \ No newline at end of file diff --git a/keyboards/h87a/config.h b/keyboards/hineybush/h87a/config.h similarity index 97% rename from keyboards/h87a/config.h rename to keyboards/hineybush/h87a/config.h index 90b3a509c86..2e6c37e33fd 100644 --- a/keyboards/h87a/config.h +++ b/keyboards/hineybush/h87a/config.h @@ -72,4 +72,5 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP // RGB will turn off when PC is put to sleep #endif diff --git a/keyboards/h87a/h87a.c b/keyboards/hineybush/h87a/h87a.c similarity index 100% rename from keyboards/h87a/h87a.c rename to keyboards/hineybush/h87a/h87a.c diff --git a/keyboards/hineybush/h87a/h87a.h b/keyboards/hineybush/h87a/h87a.h new file mode 100644 index 00000000000..437199b23ed --- /dev/null +++ b/keyboards/hineybush/h87a/h87a.h @@ -0,0 +1,90 @@ +/* Copyright 2018 Josh Hinnebusch + * + * 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 . + */ +#pragma once + +#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 LAYOUT_all(\ + K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ + K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K036, K027, K037, K028, K038, \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ + K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K066, K076, \ + K080, K090, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K096, K088, \ + K100, K110, K101, K113, K105, K115, K106, K116, K117, K108, K118 \ +) { \ + { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ + { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, K066, KC_NO, KC_NO }, \ + { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ + { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ + { K090, K091, K092, K093, K094, K095, K096, KC_NO, KC_NO }, \ + { K100, K101, KC_NO, KC_NO, KC_NO, K105, K106, KC_NO, K108 }, \ + { K110, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ +} + + +#define LAYOUT_tkl_ansi(\ + K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ + K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K027, K037, K028, K038, \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ + K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K076, \ + K080, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K088, \ + K100, K110, K101, K113, K105, K115, K106, K116, K117, K108, K118 \ +) { \ + { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ + { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, KC_NO, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, KC_NO, KC_NO }, \ + { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ + { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, KC_NO, KC_NO, KC_NO }, \ + { K100, K101, KC_NO, KC_NO, KC_NO, K105, K106, KC_NO, K108 }, \ + { K110, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ +} + +#define LAYOUT_tkl_ansi_wkl(\ + K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ + K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K027, K037, K028, K038, \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ + K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K076, \ + K080, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K088, \ + K100, K101, K113, K115, K116, K117, K108, K118 \ +) { \ + { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ + { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, KC_NO, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, KC_NO, KC_NO }, \ + { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ + { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, KC_NO, KC_NO, KC_NO }, \ + { K100, K101, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, K108 }, \ + {KC_NO, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ +} + diff --git a/keyboards/hineybush/h87a/info.json b/keyboards/hineybush/h87a/info.json new file mode 100644 index 00000000000..57f68db0b7a --- /dev/null +++ b/keyboards/hineybush/h87a/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "h87a", + "url": "", + "maintainer": "hineybush", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"x":13, "y":1.5}, {"label":"Bksp", "x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + }, + + "LAYOUT_tkl_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Bksp", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + }, + "LAYOUT_tkl_ansi_wkl": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Bksp", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} + diff --git a/keyboards/hineybush/h87a/keymaps/default/config.h b/keyboards/hineybush/h87a/keymaps/default/config.h new file mode 100644 index 00000000000..cef67bd4880 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/default/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Josh Hinnebusch + * + * 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 . + */ + +#pragma once + + +// place overrides here + diff --git a/keyboards/h87a/keymaps/default/keymap.c b/keyboards/hineybush/h87a/keymaps/default/keymap.c similarity index 98% rename from keyboards/h87a/keymaps/default/keymap.c rename to keyboards/hineybush/h87a/keymaps/default/keymap.c index 89178453d58..6382af1eec0 100644 --- a/keyboards/h87a/keymaps/default/keymap.c +++ b/keyboards/hineybush/h87a/keymaps/default/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_TRNS, KC_UP, + 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_TRNS, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [1] = LAYOUT_all( diff --git a/keyboards/hineybush/h87a/keymaps/default/readme.md b/keyboards/hineybush/h87a/keymaps/default/readme.md new file mode 100644 index 00000000000..da22afc6ad3 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for h87a \ No newline at end of file diff --git a/keyboards/h87a/keymaps/gam3cat/config.h b/keyboards/hineybush/h87a/keymaps/gam3cat/config.h similarity index 100% rename from keyboards/h87a/keymaps/gam3cat/config.h rename to keyboards/hineybush/h87a/keymaps/gam3cat/config.h diff --git a/keyboards/h87a/keymaps/gam3cat/keymap.c b/keyboards/hineybush/h87a/keymaps/gam3cat/keymap.c similarity index 100% rename from keyboards/h87a/keymaps/gam3cat/keymap.c rename to keyboards/hineybush/h87a/keymaps/gam3cat/keymap.c diff --git a/keyboards/h87a/keymaps/gam3cat/readme.md b/keyboards/hineybush/h87a/keymaps/gam3cat/readme.md similarity index 100% rename from keyboards/h87a/keymaps/gam3cat/readme.md rename to keyboards/hineybush/h87a/keymaps/gam3cat/readme.md diff --git a/keyboards/h87a/keymaps/gam3cat/rules.mk b/keyboards/hineybush/h87a/keymaps/gam3cat/rules.mk similarity index 100% rename from keyboards/h87a/keymaps/gam3cat/rules.mk rename to keyboards/hineybush/h87a/keymaps/gam3cat/rules.mk diff --git a/keyboards/hineybush/h87a/keymaps/wkl/config.h b/keyboards/hineybush/h87a/keymaps/wkl/config.h new file mode 100644 index 00000000000..cef67bd4880 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/wkl/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Josh Hinnebusch + * + * 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 . + */ + +#pragma once + + +// place overrides here + diff --git a/keyboards/hineybush/h87a/keymaps/wkl/keymap.c b/keyboards/hineybush/h87a/keymaps/wkl/keymap.c new file mode 100644 index 00000000000..72b4d4e44da --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/wkl/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2018 Josh Hinnebusch + + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_tkl_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, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_ansi_wkl( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + 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_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_init_ports(void) { + setPinOutput(D5); + setPinOutput(E6); +} + +void led_set_user(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + setPinOutput(D5); + writePinLow(D5); + } else { + setPinInput(D5); + writePinLow(D5); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + setPinOutput(E6); + writePinLow(E6); + } else { + setPinInput(E6); + writePinLow(E6); + } + +} diff --git a/keyboards/hineybush/h87a/keymaps/wkl/readme.md b/keyboards/hineybush/h87a/keymaps/wkl/readme.md new file mode 100644 index 00000000000..da22afc6ad3 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/wkl/readme.md @@ -0,0 +1 @@ +# The default keymap for h87a \ No newline at end of file diff --git a/keyboards/h87a/readme.md b/keyboards/hineybush/h87a/readme.md similarity index 67% rename from keyboards/h87a/readme.md rename to keyboards/hineybush/h87a/readme.md index d7185db522c..90f513c45d1 100644 --- a/keyboards/h87a/readme.md +++ b/keyboards/hineybush/h87a/readme.md @@ -3,16 +3,16 @@ h87a A QMK-powered replacement PCB for custom TKL keyboards. This PCB has the same size of the b.87 PCB, while using the USB port placement and spacebar stabilizer orientation as the a.87 PCB. -Keyboard Maintainer: hineybush (Josh Hinnebusch) - -Hardware Supported: h87a Rev 1 - -Hardware Availability: Currently prototyped, group buy TBD +Keyboard Maintainer: [hineybush](https://github.com/hineybush) +Hardware Supported: h87a ver. 1.5, ver. 1.6 (normal and thin), h87alps +Hardware Availability: hineybush.com Make example for this keyboard (after setting up your build environment): - make h87a:default + make hineybush/h87a:default +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + ## h87a hardware information Controller: Atmega32u4 @@ -35,8 +35,11 @@ The H87a PCB utilizes duplex matrix organization. Backlight Pin: B7 RGB Data Pin: D3 + + +For ver 1.5 in-switch indicators: To connect the Caps Lock LED to the main backlight matrix, jump the middle pad and the left pad on J1. To use the Caps Lock LED as an indicator, jump the middle pad and the right pad on J1. To connect the Scroll Lock LED to the main backlight matrix, jump the middle pad and the right pad on J2. To use the Scroll Lock LED as an indicator, jump the middle pad and the left pad on J2. -Note: The different orientations of J1 and J2 will be fixed with Rev 2. +Note: The different orientations of J1 and J2 was fixed with ver. 1.6. diff --git a/keyboards/h87a/rules.mk b/keyboards/hineybush/h87a/rules.mk similarity index 100% rename from keyboards/h87a/rules.mk rename to keyboards/hineybush/h87a/rules.mk diff --git a/keyboards/hineybush/hineyg80/config.h b/keyboards/hineybush/hineyg80/config.h new file mode 100644 index 00000000000..7e75c62b341 --- /dev/null +++ b/keyboards/hineybush/hineyg80/config.h @@ -0,0 +1,47 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER hineybush +#define PRODUCT hineyG80 +#define DESCRIPTION QMK-powered PCB for Cherry G80/81-1800 Boards + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B2, B3, D0, B1, D2, D1, D5, D3, D6, D4, B4, D7 } +#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, F0, B7, B0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#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 + +#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 + diff --git a/keyboards/hineybush/hineyg80/hineyg80.c b/keyboards/hineybush/hineyg80/hineyg80.c new file mode 100644 index 00000000000..236c646be75 --- /dev/null +++ b/keyboards/hineybush/hineyg80/hineyg80.c @@ -0,0 +1,63 @@ +/* Copyright 2019 Josh Hinnebusch + * + * 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 "hineyg80.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 (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + // Turn numlock on + writePinHigh(C6); + } else { + // Turn numlock off + writePinLow(C6); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + // Turn capslock on + writePinHigh(B6); + } else { + // Turn capslock off + writePinLow(B6); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + // Turn scrolllock on + writePinHigh(B5); + } else { + // Turn scrolllock off + writePinLow(B5); + } + led_set_user(usb_led); +} diff --git a/keyboards/hineybush/hineyg80/hineyg80.h b/keyboards/hineybush/hineyg80/hineyg80.h new file mode 100644 index 00000000000..617c5166a94 --- /dev/null +++ b/keyboards/hineybush/hineyg80/hineyg80.h @@ -0,0 +1,89 @@ +/* Copyright 2019 Josh Hinnebusch + * + * 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 . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_all( \ + K000,K010,K001,K011,K002,K012,K003,K013,K004,K014,K005,K015,K006, K007,K017,K008,K018, \ + K027,K016,K028,K038, \ + K020,K030,K021,K031,K022,K032,K023,K033,K024,K034,K025,K035,K026,K036,K037,K047,K057,K048,K058, \ + K040,K050,K041,K051,K042,K052,K043,K053,K044,K054,K045,K055,K046,K056, K067,K077,K068,K078, \ + K060,K070,K061,K071,K062,K072,K063,K073,K064,K074,K065,K075,K066,K076, K087,K097,K088,K098, \ + K080,K090,K081,K091,K082,K092,K083,K093,K084,K094,K085,K095,K086,K096, K106,K116,K108,K118, \ + K100,K110,K101, K102, K112,K103,K113,K104,K114, K105,K115,K117,K107 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, K066, K067, K068 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087, K088 }, \ + { K090, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { K110, KC_NO, K112, K113, K114, K115, K116, K117, K118 } \ +} + +/* 6U spacebar, 1U mods */ +#define LAYOUT_ansi_100u_mods( \ + K000,K010,K001,K011,K002,K012,K003,K013,K004,K014,K005,K015,K006, K007,K017,K008,K018, \ + K027,K016,K028,K038, \ + K020,K030,K021,K031,K022,K032,K023,K033,K024,K034,K025,K035,K026,K036,K047,K057,K048,K058, \ + K040,K050,K041,K051,K042,K052,K043,K053,K044,K054,K045,K055,K046,K056,K067,K077,K068,K078, \ + K060,K070,K061,K071,K062,K072,K063,K073,K064,K074,K065,K075, K076,K087,K097,K088,K098, \ + K080 ,K081,K091,K082,K092,K083,K093,K084,K094,K085,K095,K086,K096,K106,K116,K108,K118, \ + K100,K110,K101, K102, K112,K103,K113,K104,K114,K105,K115,K117,K107 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, KC_NO, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, K067, K068 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { K110, KC_NO, K112, K113, K114, K115, K116, K117, K118 } \ +} + +/* 7U spacebar, 1.5U mods */ +#define LAYOUT_ansi_150u_mods( \ + K000,K010,K001,K011,K002,K012,K003,K013,K004,K014,K005,K015,K006, K007,K017,K008,K018, \ + K027,K016,K028,K038, \ + K020,K030,K021,K031,K022,K032,K023,K033,K024,K034,K025,K035,K026,K036,K047,K057,K048,K058, \ + K040,K050,K041,K051,K042,K052,K043,K053,K044,K054,K045,K055,K046,K056,K067,K077,K068,K078, \ + K060,K070,K061,K071,K062,K072,K063,K073,K064,K074,K065,K075 ,K076,K087,K097,K088,K098, \ + K080 ,K081,K091,K082,K092,K083,K093,K084,K094,K085,K095,K086,K096,K106,K116,K108,K118, \ + K100, K101, K102, K103, K104,K114,K105,K115,K117,K107 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, KC_NO, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, K067, K068 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, K114, K115, K116, K117, K118 } \ +} diff --git a/keyboards/hineybush/hineyg80/info.json b/keyboards/hineybush/hineyg80/info.json new file mode 100644 index 00000000000..07498b9bbdd --- /dev/null +++ b/keyboards/hineybush/hineyg80/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "hineyg80", + "url": "", + "maintainer": "hineybush", + "width": 19.5, + "height": 7.25, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Pause", "x":15.5, "y":0}, {"label":"Insert", "x":16.5, "y":0}, {"label":"Home", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"Scroll Lock", "x":15.5, "y":1}, {"label":"Delete", "x":16.5, "y":1}, {"label":"End", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"~", "x":0, "y":2}, {"label":"!", "x":1, "y":2}, {"label":"@", "x":2, "y":2}, {"label":"#", "x":3, "y":2}, {"label":"$", "x":4, "y":2}, {"label":"%", "x":5, "y":2}, {"label":"^", "x":6, "y":2}, {"label":"&", "x":7, "y":2}, {"label":"*", "x":8, "y":2}, {"label":"(", "x":9, "y":2}, {"label":")", "x":10, "y":2}, {"label":"_", "x":11, "y":2}, {"label":"+", "x":12, "y":2}, {"label":"Bksp", "x":13, "y":2}, {"x":14, "y":2}, {"label":"Num Lock", "x":15.5, "y":2}, {"label":"/", "x":16.5, "y":2}, {"label":"*", "x":17.5, "y":2}, {"label":"-", "x":18.5, "y":2}, {"label":"Tab", "x":0, "y":3, "w":1.5}, {"label":"Q", "x":1.5, "y":3}, {"label":"W", "x":2.5, "y":3}, {"label":"E", "x":3.5, "y":3}, {"label":"R", "x":4.5, "y":3}, {"label":"T", "x":5.5, "y":3}, {"label":"Y", "x":6.5, "y":3}, {"label":"U", "x":7.5, "y":3}, {"label":"I", "x":8.5, "y":3}, {"label":"O", "x":9.5, "y":3}, {"label":"P", "x":10.5, "y":3}, {"label":"{", "x":11.5, "y":3}, {"label":"}", "x":12.5, "y":3}, {"label":"|", "x":13.5, "y":3, "w":1.5}, {"label":"7", "x":15.5, "y":3}, {"label":"8", "x":16.5, "y":3}, {"label":"9", "x":17.5, "y":3}, {"label":"+", "x":18.5, "y":3}, {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, {"label":"A", "x":1.75, "y":4}, {"label":"S", "x":2.75, "y":4}, {"label":"D", "x":3.75, "y":4}, {"label":"F", "x":4.75, "y":4}, {"label":"G", "x":5.75, "y":4}, {"label":"H", "x":6.75, "y":4}, {"label":"J", "x":7.75, "y":4}, {"label":"K", "x":8.75, "y":4}, {"label":"L", "x":9.75, "y":4}, {"label":":", "x":10.75, "y":4}, {"label":"\"", "x":11.75, "y":4}, {"x":12.75, "y":4}, {"label":"Enter", "x":13.75, "y":4, "w":1.25}, {"label":"4", "x":15.5, "y":4}, {"label":"5", "x":16.5, "y":4}, {"label":"6", "x":17.5, "y":4}, {"x":18.5, "y":4}, {"label":"Shift", "x":0, "y":5, "w":1.25}, {"x":1.25, "y":5}, {"label":"Z", "x":2.25, "y":5}, {"label":"X", "x":3.25, "y":5}, {"label":"C", "x":4.25, "y":5}, {"label":"V", "x":5.25, "y":5}, {"label":"B", "x":6.25, "y":5}, {"label":"N", "x":7.25, "y":5}, {"label":"M", "x":8.25, "y":5}, {"label":"<", "x":9.25, "y":5}, {"label":">", "x":10.25, "y":5}, {"label":"?", "x":11.25, "y":5}, {"label":"Shift", "x":12.25, "y":5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":5.25}, {"label":"1", "x":15.5, "y":5}, {"label":"2", "x":16.5, "y":5}, {"label":"3", "x":17.5, "y":5}, {"label":"Enter", "x":18.5, "y":5, "h":2}, {"label":"Ctrl", "x":0, "y":6}, {"label":"Win", "x":1, "y":6}, {"label":"Alt", "x":2, "y":6}, {"x":3, "y":6, "w":6}, {"label":"Alt", "x":9, "y":6}, {"label":"Win", "x":10, "y":6}, {"label":"Menu", "x":11, "y":6}, {"label":"Ctrl", "x":12, "y":6}, {"label":"\u2190", "x":13.25, "y":6.25}, {"label":"\u2193", "x":14.25, "y":6.25}, {"label":"\u2192", "x":15.25, "y":6.25}, {"label":"0", "x":16.5, "y":6}, {"label":".", "x":17.5, "y":6}] + }, + "LAYOUT_ansi_100u_mods": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Insert", "x":15.5, "y":0}, {"label":"Home", "x":16.5, "y":0}, {"label":"PgUp", "x":17.5, "y":0}, {"label":"Prt Sc", "x":18.5, "y":0}, {"label":"Delete", "x":15.5, "y":1}, {"label":"End", "x":16.5, "y":1}, {"label":"PgDn", "x":17.5, "y":1}, {"label":"Scroll", "x":18.5, "y":1}, {"label":"~", "x":0, "y":2}, {"label":"!", "x":1, "y":2}, {"label":"@", "x":2, "y":2}, {"label":"#", "x":3, "y":2}, {"label":"$", "x":4, "y":2}, {"label":"%", "x":5, "y":2}, {"label":"^", "x":6, "y":2}, {"label":"&", "x":7, "y":2}, {"label":"*", "x":8, "y":2}, {"label":"(", "x":9, "y":2}, {"label":")", "x":10, "y":2}, {"label":"_", "x":11, "y":2}, {"label":"+", "x":12, "y":2}, {"label":"Backspace", "x":13, "y":2, "w":2}, {"label":"Num Lock", "x":15.5, "y":2}, {"label":"/", "x":16.5, "y":2}, {"label":"*", "x":17.5, "y":2}, {"label":"Pause", "x":18.5, "y":2}, {"label":"Tab", "x":0, "y":3, "w":1.5}, {"label":"Q", "x":1.5, "y":3}, {"label":"W", "x":2.5, "y":3}, {"label":"E", "x":3.5, "y":3}, {"label":"R", "x":4.5, "y":3}, {"label":"T", "x":5.5, "y":3}, {"label":"Y", "x":6.5, "y":3}, {"label":"U", "x":7.5, "y":3}, {"label":"I", "x":8.5, "y":3}, {"label":"O", "x":9.5, "y":3}, {"label":"P", "x":10.5, "y":3}, {"label":"{", "x":11.5, "y":3}, {"label":"}", "x":12.5, "y":3}, {"label":"|", "x":13.5, "y":3, "w":1.5}, {"label":"7", "x":15.5, "y":3}, {"label":"8", "x":16.5, "y":3}, {"label":"9", "x":17.5, "y":3}, {"label":"-", "x":18.5, "y":3}, {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, {"label":"A", "x":1.75, "y":4}, {"label":"S", "x":2.75, "y":4}, {"label":"D", "x":3.75, "y":4}, {"label":"F", "x":4.75, "y":4}, {"label":"G", "x":5.75, "y":4}, {"label":"H", "x":6.75, "y":4}, {"label":"J", "x":7.75, "y":4}, {"label":"K", "x":8.75, "y":4}, {"label":"L", "x":9.75, "y":4}, {"label":":", "x":10.75, "y":4}, {"label":"\"", "x":11.75, "y":4}, {"label":"Enter", "x":12.75, "y":4, "w":2.25}, {"label":"4", "x":15.5, "y":4}, {"label":"5", "x":16.5, "y":4}, {"label":"6", "x":17.5, "y":4}, {"label":"+", "x":18.5, "y":4}, {"label":"Shift", "x":0, "y":5, "w":2.25}, {"label":"Z", "x":2.25, "y":5}, {"label":"X", "x":3.25, "y":5}, {"label":"C", "x":4.25, "y":5}, {"label":"V", "x":5.25, "y":5}, {"label":"B", "x":6.25, "y":5}, {"label":"N", "x":7.25, "y":5}, {"label":"M", "x":8.25, "y":5}, {"label":"<", "x":9.25, "y":5}, {"label":">", "x":10.25, "y":5}, {"label":"?", "x":11.25, "y":5}, {"label":"Shift", "x":12.25, "y":5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":5.25}, {"label":"1", "x":15.5, "y":5}, {"label":"2", "x":16.5, "y":5}, {"label":"3", "x":17.5, "y":5}, {"label":"Enter", "x":18.5, "y":5, "h":2}, {"label":"Ctrl", "x":0, "y":6}, {"label":"Win", "x":1, "y":6}, {"label":"Alt", "x":2, "y":6}, {"x":3, "y":6, "w":6}, {"label":"Alt", "x":9, "y":6}, {"label":"Win", "x":10, "y":6}, {"label":"Menu", "x":11, "y":6}, {"label":"Ctrl", "x":12, "y":6}, {"label":"\u2190", "x":13.25, "y":6.25}, {"label":"\u2193", "x":14.25, "y":6.25}, {"label":"\u2192", "x":15.25, "y":6.25}, {"label":"0", "x":16.5, "y":6}, {"label":".", "x":17.5, "y":6}] + }, + "LAYOUT_ansi_150u_mods": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Insert", "x":15.5, "y":0}, {"label":"Home", "x":16.5, "y":0}, {"label":"PgUp", "x":17.5, "y":0}, {"label":"Prt Sc", "x":18.5, "y":0}, {"label":"Delete", "x":15.5, "y":1}, {"label":"End", "x":16.5, "y":1}, {"label":"PgDn", "x":17.5, "y":1}, {"label":"Scroll", "x":18.5, "y":1}, {"label":"~", "x":0, "y":2}, {"label":"!", "x":1, "y":2}, {"label":"@", "x":2, "y":2}, {"label":"#", "x":3, "y":2}, {"label":"$", "x":4, "y":2}, {"label":"%", "x":5, "y":2}, {"label":"^", "x":6, "y":2}, {"label":"&", "x":7, "y":2}, {"label":"*", "x":8, "y":2}, {"label":"(", "x":9, "y":2}, {"label":")", "x":10, "y":2}, {"label":"_", "x":11, "y":2}, {"label":"+", "x":12, "y":2}, {"label":"Backspace", "x":13, "y":2, "w":2}, {"label":"Num Lock", "x":15.5, "y":2}, {"label":"/", "x":16.5, "y":2}, {"label":"*", "x":17.5, "y":2}, {"label":"Pause", "x":18.5, "y":2}, {"label":"Tab", "x":0, "y":3, "w":1.5}, {"label":"Q", "x":1.5, "y":3}, {"label":"W", "x":2.5, "y":3}, {"label":"E", "x":3.5, "y":3}, {"label":"R", "x":4.5, "y":3}, {"label":"T", "x":5.5, "y":3}, {"label":"Y", "x":6.5, "y":3}, {"label":"U", "x":7.5, "y":3}, {"label":"I", "x":8.5, "y":3}, {"label":"O", "x":9.5, "y":3}, {"label":"P", "x":10.5, "y":3}, {"label":"{", "x":11.5, "y":3}, {"label":"}", "x":12.5, "y":3}, {"label":"|", "x":13.5, "y":3, "w":1.5}, {"label":"7", "x":15.5, "y":3}, {"label":"8", "x":16.5, "y":3}, {"label":"9", "x":17.5, "y":3}, {"label":"-", "x":18.5, "y":3}, {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, {"label":"A", "x":1.75, "y":4}, {"label":"S", "x":2.75, "y":4}, {"label":"D", "x":3.75, "y":4}, {"label":"F", "x":4.75, "y":4}, {"label":"G", "x":5.75, "y":4}, {"label":"H", "x":6.75, "y":4}, {"label":"J", "x":7.75, "y":4}, {"label":"K", "x":8.75, "y":4}, {"label":"L", "x":9.75, "y":4}, {"label":":", "x":10.75, "y":4}, {"label":"\"", "x":11.75, "y":4}, {"label":"Enter", "x":12.75, "y":4, "w":2.25}, {"label":"4", "x":15.5, "y":4}, {"label":"5", "x":16.5, "y":4}, {"label":"6", "x":17.5, "y":4}, {"label":"+", "x":18.5, "y":4}, {"label":"Shift", "x":0, "y":5, "w":2.25}, {"label":"Z", "x":2.25, "y":5}, {"label":"X", "x":3.25, "y":5}, {"label":"C", "x":4.25, "y":5}, {"label":"V", "x":5.25, "y":5}, {"label":"B", "x":6.25, "y":5}, {"label":"N", "x":7.25, "y":5}, {"label":"M", "x":8.25, "y":5}, {"label":"<", "x":9.25, "y":5}, {"label":">", "x":10.25, "y":5}, {"label":"?", "x":11.25, "y":5}, {"label":"Shift", "x":12.25, "y":5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":5.25}, {"label":"1", "x":15.5, "y":5}, {"label":"2", "x":16.5, "y":5}, {"label":"3", "x":17.5, "y":5}, {"label":"Enter", "x":18.5, "y":5, "h":2}, {"label":"Ctrl", "x":0, "y":6, "w":1.5}, {"label":"Alt", "x":1.5, "y":6, "w":1.5}, {"x":3, "y":6, "w":7}, {"label":"Menu", "x":10, "y":6, "w":1.5}, {"label":"Ctrl", "x":11.5, "y":6, "w":1.5}, {"label":"\u2190", "x":13.25, "y":6.25}, {"label":"\u2193", "x":14.25, "y":6.25}, {"label":"\u2192", "x":15.25, "y":6.25}, {"label":"0", "x":16.5, "y":6}, {"label":".", "x":17.5, "y":6}] + } + } +} + diff --git a/keyboards/hineybush/hineyg80/keymaps/default/config.h b/keyboards/hineybush/hineyg80/keymaps/default/config.h new file mode 100644 index 00000000000..16e640d3060 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Josh Hinnebusch + * + * 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/hineybush/hineyg80/keymaps/default/keymap.c b/keyboards/hineybush/hineyg80/keymaps/default/keymap.c new file mode 100644 index 00000000000..13d0c895578 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/default/keymap.c @@ -0,0 +1,58 @@ +/* Copyright 2019 Josh Hinnebusch + * + * 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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi_100u_mods( /* Base */ + 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, 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_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_P4, KC_P5, KC_P6, KC_PPLS, + 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), + [1] = LAYOUT_ansi_100u_mods( /* Fn */KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, + KC_TRNS, KC_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, 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_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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/hineybush/hineyg80/keymaps/default/readme.md b/keyboards/hineybush/hineyg80/keymaps/default/readme.md new file mode 100644 index 00000000000..3e0d8343c7f --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for hineyg80 \ No newline at end of file diff --git a/keyboards/hineybush/hineyg80/keymaps/wkl/config.h b/keyboards/hineybush/hineyg80/keymaps/wkl/config.h new file mode 100644 index 00000000000..16e640d3060 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/wkl/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Josh Hinnebusch + * + * 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/hineybush/hineyg80/keymaps/wkl/keymap.c b/keyboards/hineybush/hineyg80/keymaps/wkl/keymap.c new file mode 100644 index 00000000000..a1255e9cc73 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/wkl/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2019 %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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL, + ______ = KC_TRNS, + XXXXXX = KC_NO +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi_150u_mods( /* Base */ + 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, 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_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_P4, KC_P5, KC_P6, KC_PPLS, + 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), + [1] = LAYOUT_ansi_150u_mods( /* Fn */______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, + ______, ______, ______, KC_VOLD, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_DEL, ______, ______, ______, ______, + ______, ______, ______, ______, RESET , ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/hineybush/hineyg80/keymaps/wkl/readme.md b/keyboards/hineybush/hineyg80/keymaps/wkl/readme.md new file mode 100644 index 00000000000..3e0d8343c7f --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/wkl/readme.md @@ -0,0 +1 @@ +# The default keymap for hineyg80 \ No newline at end of file diff --git a/keyboards/hineybush/hineyg80/readme.md b/keyboards/hineybush/hineyg80/readme.md new file mode 100644 index 00000000000..b305049d649 --- /dev/null +++ b/keyboards/hineybush/hineyg80/readme.md @@ -0,0 +1,16 @@ +# hineyg80 + + +A small-batch PCB design to be a drop-in replacement for G80-1800 and G81-1800 boards. + +Keyboard Maintainer: [hineybush](https://github.com/hineybush) + +Hardware Supported: hiney g80 rev 2 + +Hardware Availability: https://geekhack.org/index.php?topic=92389.0 + +Make example for this keyboard (after setting up your build environment): + + make hineybush/hineyg80:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/hineybush/hineyg80/rules.mk b/keyboards/hineybush/hineyg80/rules.mk new file mode 100644 index 00000000000..383a3594b47 --- /dev/null +++ b/keyboards/hineybush/hineyg80/rules.mk @@ -0,0 +1,81 @@ +# 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 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) From 50bc2dbe77e533959c4b8f821a31b489d25c7cb7 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Wed, 1 May 2019 07:48:33 -0500 Subject: [PATCH 069/129] Fixing incorrect usage of RGBLED_NUM in ws2812 driver when used with RGB Matrix (#5744) --- drivers/avr/ws2812.c | 2 +- quantum/rgb_matrix_drivers.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/avr/ws2812.c b/drivers/avr/ws2812.c index b3ed4fd0b0a..7c3cb5174df 100644 --- a/drivers/avr/ws2812.c +++ b/drivers/avr/ws2812.c @@ -158,7 +158,7 @@ void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b) void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b) { - for (int i = 0; i < RGBLED_NUM; i++) { + for (int i = 0; i < sizeof(led)/sizeof(led[0]); i++) { led[i].r = r; led[i].g = g; led[i].b = b; diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index 3814dd61fc9..1d64dc9093a 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c @@ -99,12 +99,12 @@ const rgb_matrix_driver_t rgb_matrix_driver = { #elif defined(WS2812) -extern LED_TYPE led[RGBLED_NUM]; +extern LED_TYPE led[DRIVER_LED_TOTAL]; static void flush( void ) { // Assumes use of RGB_DI_PIN - ws2812_setleds(led, RGBLED_NUM); + ws2812_setleds(led, DRIVER_LED_TOTAL); } static void init( void ) From 22ba36a4d86c06ce1b6049555525646eb16bb57a Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Wed, 1 May 2019 10:02:02 -0500 Subject: [PATCH 070/129] rgblight 255 hue (#5547) --- common_features.mk | 1 + docs/feature_rgblight.md | 2 +- .../v32u4/keymaps/dead_encryption/keymap.c | 2 +- quantum/rgblight.c | 200 +++++------------- quantum/rgblight.h | 27 +-- quantum/rgblight_list.h | 32 +-- 6 files changed, 84 insertions(+), 180 deletions(-) diff --git a/common_features.mk b/common_features.mk index 6dffe31ff8d..7c35f07d52c 100644 --- a/common_features.mk +++ b/common_features.mk @@ -105,6 +105,7 @@ endif ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h OPT_DEFS += -DRGBLIGHT_ENABLE + SRC += $(QUANTUM_DIR)/color.c SRC += $(QUANTUM_DIR)/rgblight.c CIE1931_CURVE = yes LED_BREATHING_TABLE = yes diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 48277373a51..8b0a45cb64c 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -145,7 +145,7 @@ const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; // These control which hues are selected for each of the "Static gradient" modes -const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; +const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64}; ``` ## Functions diff --git a/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c b/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c index 61386395a82..528bde8852a 100644 --- a/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c @@ -15,7 +15,7 @@ const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; // These control which colors are selected for the gradient mode -const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; +const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 2f23768ed7f..98755ff08bd 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -28,8 +28,10 @@ #include "progmem.h" #include "timer.h" #include "rgblight.h" +#include "color.h" #include "debug.h" #include "led_tables.h" +#include "lib/lib8tion/lib8tion.h" #ifdef VELOCIKEY_ENABLE #include "velocikey.h" #endif @@ -74,16 +76,13 @@ static inline int is_static_effect(uint8_t mode) { return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL; } -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) - #ifdef RGBLIGHT_LED_MAP const uint8_t led_map[] PROGMEM = RGBLIGHT_LED_MAP; #endif #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT __attribute__ ((weak)) -const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; +const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64}; #endif rgblight_config_t rgblight_config; @@ -109,59 +108,10 @@ void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds) { } -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { - uint8_t r = 0, g = 0, b = 0, base, color; - - if (val > RGBLIGHT_LIMIT_VAL) { - val=RGBLIGHT_LIMIT_VAL; // limit the val - } - - if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. - r = val; - g = val; - b = val; - } else { - base = ((255 - sat) * val) >> 8; - color = (val - base) * (hue % 60) / 60; - - switch (hue / 60) { - case 0: - r = val; - g = base + color; - b = base; - break; - case 1: - r = val - color; - g = val; - b = base; - break; - case 2: - r = base; - g = val; - b = base + color; - break; - case 3: - r = base; - g = val - color; - b = val; - break; - case 4: - r = base + color; - g = base; - b = val; - break; - case 5: - r = val; - g = base; - b = val - color; - break; - } - } - r = pgm_read_byte(&CIE1931_CURVE[r]); - g = pgm_read_byte(&CIE1931_CURVE[g]); - b = pgm_read_byte(&CIE1931_CURVE[b]); - - setrgb(r, g, b, led1); +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { + HSV hsv = { hue, sat, val > RGBLIGHT_LIMIT_VAL ? RGBLIGHT_LIMIT_VAL : val }; + RGB rgb = hsv_to_rgb(hsv); + setrgb(rgb.r, rgb.g, rgb.b, led1); } void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) { @@ -180,24 +130,9 @@ void rgblight_check_config(void) { rgblight_config.mode = RGBLIGHT_MODES; } - if (rgblight_config.hue < 0) { - rgblight_config.hue = 0; - } else if (rgblight_config.hue > 360) { - rgblight_config.hue %= 360; - } - - if (rgblight_config.sat < 0) { - rgblight_config.sat = 0; - } else if (rgblight_config.sat > 255) { - rgblight_config.sat = 255; - } - - if (rgblight_config.val < 0) { - rgblight_config.val = 0; - } else if (rgblight_config.val > RGBLIGHT_LIMIT_VAL) { + if (rgblight_config.val > RGBLIGHT_LIMIT_VAL) { rgblight_config.val = RGBLIGHT_LIMIT_VAL; } - } uint32_t eeconfig_read_rgblight(void) { @@ -220,7 +155,7 @@ void eeconfig_update_rgblight_default(void) { rgblight_config.enable = 1; rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; rgblight_config.hue = 0; - rgblight_config.sat = 255; + rgblight_config.sat = UINT8_MAX; rgblight_config.val = RGBLIGHT_LIMIT_VAL; rgblight_config.speed = 0; RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; @@ -442,23 +377,8 @@ void rgblight_disable_noeeprom(void) { rgblight_set(); } - -// Deals with the messy details of incrementing an integer -static uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { - int16_t new_value = value; - new_value += step; - return MIN( MAX( new_value, min ), max ); -} - -static uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { - int16_t new_value = value; - new_value -= step; - return MIN( MAX( new_value, min ), max ); -} - void rgblight_increase_hue_helper(bool write_to_eeprom) { - uint16_t hue; - hue = (rgblight_config.hue+RGBLIGHT_HUE_STEP) % 360; + uint8_t hue = rgblight_config.hue + RGBLIGHT_HUE_STEP; rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); } void rgblight_increase_hue_noeeprom(void) { @@ -468,12 +388,7 @@ void rgblight_increase_hue(void) { rgblight_increase_hue_helper(true); } void rgblight_decrease_hue_helper(bool write_to_eeprom) { - uint16_t hue; - if (rgblight_config.hue-RGBLIGHT_HUE_STEP < 0) { - hue = (rgblight_config.hue + 360 - RGBLIGHT_HUE_STEP) % 360; - } else { - hue = (rgblight_config.hue - RGBLIGHT_HUE_STEP) % 360; - } + uint8_t hue = rgblight_config.hue - RGBLIGHT_HUE_STEP; rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); } void rgblight_decrease_hue_noeeprom(void) { @@ -483,12 +398,7 @@ void rgblight_decrease_hue(void) { rgblight_decrease_hue_helper(true); } void rgblight_increase_sat_helper(bool write_to_eeprom) { - uint8_t sat; - if (rgblight_config.sat + RGBLIGHT_SAT_STEP > 255) { - sat = 255; - } else { - sat = rgblight_config.sat + RGBLIGHT_SAT_STEP; - } + uint8_t sat = qadd8(rgblight_config.sat, RGBLIGHT_SAT_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); } void rgblight_increase_sat_noeeprom(void) { @@ -498,12 +408,7 @@ void rgblight_increase_sat(void) { rgblight_increase_sat_helper(true); } void rgblight_decrease_sat_helper(bool write_to_eeprom) { - uint8_t sat; - if (rgblight_config.sat - RGBLIGHT_SAT_STEP < 0) { - sat = 0; - } else { - sat = rgblight_config.sat - RGBLIGHT_SAT_STEP; - } + uint8_t sat = qsub8(rgblight_config.sat, RGBLIGHT_SAT_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); } void rgblight_decrease_sat_noeeprom(void) { @@ -513,12 +418,7 @@ void rgblight_decrease_sat(void) { rgblight_decrease_sat_helper(true); } void rgblight_increase_val_helper(bool write_to_eeprom) { - uint8_t val; - if (rgblight_config.val + RGBLIGHT_VAL_STEP > RGBLIGHT_LIMIT_VAL) { - val = RGBLIGHT_LIMIT_VAL; - } else { - val = rgblight_config.val + RGBLIGHT_VAL_STEP; - } + uint8_t val = qadd8(rgblight_config.val, RGBLIGHT_VAL_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); } void rgblight_increase_val_noeeprom(void) { @@ -528,12 +428,7 @@ void rgblight_increase_val(void) { rgblight_increase_val_helper(true); } void rgblight_decrease_val_helper(bool write_to_eeprom) { - uint8_t val; - if (rgblight_config.val - RGBLIGHT_VAL_STEP < 0) { - val = 0; - } else { - val = rgblight_config.val - RGBLIGHT_VAL_STEP; - } + uint8_t val = qsub8(rgblight_config.val, RGBLIGHT_VAL_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); } void rgblight_decrease_val_noeeprom(void) { @@ -543,18 +438,20 @@ void rgblight_decrease_val(void) { rgblight_decrease_val_helper(true); } void rgblight_increase_speed(void) { - rgblight_config.speed = increment( rgblight_config.speed, 1, 0, 3 ); + if (rgblight_config.speed < 3) + rgblight_config.speed++; //RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED? eeconfig_update_rgblight(rgblight_config.raw);//EECONFIG needs to be increased to support this } void rgblight_decrease_speed(void) { - rgblight_config.speed = decrement( rgblight_config.speed, 1, 0, 3 ); + if (rgblight_config.speed > 0) + rgblight_config.speed--; //RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED?? eeconfig_update_rgblight(rgblight_config.raw);//EECONFIG needs to be increased to support this } -void rgblight_sethsv_noeeprom_old(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) { if (rgblight_config.enable) { LED_TYPE tmp_led; sethsv(hue, sat, val, &tmp_led); @@ -563,7 +460,7 @@ void rgblight_sethsv_noeeprom_old(uint16_t hue, uint8_t sat, uint8_t val) { } } -void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { +void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { if (rgblight_config.enable) { rgblight_status.base_mode = mode_base_table[rgblight_config.mode]; if (rgblight_config.mode == RGBLIGHT_MODE_STATIC_LIGHT) { @@ -596,13 +493,22 @@ void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT else if (rgblight_status.base_mode == RGBLIGHT_MODE_STATIC_GRADIENT) { // static gradient - uint16_t _hue; uint8_t delta = rgblight_config.mode - rgblight_status.base_mode; - int8_t direction = (delta % 2) ? -1 : 1; - uint16_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[delta / 2]); + bool direction = (delta % 2) == 0; +#ifdef __AVR__ + // probably due to how pgm_read_word is defined for ARM, but the ARM compiler really hates this line + uint8_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[delta / 2]); +#else + uint8_t range = RGBLED_GRADIENT_RANGES[delta / 2]; +#endif for (uint8_t i = 0; i < RGBLED_NUM; i++) { - _hue = (range / RGBLED_NUM * i * direction + hue + 360) % 360; - dprintf("rgblight rainbow set hsv: %u,%u,%d,%u\n", i, _hue, direction, range); + uint8_t _hue = ((uint16_t)i * (uint16_t)range) / RGBLED_NUM; + if (direction) { + _hue = hue + _hue; + } else { + _hue = hue - _hue; + } + dprintf("rgblight rainbow set hsv: %d,%d,%d,%u\n", i, _hue, direction, range); sethsv(_hue, sat, val, (LED_TYPE *)&led[i]); } rgblight_set(); @@ -628,15 +534,15 @@ void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool } } -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, true); } -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } -uint16_t rgblight_get_hue(void) { +uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } @@ -668,7 +574,7 @@ void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index) { rgblight_set(); } -void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index) { +void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index) { if (!rgblight_config.enable) { return; } LED_TYPE tmp_led; @@ -701,7 +607,7 @@ void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8 wait_ms(1); } -void rgblight_sethsv_range(uint16_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end) { +void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end) { if (!rgblight_config.enable) { return; } LED_TYPE tmp_led; @@ -717,11 +623,11 @@ void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, (uint8_t) RGBLED_NUM/2, (uint8_t) RGBLED_NUM); } -void rgblight_sethsv_master(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, 0, (uint8_t) RGBLED_NUM/2); } -void rgblight_sethsv_slave(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, (uint8_t) RGBLED_NUM/2, (uint8_t) RGBLED_NUM); } @@ -982,7 +888,7 @@ void rgblight_effect_breathing(animation_status_t *anim) { // http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/ val = (exp(sin((anim->pos/255.0)*M_PI)) - RGBLIGHT_EFFECT_BREATHE_CENTER/M_E)*(RGBLIGHT_EFFECT_BREATHE_MAX/(M_E-1/M_E)); rgblight_sethsv_noeeprom_old(rgblight_config.hue, rgblight_config.sat, val); - anim->pos = (anim->pos + 1) % 256; + anim->pos = (anim->pos + 1); } #endif @@ -992,36 +898,32 @@ const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; void rgblight_effect_rainbow_mood(animation_status_t *anim) { rgblight_sethsv_noeeprom_old(anim->current_hue, rgblight_config.sat, rgblight_config.val); - anim->current_hue = (anim->current_hue + 1) % 360; + anim->current_hue++; } #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL #ifndef RGBLIGHT_RAINBOW_SWIRL_RANGE - #define RGBLIGHT_RAINBOW_SWIRL_RANGE 360 + #define RGBLIGHT_RAINBOW_SWIRL_RANGE 255 #endif __attribute__ ((weak)) const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; void rgblight_effect_rainbow_swirl(animation_status_t *anim) { - uint16_t hue; + uint8_t hue; uint8_t i; for (i = 0; i < RGBLED_NUM; i++) { - hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / RGBLED_NUM * i + anim->current_hue) % 360; + hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / RGBLED_NUM * i + anim->current_hue); sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); } rgblight_set(); if (anim->delta % 2) { - anim->current_hue = (anim->current_hue + 1) % 360; + anim->current_hue++; } else { - if (anim->current_hue - 1 < 0) { - anim->current_hue = 359; - } else { - anim->current_hue = anim->current_hue - 1; - } + anim->current_hue--; } } #endif @@ -1146,12 +1048,12 @@ void rgblight_effect_knight(animation_status_t *anim) { #ifdef RGBLIGHT_EFFECT_CHRISTMAS void rgblight_effect_christmas(animation_status_t *anim) { - uint16_t hue; + uint8_t hue; uint8_t i; anim->current_offset = (anim->current_offset + 1) % 2; for (i = 0; i < RGBLED_NUM; i++) { - hue = 0 + ((i/RGBLIGHT_EFFECT_CHRISTMAS_STEP + anim->current_offset) % 2) * 120; + hue = 0 + ((i/RGBLIGHT_EFFECT_CHRISTMAS_STEP + anim->current_offset) % 2) * 85; sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); } rgblight_set(); diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 748d009dcf2..9ccb3135c59 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -113,7 +113,7 @@ enum RGBLIGHT_EFFECT_MODE { #endif #ifndef RGBLIGHT_HUE_STEP -#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_HUE_STEP 8 #endif #ifndef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 17 @@ -151,12 +151,13 @@ extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; extern bool is_rgblight_initialized; +// Should stay in sycn with rgb matrix config as we reuse eeprom storage for both (for now) typedef union { uint32_t raw; struct { bool enable :1; - uint8_t mode :6; - uint16_t hue :9; + uint8_t mode :7; + uint8_t hue :8; uint8_t sat :8; uint8_t val :8; uint8_t speed :8;//EECONFIG needs to be increased to support this @@ -211,19 +212,19 @@ void rgblight_increase_val(void); void rgblight_decrease_val(void); void rgblight_increase_speed(void); void rgblight_decrease_speed(void); -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); -uint16_t rgblight_get_hue(void); +void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val); +uint8_t rgblight_get_hue(void); uint8_t rgblight_get_sat(void); uint8_t rgblight_get_val(void); void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index); -void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index); +void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index); void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8_t end); -void rgblight_sethsv_range(uint16_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end); +void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end); void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b); void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b); -void rgblight_sethsv_master(uint16_t hue, uint8_t sat, uint8_t val); -void rgblight_sethsv_slave(uint16_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val); void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds); uint32_t eeconfig_read_rgblight(void); @@ -234,10 +235,10 @@ void eeconfig_debug_rgblight(void); void rgb_matrix_increase(void); void rgb_matrix_decrease(void); -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val); void rgblight_mode_noeeprom(uint8_t mode); void rgblight_toggle_noeeprom(void); void rgblight_enable_noeeprom(void); @@ -251,7 +252,7 @@ void rgblight_decrease_sat_noeeprom(void); void rgblight_increase_val_noeeprom(void); void rgblight_decrease_val_noeeprom(void); -void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); +void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); @@ -274,7 +275,7 @@ typedef struct _animation_status_t { union { uint16_t pos16; uint8_t pos; - int16_t current_hue; + int8_t current_hue; uint16_t current_offset; }; } animation_status_t; diff --git a/quantum/rgblight_list.h b/quantum/rgblight_list.h index e024364f056..702e33e7654 100644 --- a/quantum/rgblight_list.h +++ b/quantum/rgblight_list.h @@ -38,22 +38,22 @@ /* HSV COLORS */ #define HSV_WHITE 0, 0, 255 #define HSV_RED 0, 255, 255 -#define HSV_CORAL 16, 176, 255 -#define HSV_ORANGE 39, 255, 255 -#define HSV_GOLDENROD 43, 218, 218 -#define HSV_GOLD 51, 255, 255 -#define HSV_YELLOW 60, 255, 255 -#define HSV_CHARTREUSE 90, 255, 255 -#define HSV_GREEN 120, 255, 255 -#define HSV_SPRINGGREEN 150, 255, 255 -#define HSV_TURQUOISE 174, 90, 112 -#define HSV_TEAL 180, 255, 128 -#define HSV_CYAN 180, 255, 255 -#define HSV_AZURE 186, 102, 255 -#define HSV_BLUE 240, 255, 255 -#define HSV_PURPLE 270, 255, 255 -#define HSV_MAGENTA 300, 255, 255 -#define HSV_PINK 330, 128, 255 +#define HSV_CORAL 11, 176, 255 +#define HSV_ORANGE 28, 255, 255 +#define HSV_GOLDENROD 30, 218, 218 +#define HSV_GOLD 36, 255, 255 +#define HSV_YELLOW 43, 255, 255 +#define HSV_CHARTREUSE 64, 255, 255 +#define HSV_GREEN 85, 255, 255 +#define HSV_SPRINGGREEN 106, 255, 255 +#define HSV_TURQUOISE 123, 90, 112 +#define HSV_TEAL 128, 255, 128 +#define HSV_CYAN 128, 255, 255 +#define HSV_AZURE 132, 102, 255 +#define HSV_BLUE 170, 255, 255 +#define HSV_PURPLE 191, 255, 255 +#define HSV_MAGENTA 213, 255, 255 +#define HSV_PINK 234, 128, 255 /* From 3235c8527dd292d4a5e5e28302e118f3ef1a043e Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Wed, 1 May 2019 13:36:50 -0500 Subject: [PATCH 071/129] Simple fix for selecting which tracked key press to work off of for simple reactive effects (#5745) --- quantum/rgb_matrix_animations/solid_reactive_anim.h | 3 ++- quantum/rgb_matrix_animations/solid_reactive_simple_anim.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h index 836409dd60b..82483653aeb 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h @@ -15,7 +15,8 @@ bool rgb_matrix_solid_reactive(effect_params_t* params) { for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); uint16_t tick = max_tick; - for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { + // Reverse search to find most recent key hit + for (int8_t j = g_last_hit_tracker.count - 1; j >= 0; j--) { if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { tick = g_last_hit_tracker.tick[j]; break; diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h index d7bdb414ec1..9fc4d527a87 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h @@ -14,7 +14,8 @@ bool rgb_matrix_solid_reactive_simple(effect_params_t* params) { for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); uint16_t tick = max_tick; - for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { + // Reverse search to find most recent key hit + for (int8_t j = g_last_hit_tracker.count - 1; j >= 0; j--) { if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { tick = g_last_hit_tracker.tick[j]; break; From 12a07dae33aaa59b8172f13f25af74e0cf3b82cc Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Wed, 1 May 2019 20:59:01 -0500 Subject: [PATCH 072/129] Adjusted the linear led table and hsv_to_rgb to better handle 255 hue (#5739) * Adjusted the linear led table and hsv_to_rgb to better handle 255 hue * small math adjustments to better handle specific uint8_t rounding and overflows --- quantum/color.c | 9 +++++---- quantum/led_tables.c | 48 ++++++++++++++++++-------------------------- 2 files changed, 24 insertions(+), 33 deletions(-) diff --git a/quantum/color.c b/quantum/color.c index c49877592ec..466e6edacb0 100644 --- a/quantum/color.c +++ b/quantum/color.c @@ -22,8 +22,8 @@ RGB hsv_to_rgb( HSV hsv ) { RGB rgb; - uint8_t region, p, q, t; - uint16_t h, s, v, remainder; + uint8_t region, remainder, p, q, t; + uint16_t h, s, v; if ( hsv.s == 0 ) { @@ -37,8 +37,8 @@ RGB hsv_to_rgb( HSV hsv ) s = hsv.s; v = hsv.v; - region = h / 43; - remainder = (h - (region * 43)) * 6; + region = h * 6 / 255; + remainder = (h * 2 - region * 85) * 3; p = (v * (255 - s)) >> 8; q = (v * (255 - ((s * remainder) >> 8))) >> 8; @@ -46,6 +46,7 @@ RGB hsv_to_rgb( HSV hsv ) switch ( region ) { + case 6: case 0: rgb.r = v; rgb.g = t; diff --git a/quantum/led_tables.c b/quantum/led_tables.c index b99f262097f..0eeb5c44b60 100644 --- a/quantum/led_tables.c +++ b/quantum/led_tables.c @@ -19,38 +19,28 @@ along with this program. If not, see . #ifdef USE_CIE1931_CURVE // Lightness curve using the CIE 1931 lightness formula //Generated by the python script provided in http://jared.geek.nz/2013/feb/linear-led-pwm -const uint8_t CIE1931_CURVE[] PROGMEM = { - 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, - 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, - 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, - 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, - 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, - 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, - 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, - 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, - 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, - 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, - 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, - 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, - 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, - 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, - 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, - 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, - 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, - 242, 245, 247, 250, 252, 255, - }; +const uint8_t CIE1931_CURVE[256] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, + 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, + 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, + 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, + 25, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, + 35, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, + 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, + 79, 80, 82, 83, 84, 85, 87, 88, 89, 90, 92, 93, 94, 96, 97, 99, +100, 101, 103, 104, 106, 107, 108, 110, 111, 113, 114, 116, 118, 119, 121, 122, +124, 125, 127, 129, 130, 132, 134, 135, 137, 139, 141, 142, 144, 146, 148, 149, +151, 153, 155, 157, 159, 161, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, +182, 185, 187, 189, 191, 193, 195, 197, 200, 202, 204, 206, 208, 211, 213, 215, +218, 220, 222, 225, 227, 230, 232, 234, 237, 239, 242, 244, 247, 249, 252, 255 +}; #endif #ifdef USE_LED_BREATHING_TABLE -const uint8_t LED_BREATHING_TABLE[] PROGMEM = { +const uint8_t LED_BREATHING_TABLE[256] PROGMEM = { 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9, 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35, 37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76, From 6fa88d981c237f19839b2cc4ca4a0d44f84d2043 Mon Sep 17 00:00:00 2001 From: roguepullrequest Date: Wed, 1 May 2019 20:27:54 -0700 Subject: [PATCH 073/129] Roguepullrequest planck layout update (#5751) * First publish of roguepullreqest programmer dvorak planck layout * Removed junk line * Update keyboards/planck/keymaps/roguepullrequest/keymap.c Co-Authored-By: roguepullrequest * Update keyboards/planck/keymaps/roguepullrequest/keymap.c Co-Authored-By: roguepullrequest * Update keyboards/planck/keymaps/roguepullrequest/keymap.c Co-Authored-By: roguepullrequest * Update keyboards/planck/keymaps/roguepullrequest/keymap.c Co-Authored-By: roguepullrequest * Removed layer songs Removed layer songs for cleanliness. Will use them later. * Update keyboards/planck/keymaps/roguepullrequest/readme.md Co-Authored-By: roguepullrequest * Made basic LSHIFT framework but is not working. Listed other tapdances. * Got LSHIFT to work * Added working RSHIFT * Added working TD_S * Cleaned up LEFT and RIGHT [ { ] } on the UPPER layer. * Cleaned up layout. * Reenabled audio space is not needed right now. * Added tap dances and layout image * Started dactylmanuform layout * Revert "Started dactylmanuform layout" This reverts commit 5ef48e4a23de14db9b843d85d3250e1bf4426817. --- keyboards/planck/keymaps/roguepullrequest/keymap.c | 8 ++++++-- keyboards/planck/keymaps/roguepullrequest/readme.md | 13 +++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/roguepullrequest/keymap.c b/keyboards/planck/keymaps/roguepullrequest/keymap.c index 51c740dc4bc..177cb2b671f 100644 --- a/keyboards/planck/keymaps/roguepullrequest/keymap.c +++ b/keyboards/planck/keymaps/roguepullrequest/keymap.c @@ -4,6 +4,7 @@ float mushroom[][2] = SONG(MARIO_MUSHROOM); #endif + extern keymap_config_t keymap_config; // Complex Tapdance hoopla @@ -26,7 +27,8 @@ enum { X_AT_FUN = 0, RSHIFT, LSHIFT, - TD_S + TD_S, + SLASH }; int cur_dance (qk_tap_dance_state_t *state); @@ -110,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Programmer Dvorak */ [_PDVORAK] = LAYOUT_planck_grid( KC_GESC, KC_SCOLON, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_LAST, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, TD(TD_S), KC_SLASH, + KC_LAST, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, TD(TD_S), TD(SLASH), TD(LSHIFT), KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, TD(RSHIFT), TD(X_AT_FUN), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, ALT_TAB, KC_SPACE, KC_ENTER, MT(MOD_LCTL | MOD_LSFT, KC_LGUI), KC_PGUP, KC_PGDN, LT(_LOWER, KC_PLUS) ), @@ -245,6 +247,8 @@ qk_tap_dance_action_t tap_dance_actions[] = { [LSHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lshift_finished, lshift_reset), [RSHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rshift_finished, rshift_reset), [TD_S] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, s_finished, s_reset), + [SLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_BSLASH), + }; void shutdown_user(void) { clear_keyboard(); } diff --git a/keyboards/planck/keymaps/roguepullrequest/readme.md b/keyboards/planck/keymaps/roguepullrequest/readme.md index d3cae22fff0..687a65fc932 100644 --- a/keyboards/planck/keymaps/roguepullrequest/readme.md +++ b/keyboards/planck/keymaps/roguepullrequest/readme.md @@ -1,12 +1,17 @@ # Programmer Dvorak for the Planck (Light) -| Magic | | UPPER | -|----------|---------|-------| -| | DEFAULT | | -| FUNCTION | | LOWER | +| | | | | | | | | | | | | +|----------|---------|-------|-----|------|-------|-------|------|------|------|------|------| +| GRAVE_ESC | ; [u]; [l]7 | , [u]% [l]5 | . [l]3 | p [l]1 | y [u]= [l]9 | f [u]* [l]0 | g [l]2 | c [l]4 | r [u]! [l]6 | l [u]# [l]8 | BKSP | +| LCTRL [TD]!$ | a | o | e | u | i | d | h | t | n | s [TD]- _ | / [TD]\ | +| LSHFT [TD]( [ { | ' | q | j | k | x | b | m | w | v | z | LSHFT [TD]) ] } | +| @ [TD]UPPER FUN RESET | LEFT | DOWN | UP | RIGHT | ALT_TAB | SPACE | ENTER | LGUI | PGUP | PGDOWN | = [TD]LOWER | # Layout notes +- [u] = UPPER symbol +- [l] = LOWER symbol +- [TD] = Tap Dances - ALT_TAB = cycle through windows as long as you keep tapping it keeps alt tabbing - LAST = "!$" = is useful for using the last parm in bash/zsh - More to come From 588b2329cbe3b521475c62d5641c713430d8f188 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Wed, 1 May 2019 20:29:00 -0700 Subject: [PATCH 074/129] Wanleg tuneup / additions (#5752) * change split keyboard tapping term in userspace * fix 5x15 layout numpad movement * minor changes for Nori setup * edit based on 40percentclub refactor change * fix gherkin due to refactor * kbd6x wanleg keymap * kbd6x edits * kbd6x tweak * fn / backlight layer * fix jj40 rgb hex issue * wanleg gherkin lighting * 4x12 layout cleanup * move kbd6x to new kbdfans directory * minor edit related to new kbdfans directory * mac layout for kbd6x * gherkin flip option * tweak tapping term on lets_split * edit for keebio board coalescing * update user readme with git hints * wanleg miniaxe keymap * testing Permissive Hold instead of Mod Tap Interrupt * wiring names * kbd6x keymap * change default backlight behaviour on kbd6x * userspace underglow * userspace underglow * underglow tweaks * user readme update * more layer underglow tweaks * fix userspace for non-underglow-enabled boards * readme edits * readme edits * readme edits * readme edits * Update readme.md * Update readme.md * readme edits * readme edits * update keymap picture --- .../kbdfans/kbd6x/keymaps/wanleg/keymap.c | 82 +++++++++++ .../kbdfans/kbd6x/keymaps/wanleg/rules.mk | 3 + keyboards/miniaxe/keymaps/wanleg/config.h | 11 ++ keyboards/miniaxe/keymaps/wanleg/keymap.c | 49 +++++++ keyboards/miniaxe/keymaps/wanleg/rules.mk | 18 +++ layouts/community/ortho_3x10/wanleg/config.h | 19 ++- layouts/community/ortho_3x10/wanleg/keymap.c | 5 + layouts/community/ortho_3x10/wanleg/readme.md | 8 +- layouts/community/ortho_3x10/wanleg/rules.mk | 2 - layouts/community/ortho_4x12/wanleg/config.h | 7 + layouts/community/ortho_4x12/wanleg/keymap.c | 17 ++- layouts/community/ortho_4x12/wanleg/rules.mk | 5 + layouts/community/ortho_5x15/wanleg/keymap.c | 40 +++--- users/wanleg/config.h | 19 ++- users/wanleg/readme.md | 133 ++++++++++++++++-- users/wanleg/rules.mk | 6 + users/wanleg/wanleg.c | 41 +++++- users/wanleg/wanleg.h | 45 +++--- 18 files changed, 439 insertions(+), 71 deletions(-) create mode 100644 keyboards/kbdfans/kbd6x/keymaps/wanleg/keymap.c create mode 100644 keyboards/kbdfans/kbd6x/keymaps/wanleg/rules.mk create mode 100644 keyboards/miniaxe/keymaps/wanleg/config.h create mode 100644 keyboards/miniaxe/keymaps/wanleg/keymap.c create mode 100644 keyboards/miniaxe/keymaps/wanleg/rules.mk diff --git a/keyboards/kbdfans/kbd6x/keymaps/wanleg/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/wanleg/keymap.c new file mode 100644 index 00000000000..f3aa991f316 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/wanleg/keymap.c @@ -0,0 +1,82 @@ +/* Copyright 2018 wanleg + * + * 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 QMK_KEYBOARD_H +#include "wanleg.h" + + +#define LAYOUT_kbd6x_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + 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_DEL, \ + KC_TAB, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, KC_ENT, \ + KC_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, KC_LSFT, FUNCTION, \ + KC_LCTL, KC_LGUI, KC_LALT, LT(gDIR,KC_SPC), KC_RALT, KC_RGUI, KC_RCTL \ + ) +#define LAYOUT_kbd6x_base_wrapper(...) LAYOUT_kbd6x_base(__VA_ARGS__) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[gGK] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + _______________Gherkin_Row_2_______________ +), + +[gNUM] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________ +), + +[gDIR] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________ +), + +[gETC] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________ +), + +[_FN] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_FN_0________________, + _______________Gherkin_FN_1________________, + _______________Gherkin_FN_2________________ +), + +//mac layout +[_QW] = LAYOUT_wrapper( + 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_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_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, MO(ONE), + KC_LCTL, MO(ONE), KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, KC_RCTL + ), + +[ONE] = LAYOUT_wrapper( + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, BL_BRTG, BL_DEC, BL_INC, BL_TOGG, BL_STEP, BL_ON, KC_PGUP, KC_HOME, _______, _______, _______, _______, _______, + _______, RGB_M_B, RGB_VAD, RGB_VAI, RGB_TOG, RGB_MOD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, + _______, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, KC_PGDN, KC_END, _______, gGHERKIN,_______, _______, + _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/kbdfans/kbd6x/keymaps/wanleg/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/wanleg/rules.mk new file mode 100644 index 00000000000..92cc41e2129 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/wanleg/rules.mk @@ -0,0 +1,3 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) \ No newline at end of file diff --git a/keyboards/miniaxe/keymaps/wanleg/config.h b/keyboards/miniaxe/keymaps/wanleg/config.h new file mode 100644 index 00000000000..0f20ea455f0 --- /dev/null +++ b/keyboards/miniaxe/keymaps/wanleg/config.h @@ -0,0 +1,11 @@ +#pragma once + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +//#define QMK_ESC_OUTPUT F1 // usually COL +//#define QMK_ESC_INPUT D6 // usually ROW // connected to nothing on the miniaxe +//#define QMK_LED D7 //connected to nothing on the miniaxe diff --git a/keyboards/miniaxe/keymaps/wanleg/keymap.c b/keyboards/miniaxe/keymaps/wanleg/keymap.c new file mode 100644 index 00000000000..69233741ba5 --- /dev/null +++ b/keyboards/miniaxe/keymaps/wanleg/keymap.c @@ -0,0 +1,49 @@ +#include QMK_KEYBOARD_H +#include "wanleg.h" + +#define LAYOUT_miniaxe_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + _______, NUMBER, ETCETERA, KC_SPC, DIRECTION, KC_RGUI \ + ) +#define LAYOUT_miniaxe_base_wrapper(...) LAYOUT_miniaxe_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_GK] = LAYOUT_miniaxe_base_wrapper( + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + SFT_T(KC_Z), KC_X, KC_C, LT(NUM,KC_V), LT(ETC,KC_B), LT(_FN,KC_N), LT(DIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) +), + +[NUM] = LAYOUT_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________, + _______, _______, _______, KC_ENT, KC_RSFT, _______ +), + +[DIR] = LAYOUT_miniaxe_base_wrapper( + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________ +), + +[ETC] = LAYOUT_wrapper( + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________, + _______, NUMBER, ETCETERA, LALT(LCTL(KC_DEL)), DIRECTION, KC_RGUI +), + +[_FN] = LAYOUT_miniaxe_base_wrapper( + _______________Gherkin_FN_0________________, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; \ No newline at end of file diff --git a/keyboards/miniaxe/keymaps/wanleg/rules.mk b/keyboards/miniaxe/keymaps/wanleg/rules.mk new file mode 100644 index 00000000000..ae5ae549cc3 --- /dev/null +++ b/keyboards/miniaxe/keymaps/wanleg/rules.mk @@ -0,0 +1,18 @@ +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +#BOOTLOADER = qmk-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 \ No newline at end of file diff --git a/layouts/community/ortho_3x10/wanleg/config.h b/layouts/community/ortho_3x10/wanleg/config.h index 6719a4591eb..dc22454481e 100644 --- a/layouts/community/ortho_3x10/wanleg/config.h +++ b/layouts/community/ortho_3x10/wanleg/config.h @@ -2,8 +2,25 @@ //QMK DFU settings (ProMicro boards) // set top left key as bootloader mode escape key on Gherkin -#if defined(KEYBOARD_gherkin) +#if defined(KEYBOARD_40percentclub_gherkin) && !defined(FLIP) #define QMK_LED B0 #define QMK_ESC_OUTPUT B4 // usually COL #define QMK_ESC_INPUT F7 // usually ROW #endif + +//change gherkin orientation (i.e. move USB port from right side to left side) +#if defined(KEYBOARD_40percentclub_gherkin) && defined(FLIP) +//need to fix QMKdfu setting: +#define QMK_ESC_OUTPUT B6 // usually COL +#define QMK_ESC_INPUT D0 // usually ROW +#define QMK_LED B0 + +//need to undefine standard 4x4 array before defining alternate ProMicro array +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +//standard config: +//#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +//#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } +#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } +#define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } +#endif diff --git a/layouts/community/ortho_3x10/wanleg/keymap.c b/layouts/community/ortho_3x10/wanleg/keymap.c index 44be300a417..96d36eb3126 100644 --- a/layouts/community/ortho_3x10/wanleg/keymap.c +++ b/layouts/community/ortho_3x10/wanleg/keymap.c @@ -26,4 +26,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Gherkin_ETC_2_______________ ), +[_FN] = LAYOUT_ortho_3x10_wrapper( + _______________Gherkin_FN_0________________, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), }; diff --git a/layouts/community/ortho_3x10/wanleg/readme.md b/layouts/community/ortho_3x10/wanleg/readme.md index 8696cccf6bf..255e19c2a49 100644 --- a/layouts/community/ortho_3x10/wanleg/readme.md +++ b/layouts/community/ortho_3x10/wanleg/readme.md @@ -1,4 +1,4 @@ -![Gherkin Wanleg Layout Image](https://i.imgur.com/nCPog2W.png) +![Gherkin Wanleg Layout Image](https://i.imgur.com/iNkR90W.png) # Gherkin Wanleg Layout This is the layout I came up with to preserve a standard QWERTY 104 key ANSI layout as much as possible, in as few layers as possible for a 30 key board. Here are the two Tap Dance keys I've set up for this board: @@ -47,9 +47,9 @@ The instructions below have been adapted from https://www.reddit.com/r/olkb/comm | Arduino | ProMicro | | --- | --- | | 10 | RST | -| 11 | 16 | -| 12 | 14 | -| 13 | 15 | +| 11 (MOSI) | 16 | +| 12 (MISO) | 14 | +| 13 (SCK) | 15 | | GND | GND | | 5V | VCC | diff --git a/layouts/community/ortho_3x10/wanleg/rules.mk b/layouts/community/ortho_3x10/wanleg/rules.mk index 90841d2abed..efd11f7f80a 100644 --- a/layouts/community/ortho_3x10/wanleg/rules.mk +++ b/layouts/community/ortho_3x10/wanleg/rules.mk @@ -1,3 +1 @@ -SWAP_HANDS_ENABLE = no - BOOTLOADER = qmk-dfu \ No newline at end of file diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h index f7650ddd3a6..bcf2756f6bb 100644 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -20,6 +20,13 @@ #define EE_HANDS #endif +// set top left key as bootloader mode escape key on Nori +#if defined(KEYBOARD_40percentclub_nori) +#define QMK_LED B0 +#define QMK_ESC_OUTPUT F4 // usually COL +#define QMK_ESC_INPUT D3 // usually ROW +#endif + // set top left key as bootloader mode escape key on 4x4 48key layout #if defined(KEYBOARD_40percentclub_4x4) && !defined(PRO_MICRO) #define QMK_LED B0 diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c index 23e794dc411..bcf6671aedf 100644 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -21,7 +21,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _____________DIRECTIONS_Row__2_____________, _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -#elif defined(KEYBOARD_40percentclub_4x4) +#elif defined(KEYBOARD_40percentclub_4x4) || defined(KEYBOARD_40percentclub_nori) [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, _______________GherkinLike_1_______________, @@ -36,14 +36,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________NUMPAD_Row__3_______________ ), -#elif defined(KEYBOARD_jj40) -[_GK] = LAYOUT_ortho_4x12_wrapper( - _______________GherkinLike_0_______________, - _______________GherkinLike_1_______________, - _______________GherkinLike_2_______________, - TD(RST_TAP_DANCE), BL_TOGG, BL_STEP, BL_BRTG, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL -), - #else [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, @@ -94,4 +86,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______________ETCETERA_Row__3______________ ), +[_FN] = LAYOUT_ortho_4x12_wrapper( + _______, _______________Gherkin_FN_0________________, _______, + _______, _______________Gherkin_FN_0________________, _______, + _______, _______________Gherkin_FN_0________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + }; diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk index e8277610b6a..0b3917e98f6 100644 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -7,4 +7,9 @@ endif ifeq ($(strip $(KEYBOARD)), planck/rev6) AUDIO_ENABLE = yes +endif + +#disable RGB on version 1 of jj40 keyboard (does not exist) +ifeq ($(strip $(KEYBOARD)), jj40) + RGBLIGHT_ENABLE = no endif \ No newline at end of file diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c index a98f61988cf..ea4521d3d90 100644 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -11,7 +11,7 @@ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ ) \ LAYOUT_ortho_5x15_wrapper( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, QWERTY, GHERKIN, FUNCTION, \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, QWERTY, GHERKIN, FUNCTION, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, \ K00, K01, K02, K03, K04, K05, K0c, K0d, K0e, K06, K07, K08, K09, K0a, K0b, \ K10, K11, K12, K13, K14, K15, K1c, K1d, K1e, K16, K17, K18, K19, K1a, K1b, \ K20, K21, K22, K23, K24, K25, K2c, K2d, K2e, K26, K27, K28, K29, K2a, K2b, \ @@ -26,7 +26,7 @@ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ ) \ LAYOUT_ortho_5x15_wrapper( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, QWERTY, GHERKIN, FUNCTION, \ + QWERTY, GHERKIN, FUNCTION, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, \ K0c, K0d, K0e, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ K1c, K1d, K1e, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ K2c, K2d, K2e, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ @@ -110,7 +110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), #endif #else - /* Gherkin + /* Gherkin-Like * .--------------------------------------------------------------------------------------------------------------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | gherkin| FN | * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| @@ -190,7 +190,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ________________SUPRA_Row_3________________, _______, _______, _______ ), -/* Gherkin Numbers +/* Gherkin-Like Numbers * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -210,7 +210,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________NUMBERS_Row_3_______________, _______, _______, _______ ), -/* Gherkin Et Cetera +/* Gherkin-Like Et Cetera * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -230,7 +230,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______________ETCETERA_Row__3______________, _______, _______, _______ ), -/* Gherkin Directional Keys +/* Gherkin-Like Directional Keys * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -250,25 +250,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _____________DIRECTIONS_Row__3_____________, _______, _______, _______ ), - -/* FUNCTION +/* Gherkin FN/Lighting * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | | | WHEEL+ | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | RGB TG | RGB MD | RGB HI | RGB HD | RGB SI | RGB SD | RGB VI | RGB VD | BL TOG | BL INC | BL DEC | | | MOUS U | WHEEL- | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | MS BT1 | | | | | | MOUS L | MOUS D | MOUS R | + * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| + * | | | | | + * | |--------+--------+--------| + * | 4x12 FN/Lighting LAYOUT | | | | + * | |--------+--------+--------| + * | | | | | + * | |--------+--------+--------| + * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ + [_FN] = LAYOUT_75_base_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______, 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, _______, _______, KC_MS_U, KC_WH_D, - _______, _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R + _______, _______________Gherkin_FN_0________________, _______, _______, _______, _______, + _______, _______________Gherkin_FN_1________________, _______, _______, _______, _______, + _______, _______________Gherkin_FN_2________________, _______, _______, _______, _______, + _______, _________________BLANK_50__________________, _______, _______, _______, _______ ), }; diff --git a/users/wanleg/config.h b/users/wanleg/config.h index 0c8b048af7b..d29054694c8 100644 --- a/users/wanleg/config.h +++ b/users/wanleg/config.h @@ -6,9 +6,9 @@ //MIGHT HAVE TO SPLIT THIS INTO TWO CONDITIONS -#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) || defined(KEYBOARD_iris_rev2) +#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) || defined(KEYBOARD_keebio_iris_rev2) //Kailh Coppers activate quickly and don't need a long tapping term -#define TAPPING_TERM 100 +#define TAPPING_TERM 180 #elif defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_bigswitch) #define TAPPING_TERM 700 @@ -38,7 +38,14 @@ #define NO_ACTION_FUNCTION #define NO_ACTION_ONESHOT -// Disable mod tap interrrupt -#ifndef IGNORE_MOD_TAP_INTERRUPT -#define IGNORE_MOD_TAP_INTERRUPT -#endif // !mod tap interrrupt \ No newline at end of file + +#define PERMISSIVE_HOLD +//// Disable mod tap interrrupt +//#ifndef IGNORE_MOD_TAP_INTERRUPT +//#define IGNORE_MOD_TAP_INTERRUPT +//#endif // !mod tap interrrupt + +//set max breathing brightness on kbd6x +#if defined(KEYBOARD_kbdfans_kbd6x) +#define RGBLIGHT_EFFECT_BREATHE_MAX 128 // 0-255 +#endif diff --git a/users/wanleg/readme.md b/users/wanleg/readme.md index f687b92f48f..4276111280d 100644 --- a/users/wanleg/readme.md +++ b/users/wanleg/readme.md @@ -1,14 +1,125 @@ -Copyright 2018 Brian Fong @wanleg +# Contents + * [Git Basics](#git-basics) + * [Update a Feature Branch](#update-a-development-branch) + * [Delete Branch Locally and Remotely](#delete-branch-locally-and-remotely) + * [Merge TEST branch into DEV branch](#merge-test-branch-into-dev-branch) + * [STM32F103C8T6 Setup](#STM32F103C8T6-setup) + * [Bootloader](#bootloader) + * [Flashing QMK](#flashing-qmk) -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. +--- +## Git Basics +### Update a Development Branch -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. +This is how to update a working branch with upstream changes. +First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch) +```bash +$ git checkout master +``` -You should have received a copy of the GNU General Public License -along with this program. If not, see . +Fetch the remote, bringing the branches and their commits from the remote repository. +You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master +```bash +$ git fetch -p origin +``` + +Merge the changes from origin/master into your local master branch. This brings your master branch in sync with the remote repository, without losing your local changes. If your local branch didn't have any unique commits, Git will instead perform a "fast-forward". +```bash +$ git merge origin/master +``` + +Checkout the branch you want to merge into +```bash +$ git checkout +``` + +Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team. +```bash +$ git merge master +``` + +This will open your git-configured text editor. Edit the message as desired, save, and exit the editor. + +The above steps only update your local feature branch. To update it on GitHub, push your changes. +```bash +$ git push origin +``` + +### Delete Branch Locally and Remotely + +Executive Summary +```bash +$ git push --delete +$ git branch -d +``` +Note that in most cases the remote name is origin. + +Delete Local Branch +To delete the local branch use one of the following: +```bash +$ git branch -d branch_name +$ git branch -D branch_name +``` +Note: The -d option is an alias for --delete, which only deletes the branch if it has already been fully merged in its upstream branch. You could also use -D, which is an alias for --delete --force, which deletes the branch "irrespective of its merged status." [Source: man git-branch] + +Delete Remote Branch [Updated on 8-Sep-2017] +As of Git v1.7.0, you can delete a remote branch using +```bash +$ git push --delete +``` +which might be easier to remember than +```bash +$ git push : +``` +which was added in Git v1.5.0 "to delete a remote branch or a tag." + +Starting on Git v2.8.0 you can also use `git push` with the `-d` option as an alias for `--delete`. + +Therefore, the version of Git you have installed will dictate whether you need to use the easier or harder syntax. + +### Merge TEST branch into DEV branch + +Executive Summary +```bash +$ git checkout DEV +$ git merge TEST +$ git push DEV +$ git branch -d TEST +$ git push :TEST +``` +Note that in most cases the remote name is origin. +The above code will merge, push to remote, and delete both the local and remote TEST branches + +--- +## STM32F103C8T6 Setup +Cheap "Blue/Black Pills" typically do not come with a bootloader installed. The Black Pill uses [generic_boot20_pb12.bin](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/binaries/generic_boot20_pb12.bin). The Blue Pill uses [generic_boot20_pc13.bin](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/binaries/generic_boot20_pc13.bin). +The following instructions have been adapted from [here](http://wiki.stm32duino.com/index.php?title=Burning_the_bootloader). +### Bootloader +Flashing a bootloader on to a Black Pill can be done via a USB to Serial converter (e.g. CP2102). This process should be roughly the same for all F103 boards. + +1. Download the correct bootloader binary +2. Set the 'boot 0' pin/jumper high, and 'boot 1' low + B0+ to center pin + B1- to center pin +3. Connect the board to the PC using a USB to serial converter + RX to PA9 + TX to PA10 + GND to Ground + 3.3V to 3.3 Volts +4. Download and install __Flash Loader Demonstrator__ from [here](http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html) +5. Use __Flash Loader Demonstrator__ to flash the bootloader + Ensure the correct COM port is selected. Leave other options with their default values/selections. + Use the "Download to Device" option, with "Erase necessary pages" selected +6. After a successful flash, set 'boot 0' pin/jumper low + B0- to center pin + B1- to center pin (no change) + +### Flashing QMK +As of April 2019, the `:dfu-util` target doesn't work on a \*Pill. You will need to use dfu-util directly. +1. Use QMK to build your `.bin` +2. Run `dfu-util.exe -d 1eaf:0003 -a 2 -D YOUR_FIRMWARE.bin"` + If this is the first QMK flash on the \*Pill, you will need to synchronize your Reset Button-push with starting the command. By default, the \*Pill only stays in bootloader mode for about 3 seconds before returning to normal operation. + +See [this page](https://docs.qmk.fm/#/faq_build?id=unknown-device-for-dfu-bootloader) if Windows can't see anything to upload to. + +--- diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index b069cd8d387..eb66a49e6fa 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -36,4 +36,10 @@ ifeq ($(strip $(padc)), yes) endif ifeq ($(strip $(padl)), yes) OPT_DEFS += -DPADL +endif + +#change gherkin orientation (i.e. move USB port from right side to left side) +#example usage: make gherkin:wanleg flip=yes +ifeq ($(strip $(flip)), yes) + OPT_DEFS += -DFLIP endif \ No newline at end of file diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c index 274c74f728c..aa7b1c9a4c4 100644 --- a/users/wanleg/wanleg.c +++ b/users/wanleg/wanleg.c @@ -6,20 +6,30 @@ 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(_QW); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(0,0,128); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING); + #endif } return false; break; case GHERKIN: if (record->event.pressed) { set_single_persistent_default_layer(_GK); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(128,255,64); + #endif } return false; break; case gGHERKIN: if (record->event.pressed) { set_single_persistent_default_layer(gGK); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(128,255,128); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT); + #endif } return false; break; @@ -113,6 +123,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + //on RESET, underglow red if present + case RESET: + if (record->event.pressed) { + #if defined(RGBLIGHT_ENABLE) + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom_red(); + #endif + } + return true; // Let QMK send the press/release events as normal + break; } return true; } @@ -128,6 +149,7 @@ void matrix_init_keymap(void) {} // Call user matrix init, then call the keymap's init function void matrix_init_user(void) { +//turn off pro micro LEDs #if defined(KEYBOARD_lets_split_rev2) DDRD &= ~(1<<5); PORTD &= ~(1<<5); @@ -135,5 +157,20 @@ void matrix_init_user(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); #endif + +//disable backlight breathing for keyboard using random flashing RGB LEDs for backlight +//(breathing provides insufficient power to integrated LED IC) +#if defined(KEYBOARD_kbdfans_kbd6x) && defined(BACKLIGHT_BREATHING) + breathing_disable(); +#endif matrix_init_keymap(); -} \ No newline at end of file +} + +//at end of firmware startup process, change powerup default layer and underglow colour for kbd6x +void keyboard_post_init_user(void) { + #if defined(KEYBOARD_kbdfans_kbd6x) + set_single_persistent_default_layer(_QW); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 5); + rgblight_sethsv_noeeprom(0,0,128); + #endif +} diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 9d07760a7bd..2aea1a31e7e 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -3,7 +3,7 @@ #include "quantum.h" // Define layer names and order -#ifdef KEYBOARD_gherkin +#if defined(KEYBOARD_40percentclub_gherkin) || defined(KEYBOARD_kbdfans_kbd6x) enum userspace_layers { gGK = 0, gNUM, @@ -118,22 +118,22 @@ enum { // lengths consistent. -/* Pure Gherkin +/* Gherkin * .-----------------------------------------------------------------------------------------. * | Q//ESC | W | E | R | T | Y | U | I | O | P | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | A | S | D | F | G | H | J | K | L | SPACE | * | | | | | | | | | |SFThold | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Z | X | C | V/gNUM | B/gETC | N | M/gDIR | ,/GUI | ./ALT | BSPC | + * | Z | X | C | V/gNUM | B/gETC | N/Fn | M/gDIR | ,/GUI | ./ALT | BSPC | * | SFThold| | | | | | | | |CTRLhold| * '-----------------------------------------------------------------------------------------' */ #define _______________Gherkin_Row_0_______________ TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P #define _______________Gherkin_Row_1_______________ KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC) -#define _______________Gherkin_Row_2_______________ SFT_T(KC_Z), KC_X, KC_C, LT(gNUM,KC_V), LT(gETC,KC_B), KC_N, LT(gDIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) +#define _______________Gherkin_Row_2_______________ SFT_T(KC_Z), KC_X, KC_C, LT(gNUM,KC_V), LT(gETC,KC_B), LT(_FN,KC_N), LT(gDIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) -/* Directional Keys +/* Gherkin Directional Keys * .-----------------------------------------------------------------------------------------. * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -146,7 +146,7 @@ enum { #define _______________Gherkin_DIR_1_______________ KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC #define _______________Gherkin_DIR_2_______________ KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_LALT, KC_SLSH -/* Numbers +/* Gherkin Numbers * .-----------------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -160,16 +160,16 @@ enum { #define _______________Gherkin_NUM_1_______________ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 #define _______________Gherkin_NUM_2_______________ KC_F11, KC_F12, _______,_______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC) -/* Et Cetera +/* Gherkin Et Cetera * .-----------------------------------------------------------------------------------------. - * | ` | mUP | | | RESET | SHIFT | mScrDn | mScrUp | | \ | + * | ` | mUP | | ESC | RESET | SHIFT | mScrDn | mScrUp | | \ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | Sft//Cp| CAPS | | | | C-A-D | mScrL | mScrR | ALT | DEL | * '-----------------------------------------------------------------------------------------' */ -#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,_______, RESET, KC_RSFT, KC_WH_D, KC_WH_U, _______, KC_BSLS +#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,KC_ESC, RESET, KC_RSFT, KC_WH_D, KC_WH_U, _______, KC_BSLS #define _______________Gherkin_ETC_1_______________ KC_MS_L, KC_MS_D, KC_MS_R,_______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT #define _______________Gherkin_ETC_2_______________ TD(TD_SFT_CAPS),KC_CAPS, _______,_______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL @@ -180,7 +180,7 @@ enum { * | TAB | A | S | D | F | G | H | J | K | L | SPACE | ' | * | | | | | | | | | | |SFThold | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BSPC | ENT/SFT| + * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N/Fn | M/DIR | ,/GUI | ./ALT | BSPC | ENT/SFT| * | |SFThold | | | | | | | | |CTRLhold| | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | LCTRL | LGUI | ALT | ONEHAND| NUM | ETC | SPACE | DIR | RGUI | ALT | DEL | CTRL | @@ -188,7 +188,7 @@ enum { */ #define _______________GherkinLike_0_______________ KC_ESC, _______________Gherkin_Row_0_______________, KC_BSPC #define _______________GherkinLike_1_______________ KC_TAB, _______________Gherkin_Row_1_______________, KC_QUOT -#define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), 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), SFT_T(KC_ENT) +#define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V),LT(ETC, KC_B),LT(_FN,KC_N), LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT) #define _______________GherkinLike_3_______________ KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL #define _______________GherkinLike_3_OneHand_______ KC_LCTL, KC_LGUI, KC_LALT, ONEHAND, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, ONEHAND, KC_RCTL @@ -241,7 +241,7 @@ enum { #define _______________SUBTER_Row__2_______________ _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_RGUI,ALT_T(KC_DOT), CTL_T(KC_BSPC), _______ #define _______________SUBTER_Row__3_______________ _______, _______, GHERKIN, _______, _______, _______, KC_ENT, KC_LSFT, _______,_______, _______, _______ -/* Gherkin Numbers +/* Gherkin-Like Numbers * .-----------------------------------------------------------------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -259,7 +259,7 @@ enum { #define _______________NUMBERS_Row_3_______________ _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______, _______ -/* Gherkin Directional Keys +/* Gherkin-Like Directional Keys * .-----------------------------------------------------------------------------------------------------------. * | | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | DEL | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -275,9 +275,9 @@ enum { #define _____________DIRECTIONS_Row__2_____________ _______, _______________Gherkin_DIR_2_______________, _______ #define _____________DIRECTIONS_Row__3_____________ _______, _______, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, _______ -/* Gherkin Et Cetera +/* Gherkin-Like Et Cetera * .-----------------------------------------------------------------------------------------------------------. - * | | ` | mUP | | | RESET | SHIFT | mScrUp |mScrDown| | \ | DEL | + * | | ` | mUP | | | RESET | SHIFT | mScrDn | mScrUp | | \ | DEL | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -290,7 +290,7 @@ enum { #define ______________ETCETERA_Row__1______________ _______, _______________Gherkin_ETC_1_______________, _______ #define ______________ETCETERA_Row__2______________ _______, _______________Gherkin_ETC_2_______________, _______ #define ______________ETCETERA_Row__3______________ _______, _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______, _______ - + /* Single 4x4 board only * .-----------------------------------. * | 7 | 8 | 9 | BSPC | @@ -307,3 +307,16 @@ enum { #define _______________NUMPAD_Row__1_______________ KC_KP_4, KC_KP_5, KC_KP_6, KC_SPC #define _______________NUMPAD_Row__2_______________ KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT #define _______________NUMPAD_Row__3_______________ KC_KP_0, TD(LYR_TAP_DANCE), KC_KP_DOT, KC_PMNS + +/* Gherkin FN/Lighting + * .-----------------------------------------------------------------------------------------------------. + * | BL_breathe | BL_brite- | BL_brite+ | BL_toggle | BL_briteCyc | BL_briteMax | | | | | + * |------------+-----------+-----------+-----------+-------------+-------------+-----+-----+-----+------| + * | UG_breathe | UG_brite- | UG_brite+ | UG_toggle | UG_modeCycle| | | | | | + * |------------+-----------+-----------+-----------+-------------+-------------+-----+-----+-----+------| + * | UG_hue- | UG_hue+ | UG_sat- | UG_sat+ | | | | | |QWERTY| + * '-----------------------------------------------------------------------------------------------------' + */ +#define _______________Gherkin_FN_0________________ BL_BRTG, BL_DEC, BL_INC, BL_TOGG, BL_STEP, BL_ON, _______, _______, _______, _______ +#define _______________Gherkin_FN_1________________ RGB_M_B, RGB_VAD, RGB_VAI, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______ +#define _______________Gherkin_FN_2________________ RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, QWERTY From 7e68faa3361902458ef7d02e4ae156b2ed4e2303 Mon Sep 17 00:00:00 2001 From: zvecr Date: Thu, 2 May 2019 05:50:16 +0100 Subject: [PATCH 075/129] [Keyboard] Plaid - Add compatibility for LAYOUTS = planck_mit planck_grid (#5591) * Add compatibility for LAYOUTS = planck_mit planck_grid * Add compatibility for LAYOUTS = ortho_4x12 * Remove planck_grid community support from Plaid --- keyboards/plaid/plaid.h | 2 ++ keyboards/plaid/rules.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/plaid/plaid.h b/keyboards/plaid/plaid.h index 4ebdcea11f2..e680c077c2a 100644 --- a/keyboards/plaid/plaid.h +++ b/keyboards/plaid/plaid.h @@ -60,4 +60,6 @@ #define KEYMAP LAYOUT_plaid_grid #define LAYOUT_ortho_4x12 LAYOUT_plaid_grid +#define LAYOUT_planck_mit LAYOUT_plaid_mit +#define LAYOUT_kc_ortho_4x12 KC_KEYMAP #define KC_LAYOUT_ortho_4x12 KC_KEYMAP diff --git a/keyboards/plaid/rules.mk b/keyboards/plaid/rules.mk index 3d66334b301..507f873ae98 100644 --- a/keyboards/plaid/rules.mk +++ b/keyboards/plaid/rules.mk @@ -97,5 +97,5 @@ NO_UART = yes NO_SUSPEND_POWER_DOWN = yes -LAYOUTS = ortho_4x12 planck_mit planck_grid +LAYOUTS = ortho_4x12 planck_mit LAYOUTS_HAS_RGB = no From de5c8d86b432f0481f73602d978ac8f4249c3819 Mon Sep 17 00:00:00 2001 From: Naoto Takai Date: Thu, 2 May 2019 23:33:04 +0900 Subject: [PATCH 076/129] Add support for Nomu30 (#5759) --- keyboards/nomu30/config.h | 49 ++++++ keyboards/nomu30/info.json | 172 +++++++++++++++++++++ keyboards/nomu30/keymaps/default/config.h | 22 +++ keyboards/nomu30/keymaps/default/keymap.c | 44 ++++++ keyboards/nomu30/keymaps/default/readme.md | 1 + keyboards/nomu30/nomu30.c | 16 ++ keyboards/nomu30/nomu30.h | 48 ++++++ keyboards/nomu30/readme.md | 15 ++ keyboards/nomu30/rules.mk | 81 ++++++++++ 9 files changed, 448 insertions(+) create mode 100644 keyboards/nomu30/config.h create mode 100644 keyboards/nomu30/info.json create mode 100644 keyboards/nomu30/keymaps/default/config.h create mode 100644 keyboards/nomu30/keymaps/default/keymap.c create mode 100644 keyboards/nomu30/keymaps/default/readme.md create mode 100644 keyboards/nomu30/nomu30.c create mode 100644 keyboards/nomu30/nomu30.h create mode 100644 keyboards/nomu30/readme.md create mode 100644 keyboards/nomu30/rules.mk diff --git a/keyboards/nomu30/config.h b/keyboards/nomu30/config.h new file mode 100644 index 00000000000..13fae5af3aa --- /dev/null +++ b/keyboards/nomu30/config.h @@ -0,0 +1,49 @@ +/* +Copyright 2019 Naoto Takai + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC0C0 +#define PRODUCT_ID 0x3000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Naoto Takai +#define PRODUCT nomu30 +#define DESCRIPTION A 30% keyboard with ISO enter. + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 12 + +/* + * 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 { D1, D0, D4 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/nomu30/info.json b/keyboards/nomu30/info.json new file mode 100644 index 00000000000..d0c18601693 --- /dev/null +++ b/keyboards/nomu30/info.json @@ -0,0 +1,172 @@ +{ + "keyboard_name": "Nomu30", + "url": "https://keys.recompile.net/projects/nomu30/", + "maintainer": "takai", + "width": 11.5, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + { + "label": "Q", + "x": 0.5, + "y": 0 + }, + { + "label": "W", + "x": 1.5, + "y": 0 + }, + { + "label": "E", + "x": 2.5, + "y": 0 + }, + { + "label": "R", + "x": 3.5, + "y": 0 + }, + { + "label": "T", + "x": 4.5, + "y": 0 + }, + { + "label": "Y", + "x": 5.5, + "y": 0 + }, + { + "label": "U", + "x": 6.5, + "y": 0 + }, + { + "label": "I", + "x": 7.5, + "y": 0 + }, + { + "label": "O", + "x": 8.5, + "y": 0 + }, + { + "label": "P", + "x": 9.5, + "y": 0 + }, + { + "label": "Del", + "x": 10.5, + "y": 0 + }, + { + "label": "|", + "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": "H", + "x": 6, + "y": 1 + }, + { + "label": "J", + "x": 7, + "y": 1 + }, + { + "label": "K", + "x": 8, + "y": 1 + }, + { + "label": "L", + "x": 9, + "y": 1 + }, + { + "label": "Enter", + "x": 10.25, + "y": 1, + "w": 1.25, + "h": 2 + }, + { + "label": "Control", + "x": 0, + "y": 2, + "w": 1.5 + }, + { + "label": "Z", + "x": 1.5, + "y": 2 + }, + { + "label": "X", + "x": 2.5, + "y": 2 + }, + { + "label": "C", + "x": 3.5, + "y": 2 + }, + { + "label": "V", + "x": 4.5, + "y": 2 + }, + { + "label": "B", + "x": 5.5, + "y": 2 + }, + { + "label": "N", + "x": 6.5, + "y": 2 + }, + { + "label": "M", + "x": 7.5, + "y": 2 + }, + { + "label": "Shift", + "x": 8.5, + "y": 2, + "w": 1.75 + } + ] + } + } +} diff --git a/keyboards/nomu30/keymaps/default/config.h b/keyboards/nomu30/keymaps/default/config.h new file mode 100644 index 00000000000..fb21eed1bce --- /dev/null +++ b/keyboards/nomu30/keymaps/default/config.h @@ -0,0 +1,22 @@ +/* Copyright 2019 Naoto Takai + * + * 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 . + */ + +#pragma once + +// place overrides here + +#define TAPPING_TERM 200 +#define PERMISSIVE_HOLD diff --git a/keyboards/nomu30/keymaps/default/keymap.c b/keyboards/nomu30/keymaps/default/keymap.c new file mode 100644 index 00000000000..8878c3b1e85 --- /dev/null +++ b/keyboards/nomu30/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Naoto Takai + * + * 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 QMK_KEYBOARD_H + +#define _BASE 0 +#define _NUMS 1 +#define _SYMS 2 +#define _FUNC 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + 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_ENT, + KC_LSFT, LALT_T(KC_Z), LGUI_T(KC_X), KC_C, LT(_SYMS, KC_V), LT(_FUNC, KC_B), LT(_NUMS, KC_N), KC_M, KC_SPC + ), + [_NUMS] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, + KC_TRNS, KC_LBRC, KC_RBRC, KC_SLSH, KC_BSLS, KC_TRNS, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COMM, KC_DOT + ), + [_SYMS] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, + KC_TRNS, KC_LCBR, KC_RCBR, KC_QUES, KC_PIPE, KC_TRNS, KC_UNDS, KC_PLUS, KC_COLN, KC_DQUO, KC_TRNS, + KC_TRNS, KC_LABK, KC_RABK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_FUNC] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_TAB, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, RESET, + KC_TRNS, KC_LALT, KC_LGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/nomu30/keymaps/default/readme.md b/keyboards/nomu30/keymaps/default/readme.md new file mode 100644 index 00000000000..55bc4585010 --- /dev/null +++ b/keyboards/nomu30/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for nomu30 diff --git a/keyboards/nomu30/nomu30.c b/keyboards/nomu30/nomu30.c new file mode 100644 index 00000000000..37a8614c11b --- /dev/null +++ b/keyboards/nomu30/nomu30.c @@ -0,0 +1,16 @@ +/* Copyright 2019 Naoto Takai + * + * 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 "nomu30.h" diff --git a/keyboards/nomu30/nomu30.h b/keyboards/nomu30/nomu30.h new file mode 100644 index 00000000000..e6c553bec52 --- /dev/null +++ b/keyboards/nomu30/nomu30.h @@ -0,0 +1,48 @@ +/* Copyright 2019 Naoto Takai + * + * 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208 \ +) \ +{ \ + { KC_NO, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, KC_NO, KC_NO, KC_NO }, \ +} + +#define LAYOUT_kc( \ + K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208 \ +) \ +LAYOUT( \ + KC_##K001, KC_##K002, KC_##K003, KC_##K004, KC_##K005, KC_##K006, KC_##K007, KC_##K008, KC_##K009, KC_##K010, KC_##K011, \ + KC_##K100, KC_##K101, KC_##K102, KC_##K103, KC_##K104, KC_##K105, KC_##K106, KC_##K107, KC_##K108, KC_##K109, KC_##K110, \ + KC_##K200, KC_##K201, KC_##K202, KC_##K203, KC_##K204, KC_##K205, KC_##K206, KC_##K207, KC_##K208 \ +) diff --git a/keyboards/nomu30/readme.md b/keyboards/nomu30/readme.md new file mode 100644 index 00000000000..95577164a11 --- /dev/null +++ b/keyboards/nomu30/readme.md @@ -0,0 +1,15 @@ +# nomu30 + +![nomu30](https://keys.recompile.net/images/nomu30-main@600w.jpg) + +A 30% keyboard with ISO enter. + +Keyboard Maintainer: [Naoto Takai](https://github.com/takai) +Hardware Supported: The Nomu30 PCBs, ProMicro supported +Hardware Availability: https://keys.recompile.net/projects/nomu30/ + +Make example for this keyboard (after setting up your build environment): + + make nomu30:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/nomu30/rules.mk b/keyboards/nomu30/rules.mk new file mode 100644 index 00000000000..d4785aabbea --- /dev/null +++ b/keyboards/nomu30/rules.mk @@ -0,0 +1,81 @@ +# 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 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 = 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 +# 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 +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) From 3956b7c685e2501ccb6c8dd22081031986688f26 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Thu, 2 May 2019 23:37:37 +0900 Subject: [PATCH 077/129] add '#define USE_SERIAL' to keyboards/mint60/config.h (#5758) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If there is no '#define USE_SERIAL', qmk configurator will give an error, so add '#define USE_SERIAL' to `mint60/config.h`。 --- keyboards/mint60/config.h | 2 ++ keyboards/mint60/keymaps/default/config.h | 2 +- keyboards/mint60/keymaps/eucalyn/config.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/keyboards/mint60/config.h b/keyboards/mint60/config.h index eda933d3ad2..35449eb2619 100644 --- a/keyboards/mint60/config.h +++ b/keyboards/mint60/config.h @@ -31,6 +31,8 @@ along with this program. If not, see . #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 +#define USE_SERIAL + /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 diff --git a/keyboards/mint60/keymaps/default/config.h b/keyboards/mint60/keymaps/default/config.h index 0195c61dffb..9af2f45cfb4 100644 --- a/keyboards/mint60/keymaps/default/config.h +++ b/keyboards/mint60/keymaps/default/config.h @@ -17,7 +17,7 @@ #pragma once /* Use I2C or Serial, not both */ -#define USE_SERIAL +// #define USE_SERIAL // #define USE_I2C // #define MASTER_RIGHT diff --git a/keyboards/mint60/keymaps/eucalyn/config.h b/keyboards/mint60/keymaps/eucalyn/config.h index 0195c61dffb..9af2f45cfb4 100644 --- a/keyboards/mint60/keymaps/eucalyn/config.h +++ b/keyboards/mint60/keymaps/eucalyn/config.h @@ -17,7 +17,7 @@ #pragma once /* Use I2C or Serial, not both */ -#define USE_SERIAL +// #define USE_SERIAL // #define USE_I2C // #define MASTER_RIGHT From 4db31fb374d365bfa0f5c8a25d089bb2f967352f Mon Sep 17 00:00:00 2001 From: yynmt <45400583+yynmt@users.noreply.github.com> Date: Thu, 2 May 2019 23:55:55 +0900 Subject: [PATCH 078/129] Add new keyboard KagaMidget (#5755) * Add KagaMidget keyboard * Update readme.md --- keyboards/kagamidget/config.h | 222 ++++++++++++++++++ keyboards/kagamidget/info.json | 18 ++ keyboards/kagamidget/kagamidget.c | 43 ++++ keyboards/kagamidget/kagamidget.h | 39 +++ keyboards/kagamidget/keymaps/default/config.h | 19 ++ keyboards/kagamidget/keymaps/default/keymap.c | 118 ++++++++++ .../kagamidget/keymaps/default/readme.md | 49 ++++ keyboards/kagamidget/readme.md | 14 ++ keyboards/kagamidget/rules.mk | 83 +++++++ 9 files changed, 605 insertions(+) create mode 100644 keyboards/kagamidget/config.h create mode 100644 keyboards/kagamidget/info.json create mode 100644 keyboards/kagamidget/kagamidget.c create mode 100644 keyboards/kagamidget/kagamidget.h create mode 100644 keyboards/kagamidget/keymaps/default/config.h create mode 100644 keyboards/kagamidget/keymaps/default/keymap.c create mode 100644 keyboards/kagamidget/keymaps/default/readme.md create mode 100644 keyboards/kagamidget/readme.md create mode 100644 keyboards/kagamidget/rules.mk diff --git a/keyboards/kagamidget/config.h b/keyboards/kagamidget/config.h new file mode 100644 index 00000000000..fc9463aee01 --- /dev/null +++ b/keyboards/kagamidget/config.h @@ -0,0 +1,222 @@ +/* +Copyright 2019 yynmt + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER yynmt +#define PRODUCT KagaMidget +#define DESCRIPTION 48 keys tiny keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * 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 { D1, D0, F4, F5 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + + +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 4 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +/* 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 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/kagamidget/info.json b/keyboards/kagamidget/info.json new file mode 100644 index 00000000000..a9e0dd1b8fe --- /dev/null +++ b/keyboards/kagamidget/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "KagaMidget", + "url": "http://yynmt.com", + "maintainer": "yynmt", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 48, + "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":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":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3} + ] + } + } +} diff --git a/keyboards/kagamidget/kagamidget.c b/keyboards/kagamidget/kagamidget.c new file mode 100644 index 00000000000..1f790c9e777 --- /dev/null +++ b/keyboards/kagamidget/kagamidget.c @@ -0,0 +1,43 @@ +/* Copyright 2019 yynmt + * + * 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 "kagamidget.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/kagamidget/kagamidget.h b/keyboards/kagamidget/kagamidget.h new file mode 100644 index 00000000000..e0655a4e989 --- /dev/null +++ b/keyboards/kagamidget/kagamidget.h @@ -0,0 +1,39 @@ +/* Copyright 2019 yynmt + * + * 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K01, K05, K09, K13, K17, K21, K25, K29, K33, K37, K41, K45, \ + K02, K06, K10, K14, K18, K22, K26, K30, K34, K38, K42, K46, \ + K03, K07, K11, K15, K19, K23, K27, K31, K35, K39, K43, K47, \ + K04, K08, K12, K16, K20, K24, K28, K32, K36, K40, K44, K48 \ +) \ +{ \ + { K01, K05, K09, K13, K17, K21, K25, K29, K33, K37, K41, K45 }, \ + { K02, K06, K10, K14, K18, K22, K26, K30, K34, K38, K42, K46 }, \ + { K03, K07, K11, K15, K19, K23, K27, K31, K35, K39, K43, K47 }, \ + { K04, K08, K12, K16, K20, K24, K28, K32, K36, K40, K44, K48 }, \ +} diff --git a/keyboards/kagamidget/keymaps/default/config.h b/keyboards/kagamidget/keymaps/default/config.h new file mode 100644 index 00000000000..bab59c67e07 --- /dev/null +++ b/keyboards/kagamidget/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 yynmt + * + * 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kagamidget/keymaps/default/keymap.c b/keyboards/kagamidget/keymaps/default/keymap.c new file mode 100644 index 00000000000..3d9a9547008 --- /dev/null +++ b/keyboards/kagamidget/keymaps/default/keymap.c @@ -0,0 +1,118 @@ +/* Copyright 2019 yynmt + * + * 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 QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + 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_RSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug|RGBTog|RGBMod|RGBHuI|RGBHuD|RGBSaI|RGBSaD|RGBVaI|RGBVaD| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kagamidget/keymaps/default/readme.md b/keyboards/kagamidget/keymaps/default/readme.md new file mode 100644 index 00000000000..9ce02fb09d3 --- /dev/null +++ b/keyboards/kagamidget/keymaps/default/readme.md @@ -0,0 +1,49 @@ +# The default keymap for KagaMidget +## 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 | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` +## Lower +``` +,-----------------------------------------------------------------------------------. +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------------------------------------------------' + ``` +## 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 | +`-----------------------------------------------------------------------------------' +``` +## Adjust (Lower + Raise) +``` +,-----------------------------------------------------------------------------------. +| | Reset| Debug|RGBTog|RGBMod|RGBHuI|RGBHuD|RGBSaI|RGBSaD|RGBVaI|RGBVaD| Del | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/kagamidget/readme.md b/keyboards/kagamidget/readme.md new file mode 100644 index 00000000000..af38fdd8589 --- /dev/null +++ b/keyboards/kagamidget/readme.md @@ -0,0 +1,14 @@ +# KagaMidget + +![KagaMidget](https://raw.githubusercontent.com/yynmt/KagaMidget/master/images/main_image.jpg) + +KagaMidget is 40% tiny keyboard. + +Keyboard Maintainer: [yynmt](https://github.com/yynmt) +Hardware Supported: KagaMidget PCBs, ProMicro supported + +Make example for this keyboard (after setting up your build environment): + + make kagamidget:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kagamidget/rules.mk b/keyboards/kagamidget/rules.mk new file mode 100644 index 00000000000..50608d9857c --- /dev/null +++ b/keyboards/kagamidget/rules.mk @@ -0,0 +1,83 @@ +# 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 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 = no # 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 +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +RGBLIGHT_ENABLE = yes \ No newline at end of file From 3da8d46a07167fc862e90b6bb232812d5cb64651 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Thu, 2 May 2019 23:59:29 +0900 Subject: [PATCH 079/129] If RGBLIGHT_EFFECT_BREATHE_CENTER is undefined, use fixed breathe table instead of exp() and sin() (#5484) * If RGBLIGHT_EFFECT_BREATHE_CENTER is undefined, use fixed breathe table instead of exp() and sin() * Change rgblight breathing table size to be easily selectable. add RGBLIGHT_BREATHE_TABLE_SIZE macro for customize breathing effect. --- docs/feature_rgblight.md | 2 +- quantum/rgblight.c | 12 +++ quantum/rgblight.h | 4 +- quantum/rgblight_breathe_table.h | 116 +++++++++++++++++++++++++++ quantum/template/avr/config.h | 6 ++ util/rgblight_breathing_table_calc.c | 49 +++++++++++ 6 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 quantum/rgblight_breathe_table.h create mode 100644 util/rgblight_breathing_table_calc.c diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 8b0a45cb64c..4572f45b26c 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -114,7 +114,7 @@ The following options can be used to tweak the various animations: |`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|If defined, enable RGB test animation mode. | |`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|If defined, enable alternating animation mode. | |`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables all additional animation modes | -|`RGBLIGHT_EFFECT_BREATHE_CENTER` |`1.85` |Used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 | +|`RGBLIGHT_EFFECT_BREATHE_CENTER` |*Not defined*|If defined, used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 | |`RGBLIGHT_EFFECT_BREATHE_MAX` |`255` |The maximum brightness for the breathing mode. Valid values are 1 to 255 | |`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation | |`RGBLIGHT_EFFECT_KNIGHT_LENGTH` |`3` |The number of LEDs to light up for the "Knight" animation | diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 98755ff08bd..77772e2925f 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -879,6 +879,14 @@ void rgblight_task(void) { // Effects #ifdef RGBLIGHT_EFFECT_BREATHING + +#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER + #ifndef RGBLIGHT_BREATHE_TABLE_SIZE + #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256 or 128 or 64 + #endif + #include +#endif + __attribute__ ((weak)) const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; @@ -886,7 +894,11 @@ void rgblight_effect_breathing(animation_status_t *anim) { float val; // http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/ +#ifdef RGBLIGHT_EFFECT_BREATHE_TABLE + val = pgm_read_byte(&rgblight_effect_breathe_table[anim->pos / table_scale]); +#else val = (exp(sin((anim->pos/255.0)*M_PI)) - RGBLIGHT_EFFECT_BREATHE_CENTER/M_E)*(RGBLIGHT_EFFECT_BREATHE_MAX/(M_E-1/M_E)); +#endif rgblight_sethsv_noeeprom_old(rgblight_config.hue, rgblight_config.sat, val); anim->pos = (anim->pos + 1); } diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 9ccb3135c59..35d7942ca69 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -80,9 +80,7 @@ enum RGBLIGHT_EFFECT_MODE { #define RGBLIGHT_MODES (RGBLIGHT_MODE_last-1) -#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1-2.7 -#endif +// sample: #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 #ifndef RGBLIGHT_EFFECT_BREATHE_MAX #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255 diff --git a/quantum/rgblight_breathe_table.h b/quantum/rgblight_breathe_table.h new file mode 100644 index 00000000000..7ab8cc9479a --- /dev/null +++ b/quantum/rgblight_breathe_table.h @@ -0,0 +1,116 @@ +#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE +#define RGBLIGHT_EFFECT_BREATHE_TABLE + +const uint8_t rgblight_effect_breathe_table[] PROGMEM = { + /* #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 */ + /* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 + 0x22, 0x23, 0x25, 0x26, 0x28, 0x29, 0x2a, 0x2c, + 0x2d, 0x2f, 0x30, 0x32, 0x33, 0x35, 0x36, 0x38, + 0x3a, 0x3b, 0x3d, 0x3e, 0x40, 0x42, 0x43, 0x45, + 0x47, 0x49, 0x4a, 0x4c, 0x4e, 0x50, 0x51, 0x53, + 0x55, 0x57, 0x59, 0x5a, 0x5c, 0x5e, 0x60, 0x62, + 0x64, 0x66, 0x68, 0x69, 0x6b, 0x6d, 0x6f, 0x71, + 0x73, 0x75, 0x77, 0x79, 0x7b, 0x7d, 0x7f, 0x81, + 0x83, 0x85, 0x87, 0x89, 0x8a, 0x8c, 0x8e, 0x90, + 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0x9f, + 0xa1, 0xa3, 0xa5, 0xa7, 0xa8, 0xaa, 0xac, 0xae, + 0xaf, 0xb1, 0xb3, 0xb4, 0xb6, 0xb8, 0xb9, 0xbb, + 0xbc, 0xbe, 0xbf, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, + 0xc7, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xd0, + 0xd1, 0xd2, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd7, 0xd8, 0xd9, 0xd9, 0xda, 0xda, 0xdb, 0xdb, + 0xdb, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdb, + 0xdb, 0xdb, 0xda, 0xda, 0xd9, 0xd9, 0xd8, 0xd7, + 0xd7, 0xd6, 0xd5, 0xd4, 0xd3, 0xd2, 0xd2, 0xd1, + 0xd0, 0xce, 0xcd, 0xcc, 0xcb, 0xca, 0xc9, 0xc7, + 0xc6, 0xc5, 0xc3, 0xc2, 0xc1, 0xbf, 0xbe, 0xbc, + 0xbb, 0xb9, 0xb8, 0xb6, 0xb4, 0xb3, 0xb1, 0xaf, + 0xae, 0xac, 0xaa, 0xa8, 0xa7, 0xa5, 0xa3, 0xa1, + 0x9f, 0x9e, 0x9c, 0x9a, 0x98, 0x96, 0x94, 0x92, + 0x90, 0x8e, 0x8c, 0x8a, 0x89, 0x87, 0x85, 0x83, + 0x81, 0x7f, 0x7d, 0x7b, 0x79, 0x77, 0x75, 0x73, + 0x71, 0x6f, 0x6d, 0x6b, 0x69, 0x68, 0x66, 0x64, + 0x62, 0x60, 0x5e, 0x5c, 0x5a, 0x59, 0x57, 0x55, + 0x53, 0x51, 0x50, 0x4e, 0x4c, 0x4a, 0x49, 0x47, + 0x45, 0x43, 0x42, 0x40, 0x3e, 0x3d, 0x3b, 0x3a, + 0x38, 0x36, 0x35, 0x33, 0x32, 0x30, 0x2f, 0x2d, + 0x2c, 0x2a, 0x29, 0x28, 0x26, 0x25, 0x23, 0x22 + #endif /* 256 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 128 + 0x22, 0x25, 0x28, 0x2a, + 0x2d, 0x30, 0x33, 0x36, + 0x3a, 0x3d, 0x40, 0x43, + 0x47, 0x4a, 0x4e, 0x51, + 0x55, 0x59, 0x5c, 0x60, + 0x64, 0x68, 0x6b, 0x6f, + 0x73, 0x77, 0x7b, 0x7f, + 0x83, 0x87, 0x8a, 0x8e, + 0x92, 0x96, 0x9a, 0x9e, + 0xa1, 0xa5, 0xa8, 0xac, + 0xaf, 0xb3, 0xb6, 0xb9, + 0xbc, 0xbf, 0xc2, 0xc5, + 0xc7, 0xca, 0xcc, 0xce, + 0xd1, 0xd2, 0xd4, 0xd6, + 0xd7, 0xd9, 0xda, 0xdb, + 0xdb, 0xdc, 0xdc, 0xdd, + 0xdd, 0xdc, 0xdc, 0xdc, + 0xdb, 0xda, 0xd9, 0xd8, + 0xd7, 0xd5, 0xd3, 0xd2, + 0xd0, 0xcd, 0xcb, 0xc9, + 0xc6, 0xc3, 0xc1, 0xbe, + 0xbb, 0xb8, 0xb4, 0xb1, + 0xae, 0xaa, 0xa7, 0xa3, + 0x9f, 0x9c, 0x98, 0x94, + 0x90, 0x8c, 0x89, 0x85, + 0x81, 0x7d, 0x79, 0x75, + 0x71, 0x6d, 0x69, 0x66, + 0x62, 0x5e, 0x5a, 0x57, + 0x53, 0x50, 0x4c, 0x49, + 0x45, 0x42, 0x3e, 0x3b, + 0x38, 0x35, 0x32, 0x2f, + 0x2c, 0x29, 0x26, 0x23 + #endif /* 128 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 64 + 0x22, 0x28, + 0x2d, 0x33, + 0x3a, 0x40, + 0x47, 0x4e, + 0x55, 0x5c, + 0x64, 0x6b, + 0x73, 0x7b, + 0x83, 0x8a, + 0x92, 0x9a, + 0xa1, 0xa8, + 0xaf, 0xb6, + 0xbc, 0xc2, + 0xc7, 0xcc, + 0xd1, 0xd4, + 0xd7, 0xda, + 0xdb, 0xdc, + 0xdd, 0xdc, + 0xdb, 0xd9, + 0xd7, 0xd3, + 0xd0, 0xcb, + 0xc6, 0xc1, + 0xbb, 0xb4, + 0xae, 0xa7, + 0x9f, 0x98, + 0x90, 0x89, + 0x81, 0x79, + 0x71, 0x69, + 0x62, 0x5a, + 0x53, 0x4c, + 0x45, 0x3e, + 0x38, 0x32, + 0x2c, 0x26 + #endif /* 64 bytes table */ +}; + +static const int table_scale = 256/sizeof(rgblight_effect_breathe_table); + +#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index a9bb7548213..48d7afb1492 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -77,6 +77,12 @@ along with this program. If not, see . // #define RGBLIGHT_EFFECT_STATIC_GRADIENT // #define RGBLIGHT_EFFECT_RGB_TEST // #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ diff --git a/util/rgblight_breathing_table_calc.c b/util/rgblight_breathing_table_calc.c new file mode 100644 index 00000000000..fc4d49ea587 --- /dev/null +++ b/util/rgblight_breathing_table_calc.c @@ -0,0 +1,49 @@ +// +// calculate rgblight_effect_breathe_table[] values +// +// this is host program for quantum/rgblight.c:void rgblight_effect_breathing(); +// +// example: +// $ edit util/rgblight_breathing_table_calc.c +// $ cc -o util/rgblight_breathing_table_calc util/rgblight_breathing_table_calc.c +// $ ./util/rgblight_breathing_table_calc > keyboards/KEYBOARD_NAME/keymaps/KEYMAP_NAME/rgblight_breathe_table.h +// +#include +#include +#include + +/// customize breeathing effect part /////////////////////////// +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +//////////////////////////////////////////////////////////////// + +int main(void) { + int pos, step; + int table[256]; + for (pos = 0; pos < 256; pos ++ ) { + table[pos] = (uint8_t)( + (exp(sin((pos/255.0)*M_PI))- RGBLIGHT_EFFECT_BREATHE_CENTER/M_E) + * (RGBLIGHT_EFFECT_BREATHE_MAX/(M_E-1/M_E)) + ); + } + printf("#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE\n"); + printf("#define RGBLIGHT_EFFECT_BREATHE_TABLE\n\n"); + printf("const uint8_t rgblight_effect_breathe_table[] PROGMEM = {\n"); + printf(" /* #define RGBLIGHT_EFFECT_BREATHE_CENTER %.2f */\n", RGBLIGHT_EFFECT_BREATHE_CENTER); + printf(" /* #define RGBLIGHT_EFFECT_BREATHE_MAX %d */\n", RGBLIGHT_EFFECT_BREATHE_MAX); + + for (int s = 0, step = (1<=256?"":"," ); + if ((pos+step) % 8 == 0) + printf("\n"); + } + printf(" #endif /* %d bytes table */\n", s == 0 ? 256:(s== 1 ? 128: 64)); + } + printf("};\n"); + printf("\nstatic const int table_scale = 256/sizeof(rgblight_effect_breathe_table);\n"); + printf("\n#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */\n"); + return 0; +} From 27b0f8923e845a30adfde13756cb5845b8cd1ab7 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 2 May 2019 08:01:58 -0700 Subject: [PATCH 080/129] Change VPATH path addition order (#5754) Specifically, to fix some edge cases, and keep the handling consistent, the userspace folder should not actually be added at the end. Ideally, it should be added after the keymap paths, but before the keyboard's path. This issue was discovered in #5484, and the fix created by mtei. --- build_keyboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index 5d633f27169..510923ebe12 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -334,9 +334,9 @@ SRC += $(KEYBOARD_SRC) \ # Search Path VPATH += $(KEYMAP_PATH) +VPATH += $(USER_PATH) VPATH += $(KEYBOARD_PATHS) VPATH += $(COMMON_VPATH) -VPATH += $(USER_PATH) include common_features.mk include $(TMK_PATH)/protocol.mk From 55d37d9fbcd85a49acbf539d751f0003e7b770ed Mon Sep 17 00:00:00 2001 From: Teng Date: Thu, 2 May 2019 16:02:34 +0100 Subject: [PATCH 081/129] add a new keymap of DZ60 for MacOS (#5760) * add a new keymap of DZ60 for MacOS * dz60:macos_64 1. remove useless bright keys code, change to KC_PAUSE 2. add a documentation link in the readme --- keyboards/dz60/keymaps/macos_64/config.h | 9 +++++ keyboards/dz60/keymaps/macos_64/keymap.c | 42 +++++++++++++++++++++ keyboards/dz60/keymaps/macos_64/readme.md | 45 +++++++++++++++++++++++ keyboards/dz60/keymaps/macos_64/rules.mk | 2 + 4 files changed, 98 insertions(+) create mode 100644 keyboards/dz60/keymaps/macos_64/config.h create mode 100644 keyboards/dz60/keymaps/macos_64/keymap.c create mode 100644 keyboards/dz60/keymaps/macos_64/readme.md create mode 100644 keyboards/dz60/keymaps/macos_64/rules.mk diff --git a/keyboards/dz60/keymaps/macos_64/config.h b/keyboards/dz60/keymaps/macos_64/config.h new file mode 100644 index 00000000000..235ae1b2db2 --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/config.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H + +#include "../../config.h" + +// Fix KC_GESC conflict with Cmd+Alt+Esc on macos +#define GRAVE_ESC_GUI_OVERRIDE + +#endif \ No newline at end of file diff --git a/keyboards/dz60/keymaps/macos_64/keymap.c b/keyboards/dz60/keymaps/macos_64/keymap.c new file mode 100644 index 00000000000..fd19bfe14e7 --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | 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 | , | . | / |Shift| Up |Delete| + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Fn | Alt | Left| Down|Right| + * `-----------------------------------------------------------------------------------------' + */ + LAYOUT_all( + 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_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_UP, KC_DELETE, + KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_NO, MO(1), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), + + /* ,-----------------------------------------------------------------------------------------. + * | ` ~ | BR- | BR+ | | | | |PREV |PLAY |NEXT |MUTE | V- | V+ | Delete | + * |-----------------------------------------------------------------------------------------+ + * | | | | Up | | | | | 0 | 1 | 2 | 3 | | RESET | + * |-----------------------------------------------------------------------------------------+ + * | | | Left| Down|Right| | | | | 4 | 5 | 6 | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | 7 | 8 | 9 | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + LAYOUT_all( + KC_GRV , KC_SCROLLLOCK, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_1, KC_2, KC_3, KC_TRNS, RESET, + KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, 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/dz60/keymaps/macos_64/readme.md b/keyboards/dz60/keymaps/macos_64/readme.md new file mode 100644 index 00000000000..c559c2b3836 --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/readme.md @@ -0,0 +1,45 @@ +# MacOS 64 keymap + +This is a keymap of DZ60 configured with 64 keys for MacOS. It refers the keymap of [macos_arrow](../macos_arrow/readme.md). + +## How to use + +1. Follow the [introduction](https://docs.qmk.fm/#/) to compile the keymap +2. Download QMK Toolbox from [here](https://github.com/qmk/qmk_toolbox/releases) +3. Insert the dz60 keyboard while pressing ```Space+b``` (default) +4. Flash the firmware + +More details about flashing firmware please check the [documentation](https://docs.qmk.fm/#/) of QMK. + +## Base Layer + +``` +,-----------------------------------------------------------------------------------------. +| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +|-----------------------------------------------------------------------------------------+ +| 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 | , | . | / |Shift| Up |Delete| +|-----------------------------------------------------------------------------------------+ +| Ctrl | Alt | Cmd | Space | Fn | Alt | Left| Down|Right| +`-----------------------------------------------------------------------------------------' +``` + +## Fn Layer + +``` +,-----------------------------------------------------------------------------------------. +| ` ~ | BR- | BR+ | | | | |PREV |PLAY |NEXT |MUTE | V- | V+ | Delete | +|-----------------------------------------------------------------------------------------+ +| | | | Up | | | | | 0 | 1 | 2 | 3 | | RESET | +|-----------------------------------------------------------------------------------------+ +| | | Left| Down|Right| | | | | 4 | 5 | 6 | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | 7 | 8 | 9 | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | +`-----------------------------------------------------------------------------------------' + +``` diff --git a/keyboards/dz60/keymaps/macos_64/rules.mk b/keyboards/dz60/keymaps/macos_64/rules.mk new file mode 100644 index 00000000000..e1cfb3e508c --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file From 7e655a207e58fb8e5c7d76bd5727558e6b4c8b0c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 2 May 2019 08:03:42 -0700 Subject: [PATCH 082/129] Add option to enable LTO easily (#5674) * Add option to enable LTO easily and disable features that cause compiling errors with LTO * Add documentation about LTO option * Add to show_options --- docs/config_options.md | 2 ++ show_options.mk | 3 ++- tmk_core/common.mk | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/config_options.md b/docs/config_options.md index 8f229a2cb8d..3ef00394dba 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -330,6 +330,8 @@ Use these to enable or disable building certain features. The more you have enab * Forces the keyboard to wait for a USB connection to be established before it starts up * `NO_USB_STARTUP_CHECK` * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. +* `LINK_TIME_OPTIMIZATION_ENABLE` + = Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION` ## USB Endpoint Limitations diff --git a/show_options.mk b/show_options.mk index c72059118f7..02e062a8d94 100644 --- a/show_options.mk +++ b/show_options.mk @@ -88,7 +88,8 @@ OTHER_OPTION_NAMES = \ RGB_MATRIX_KEYPRESSES \ LED_MIRRORED \ RGBLIGHT_FULL_POWER \ - Link_Time_Optimization + Link_Time_Optimization \ + LINK_TIME_OPTIMIZATION_ENABLE define NAME_ECHO @echo " $1 = $($1) # $(origin $1)" diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 94f3c2380dc..22168875551 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -208,6 +208,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes) TMK_COMMON_DEFS += -DSHARED_EP_ENABLE endif + +ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes) + EXTRAFLAGS += -flto + TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE + TMK_COMMON_DEFS += -DNO_ACTION_MACRO + TMK_COMMON_DEFS += -DNO_ACTION_FUNCTION +endif # Bootloader address ifdef STM32_BOOTLOADER_ADDRESS TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) From db440f3e75f1d71e2c26499c7c7500cc48020047 Mon Sep 17 00:00:00 2001 From: ymzcdg <49898694+ymzcdg@users.noreply.github.com> Date: Fri, 3 May 2019 13:21:06 +0800 Subject: [PATCH 083/129] translate the first unit(newbs) (#5753) translate newbs_getting_started.md newbs_building_firmware.md newbs_flashing.md newbs_testing_debugging.md newbs_best_practices.md newbs_learn_more_resources.md into Mandarin Chinese --- docs/zh-cn/newbs_best_practices.md | 163 ++++++++++++ docs/zh-cn/newbs_building_firmware.md | 81 ++++++ docs/zh-cn/newbs_flashing.md | 307 +++++++++++++++++++++++ docs/zh-cn/newbs_getting_started.md | 102 ++++++++ docs/zh-cn/newbs_learn_more_resources.md | 15 ++ docs/zh-cn/newbs_testing_debugging.md | 43 ++++ 6 files changed, 711 insertions(+) create mode 100644 docs/zh-cn/newbs_best_practices.md create mode 100644 docs/zh-cn/newbs_building_firmware.md create mode 100644 docs/zh-cn/newbs_flashing.md create mode 100644 docs/zh-cn/newbs_getting_started.md create mode 100644 docs/zh-cn/newbs_learn_more_resources.md create mode 100644 docs/zh-cn/newbs_testing_debugging.md diff --git a/docs/zh-cn/newbs_best_practices.md b/docs/zh-cn/newbs_best_practices.md new file mode 100644 index 00000000000..fa58dc75e87 --- /dev/null +++ b/docs/zh-cn/newbs_best_practices.md @@ -0,0 +1,163 @@ +# 最佳实践 + +## 或者说, "我应如何学会不再担心并开始爱上Git。" + +本文档旨在指导新手以最佳方式获得为QMK做出贡献的丝滑体验。我们将介绍为QMK做出贡献的过程,详细介绍使这项任务更容易的一些方法,然后我们将制造一些问题,来教你如何解决它们。 + +本文假设了一些内容: + +1. 一有个GitHub账户, 并[创建qmk_firmware仓库分叉](getting_started_github.md)到你的帐户. +2. 你已经[建立你的构建环境](newbs_getting_started.md?id=environment-setup). + + +## 你分叉的主分支: 一直在上传,但不要提交 + +十分推荐您在QMK开发过程中无论开发是否完成都要保持你的 `master` 分支更新,但是 ***一定不要*** 提交。相反,你应该在一个开发分叉中做出你所有修改并在开发时提交pull request。 + +减少合并冲突的可能性 — 两个或多个用户同时编辑文件的同一部分的实例 — 保持 `master` 分支最新,并创建一个新的分支来开始新的开发。 + +### 更新你的主分支 + +保持你的 `master` 更新, 推荐你添加QMK Firmware仓库作为Git的远程仓库,想这么做的话, 你可以打开你的Git命令行接口然后输入: + +``` +git remote add upstream https://github.com/qmk/qmk_firmware.git +``` + +运行 `git remote -v`, 来确定这个仓库已经添加,以下是回显: + +``` +$ git remote -v +origin https://github.com//qmk_firmware.git (fetch) +origin https://github.com//qmk_firmware.git (push) +upstream https://github.com/qmk/qmk_firmware.git (fetch) +upstream https://github.com/qmk/qmk_firmware.git (push) +``` + +现在添加已完成,你可以用`git fetch upstream`来检查仓库的更新. 这会检索branches 和 tags — 统称为"refs" — 从QMK仓库, 也就是 `upstream`。我们可以比较我们的分叉和QMK的 `origin` 数据的不同。 + +要更新你的分叉的主分支,请运行以下命令,在每行之后按Enter键: + +``` +git checkout master +git fetch upstream +git pull upstream master +git push origin master +``` + +这回切换到你的`master` 分支, 检索你QMK仓库的refs, 下载当前QMK `master` 分支到你的电脑, 并上传到你的分叉. + +### 做改动 + +你可以输入以下命令来创建一个新的分支来做改动: + +``` +git checkout -b dev_branch +git push --set-upstream origin dev_branch +``` + +这回建立一个叫做 `dev_branch`的新分支, 检查一下, 然后想你的分叉保存分支. 使用 `--set-upstream` 参数来告诉git使用你的分叉并且当每次你对你的分支用`git push` 或 `git pull`时要使用`dev_branch`。 它仅需要在第一次push的时候使用;然后你就可以很安全的用 `git push` 或 `git pull`, 并不需要其他参数了。 + +!> 使用 `git push`, 你可以用 `-u` 来代替 `--set-upstream` — `-u`是`--set-upstream`的简写。 + +您可以将您的分支命名为您想要的任何名称,但建议将其命名为与您要进行的更改相关的内容。 + +默认情况下 `git checkout -b` 在已经检出的分支上建立新的分支。您可以将新的分支建立在未检出的现有分支的基础上,方法是将现有分支的名称添加到命令: + +``` +git checkout -b dev_branch master +``` + +现在您已经有了一个开发分支,那么就打开您的文本编辑器并进行您需要做的任何更改。建议对您的分支进行许多小的提交;这样,任何引起问题的更改都可以在需要时更容易地跟踪和撤消。要进行更改,编辑并保存任何需要更新的文件,请将它们添加到Git的 *staging area* ,然后将它们提交到您的分支: + +``` +git add path/to/updated_file +git commit -m "My commit message." +``` + +` git add`添加已更改到Git的*临时区域*也就是Git的“加载区域”的文件。其中包含使用 `git commit` 命令 *提交* 的并已经保存到仓库的更改。建议您使用描述性的提交消息,这样您就可以一目了然地知道更改了什么。 + +!> 如果你修改了很多文件,但所有的文件都是同一个更改的一部分,你可以用 `git add .` 来添加当前目录中所有已更改的文件而不是单独添加每个文件. + +### 发布更改 + +最后一步是将更改推送到您的分叉。 输入 `git push`来推送. 现在Git将`dev_branch`的当前状态发布到您的分叉。 + + +## 解决合并冲突 + +有时,当您在某个分支中的工作需要很长时间才能完成时,其他人所做的更改与您在打开pull request时对该分支所做的更改相冲突。这称为*rebase* 即合并冲突,当多个人编辑同一文件的同一部分时会发生这种情况。 + +### 重新调整您的更改 + +*rebase*是Git的一种方法,它获取在某一点上应用的更改,撤销它们,然后将相同的更改应用到另一点。在合并冲突的情况下,您可以重新设置您的分支以获取在创建分支时和当前时间之间的那段时间所做的更改。 + +运行以下命令来开始: + +``` +git fetch upstream +git rev-list --left-right --count HEAD...upstream/master +``` + + 这里的`git rev-list` 命令返回当前分支和qmk的主分支之间不同的提交数。我们首先运行`git fetch`,以确保我们有代表upstream仓库的refs。 `git rev-list` 命令的回显有两个数字: + +``` +$ git rev-list --left-right --count HEAD...upstream/master +7 35 +``` + +第一个数字表示自创建以来当前分支的提交数, 第二个数字是自创建当前分支以来对 `upstream/master` 进行的提交数, 因此, 当前分支中未记录变动。 + +既然知道当前分支和upstream仓库的当前状态,我们可以开始一个rebase操作: + +``` +git rebase upstream/master +``` + +这就是让Git撤销当前分支上的提交,然后根据QMK的主分支重新应用它们。 + +``` +$ git rebase upstream/master +First, rewinding head to replay your work on top of it... +Applying: Commit #1 +Using index info to reconstruct a base tree... +M conflicting_file_1.txt +Falling back to patching base and 3-way merge... +Auto-merging conflicting_file_1.txt +CONFLICT (content): Merge conflict in conflicting_file_1.txt +error: Failed to merge in the changes. +hint: Use 'git am --show-current-patch' to see the failed patch +Patch failed at 0001 Commit #1 + +Resolve all conflicts manually, mark them as resolved with +"git add/rm ", then run "git rebase --continue". +You can instead skip this commit: run "git rebase --skip". +To abort and get back to the state before "git rebase", run "git rebase --abort". +``` + +这告诉我们有一个合并冲突,并给出带有冲突的文件的名称。在文本编辑器中打开冲突的文件,在该文件的某个位置,您会发现如下内容: + +``` +<<<<<<< HEAD +

For help with any issues, email us at support@webhost.us.

+======= +

Need help? Email support@webhost.us.

+>>>>>>> Commit #1 +``` + + `<<<<<<< HEAD`行标记合并冲突的开始, `>>>>>>> Commit #1` 行标记结束, 冲突选项被 `=======`分隔。`HEAD`那端的部分来自文件的qmk master版本,标记有commit消息的部分来自当前的分支持和提交。 + +因为Git跟踪 *对文件的更改* 而不是直接跟踪文件的内容,所以如果Git在提交之前找不到文件中的文本,它将不知道如何编辑该文件。重新编辑文件将解决冲突。进行更改,然后保存文件。 + +``` +

Need help? Email support@webhost.us.

+``` + +现在运行: + +``` +git add conflicting_file_1.txt +git rebase --continue +``` + +Git记录对冲突文件的更改,并继续应用来自我们的分支的提交,直到它到达末尾。 diff --git a/docs/zh-cn/newbs_building_firmware.md b/docs/zh-cn/newbs_building_firmware.md new file mode 100644 index 00000000000..31093f2543b --- /dev/null +++ b/docs/zh-cn/newbs_building_firmware.md @@ -0,0 +1,81 @@ +# 构建第一个固件 + +现在您已经建立了构建环境,就可以开始构建自定义固件了。对于本指南的这一部分,我们将在3个程序之间切换——文件管理器、文本编辑器和终端窗口。请保持所有3个程序打开,直到您完成并对键盘固件满意。 + +如果您在按照指南第一部分的操作之后关闭并重新打开了终端窗口,请不要忘记输入“cd qmk_firmware”,来使您的终端位于正确的目录。 + +## 导航到您的keymaps文件夹 + +首先导航到键盘的 `keymaps` 文件夹. + +?> 如果您使用的是MacOS或Windows,可以使用以下命令轻松地打开keymaps文件夹。 + +?> macOS: + + open keyboards//keymaps + +?> Windows: + + start .\\keyboards\\\\keymaps + +## 创建`default` 布局副本 + +打开`keymaps`文件夹后,您将需要创建`default`文件夹的副本。我们强烈建议您将文件夹命名为与Github用户名相同的名称,但您也可以使用任何您想使用的名称,只要它只包含小写字母、数字和下划线字符。 + +要自动执行此过程,您还可以选择运行`new_keymap.sh`脚本。 + +导航到`qmk_firmware/util` 目录然后输入以下命令: + +``` +./new_keymap.sh +``` + +例如,一个名字叫ymzcdg的用户要创建1up60hse的布局,他需要输入 + +``` +./new_keymap.sh 1upkeyboards/1up60hse ymzcdg +``` + +## 在你最钟爱的文本编辑器中打开`keymap.c` + +打开你的`keymap.c`. 在这个文件中,您可以找到控制键盘行为的结构。 在你的`keymap.c` 的顶部有一些让布局更易读的define和enum。在靠下的位置你会找到一行和下面这句很像的: + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +从这一行开始便是层列表。这行下面你会看到包括 `LAYOUT` 或 `KEYMAP`这两个词的几行, 从这些行开始就是层。在这一行下面是组成该特定层的键的列表。 + +!> 编辑您的keymap文件时,注意不要添加或删除任何逗号。如果这样做,您将阻止您的固件编译,并且您可能不容易找出多余的或缺少的逗号在哪里。 + +## 根据您的喜好自定义布局 + +如何完成这一步骤完全取决于您。改变一直困扰着你的问题,或者完全重做所有的事情。如果您不需要全部图层,可以删除图层,或者将图层总数增加到32个。查看以下文档,了解可以在此处定义的内容: + +* [键码](keycodes.md) +* [特性](features.md) +* [问题与解答](faq.md) + +?> 当你明白布局是怎么工作时,您也要让每次改变尽可能小。一次改变很大在调试时找出问题会十分困难。 + +## 构建你的固件 + +完成对布局的更改后,您就要构建固件了。为此,请返回终端窗口并运行build命令: + + make : + +例如,如果您的keymap名为“xyverz”,并且您正在为rev5 planck构建一个keymap,那么您将使用此命令: + + make planck/rev5:xyverz + +在编译过程中,你将看到屏幕上有很多输出,通知您正在编译哪些文件他应该以与下文类似的输出结束: + +``` +Linking: .build/planck_rev5_xyverz.elf [OK] +Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK] +Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK] +Checking file size of planck_rev5_xyverz.hex [OK] + * File size is fine - 18392/28672 +``` + +## 刷新你的固件 + +请移步 [Flashing Firmware](newbs_flashing.md) 来继续。 diff --git a/docs/zh-cn/newbs_flashing.md b/docs/zh-cn/newbs_flashing.md new file mode 100644 index 00000000000..05a9eb55eef --- /dev/null +++ b/docs/zh-cn/newbs_flashing.md @@ -0,0 +1,307 @@ +# 刷新你的键盘 + +现在您已经构建了一个自定义固件文件,那么您就需要刷新键盘了。 + +## 用QMK工具箱刷新键盘 + +刷新键盘的最简单方法是使用[QMK 工具箱](https://github.com/qmk/qmk_toolbox/releases). + +但是,QMK工具箱目前仅适用于Windows和MacOS。如果您使用的是Linux(或者只是希望从命令行刷新固件),则必须使用 [方法概述](newbs_flashing.md#flash-your-keyboard-from-the-command-line). + +### 将文件加载到QMK工具箱中 + +首先打开QMK工具箱应用程序。您将要在访达或资源管理器中找到固件文件。您的键盘固件可能是两种格式之一`.hex`或`.bin`。qmk会尝试将键盘的相应文件复制到“qmk_firmware”根目录中。 + +?> 如果您在Windows或MacOS上,可以使用以下命令轻松地在资源管理器或访达中打开当前固件文件夹。 + +?> Windows: + + start . + +?> macOS: + + open . + +固件文件始终遵循此命名格式: + + _.{bin,hex} + +例如,使用 `default` 布局的 `plank/rev5` 将使用以下名字: + + planck_rev5_default.hex + +找到固件文件后,将其拖到QMK工具箱中的“Local file”框中,或单击“Open”并导航到固件文件的存储位置。 + +### 将键盘置于DFU(Bootloader)模式 + +要刷新自定义固件,您必须将键盘置于特殊的刷新模式。在此模式下,您将无法键入或使用键盘。在写入固件时,不要拔下键盘插头或以其他方式中断刷新过程,这一点非常重要。 + +不同的键盘有不同的方式进入这种特殊模式。如果您的键盘当前运行的是QMK或TMK,而您没有得到特定的指示,请按顺序尝试以下操作: + +* 按住两个shift键并按 `Pause` +* 按住两个shift键并按 `B` +* 拔下键盘插头, 同时按住空格键和 `B` , 插上键盘然后等一会再放开按键 +* 按下PCB底部的 `RESET` 物理键 +* 找到PCB上标记有 `BOOT0` 或 `RESET`的金属点, 在插入PCB的同时短接它们 + +成功后,您将在QMK工具箱中看到类似以下内容的消息: + +``` +*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 +*** DFU device connected +``` + +### 刷新你的键盘 + +单击QMK工具箱中的 `Flash` 按钮。您将看到类似以下内容的输出: + +``` +*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 +*** DFU device connected +*** Attempting to flash, please don't remove device +>>> dfu-programmer atmega32u4 erase --force + Erasing flash... Success + Checking memory from 0x0 to 0x6FFF... Empty. +>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex + Checking memory from 0x0 to 0x55FF... Empty. + 0% 100% Programming 0x5600 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + 0% 100% Reading 0x7000 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + Validating... Success + 0x5600 bytes written into 0x7000 bytes memory (76.79%). +>>> dfu-programmer atmega32u4 reset + +*** DFU device disconnected +*** Clueboard - Clueboard 66% HotSwap connected -- 0xC1ED:0x2390 +``` + +## 使用命令行刷新键盘 + +首先,您需要知道您的键盘使用的是哪个bootloader。通常是以下四个常见的bootloader。Pro-Micro 和 clones 使用 CATERINA, Teensy 使用 Halfkay, OLKB 键盘使用 QMK-DFU, 其他的atmega32u4芯片使用DFU。 + +您可以在以下文章中了解更多关于bootloader[刷新指令和Bootloader信息](flashing.md)。 + +如果您知道正在使用的bootloader是哪种,那么在编译固件时,可以向“make”命令里添加一些额外参数,以自动执行刷新过程。 + +### DFU + +对于DFU引导加载程序,当您准备好编译和刷新固件时,打开终端窗口并运行构建命令: + + make ::dfu + +例如,如果您的布局名为“xyverz”,并且您正在为rev5 planck构建一个布局,那么您可以使用此命令: + + make planck/rev5:xyverz:dfu + +编译完成后,应输出以下内容: + +``` +Linking: .build/planck_rev5_xyverz.elf [OK] +Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK] +Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK] +Checking file size of planck_rev5_xyverz.hex + * File size is fine - 18574/28672 + ``` + +到了这个时候, 构建脚本将每隔5秒查找一次DFU。它将重复以下操作,直到找到设备或将其取消。 + + dfu-programmer: no device present. + Error: Bootloader not found. Trying again in 5s. + +一旦出现以上回显,您将需要重置控制器。然后,它应该显示与以下类似的输出: + +``` +*** Attempting to flash, please don't remove device +>>> dfu-programmer atmega32u4 erase --force + Erasing flash... Success + Checking memory from 0x0 to 0x6FFF... Empty. +>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex + Checking memory from 0x0 to 0x55FF... Empty. + 0% 100% Programming 0x5600 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + 0% 100% Reading 0x7000 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + Validating... Success + 0x5600 bytes written into 0x7000 bytes memory (76.79%). +>>> dfu-programmer atmega32u4 reset +``` + +如果您对此有任何问题,您可能需要这样做: + + sudo make ::dfu + +#### DFU命令 + +有许多DFU命令可用于将固件下载到DFU设备: + +* `:dfu` - 这是正常选项,等待DFU设备可用,然后刷新固件。这将每隔5秒检查一次,以查看是否出现了DFU设备。 +* `:dfu-ee` - 这将刷新一个`eep`文件,而不是普通的十六进制文件。这很不常见。 +* `:dfu-split-left` - 这将刷新正常固件,就像默认选项 (`:dfu`)一样. 但是,这也会刷新“左侧”EEPROM文件,用于分割键盘。 _这是基于Elite C的键盘的推荐选择。_ +* `:dfu-split-right` - 这将刷新正常固件,就像默认选项(`:dfu`). 但是,这也会刷新“右侧”EEPROM文件,用于分割键盘。 _这是基于Elite C的键盘的推荐选择。_ + + +### Caterina + +对于Arduino板以及其克隆版来说(比如SparkFun和ProMicro), 准备好编译和刷新固件后,打开终端窗口并运行构建命令: + + make ::avrdude + +比如, 你的布局叫"xyverz"你要创建一个rev2 Lets Split的布局,你要用以下命令: + + make lets_split/rev2:xyverz:avrdude + +固件完成编译后,它将输出类似以下的内容: + +``` +Linking: .build/lets_split_rev2_xyverz.elf [OK] +Creating load file for flashing: .build/lets_split_rev2_xyverz.hex [OK] +Checking file size of lets_split_rev2_xyverz.hex [OK] + * File size is fine - 27938/28672 +Detecting USB port, reset your controller now.............. +``` + +此时,复位,然后脚本将检测bootloader,然后刷新固件。输出应该像这样: + +``` +Detected controller on USB port at /dev/ttyS15 + +Connecting to programmer: . +Found programmer: Id = "CATERIN"; type = S + Software Version = 1.0; No Hardware Version given. +Programmer supports auto addr increment. +Programmer supports buffered memory access with buffersize=128 bytes. + +Programmer supports the following devices: + Device code: 0x44 + +avrdude.exe: AVR device initialized and ready to accept instructions + +Reading | ################################################## | 100% 0.00s + +avrdude.exe: Device signature = 0x1e9587 (probably m32u4) +avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed + To disable this feature, specify the -D option. +avrdude.exe: erasing chip +avrdude.exe: reading input file "./.build/lets_split_rev2_xyverz.hex" +avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex +avrdude.exe: writing flash (27938 bytes): + +Writing | ################################################## | 100% 2.40s + +avrdude.exe: 27938 bytes of flash written +avrdude.exe: verifying flash memory against ./.build/lets_split_rev2_xyverz.hex: +avrdude.exe: load data flash data from input file ./.build/lets_split_rev2_xyverz.hex: +avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex +avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex contains 27938 bytes +avrdude.exe: reading on-chip flash data: + +Reading | ################################################## | 100% 0.43s + +avrdude.exe: verifying ... +avrdude.exe: 27938 bytes of flash verified + +avrdude.exe: safemode: Fuses OK (E:CB, H:D8, L:FF) + +avrdude.exe done. Thank you. +``` +如果您对此有任何问题,您可能需要这样做: + + sudo make ::avrdude + + +此外,如果要刷新多个板,请使用以下命令: + + make ::avrdude-loop + +当你完成了刷新后,你需要按下ctrl+c或者其他正确的按键来让你的操作系统终止循环。 + + +## HalfKay + +对于PJRC设备(Teensy),当您准备好编译和刷新固件时,打开终端窗口并运行构建命令: + + make ::teensy + +比如, 如果你的布局叫做"xyverz"你想创建Ergodox or Ergodox EZ的布局,你要使用以下命令: + + make erdogox_ez:xyverz:teensy + +固件完成编译后,它将输出如下内容: + +``` +Linking: .build/ergodox_ez_xyverz.elf [OK] +Creating load file for flashing: .build/ergodox_ez_xyverz.hex [OK] +Checking file size of ergodox_ez_xyverz.hex [OK] + * File size is fine - 25584/32256 + Teensy Loader, Command Line, Version 2.1 +Read "./.build/ergodox_ez_xyverz.hex": 25584 bytes, 79.3% usage +Waiting for Teensy device... + (hint: press the reset button) + ``` + +此时,复位键盘。完成后,您将看到如下输出: + + ``` + Found HalfKay Bootloader +Read "./.build/ergodox_ez_xyverz.hex": 28532 bytes, 88.5% usage +Programming............................................................................................................................................................................ +................................................... +Booting +``` + +## STM32 (ARM) + +对于大多数ARM板(包括Proton C、Planck Rev 6和Preonic Rev 3),当您准备好编译和刷新固件时,打开终端窗口并运行构建命令: + + make ::dfu-util + +例如,如果您的keymap被命名为“xyverz”,并且您正在为Planck Revision 6键盘构建一个布局,那么您需要使用以下命令,然后将键盘重新启动到bootloader(在完成编译之前): + + make planck/rev6:xyverz:dfu-util + +固件完成编译后,它将输出如下内容: + +``` +Linking: .build/planck_rev6_xyverz.elf [OK] +Creating binary load file for flashing: .build/planck_rev6_xyverz.bin [OK] +Creating load file for flashing: .build/planck_rev6_xyverz.hex [OK] + +Size after: + text data bss dec hex filename + 0 41820 0 41820 a35c .build/planck_rev6_xyverz.hex + +Copying planck_rev6_xyverz.bin to qmk_firmware folder [OK] +dfu-util 0.9 + +Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. +Copyright 2010-2016 Tormod Volden and Stefan Schmidt +This program is Free Software and has ABSOLUTELY NO WARRANTY +Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ + +Invalid DFU suffix signature +A valid DFU suffix will be required in a future dfu-util release!!! +Opening DFU capable USB device... +ID 0483:df11 +Run-time device DFU version 011a +Claiming USB DFU Interface... +Setting Alternate Setting #0 ... +Determining device status: state = dfuERROR, status = 10 +dfuERROR, clearing status +Determining device status: state = dfuIDLE, status = 0 +dfuIDLE, continuing +DFU mode device DFU version 011a +Device returned transfer size 2048 +DfuSe interface name: "Internal Flash " +Downloading to address = 0x08000000, size = 41824 +Download [=========================] 100% 41824 bytes +Download done. +File downloaded successfully +Transitioning to dfuMANIFEST state +``` + +## 试一试吧! + +恭喜您! 您的自定义固件已经刷写到您的键盘 + +试一试,确保一切按你想的方式进行。我们写了[测试和调试](newbs_testing_debugging.md)来完善新手引导。 因此,请前往那里了解如何排除自定义功能的故障。 diff --git a/docs/zh-cn/newbs_getting_started.md b/docs/zh-cn/newbs_getting_started.md new file mode 100644 index 00000000000..4e7850201d1 --- /dev/null +++ b/docs/zh-cn/newbs_getting_started.md @@ -0,0 +1,102 @@ +# 介绍 + +你的电脑键盘里面包含一个处理器, 这个处理器和你电脑里面的不太一样。这个处理器负责运行一些特殊的软件,这些软件可以监测按钮按下并将按钮处于按下还是释放状态的数据发送出去。QMK就是这样一种软件,即监测按钮被按下并发送这样的信息到作为主机的计算机上。当你创建了你的布局, 你也就创建了你的键盘运行的的可执行程序。 + +QMK试图通过使简单的事情变得更简单,使使不可能成为可能来把大量的权力交给你。你不需要懂如何通过程序创建强大的布局——你只需要遵循简单的语法规则。 + +# 新手上路 + +在你能创建布局前,你要安装一些软件来建立你的开发环境。无论你想编译多少固件,这个操作都只需要进行一次。 + +如果您更喜欢图形化界面, 请考虑使用在线工具[QMK配置器](https://config.qmk.fm)。 请参考 [使用在线GUI构建您的第一个固件](newbs_building_firmware_configurator.md)。 + + +## 下载软件 + +### 文本编辑器 + +你需要一个可以编辑 **纯文本** 文件的程序。在Windows上你可以用Notepad, 在Linux上使用gedit,这两个都是简单又实用的文本编辑工具。 在macOS上, 请小心使用 “文本编辑” 这个默认软件: 如果你不明确的选择_格式_菜单中的 _制作纯文本_ 的话文本将不会被保存为纯文本。 + +你也可以下载并安装一个专用编辑器 [Sublime Text](https://www.sublimetext.com/) 或 [VS Code](https://code.visualstudio.com/)。 这大概是跨平台的最好方法了, 这些编辑器是专门为了编辑代码设计的。 + +?>搞不清用哪种编辑器? Laurence Bradford 写了篇关于编辑器选择的文章 [a great introduction](https://learntocodewith.me/programming/basics/text-editors/)。 + +### QMK 工具箱 + +QMK 工具箱 是一种可选的Windows和macOS下的图形化工具,它可以对你的定制键盘进行编程和调试。你可能会发现它就是你能简单的刷新你的键盘固件并查看调试信息的稀世珍宝。 + +[在这里下载最新发布版本](https://github.com/qmk/qmk_toolbox/releases/latest) + +* Windows用户: `qmk_toolbox.exe` (绿色版) 或 `qmk_toolbox_install.exe` (安装版) +* macOS用户: `QMK.Toolbox.app.zip` (绿色版) or `QMK.Toolbox.pkg` (安装版) + +## 建立你的环境 + +我们为了使QMK环境变得更容易建立已竭尽所能。你只需要准备Linux 或 Unix 环境, 然后让QMK安装剩余部分。 + +?> 如果你从未使用过Linux/Unix的命令行,有一些你需要学习的基础概念和命令,以下资料将教会您使用QMK环境的必要能力:
+[必会Linux命令](https://www.guru99.com/must-know-linux-commands.html)
+[一些基本的Unix命令](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html) + +### Windows + +你需要安装MSYS2和Git. + +* 按照以下安装说明进行操作[MSYS2 主页](http://www.msys2.org)。 +* 关闭所有打开的MSYS2终端并打开新的MSYS2 MinGW 64-bit终端。 +* 使用以下命令安装Git: `pacman -S git`。 + +### macOS + +你需要安装Homebrew。按照以下说明进行操作 [Homebrew 主页](https://brew.sh)。 + +在Homebrew安装完成后, 继续 _同步QMK工程_. 这一步你将会通过运行一个脚本安装其他包。 + +### Linux + +你将需要安装Git.你很有可能已经安装,但若你尚未安装,可以使用以下命令进行安装: + +* Debian / Ubuntu / Devuan: `apt-get install git` +* Fedora / Red Hat / CentOS: `yum install git` +* Arch: `pacman -S git` + +?> 无论你使用哪种平台,Docker都可以是你的选择[点这里进一步了解](getting_started_build_tools.md#docker) + +## 同步QMK工程 + +当你建立Linux/Unix环境后,你就已经可以下载QMK了.下载时我们可以用Git来 "clone" QMK仓库. 打开一个终端或MSYS2 MinGW 窗口,在阅读剩余的指南时请保持窗口打开。在窗口里面运行以下两句命令: + +```shell +git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git +cd qmk_firmware +``` + +?> 如果您已经知道[如何使用GitHub](getting_started_github.md), 我们推荐您创建您自己的分支并克隆。 如果您不知道这是什么, 您完全可以忽略这句无关紧要的话。 + +QMK附带一个脚本,可帮助您设置剩余的所需内容.您可以通过输入此命令来运行它: + + util/qmk_install.sh + +## 测试你的开发环境 + +现在你的QMK环境已经建立完毕, 你可以为你的键盘创建固件了。开始试着创建键盘的默认固件吧。 你需要使用以下格式的命令创建固件: + + make :default + +比如, 制作一个Clueboard 66%的固件,需要用: + + make clueboard/66/rev3:default + +当完成后你要看到一些回显,尾部如下: + +``` +Linking: .build/clueboard_66_rev3_default.elf [OK] +Creating load file for flashing: .build/clueboard_66_rev3_default.hex [OK] +Copying clueboard_66_rev3_default.hex to qmk_firmware folder [OK] +Checking file size of clueboard_66_rev3_default.hex [OK] + * The firmware size is fine - 26356/28672 (2316 bytes free) +``` + +# 创建你的布局 + +现在你可以创建属于你自己的布局了! 请移步 [构建你的第一个固件](newbs_building_firmware.md)来继续。 diff --git a/docs/zh-cn/newbs_learn_more_resources.md b/docs/zh-cn/newbs_learn_more_resources.md new file mode 100644 index 00000000000..ccb4fa326c4 --- /dev/null +++ b/docs/zh-cn/newbs_learn_more_resources.md @@ -0,0 +1,15 @@ +# 学习资源 + +这些资源旨在让QMK社区的新成员更了解新成员文档中提供的信息。 + +Git 资源: + +* [很好的通用教程](https://www.codecademy.com/learn/learn-git) +* [从例子中学习Git游戏](https://learngitbranching.js.org/) +* [了解有关GitHub的更多信息的Git资源](getting_started_github.md) +* [专门针对QMK的Git资源](contributing.md) + + +命令行资源: + +* [超棒的命令行通用教程](https://www.codecademy.com/learn/learn-the-command-line) diff --git a/docs/zh-cn/newbs_testing_debugging.md b/docs/zh-cn/newbs_testing_debugging.md new file mode 100644 index 00000000000..824f94b906f --- /dev/null +++ b/docs/zh-cn/newbs_testing_debugging.md @@ -0,0 +1,43 @@ +# 测试和调试 + +使用自定义固件刷新键盘后,您就可以测试它了。如果您幸运,一切都会完美运行,但如果没有,这份文件将帮助您找出问题所在。 + +## 测试 + +测试键盘通常非常简单。按下每一个键并确保它发送的是您期望的键。甚至有一些程序可以帮助您确保没有任何键失效。 + +注意:这些程序不是由QMK提供或认可的。 + +* [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (仅Windows) +* [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (仅Mac) +* [Keyboard Tester](http://www.keyboardtester.com) (网页版) +* [Keyboard Checker](http://keyboardchecker.com) (网页版) + +## 使用QMK工具箱进行调试 + +[QMK工具箱](https://github.com/qmk/qmk_toolbox) 将会在你的`rules.mk`中有`CONSOLE_ENABLE = yes`的时候显示你键盘发来的消息。 默认情况下,输出极为有限,不过您可以打开调试模式来增加输出信息量。使用你键盘布局中的`DEBUG`键码,使用 [命令](feature_command.md) 特性来使能调试模式, 或者向你的布局中添加以下代码。 + +```c +void keyboard_post_init_user(void) { + // Customise these values to desired behaviour + debug_enable=true; + debug_matrix=true; + //debug_keyboard=true; + //debug_mouse=true; +} +``` + + + +## 发送您自己的调试消息 + +有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`: + + #include + +之后,您可以使用一些不同的打印功能: + +* `print("string")`: 打印简单字符串. +* `uprintf("%s string", var)`: 打印格式化字符串 +* `dprint("string")`: 仅在调试模式使能时打印简单字符串 +* `dprintf("%s string", var)`: 仅在调试模式使能时打印格式化字符串 From 36bed36cd6830cc1428a3e6df19549e831f0b062 Mon Sep 17 00:00:00 2001 From: ymzcdg <49898694+ymzcdg@users.noreply.github.com> Date: Fri, 3 May 2019 21:18:20 +0800 Subject: [PATCH 084/129] getting_started_introduction.md ->zh-cn (#5767) translate getting_started_introduction.md into Mandarin Chinese --- docs/zh-cn/getting_started_introduction.md | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/zh-cn/getting_started_introduction.md diff --git a/docs/zh-cn/getting_started_introduction.md b/docs/zh-cn/getting_started_introduction.md new file mode 100644 index 00000000000..36194c293aa --- /dev/null +++ b/docs/zh-cn/getting_started_introduction.md @@ -0,0 +1,54 @@ +# 介绍 + +本页解释了使用QMK项目所需的基本信息。它假定您能熟练使用Unix shell,但您不熟悉C语言也不熟悉使用make编译。 + +## 基本QMK结构 + +QMK是[Jun Wako](https://github.com/tmk)的[tmk_keyboard](https://github.com/tmk/tmk_keyboard)工程的一个分叉。经过更改的TMK原始代码放在`tmk` 文件夹中。 QMK增加的新东西可以在 `quantum` 文件夹中找到。 键盘项目可以在 `handwired`(手动飞线) 和 `keyboard`(PCB键盘)这两个文件夹找到。 + +### 用户空间结构 + +在`users`文件夹里面的目录是每个用户的目录。这个文件夹里面放的是用户们在不同键盘都能用到的代码。详见[用户空间特性](feature_userspace.md) + +### 键盘项目结构 + +在`keyboards`文件夹和他的子文件夹`handwired`中就是各个键盘的项目了,比如`qmk_firmware/keyboards/clueboard`。内部结构与如下: + +* `keymaps/`: 可以构建的不同布局 +* `rules.mk`: 用来设置 "make" 命令默认选项的文件。别直接编辑这个文件,你应该使用具体某个布局的 `rules.mk`. +* `config.h`: 用于设置默认编译选项的文件。别直接编辑这个文件, 你应该使用具体某个布局的 `config.h`. + +### 布局结构 + +在各个布局的文件夹,你能找到以下文件。只有 `keymap.c` 是必要的, 如果其他文件找不到就会直接选择默认选项。 + +* `config.h`: 配置布局的选项 +* `keymap.c`: 布局的全部代码, 必要文件 +* `rules.mk`: 使能的QMK特性 +* `readme.md`:介绍你的布局,告诉别人怎么使用,附上功能说明。请将图片上传到imgur等图床(译者注:imgur可能已被墙,为了方便国人访问,建议使用国内可以直接访问的图床)。 + +# `config.h` 文件 + +有三个重要的`config.h` 位置: + +* 键盘 (`/keyboards//config.h`) +* 用户空间 (`/users//config.h`) +* 布局 (`/keyboards//keymaps//config.h`) + +构建系统按照上述顺序自动获取配置文件。如果要覆盖由上一个 `config.h` 所做的设置,您需要首先为要更改的设置包含一些样板代码。 + +``` +#pragma once +``` + +要覆盖上一个 `config.h` 所做的设置,你要先 `#undef` 然后再 `#define` 这个设置. + +样板代码和设置看起来像这样: + +``` +#pragma once + +// 像下面那样覆盖设置(MY_SETTING指的是你要覆盖的设置项)! +#undef MY_SETTING +#define MY_SETTING 4 +``` From 6a59198a42d49422297ee9320e5d842592573297 Mon Sep 17 00:00:00 2001 From: moyi4681 Date: Fri, 3 May 2019 21:19:33 +0800 Subject: [PATCH 085/129] add dz65rgb (#5756) * add dz68rgb * Update dz68rgb.c * Apply suggestions from code review Co-Authored-By: moyi4681 * Apply suggestions from code review Co-Authored-By: moyi4681 * Apply suggestions from code review Co-Authored-By: moyi4681 * Apply suggestions from code review Co-Authored-By: moyi4681 * Apply suggestions from code review Co-Authored-By: moyi4681 * Apply suggestions from code review Co-Authored-By: moyi4681 * Apply suggestions from code review Co-Authored-By: moyi4681 * Rename keyboards/dztech/dz68rgb/rules.mk to keyboards/dztech/dz65rgb/rules.mk * Update and rename keyboards/dztech/dz68rgb/config.h to keyboards/dztech/dz65rgb/config.h * Update and rename keyboards/dztech/dz68rgb/dz68rgb.c to keyboards/dztech/dz65rgb/dz65rgb.c * Rename keyboards/dztech/dz68rgb/dz68rgb.h to keyboards/dztech/dz65rgb/dz65rgb.h * Update and rename keyboards/dztech/dz68rgb/info.json to keyboards/dztech/dz65rgb/info.json * Update readme.md * Rename keyboards/dztech/dz68rgb/readme.md to keyboards/dztech/dz65rgb/readme.md * Rename keyboards/dztech/dz68rgb/keymaps/default/keymap.c to keyboards/dztech/dz65rgb/keymaps/default/keymap.c * Update dz65rgb.c * Update readme.md * Update keyboards/dztech/dz65rgb/keymaps/default/keymap.c Co-Authored-By: moyi4681 * Update keyboards/dztech/dz65rgb/keymaps/default/keymap.c Co-Authored-By: moyi4681 --- keyboards/dztech/dz65rgb/config.h | 29 ++++ keyboards/dztech/dz65rgb/dz65rgb.c | 156 ++++++++++++++++++ keyboards/dztech/dz65rgb/dz65rgb.h | 16 ++ keyboards/dztech/dz65rgb/info.json | 12 ++ .../dztech/dz65rgb/keymaps/default/keymap.c | 41 +++++ keyboards/dztech/dz65rgb/readme.md | 14 ++ keyboards/dztech/dz65rgb/rules.mk | 12 ++ 7 files changed, 280 insertions(+) create mode 100644 keyboards/dztech/dz65rgb/config.h create mode 100644 keyboards/dztech/dz65rgb/dz65rgb.c create mode 100644 keyboards/dztech/dz65rgb/dz65rgb.h create mode 100644 keyboards/dztech/dz65rgb/info.json create mode 100644 keyboards/dztech/dz65rgb/keymaps/default/keymap.c create mode 100644 keyboards/dztech/dz65rgb/readme.md create mode 100644 keyboards/dztech/dz65rgb/rules.mk diff --git a/keyboards/dztech/dz65rgb/config.h b/keyboards/dztech/dz65rgb/config.h new file mode 100644 index 00000000000..8ef9c23904e --- /dev/null +++ b/keyboards/dztech/dz65rgb/config.h @@ -0,0 +1,29 @@ +#pragma once +#include "config_common.h" +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1224 +#define DEVICE_VER 0x0001 +#define MANUFACTURER DZTECH +#define PRODUCT DZ65RGB +#define DESCRIPTION DZ65 ARM RGB keyboard + +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 +#define MATRIX_ROW_PINS { B1, B10, B11, B14, B12 } +#define MATRIX_COL_PINS {A6, A7, B0, B13, B15, A8, A15, B3, B4, B5, B8, B9, C13, C14, C15 } +#define DIODE_DIRECTION COL2ROW + +#define RGB_MATRIX_LED_PROCESS_LIMIT 4 +#define RGB_MATRIX_LED_FLUSH_LIMIT 26 +#define DEBOUNCE 3 +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 + +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110111 +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 35 +#define DRIVER_2_LED_TOTAL 33 +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL diff --git a/keyboards/dztech/dz65rgb/dz65rgb.c b/keyboards/dztech/dz65rgb/dz65rgb.c new file mode 100644 index 00000000000..78b345843c6 --- /dev/null +++ b/keyboards/dztech/dz65rgb/dz65rgb.c @@ -0,0 +1,156 @@ +#include "dz65rgb.h" +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, C2_1, C3_1, C4_1}, // LA0 + {0, C1_1, C3_2, C4_2}, // LA1 + {0, C1_2, C2_2, C4_3}, // LA2 + {0, C1_3, C2_3, C3_3}, // LA3 + {0, C1_4, C2_4, C3_4}, // LA4 + {0, C1_5, C2_5, C3_5}, // LA5 + {0, C1_6, C2_6, C3_6}, // LA6 + {0, C1_7, C2_7, C3_7}, // LA7 + {0, C1_8, C2_8, C3_8}, // LA8 + {0, C9_1, C8_1, C7_1}, // LA9 + {0, C9_2, C8_2, C7_2}, // LA10 + {0, C9_3, C8_3, C7_3}, // LA11 + {0, C9_4, C8_4, C7_4}, // LA12 + {0, C9_5, C8_5, C7_5}, // LA13 + {0, C9_6, C8_6, C7_6}, // LA14 + {0, C9_7, C8_7, C6_6}, // LA15 + {0, C9_8, C7_7, C6_7}, // LA16 + {0, C8_8, C7_8, C6_8}, // LA17 + {0, C2_9, C3_9, C4_9}, // LB0 + {0, C1_9, C3_10, C4_10}, // LB1 + {0, C1_10, C2_10, C4_11}, // LB2 + {0, C1_11, C2_11, C3_11}, // LB3 + //{0, C1_12, C2_12, C3_12}, // LB4 + {0, C1_13, C2_13, C3_13}, // LB5 + {0, C1_14, C2_14, C3_14}, // LB6 + {0, C1_15, C2_15, C3_15}, // LB7 + {0, C1_16, C2_16, C3_16}, // LB8 + {0, C9_9, C8_9, C7_9}, // LB9 + {0, C9_10, C8_10, C7_10}, // LB10 + {0, C9_11, C8_11, C7_11}, // LB11 + {0, C9_12, C8_12, C7_12}, // LB12 + {0, C9_13, C8_13, C7_13}, // LB13 + {0, C9_14, C8_14, C7_14}, // LB14 + {0, C9_15, C8_15, C6_14}, // LB15 + {0, C9_16, C7_15, C6_15}, // LB16 + {0, C8_16, C7_16, C6_16}, // LB17 + {1, C2_1, C3_1, C4_1}, // LC0 + {1, C1_1, C3_2, C4_2}, // LC1 + {1, C1_2, C2_2, C4_3}, // LC2 + {1, C1_3, C2_3, C3_3}, // LC3 + {1, C1_4, C2_4, C3_4}, // LC4 + {1, C1_5, C2_5, C3_5}, // LC5 + //{1, C1_6, C2_6, C3_6}, // LC6 + {1, C1_7, C2_7, C3_7}, // LC7 + {1, C1_8, C2_8, C3_8}, // LC8 + {1, C9_1, C8_1, C7_1}, // LC9 + {1, C9_2, C8_2, C7_2}, // LC10 + {1, C9_3, C8_3, C7_3}, // LC11 + {1, C9_4, C8_4, C7_4}, // LC12 + {1, C9_5, C8_5, C7_5}, // LC13 + {1, C9_6, C8_6, C7_6}, // LC14 + //{1, C9_7, C8_7, C6_6}, // LC15 + {1, C9_8, C7_7, C6_7}, // LC16 + {1, C8_8, C7_8, C6_8}, // LC17 + {1, C2_9, C3_9, C4_9}, // LD0 + {1, C1_9, C3_10, C4_10}, // LD1 + {1, C1_10, C2_10, C4_11}, // LD2 + {1, C1_11, C2_11, C3_11}, // LD3 + {1, C1_12, C2_12, C3_12}, // LD4 + {1, C1_13, C2_13, C3_13}, // LD5 + {1, C1_14, C2_14, C3_14}, // LD6 + {1, C1_15, C2_15, C3_15}, // LD7 + {1, C1_16, C2_16, C3_16}, // LD8 + {1, C9_9, C8_9, C7_9}, // LD9 + {1, C9_10, C8_10, C7_10}, // LD10 + {1, C9_11, C8_11, C7_11}, // LD11 + {1, C9_12, C8_12, C7_12}, // LD12 + //{1, C9_13, C8_13, C7_13}, // LD13 + {1, C9_14, C8_14, C7_14}, // LD14 + {1, C9_15, C8_15, C6_14}, // LD15 + {1, C9_16, C7_15, C6_15}, // LD16 + {1, C8_16, C7_16, C6_16}, // LD17 +}; +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{1|(7<<4)}, {16*7, 16}, 4}, + {{1|(6<<4)}, {16*6, 16}, 4}, + {{1|(5<<4)}, {16*5, 16}, 4}, + {{1|(4<<4)}, {16*4, 16}, 4}, + {{1|(3<<4)}, {16*3, 16}, 4}, + {{1|(2<<4)}, {16*2, 16}, 4}, + {{1|(1<<4)}, {16*1, 16}, 4}, + {{1|(0<<4)}, {16*0, 16}, 1}, + {{2|(0<<4)}, {16*0, 32}, 1}, + {{0|(8<<4)}, {16*8, 0}, 1}, + {{0|(7<<4)}, {16*7, 0}, 1}, + {{0|(6<<4)}, {16*6, 0}, 1}, + {{0|(5<<4)}, {16*5, 0}, 1}, + {{0|(4<<4)}, {16*4, 0}, 1}, + {{0|(3<<4)}, {16*3, 0}, 1}, + {{0|(2<<4)}, {16*2, 0}, 1}, + {{0|(1<<4)}, {16*1, 0}, 1}, + {{0|(0<<4)}, {16*0, 0}, 1}, + {{0|(9<<4)}, {16*9, 0}, 1}, + {{0|(10<<4)}, {16*10, 0}, 1}, + {{0|(11<<4)}, {16*11, 0}, 1}, + {{0|(12<<4)}, {16*12, 0}, 1}, + {{0|(13<<4)}, {16*13, 0}, 1}, + {{0|(14<<4)}, {16*14, 0}, 1}, + {{1|(14<<4)}, {16*14, 16}, 1}, + {{2|(14<<4)}, {16*14, 32}, 1}, + {{1|(8<<4)}, {16*8, 16}, 4}, + {{1|(9<<4)}, {16*9, 16}, 4}, + {{1|(10<<4)}, {16*10, 16}, 4}, + {{1|(11<<4)}, {16*11, 16}, 4}, + {{1|(12<<4)}, {16*12, 16}, 4}, + {{1|(13<<4)}, {16*13, 16}, 4}, + {{3|(14<<4)}, {16*14, 48}, 1}, + {{4|(14<<4)}, {16*14, 64}, 1}, + {{4|(13<<4)}, {16*13, 64}, 1}, + {{4|(5<<4)}, {16*5, 64}, 1}, + {{3|(5<<4)}, {16*5, 48}, 4}, + {{3|(4<<4)}, {16*4, 48}, 4}, + {{3|(3<<4)}, {16*3, 48}, 4}, + {{3|(2<<4)}, {16*2, 48}, 4}, + {{3|(1<<4)}, {16*1, 48}, 4}, + {{4|(2<<4)}, {16*2, 64}, 1}, + {{4|(1<<4)}, {16*1, 64}, 1}, + {{2|(6<<4)}, {16*6, 32}, 4}, + {{2|(5<<4)}, {16*5, 32}, 4}, + {{2|(4<<4)}, {16*4, 32}, 4}, + {{2|(3<<4)}, {16*3, 32}, 4}, + {{2|(2<<4)}, {16*2, 32}, 4}, + {{2|(1<<4)}, {16*1, 32}, 4}, + {{3|(0<<4)}, {16*0, 48}, 1}, + {{4|(0<<4)}, {16*0, 64}, 1}, + {{2|(7<<4)}, {16*7, 32}, 4}, + {{2|(8<<4)}, {16*8, 32}, 4}, + {{2|(9<<4)}, {16*9, 32}, 4}, + {{2|(10<<4)}, {16*10, 32}, 4}, + {{2|(11<<4)}, {16*11, 32}, 4}, + {{2|(13<<4)}, {16*13, 32}, 4}, + {{3|(10<<4)}, {16*10, 48}, 4}, + {{3|(11<<4)}, {16*11, 48}, 4}, + {{3|(13<<4)}, {16*13, 48}, 4}, + {{3|(6<<4)}, {16*6, 48}, 4}, + {{3|(7<<4)}, {16*7, 48}, 4}, + {{3|(8<<4)}, {16*8, 48}, 4}, + {{3|(9<<4)}, {16*9, 48}, 4}, + {{4|(8<<4)}, {16*8, 64}, 1}, + {{4|(9<<4)}, {16*9, 64}, 1}, + {{4|(10<<4)}, {16*10, 64}, 1}, + {{4|(11<<4)}, {16*11, 64}, 1}, +}; + +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} diff --git a/keyboards/dztech/dz65rgb/dz65rgb.h b/keyboards/dztech/dz65rgb/dz65rgb.h new file mode 100644 index 00000000000..b251a339f91 --- /dev/null +++ b/keyboards/dztech/dz65rgb/dz65rgb.h @@ -0,0 +1,16 @@ +#pragma once +#define XXX KC_NO +#include "quantum.h" +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K45, K48, K49, K4A, K4B, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, K48, K49, K4A, K4B, XXX, K4D, K4E } \ +} diff --git a/keyboards/dztech/dz65rgb/info.json b/keyboards/dztech/dz65rgb/info.json new file mode 100644 index 00000000000..fe61e5d9733 --- /dev/null +++ b/keyboards/dztech/dz65rgb/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "dz65rgb", + "url": "", + "maintainer": "dztch", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_65_ansi": { + "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, "w":2},{"x":15, "y":0}, {"x":0, "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":13.5, "y":1, "w":1.5},{"x":15, "y":1}, {"x":0, "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":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "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":12.25, "y":3, "w":1.75},{"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/dztech/dz65rgb/keymaps/default/keymap.c b/keyboards/dztech/dz65rgb/keymaps/default/keymap.c new file mode 100644 index 00000000000..bce9118f8f7 --- /dev/null +++ b/keyboards/dztech/dz65rgb/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H +extern bool g_suspend_state; +#define _LAYER0 0 +#define _LAYER1 1 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYER0] = LAYOUT_65_ansi( /* Base */ + 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_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_BSLASH, KC_PGUP,\ + CTL_T(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_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_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + [_LAYER1] = LAYOUT_65_ansi( /* FN */ + KC_GESC, 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_HOME,\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI,RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP,\ + CTL_T(KC_CAPS),RGB_SPI, RGB_SPD, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, EEP_RST, KC_PGDN,\ + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_MUTE,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), +}; + +void rgb_matrix_indicators_user(void) +{ + if (IS_LED_ON(host_keyboard_leds(), USB_LED_CAPS_LOCK)) + { + rgb_matrix_set_color(8, 0xFF, 0xFF, 0xFF); + } +} + +void matrix_init_user(void) +{ + //user initialization +} + +void matrix_scan_user(void) +{ + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + return true; +} diff --git a/keyboards/dztech/dz65rgb/readme.md b/keyboards/dztech/dz65rgb/readme.md new file mode 100644 index 00000000000..7f8aad95f87 --- /dev/null +++ b/keyboards/dztech/dz65rgb/readme.md @@ -0,0 +1,14 @@ +# DZ65RGB + +A customizable 65% RGB keyboard. + +Keyboard Maintainer: [DZtech](http://keyboarddiy.taobao.com) +Hardware Supported: [DZtech](http://keyboarddiy.taobao.com) +Hardware Availability: [kbdfans](https://kbdfans.myshopify.com/) + + +Make example for this keyboard (after setting up your build environment): + + make dztech/dz65rgb:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/dztech/dz65rgb/rules.mk b/keyboards/dztech/dz65rgb/rules.mk new file mode 100644 index 00000000000..7dc3bd9690c --- /dev/null +++ b/keyboards/dztech/dz65rgb/rules.mk @@ -0,0 +1,12 @@ +MCU = STM32F303 +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no +RGB_MATRIX_ENABLE = yes # Use RGB matrix + +LAYOUTS = 65_ansi From 29f68459a01c155ca64aed4ec0ba083d0dee0d2e Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Fri, 3 May 2019 22:20:23 +0900 Subject: [PATCH 086/129] Fix LIB_SRC insert position (#5731) The insertion point for `$(patsubst %.c,%.clib,$(LIB_SRC))` must be after all normal `SRC += ..` . I modified it to be so. Because LIB_SRC and SRC are assumed to be used in pairs. Similarly, QUANTUM_LIB_SRC and QUANTUM_SRC are assumed to be used in pairs. --- build_keyboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index 510923ebe12..213cb44456e 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -324,7 +324,6 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") endif # # project specific files -SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) SRC += $(KEYBOARD_SRC) \ $(KEYMAP_C) \ $(QUANTUM_SRC) @@ -343,6 +342,7 @@ include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/common.mk include bootloader.mk +SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) SRC += $(TMK_COMMON_SRC) OPT_DEFS += $(TMK_COMMON_DEFS) From 41beecfc1847bd0039c508753a212fa18f207e3f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 3 May 2019 08:24:22 -0700 Subject: [PATCH 087/129] Add DFU Suffix for ARM boards (#5763) * Add DFU Suffix for ARM boards * Blindly flash DFU SUFFIX ARGS for now * Fix commented out check * Fix DFU Suffix Argument check Thank you jack! * Update Travis CI Scripts to include dfu-util So we can get dfu-suffix as well * Manually add dfu-suffix package * Use external repo for newer version of dfu-util One that includes dfu-suffix * Update .travis.yml * Silence unnecessary output from dfu-suffix --- .travis.yml | 4 ++++ keyboards/candybar/rules.mk | 1 + keyboards/clueboard/60/rules.mk | 1 + keyboards/clueboard/66/rev4/rules.mk | 1 + keyboards/clueboard/66_hotswap/gen1/rules.mk | 1 + keyboards/dztech/dz40rgb/rules.mk | 1 + keyboards/dztech/dz60rgb/rules.mk | 1 + keyboards/ergodox_infinity/rules.mk | 1 + keyboards/hs60/v2/keymaps/ansi_via/rules.mk | 1 + keyboards/hs60/v2/keymaps/default_via/rules.mk | 1 + keyboards/hs60/v2/keymaps/goatmaster/rules.mk | 1 + keyboards/hs60/v2/keymaps/hhkb_via/rules.mk | 1 + keyboards/hs60/v2/keymaps/iso_andys8/rules.mk | 1 + keyboards/hs60/v2/keymaps/stanrc85/rules.mk | 1 + keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk | 1 + keyboards/hs60/v2/rules.mk | 1 + keyboards/infinity60/rules.mk | 1 + keyboards/k_type/rules.mk | 1 + keyboards/vinta/rules.mk | 1 + keyboards/whitefox/rules.mk | 1 + quantum/mcu_selection.mk | 1 + quantum/stm32/proton_c.mk | 1 + tmk_core/chibios.mk | 5 +++++ 23 files changed, 30 insertions(+) diff --git a/.travis.yml b/.travis.yml index a50b205ec07..796be6c045b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,14 @@ env: - MAKEFLAGS="-j3 --output-sync" before_install: - 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 + # Need DFU > .5 for dfu-suffix + - sudo add-apt-repository --yes ppa:tormodvolden/ppa + - sudo apt-get update -qq 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" - npm install -g moxygen + - sudo apt-get -y --force-yes install dfu-util before_script: - avr-gcc --version script: diff --git a/keyboards/candybar/rules.mk b/keyboards/candybar/rules.mk index 6f39ee0e74a..0bc9a5b3e69 100644 --- a/keyboards/candybar/rules.mk +++ b/keyboards/candybar/rules.mk @@ -31,6 +31,7 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/clueboard/60/rules.mk b/keyboards/clueboard/60/rules.mk index aada0735259..a0927025bb5 100644 --- a/keyboards/clueboard/60/rules.mk +++ b/keyboards/clueboard/60/rules.mk @@ -35,6 +35,7 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/clueboard/66/rev4/rules.mk b/keyboards/clueboard/66/rev4/rules.mk index 846b1eee0b7..4d20ff2e96e 100644 --- a/keyboards/clueboard/66/rev4/rules.mk +++ b/keyboards/clueboard/66/rev4/rules.mk @@ -13,6 +13,7 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/clueboard/66_hotswap/gen1/rules.mk b/keyboards/clueboard/66_hotswap/gen1/rules.mk index 6b1ee92c180..326912a34b8 100644 --- a/keyboards/clueboard/66_hotswap/gen1/rules.mk +++ b/keyboards/clueboard/66_hotswap/gen1/rules.mk @@ -37,6 +37,7 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # LED Configuration LED_MATRIX_ENABLE = IS31FL3731 diff --git a/keyboards/dztech/dz40rgb/rules.mk b/keyboards/dztech/dz40rgb/rules.mk index 99cbafb8cc5..d0ddec838cc 100644 --- a/keyboards/dztech/dz40rgb/rules.mk +++ b/keyboards/dztech/dz40rgb/rules.mk @@ -40,6 +40,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/dztech/dz60rgb/rules.mk b/keyboards/dztech/dz60rgb/rules.mk index 98e95c88dfe..20ca7f2eb64 100644 --- a/keyboards/dztech/dz60rgb/rules.mk +++ b/keyboards/dztech/dz60rgb/rules.mk @@ -35,6 +35,7 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 BACKLIGHT_ENABLE = no diff --git a/keyboards/ergodox_infinity/rules.mk b/keyboards/ergodox_infinity/rules.mk index 1cc95193cb5..af8e9ef200c 100644 --- a/keyboards/ergodox_infinity/rules.mk +++ b/keyboards/ergodox_infinity/rules.mk @@ -59,6 +59,7 @@ OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 # DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) diff --git a/keyboards/hs60/v2/keymaps/ansi_via/rules.mk b/keyboards/hs60/v2/keymaps/ansi_via/rules.mk index a2850a83057..deb4fc889b9 100644 --- a/keyboards/hs60/v2/keymaps/ansi_via/rules.mk +++ b/keyboards/hs60/v2/keymaps/ansi_via/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/hs60/v2/keymaps/default_via/rules.mk b/keyboards/hs60/v2/keymaps/default_via/rules.mk index a2850a83057..deb4fc889b9 100644 --- a/keyboards/hs60/v2/keymaps/default_via/rules.mk +++ b/keyboards/hs60/v2/keymaps/default_via/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/hs60/v2/keymaps/goatmaster/rules.mk b/keyboards/hs60/v2/keymaps/goatmaster/rules.mk index a2850a83057..deb4fc889b9 100644 --- a/keyboards/hs60/v2/keymaps/goatmaster/rules.mk +++ b/keyboards/hs60/v2/keymaps/goatmaster/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/hs60/v2/keymaps/hhkb_via/rules.mk b/keyboards/hs60/v2/keymaps/hhkb_via/rules.mk index a2850a83057..deb4fc889b9 100644 --- a/keyboards/hs60/v2/keymaps/hhkb_via/rules.mk +++ b/keyboards/hs60/v2/keymaps/hhkb_via/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/hs60/v2/keymaps/iso_andys8/rules.mk b/keyboards/hs60/v2/keymaps/iso_andys8/rules.mk index a2850a83057..deb4fc889b9 100644 --- a/keyboards/hs60/v2/keymaps/iso_andys8/rules.mk +++ b/keyboards/hs60/v2/keymaps/iso_andys8/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/hs60/v2/keymaps/stanrc85/rules.mk b/keyboards/hs60/v2/keymaps/stanrc85/rules.mk index c46a6b9528c..817785d7aac 100644 --- a/keyboards/hs60/v2/keymaps/stanrc85/rules.mk +++ b/keyboards/hs60/v2/keymaps/stanrc85/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk b/keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk index c89d9096957..05193af4bbc 100644 --- a/keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk +++ b/keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/hs60/v2/rules.mk b/keyboards/hs60/v2/rules.mk index 5659d28c9ff..64948c2e9a7 100644 --- a/keyboards/hs60/v2/rules.mk +++ b/keyboards/hs60/v2/rules.mk @@ -45,6 +45,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/infinity60/rules.mk b/keyboards/infinity60/rules.mk index 8cb2b375595..1f02e05c84c 100644 --- a/keyboards/infinity60/rules.mk +++ b/keyboards/infinity60/rules.mk @@ -58,6 +58,7 @@ OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 # DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) diff --git a/keyboards/k_type/rules.mk b/keyboards/k_type/rules.mk index a1c56903b5c..7762f186820 100644 --- a/keyboards/k_type/rules.mk +++ b/keyboards/k_type/rules.mk @@ -57,6 +57,7 @@ ARMV = 7 OPT_DEFS = DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 # Build Options # comment out to disable the options. diff --git a/keyboards/vinta/rules.mk b/keyboards/vinta/rules.mk index 9d89d966363..3ddb8d5bc0d 100644 --- a/keyboards/vinta/rules.mk +++ b/keyboards/vinta/rules.mk @@ -33,6 +33,7 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/whitefox/rules.mk b/keyboards/whitefox/rules.mk index 9f222bf4f30..d9aa911c54e 100644 --- a/keyboards/whitefox/rules.mk +++ b/keyboards/whitefox/rules.mk @@ -55,6 +55,7 @@ ARMV = 7 OPT_DEFS = DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 # Build Options # comment out to disable the options. diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk index 209b578ea55..fa6dc8b53ca 100644 --- a/quantum/mcu_selection.mk +++ b/quantum/mcu_selection.mk @@ -34,6 +34,7 @@ ifneq ($(findstring STM32F303, $(MCU)),) # Options to pass to dfu-util when flashing DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave + DFU_SUFFIX_ARGS = -p DF11 -v 0483 endif ifneq (,$(filter $(MCU),atmega32u4 at90usb1286)) diff --git a/quantum/stm32/proton_c.mk b/quantum/stm32/proton_c.mk index a0fa013736b..a65e283d3f1 100644 --- a/quantum/stm32/proton_c.mk +++ b/quantum/stm32/proton_c.mk @@ -42,3 +42,4 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p df11 -v 0483 diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 01edebfd74c..44c00bdd151 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -201,6 +201,7 @@ DFU_ARGS ?= ifneq ("$(SERIAL)","") DFU_ARGS += -S $(SERIAL) endif +DFU_SUFFIX_ARGS ?= ST_LINK_ARGS ?= @@ -208,6 +209,7 @@ ST_LINK_ARGS ?= EXTRALIBDIRS = $(RULESPATH)/ld DFU_UTIL ?= dfu-util +DFU_SUFFIX ?= dfu-suffix ST_LINK_CLI ?= st-link_cli # Generate a .qmk for the QMK-FF @@ -259,4 +261,7 @@ st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst bin: $(BUILD_DIR)/$(TARGET).bin sizeafter + if [ ! -z "$(DFU_SUFFIX_ARGS)" ]; then \ + $(DFU_SUFFIX) $(DFU_SUFFIX_ARGS) -a $(BUILD_DIR)/$(TARGET).bin 1>/dev/null ;\ + fi $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; From bdc8d89e6b8f49528b716d9bd3343a4f9e9327bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Fri, 3 May 2019 18:33:00 +0200 Subject: [PATCH 088/129] New keycode macro (XP) for shifted character pairs using UNICODEMAP + bug fixes and improvements (#4803) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Expose unicode_saved_mods * Add UNICODEMAP shift pair functionality and XS keycode * Add XS to keycode reference documentation * Pick pair index based on both Shift and Caps Lock state * Add XS to Unicode feature docs * Clean up process_unicode* headers * Extract unicode_map index calculation into function * Pick pair index as XOR rather than OR of Shift and Caps states * unicode_input_start() has to be called before the unicode_map index is calculated * Replace unicodemap_input_error() with more generic unicode_input_cancel() * Replace register+tap+unregister with tap_code16(LCTL(LSFT(KC_U))) * UNICODE_OSX_KEY → UNICODE_KEY_OSX, UNICODE_WINC_KEY → UNICODE_KEY_WINC * Make keycode range checks more robust * Fix keycode range checks for different input modes * Add UNICODE_KEY_LNX, update docs * QK_UNICODEMAP_SHIFT → QK_UNICODEMAP_PAIR * XS → XP, update docs * Tweak Unicode docs * Use recently added MOD_MASK_SHIFT and IS_HOST_LED_ON helpers * Update Unicode table in docs/keycodes.md * Update Unicode docs per review comments * Replace references to Mac OS X with macOS in Unicode docs * As of v0.9.0, WinCompose supports all possible code points * Expand descriptions in XP docs * Update keycode table and cycling docs * Further expand cycling docs --- docs/feature_unicode.md | 83 ++++++++++++------- docs/keycodes.md | 16 +++- quantum/process_keycode/process_unicode.c | 6 +- quantum/process_keycode/process_unicode.h | 2 +- .../process_keycode/process_unicode_common.c | 38 ++++++--- .../process_keycode/process_unicode_common.h | 13 ++- quantum/process_keycode/process_unicodemap.c | 36 +++++--- quantum/process_keycode/process_unicodemap.h | 4 +- quantum/quantum_keycodes.h | 7 +- users/konstantin/config.h | 2 +- 10 files changed, 133 insertions(+), 74 deletions(-) diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index 1bc3c89d202..778cdc69cb0 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -4,11 +4,11 @@ There are three Unicode keymap definition methods available in QMK: ## `UNICODE_ENABLE` -Supports Unicode up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. The keycode function is `UC(c)` in the keymap file, where _c_ is the code point's number (preferably hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`. +Supports Unicode up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. The keycode function is `UC(c)` in the keymap, where _c_ is the code point's number (preferably hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`. ## `UNICODEMAP_ENABLE` -Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(i)`, where _i_ is an array index into the mapping table. The table may contain at most 1024 entries. +Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(i)`, where _i_ is an array index into the mapping table. The table may contain at most 16384 entries. You may want to have an enum to make referencing easier. So, you could add something like this to your keymap file: @@ -26,13 +26,21 @@ const uint32_t PROGMEM unicode_map[] = { }; ``` -Then you can use `X(BANG)` etc. in your keymap. +Then you can use `X(BANG)`, `X(SNEK)` etc. in your keymap. + +### Lower and Upper Case + +Characters often come in lower and upper case pairs, for example: å, Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear. + +This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP`. This blends Unicode keys in with regular alphas. + +Due to keycode size constraints, _i_ and _j_ can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ _i_ ≤ 127 and 0 ≤ _j_ ≤ 127. This is enough for most use cases, but if you'd like to customize the index calculation, you can override the [`unicodemap_index()`](https://github.com/qmk/qmk_firmware/blob/71f640d47ee12c862c798e1f56392853c7b1c1a8/quantum/process_keycode/process_unicodemap.c#L40) function. This also allows you to, say, check Ctrl instead of Shift/Caps. ## `UCIS_ENABLE` -Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you will have to add a keycode or function that calls `qk_ucis_start()`. Once this function's been called, you can type the corresponding mnemonic for your character, then hit Space or Enter to complete it, or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode character inserted. +Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you have to add a keycode or function that calls `qk_ucis_start()`. Once this function has been called, you can type the corresponding mnemonic for your character, then hit Space or Enter to complete it, or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode character inserted. -For instance, you would define a table like this in your keymap file: +For instance, you could define a table like this in your keymap file: ```c const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( @@ -42,7 +50,7 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( ); ``` -You call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and input the laughing emoji. +To use it, call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and insert the laughing emoji. ### Customization @@ -60,28 +68,29 @@ Unicode input in QMK works by inputting a sequence of characters to the OS, sort The following input modes are available: -* **`UC_OSX`**: Mac OS X built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`). +* **`UC_OSX`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`). To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar. - By default, this mode uses the left Option key (`KC_LALT`), but this can be changed by defining [`UNICODE_OSX_KEY`](#input-key-configuration) with another keycode. + By default, this mode uses the left Option key (`KC_LALT`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_OSX`](#input-key-configuration) with another keycode. - **Note:** Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as: Option + Left Arrow (`moveWordLeftAndModifySelection`) and Option + Right Arrow (`moveWordRightAndModifySelection`). + !> Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as Option + Left Arrow and Option + Right Arrow. * **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points). Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else. + By default, this mode uses Ctrl+Shift+U (`LCTL(LSFT(KC_U))`) to start Unicode input, but this can be changed by defining [`UNICODE_KEY_LNX`](#input-key-configuration) with another keycode. This might be required for IBus versions ≥1.5.15, where Ctrl+Shift+U behavior is consolidated into Ctrl+Shift+E. * **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`. - To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Afterwards, reboot. + To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Reboot afterwards. This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead. * **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues). -* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.8.2, supports code points up to `0xFFFFF` (all currently assigned code points). +* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.9.0, supports code points up to `0x10FFFF` (all possible code points). To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. Works reliably under all version of Windows supported by the app. - By default, this mode uses the right Alt key (`KC_RALT`), but this can be changed in the WinCompose settings and by defining [`UNICODE_WINC_KEY`](#input-key-configuration) with another keycode. + By default, this mode uses right Alt (`KC_RALT`) as the Compose key, but this can be changed in the WinCompose settings and by defining [`UNICODE_KEY_WINC`](#input-key-configuration) with another keycode. ### Switching Input Modes @@ -89,17 +98,17 @@ There are two ways to set the input mode for Unicode: by keycode or by function. You can switch the input mode at any time by using one of the following keycodes. The easiest way is to add the ones you use to your keymap. -|Keycode |Alias |Input mode |Description | -|-----------------------|---------|-------------|-----------------------------------------| -|`UNICODE_MODE_FORWARD` |`UC_MOD` | |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| -|`UNICODE_MODE_REVERSE` |`UC_RMOD`| |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| -|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to Mac OS X input. | -|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input. | -|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input. | -|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented). | -|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose.| +|Keycode |Alias |Input Mode |Description | +|----------------------|---------|------------|--------------------------------------------------------------| +|`UNICODE_MODE_FORWARD`|`UC_MOD` |Next in list|[Cycle](#input-mode-cycling) through selected modes | +|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Prev in list|[Cycle](#input-mode-cycling) through selected modes in reverse| +|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to macOS input | +|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input | +|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input | +|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented) | +|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose | -You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user` (or a similar function). For example: +You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user()` (or a similar function). For example: ```c void eeconfig_init_user(void) { @@ -123,35 +132,45 @@ For instance, you can add these definitions to your `config.h` file: ### Additional Customization -Because Unicode is such a large and variable feature, there are a number of options that you can customize to work better on your system. +Because Unicode is a large and versatile feature, there are a number of options you can customize to make it work better on your system. -#### Start and Finish input functions +#### Start and Finish Input Functions The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input. -* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on Mac. +* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on macOS. * `void unicode_input_finish(void)` – This is called to exit Unicode input mode, for example by pressing Space or releasing the Option key. You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c). - #### Input Key Configuration -Additionally, you can customize the keys used to trigger the unicode input for macOS and WinCompose by adding defines to your `config.h` +You can customize the keys used to trigger Unicode input for macOS, Linux and WinCompose by adding corresponding defines to your `config.h`. The default values match the platforms' default settings, so you shouldn't need to change this unless Unicode input isn't working, or you want to use a different key (e.g. in order to free up left or right Alt). + +|Define |Type |Default |Example | +|------------------|----------|------------------|-------------------------------------------| +|`UNICODE_KEY_OSX` |`uint8_t` |`KC_LALT` |`#define UNICODE_KEY_OSX KC_RALT` | +|`UNICODE_KEY_LNX` |`uint16_t`|`LCTL(LSFT(KC_U))`|`#define UNICODE_KEY_LNX LCTL(LSFT(KC_E))`| +|`UNICODE_KEY_WINC`|`uint8_t` |`KC_RALT` |`#define UNICODE_KEY_WINC KC_RGUI` | + +#### Input Mode Cycling + +You can choose which input modes are available for cycling through. By default, this is disabled. If you want to enable it, limiting it to just the modes you use makes sense. Note that the values in the list are comma-delimited. ```c -#define UNICODE_OSX_KEY KC_LALT -#define UNICODE_WINC_KEY KC_RALT +#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_WINC ``` -#### Input Method Cycling +You can cycle through the selected modes by using the `UC_MOD`/`UC_RMOD` keycodes, or by calling `cycle_unicode_input_mode(offset)` in your code (`offset` is how many modes to move forward by, so +1 corresponds to `UC_MOD`). -Also, you can choose which input methods are availble for cycling through. By default, this is disabled. But if you want to enabled it, then limiting it to just those modes makes sense. Note that `UNICODE_SELECTED_MODES` define is comma delimited. +By default, when the keyboard boots, it will initialize the input mode to the last one you used. You can disable this and make it start with the first mode in the list every time by adding the following to your `config.h`: ```c -#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_BSD, UC_WINC +#define UNICODE_CYCLE_PERSIST false ``` +!> Using `UNICODE_SELECTED_MODES` means you don't have to initially set the input mode in `matrix_init_user()` (or a similar function); the Unicode system will do that for you on startup. This has the added benefit of avoiding unnecessary writes to EEPROM. + ## `send_unicode_hex_string` To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values separate by spaces. diff --git a/docs/keycodes.md b/docs/keycodes.md index 91578414d19..c0e6aa5c63e 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -450,7 +450,15 @@ This is a reference only. Each group of keys links to the page documenting their ## [Unicode Support](feature_unicode.md) -|Key |Description | -|-------|---------------------------------------------------------------------------| -|`UC(c)`|Send Unicode code point `c` (`UNICODE_ENABLE`) | -|`X(i)` |Send Unicode code point at index `i` in `unicode_map` (`UNICODEMAP_ENABLE`)| +|Key |Aliases |Description | +|----------------------|---------|----------------------------------------------------------------| +|`UC(c)` | |Send Unicode code point `c` | +|`X(i)` | |Send Unicode code point at index `i` in `unicode_map` | +|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on| +|`UNICODE_MODE_FORWARD`|`UC_MOD` |Cycle through selected input modes | +|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Cycle through selected input modes in reverse | +|`UNICODE_MODE_OSX` |`UC_M_OS`|Switch to macOS input | +|`UNICODE_MODE_LNX` |`UC_M_LN`|Switch to Linux input | +|`UNICODE_MODE_WIN` |`UC_M_WI`|Switch to Windows input | +|`UNICODE_MODE_BSD` |`UC_M_BS`|Switch to BSD input (not implemented) | +|`UNICODE_MODE_WINC` |`UC_M_WC`|Switch to Windows input using WinCompose | diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 19beb84520b..2c914013ac0 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -13,15 +13,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "process_unicode.h" #include "action_util.h" #include "eeprom.h" bool process_unicode(uint16_t keycode, keyrecord_t *record) { - if (keycode > QK_UNICODE && record->event.pressed) { - uint16_t unicode = keycode & 0x7FFF; + if (keycode >= QK_UNICODE && keycode <= QK_UNICODE_MAX && record->event.pressed) { unicode_input_start(); - register_hex(unicode); + register_hex(keycode & 0x7FFF); unicode_input_finish(); } return true; diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index 0913e991075..22765ad5604 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -13,9 +13,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once -#include "quantum.h" #include "process_unicode_common.h" bool process_unicode(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index d0a9cf2324d..21ac2291dba 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -20,6 +20,8 @@ #include unicode_config_t unicode_config; +uint8_t unicode_saved_mods; + #if UNICODE_SELECTED_MODES != -1 static uint8_t selected[] = { UNICODE_SELECTED_MODES }; static uint8_t selected_count = sizeof selected / sizeof *selected; @@ -75,30 +77,24 @@ void persist_unicode_input_mode(void) { eeprom_update_byte(EECONFIG_UNICODEMODE, unicode_config.input_mode); } -static uint8_t saved_mods; - __attribute__((weak)) void unicode_input_start(void) { - saved_mods = get_mods(); // Save current mods + unicode_saved_mods = get_mods(); // Save current mods clear_mods(); // Unregister mods to start from a clean state switch (unicode_config.input_mode) { case UC_OSX: - register_code(UNICODE_OSX_KEY); + register_code(UNICODE_KEY_OSX); break; case UC_LNX: - register_code(KC_LCTL); - register_code(KC_LSFT); - tap_code(KC_U); // TODO: Replace with tap_code16(LCTL(LSFT(KC_U))); and test - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); + tap_code16(UNICODE_KEY_LNX); break; case UC_WIN: register_code(KC_LALT); tap_code(KC_PPLS); break; case UC_WINC: - tap_code(UNICODE_WINC_KEY); + tap_code(UNICODE_KEY_WINC); tap_code(KC_U); break; } @@ -110,7 +106,7 @@ __attribute__((weak)) void unicode_input_finish(void) { switch (unicode_config.input_mode) { case UC_OSX: - unregister_code(UNICODE_OSX_KEY); + unregister_code(UNICODE_KEY_OSX); break; case UC_LNX: tap_code(KC_SPC); @@ -123,7 +119,25 @@ void unicode_input_finish(void) { break; } - set_mods(saved_mods); // Reregister previously set mods + set_mods(unicode_saved_mods); // Reregister previously set mods +} + +__attribute__((weak)) +void unicode_input_cancel(void) { + switch (unicode_config.input_mode) { + case UC_OSX: + unregister_code(UNICODE_KEY_OSX); + break; + case UC_LNX: + case UC_WINC: + tap_code(KC_ESC); + break; + case UC_WIN: + unregister_code(KC_LALT); + break; + } + + set_mods(unicode_saved_mods); // Reregister previously set mods } __attribute__((weak)) diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index e608ab76be7..7340800e567 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -23,11 +23,14 @@ #endif // Keycodes used for starting Unicode input on different platforms -#ifndef UNICODE_OSX_KEY - #define UNICODE_OSX_KEY KC_LALT +#ifndef UNICODE_KEY_OSX + #define UNICODE_KEY_OSX KC_LALT #endif -#ifndef UNICODE_WINC_KEY - #define UNICODE_WINC_KEY KC_RALT +#ifndef UNICODE_KEY_LNX + #define UNICODE_KEY_LNX LCTL(LSFT(KC_U)) +#endif +#ifndef UNICODE_KEY_WINC + #define UNICODE_KEY_WINC KC_RALT #endif // Comma-delimited, ordered list of input modes selected for use (e.g. in cycle) @@ -63,6 +66,7 @@ typedef union { } unicode_config_t; extern unicode_config_t unicode_config; +extern uint8_t unicode_saved_mods; void unicode_input_mode_init(void); uint8_t get_unicode_input_mode(void); @@ -72,6 +76,7 @@ void persist_unicode_input_mode(void); void unicode_input_start(void); void unicode_input_finish(void); +void unicode_input_cancel(void); void register_hex(uint16_t hex); void send_unicode_hex_string(const char *str); diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c index 32740276130..b8878798606 100644 --- a/quantum/process_keycode/process_unicodemap.c +++ b/quantum/process_keycode/process_unicodemap.c @@ -15,7 +15,6 @@ */ #include "process_unicodemap.h" -#include "process_unicode_common.h" void register_hex32(uint32_t hex) { bool onzerostart = true; @@ -38,28 +37,39 @@ void register_hex32(uint32_t hex) { } __attribute__((weak)) -void unicodemap_input_error() {} +uint16_t unicodemap_index(uint16_t keycode) { + if (keycode >= QK_UNICODEMAP_PAIR) { + // Keycode is a pair: extract index based on Shift / Caps Lock state + uint16_t index = keycode - QK_UNICODEMAP_PAIR; + + bool shift = unicode_saved_mods & MOD_MASK_SHIFT, caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK); + if (shift ^ caps) { index >>= 7; } + + return index & 0x7F; + } else { + // Keycode is a regular index + return keycode - QK_UNICODEMAP; + } +} bool process_unicodemap(uint16_t keycode, keyrecord_t *record) { - if ((keycode & QK_UNICODEMAP) == QK_UNICODEMAP && record->event.pressed) { - uint16_t index = keycode - QK_UNICODEMAP; - uint32_t code = pgm_read_dword(unicode_map + index); + if (keycode >= QK_UNICODEMAP && keycode <= QK_UNICODEMAP_PAIR_MAX && record->event.pressed) { + unicode_input_start(); + + uint32_t code = pgm_read_dword(unicode_map + unicodemap_index(keycode)); uint8_t input_mode = get_unicode_input_mode(); - if (code > 0xFFFF && code <= 0x10FFFF && input_mode == UC_OSX) { - // Convert to UTF-16 surrogate pair + if (code > 0x10FFFF || (code > 0xFFFF && input_mode == UC_WIN)) { + // Character is out of range supported by the platform + unicode_input_cancel(); + } else if (code > 0xFFFF && input_mode == UC_OSX) { + // Convert to UTF-16 surrogate pair on Mac code -= 0x10000; uint32_t lo = code & 0x3FF, hi = (code & 0xFFC00) >> 10; - - unicode_input_start(); register_hex32(hi + 0xD800); register_hex32(lo + 0xDC00); unicode_input_finish(); - } else if ((code > 0x10FFFF && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) { - // Character is out of range supported by the OS - unicodemap_input_error(); } else { - unicode_input_start(); register_hex32(code); unicode_input_finish(); } diff --git a/quantum/process_keycode/process_unicodemap.h b/quantum/process_keycode/process_unicodemap.h index fe4f979155e..51709c5dc8a 100644 --- a/quantum/process_keycode/process_unicodemap.h +++ b/quantum/process_keycode/process_unicodemap.h @@ -16,10 +16,10 @@ #pragma once -#include "quantum.h" #include "process_unicode_common.h" extern const uint32_t PROGMEM unicode_map[]; -void unicodemap_input_error(void); +void register_hex32(uint32_t hex); +uint16_t unicodemap_index(uint16_t keycode); bool process_unicodemap(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 19bd7c21658..779c355efc0 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -87,7 +87,9 @@ enum quantum_keycodes { #endif #ifdef UNICODEMAP_ENABLE QK_UNICODEMAP = 0x8000, - QK_UNICODEMAP_MAX = 0x83FF, + QK_UNICODEMAP_MAX = 0xBFFF, + QK_UNICODEMAP_PAIR = 0xC000, + QK_UNICODEMAP_PAIR_MAX = 0xFFFF, #endif // Loose keycodes - to be used directly @@ -712,7 +714,8 @@ enum quantum_keycodes { #endif #ifdef UNICODEMAP_ENABLE // Allows Unicode input up to 0x10FFFF, requires unicode_map - #define X(i) (QK_UNICODEMAP | (i)) + #define X(i) (QK_UNICODEMAP | (i)) + #define XP(i, j) (QK_UNICODEMAP_PAIR | ((i) & 0x7F) | (((j) & 0x7F) << 7)) // 127 max i and j #endif #define UC_MOD UNICODE_MODE_FORWARD diff --git a/users/konstantin/config.h b/users/konstantin/config.h index f18c4a70e45..4ca19f82452 100644 --- a/users/konstantin/config.h +++ b/users/konstantin/config.h @@ -19,4 +19,4 @@ #define UNICODE_CYCLE_PERSIST false #define UNICODE_SELECTED_MODES UC_WINC, UC_WIN, UC_LNX -#define UNICODE_WINC_KEY KC_RGUI +#define UNICODE_KEY_WINC KC_RGUI From da995d2aeace38cd548c77f341920fab49501ded Mon Sep 17 00:00:00 2001 From: zvecr Date: Sat, 4 May 2019 01:24:07 +0100 Subject: [PATCH 089/129] [Docs] Add examples to debugging docs (#5555) * Add examples to debugging docs * Add examples to debugging docs - review comments * Update matrix keypress example to use uprintf --- docs/newbs_testing_debugging.md | 60 +++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/docs/newbs_testing_debugging.md b/docs/newbs_testing_debugging.md index d78311339d7..771846b4099 100644 --- a/docs/newbs_testing_debugging.md +++ b/docs/newbs_testing_debugging.md @@ -13,9 +13,9 @@ Note: These programs are not provided by or endorsed by QMK. * [Keyboard Tester](http://www.keyboardtester.com) (Web Based) * [Keyboard Checker](http://keyboardchecker.com) (Web Based) -## Debugging With QMK Toolbox +## Debugging -[QMK Toolbox](https://github.com/qmk/qmk_toolbox) will show messages from your keyboard if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap. +Your keyboard will output debug information if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap. ```c void keyboard_post_init_user(void) { @@ -27,6 +27,14 @@ void keyboard_post_init_user(void) { } ``` +### Debugging With QMK Toolbox + +For compatible platforms, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) can be used to display debug messages from your keyboard. + +### Debugging With hid_listen + +Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provided by PJRC, can also be used to display debug messages. Prebuilt binaries for Windows,Linux,and MacOS are available. + ## Sending Your Own Debug Messages @@ -41,3 +49,51 @@ After that you can use a few different print functions: * `uprintf("%s string", var)`: Print a formatted string * `dprint("string")` Print a simple string, but only when debug mode is enabled * `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled + +## Debug Examples + +Below is a collection of real world debugging examples. For additional information, refer to [Debugging/Troubleshooting QMK](faq_debug.md). + +### Which matrix position is this keypress? + +When porting, or when attempting to diagnose pcb issues, it can be useful to know if a keypress is scanned correctly. To enable logging for this scenario, add the following code to your keymaps `keymap.c` + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // If console is enabled, it will print the matrix position and status of each key pressed +#ifdef CONSOLE_ENABLE + uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); +#endif + return true; +} +``` + +Example output +```text +Waiting for device:....... +Listening: +KL: kc: 169, col: 0, row: 0, pressed: 1 +KL: kc: 169, col: 0, row: 0, pressed: 0 +KL: kc: 174, col: 1, row: 0, pressed: 1 +KL: kc: 174, col: 1, row: 0, pressed: 0 +KL: kc: 172, col: 2, row: 0, pressed: 1 +KL: kc: 172, col: 2, row: 0, pressed: 0 +``` + +### How long did it take to scan for a keypress? + +When testing performance issues, it can be useful to know the frequency at which the switch matrix is being scanned. To enable logging for this scenario, add the following code to your keymaps `config.h` + +```c +#define DEBUG_MATRIX_SCAN_RATE +``` + +Example output +```text + > matrix scan frequency: 315 + > matrix scan frequency: 313 + > matrix scan frequency: 316 + > matrix scan frequency: 316 + > matrix scan frequency: 316 + > matrix scan frequency: 316 +``` From b9f060c98ca8245d105d2f79f3fa675877d0c3da Mon Sep 17 00:00:00 2001 From: Oliver Granlund Date: Sat, 4 May 2019 03:25:24 +0300 Subject: [PATCH 090/129] [Keymap] DZ60 keymap and layout (#5474) * init * function layout planning * nordic keymap v1.0 * Added latest satan layouts, updated readmes * Cleaning code * Renamed ISO -> iso * Updated keymap to work better with Swedish layout * merge conflict * Added dz60 layout * pr issues fixes * removed weirdly positioned files * code cleanup, added dz60 layout json data * Added dz60 layout readme * Renamed layout * removed vscode file * Update keyboards/dz60/dz60.h Co-Authored-By: OlliGranlund --- keyboards/dz60/dz60.h | 27 +++++++++++++ keyboards/dz60/info.json | 4 ++ .../dz60/keymaps/olligranlund_iso/keymap.c | 38 +++++++++++++++++++ .../dz60/keymaps/olligranlund_iso/readme.md | 6 +++ .../satan/keymaps/olligranlund_iso/keymap.c | 3 ++ .../satan/keymaps/olligranlund_iso/rules.mk | 2 +- 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 keyboards/dz60/keymaps/olligranlund_iso/keymap.c create mode 100644 keyboards/dz60/keymaps/olligranlund_iso/readme.md diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 202bd1db4d4..e6045be4346 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -386,4 +386,31 @@ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, k4e } \ } +/* LAYOUT_60_iso_split_space_bs_rshift + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ + * │30 |31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┼───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘ +*/ +#define LAYOUT_60_iso_split_space_bs_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4c, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO,k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ +} + #endif diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 6a30234962a..1eb2d6c8c7b 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -60,6 +60,10 @@ "LAYOUT_60_tsangan_hhkb": { "key_count": 62, "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":"~", "x":14, "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":"Backspace", "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, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"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":7}, {"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}] + }, + "LAYOUT_60_iso_split_space_bs_rshift": { + "key_count": 66, + "layout": [{"label":"¬", "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":"Del", "x":13, "y":0, "w":1}, {"label":"Backspace", "x":14, "y":0, "w":1}, {"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":"CapsLock", "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":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "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":"Print screen", "x":14, "y":3, "w":1}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] } } } diff --git a/keyboards/dz60/keymaps/olligranlund_iso/keymap.c b/keyboards/dz60/keymaps/olligranlund_iso/keymap.c new file mode 100644 index 00000000000..5b804701339 --- /dev/null +++ b/keyboards/dz60/keymaps/olligranlund_iso/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +/* ISO 60 layout by olligranlund +* +* This layout starts from a standard ISO 60% layout, and adds one function layer. +* If you wish to only have one wide spacebar, you can easily do that by dismissing the "side" spacebar switches. +* +* Default Layer +* ,-----------------------------------------------------------------------------------------. +* | Esc | 1 ! | 2 " | 3 § | 4 $ | 5 % | 6 & | 7 / | 8 ( | 9 ) | 0 = | ß ? | ´ ` | Del | BSPC| +* |-----------------------------------------------------------------------------------------| +* | Tab | Q | W | E | R | T | Y | U | I | O | P | Ä | + * | Enter | +* |---------------------------------------------------------------------------------- | +* | FN | A | S | D | F | G | H | J | K | L | Ö | Ü | # ' | | +* |-----------------------------------------------------------------------------------------| +* | Shift | < > | Z | X | C | V | B | N | M | , ; | . : | - _ | Shift |Shift| +* |-----------------------------------------------------------------------------------------| +* | LCtl | LGUI | LAlt | Space | Space | Space | RAlt | FN | App | RCtl | +* `-----------------------------------------------------------------------------------------' +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_60_iso_split_space_bs_rshift( + 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_DEL, 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, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, 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_PSCR, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_NO, KC_APP, KC_RCTL), + + LAYOUT_60_iso_split_space_bs_rshift( + 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, + KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_PGDOWN,KC_UP, KC_PGUP, KC_NO, KC_NO, KC_NO, + KC_NO, KC_VOLD, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT, KC_CAPS, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_NO, KC_APP, KC_RCTL), + +}; diff --git a/keyboards/dz60/keymaps/olligranlund_iso/readme.md b/keyboards/dz60/keymaps/olligranlund_iso/readme.md new file mode 100644 index 00000000000..6aa4007d387 --- /dev/null +++ b/keyboards/dz60/keymaps/olligranlund_iso/readme.md @@ -0,0 +1,6 @@ +# DZ60 with splitted parts +### by Oliver Granlund + +![Finished product](https://i.imgur.com/HlEo5Yg.jpg) + +This is still under progress, but currently works on Windows as a daily driver. \ No newline at end of file diff --git a/keyboards/satan/keymaps/olligranlund_iso/keymap.c b/keyboards/satan/keymaps/olligranlund_iso/keymap.c index 6979092cd2b..789543b56dc 100644 --- a/keyboards/satan/keymaps/olligranlund_iso/keymap.c +++ b/keyboards/satan/keymaps/olligranlund_iso/keymap.c @@ -48,6 +48,9 @@ #define CALC KC_CALC // Open default calculator app #define MYCM KC_MYCM // Open default file manager +// increase readability +#define XXXXX KC_NO + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap BASE: (Base Layer) Default Layer diff --git a/keyboards/satan/keymaps/olligranlund_iso/rules.mk b/keyboards/satan/keymaps/olligranlund_iso/rules.mk index 73106b6749d..3d886f14f58 100644 --- a/keyboards/satan/keymaps/olligranlund_iso/rules.mk +++ b/keyboards/satan/keymaps/olligranlund_iso/rules.mk @@ -13,5 +13,5 @@ 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. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend From 4c14b5832a7598d19a6a1196aaaafd473f7ed920 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 3 May 2019 17:26:29 -0700 Subject: [PATCH 091/129] Fix up ps2avrgb templates (#5606) * fix up ps2avrgb templates * set backlight enable to no as per review comments * add back no_uart --- quantum/template/ps2avrgb/readme.md | 2 ++ quantum/template/ps2avrgb/rules.mk | 4 ++-- quantum/template/ps2avrgb/usbconfig.h | 5 +---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index ef24deb8f75..1449b278cdf 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -16,6 +16,8 @@ Flashing ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. +**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard. + Windows: 1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). 2. Place your keyboard into reset. diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index 191a1384463..bd0eed0527e 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -31,13 +31,13 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = full +BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index d2d848fcdc8..54a7d20f142 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ From 997bafc8ec4ff793d7ded0b9dc3b2fc3d13b81b5 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 3 May 2019 17:28:03 -0700 Subject: [PATCH 092/129] [Keyboard] Refactor S60x (#5596) * remove files that contributed to default hex file creation * fix up rgb pcb rules and config that previously depended on rules and config in a parent directory * use #pragma once * turn on backlight breathing and use #pragma once * fix config.h and rules.mk to not depend on the parent directory * use #pragma once * removed keyboard info.jsons in favor of a shared one * add in hhkb layout and shared info.json file * fixup readme file * remove cruft * use bootmagic lite over yes * fix config path and use pragma once * commit PR fixes * update manufacturer * set bootloader correctly --- keyboards/sentraq/s60_x/config.h | 54 -------------- keyboards/sentraq/s60_x/default/config.h | 35 ++++++++- keyboards/sentraq/s60_x/default/default.h | 23 +++--- keyboards/sentraq/s60_x/default/rules.mk | 73 +++++++++++++++++-- .../sentraq/s60_x/{default => }/info.json | 3 + .../s60_x/keymaps/ansi_qwertz/config.h | 6 +- keyboards/sentraq/s60_x/readme.md | 8 +- keyboards/sentraq/s60_x/rgb/config.h | 28 ++++++- keyboards/sentraq/s60_x/rgb/info.json | 21 ------ keyboards/sentraq/s60_x/rgb/rgb.h | 18 ++++- keyboards/sentraq/s60_x/rgb/rules.mk | 70 +++++++++++++++++- keyboards/sentraq/s60_x/rules.mk | 69 ------------------ keyboards/sentraq/s60_x/s60_x.c | 1 - keyboards/sentraq/s60_x/s60_x.h | 13 ---- 14 files changed, 228 insertions(+), 194 deletions(-) delete mode 100644 keyboards/sentraq/s60_x/config.h rename keyboards/sentraq/s60_x/{default => }/info.json (87%) delete mode 100644 keyboards/sentraq/s60_x/rgb/info.json delete mode 100644 keyboards/sentraq/s60_x/rules.mk delete mode 100644 keyboards/sentraq/s60_x/s60_x.c delete mode 100644 keyboards/sentraq/s60_x/s60_x.h diff --git a/keyboards/sentraq/s60_x/config.h b/keyboards/sentraq/s60_x/config.h deleted file mode 100644 index bb2602dcabc..00000000000 --- a/keyboards/sentraq/s60_x/config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2016 Julien Pecqueur -Copyright 2016 Felix Uhl - -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 Massdrop - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* number of backlight levels */ -#define BACKLIGHT_PIN B7 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 3 -#endif - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -#ifdef SUBPROJECT_default - #include "default/config.h" -#endif -#ifdef SUBPROJECT_rgb - #include "rgb/config.h" -#endif - -#endif diff --git a/keyboards/sentraq/s60_x/default/config.h b/keyboards/sentraq/s60_x/default/config.h index f6b7f8d6833..d7fb79625c7 100644 --- a/keyboards/sentraq/s60_x/default/config.h +++ b/keyboards/sentraq/s60_x/default/config.h @@ -1,15 +1,43 @@ -#ifndef DEFAULT_CONFIG_H -#define DEFAULT_CONFIG_H +#pragma once #include "config_common.h" +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq #define PRODUCT S60-X -#define DESCRIPTION q.m.k. keyboard firmware for S60-X +#define DESCRIPTION QMK keyboard firmware for S60-X +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ #define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 } #define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 } #define UNUSED_PINS { F0 } +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#endif + +/* 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 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + #define LOCKING_SUPPORT_ENABLE #define LOCKING_RESYNC_ENABLE @@ -17,4 +45,3 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#endif diff --git a/keyboards/sentraq/s60_x/default/default.h b/keyboards/sentraq/s60_x/default/default.h index f3646f15590..e330d99bb0e 100644 --- a/keyboards/sentraq/s60_x/default/default.h +++ b/keyboards/sentraq/s60_x/default/default.h @@ -17,16 +17,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef DEFAULT_H -#define DEFAULT_H +#pragma once #include "quantum.h" -#ifdef __INTELLISENSE__ -#define PROGMEM -#include "../config.h" -#endif - /* S60-X keymap definition macro * K31 is the extra key next to short left ISO shift * K2C is the moved key next to enter on ISO boards @@ -67,6 +61,19 @@ along with this program. If not, see . { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ } +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K41, K42, K46, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { XXX, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, XXX, K4B, K4C, XXX, XXX, } \ +} #define LAYOUT_60_ansi_split_bs_rshift( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ @@ -114,5 +121,3 @@ along with this program. If not, see . { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ { KC_##K40, KC_##K41, KC_##K42, XXX, XXX, XXX, KC_##K46, XXX, XXX, XXX, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, XXX } \ } - -#endif diff --git a/keyboards/sentraq/s60_x/default/rules.mk b/keyboards/sentraq/s60_x/default/rules.mk index ce4064d1c6a..af43bf6c5c6 100644 --- a/keyboards/sentraq/s60_x/default/rules.mk +++ b/keyboards/sentraq/s60_x/default/rules.mk @@ -1,5 +1,68 @@ -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # 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 -RGBLIGHT_ENABLE = no + + +# 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 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# 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 +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 + + +LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb \ No newline at end of file diff --git a/keyboards/sentraq/s60_x/default/info.json b/keyboards/sentraq/s60_x/info.json similarity index 87% rename from keyboards/sentraq/s60_x/default/info.json rename to keyboards/sentraq/s60_x/info.json index 1aa2dbf3e00..1e4514ac8ed 100644 --- a/keyboards/sentraq/s60_x/default/info.json +++ b/keyboards/sentraq/s60_x/info.json @@ -11,6 +11,9 @@ "LAYOUT_60_ansi": { "layout": [{"label":"~", "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":"Backspace", "x":13, "y":0, "w":2}, {"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, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"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":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, + "LAYOUT_60_hhkb": { + "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, "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":13.5, "y":1, "w":1.5}, {"x":0, "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":12.75, "y":2, "w":2.25}, {"x":0, "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":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}] + }, "LAYOUT_60_ansi_split_bs_rshift": { "layout": [{"label":"~", "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}, {"x":13, "y":0}, {"x":14, "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, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"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}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, diff --git a/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/config.h b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/config.h index aee65690f32..e960f8c5b73 100644 --- a/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/config.h +++ b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/config.h @@ -1,9 +1,5 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // keymap needs oneshot functionality #undef NO_ACTION_ONESHOT -#endif diff --git a/keyboards/sentraq/s60_x/readme.md b/keyboards/sentraq/s60_x/readme.md index 09ad068e738..927a2f0401c 100644 --- a/keyboards/sentraq/s60_x/readme.md +++ b/keyboards/sentraq/s60_x/readme.md @@ -1,16 +1,16 @@ -S60-x -===== +# S60-x + DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps are based on GH60 code. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/VinnyCordeiro/tmk_keyboard). Keyboard Maintainer: QMK Community Hardware Supported: S60-x PCB Hardware Availability: https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open -There are two versions of this keyboard, an RGB and a non RGB one. +There are two versions of this keyboard, an RGB and a non RGB one. Firmware built for one, will not work on the other. Make example for this keyboard (after setting up your build environment): - make sentraq/s60_x:default + make sentraq/s60_x/default:default Make example for rgb version of this keyboard: diff --git a/keyboards/sentraq/s60_x/rgb/config.h b/keyboards/sentraq/s60_x/rgb/config.h index d9c26658dfd..0e231a72280 100644 --- a/keyboards/sentraq/s60_x/rgb/config.h +++ b/keyboards/sentraq/s60_x/rgb/config.h @@ -1,22 +1,43 @@ -#ifndef RBG_CONFIG_H -#define RBG_CONFIG_H +#pragma once #include "config_common.h" +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq #define PRODUCT S60-X-RGB -#define DESCRIPTION q.m.k. keyboard firmware for S60-X RGB +#define DESCRIPTION QMK keyboard firmware for S60-X RGB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 /* key matrix pins */ #define MATRIX_ROW_PINS { B5, B4, D7, D6, D4 } #define MATRIX_COL_PINS { D0, D1, D2, D3, D5, B6, C6, C7, F1, F0, E6, B3, B2, B1, B0 } #define UNUSED_PINS +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#endif + /* 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 +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + #define RGB_DI_PIN F6 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -26,4 +47,3 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif diff --git a/keyboards/sentraq/s60_x/rgb/info.json b/keyboards/sentraq/s60_x/rgb/info.json deleted file mode 100644 index 1aa2dbf3e00..00000000000 --- a/keyboards/sentraq/s60_x/rgb/info.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "keyboard_name": "S60-X", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "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}, {"x":13, "y":0}, {"x":14, "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}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"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}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi": { - "layout": [{"label":"~", "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":"Backspace", "x":13, "y":0, "w":2}, {"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, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"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":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi_split_bs_rshift": { - "layout": [{"label":"~", "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}, {"x":13, "y":0}, {"x":14, "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, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"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}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_iso": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "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":"Backspace", "x":13, "y":0, "w":2}, {"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":"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":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "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":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - } - } -} \ No newline at end of file diff --git a/keyboards/sentraq/s60_x/rgb/rgb.h b/keyboards/sentraq/s60_x/rgb/rgb.h index d70473eeaaa..59ffdfbbfa8 100644 --- a/keyboards/sentraq/s60_x/rgb/rgb.h +++ b/keyboards/sentraq/s60_x/rgb/rgb.h @@ -1,5 +1,4 @@ -#ifndef S60XRGB_H -#define S60XRGB_H +#pragma once #include "quantum.h" @@ -35,6 +34,19 @@ { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ } +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K41, K42, K46, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { XXX, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, XXX, K4B, K4C, XXX, XXX, } \ +} #define LAYOUT_60_ansi_split_bs_rshift( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ @@ -82,5 +94,3 @@ { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ { KC_##K40, KC_##K41, KC_##K42, XXX, XXX, XXX, KC_##K46, XXX, XXX, XXX, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, XXX } \ } - -#endif diff --git a/keyboards/sentraq/s60_x/rgb/rules.mk b/keyboards/sentraq/s60_x/rgb/rules.mk index 42d45c332bd..409d60abf51 100644 --- a/keyboards/sentraq/s60_x/rgb/rules.mk +++ b/keyboards/sentraq/s60_x/rgb/rules.mk @@ -1,5 +1,73 @@ + + +# 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 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# 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 +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 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 BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable RGB light \ No newline at end of file +RGBLIGHT_ENABLE = yes # Enable RGB light + + +LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb \ No newline at end of file diff --git a/keyboards/sentraq/s60_x/rules.mk b/keyboards/sentraq/s60_x/rules.mk deleted file mode 100644 index 31de8ba39e3..00000000000 --- a/keyboards/sentraq/s60_x/rules.mk +++ /dev/null @@ -1,69 +0,0 @@ - - -# 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 = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# 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 -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 - -DEFAULT_FOLDER = sentraq/s60_x/default - -LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso diff --git a/keyboards/sentraq/s60_x/s60_x.c b/keyboards/sentraq/s60_x/s60_x.c deleted file mode 100644 index 595418bfacc..00000000000 --- a/keyboards/sentraq/s60_x/s60_x.c +++ /dev/null @@ -1 +0,0 @@ -#include "s60_x.h" \ No newline at end of file diff --git a/keyboards/sentraq/s60_x/s60_x.h b/keyboards/sentraq/s60_x/s60_x.h deleted file mode 100644 index 59c9741b5a8..00000000000 --- a/keyboards/sentraq/s60_x/s60_x.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef S60X_H -#define S60X_H - -#ifdef KEYBOARD_sentraq_s60_x_default - #include "default.h" -#endif -#ifdef KEYBOARD_sentraq_s60_x_rgb - #include "rgb.h" -#endif - -#include "quantum.h" - -#endif From e73587cfd08b2bd73987e7f762194079875df93a Mon Sep 17 00:00:00 2001 From: Robin Hallabro-Kokko <44033026+hallabro@users.noreply.github.com> Date: Sat, 4 May 2019 00:41:39 +0000 Subject: [PATCH 093/129] docker_build.sh: Docker requires access to hosts devices (#5063) * docker_build.sh: Docker requires access to hosts devices This also runs the container interactively which allows the user to interupt the build with Ctrl-C. * docker_build.sh: Mount /dev via $usb_args instead --- util/docker_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/docker_build.sh b/util/docker_build.sh index e7aeac8f3e5..c573ebcae2d 100755 --- a/util/docker_build.sh +++ b/util/docker_build.sh @@ -35,7 +35,7 @@ else fi if [ -n "$target" ]; then if [ "$(uname)" = "Linux" ] || docker-machine active >/dev/null 2>&1; then - usb_args="--privileged -v /dev/bus/usb:/dev/bus/usb" + usb_args="--privileged -v /dev:/dev" else echo "Error: target requires docker-machine to work on your platform" >&2 echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2 From 9d97e47df4de36adae48c57474f3836acb78195d Mon Sep 17 00:00:00 2001 From: Jez Cope Date: Sat, 4 May 2019 17:46:44 +0100 Subject: [PATCH 094/129] =?UTF-8?q?[Docs]=20Update=20Super=20ALT=E2=86=AFT?= =?UTF-8?q?AB=20to=20remove=20use=20of=20unregister=5Fcode16=20(#5766)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code as originally listed didn't work for me, but replacing `unregister_code16(LALT(KC_TAB));` with `unregister_code(KC_LALT);` fixes the problem and causes the macro to work as intended. Thanks to folks on Discord for helping me figure this out. --- docs/feature_macros.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_macros.md b/docs/feature_macros.md index fe45016e3b9..d81c3c65597 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -230,7 +230,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void matrix_scan_user(void) { # The very important timer. if (is_alt_tab_active) { if (timer_elapsed(alt_tab_timer) > 1000) { - unregister_code16(LALT(KC_TAB)); + unregister_code(KC_LALT); is_alt_tab_active = false; } } From 9f2fc1179aa39a2728a9606909a2a2795313d8d5 Mon Sep 17 00:00:00 2001 From: jotix <47826561+jotix@users.noreply.github.com> Date: Sat, 4 May 2019 13:57:41 -0300 Subject: [PATCH 095/129] [Keymap] add unicode to jotix's ortho_4x12_layout (#5775) * add unicode to jotix's ortho_4x12_layout * suggested change #define UNICODE_SELECTED_MODES UC_LNX --- layouts/community/ortho_4x12/jotix/config.h | 1 + layouts/community/ortho_4x12/jotix/keymap.c | 173 +++++++++++++----- layouts/community/ortho_4x12/jotix/rules.mk | 1 + layouts/community/ortho_4x12/jotix2/keymap.c | 87 --------- layouts/community/ortho_4x12/jotix2/readme.md | 8 - 5 files changed, 134 insertions(+), 136 deletions(-) create mode 100644 layouts/community/ortho_4x12/jotix/config.h create mode 100644 layouts/community/ortho_4x12/jotix/rules.mk delete mode 100644 layouts/community/ortho_4x12/jotix2/keymap.c delete mode 100644 layouts/community/ortho_4x12/jotix2/readme.md diff --git a/layouts/community/ortho_4x12/jotix/config.h b/layouts/community/ortho_4x12/jotix/config.h new file mode 100644 index 00000000000..cdc202d5f59 --- /dev/null +++ b/layouts/community/ortho_4x12/jotix/config.h @@ -0,0 +1 @@ +#define UNICODE_SELECTED_MODES UC_LNX diff --git a/layouts/community/ortho_4x12/jotix/keymap.c b/layouts/community/ortho_4x12/jotix/keymap.c index 12aa5ea88af..cd5413da723 100644 --- a/layouts/community/ortho_4x12/jotix/keymap.c +++ b/layouts/community/ortho_4x12/jotix/keymap.c @@ -1,6 +1,3 @@ -// 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 QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -10,81 +7,175 @@ extern keymap_config_t keymap_config; // 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 _LOWER 1 -#define _RAISE 2 -#define _ADJUST 3 +#define _QWERTY 0 +#define _FN 1 +#define _UNICODE 2 +#define _ADJUST 3 -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) +#define FN MO(_FN) +#define UNICODE MO(_UNICODE) + +enum unicode_names { + AACUTE, + AACUTE_M, + EACUTE, + EACUTE_M, + IACUTE, + IACUTE_M, + OACUTE, + OACUTE_M, + UACUTE, + UACUTE_M, + UDIER, + UDIER_M, + NTILDE, + NTILDE_M, + POUN, + COPY, + ORDF, + ORDM, + QUAD, + CUBE, + DEGR, + QUAR, + HALF, + NOT, + LDQU, + RDQU, + QUES, + EXCL, + ARRL, + ARRU, + ARRR, + ARRD, + EURO, + SMIL, + NEUT, + SMIH, + ANGR, + WORR, + DIZY, + TONG, + DISS, + SCRE, +}; + +const uint32_t PROGMEM unicode_map[] = { + [AACUTE] = 0xe1, // á + [AACUTE_M] = 0xc1, // Á + [EACUTE] = 0xe9, // é + [EACUTE_M] = 0xc9, // É + [IACUTE] = 0xed, // í + [IACUTE_M] = 0xcd, // Í + [OACUTE] = 0xf3, // ó + [OACUTE_M] = 0xd3, // Ó + [UACUTE] = 0xfa, // ú + [UACUTE_M] = 0xda, // Ú + [UDIER] = 0xfc, // ü + [UDIER_M] = 0xdc, // Ü + [NTILDE] = 0xf1, // ñ + [NTILDE_M] = 0xd1, // Ñ + [POUN] = 0xa3, // £ + [COPY] = 0xa9, // © + [ORDF] = 0xaa, // ª + [ORDM] = 0xba, // º + [QUAD] = 0xb2, // ² + [CUBE] = 0xb3, // ³ + [DEGR] = 0xb0, // ° + [QUAR] = 0xbc, // ¼ + [HALF] = 0xbd, // ½ + [NOT] = 0xac, // ¬ + [LDQU] = 0xab, // « + [RDQU] = 0xbb, // » + [QUES] = 0xbf, // ¿ + [EXCL] = 0xa1, // ¡ + [ARRL] = 0x2190, // ← + [ARRU] = 0x2191, // ↑ + [ARRR] = 0x2192, // → + [ARRD] = 0x2193, // ↓ + [EURO] = 0x20ac, // € + [SMIL] = 0x1f603, // 😃 + [NEUT] = 0x1f610, // 😐 + [SMIH] = 0x1f608, // 😈 + [ANGR] = 0x1f620, // 😠 + [WORR] = 0x1f61f, // 😟 + [DIZY] = 0x1f635, // 😵 + [TONG] = 0x1f61d, // 😝 + [DISS] = 0x1f61e, // 😝 + [SCRE] = 0x1f631, // 😱 +}; + +#define A_UNIC XP(AACUTE, AACUTE_M) +#define E_UNIC XP(EACUTE, EACUTE_M) +#define I_UNIC XP(IACUTE, IACUTE_M) +#define O_UNIC XP(OACUTE, OACUTE_M) +#define U_UNIC XP(UACUTE, UACUTE_M) +#define Y_UNIC XP(UDIER, UDIER_M ) +#define N_UNIC XP(NTILDE, NTILDE_M) + +#define TAB_UNI LT(_UNICODE, KC_TAB) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty +/* qwerty * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | esc | Q | W | E | R | T | Y | U | I | O | P | bksp | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |tab/unic| A | S | D | F | G | H | J | K | L | ; | ' | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | lshift | Z | X | C | V | B | N | M | , | . | / | enter | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | lctrl | lalt | ralt | lgui | lower | space | space | raise | left | down | up | right | + * | lctrl | lalt | caps | del | lgui | space | space | fn | left | down | up | right | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ */ [_QWERTY] = LAYOUT_ortho_4x12 ( 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, + TAB_UNI, 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_LALT, KC_RALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + KC_LCTL, KC_LALT, KC_CAPS, KC_DEL, KC_LGUI, KC_SPC, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), -/* Lower +/* fn * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | - | = | [ | ] | \ | | | | | | | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | _ | + | { | } | | | | | | | | | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | | | | | | | | | | | | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - */ -[_LOWER] = LAYOUT_ortho_4x12 ( - 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_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, _______, _______, _______, - _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Raise - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | del | + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | F7 | F8 | F9 | F10 | F11 | F12 | _ | + | { | } | | | + * | | F7 | F8 | F9 | F10 | F11 | F12 | ` | | | | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | | | | | | | | | home | pgdn | pgun | end | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ */ -[_RAISE] = LAYOUT_ortho_4x12 ( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, +[_FN] = LAYOUT_ortho_4x12 ( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, 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_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END ), -/* Adjust */ +/* + * unicode + */ +[_UNICODE] = LAYOUT_ortho_4x12 ( + _______, X(EXCL), X(WORR), E_UNIC, X(EURO), X(TONG), Y_UNIC, U_UNIC, I_UNIC, O_UNIC, X(POUN), _______, + _______, A_UNIC, X(SMIL), X(DISS), X(SCRE), X(DEGR), X(SMIH), X(NOT), X(QUAR), X(HALF), X(ORDF), X(ORDM), + _______, X(DIZY), X(ANGR), X(COPY), X(QUAD), X(CUBE), N_UNIC, X(NEUT), X(LDQU), X(RDQU), X(QUES), _______, + _______, _______, _______, _______, _______, _______, _______, _______, X(ARRL), X(ARRD), X(ARRU), X(ARRR) +), + +/* + * Adjust + */ [_ADJUST] = LAYOUT_ortho_4x12 ( _______, RESET, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, KC_CAPS, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; uint32_t layer_state_set_user(uint32_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + return update_tri_layer_state(state, _FN, _UNICODE, _ADJUST); } void matrix_init_user(void) { diff --git a/layouts/community/ortho_4x12/jotix/rules.mk b/layouts/community/ortho_4x12/jotix/rules.mk new file mode 100644 index 00000000000..502b2def762 --- /dev/null +++ b/layouts/community/ortho_4x12/jotix/rules.mk @@ -0,0 +1 @@ +UNICODEMAP_ENABLE = yes diff --git a/layouts/community/ortho_4x12/jotix2/keymap.c b/layouts/community/ortho_4x12/jotix2/keymap.c deleted file mode 100644 index 636476488e9..00000000000 --- a/layouts/community/ortho_4x12/jotix2/keymap.c +++ /dev/null @@ -1,87 +0,0 @@ -// 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 QMK_KEYBOARD_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 _LOWER 1 -#define _RAISE 2 -#define _GAME 3 -#define _ADJUST 4 - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define GAME TG(_GAME) - -/* Funct - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | F7 | F8 | F9 | F10 | F11 | F12 | ' | | | | | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | | | | | | | | home | vol- | vol+ | end | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - */ -#define _FUNCT LAYOUT_ortho_4x12 (\ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,\ - _______, 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_QUOT, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_VOLD, KC_VOLU, KC_END\ -) - -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 | ; | del | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | lshift | Z | X | C | V | B | N | M | , | . | / | enter | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | lctrl | lgui | lalt | ralt | funct | space | space | funct | left | down | up | right | - * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - */ -[_QWERTY] = LAYOUT_ortho_4x12 ( - 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_DEL, - 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, KC_RALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -[_LOWER] = _FUNCT, - -[_RAISE] = _FUNCT, - -/* Game */ -[_GAME] = LAYOUT_ortho_4x12 ( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT -), - -/* Adjust */ -[_ADJUST] = LAYOUT_ortho_4x12 ( - _______, RESET, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, - _______, _______, _______, _______, _______, GAME, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), -}; - -uint32_t layer_state_set_user(uint32_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - -void matrix_init_user(void) { -} diff --git a/layouts/community/ortho_4x12/jotix2/readme.md b/layouts/community/ortho_4x12/jotix2/readme.md deleted file mode 100644 index b023227a777..00000000000 --- a/layouts/community/ortho_4x12/jotix2/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Jotix2 ortho 4x12 keymap - -![keymap](https://i.imgur.com/WMfIpH3.jpg) - -Tested on: - -* Planck/rev4 -* Jotanck From 3a7c65b42442971bcb3369cc9dc3615b6aad1383 Mon Sep 17 00:00:00 2001 From: Ryan Caltabiano Date: Sat, 4 May 2019 12:02:02 -0500 Subject: [PATCH 096/129] fix line endings --- docs/zh-cn/getting_started_introduction.md | 108 ++++++++++----------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/docs/zh-cn/getting_started_introduction.md b/docs/zh-cn/getting_started_introduction.md index 36194c293aa..dcd0b72a564 100644 --- a/docs/zh-cn/getting_started_introduction.md +++ b/docs/zh-cn/getting_started_introduction.md @@ -1,54 +1,54 @@ -# 介绍 - -本页解释了使用QMK项目所需的基本信息。它假定您能熟练使用Unix shell,但您不熟悉C语言也不熟悉使用make编译。 - -## 基本QMK结构 - -QMK是[Jun Wako](https://github.com/tmk)的[tmk_keyboard](https://github.com/tmk/tmk_keyboard)工程的一个分叉。经过更改的TMK原始代码放在`tmk` 文件夹中。 QMK增加的新东西可以在 `quantum` 文件夹中找到。 键盘项目可以在 `handwired`(手动飞线) 和 `keyboard`(PCB键盘)这两个文件夹找到。 - -### 用户空间结构 - -在`users`文件夹里面的目录是每个用户的目录。这个文件夹里面放的是用户们在不同键盘都能用到的代码。详见[用户空间特性](feature_userspace.md) - -### 键盘项目结构 - -在`keyboards`文件夹和他的子文件夹`handwired`中就是各个键盘的项目了,比如`qmk_firmware/keyboards/clueboard`。内部结构与如下: - -* `keymaps/`: 可以构建的不同布局 -* `rules.mk`: 用来设置 "make" 命令默认选项的文件。别直接编辑这个文件,你应该使用具体某个布局的 `rules.mk`. -* `config.h`: 用于设置默认编译选项的文件。别直接编辑这个文件, 你应该使用具体某个布局的 `config.h`. - -### 布局结构 - -在各个布局的文件夹,你能找到以下文件。只有 `keymap.c` 是必要的, 如果其他文件找不到就会直接选择默认选项。 - -* `config.h`: 配置布局的选项 -* `keymap.c`: 布局的全部代码, 必要文件 -* `rules.mk`: 使能的QMK特性 -* `readme.md`:介绍你的布局,告诉别人怎么使用,附上功能说明。请将图片上传到imgur等图床(译者注:imgur可能已被墙,为了方便国人访问,建议使用国内可以直接访问的图床)。 - -# `config.h` 文件 - -有三个重要的`config.h` 位置: - -* 键盘 (`/keyboards//config.h`) -* 用户空间 (`/users//config.h`) -* 布局 (`/keyboards//keymaps//config.h`) - -构建系统按照上述顺序自动获取配置文件。如果要覆盖由上一个 `config.h` 所做的设置,您需要首先为要更改的设置包含一些样板代码。 - -``` -#pragma once -``` - -要覆盖上一个 `config.h` 所做的设置,你要先 `#undef` 然后再 `#define` 这个设置. - -样板代码和设置看起来像这样: - -``` -#pragma once - -// 像下面那样覆盖设置(MY_SETTING指的是你要覆盖的设置项)! -#undef MY_SETTING -#define MY_SETTING 4 -``` +# 介绍 + +本页解释了使用QMK项目所需的基本信息。它假定您能熟练使用Unix shell,但您不熟悉C语言也不熟悉使用make编译。 + +## 基本QMK结构 + +QMK是[Jun Wako](https://github.com/tmk)的[tmk_keyboard](https://github.com/tmk/tmk_keyboard)工程的一个分叉。经过更改的TMK原始代码放在`tmk` 文件夹中。 QMK增加的新东西可以在 `quantum` 文件夹中找到。 键盘项目可以在 `handwired`(手动飞线) 和 `keyboard`(PCB键盘)这两个文件夹找到。 + +### 用户空间结构 + +在`users`文件夹里面的目录是每个用户的目录。这个文件夹里面放的是用户们在不同键盘都能用到的代码。详见[用户空间特性](feature_userspace.md) + +### 键盘项目结构 + +在`keyboards`文件夹和他的子文件夹`handwired`中就是各个键盘的项目了,比如`qmk_firmware/keyboards/clueboard`。内部结构与如下: + +* `keymaps/`: 可以构建的不同布局 +* `rules.mk`: 用来设置 "make" 命令默认选项的文件。别直接编辑这个文件,你应该使用具体某个布局的 `rules.mk`. +* `config.h`: 用于设置默认编译选项的文件。别直接编辑这个文件, 你应该使用具体某个布局的 `config.h`. + +### 布局结构 + +在各个布局的文件夹,你能找到以下文件。只有 `keymap.c` 是必要的, 如果其他文件找不到就会直接选择默认选项。 + +* `config.h`: 配置布局的选项 +* `keymap.c`: 布局的全部代码, 必要文件 +* `rules.mk`: 使能的QMK特性 +* `readme.md`:介绍你的布局,告诉别人怎么使用,附上功能说明。请将图片上传到imgur等图床(译者注:imgur可能已被墙,为了方便国人访问,建议使用国内可以直接访问的图床)。 + +# `config.h` 文件 + +有三个重要的`config.h` 位置: + +* 键盘 (`/keyboards//config.h`) +* 用户空间 (`/users//config.h`) +* 布局 (`/keyboards//keymaps//config.h`) + +构建系统按照上述顺序自动获取配置文件。如果要覆盖由上一个 `config.h` 所做的设置,您需要首先为要更改的设置包含一些样板代码。 + +``` +#pragma once +``` + +要覆盖上一个 `config.h` 所做的设置,你要先 `#undef` 然后再 `#define` 这个设置. + +样板代码和设置看起来像这样: + +``` +#pragma once + +// 像下面那样覆盖设置(MY_SETTING指的是你要覆盖的设置项)! +#undef MY_SETTING +#define MY_SETTING 4 +``` From 0213867deaab4a2a39efdeabfce50aa81125e21c Mon Sep 17 00:00:00 2001 From: kwerdenker Date: Sun, 5 May 2019 18:31:51 +0200 Subject: [PATCH 097/129] Fix wrong key assigning in keymap for ISO layout (#5790) --- keyboards/westfoxtrot/aanzee/aanzee.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/westfoxtrot/aanzee/aanzee.h b/keyboards/westfoxtrot/aanzee/aanzee.h index b2a04a9d2ab..841205db3e2 100644 --- a/keyboards/westfoxtrot/aanzee/aanzee.h +++ b/keyboards/westfoxtrot/aanzee/aanzee.h @@ -46,14 +46,14 @@ } #define LAYOUT_iso( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4E \ ) \ { \ {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, ___}, \ - {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, ___, K1D, K1E, ___}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, ___, K1E, ___}, \ {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, ___}, \ {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, ___}, \ {K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, K4B, K4C, K4D, K4E, ___} \ From 63d53b0f2860dd89c87ff477bd5064d17ec96635 Mon Sep 17 00:00:00 2001 From: Max <17062872+westfoxtrot@users.noreply.github.com> Date: Sun, 5 May 2019 23:37:54 +0200 Subject: [PATCH 098/129] config.qmk.fm support fix for westfoxtrot/aanzee (#5794) * fixed issue with LED indicators corrected error in info.json * fixed issue with led indictors * added fix for key_count to info.json for westfoxtrot/aanzee * fix to support config.qmk.fm correctly and remove unused key from matrix for westfoxtrot/aanzee --- keyboards/westfoxtrot/aanzee/aanzee.h | 12 ++++++------ .../westfoxtrot/aanzee/keymaps/default/keymap.c | 4 ++-- .../westfoxtrot/aanzee/keymaps/iso-default/keymap.c | 4 ++-- keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/keyboards/westfoxtrot/aanzee/aanzee.h b/keyboards/westfoxtrot/aanzee/aanzee.h index 841205db3e2..aa1b9165606 100644 --- a/keyboards/westfoxtrot/aanzee/aanzee.h +++ b/keyboards/westfoxtrot/aanzee/aanzee.h @@ -33,30 +33,30 @@ #define LAYOUT_ansi( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0F, K0D, K0E, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, K2D, K2E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4E \ + K40, K41, K42, K46, K49, K4A, K4C, K4D, K4E \ ) \ { \ {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, K1E, ___}, \ - {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, ___, K2C, K2D, K2E, ___}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D, K2E, ___}, \ {K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, ___}, \ - {K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, K4B, K4C, K4D, K4E, ___} \ + {K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, ___, K4C, K4D, K4E, ___} \ } #define LAYOUT_iso( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4E \ + K40, K41, K42, K46, K49, K4A, K4C, K4D, K4E \ ) \ { \ {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, ___}, \ {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, ___, K1E, ___}, \ {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, ___}, \ {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, ___}, \ - {K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, K4B, K4C, K4D, K4E, ___} \ + {K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, ___, K4C, K4D, K4E, ___} \ } void matrix_init_user(void); diff --git a/keyboards/westfoxtrot/aanzee/keymaps/default/keymap.c b/keyboards/westfoxtrot/aanzee/keymaps/default/keymap.c index 4b7a9f20809..e2b75bc860b 100644 --- a/keyboards/westfoxtrot/aanzee/keymaps/default/keymap.c +++ b/keyboards/westfoxtrot/aanzee/keymaps/default/keymap.c @@ -25,14 +25,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, \ 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_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1),KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT), + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT), [_F1] = LAYOUT_ansi( 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,_______,_______,_______, \ _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, _______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______, _______, _______,_______,_______,_______,_______, _______) + _______,_______,_______, _______, _______,_______,_______,_______, _______) }; void matrix_init_user(void) { diff --git a/keyboards/westfoxtrot/aanzee/keymaps/iso-default/keymap.c b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/keymap.c index 79628eb9012..4ea02795805 100644 --- a/keyboards/westfoxtrot/aanzee/keymaps/iso-default/keymap.c +++ b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/keymap.c @@ -25,14 +25,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_END, \ 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_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1),KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT), + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1), KC_LEFT,KC_DOWN, KC_RGHT), [_F1] = LAYOUT_iso( 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,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______,_______,_______,_______) + _______,_______,_______, _______, _______,_______,_______,_______,_______) }; void matrix_init_user(void) { diff --git a/keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c b/keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c index 4b7a9f20809..1ac5c77fff1 100644 --- a/keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c +++ b/keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c @@ -25,14 +25,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, \ 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_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1),KC_RCTL,KC_LEFT,KC_DOWN, KC_RGHT), + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1) ,KC_LEFT,KC_DOWN, KC_RGHT), [_F1] = LAYOUT_ansi( 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,_______,_______,_______, \ _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, _______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______, _______, _______,_______,_______,_______,_______, _______) + _______,_______,_______, _______, _______,_______ ,_______,_______, _______) }; void matrix_init_user(void) { From eb9ea8492736c14a7c57fd9bac7304e8dd6b7d80 Mon Sep 17 00:00:00 2001 From: omkbd Date: Mon, 6 May 2019 08:19:07 +0900 Subject: [PATCH 099/129] [Keybooard] Update of Ergodash Keyboard (#5772) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Simpler coding use SPLIT_KEYBOARD delete rev1 (rev2→rev1) because rev1is not sold * delete USE_I2C = no * Update readme.md --- keyboards/ergodash/ergodash.h | 22 +- keyboards/ergodash/i2c.c | 162 ------ keyboards/ergodash/i2c.h | 49 -- keyboards/ergodash/matrix.c | 490 ------------------ keyboards/ergodash/mini/config.h | 37 +- .../ergodash/mini/keymaps/default/config.h | 8 +- .../ergodash/mini/keymaps/default/rules.mk | 3 + keyboards/ergodash/mini/rules.mk | 1 + keyboards/ergodash/readme.md | 11 +- keyboards/ergodash/rev1/config.h | 53 +- keyboards/ergodash/rev1/info.json | 8 +- .../ergodash/rev1/keymaps/default/config.h | 8 - .../ergodash/rev1/keymaps/default/keymap.c | 130 ++--- .../ergodash/rev1/keymaps/default/rules.mk | 3 + .../keymaps/greenshadowmaker/config.h | 8 - .../keyboard-layout-editor.json | 0 .../keymaps/greenshadowmaker/keymap.c | 0 .../keymaps/greenshadowmaker/rules.mk | 0 keyboards/ergodash/rev1/rev1.h | 44 +- keyboards/ergodash/rev1/rules.mk | 2 + keyboards/ergodash/rev2/config.h | 89 ---- keyboards/ergodash/rev2/info.json | 13 - .../ergodash/rev2/keymaps/default/config.h | 42 -- .../ergodash/rev2/keymaps/default/keymap.c | 154 ------ .../ergodash/rev2/keymaps/default/rules.mk | 0 keyboards/ergodash/rev2/rev2.c | 39 -- keyboards/ergodash/rev2/rev2.h | 66 --- keyboards/ergodash/rev2/rules.mk | 2 - keyboards/ergodash/rules.mk | 41 +- keyboards/ergodash/serial.c | 228 -------- keyboards/ergodash/serial.h | 26 - keyboards/ergodash/split_util.c | 86 --- keyboards/ergodash/split_util.h | 20 - 33 files changed, 152 insertions(+), 1693 deletions(-) delete mode 100644 keyboards/ergodash/i2c.c delete mode 100644 keyboards/ergodash/i2c.h delete mode 100644 keyboards/ergodash/matrix.c rename keyboards/ergodash/{rev2 => rev1}/keymaps/greenshadowmaker/config.h (85%) rename keyboards/ergodash/{rev2 => rev1}/keymaps/greenshadowmaker/keyboard-layout-editor.json (100%) rename keyboards/ergodash/{rev2 => rev1}/keymaps/greenshadowmaker/keymap.c (100%) rename keyboards/ergodash/{rev2 => rev1}/keymaps/greenshadowmaker/rules.mk (100%) delete mode 100644 keyboards/ergodash/rev2/config.h delete mode 100644 keyboards/ergodash/rev2/info.json delete mode 100644 keyboards/ergodash/rev2/keymaps/default/config.h delete mode 100644 keyboards/ergodash/rev2/keymaps/default/keymap.c delete mode 100644 keyboards/ergodash/rev2/keymaps/default/rules.mk delete mode 100644 keyboards/ergodash/rev2/rev2.c delete mode 100644 keyboards/ergodash/rev2/rev2.h delete mode 100644 keyboards/ergodash/rev2/rules.mk delete mode 100644 keyboards/ergodash/serial.c delete mode 100644 keyboards/ergodash/serial.h delete mode 100644 keyboards/ergodash/split_util.c delete mode 100644 keyboards/ergodash/split_util.h diff --git a/keyboards/ergodash/ergodash.h b/keyboards/ergodash/ergodash.h index bf2bac581eb..83c78593078 100644 --- a/keyboards/ergodash/ergodash.h +++ b/keyboards/ergodash/ergodash.h @@ -6,26 +6,6 @@ #ifdef KEYBOARD_ergodash_rev1 #include "rev1.h" - // Used to create a keymap using only KC_ prefixed keys - #define LAYOUT_kc( \ - 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, \ - LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, 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_##L16, KC_##R10, 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_##L26, KC_##R20, 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_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ - KC_##LT0, KC_##LT1, KC_##LT2, KC_##LT3, KC_##LT4, KC_##LT5, KC_##RT0, KC_##RT1, KC_##RT2, KC_##RT3, KC_##RT4, KC_##RT5 \ - ) -#endif // #ifdef KEYBOARD_ergodash_rev1 - -#ifdef KEYBOARD_ergodash_rev2 - #include "rev2.h" - // Used to create a keymap using only KC_ prefixed keys #define LAYOUT_kc( \ L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ @@ -41,7 +21,7 @@ KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, 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 // #ifdef KEYBOARD_ergodash_rev2 +#endif // #ifdef KEYBOARD_ergodash_rev1 #ifdef KEYBOARD_ergodash_mini #include "mini.h" diff --git a/keyboards/ergodash/i2c.c b/keyboards/ergodash/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/ergodash/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#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/ergodash/matrix.c b/keyboards/ergodash/matrix.c deleted file mode 100644 index bdf265a8749..00000000000 --- a/keyboards/ergodash/matrix.c +++ /dev/null @@ -1,490 +0,0 @@ -/* -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" - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#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 -#if (DIODE_DIRECTION == COL2ROW) - unselect_rows(); - init_cols(); -#elif (DIODE_DIRECTION == ROW2COL) - unselect_cols(); - init_rows(); -#endif - - 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) -{ - 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; - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0); -#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; - - 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] = backlight_config.enable ? backlight_config.level : 0; -#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; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - 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+1] = 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/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h index fc63cc1e9d2..cac1bba6f7b 100644 --- a/keyboards/ergodash/mini/config.h +++ b/keyboards/ergodash/mini/config.h @@ -45,10 +45,6 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST #define C6_AUDIO -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(STARTUP_SOUND) - #define GOODBYE_SONG SONG(GOODBYE_SOUND) -#endif /* number of backlight levels */ #ifdef BACKLIGHT_ENABLE @@ -68,23 +64,18 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 10, 10 } // Number of LEDs -#define RGBLED_NUM 20 // Number of LEDs - -/* - * 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 +#define SOFT_SERIAL_PIN D0 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/ergodash/mini/keymaps/default/config.h b/keyboards/ergodash/mini/keymaps/default/config.h index a5a722fb2a3..df04873a97e 100644 --- a/keyboards/ergodash/mini/keymaps/default/config.h +++ b/keyboards/ergodash/mini/keymaps/default/config.h @@ -20,6 +20,7 @@ along with this program. If not, see . #pragma once + /* Use I2C or Serial, not both */ #define USE_SERIAL @@ -30,10 +31,3 @@ along with this program. If not, see . #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 20 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/mini/keymaps/default/rules.mk b/keyboards/ergodash/mini/keymaps/default/rules.mk index e69de29bb2d..bb9e33b0829 100644 --- a/keyboards/ergodash/mini/keymaps/default/rules.mk +++ b/keyboards/ergodash/mini/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/mini/rules.mk b/keyboards/ergodash/mini/rules.mk index b6c9a258059..bb9e33b0829 100644 --- a/keyboards/ergodash/mini/rules.mk +++ b/keyboards/ergodash/mini/rules.mk @@ -1,2 +1,3 @@ BACKLIGHT_ENABLE = no RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/readme.md b/keyboards/ergodash/readme.md index 40d9fddfa5f..27672c3ecf3 100644 --- a/keyboards/ergodash/readme.md +++ b/keyboards/ergodash/readme.md @@ -9,16 +9,17 @@ Hardware Availability: Order your own [yourself](https://github.com/omkbd/ErgoDa Make example for this keyboard (after setting up your build environment): - make ergodash/rev2:default + make ergodash/rev1:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Install Example: (for pro micro) - `make ergodash/rev2:default:avrdude` - + `make ergodash/rev1:default:avrdude` + Note: - "rev2" is for PCB ver 1.1,1.2 - "rev1" is from earlier pcb + "rev1" is for PCB ver 1.0,1.1,1.2 + **The original Rev 1 was owned only by the designer. Therefore, Rev1 has been removed. Since the current PCB is Rev1, we changed Rev2 to Rev1 to match the firmware version.** + # Layout ![layout](https://github.com/omkbd/picture/blob/master/ergodash-layout.png) diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h index 160e703629f..5b7d8568878 100644 --- a/keyboards/ergodash/rev1/config.h +++ b/keyboards/ergodash/rev1/config.h @@ -16,8 +16,7 @@ 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 +#pragma once #include "config_common.h" @@ -35,9 +34,9 @@ along with this program. If not, see . #define MATRIX_COLS 7 // wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } -#define MATRIX_COL_PINS { F5, 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 MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } +#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 tapping term */ #define TAPPING_TERM 120 @@ -45,8 +44,15 @@ along with this program. If not, see . /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +#define C6_AUDIO + /* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 +#ifdef BACKLIGHT_ENABLE + #define BACKLIGHT_PIN B6 + #define BACKLIGHT_LEVELS 7 +// #define BACKLIGHT_BREATHING +// #define BREATHING_PERIOD 4 +#endif /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 @@ -58,25 +64,18 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 24 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 12, 12 } // Number of LEDs -#define RGBLED_NUM 24 // Number of LEDs - -/* - * 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 +#define SOFT_SERIAL_PIN D0 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/ergodash/rev1/info.json b/keyboards/ergodash/rev1/info.json index f5ed321de66..bcfbda6d33b 100644 --- a/keyboards/ergodash/rev1/info.json +++ b/keyboards/ergodash/rev1/info.json @@ -1,13 +1,13 @@ { - "keyboard_name": "ErgoDash rev1", + "keyboard_name": "ErgoDash rev2", "url": "", "maintainer": "qmk", - "width": 16, + "width": 18, "height": 6.25, "layouts": { "LAYOUT": { - "key_count": 68, - "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":9, "y":0.75}, {"label":"R01", "x":10, "y":0.25}, {"label":"R02", "x":11, "y":0.125}, {"label":"R03", "x":12, "y":0}, {"label":"R04", "x":13, "y":0.125}, {"label":"R05", "x":14, "y":0.375}, {"label":"R06", "x":15, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":9, "y":1.75}, {"label":"R11", "x":10, "y":1.25}, {"label":"R12", "x":11, "y":1.125}, {"label":"R13", "x":12, "y":1}, {"label":"R14", "x":13, "y":1.125}, {"label":"R15", "x":14, "y":1.375}, {"label":"R16", "x":15, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":9, "y":2.75}, {"label":"R21", "x":10, "y":2.25}, {"label":"R22", "x":11, "y":2.125}, {"label":"R23", "x":12, "y":2}, {"label":"R24", "x":13, "y":2.125}, {"label":"R25", "x":14, "y":2.375}, {"label":"R26", "x":15, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":8.5, "y":4.25}, {"label":"R31", "x":10, "y":3.25}, {"label":"R32", "x":11, "y":3.125}, {"label":"R33", "x":12, "y":3}, {"label":"R34", "x":13, "y":3.125}, {"label":"R35", "x":14, "y":3.375}, {"label":"R36", "x":15, "y":3.375}, {"label":"LT0", "x":0, "y":4.375}, {"label":"LT1", "x":1, "y":4.375}, {"label":"LT2", "x":2, "y":4.125}, {"label":"LT3", "x":3, "y":4}, {"label":"LT4", "x":5.5, "y":5.25}, {"label":"LT5", "x":6.5, "y":5.25}, {"label":"RT0", "x":8.5, "y":5.25}, {"label":"RT1", "x":9.5, "y":5.25}, {"label":"RT2", "x":12, "y":4}, {"label":"RT3", "x":13, "y":4.125}, {"label":"RT4", "x":14, "y":4.375}, {"label":"RT5", "x":15, "y":4.375}] + "key_count": 70, + "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":11, "y":0.75}, {"label":"R01", "x":12, "y":0.25}, {"label":"R02", "x":13, "y":0.125}, {"label":"R03", "x":14, "y":0}, {"label":"R04", "x":15, "y":0.125}, {"label":"R05", "x":16, "y":0.375}, {"label":"R06", "x":17, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":11, "y":1.75}, {"label":"R11", "x":12, "y":1.25}, {"label":"R12", "x":13, "y":1.125}, {"label":"R13", "x":14, "y":1}, {"label":"R14", "x":15, "y":1.125}, {"label":"R15", "x":16, "y":1.375}, {"label":"R16", "x":17, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":11, "y":2.75}, {"label":"R21", "x":12, "y":2.25}, {"label":"R22", "x":13, "y":2.125}, {"label":"R23", "x":14, "y":2}, {"label":"R24", "x":15, "y":2.125}, {"label":"R25", "x":16, "y":2.375}, {"label":"R26", "x":17, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":10.5, "y":4.25}, {"label":"R31", "x":12, "y":3.25}, {"label":"R32", "x":13, "y":3.125}, {"label":"R33", "x":14, "y":3}, {"label":"R34", "x":15, "y":3.125}, {"label":"R35", "x":16, "y":3.375}, {"label":"R36", "x":17, "y":3.375}, {"label":"L40", "x":0, "y":4.375}, {"label":"L41", "x":1, "y":4.375}, {"label":"L42", "x":2, "y":4.125}, {"label":"L43", "x":3, "y":4}, {"label":"L44", "x":5.5, "y":5.25}, {"label":"L45", "x":6.5, "y":5.25}, {"label":"L46", "x":7.5, "y":4.25, "h":2}, {"label":"R40", "x":9.5, "y":4.25, "h":2}, {"label":"R41", "x":10.5, "y":5.25}, {"label":"R42", "x":11.5, "y":5.25}, {"label":"R43", "x":14, "y":4}, {"label":"R44", "x":15, "y":4.125}, {"label":"R45", "x":16, "y":4.375}, {"label":"R46", "x":17, "y":4.375}] } } } diff --git a/keyboards/ergodash/rev1/keymaps/default/config.h b/keyboards/ergodash/rev1/keymaps/default/config.h index dc00328dcb5..df04873a97e 100644 --- a/keyboards/ergodash/rev1/keymaps/default/config.h +++ b/keyboards/ergodash/rev1/keymaps/default/config.h @@ -20,7 +20,6 @@ along with this program. If not, see . #pragma once -// place overrides here /* Use I2C or Serial, not both */ @@ -32,10 +31,3 @@ along with this program. If not, see . #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 24 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/rev1/keymaps/default/keymap.c b/keyboards/ergodash/rev1/keymaps/default/keymap.c index a1bfb226785..61539987482 100644 --- a/keyboards/ergodash/rev1/keymaps/default/keymap.c +++ b/keyboards/ergodash/rev1/keymaps/default/keymap.c @@ -14,92 +14,92 @@ enum custom_keycodes { ADJUST, }; -#define KC_JPN LALT(KC_GRV) +#define EISU LALT(KC_GRV) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty - * ,-------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | [ | ] | 6 | 7 | 8 | 9 | 0 | Caps | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Q | W | E | R | T | - | = | Y | U | I | O | P | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | A | S | D | F | G | Del | Bksp | H | J | K | L | ; | " | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | JPN | Enter| N | M | , | . | / | Shift| - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Left| Down | Up | Right| - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 |Pscree| + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ` | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | Del | | Bksp | H | J | K | L | ; | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Left | Down | Up | Right| + * ,----------------------------------------------------------------------------------------------------------------------. */ [_QWERTY] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CAPS, \ - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, 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_JPN , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, 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_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower - * ,-------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | Enter| N | M | < | > | ? | Shift| - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Home |PageDn|PageUp| End | - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * ,----------------------------------------------------------------------------------------------------------------------. */ [_LOWER] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ + KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), /* Raise - * ,-------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | Enter| N | M | < | > | ? | Shift| - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Home |PageDn|PageUp| End | - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * ,----------------------------------------------------------------------------------------------------------------------. */ [_RAISE] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ + KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), /* Adjust - * ,-------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset|RGB ON| MODE| HUE-| HUE+| | | SAT-| SAT+| VAL-| VAL+| | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | | | | | | | | | | | | | | | - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | Reset|RGB ON| MODE| HUE-| HUE+| | | | SAT-| SAT+| VAL-| VAL+| | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | | BL ON| BRTG| INC| DEC| | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| | | |||||||| | | |||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. */ [_ADJUST] = LAYOUT( - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, BL_TOGG, BL_BRTG, BL_INC , BL_DEC ,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______,_______,_______, _______,_______, _______, _______, _______, _______, _______ \ ) }; diff --git a/keyboards/ergodash/rev1/keymaps/default/rules.mk b/keyboards/ergodash/rev1/keymaps/default/rules.mk index e69de29bb2d..bb9e33b0829 100644 --- a/keyboards/ergodash/rev1/keymaps/default/rules.mk +++ b/keyboards/ergodash/rev1/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h similarity index 85% rename from keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h rename to keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h index 8ace28f240a..df04873a97e 100644 --- a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h @@ -31,11 +31,3 @@ along with this program. If not, see . #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 24 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keyboard-layout-editor.json b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json similarity index 100% rename from keyboards/ergodash/rev2/keymaps/greenshadowmaker/keyboard-layout-editor.json rename to keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keymap.c b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c similarity index 100% rename from keyboards/ergodash/rev2/keymaps/greenshadowmaker/keymap.c rename to keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/rules.mk b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk similarity index 100% rename from keyboards/ergodash/rev2/keymaps/greenshadowmaker/rules.mk rename to keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk diff --git a/keyboards/ergodash/rev1/rev1.h b/keyboards/ergodash/rev1/rev1.h index 952801916a1..55135adca6d 100644 --- a/keyboards/ergodash/rev1/rev1.h +++ b/keyboards/ergodash/rev1/rev1.h @@ -25,19 +25,19 @@ 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, \ - LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ ) \ { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { LT0, LT1, LT2, LT3, LT4, LT5, KC_NO }, \ - { R06, R05, R04, R03, R02, R01, R00 }, \ - { R16, R15, R14, R13, R12, R11, R10 }, \ - { R26, R25, R24, R23, R22, R21, R20 }, \ - { R36, R35, R34, R33, R32, R31, R30 }, \ - { RT5, RT4, RT3, RT2, RT1, RT0, KC_NO } \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { R46, R45, R44, R43, R42, R41, R40 } \ } #else // Keymap with right side flipped @@ -47,19 +47,19 @@ 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, \ - LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ ) \ { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { LT0, LT1, LT2, LT3, LT4, LT5, KC_NO }, \ - { R00, R01, R02, R03, R04, R05, R06 }, \ - { R10, R11, R12, R13, R14, R15, R16 }, \ - { R20, R21, R22, R23, R24, R25, R26 }, \ - { R30, R31, R32, R33, R34, R35, R36 }, \ - { RT0, RT1, RT2, RT3, RT4, RT5, KC_NO } \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R00, R01, R02, R03, R04, R05, R06 }, \ + { R10, R11, R12, R13, R14, R15, R16 }, \ + { R20, R21, R22, R23, R24, R25, R26 }, \ + { R30, R31, R32, R33, R34, R35, R36 }, \ + { R40, R41, R42, R43, R44, R45, R46 } \ } #endif diff --git a/keyboards/ergodash/rev1/rules.mk b/keyboards/ergodash/rev1/rules.mk index 7b30c0beff2..bb9e33b0829 100644 --- a/keyboards/ergodash/rev1/rules.mk +++ b/keyboards/ergodash/rev1/rules.mk @@ -1 +1,3 @@ BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/rev2/config.h b/keyboards/ergodash/rev2/config.h deleted file mode 100644 index 09657250b13..00000000000 --- a/keyboards/ergodash/rev2/config.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -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_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Omkbd -#define PRODUCT ErgoDash -#define DESCRIPTION Power - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 7 - -// wiring of each half -#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } -#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 tapping term */ -#define TAPPING_TERM 120 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -#define C6_AUDIO - -/* number of backlight levels */ -#ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_PIN B6 - #define BACKLIGHT_LEVELS 7 -// #define BACKLIGHT_BREATHING -// #define BREATHING_PERIOD 4 -#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 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 24 // Number of LEDs - -/* - * 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/ergodash/rev2/info.json b/keyboards/ergodash/rev2/info.json deleted file mode 100644 index bcfbda6d33b..00000000000 --- a/keyboards/ergodash/rev2/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "ErgoDash rev2", - "url": "", - "maintainer": "qmk", - "width": 18, - "height": 6.25, - "layouts": { - "LAYOUT": { - "key_count": 70, - "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":11, "y":0.75}, {"label":"R01", "x":12, "y":0.25}, {"label":"R02", "x":13, "y":0.125}, {"label":"R03", "x":14, "y":0}, {"label":"R04", "x":15, "y":0.125}, {"label":"R05", "x":16, "y":0.375}, {"label":"R06", "x":17, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":11, "y":1.75}, {"label":"R11", "x":12, "y":1.25}, {"label":"R12", "x":13, "y":1.125}, {"label":"R13", "x":14, "y":1}, {"label":"R14", "x":15, "y":1.125}, {"label":"R15", "x":16, "y":1.375}, {"label":"R16", "x":17, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":11, "y":2.75}, {"label":"R21", "x":12, "y":2.25}, {"label":"R22", "x":13, "y":2.125}, {"label":"R23", "x":14, "y":2}, {"label":"R24", "x":15, "y":2.125}, {"label":"R25", "x":16, "y":2.375}, {"label":"R26", "x":17, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":10.5, "y":4.25}, {"label":"R31", "x":12, "y":3.25}, {"label":"R32", "x":13, "y":3.125}, {"label":"R33", "x":14, "y":3}, {"label":"R34", "x":15, "y":3.125}, {"label":"R35", "x":16, "y":3.375}, {"label":"R36", "x":17, "y":3.375}, {"label":"L40", "x":0, "y":4.375}, {"label":"L41", "x":1, "y":4.375}, {"label":"L42", "x":2, "y":4.125}, {"label":"L43", "x":3, "y":4}, {"label":"L44", "x":5.5, "y":5.25}, {"label":"L45", "x":6.5, "y":5.25}, {"label":"L46", "x":7.5, "y":4.25, "h":2}, {"label":"R40", "x":9.5, "y":4.25, "h":2}, {"label":"R41", "x":10.5, "y":5.25}, {"label":"R42", "x":11.5, "y":5.25}, {"label":"R43", "x":14, "y":4}, {"label":"R44", "x":15, "y":4.125}, {"label":"R45", "x":16, "y":4.375}, {"label":"R46", "x":17, "y":4.375}] - } - } -} diff --git a/keyboards/ergodash/rev2/keymaps/default/config.h b/keyboards/ergodash/rev2/keymaps/default/config.h deleted file mode 100644 index 90a364811ed..00000000000 --- a/keyboards/ergodash/rev2/keymaps/default/config.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -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 . -*/ - -#pragma once - -// place overrides here - -/* 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 24 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/rev2/keymaps/default/keymap.c b/keyboards/ergodash/rev2/keymaps/default/keymap.c deleted file mode 100644 index 5412eb0c0cb..00000000000 --- a/keyboards/ergodash/rev2/keymaps/default/keymap.c +++ /dev/null @@ -1,154 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define EISU LALT(KC_GRV) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,----------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 |Pscree| - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | ` | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | Tab | A | S | D | F | G | Del | | Bksp | H | J | K | L | ; | " | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Left | Down | Up | Right| - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_QWERTY] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \ - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, 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_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_SPC, KC_SPC,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Lower - * ,----------------------------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_LOWER] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_SPC, KC_SPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ - ), - - /* Raise - * ,----------------------------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_RAISE] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_SPC, KC_SPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ - ), - - /* Adjust - * ,----------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | | Reset|RGB ON| MODE| HUE-| HUE+| | | | SAT-| SAT+| VAL-| VAL+| | | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | | | | |||||||| | | |||||||| | | |||||||| | | | | - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_ADJUST] = LAYOUT( - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, BL_TOGG, BL_BRTG, BL_INC , BL_DEC ,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______,_______,_______, _______,_______, _______, _______, _______, _______, _______ \ - ) -}; - -#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) { - 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 ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/ergodash/rev2/keymaps/default/rules.mk b/keyboards/ergodash/rev2/keymaps/default/rules.mk deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/keyboards/ergodash/rev2/rev2.c b/keyboards/ergodash/rev2/rev2.c deleted file mode 100644 index 5e787921cbb..00000000000 --- a/keyboards/ergodash/rev2/rev2.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "ergodash.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_user(void) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); - #endif -} diff --git a/keyboards/ergodash/rev2/rev2.h b/keyboards/ergodash/rev2/rev2.h deleted file mode 100644 index 55135adca6d..00000000000 --- a/keyboards/ergodash/rev2/rev2.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef REV1_H -#define REV1_H - -#include "ergodash.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); - -#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 LAYOUT( \ - 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, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R06, R05, R04, R03, R02, R01, R00 }, \ - { R16, R15, R14, R13, R12, R11, R10 }, \ - { R26, R25, R24, R23, R22, R21, R20 }, \ - { R36, R35, R34, R33, R32, R31, R30 }, \ - { R46, R45, R44, R43, R42, R41, R40 } \ - } -#else -// Keymap with right side flipped -// (TRRS jack on both halves are to the right) -#define LAYOUT( \ - 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, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R00, R01, R02, R03, R04, R05, R06 }, \ - { R10, R11, R12, R13, R14, R15, R16 }, \ - { R20, R21, R22, R23, R24, R25, R26 }, \ - { R30, R31, R32, R33, R34, R35, R36 }, \ - { R40, R41, R42, R43, R44, R45, R46 } \ - } -#endif - -#endif diff --git a/keyboards/ergodash/rev2/rules.mk b/keyboards/ergodash/rev2/rules.mk deleted file mode 100644 index b6c9a258059..00000000000 --- a/keyboards/ergodash/rev2/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no diff --git a/keyboards/ergodash/rules.mk b/keyboards/ergodash/rules.mk index e25346dacd1..8be059d969f 100644 --- a/keyboards/ergodash/rules.mk +++ b/keyboards/ergodash/rules.mk @@ -1,52 +1,21 @@ -SRC += matrix.c \ - i2c.c \ - split_util.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) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # 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 @@ -57,19 +26,17 @@ 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 +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. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # 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 +SPLIT_KEYBOARD = yes # Enables split keyboard support -DEFAULT_FOLDER = ergodash/rev2 +DEFAULT_FOLDER = ergodash/rev1 diff --git a/keyboards/ergodash/serial.c b/keyboards/ergodash/serial.c deleted file mode 100644 index 74bcbb6bf6e..00000000000 --- a/keyboards/ergodash/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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/ergodash/serial.h b/keyboards/ergodash/serial.h deleted file mode 100644 index 15fe4db7b4c..00000000000 --- a/keyboards/ergodash/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#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/ergodash/split_util.c b/keyboards/ergodash/split_util.c deleted file mode 100644 index 346cbc90894..00000000000 --- a/keyboards/ergodash/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#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 From e14732be9f52d2d79f2334384b52d36825539515 Mon Sep 17 00:00:00 2001 From: Martinffx Date: Mon, 6 May 2019 01:25:29 +0200 Subject: [PATCH 100/129] Add my layout for the KBD67, update readme for default layout to (#5779) display layout. --- .../kbd67/rev1/keymaps/default/readme.md | 32 ++++++ .../kbd67/rev1/keymaps/martinffx/config.h | 19 ++++ .../kbd67/rev1/keymaps/martinffx/keymap.c | 99 +++++++++++++++++++ .../kbd67/rev1/keymaps/martinffx/readme.md | 33 +++++++ 4 files changed, 183 insertions(+) create mode 100644 keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/config.h create mode 100644 keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/keymap.c create mode 100644 keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/readme.md diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/default/readme.md b/keyboards/kbdfans/kbd67/rev1/keymaps/default/readme.md index 2cb43c5e1a3..391ea3b4101 100644 --- a/keyboards/kbdfans/kbd67/rev1/keymaps/default/readme.md +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/default/readme.md @@ -1 +1,33 @@ # The default keymap for kbd67 + +``` +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Home| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |PgUp| + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|End | + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +``` + +``` + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +``` diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/config.h b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/keymap.c b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/keymap.c new file mode 100644 index 00000000000..839e28fae13 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/keymap.c @@ -0,0 +1,99 @@ +/* Copyright 2018 '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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (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| + * |----------------------------------------------------------------| + * |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 |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[0] = LAYOUT_65_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_GRAVE, \ + 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_DELETE,\ + 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_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, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +[1] = LAYOUT_65_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_DEL,KC_INS, \ + KC_CAPS,_______, KC_UP,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP,_______, _______,_______, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______, KC_END,KC_PGDN,KC_DOWN, _______,KC_PGUP,_______, \ + _______, _______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN, KC_END), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/readme.md b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/readme.md new file mode 100644 index 00000000000..dfa800d17c2 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/readme.md @@ -0,0 +1,33 @@ +# The default keymap for kbd67 + +``` +/* Keymap (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| + * |----------------------------------------------------------------| + * |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 |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +``` + +``` + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +``` From e290dc5ad811e9d121e216fba6fe03666772c3a4 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Sun, 5 May 2019 18:27:02 -0500 Subject: [PATCH 101/129] Space Cadet: Reducing unnecessary reported keypresses (#5781) * Reducing unnecessary reported keypresses and minor docs / variable name changes * Apply suggestions from code review Co-Authored-By: XScorpion2 --- docs/feature_space_cadet.md | 6 +-- quantum/process_keycode/process_space_cadet.c | 39 +++++++++++-------- quantum/process_keycode/process_space_cadet.h | 2 +- users/xulkal/config.h | 2 +- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/docs/feature_space_cadet.md b/docs/feature_space_cadet.md index 3e4665cde68..5c375c51842 100644 --- a/docs/feature_space_cadet.md +++ b/docs/feature_space_cadet.md @@ -39,15 +39,15 @@ By default Space Cadet assumes a US ANSI layout, but if your layout uses differe |`LSPO_KEYS` |`KC_LSFT, LSPO_MOD, LSPO_KEY` |Send `KC_LSFT` when held, the mod and key defined by `LSPO_MOD` and `LSPO_KEY`. | |`RSPC_KEYS` |`KC_RSFT, RSPC_MOD, RSPC_KEY` |Send `KC_RSFT` when held, the mod and key defined by `RSPC_MOD` and `RSPC_KEY`. | |`LCPO_KEYS` |`KC_LCTL, KC_LCTL, KC_9` |Send `KC_LCTL` when held, the mod `KC_LCTL` with the key `KC_9` when tapped. | -|`RCPO_KEYS` |`KC_RCTL, KC_RCTL, KC_0` |Send `KC_RCTL` when held, the mod `KC_RCTL` with the key `KC_0` when tapped. | +|`RCPC_KEYS` |`KC_RCTL, KC_RCTL, KC_0` |Send `KC_RCTL` when held, the mod `KC_RCTL` with the key `KC_0` when tapped. | |`LAPO_KEYS` |`KC_LALT, KC_LALT, KC_9` |Send `KC_LALT` when held, the mod `KC_LALT` with the key `KC_9` when tapped. | -|`RAPO_KEYS` |`KC_RALT, KC_RALT, KC_0` |Send `KC_RALT` when held, the mod `KC_RALT` with the key `KC_0` when tapped. | +|`RAPC_KEYS` |`KC_RALT, KC_RALT, KC_0` |Send `KC_RALT` when held, the mod `KC_RALT` with the key `KC_0` when tapped. | |`SFTENT_KEYS` |`KC_RSFT, KC_TRNS, SFTENT_KEY` |Send `KC_RSFT` when held, no mod with the key `SFTENT_KEY` when tapped. | ## Obsolete Configuration -These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just `KC_LSPO`, with the old defines you had an all or nothing choice of using the `DISABLE_SPACE_CADET_MODIFIER` define. Now you can define that key as: `#define KC_LSPO_KEYS KC_LSFT, KC_TRNS, KC_9`. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the `KC_9` +These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just `KC_LSPO`, with the old defines you had an all or nothing choice of using the `DISABLE_SPACE_CADET_MODIFIER` define. Now you can define that key as: `#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_9`. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the `KC_9`. |Define |Default |Description | |------------------------------|-------------|------------------------------------------------------------------| diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c index a9c506168d6..ac39df80893 100644 --- a/quantum/process_keycode/process_space_cadet.c +++ b/quantum/process_keycode/process_space_cadet.c @@ -62,16 +62,16 @@ #ifndef LCPO_KEYS #define LCPO_KEYS KC_LCTL, KC_LCTL, KC_9 #endif -#ifndef RCPO_KEYS - #define RCPO_KEYS KC_RCTL, KC_RCTL, KC_0 +#ifndef RCPC_KEYS + #define RCPC_KEYS KC_RCTL, KC_RCTL, KC_0 #endif // Alt / paren setup #ifndef LAPO_KEYS #define LAPO_KEYS KC_LALT, KC_LALT, KC_9 #endif -#ifndef RAPO_KEYS - #define RAPO_KEYS KC_RALT, KC_RALT, KC_0 +#ifndef RAPC_KEYS + #define RAPC_KEYS KC_RALT, KC_RALT, KC_0 #endif // Shift / Enter setup @@ -82,27 +82,32 @@ static uint8_t sc_last = 0; static uint16_t sc_timer = 0; -void perform_space_cadet(keyrecord_t *record, uint8_t normalMod, uint8_t tapMod, uint8_t keycode) { +void perform_space_cadet(keyrecord_t *record, uint8_t holdMod, uint8_t tapMod, uint8_t keycode) { if (record->event.pressed) { - sc_last = normalMod; + sc_last = holdMod; sc_timer = timer_read (); - if (IS_MOD(normalMod)) { - register_mods(MOD_BIT(normalMod)); + if (IS_MOD(holdMod)) { + register_mods(MOD_BIT(holdMod)); } } else { - if (IS_MOD(normalMod)) { - unregister_mods(MOD_BIT(normalMod)); - } - - if (sc_last == normalMod && timer_elapsed(sc_timer) < TAPPING_TERM) { - if (IS_MOD(tapMod)) { - register_mods(MOD_BIT(tapMod)); + if (sc_last == holdMod && timer_elapsed(sc_timer) < TAPPING_TERM) { + if (holdMod != tapMod) { + if (IS_MOD(holdMod)) { + unregister_mods(MOD_BIT(holdMod)); + } + if (IS_MOD(tapMod)) { + register_mods(MOD_BIT(tapMod)); + } } tap_code(keycode); if (IS_MOD(tapMod)) { unregister_mods(MOD_BIT(tapMod)); } + } else { + if (IS_MOD(holdMod)) { + unregister_mods(MOD_BIT(holdMod)); + } } } } @@ -122,7 +127,7 @@ bool process_space_cadet(uint16_t keycode, keyrecord_t *record) { return false; } case KC_RCPC: { - perform_space_cadet(record, RCPO_KEYS); + perform_space_cadet(record, RCPC_KEYS); return false; } case KC_LAPO: { @@ -130,7 +135,7 @@ bool process_space_cadet(uint16_t keycode, keyrecord_t *record) { return false; } case KC_RAPC: { - perform_space_cadet(record, RAPO_KEYS); + perform_space_cadet(record, RAPC_KEYS); return false; } case KC_SFTENT: { diff --git a/quantum/process_keycode/process_space_cadet.h b/quantum/process_keycode/process_space_cadet.h index 3f08b8002ad..c8231435046 100644 --- a/quantum/process_keycode/process_space_cadet.h +++ b/quantum/process_keycode/process_space_cadet.h @@ -17,5 +17,5 @@ #include "quantum.h" -void perform_space_cadet(keyrecord_t *record, uint8_t normalMod, uint8_t tapMod, uint8_t keycode); +void perform_space_cadet(keyrecord_t *record, uint8_t holdMod, uint8_t tapMod, uint8_t keycode); bool process_space_cadet(uint16_t keycode, keyrecord_t *record); diff --git a/users/xulkal/config.h b/users/xulkal/config.h index 6ff4ca49df4..2899017b038 100644 --- a/users/xulkal/config.h +++ b/users/xulkal/config.h @@ -10,7 +10,7 @@ #define LSPO_KEYS KC_LSFT, KC_TRNS, KC_LBRC #define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC #define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS -#define RCPO_KEYS KC_RCTL, KC_TRNS, KC_EQL +#define RCPC_KEYS KC_RCTL, KC_TRNS, KC_EQL // No need for the single versions when multi performance isn't a problem =D #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE From af22609ba53332b7b1e56f3a79119cec6c2e8c39 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Sun, 5 May 2019 19:58:08 -0400 Subject: [PATCH 102/129] [Keyboard] Practice65 Keyboard (#5795) * Save p65 changes * Save p65 changes * Add reset * update num leds --- .../boards/GENERIC_STM32_F103/board.c | 56 ++ .../boards/GENERIC_STM32_F103/board.h | 166 ++++++ .../boards/GENERIC_STM32_F103/board.mk | 5 + .../cannonkeys/practice65/bootloader_defs.h | 10 + keyboards/cannonkeys/practice65/chconf.h | 524 ++++++++++++++++++ keyboards/cannonkeys/practice65/config.h | 78 +++ keyboards/cannonkeys/practice65/halconf.h | 353 ++++++++++++ .../practice65/keymaps/default/keymap.c | 48 ++ .../cannonkeys/practice65/ld/MKL26Z64.ld | 105 ++++ .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 +++ keyboards/cannonkeys/practice65/mcuconf.h | 209 +++++++ keyboards/cannonkeys/practice65/practice65.c | 2 + keyboards/cannonkeys/practice65/practice65.h | 19 + keyboards/cannonkeys/practice65/readme.md | 12 + keyboards/cannonkeys/practice65/rules.mk | 53 ++ 15 files changed, 1728 insertions(+) create mode 100644 keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.c create mode 100644 keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.h create mode 100644 keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.mk create mode 100644 keyboards/cannonkeys/practice65/bootloader_defs.h create mode 100644 keyboards/cannonkeys/practice65/chconf.h create mode 100644 keyboards/cannonkeys/practice65/config.h create mode 100644 keyboards/cannonkeys/practice65/halconf.h create mode 100644 keyboards/cannonkeys/practice65/keymaps/default/keymap.c create mode 100644 keyboards/cannonkeys/practice65/ld/MKL26Z64.ld create mode 100644 keyboards/cannonkeys/practice65/ld/STM32F103x8_stm32duino_bootloader.ld create mode 100644 keyboards/cannonkeys/practice65/mcuconf.h create mode 100644 keyboards/cannonkeys/practice65/practice65.c create mode 100644 keyboards/cannonkeys/practice65/practice65.h create mode 100644 keyboards/cannonkeys/practice65/readme.md create mode 100644 keyboards/cannonkeys/practice65/rules.mk diff --git a/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.c b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.h b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#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) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.mk b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/cannonkeys/practice65/bootloader_defs.h b/keyboards/cannonkeys/practice65/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/cannonkeys/practice65/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/cannonkeys/practice65/chconf.h b/keyboards/cannonkeys/practice65/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/cannonkeys/practice65/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/practice65/config.h b/keyboards/cannonkeys/practice65/config.h new file mode 100644 index 00000000000..d09b521bfab --- /dev/null +++ b/keyboards/cannonkeys/practice65/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2015 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 . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA04 +#define PRODUCT_ID 0x6565 +#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 CannonKeys +#define PRODUCT Practice 65 +#define DESCRIPTION Practice 65 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +#define MATRIX_COL_PINS { B8, B0, A0, B5, B10, B9, A6, B12, A7, A5, A4, A3, A2, A1, B13, B14 } +#define MATRIX_ROW_PINS { B4, B11, B1, B7, B6 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 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 + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 20 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +/* + * 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 diff --git a/keyboards/cannonkeys/practice65/halconf.h b/keyboards/cannonkeys/practice65/halconf.h new file mode 100644 index 00000000000..72879a575b9 --- /dev/null +++ b/keyboards/cannonkeys/practice65/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/practice65/keymaps/default/keymap.c b/keyboards/cannonkeys/practice65/keymaps/default/keymap.c new file mode 100644 index 00000000000..fdc06e39857 --- /dev/null +++ b/keyboards/cannonkeys/practice65/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,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 . +*/ +#include QMK_KEYBOARD_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 _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_default( + 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_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_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, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT \ + ), + + [_FN1] = LAYOUT_default( + KC_GESC, 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, _______, _______,\ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ + ) +}; diff --git a/keyboards/cannonkeys/practice65/ld/MKL26Z64.ld b/keyboards/cannonkeys/practice65/ld/MKL26Z64.ld new file mode 100644 index 00000000000..c4ca8b874cc --- /dev/null +++ b/keyboards/cannonkeys/practice65/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/practice65/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/cannonkeys/practice65/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/cannonkeys/practice65/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/practice65/mcuconf.h b/keyboards/cannonkeys/practice65/mcuconf.h new file mode 100644 index 00000000000..fced27289e0 --- /dev/null +++ b/keyboards/cannonkeys/practice65/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/practice65/practice65.c b/keyboards/cannonkeys/practice65/practice65.c new file mode 100644 index 00000000000..10f60460fac --- /dev/null +++ b/keyboards/cannonkeys/practice65/practice65.c @@ -0,0 +1,2 @@ + +#include "practice65.h" diff --git a/keyboards/cannonkeys/practice65/practice65.h b/keyboards/cannonkeys/practice65/practice65.h new file mode 100644 index 00000000000..dec02af936f --- /dev/null +++ b/keyboards/cannonkeys/practice65/practice65.h @@ -0,0 +1,19 @@ +#pragma once + +#include "quantum.h" + +#define KNO KC_NO + +#define LAYOUT_default( \ + 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, K2F, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, \ + K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, 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, K2F }, \ + { K30, KNO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F }, \ + { K40, K41, K42, KNO, KC_NO, KC_NO, K46, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D, KC_NO, K4F } \ +} diff --git a/keyboards/cannonkeys/practice65/readme.md b/keyboards/cannonkeys/practice65/readme.md new file mode 100644 index 00000000000..515d1ab5959 --- /dev/null +++ b/keyboards/cannonkeys/practice65/readme.md @@ -0,0 +1,12 @@ +# Practice 65 + +A Blue Pill STM32F103C8T6-based 65% ANSI board. + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: Blue Pill STM32F103C8T6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/practice65:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/practice65/rules.mk b/keyboards/cannonkeys/practice65/rules.mk new file mode 100644 index 00000000000..8bbc910aade --- /dev/null +++ b/keyboards/cannonkeys/practice65/rules.mk @@ -0,0 +1,53 @@ +# project specific files +VPATH += keyboards/cannonkeys/bluepill +SRC = led.c \ + keyboard.c + +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +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 +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes From c2f9e018abbbb1aa8029001fe224b6082127e3a7 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 6 May 2019 00:08:12 -0400 Subject: [PATCH 103/129] [Keyboard] Add ProjectKeyboard Alice PCB to QMK (#5581) * Update instant60 for tsangan version * Add project alice keyboard * remove * Remove commented out code * Update readme * Add newline * Update keyboards/projectkb/alice/readme.md Co-Authored-By: awkannan * Update keyboards/projectkb/alice/halconf.h Co-Authored-By: awkannan * Update keyboards/projectkb/alice/halconf.h Co-Authored-By: awkannan * Fix ifdef and use helper macros * Add reset keycode * udpate keymap * Add RGB Keycodes * Styling things * remove unused enum * fix --- keyboards/projectkb/alice/alice.c | 27 + keyboards/projectkb/alice/alice.h | 19 + .../boards/ST_STM32F072B_DISCOVERY/board.c | 109 +++ .../boards/ST_STM32F072B_DISCOVERY/board.h | 922 ++++++++++++++++++ .../boards/ST_STM32F072B_DISCOVERY/board.mk | 5 + .../ST_STM32F072B_DISCOVERY/cfg/board.chcfg | 703 +++++++++++++ keyboards/projectkb/alice/bootloader_defs.h | 7 + keyboards/projectkb/alice/chconf.h | 524 ++++++++++ keyboards/projectkb/alice/config.h | 92 ++ keyboards/projectkb/alice/halconf.h | 351 +++++++ .../projectkb/alice/keymaps/default/keymap.c | 45 + keyboards/projectkb/alice/mcuconf.h | 176 ++++ keyboards/projectkb/alice/readme.md | 12 + keyboards/projectkb/alice/rules.mk | 56 ++ 14 files changed, 3048 insertions(+) create mode 100644 keyboards/projectkb/alice/alice.c create mode 100644 keyboards/projectkb/alice/alice.h create mode 100644 keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c create mode 100644 keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h create mode 100644 keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk create mode 100644 keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg create mode 100644 keyboards/projectkb/alice/bootloader_defs.h create mode 100644 keyboards/projectkb/alice/chconf.h create mode 100644 keyboards/projectkb/alice/config.h create mode 100644 keyboards/projectkb/alice/halconf.h create mode 100644 keyboards/projectkb/alice/keymaps/default/keymap.c create mode 100644 keyboards/projectkb/alice/mcuconf.h create mode 100644 keyboards/projectkb/alice/readme.md create mode 100644 keyboards/projectkb/alice/rules.mk diff --git a/keyboards/projectkb/alice/alice.c b/keyboards/projectkb/alice/alice.c new file mode 100644 index 00000000000..fada4368110 --- /dev/null +++ b/keyboards/projectkb/alice/alice.c @@ -0,0 +1,27 @@ +#include "alice.h" + +void matrix_init_board(void){ + setPinOutput(A0); + setPinOutput(A1); + setPinOutput(A2); +} + + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(A0); + } else { + writePinHigh(A0); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(A1); + } else { + writePinHigh(A1); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(A2); + } else { + writePinHigh(A2); + } + led_set_user(usb_led); +} diff --git a/keyboards/projectkb/alice/alice.h b/keyboards/projectkb/alice/alice.h new file mode 100644 index 00000000000..907f020e41a --- /dev/null +++ b/keyboards/projectkb/alice/alice.h @@ -0,0 +1,19 @@ +#pragma once + +#include "quantum.h" + +#define KNO KC_NO + +#define LAYOUT_default( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K31, K32, K33, K34, K35, K36, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, \ + K41, K43, K44, K46, K49, K4B, K4F \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, KNO, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, KNO, K28, K29, K2A, K2B, K2C, K2D, KNO, K2F }, \ + { KNO, K31, K32, K33, K34, K35, K36, KNO, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \ + { KNO, K41, KNO, K43, K44, KNO, K46, KNO, KNO, K49, KNO, K4B, KNO, KNO, KNO, K4F } \ +} diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 00000000000..9d10fbd754d --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,109 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#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(); +} + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 00000000000..de3a93d1ceb --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,922 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 32768 +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 00000000000..b98dcdd26c6 --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg new file mode 100644 index 00000000000..9c7cf4fd76a --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg @@ -0,0 +1,703 @@ + + + + + resources/gencfg/processors/boards/stm32f0xx/templates + .. + 3.0.x + + ST STM32F072B-Discovery + ST_STM32F072B_DISCOVERY + + STM32F072xB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/projectkb/alice/bootloader_defs.h b/keyboards/projectkb/alice/bootloader_defs.h new file mode 100644 index 00000000000..02c48c4e6dc --- /dev/null +++ b/keyboards/projectkb/alice/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/projectkb/alice/chconf.h b/keyboards/projectkb/alice/chconf.h new file mode 100644 index 00000000000..99fa8ce3982 --- /dev/null +++ b/keyboards/projectkb/alice/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/projectkb/alice/config.h b/keyboards/projectkb/alice/config.h new file mode 100644 index 00000000000..2a6e81f1d7f --- /dev/null +++ b/keyboards/projectkb/alice/config.h @@ -0,0 +1,92 @@ +/* +Copyright 2015 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 . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x0159 +#define PRODUCT_ID 0xA71C +#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 ProjectKB +#define PRODUCT Alice +#define DESCRIPTION ProjectKB Alice + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +#define MATRIX_COL_PINS { B2, B10, B11, A9, A15, B3, B4, B5, B6, B7, B8, B9, C13, C14, C15, B12 } +#define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 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 + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 14 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +// EEPROM usage +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x01 +#define EEPROM_VERSION_ADDR 34 + +#define EEPROM_CUSTOM_BACKLIGHT 804 + + + +/* + * 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 diff --git a/keyboards/projectkb/alice/halconf.h b/keyboards/projectkb/alice/halconf.h new file mode 100644 index 00000000000..da08cdbae2c --- /dev/null +++ b/keyboards/projectkb/alice/halconf.h @@ -0,0 +1,351 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#pragma once + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +/** @} */ diff --git a/keyboards/projectkb/alice/keymaps/default/keymap.c b/keyboards/projectkb/alice/keymaps/default/keymap.c new file mode 100644 index 00000000000..bad22f9ae44 --- /dev/null +++ b/keyboards/projectkb/alice/keymaps/default/keymap.c @@ -0,0 +1,45 @@ +/* +Copyright 2012,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 . +*/ +#include QMK_KEYBOARD_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 _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_default( + KC_ESC, 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_DEL, KC_BSPC, + 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_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_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RGUI, + KC_LCTL, KC_LALT, KC_SPC, MO(_FN1), KC_SPC, KC_RALT, KC_RCTL + ), + + [_FN1] = LAYOUT_default( + RGB_TOG, _______, 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, + RGB_MOD, _______, _______, KC_UP, _______, _______, _______, RGB_SAI, RGB_HUI, RGB_VAI, _______, _______, _______, _______, _______, + RGB_RMOD, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, _______, _______, _______, _______, + _______, BL_INC, BL_DEC, BL_TOGG, BL_BRTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET + ) +}; + diff --git a/keyboards/projectkb/alice/mcuconf.h b/keyboards/projectkb/alice/mcuconf.h new file mode 100644 index 00000000000..048eb4df650 --- /dev/null +++ b/keyboards/projectkb/alice/mcuconf.h @@ -0,0 +1,176 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF +// #define STM32F070xB + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/projectkb/alice/readme.md b/keyboards/projectkb/alice/readme.md new file mode 100644 index 00000000000..cc9f22685b0 --- /dev/null +++ b/keyboards/projectkb/alice/readme.md @@ -0,0 +1,12 @@ +# ProjectKeyboard Alice PCB + +ProjectKeyboard Alice Keyboard Replacement PCB + +Keyboard Maintainer: onefiftynine + +Hardware Supported: STM32F072CBT6 +Make example for this keyboard (after setting up your build environment): + + make projectkb/alice:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/projectkb/alice/rules.mk b/keyboards/projectkb/alice/rules.mk new file mode 100644 index 00000000000..cd366c76aa7 --- /dev/null +++ b/keyboards/projectkb/alice/rules.mk @@ -0,0 +1,56 @@ +# project specific files +# SRC = ssd1306.c +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# + +# project specific files +VPATH += keyboards/cannonkeys/stm32f072 +SRC = keyboard.c \ + led.c + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +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 +CUSTOM_MATRIX = no # Custom matrix file +# BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason +RGBLIGHT_ENABLE = yes + +# RAW_ENABLE = yes +# DYNAMIC_KEYMAP_ENABLE = yes + From e96d196dc985072a30cdc5a520c37e9533894cbf Mon Sep 17 00:00:00 2001 From: M-AS Date: Mon, 6 May 2019 00:54:41 -0400 Subject: [PATCH 104/129] [Keymap] MatthewRobo Massdrop CTRL/DZ60RGB Keymaps (#5799) * added personal CTRL keymap * added personal dz60rgb keymap * enabled new rgb effect * added space cadet shift * media player track buttons now orange * updated keymaps with rgb setting and visual HSV setting preview * fixed source stuff? * added support for underglow toggle (bugged to all hell) * everything now behaves as expected when ti comes to RGB toggles, thank god * removed ifdefs * changed color of MAS_CRM * uh, whitespace --- .../dz60rgb/keymaps/matthewrobo/config.h | 60 +++ .../dz60rgb/keymaps/matthewrobo/keymap.c | 333 ++++++++++++++ .../dz60rgb/keymaps/matthewrobo/rules.mk | 7 + .../ctrl/keymaps/matthewrobo/config.h | 52 +++ .../ctrl/keymaps/matthewrobo/keymap.c | 405 ++++++++++++++++++ .../ctrl/keymaps/matthewrobo/rules.mk | 2 + 6 files changed, 859 insertions(+) create mode 100644 keyboards/dztech/dz60rgb/keymaps/matthewrobo/config.h create mode 100644 keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c create mode 100644 keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk create mode 100644 keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h create mode 100644 keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c create mode 100644 keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/config.h b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/config.h new file mode 100644 index 00000000000..b6fb08dc1c5 --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/config.h @@ -0,0 +1,60 @@ +#pragma once + +#define FORCE_NKRO + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 + +#undef DISABLE_RGB_MATRIX_SPLASH +#undef DISABLE_RGB_MATRIX_MULTISPLASH +#undef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + + +// #define DISABLE_RGB_MATRIX_ALPHAS_MODS +#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define DISABLE_RGB_MATRIX_BREATHING +#define DISABLE_RGB_MATRIX_CYCLE_ALL +#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +// #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define DISABLE_RGB_MATRIX_DUAL_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define DISABLE_RGB_MATRIX_RAINDROPS +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define DISABLE_RGB_MATRIX_DIGITAL_RAIN +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +// #define DISABLE_RGB_MATRIX_SPLASH +// #define DISABLE_RGB_MATRIX_MULTISPLASH +// #define DISABLE_RGB_MATRIX_SOLID_SPLASH +// #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define QMK_KEYS_PER_SCAN 4 + +// #define RGB_MATRIX_KEYRELEASES + + +// some speed shit +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#ifndef NO_DEBUG +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT + +#define NO_ACTION_ONESHOT +#define TAPPING_FORCE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT + +// #include "config_led.h" +// #include "dz60rgb.h" diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c new file mode 100644 index 00000000000..5c725f5dccd --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c @@ -0,0 +1,333 @@ +#include QMK_KEYBOARD_H + +extern bool g_suspend_state; + +enum dz60rgb_layers { + _QWERTY, + _FNM, + _NAV, + _RGB, + _FNC +}; + +enum dz60rgb_keycodes { + REBOOT = SAFE_RANGE, + MAS_CRM, + MAS_PRP, + MAS_RED, + MAS_GRN, + MAS_BLU, + MAS_CYN, + MAS_MGT, + MAS_YEL, + MAS_KEY, + MAS_WHT, +}; +#define _V_V_V_ KC_TRNS +#define LT_CAPS LT(_NAV, KC_CAPS) +#define LT_DEL LT(_RGB, KC_DEL) +extern rgb_config_t rgb_matrix_config; +extern bool autoshift_enabled; +#define MT_SLSH RSFT_T(KC_SLSH) +#define MT_APP RALT_T(KC_APP) +#define LM_LALT LM(_FNM, MOD_LALT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + 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, \ + LT_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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MT_SLSH, KC_UP, LT_DEL, \ + KC_LCTL, KC_LGUI, LM_LALT, KC_SPC, MT_APP, MO(_FNC), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FNM] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _V_V_V_, _______, _______, _______, _______, _______, _______ \ + ), + [_NAV] = LAYOUT( + KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PMNS, KC_PPLS, KC_DEL, \ + _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, _______, KC_P4, KC_P5, KC_P6, KC_PSLS, KC_PSCR, KC_SLCK, KC_INS, \ + _V_V_V_, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_P1, KC_P2, KC_P3, _______, _______, KC_PENT, \ + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, KC_P0, KC_PDOT, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_RGB] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, MAS_MGT, MAS_BLU, MAS_WHT, RGB_RMOD, RGB_MOD, _______, \ + _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, MAS_RED, MAS_KEY, MAS_CYN, MAS_PRP, _______, _______, \ + _______, RGB_TOG, _______, _______, _______, _______, _______, MAS_YEL, MAS_GRN, MAS_CRM, _______, _______, _V_V_V_, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_FNC] = LAYOUT( // fuck it edition + RCTL(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_ASTG, \ + RCTL(KC_TAB), RCTL(KC_Q), RCTL(KC_W), RCTL(KC_E), RCTL(KC_R), RCTL(KC_T), RCTL(KC_Y), RCTL(KC_U), RCTL(KC_I), RCTL(KC_O), RCTL(KC_P), RCTL(KC_LBRC), RCTL(KC_RBRC), RCTL(KC_BSLS), \ + RCTL(KC_CAPS), RCTL(KC_A), RCTL(KC_S), RCTL(KC_D), RCTL(KC_F), RCTL(KC_G), RCTL(KC_H), RCTL(KC_J), RCTL(KC_K), RCTL(KC_L), RCTL(KC_SCLN), RCTL(KC_QUOT), RCTL(KC_ENT), \ + RCTL(KC_LSFT), RCTL(KC_Z), RCTL(KC_X), RCTL(KC_C), RCTL(KC_V), REBOOT, RCTL(KC_N), RCTL(KC_M), RCTL(KC_COMM), RCTL(KC_DOT), RCTL(KC_SLSH), KC_VOLU, RCTL(KC_DEL), \ + RCTL(KC_LCTL), RCTL(KC_LGUI), RCTL(KC_LALT), RCTL(KC_SPC), KC_MUTE, _V_V_V_, RCTL(KC_LEFT), KC_VOLD, RCTL(KC_RGHT) \ + ), + /* + [_FNC] = LAYOUT( + _______, 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_ASTG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, REBOOT, _______, _______, _______, _______, RCTL(KC_SLSH), KC_VOLU, RCTL(KC_DEL), \ + _______, _______, _______, _______, KC_MUTE, _______, RCTL(KC_LEFT), KC_VOLD, RCTL(KC_RGHT) \ + ), + [_LAYER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_LAYER] = LAYOUT( + 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, \ + 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, \ + 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, \ + 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, \ + 62, 61, 60, 59, 58, 57, 56, 55, 54 \ + ), + */ +}; + +void rgb_matrix_indicators_user(void) +{ + uint8_t this_led = host_keyboard_leds(); + + if (!g_suspend_state && rgb_matrix_config.enable) { + switch (biton32(layer_state)) { + case _NAV: + if (this_led & (1 << USB_LED_NUM_LOCK)) { + rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(19, 0xFF, 0xFF, 0x00); + } else { + rgb_matrix_set_color(13, 0x00, 0x00, 0x00); + rgb_matrix_set_color(19, 0xFF, 0x00, 0x00); + } + + rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); // layer indicator + // ESDF + rgb_matrix_set_color(24, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(38, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(36, 0xFF, 0x00, 0x00); + // home/end + rgb_matrix_set_color(25, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(23, 0x00, 0xFF, 0x00); + // pgup/dn + rgb_matrix_set_color(26, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(39, 0x00, 0x00, 0xFF); + // numpad + rgb_matrix_set_color(6, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(5, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(4, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(20, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(18, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(33, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(32, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(31, 0xFF, 0xFF, 0x00); + // zero + rgb_matrix_set_color(47, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(46, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(45, 0xFF, 0x00, 0x00); + // dot + rgb_matrix_set_color(44, 0x00, 0x00, 0xFF); + // math shit + rgb_matrix_set_color(3, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(2, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(1, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(0, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(17, 0x00, 0x00, 0xFF); + // other + rgb_matrix_set_color(16, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(15, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(14, 0xFF, 0xFF, 0xFF); + break; + + case _RGB: { + HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; + HSV hui = hsv; + HSV hud = hsv; + HSV sai = hsv; + HSV sad = hsv; + HSV vai = hsv; + HSV vad = hsv; + hui.h = hsv.h + 8; + hud.h = hsv.h - 8; + sai.s = hsv.s + 16 > 255 ? 255 : hsv.s + 16; + sad.s = hsv.s - 16 < 0 ? 0 : hsv.s - 16; + vai.v = hsv.v + 16 > 255 ? 255 : hsv.v + 16; + vad.v = hsv.v - 16 < 0 ? 0 : hsv.v - 16; + RGB rgb = hsv_to_rgb(hsv); + RGB rgbHUI = hsv_to_rgb(hui); + RGB rgbHUD = hsv_to_rgb(hud); + RGB rgbSAI = hsv_to_rgb(sai); + RGB rgbSAD = hsv_to_rgb(sad); + RGB rgbVAI = hsv_to_rgb(vai); + RGB rgbVAD = hsv_to_rgb(vad); + rgb_matrix_set_color(41, 0xFF, 0xFF, 0xFF); // layer indicator + rgb_matrix_set_color(59, rgb.r, rgb.g, rgb.b); // color indicator + rgb_matrix_set_color(26, 0xFF, 0x80, 0x00); //MOD + rgb_matrix_set_color(39, 0xFF, 0x80, 0x00); //MOD + rgb_matrix_set_color(16, 0xFF, 0x80, 0x00); //RGB_RMOD + rgb_matrix_set_color(15, 0xFF, 0x80, 0x00); //MOD + rgb_matrix_set_color(52, 0xFF, 0x40, 0x00); //TOG + rgb_matrix_set_color(25, 0x80, 0x80, 0x80); //SPI + rgb_matrix_set_color(38, 0x80, 0x80, 0x80); //SPD + rgb_matrix_set_color(24, rgbHUI.r, rgbHUI.g, rgbHUI.b); //HUI + rgb_matrix_set_color(37, rgbHUD.r, rgbHUD.g, rgbHUD.b); //HUD + rgb_matrix_set_color(23, rgbSAI.r, rgbSAI.g, rgbSAI.b); //SAI + rgb_matrix_set_color(36, rgbSAD.r, rgbSAD.g, rgbSAD.b); //SAD + rgb_matrix_set_color(22, rgbVAI.r, rgbVAI.g, rgbVAI.b); //VAI + rgb_matrix_set_color(35, rgbVAD.r, rgbVAD.g, rgbVAD.b); //VAD + rgb_matrix_set_color(19, 0xF0, 0x00, 0xFF); //MAS_MGT + rgb_matrix_set_color(18, 0x00, 0x02, 0xFF); //MAS_BLU + rgb_matrix_set_color(33, 0xFF, 0x00, 0x00); //MAS_RED + rgb_matrix_set_color(32, 0x00, 0x00, 0x00); //MAS_KEY + rgb_matrix_set_color(31, 0x00, 0xFF, 0xF7); //MAS_CYN + rgb_matrix_set_color(46, 0xFF, 0xDA, 0x00); //MAS_YEL + rgb_matrix_set_color(45, 0x00, 0xFF, 0x01); //MAS_GRN + rgb_matrix_set_color(44, 0xFF, 0xA5, 0x18); //MAS_CRM + rgb_matrix_set_color(30, 0x81, 0x3C, 0xFF); //MAS_PRP + rgb_matrix_set_color(17, 0xFF, 0xFF, 0xFF); //MAS_WHT + } + break; + + case _FNC: + rgb_matrix_set_color(57, 0xFF, 0xFF, 0xFF); // layer indicator + rgb_matrix_set_color(48, 0xFF, 0x00, 0x00); // bootloader + rgb_matrix_set_color(42, 0x00, 0x80, 0xFF); // vol + rgb_matrix_set_color(55, 0x00, 0x80, 0xFF); + rgb_matrix_set_color(58, 0xFF, 0x00, 0x00); // mute + rgb_matrix_set_color(56, 0xFF, 0x80, 0x00); // ctrl+left/right + rgb_matrix_set_color(54, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(41, 0xFF, 0x00, 0x40); // ctrl+delete + rgb_matrix_set_color(43, 0xFF, 0x00, 0x40); // ctrl+slash + + if (this_led & (1 << !autoshift_enabled)) { + rgb_matrix_set_color(0, 0xFF, 0x00, 0x00); // KC_ASTG + } else { + rgb_matrix_set_color(0, 0xFF, 0xFF, 0x00); + } + + break; + } + } + + if (this_led & (1 << USB_LED_CAPS_LOCK)) { + rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); + } +} + +void matrix_init_user(void) +{ + //user initialization + autoshift_disable(); +} + +void matrix_scan_user(void) +{ + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + static uint32_t key_timer; + + switch (keycode) { + case REBOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(1); + rgb_matrix_sethsv_noeeprom(11, 11, 11); + wait_ms(150); + reset_keyboard(); + } else { + register_code(KC_RCTL); + tap_code(KC_B); + unregister_code(KC_RCTL); + } + } + + return false; + + case MAS_CRM: + if (record->event.pressed) { + rgb_matrix_sethsv(32, 160, 255); + } + + return false; + + case MAS_PRP: + if (record->event.pressed) { + rgb_matrix_sethsv(192, 112, 255); + } + + return false; + + case MAS_RED: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 255, 255); + } + + return false; + + case MAS_GRN: + if (record->event.pressed) { + rgb_matrix_sethsv(88, 255, 255); + } + + return false; + + case MAS_BLU: + if (record->event.pressed) { + rgb_matrix_sethsv(168, 255, 255); + } + + return false; + + case MAS_CYN: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 255, 255); + } + + return false; + + case MAS_MGT: + if (record->event.pressed) { + rgb_matrix_sethsv(216, 255, 255); + } + + return false; + + case MAS_YEL: + if (record->event.pressed) { + rgb_matrix_sethsv(40, 255, 255); + } + + return false; + + case MAS_KEY: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 0, 0); + } + + return false; + + case MAS_WHT: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 0, 255); + } + + return false; + + default: + return true; + } +} diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk new file mode 100644 index 00000000000..15b8ec1bafc --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk @@ -0,0 +1,7 @@ +NKRO_ENABLE = yes # USB Nkey Rollover +AUTO_SHIFT_ENABLE = yes # Auto Shift +# VELOCIKEY_ENABLE = yes + +EXTRAFLAGS += -flto + +# SRC += dz60rgb.c diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h new file mode 100644 index 00000000000..35fd446194c --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h @@ -0,0 +1,52 @@ +#pragma once + +#define FORCE_NKRO + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 + +// #define DISABLE_RGB_MATRIX_ALPHAS_MODS +#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define DISABLE_RGB_MATRIX_BREATHING +#define DISABLE_RGB_MATRIX_CYCLE_ALL +#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +// #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define DISABLE_RGB_MATRIX_DUAL_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define DISABLE_RGB_MATRIX_RAINDROPS +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define DISABLE_RGB_MATRIX_DIGITAL_RAIN +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +// #define DISABLE_RGB_MATRIX_SPLASH +// #define DISABLE_RGB_MATRIX_MULTISPLASH +// #define DISABLE_RGB_MATRIX_SOLID_SPLASH +// #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define QMK_KEYS_PER_SCAN 4 + +// #define RGB_MATRIX_KEYRELEASES + + +// some speed shit +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#ifndef NO_DEBUG +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT + +#define NO_ACTION_ONESHOT +#define TAPPING_FORCE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c new file mode 100644 index 00000000000..b4339a4d48a --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c @@ -0,0 +1,405 @@ +#include QMK_KEYBOARD_H +extern bool g_suspend_state; + +enum ctrl_layers { + _QWERTY, + _NAV, + _FNC +}; + +enum ctrl_keycodes { + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout + MAS_TOG, + MAS_CRM, + MAS_PRP, + MAS_RED, + MAS_GRN, + MAS_BLU, + MAS_CYN, + MAS_MGT, + MAS_YEL, + MAS_KEY, + MAS_WHT, +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode +#define LT_CAPS LT(_NAV, KC_CAPS) +#define _V_V_V_ KC_TRNS +extern rgb_config_t rgb_matrix_config; +extern bool autoshift_enabled; + + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + 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, \ + LT_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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FNC), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_NAV] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PMNS, KC_PPLS, _______, _______, _______, _______, \ + _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, _______, KC_P4, KC_P5, KC_P6, KC_PSLS, _______, _______, KC_EQL, _______, _______, _______, \ + _V_V_V_, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PPLS, _______, \ + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, KC_P0, KC_PDOT, KC_PSLS, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_FNC] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_MSEL, KC_ASTG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_VOLU, \ + _______, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, MAS_MGT, MAS_BLU, MAS_WHT, RGB_RMOD, RGB_MOD, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, MAS_RED, MAS_KEY, MAS_CYN, MAS_PRP, _______, _______, \ + MAS_TOG, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, MAS_YEL, MAS_GRN, MAS_CRM, _______, _______, RGB_VAI, \ + _______, _______, _______, _______, _______, _V_V_V_, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [X] = LAYOUT( + 0, 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, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, \ + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 \ + ), + */ +}; + +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +void set_color_helper(int index, uint8_t red, uint8_t green, uint8_t blue) +{ + if (!HAS_ANY_FLAGS(g_rgb_leds[index].flags, rgb_matrix_get_flags())) + { return; } + + rgb_matrix_set_color(index, red, green, blue); +} + +void rgb_matrix_indicators_user(void) +{ + uint8_t this_led = host_keyboard_leds(); + + if (!g_suspend_state && rgb_matrix_config.enable) { + switch (biton32(layer_state)) { + case _NAV: + if (this_led & (1 << USB_LED_NUM_LOCK)) { + rgb_matrix_set_color(41, 0xFF, 0x00, 0x00); + } else { + rgb_matrix_set_color(41, 0x00, 0x00, 0x00); + } + + // layer indicator + rgb_matrix_set_color(50, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(101, 0xFF, 0xFF, 0xFF); + // ESDF + rgb_matrix_set_color(36, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(52, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(53, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(54, 0xFF, 0x00, 0x00); + // home/end + rgb_matrix_set_color(35, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(37, 0x00, 0xFF, 0x00); + // pgup/dn + rgb_matrix_set_color(34, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(51, 0x00, 0x00, 0xFF); + // numpad + rgb_matrix_set_color(23, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(40, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(42, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(57, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(58, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(59, 0xFF, 0xFF, 0x00); + // zero + rgb_matrix_set_color(69, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(70, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(71, 0xFF, 0x00, 0x00); + // dot + rgb_matrix_set_color(72, 0x00, 0x00, 0xFF); + // math shit + rgb_matrix_set_color(26, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(27, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(28, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(43, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(46, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(60, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(61, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(73, 0x00, 0x00, 0xFF); + break; + + case _FNC: { + HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; + HSV hui = hsv; + HSV hud = hsv; + HSV sai = hsv; + HSV sad = hsv; + HSV vai = hsv; + HSV vad = hsv; + hui.h = hsv.h + 8; + hud.h = hsv.h - 8; + sai.s = hsv.s + 16 > 255 ? 255u : hsv.s + 16; + sad.s = hsv.s - 16 < 0 ? 0 : hsv.s - 16; + vai.v = hsv.v + 16 > 255 ? 255 : hsv.v + 16; + vad.v = hsv.v - 16 < 0 ? 0 : hsv.v - 16; + RGB rgb = hsv_to_rgb(hsv); + RGB rgbHUI = hsv_to_rgb(hui); + RGB rgbHUD = hsv_to_rgb(hud); + RGB rgbSAI = hsv_to_rgb(sai); + RGB rgbSAD = hsv_to_rgb(sad); + RGB rgbVAI = hsv_to_rgb(vai); + RGB rgbVAD = hsv_to_rgb(vad); + rgb_matrix_set_color(81, 0xFF, 0xFF, 0xFF); // layer indicator + rgb_matrix_set_color(91, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(93, 0x00, 0x00, 0x00); + rgb_matrix_set_color(94, rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(95, rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(96, 0x00, 0x00, 0x00); + rgb_matrix_set_color(68, 0xFF, 0x00, 0x00); // MD_BOOT + rgb_matrix_set_color(69, 0xFF, 0x00, 0x40); // TG_NKRO + rgb_matrix_set_color(32, 0x00, 0x80, 0xFF); // KC_VOLU + rgb_matrix_set_color(49, 0x00, 0x80, 0xFF); + rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); // KC_MUTE + rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // KC_MSTP + rgb_matrix_set_color(47, 0xFF, 0x40, 0x00); // KC_MPRV + rgb_matrix_set_color(48, 0xFF, 0x40, 0x00); + rgb_matrix_set_color(14, 0x00, 0xFF, 0x00); // KC_MSEL + rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); // KC_MPLY + + if (this_led & (1 << !autoshift_enabled)) { + rgb_matrix_set_color(15, 0xFF, 0x00, 0x00); // KC_ASTG + } else { + rgb_matrix_set_color(15, 0xFF, 0xFF, 0x00); + } + + rgb_matrix_set_color(44, 0xFF, 0x80, 0x00); //RGB_MOD + rgb_matrix_set_color(45, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(34, 0xFF, 0x80, 0x00); //RGB_MOD + rgb_matrix_set_color(51, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(63, 0xFF, 0x40, 0x00); //RGB_TOG + rgb_matrix_set_color(64, rgb.r, rgb.g, rgb.b); //MAS_TOG + rgb_matrix_set_color(36, rgbHUI.r, rgbHUI.g, rgbHUI.b); //RGB_HUI + rgb_matrix_set_color(53, rgbHUD.r, rgbHUD.g, rgbHUD.b); + rgb_matrix_set_color(37, rgbSAI.r, rgbSAI.g, rgbSAI.b); //RGB_SAI + rgb_matrix_set_color(54, rgbSAD.r, rgbSAD.g, rgbSAD.b); + rgb_matrix_set_color(38, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI + rgb_matrix_set_color(55, rgbVAD.r, rgbVAD.g, rgbVAD.b); + rgb_matrix_set_color(79, rgb.r, rgb.g, rgb.b); // config display + rgb_matrix_set_color(75, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI + rgb_matrix_set_color(85, rgbVAD.r, rgbVAD.g, rgbVAD.b); + rgb_matrix_set_color(35, 0x80, 0x80, 0x80); //RGB_SPI + rgb_matrix_set_color(52, 0x80, 0x80, 0x80); + rgb_matrix_set_color(84, 0x80, 0x80, 0x80); //RGB_SPI + rgb_matrix_set_color(86, 0x80, 0x80, 0x80); + rgb_matrix_set_color(41, 0xF0, 0x00, 0xFF); //MAS_MGT + rgb_matrix_set_color(42, 0x00, 0x02, 0xFF); //MAS_BLU + rgb_matrix_set_color(57, 0xFF, 0x00, 0x00); //MAS_RED + rgb_matrix_set_color(58, 0x00, 0x00, 0x00); //MAS_KEY + rgb_matrix_set_color(59, 0x00, 0xFF, 0xF7); //MAS_CYN + rgb_matrix_set_color(70, 0xFF, 0xDA, 0x00); //MAS_YEL + rgb_matrix_set_color(71, 0x00, 0xFF, 0x01); //MAS_GRN + rgb_matrix_set_color(72, 0xFF, 0xA5, 0x18); //MAS_CRM + rgb_matrix_set_color(60, 0x81, 0x3C, 0xFF); //MAS_PRP + rgb_matrix_set_color(26, 0xFF, 0xFF, 0xFF); //MAS_WHT + } + break; + } + } +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) +{ + autoshift_disable(); + rgb_matrix_sethsv(192, 112, 255); + rgb_matrix_mode(4); +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) +{ +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + static uint32_t key_timer; + + switch (keycode) { + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + + return false; + + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + + return false; + + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + + return false; + + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + + return false; + + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + + return false; + + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + + return false; + + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + + return false; + + case MAS_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + } + break; + } + } + + return false; + + case MAS_CRM: + if (record->event.pressed) { + rgb_matrix_sethsv(32, 160, 255); + } + + return false; + + case MAS_PRP: + if (record->event.pressed) { + rgb_matrix_sethsv(192, 112, 255); + } + + return false; + + case MAS_RED: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 255, 255); + } + + return false; + + case MAS_GRN: + if (record->event.pressed) { + rgb_matrix_sethsv(88, 255, 255); + } + + return false; + + case MAS_BLU: + if (record->event.pressed) { + rgb_matrix_sethsv(168, 255, 255); + } + + return false; + + case MAS_CYN: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 255, 255); + } + + return false; + + case MAS_MGT: + if (record->event.pressed) { + rgb_matrix_sethsv(216, 255, 255); + } + + return false; + + case MAS_YEL: + if (record->event.pressed) { + rgb_matrix_sethsv(40, 255, 255); + } + + return false; + + case MAS_KEY: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 0, 0); + } + + return false; + + case MAS_WHT: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 0, 255); + } + + return false; + + default: + return true; //Process all other keycodes normally + } +} + diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk new file mode 100644 index 00000000000..4fb7826ce61 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk @@ -0,0 +1,2 @@ +NKRO_ENABLE = yes # USB Nkey Rollover +AUTO_SHIFT_ENABLE = yes # Auto Shift From fbc40032e73ee80db961c3930a2b5d84ffd51a6f Mon Sep 17 00:00:00 2001 From: keyhive <42986966+keyhive@users.noreply.github.com> Date: Sun, 5 May 2019 23:01:43 -0600 Subject: [PATCH 105/129] [Keyboard] add ut47.2 (#5788) * adding ut47.2 adding ut47.2 * Update keyboards/ut472/ut472.c Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * Update keyboards/ut472/rules.mk Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * Update keyboards/ut472/ut472.c Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * Update keyboards/ut472/rules.mk Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * changed shift enter special keys to KC_SFTENT changed shift enter special keys to KC_SFTENT * Update keyboards/ut472/ut472.h Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * Update keyboards/ut472/ut472.h Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * Update keyboards/ut472/ut472.h Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * Update keyboards/ut472/readme.md Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * Update keyboards/ut472/readme.md Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * updated for sourcing updated for sourcing * Update keyboards/ut472/readme.md Co-Authored-By: keyhive <42986966+keyhive@users.noreply.github.com> * changed flash to make changed flash to make --- keyboards/ut472/config.h | 60 +++++++++++++ keyboards/ut472/info.json | 13 +++ keyboards/ut472/keymaps/default/config.h | 21 +++++ keyboards/ut472/keymaps/default/keymap.c | 100 ++++++++++++++++++++++ keyboards/ut472/keymaps/default/readme.md | 5 ++ keyboards/ut472/readme.md | 20 +++++ keyboards/ut472/rules.mk | 69 +++++++++++++++ keyboards/ut472/ut472.c | 13 +++ keyboards/ut472/ut472.h | 34 ++++++++ 9 files changed, 335 insertions(+) create mode 100644 keyboards/ut472/config.h create mode 100644 keyboards/ut472/info.json create mode 100644 keyboards/ut472/keymaps/default/config.h create mode 100644 keyboards/ut472/keymaps/default/keymap.c create mode 100644 keyboards/ut472/keymaps/default/readme.md create mode 100644 keyboards/ut472/readme.md create mode 100644 keyboards/ut472/rules.mk create mode 100644 keyboards/ut472/ut472.c create mode 100644 keyboards/ut472/ut472.h diff --git a/keyboards/ut472/config.h b/keyboards/ut472/config.h new file mode 100644 index 00000000000..8f0d76271fa --- /dev/null +++ b/keyboards/ut472/config.h @@ -0,0 +1,60 @@ +/* +Copyright 2018 Carlos Filoteo + +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 . +*/ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Keyhive +#define PRODUCT UT47.2 +#define DESCRIPTION An awesome 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D2, D3, D4 } +#define MATRIX_COL_PINS { C4, C5, B7, B6, B5, B4, B3, B2, B1, B0, D6, D5 } +#define UNUSED_PINS + + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* 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 + +#define RGB_DI_PIN C6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/ut472/info.json b/keyboards/ut472/info.json new file mode 100644 index 00000000000..40f769ae2ad --- /dev/null +++ b/keyboards/ut472/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "UT47.2", + "url": "", + "maintainer": "qmk", + "width": 12.5, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 47, + "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":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Backspace", "x":11, "y":0, "w":1.5}, {"label":"LT(3) / Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.25}, {"label":"Shift", "x":0, "y":2, "w":1.5}, {"label":"Z", "x":1.5, "y":2}, {"label":"X", "x":2.5, "y":2}, {"label":"C", "x":3.5, "y":2}, {"label":"V", "x":4.5, "y":2}, {"label":"B", "x":5.5, "y":2}, {"label":"N", "x":6.5, "y":2}, {"label":"M", "x":7.5, "y":2}, {"label":"<", "x":8.5, "y":2}, {"label":">", "x":9.5, "y":2}, {"label":"?", "x":10.5, "y":2}, {"label":"Shift / Enter", "x":11.5, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Alt", "x":1, "y":3}, {"label":"GUI", "x":2, "y":3}, {"label":"Menu", "x":3, "y":3}, {"label":"MO(2)", "x":4, "y":3, "w":1.25}, {"x":5.25, "y":3, "w":2}, {"label":"MO(1)", "x":7.25, "y":3, "w":1.25}, {"label":"\u2190", "x":8.5, "y":3}, {"label":"\u2193", "x":9.5, "y":3}, {"label":"\u2191", "x":10.5, "y":3}, {"label":"\u2192", "x":11.5, "y":3}] + } + } +} diff --git a/keyboards/ut472/keymaps/default/config.h b/keyboards/ut472/keymaps/default/config.h new file mode 100644 index 00000000000..f88ebf7e803 --- /dev/null +++ b/keyboards/ut472/keymaps/default/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ + +#pragma once + +#include "config_common.h" + +// place overrides here diff --git a/keyboards/ut472/keymaps/default/keymap.c b/keyboards/ut472/keymaps/default/keymap.c new file mode 100644 index 00000000000..883eb5a2287 --- /dev/null +++ b/keyboards/ut472/keymaps/default/keymap.c @@ -0,0 +1,100 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 QMK_KEYBOARD_H + +#define LT3_TAB LT(3, KC_TAB) + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| + * |-------------------------------------------------------------------------+ + * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| + * `-------------------------------------------------------------------------' + */ + +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, + LT3_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_SFTENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------+ + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left */ + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | |MousL|MousD|MousU|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; diff --git a/keyboards/ut472/keymaps/default/readme.md b/keyboards/ut472/keymaps/default/readme.md new file mode 100644 index 00000000000..e3dcee467e5 --- /dev/null +++ b/keyboards/ut472/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# UT47 default keymap + +![UT47 layout image](https://i.imgur.com/Tsz5qsF.png) + +[KLE](http://www.keyboard-layout-editor.com/##@@_y:0%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Back%20Space&_x:0.25&a:4&f:4&w:4&h:4&d:true%3B&=%3Cb%3EGNAP!%3C%2F%2Fb%3E%3Cp%3E%3Cp%3EMinimum%20stagger%3Cp%3E47%20key%20layout%3B&@_a:7&f:3&w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=J&=K&=L&=%2F%3B&_w:1.25%3B&=%27%3B&@_w:1.5%3B&=Shift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F%2F&=Return%3B&@=Ctrl&=Alt&=Super&=Menu&_w:1.25%3B&=%2F&dArr%2F%3B&_w:2%3B&=&_w:1.25%3B&=%2F&uArr%2F%3B&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&uarr%2F%3B&=%2F&rarr%2F%3B%3B&=undefined) diff --git a/keyboards/ut472/readme.md b/keyboards/ut472/readme.md new file mode 100644 index 00000000000..25f40d783ab --- /dev/null +++ b/keyboards/ut472/readme.md @@ -0,0 +1,20 @@ +# ut47.2 + +Somewhere between ortholinear and standard offset. Created to have all the same functions on a Planck in a keyboard but with a more conventional keyboard row stagger. + +Keyboard Maintainer: [filoxo](https://github.com/filoxo), [network_operations](https://www.keyhive.xyz) + +The keyboard files can be found here: https://github.com/ai03-2725/UT47.2 +or purchased at keyhive.xyz + +## Instructions + +To create a hex file for the UT47.2, run: + + make ut472:default + +## Layout + +Go to the [default layout README](keymaps/default/readme.md) for more information. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ut472/rules.mk b/keyboards/ut472/rules.mk new file mode 100644 index 00000000000..c7b2efedca3 --- /dev/null +++ b/keyboards/ut472/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u2 + +# 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 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + + +# Build Options +# change yes to no to disable +# +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 +# 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 = 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 +RGBLIGHT_ENABLE = yes diff --git a/keyboards/ut472/ut472.c b/keyboards/ut472/ut472.c new file mode 100644 index 00000000000..c0686d661aa --- /dev/null +++ b/keyboards/ut472/ut472.c @@ -0,0 +1,13 @@ +#include "ut472.h" + +void matrix_init_kb(void) { + // Keyboard start-up code goes here + // Runs once when the firmware starts up + matrix_init_user(); +}; + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +}; diff --git a/keyboards/ut472/ut472.h b/keyboards/ut472/ut472.h new file mode 100644 index 00000000000..1068dd7041f --- /dev/null +++ b/keyboards/ut472/ut472.h @@ -0,0 +1,34 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ + + #pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ +) \ + { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ + { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b } \ + } + + From 8a9c90ad78305a1d76663fcb973a1a2ae7177297 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 6 May 2019 08:35:01 -0700 Subject: [PATCH 106/129] Re-fix Mousekey Movements (#5740) * Re-fix Mousekey Movements After the new movement model was instroduced, it broke diagonal momement, again. Reapplying fix from #3147 to both old and new acceleration method. * Make diagonal mouse report checks more readable Co-Authored-By: drashna --- tmk_core/common/mousekey.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tmk_core/common/mousekey.c b/tmk_core/common/mousekey.c index 8c918430634..bb08576b9fa 100644 --- a/tmk_core/common/mousekey.c +++ b/tmk_core/common/mousekey.c @@ -114,7 +114,9 @@ void mousekey_task(void) { /* diagonal move [1/sqrt(2)] */ if (mouse_report.x && mouse_report.y) { mouse_report.x = times_inv_sqrt2(mouse_report.x); + if (mouse_report.x == 0) { mouse_report.x = 1; } mouse_report.y = times_inv_sqrt2(mouse_report.y); + if (mouse_report.y == 0) { mouse_report.y = 1; } } if (mouse_report.v > 0) mouse_report.v = wheel_unit(); if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1; @@ -232,7 +234,9 @@ void adjust_speed(void) { // adjust for diagonals if (mouse_report.x && mouse_report.y) { mouse_report.x = times_inv_sqrt2(mouse_report.x); + if (mouse_report.x == 0) { mouse_report.x = 1; } mouse_report.y = times_inv_sqrt2(mouse_report.y); + if (mouse_report.y == 0) { mouse_report.y = 1; } } if (mouse_report.h && mouse_report.v) { mouse_report.h = times_inv_sqrt2(mouse_report.h); From cb1935aaff0fed118954996fc7afb722b6ed21be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Mon, 6 May 2019 17:41:45 +0200 Subject: [PATCH 107/129] [Keymap] Update personal userspace and keymaps (now with 4 spaces!) (#5774) * Add FnLk to Melody96 bottom row * Update conditional in userspace makefile Thanks @drashna * Add F keys to Melody96 Fn layer * Add FN_ESC alias to userspace * Update KBD6X keymap * Fix RGB_MATRIX_ENABLE constant name in #if * Remove trailing \ from LAYOUT macro calls * Set RGB mode on EEPROM reset in KBD6X * Swap right and middle mouse buttons in KBD6X * Rearrange RGB controls in KBD6X * Update keycode aliases, replace CLEAR with DEL_NXT in KBD6X Add Clear to KBD6X as RCtrl+` * Convert code to 4 space indents * Tweak RCTRL layer functionality * Replace NUMPAD custom keycode with layer state logic * Update RGB_MATRIX_ENABLE check Co-Authored-By: vomindoraan --- .../kbdfans/kbd6x/keymaps/konstantin/keymap.c | 156 ++++++++--------- .../kbdfans/kbd6x/keymaps/konstantin/rules.mk | 8 +- .../melody96/keymaps/konstantin/keymap.c | 126 +++++++------- .../whitefox/keymaps/konstantin/keymap.c | 120 ++++++------- users/konstantin/konstantin.c | 136 +++++++-------- users/konstantin/konstantin.h | 60 +++---- users/konstantin/rgb.h | 12 +- users/konstantin/rules.mk | 13 +- users/konstantin/tap_dance.c | 158 +++++++++--------- users/konstantin/tap_dance.h | 14 +- users/konstantin/unicode.c | 2 +- users/konstantin/unicode.h | 20 +-- 12 files changed, 414 insertions(+), 411 deletions(-) diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c index 3404cc4e491..bb8ab6b9b3e 100644 --- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c @@ -2,91 +2,95 @@ #include "konstantin.h" enum keycodes_keymap { - RCTRL = RANGE_KEYMAP, + RCTRL = RANGE_KEYMAP, }; enum layers_keymap { - L_RCTRL = L_RANGE_KEYMAP, + L_RCTRL = L_RANGE_KEYMAP, }; -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RCTRL: - if (record->event.pressed) { - layer_on(L_RCTRL); - register_code(KC_RCTRL); - } else { - layer_off(L_RCTRL); - unregister_code(KC_RCTRL); - } - return false; +void eeconfig_init_keymap(void) { + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); +} - default: - return true; - } +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RCTRL: + if (record->event.pressed) { + register_code(KC_RCTRL); + layer_on(L_RCTRL); + } else { + unregister_code(KC_RCTRL); + layer_off(L_RCTRL); + } + return false; + + default: + return true; + } } const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │LCtCps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │LShiftFn│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│FnL│ - * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ - * │LGu│LAlt │ Space │RAlGu│RCt│ - * └───┴─────┴───────────────────────────┴─────┴───┘ - */ - [L_BASE] = LAYOUT( - 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, - LCT_CPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - LSFT_FN, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_FNLK, - XXXXXXX, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, RCTRL, XXXXXXX - ), + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │LCtCps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │LShiftFn│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│FnL│ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │LGu│LAlt │ Space │RAlGu│RCt│ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_BASE] = LAYOUT( + 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, + LCT_CPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + LSFT_FN, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_FNLK, + XXXXXXX, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, RCTRL, XXXXXXX + ), - /* Function layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │Hom│ ↑ │End│PgU│ │ │ │ │M1 │M↑ │M2 │M3 │ Del │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ ← │ ↓ │ → │PgD│ │ │ │MW↑│M← │M↓ │M→ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │ - * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ - * │DPR│DstNA│ MW↓ │MAcl2│ │ - * └───┴─────┴───────────────────────────┴─────┴───┘ - */ - [L_FN] = LAYOUT( - _______, 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_INS, - _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_DEL, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, - _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______, - XXXXXXX, DST_P_R, DST_N_A, KC_WH_D, KC_ACL2, _______, XXXXXXX - ), + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │Hom│ ↑ │End│PgU│ │ │ │ │M1 │M↑ │M3 │M2 │ Del │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ ← │ ↓ │ → │PgD│ │ │ │MW↑│M← │M↓ │M→ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │ │ │ MW↓ │MAcl2│ │ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_FN] = LAYOUT( + _______, 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_INS, + _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN3, KC_BTN2, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, + _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______, + XXXXXXX, _______, _______, KC_WH_D, KC_ACL2, _______, XXXXXXX + ), - /* RCtrl layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │Top│Mv↑│Btm│PrT│ │ │ │ │ │ │ │ │Clear│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │Mv←│Mv↓│Mv→│NxT│ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ - * │DtR│DstA │ │ │ │ - * └───┴─────┴───────────────────────────┴─────┴───┘ - */ - [L_RCTRL] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, TOP, MV_UP, BOTTOM, PRV_TAB, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR, - _______, MV_LEFT, MV_DOWN, MV_RGHT, NXT_TAB, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, DST_REM, DST_ADD, _______, _______, _______, XXXXXXX - ), + /* RCtrl layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │Clr│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │Top│Mv↑│Btm│TPr│ │ │ │ │ │ │ │ │DelNx│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │Mv←│Mv↓│Mv→│TNx│ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │RTg│RV-│RV+│ │ │ │ │ │ │ │ │ │ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │DPR│DstNA│ │ │ │ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_RCTRL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR, + _______, TOP, MV_UP, BOTTOM, TAB_PRV, _______, _______, _______, _______, _______, _______, _______, _______, DEL_NXT, + _______, MV_LEFT, MV_DOWN, MV_RGHT, TAB_NXT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + XXXXXXX, DST_P_R, DST_N_A, _______, _______, _______, XXXXXXX + ), }; diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk index 4e485bf7667..f7cf0758b78 100644 --- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk @@ -1,11 +1,11 @@ BOOTMAGIC_ENABLE = no COMMAND_ENABLE = yes -CONSOLE_ENABLE = yes +CONSOLE_ENABLE = no EXTRAKEY_ENABLE = yes MOUSEKEY_ENABLE = yes NKRO_ENABLE = yes TAP_DANCE_ENABLE = yes -UNICODEMAP_ENABLE = yes +UNICODEMAP_ENABLE = no -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes diff --git a/keyboards/melody96/keymaps/konstantin/keymap.c b/keyboards/melody96/keymaps/konstantin/keymap.c index 1150e5dc796..7d65a0e98e7 100644 --- a/keyboards/melody96/keymaps/konstantin/keymap.c +++ b/keyboards/melody96/keymaps/konstantin/keymap.c @@ -2,77 +2,77 @@ #include "konstantin.h" static const hsv_t *colors[] = { &GODSPEED_BLUE, &GODSPEED_YELLOW }; -static size_t cnum = sizeof colors / sizeof *colors; +static const size_t cnum = sizeof colors / sizeof *colors; static size_t cidx = 0; -void eeconfig_init_keymap(void) { - rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); -} - enum keycodes_keymap { - RGB_SET = RANGE_KEYMAP, + RGB_SET = RANGE_KEYMAP, }; -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RGB_SET: - if (record->event.pressed) { - cidx = (cidx + 1) % cnum; - rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); - } - return false; +void eeconfig_init_keymap(void) { + rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); +} - default: - return true; - } +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_SET: + if (record->event.pressed) { + cidx = (cidx + 1) % cnum; + rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); + } + return false; + + default: + return true; + } } const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│Hom│End│PgU│PgD│ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │Del│NLk│P/ │P* │P- │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │P7 │P8 │P9 │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤P+ │ - * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │P4 │P5 │P6 │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ - * │LSft│RAG│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │P1 │P2 │P3 │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┼───┼───┼───┤PEn│ - * │LCtl│LGui│LAlt│ Space │RAlGu│RCtrl│ ← │ ↓ │ → │P0 │P. │ │ - * └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┴───┴───┴───┴───┘ - */ - [L_BASE] = LAYOUT( \ - 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_INS, KC_HOME, KC_END, KC_PGUP, 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_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - 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_P7, KC_P8, KC_P9, XXXXXXX, - FN_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_P4, KC_P5, KC_P6, KC_PPLS, - KC_LSFT, RAL_RGU, 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, XXXXXXX, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, XXXXXXX, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│Hom│End│PgU│PgD│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │Del│NLk│P/ │P* │P- │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │P7 │P8 │P9 │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤P+ │ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │P4 │P5 │P6 │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ + * │LSft│RAG│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │P1 │P2 │P3 │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┼───┼───┤PEn│ + * │LCtl│LGui│LAlt│ Space │RAG│FnL│RCt│ ← │ ↓ │ → │P0 │P. │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + */ + [L_BASE] = LAYOUT( + 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_INS, KC_HOME, KC_END, KC_PGUP, 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_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + 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_P7, KC_P8, KC_P9, XXXXXXX, + FN_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_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, RAL_RGU, 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, XXXXXXX, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), - /* Function layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │Sys│SLk│Pau│Brk│Top│Btm│ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │RTg│ ÷ │ × │ − │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ - * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│RH+│RS+│RV+│ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤RSt│ - * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │RH-│RS-│RV-│ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ - * │ │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ │PgU│RMR│RMS│RMB│ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┼───┼───┼───┤RMP│ - * │ │DtPR│DtNA│ MW↓ │ │ App │Hom│PgD│End│RM-│RM+│ │ - * └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┴───┴───┴───┴───┘ - */ - [L_FN] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSR, KC_SLCK, KC_PAUS, KC_BRK, TOP, BOTTOM, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, DIVIDE, TIMES, MINUS, - KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, - _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SET, - _______, _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, RGB_M_R, RGB_M_SN,RGB_M_B, XXXXXXX, - _______, DST_P_R, DST_N_A, KC_WH_D, _______, XXXXXXX, KC_APP, KC_HOME, KC_PGDN, KC_END, RGB_RMOD,RGB_MOD, RGB_M_P - ), + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │Sys│SLk│Pau│Brk│Top│Btm│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │RTg│ ÷ │ × │ − │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│RH+│RS+│RV+│ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤RSt│ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │RH-│RS-│RV-│ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ + * │ │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ │PgU│RMR│RMS│RMB│ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┼───┼───┤RMP│ + * │ │DtPR│DtNA│ MW↓ │ │ │App│Hom│PgD│End│RM-│RM+│ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + */ + [L_FN] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSR, KC_SLCK, KC_PAUS, KC_BRK, TOP, BOTTOM, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_TOG, DIVIDE, TIMES, MINUS, + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SET, + _______, _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, RGB_M_R, RGB_M_SN,RGB_M_B, XXXXXXX, + _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_APP, KC_HOME, KC_PGDN, KC_END, RGB_RMOD,RGB_MOD, RGB_M_P + ), }; diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index dddfb274e7f..c8c8c790c77 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -2,66 +2,66 @@ #include "konstantin.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RCtRSf│ ↑ │PgD│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │LCtl│LGui│LAlt│ Space │RAlG│FnLk│ │ ← │ ↓ │ → │ - * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ - */ - [L_BASE] = LAYOUT_truefox( \ - 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_PSCR, \ - 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, \ - FN_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, RCT_RSF, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT \ - ), + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RCtRSf│ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │RAlG│FnLk│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_BASE] = LAYOUT_truefox( + 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_PSCR, + 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, + FN_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, RCT_RSF, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Function layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│SLk│Pau│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│Ins│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ App │PgU│Btm│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│ - * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ - */ - [L_FN] = LAYOUT_truefox( \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, \ - KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ - _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, \ - _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \ - _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END \ - ), + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│SLk│Pau│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ App │PgU│Btm│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_FN] = LAYOUT_truefox( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, + _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, + _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END + ), - /* Numpad layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │Num│ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ PEnter │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ - */ - [L_NUMPAD] = LAYOUT_truefox( \ - _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, MINUS, EQUALS, NUMPAD, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, L_PAREN, R_PAREN, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PAST, TIMES, KC_PENT, _______, \ - _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, COMMA, KC_PDOT, KC_PSLS, DIVIDE, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), + /* Numpad layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │Num│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ PEnter │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_NUMPAD] = LAYOUT_truefox( + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, MINUS, EQUALS, NUMPAD, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, L_PAREN, R_PAREN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PAST, TIMES, KC_PENT, _______, + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, COMMA, KC_PDOT, KC_PSLS, DIVIDE, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), }; diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index 753742fa781..9e3caca4147 100644 --- a/users/konstantin/konstantin.c +++ b/users/konstantin/konstantin.c @@ -4,107 +4,99 @@ __attribute__((weak)) void keyboard_pre_init_keymap(void) {} void keyboard_pre_init_user(void) { - keyboard_pre_init_keymap(); + keyboard_pre_init_keymap(); } __attribute__((weak)) void eeconfig_init_keymap(void) {} void eeconfig_init_user(void) { - eeconfig_init_keymap(); + eeconfig_init_keymap(); } __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { - keyboard_post_init_keymap(); + keyboard_post_init_keymap(); } __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keymap(keycode, record)) { - return false; - } - -#ifdef LAYER_NUMPAD - void toggle_numpad(void) { - layer_invert(L_NUMPAD); - bool numpad = IS_LAYER_ON(L_NUMPAD), num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); - if (num_lock != numpad) { - tap_code(KC_NLCK); // Toggle Num Lock to match layer state - } - } -#endif - - switch (keycode) { - case CLEAR: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); - } - return false; - - case DST_P_R: - (record->event.pressed ? register_code16 : unregister_code16)( - (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV - ); - return false; - - case DST_N_A: - (record->event.pressed ? register_code16 : unregister_code16)( - (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT - ); - return false; - -#ifdef LAYER_FN - static bool fn_lock; - - case FN_FNLK: - if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { - fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this - } - return true; -#endif - -#ifdef LAYER_NUMPAD - case NUMPAD: - if (record->event.pressed) { - toggle_numpad(); - } - return false; -#endif - - case KC_ESC: - if (record->event.pressed) { -#ifdef LAYER_NUMPAD - if (IS_LAYER_ON(L_NUMPAD)) { - toggle_numpad(); + if (!process_record_keymap(keycode, record)) { return false; - } + } + + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; + + case DST_P_R: + (record->event.pressed ? register_code16 : unregister_code16)( + (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV + ); + return false; + + case DST_N_A: + (record->event.pressed ? register_code16 : unregister_code16)( + (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT + ); + return false; + +#ifdef LAYER_FN + static bool fn_lock; + + case FN_FNLK: + if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { + fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this + } + return true; +#endif + + case KC_ESC: + if (record->event.pressed) { +#ifdef LAYER_NUMPAD // Disable Numpad layer before Fn layer + if (IS_LAYER_ON(L_NUMPAD)) { + layer_off(L_NUMPAD); + return false; + } #endif #ifdef LAYER_FN - if (IS_LAYER_ON(L_FN) && fn_lock) { - layer_off(L_FN); - return fn_lock = false; - } + if (IS_LAYER_ON(L_FN) && fn_lock) { + layer_off(L_FN); + return fn_lock = false; + } #endif - } - return true; + } + return true; - default: - return true; - } + default: + return true; + } } __attribute__((weak)) uint32_t layer_state_set_keymap(uint32_t state) { - return state; + return state; } uint32_t layer_state_set_user(uint32_t state) { - return layer_state_set_keymap(state); + state = layer_state_set_keymap(state); + +#ifdef LAYER_NUMPAD + bool numpad = state & 1UL<count == 1 || state->count == 3) { - register_code(data->kc1); - } else if (state->count == 2) { - unregister_code(data->kc1); - register_code(data->kc2); - } - // Prevent tap dance from sending the mods as weak mods - state->weak_mods &= ~(MOD_BIT(data->kc1) | MOD_BIT(data->kc2)); + // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 + if (state->count == 1 || state->count == 3) { + register_code(data->kc1); + } else if (state->count == 2) { + unregister_code(data->kc1); + register_code(data->kc2); + } + // Prevent tap dance from sending the mods as weak mods + state->weak_mods &= ~(MOD_BIT(data->kc1) | MOD_BIT(data->kc2)); } void td_double_mod_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; + qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; - if (state->count == 1 || state->count >= 3) { - unregister_code(data->kc1); - } - if (state->count >= 2) { - unregister_code(data->kc2); - } + if (state->count == 1 || state->count >= 3) { + unregister_code(data->kc1); + } + if (state->count >= 2) { + unregister_code(data->kc2); + } } -#define ACTION_TAP_DANCE_MOD_LAYER(mod, layer) { \ - .fn = { td_mod_layer_each, NULL, td_mod_layer_reset }, \ - .user_data = &(qk_tap_dance_dual_role_t){ mod, layer }, \ - } +#define ACTION_TAP_DANCE_MOD_LAYER(mod, layer) { \ + .fn = { td_mod_layer_each, NULL, td_mod_layer_reset }, \ + .user_data = &(qk_tap_dance_dual_role_t){ mod, layer }, \ + } void td_mod_layer_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - // Single tap → mod, double tap → layer, triple tap etc. → mod+layer - if (state->count == 1 || state->count == 3) { - register_code(data->kc); - } else if (state->count == 2) { - unregister_code(data->kc); - // Prevent tap dance from sending the mod as a weak mod - state->weak_mods &= ~MOD_BIT(data->kc); - layer_on(data->layer); - } + // Single tap → mod, double tap → layer, triple tap etc. → mod+layer + if (state->count == 1 || state->count == 3) { + register_code(data->kc); + } else if (state->count == 2) { + unregister_code(data->kc); + // Prevent tap dance from sending the mod as a weak mod + state->weak_mods &= ~MOD_BIT(data->kc); + layer_on(data->layer); + } } void td_mod_layer_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - if (state->count == 1 || state->count >= 3) { - unregister_code(data->kc); - } - if (state->count >= 2) { - layer_off(data->layer); - } + if (state->count == 1 || state->count >= 3) { + unregister_code(data->kc); + } + if (state->count >= 2) { + layer_off(data->layer); + } } -#define ACTION_TAP_DANCE_LAYER_MOD(layer, mod) { \ - .fn = { td_layer_mod_each, NULL, td_layer_mod_reset }, \ - .user_data = &(qk_tap_dance_layer_mod_t){ layer, mod, 0, 0 }, \ - } +#define ACTION_TAP_DANCE_LAYER_MOD(layer, mod) { \ + .fn = { td_layer_mod_each, NULL, td_layer_mod_reset }, \ + .user_data = &(qk_tap_dance_layer_mod_t){ layer, mod, 0, 0 }, \ + } typedef struct { - uint8_t layer; - uint16_t kc; - bool layer_on; // Layer state when tap dance started - bool started; + uint8_t layer; + uint16_t kc; + bool layer_on; // Layer state when tap dance started + bool started; } qk_tap_dance_layer_mod_t; void td_layer_mod_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; - if (!data->started) { - data->layer_on = IS_LAYER_ON(data->layer); - data->started = true; - } - - // Single tap → layer, double tap → mod, triple tap etc. → layer+mod - if (state->count == 1 || state->count == 3) { - layer_on(data->layer); - } else if (state->count == 2) { - if (!data->layer_on) { - layer_off(data->layer); + qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; + if (!data->started) { + data->layer_on = IS_LAYER_ON(data->layer); + data->started = true; + } + + // Single tap → layer, double tap → mod, triple tap etc. → layer+mod + if (state->count == 1 || state->count == 3) { + layer_on(data->layer); + } else if (state->count == 2) { + if (!data->layer_on) { + layer_off(data->layer); + } + register_code(data->kc); } - register_code(data->kc); - } } void td_layer_mod_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; + qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; - if ((state->count == 1 || state->count >= 3) && !data->layer_on) { - layer_off(data->layer); - } - if (state->count >= 2) { - unregister_code(data->kc); - } + if ((state->count == 1 || state->count >= 3) && !data->layer_on) { + layer_off(data->layer); + } + if (state->count >= 2) { + unregister_code(data->kc); + } - data->started = false; + data->started = false; } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_REM), + [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_REM), - [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_LALT), - [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI), - [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT), + [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_LALT), + [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI), + [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT), - [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN), - [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN), - [TD_FN_RCTL] = ACTION_TAP_DANCE_LAYER_MOD(L_FN, KC_RCTL), + [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN), + [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN), + [TD_FN_RCTL] = ACTION_TAP_DANCE_LAYER_MOD(L_FN, KC_RCTL), }; diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h index ad7c04cb7f1..13d682a6039 100644 --- a/users/konstantin/tap_dance.h +++ b/users/konstantin/tap_dance.h @@ -13,13 +13,13 @@ #define FN_RCTL TD(TD_FN_RCTL) enum tap_dance { - TD_DST_A_R, + TD_DST_A_R, - TD_RAL_LAL, - TD_RAL_RGU, - TD_RCT_RSF, + TD_RAL_LAL, + TD_RAL_RGU, + TD_RCT_RSF, - TD_LSFT_FN, - TD_RCTL_FN, - TD_FN_RCTL, + TD_LSFT_FN, + TD_RCTL_FN, + TD_FN_RCTL, }; diff --git a/users/konstantin/unicode.c b/users/konstantin/unicode.c index 144c0aaf75f..8ef5aaa1ec3 100644 --- a/users/konstantin/unicode.c +++ b/users/konstantin/unicode.c @@ -2,6 +2,6 @@ #ifdef UNICODEMAP_ENABLE const uint32_t PROGMEM unicode_map[] = { - FOREACH_UNICODE(UCM_ENTRY) + FOREACH_UNICODE(UCM_ENTRY) }; #endif diff --git a/users/konstantin/unicode.h b/users/konstantin/unicode.h index c8eddabb713..b2616d120b4 100644 --- a/users/konstantin/unicode.h +++ b/users/konstantin/unicode.h @@ -3,13 +3,13 @@ #include "quantum.h" #define FOREACH_UNICODE(M) \ - M(COMMA, 0x002C) \ - M(L_PAREN, 0x0028) \ - M(R_PAREN, 0x0029) \ - M(EQUALS, 0x003D) \ - M(TIMES, 0x00D7) \ - M(DIVIDE, 0x00F7) \ - M(MINUS, 0x2212) + M(COMMA, 0x002C) \ + M(L_PAREN, 0x0028) \ + M(R_PAREN, 0x0029) \ + M(EQUALS, 0x003D) \ + M(TIMES, 0x00D7) \ + M(DIVIDE, 0x00F7) \ + M(MINUS, 0x2212) #define UC_KEYCODE(name, code) name = UC(code), @@ -19,16 +19,16 @@ #if defined(UNICODE_ENABLE) enum unicode_keycodes { - FOREACH_UNICODE(UC_KEYCODE) + FOREACH_UNICODE(UC_KEYCODE) }; #elif defined(UNICODEMAP_ENABLE) enum unicode_names { - FOREACH_UNICODE(UCM_NAME) + FOREACH_UNICODE(UCM_NAME) }; extern const uint32_t PROGMEM unicode_map[]; enum unicode_keycodes { - FOREACH_UNICODE(UCM_KEYCODE) + FOREACH_UNICODE(UCM_KEYCODE) }; #endif From 99500243e10c12c0a5005da49aa1986947b27153 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Mon, 6 May 2019 10:56:34 -0700 Subject: [PATCH 108/129] Make python a required build dependency (#5784) * Make python a required build dependency * Add missing color * fixup sabayon linux per @BlitzKraft --- Makefile | 2 ++ message.mk | 4 ++++ util/freebsd_install.sh | 3 ++- util/linux_install.sh | 9 ++++++++- util/macos_install.sh | 2 +- util/msys2_install.sh | 2 +- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bf3abbe5289..a6c3ee35b7a 100644 --- a/Makefile +++ b/Makefile @@ -534,6 +534,8 @@ endef %: # Check if we have the CMP tool installed cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; + # Ensure that python3 is installed. This check can be removed after python is used in more places. + if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi # Check if the submodules are dirty, and display a warning if they are ifndef SKIP_GIT if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi diff --git a/message.mk b/message.mk index 71f37be0b5f..734de864572 100644 --- a/message.mk +++ b/message.mk @@ -81,3 +81,7 @@ MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(FREE_SIZE) bytes free)\n MSG_FILE_NEAR_LIMIT = The firmware size is approaching the maximum - $(CURRENT_SIZE)/$(MAX_SIZE) ($(FREE_SIZE) bytes free)\n +MSG_PYTHON_MISSING = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ + Python 3 is not installed. It will be required by a future version\n\ + of qmk_firmware.\n\n\ + Please run $(BOLD)util/qmk_install.sh$(NO_COLOR) to install all the dependencies QMK requires.\n\n diff --git a/util/freebsd_install.sh b/util/freebsd_install.sh index 25ea80a7fcb..c8696e8cc75 100755 --- a/util/freebsd_install.sh +++ b/util/freebsd_install.sh @@ -15,4 +15,5 @@ pkg install -y \ arm-none-eabi-gcc \ arm-none-eabi-binutils \ arm-none-eabi-newlib \ - diffutils + diffutils \ + python3 diff --git a/util/linux_install.sh b/util/linux_install.sh index 608975a9158..5e2afe9998e 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -25,6 +25,7 @@ if grep ID /etc/os-release | grep -qE "fedora"; then kernel-headers \ make \ perl \ + python3 \ unzip \ wget \ zip @@ -47,6 +48,7 @@ elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then gcc-avr \ git \ libnewlib-arm-none-eabi \ + python3 \ unzip \ wget \ zip @@ -66,6 +68,7 @@ elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then diffutils \ gcc \ git \ + python \ unzip \ wget \ zip @@ -87,6 +90,7 @@ elif grep ID /etc/os-release | grep -q gentoo; then app-arch/zip \ app-mobilephone/dfu-util \ dev-embedded/avrdude \ + dev-lang/python:3.5 \ net-misc/wget \ sys-devel/gcc \ sys-devel/crossdev @@ -102,6 +106,7 @@ elif grep ID /etc/os-release | grep -q sabayon; then app-arch/zip \ app-mobilephone/dfu-util \ dev-embedded/avrdude \ + dev-lang/python \ net-misc/wget \ sys-devel/gcc \ sys-devel/crossdev @@ -125,6 +130,7 @@ elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then dfu-tool \ dfu-programmer \ gcc \ + python3 \ unzip \ wget \ zip @@ -143,7 +149,8 @@ elif grep ID /etc/os-release | grep -q slackware; then dfu-util \ arm-binutils \ arm-gcc \ - newlib + newlib \ + python3 echo "Done!" else echo "Quitting..." diff --git a/util/macos_install.sh b/util/macos_install.sh index d2629a8cb4a..93f3ed0b96f 100755 --- a/util/macos_install.sh +++ b/util/macos_install.sh @@ -22,5 +22,5 @@ fi brew tap osx-cross/avr brew tap PX4/homebrew-px4 brew update -brew install avr-gcc@7 gcc-arm-none-eabi dfu-programmer avrdude dfu-util +brew install avr-gcc@7 gcc-arm-none-eabi dfu-programmer avrdude dfu-util python3 brew link --force avr-gcc@7 diff --git a/util/msys2_install.sh b/util/msys2_install.sh index fcb4882494f..bcb628ab21f 100755 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh @@ -7,7 +7,7 @@ armtools=gcc-arm-none-eabi installflip=false echo "Installing dependencies needed for the installation (quazip)" -pacman --needed -S msys/unzip msys/p7zip base-devel msys/git mingw-w64-x86_64-toolchain +pacman --needed -S base-devel mingw-w64-x86_64-toolchain msys/git msys/p7zip msys/python3 msys/unzip source "$dir/win_shared_install.sh" From e01b2d518a1a08ce07278ef9a38c7a793c843749 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Mon, 6 May 2019 17:06:43 -0500 Subject: [PATCH 109/129] [Keyboard] Sol keyboard conversion to split common (#5773) * Split common conversion * Updated serial and encoder pins * Fixing default folder until r2 * Fixing oled driver on slave split common * Fixing keymap compile errors * Fixing oled inactivity timer on slave split common * Hoisted oled driver task, init, & activity to keyboard.c * Update keyboards/sol/config.h Co-Authored-By: XScorpion2 * Remove TAPPING_FORCE_HOLD --- keyboards/sol/common/knob_v2.c | 71 ----- keyboards/sol/common/knob_v2.h | 28 -- keyboards/sol/config.h | 70 +++++ keyboards/sol/keymaps/brianweyer/keymap.c | 36 ++- keyboards/sol/keymaps/brianweyer/rules.mk | 6 - keyboards/sol/keymaps/danielhklein/keymap.c | 28 +- keyboards/sol/keymaps/danielhklein/rules.mk | 6 - keyboards/sol/keymaps/default/keymap.c | 28 +- keyboards/sol/keymaps/default/rules.mk | 6 - keyboards/sol/keymaps/kageurufu/keymap.c | 26 +- keyboards/sol/keymaps/kageurufu/rules.mk | 6 - keyboards/sol/keymaps/xulkal/keymap.c | 12 +- keyboards/sol/keymaps/xulkal/rules.mk | 7 +- keyboards/sol/rev1/config.h | 111 +------ keyboards/sol/rev1/matrix.c | 304 -------------------- keyboards/sol/rev1/rev1.c | 6 +- keyboards/sol/rev1/rev1.h | 71 +---- keyboards/sol/rev1/rules.mk | 2 - keyboards/sol/rev1/split_util.c | 54 ---- keyboards/sol/rev1/split_util.h | 15 - keyboards/sol/rules.mk | 7 +- keyboards/sol/serial.c | 288 ------------------- keyboards/sol/serial.h | 26 -- keyboards/sol/sol.h | 54 +++- quantum/quantum.c | 23 +- quantum/split_common/matrix.c | 2 +- tmk_core/common/keyboard.c | 19 ++ 27 files changed, 250 insertions(+), 1062 deletions(-) delete mode 100644 keyboards/sol/common/knob_v2.c delete mode 100644 keyboards/sol/common/knob_v2.h delete mode 100644 keyboards/sol/rev1/matrix.c delete mode 100644 keyboards/sol/rev1/split_util.c delete mode 100644 keyboards/sol/rev1/split_util.h delete mode 100644 keyboards/sol/serial.c delete mode 100644 keyboards/sol/serial.h diff --git a/keyboards/sol/common/knob_v2.c b/keyboards/sol/common/knob_v2.c deleted file mode 100644 index f22f7c5d862..00000000000 --- a/keyboards/sol/common/knob_v2.c +++ /dev/null @@ -1,71 +0,0 @@ -#include "knob_v2.h" - -bool knob_prev_a = false; -static knob_report_t knob_report = {.dir = 0, .phase = 0}; - -void knob_init(void) { - // I use pins D1 (ISR1) & D4 for a knob. - - // Set pin mode for D4 as input. - DDRD &= ~(0UL << ENCODER_PIN_2); - - // Enable internal pull-up for D4. - // This is done by "writing" 1 to a pin that has its mode set to input. - PORTD |= (1 << ENCODER_PIN_2); - - // Enable interrupt for D1 - // For more info on the below flags see this awesome section 11.1 (pages 89-90) here: - // https://cdn-shop.adafruit.com/datasheets/atmel-7766-8-bit-avr-atmega16u4-32u4_datasheet.pdf - // Set pin mode & pull-up. - DDRD &= ~(0UL << ENCODER_PIN_1); - PORTD |= (1UL << ENCODER_PIN_1); - - // INT: 33221100 - EICRA |= 0b00010000; // 0b01 - any edge - // INT: 6 3210 - EIMSK |= 0b00000100; -} - -ISR(ENCODER_INT) { - bool a = PIND & (1 << ENCODER_PIN_1); - - if (knob_prev_a != a) { - // "A" channel has REALLY changed. - knob_report.phase = a; - knob_prev_a = a; - bool b = PIND & (1 << ENCODER_PIN_2); - if (a == b) { - // Halfway through CCW rotation (A == B) - // - // +---YOU ARE HERE (A=1, B=1) - // | +---OR HERE (A=0, B=0) - // | | - // v v - // A: _____/^^^^^\__ - // B: __/^^^^^\_____ - knob_report.dir++; - } else { - // Halfway through CW rotation (A != B) - // - // +---YOU ARE HERE (A=1, B=0) - // | +---OR HERE (A=0, B=1) - // | | - // v v - // A: _____/^^^^^\_____ - // B: ________/^^^^^\__ - knob_report.dir--; - } - } -} - -knob_report_t knob_report_read(void) { - // Return knob report. - return knob_report; -} - -void knob_report_reset(void) { - // Call this ASAP once you've processed the previous knob report. - // TODO: This should probably be called within `knob_report_read`. - knob_report.dir = 0; - knob_report.phase = 0; -} diff --git a/keyboards/sol/common/knob_v2.h b/keyboards/sol/common/knob_v2.h deleted file mode 100644 index 45196eb1a66..00000000000 --- a/keyboards/sol/common/knob_v2.h +++ /dev/null @@ -1,28 +0,0 @@ -// Rotary knob implementation - Version 2. -// Uses 2 digital pins - D2 (via interrupt) & D6. -// #include "rev1.h" -#include -#include -#include - -#ifndef ENCODER_PIN_1 - #define ENCODER_PIN_1 PD2 -#endif -#ifndef ENCODER_PIN_2 - #define ENCODER_PIN_2 PD6 -#endif -#ifndef ENCODER_INT - #define ENCODER_INT INT2_vect -#endif - -typedef struct knob_report_t { - int8_t dir; // Contains number of rotations that happened - int8_t phase; // Contains 0 if last rotation happened on 90 degrees, 1 if on 270 -} knob_report_t; - -void knob_init(void); -knob_report_t knob_report_read(void); -void knob_report_reset(void); - -bool knob_prev_a; -int8_t knob_dir; diff --git a/keyboards/sol/config.h b/keyboards/sol/config.h index 93fd2261b18..a7317d9d9c6 100644 --- a/keyboards/sol/config.h +++ b/keyboards/sol/config.h @@ -20,3 +20,73 @@ along with this program. If not, see . #include "config_common.h" +#define TAPPING_TERM 150 + +/* Select hand configuration */ +#define SOFT_SERIAL_PIN D3 +#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, E6} + +// wiring of each half +#define MATRIX_COLS 7 +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } + +// Encoder support +#define NUMBER_OF_ENCODERS 1 +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { D6 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B3 + +#ifdef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 40 +#elif RGBLIGHT_FULL_POWER + #define RGBLIGHT_LIMIT_VAL 255 +#else + #define RGBLIGHT_LIMIT_VAL 120 +#endif +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS RGBLIGHT_LIMIT_VAL + +#define LED_HITS_TO_REMEMBER 5 + +#define RGBLIGHT_ANIMATIONS + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for Helix keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 500 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * 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 diff --git a/keyboards/sol/keymaps/brianweyer/keymap.c b/keyboards/sol/keymaps/brianweyer/keymap.c index 87d603d8178..3ba52081d25 100755 --- a/keyboards/sol/keymaps/brianweyer/keymap.c +++ b/keyboards/sol/keymaps/brianweyer/keymap.c @@ -11,8 +11,6 @@ extern keymap_config_t keymap_config; 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 @@ -59,8 +57,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| LCTL, LALT, FN, LGUI, RGB_MOD, SPC, DEL, BSPC, SPC, ADJ, LGUI, FN, LALT, LCTL, //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| - VOLD, VOLU, SPC, ENT, ENT, SPC, DOWN, UP - // Rotary Left |--------+--------| |--------+-----------+ Rotary Right + SPC, ENT, ENT, SPC + // |--------+--------| |--------+-----------+ ), /* FN @@ -90,8 +88,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| - VOLD, VOLU, _______, _______, _______, _______, UP, DOWN - // Rotary Left |--------+--------| |--------+-----------+ Rotary Right + _______, _______, _______, _______ + // |--------+--------| |--------+-----------+ ), /* ADJ @@ -122,8 +120,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--------+--+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______ \ - // Rotary Left |--------+--------| |--------+--------+ Rotary Right + _______, _______, _______, _______ \ + // |--------+--------| |--------+--------+ ) }; @@ -132,6 +130,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { bool TOG_STATUS = false; int RGB_current_mode; +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } +} +#endif + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -182,7 +198,7 @@ void matrix_init_user(void) { #ifdef OLED_DRIVER_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!has_usb()) + if (!is_keyboard_master()) return OLED_ROTATION_180; // flip 180 for offhand return rotation; } @@ -244,7 +260,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (is_master) + if (is_keyboard_master()) render_status(); else render_logo(); diff --git a/keyboards/sol/keymaps/brianweyer/rules.mk b/keyboards/sol/keymaps/brianweyer/rules.mk index 15b0c8fd231..12c8779467c 100755 --- a/keyboards/sol/keymaps/brianweyer/rules.mk +++ b/keyboards/sol/keymaps/brianweyer/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = yes # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/danielhklein/keymap.c b/keyboards/sol/keymaps/danielhklein/keymap.c index 9bcc5761af1..860361e810b 100644 --- a/keyboards/sol/keymaps/danielhklein/keymap.c +++ b/keyboards/sol/keymaps/danielhklein/keymap.c @@ -11,8 +11,6 @@ extern keymap_config_t keymap_config; 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 @@ -64,7 +62,7 @@ LAYOUT( \ KC_CAPS, _10, _11, _12, _13, _14, KC_LCBR, KC_RCBR, _15, _16, _17, _18, _19, KC_QUOT, \ KC_LSFT, _20, _21, _22, _23, _24, KC_GRV, KC_BSLS, _25, _26, _27, _28, _29, KC_RSFT, \ KC_LEFT, KC_DOWN, KC_LCTRL, KC_LALT, KC_LGUI, KC_BSPC, FN, ADJ, KC_SPC, KC_RGUI, KC_RALT, KC_RCTRL, KC_UP, KC_RIGHT, \ - KC_VOLU, KC_VOLD, KC_BSPC, FN, ADJ, KC_SPC, KC_VOLU, KC_VOLD \ + KC_BSPC, FN, ADJ, KC_SPC \ ) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -132,7 +130,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + XXXXXXX, _______, XXXXXXX, XXXXXXX \ ), /* ADJ @@ -157,7 +155,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, RGB_SAD, RGB_VAI, RGB_SAI, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PENT, XXXXXXX, XXXXXXX, \ XXXXXXX, RGB_HUD, RGB_VAD, RGB_HUI, XXXXXXX, XXXXXXX, QWERTY, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_SPC, XXXXXXX, XXXXXXX, \ XXXXXXX, RGBRST, RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_P0, KC_PDOT, KC_BSPC, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX \ + XXXXXXX, XXXXXXX, _______, XXXXXXX \ ) }; @@ -165,6 +163,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { bool TOG_STATUS = false; int RGB_current_mode; +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif + // Setting ADJ 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)) { @@ -308,7 +324,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (is_master) + if (is_keyboard_master()) render_status(); else render_logo(); diff --git a/keyboards/sol/keymaps/danielhklein/rules.mk b/keyboards/sol/keymaps/danielhklein/rules.mk index 526b72fe7f3..09b0e201d53 100644 --- a/keyboards/sol/keymaps/danielhklein/rules.mk +++ b/keyboards/sol/keymaps/danielhklein/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/default/keymap.c b/keyboards/sol/keymaps/default/keymap.c index a40bc40b732..c101a9bd8e7 100644 --- a/keyboards/sol/keymaps/default/keymap.c +++ b/keyboards/sol/keymaps/default/keymap.c @@ -12,8 +12,6 @@ extern keymap_config_t keymap_config; 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 @@ -70,7 +68,7 @@ LAYOUT( \ FN_CAPS, _10, _11, _12, _13, _14, KC_LPRN, KC_RPRN, _15, _16, _17, _18, _19, KC_QUOT, \ KC_LSFT, _20, _21, _22, _23, _24, KC_LCBR, KC_RCBR, _25, _26, _27, _28, _29, KC_ENT, \ KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_DEL, KC_ENT, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, \ - KC_VOLU, KC_VOLD, KC_SPC, KC_DEL, KC_ENT, KC_SPC, KC_VOLU, KC_VOLD \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ ) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -138,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ - KC_VOLU, KC_VOLD, _______, _______, _______, _______, KC_VOLU, KC_VOLD \ + _______, _______, _______, _______ \ ), /* ADJ @@ -163,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, \ - KC_VOLU, KC_VOLD, _______, _______, _______, _______, KC_VOLU, KC_VOLD \ + _______, _______, _______, _______ \ ) }; @@ -173,6 +171,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { bool TOG_STATUS = false; int RGB_current_mode; +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif + // Setting ADJ 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)) { @@ -316,7 +332,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (is_master) + if (is_keyboard_master()) render_status(); else render_logo(); diff --git a/keyboards/sol/keymaps/default/rules.mk b/keyboards/sol/keymaps/default/rules.mk index 526b72fe7f3..09b0e201d53 100644 --- a/keyboards/sol/keymaps/default/rules.mk +++ b/keyboards/sol/keymaps/default/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/kageurufu/keymap.c b/keyboards/sol/keymaps/kageurufu/keymap.c index 9ea89db0589..b587ef2b3d6 100644 --- a/keyboards/sol/keymaps/kageurufu/keymap.c +++ b/keyboards/sol/keymaps/kageurufu/keymap.c @@ -35,7 +35,7 @@ EXPAND_LAYOUT( \ FN_ESC, _10, _11, _12, _13, _14, RGB_SAI, RGB_VAI, _15, _16, _17, _18, _19, KC_QUOT, \ KC_LSPO, _20, _21, _22, _23, _24, RGB_SAD, RGB_VAD, _25, _26, _27, _28, _29, KC_RSPC, \ KC_LCTL, KC_LGUI, KC_LGUI, KC_LALT, FN, KC_SPC, FN, FN, KC_SPC, KC_MINS, KC_EQL, KC_DOWN, KC_PGUP, KC_PGDN, \ - KC_VOLD, KC_VOLU, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, KC_VOLD, KC_VOLU \ + KC_SPC, KC_BSPC, KC_ENT, KC_SPC \ ) #define BASE_LAYOUT(...) _BASE_LAYOUT(__VA_ARGS__) @@ -65,15 +65,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ________________FUNCTION_L3________________, _______, _______, ________________FUNCTION_R3________________, \ ________________FUNCTION_L4________________, _______, _______, ________________FUNCTION_R4________________, \ ________________FUNCTION_L5________________, ADJ, ADJ, ________________FUNCTION_R5________________, \ - KC_VOLD, KC_VOLU, _______, KC_DEL, _______, _______, KC_VOLD, KC_VOLU \ + _______, KC_DEL, _______, _______ \ ), - [_ADJ] = EXPAND_LAYOUT( \ + [_ADJ] = EXPAND_LAYOUT( \ _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, \ _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, \ _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________, \ - KC_VOLD, KC_VOLU, _______, _______, _______, _______, KC_VOLD, KC_VOLU \ + _______, _______, _______, _______ \ ) }; + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif diff --git a/keyboards/sol/keymaps/kageurufu/rules.mk b/keyboards/sol/keymaps/kageurufu/rules.mk index 82816f960ff..21dca0b1161 100644 --- a/keyboards/sol/keymaps/kageurufu/rules.mk +++ b/keyboards/sol/keymaps/kageurufu/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/xulkal/keymap.c b/keyboards/sol/keymaps/xulkal/keymap.c index 4591034d21f..111e8aa3201 100644 --- a/keyboards/sol/keymaps/xulkal/keymap.c +++ b/keyboards/sol/keymaps/xulkal/keymap.c @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _________________QWERTY_L3_________________, KC_GRV, KC_QUOT, _________________QWERTY_R3_________________, \ _________________QWERTY_L4_________________, RGB_TOG, RGBRST, _________________QWERTY_R4_________________, \ _________________QWERTY_L5_________________, RGB_RMOD, RGB_MOD, _________________QWERTY_R5_________________, \ - KC_VOLU, KC_VOLD, KC_SPC, KC_DEL, KC_ENT, KC_SPC, KC_VOLU, KC_VOLD \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ ), #ifndef GAMELAYER_DISABLE @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ___________________GAME_L3_________________, KC_GRV, KC_QUOT, ___________________GAME_R3_________________, \ ___________________GAME_L4_________________, RGB_TOG, RGBRST, ___________________GAME_R4_________________, \ ___________________GAME_L5_________________, RGB_RMOD, RGB_MOD, ___________________GAME_R5_________________, \ - KC_VOLU, KC_VOLD, KC_SPC, KC_DEL, KC_ENT, KC_SPC, KC_VOLU, KC_VOLD \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ ), #endif @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __________________LOWER_L3_________________, _______, _______, __________________LOWER_R3_________________, \ __________________LOWER_L4_________________, _______, _______, __________________LOWER_R4_________________, \ __________________LOWER_L5_________________, _______, _______, __________________LOWER_R5_________________, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______ \ ), [_RAISE] = EXPAND_LAYOUT( \ @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __________________RAISE_L3_________________, _______, _______, __________________RAISE_R3_________________, \ __________________RAISE_L4_________________, _______, _______, __________________RAISE_R4_________________, \ __________________RAISE_L5_________________, _______, _______, __________________RAISE_R5_________________, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______ \ ), #ifdef TRILAYER_ENABLED @@ -75,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______ \ ), #endif }; @@ -158,7 +158,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (has_usb()) { + if (is_keyboard_master()) { render_status(); } else { render_logo(); diff --git a/keyboards/sol/keymaps/xulkal/rules.mk b/keyboards/sol/keymaps/xulkal/rules.mk index 685b8ced9ab..c3ed98edb64 100644 --- a/keyboards/sol/keymaps/xulkal/rules.mk +++ b/keyboards/sol/keymaps/xulkal/rules.mk @@ -16,17 +16,12 @@ RGB_MATRIX_KEYPRESSES = yes # Enable reactive per-key effects. Can be very l RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = no # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = yes # Enable the OLED Driver (+5000) +ENCODER_ENABLE = no # Enable rotary encoder (+90) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/rev1/config.h b/keyboards/sol/rev1/config.h index 1d8391f645a..056869daa07 100644 --- a/keyboards/sol/rev1/config.h +++ b/keyboards/sol/rev1/config.h @@ -16,8 +16,7 @@ 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 +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -27,117 +26,9 @@ along with this program. If not, see . #define PRODUCT Sol #define DESCRIPTION "An RGB, split, ortho-esque keyboard" -#define PREVENT_STUCK_MODIFIERS -#define TAPPING_FORCE_HOLD -#define TAPPING_TERM 150 - -#define USE_I2C -#define USE_SERIAL -#define USE_SERIAL_PD3 - -/* Select hand configuration */ -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -/* Select rows configuration */ -// Rows are 4 or 5 -// #define HELIX_ROWS 5 see ./rules.mk - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 12 -#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, E6} - -// wiring of each half -#define MATRIX_COLS 7 -#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } -// #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 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN B3 -#define RGBLIGHT_TIMER -//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -#define DRIVER_COUNT 1 -// #define RGB_MATRIX_KEYPRESSES -#define BACKLIGHT_PIN B7 -#define BACKLIGHT_LEVELS 5 - #ifdef LED_MIRRORED #define RGBLED_NUM 35 #else #define RGBLED_NUM 70 #endif #define DRIVER_LED_TOTAL RGBLED_NUM - -#define RGBLIGHT_RAINBOW_SWIRL_RANGE 1950 - -#ifdef IOS_DEVICE_ENABLE - #define RGBLIGHT_LIMIT_VAL 40 - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 40 -#elif RGBLIGHT_FULL_POWER - #define RGBLIGHT_LIMIT_VAL 255 - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 -#else - #define RGBLIGHT_LIMIT_VAL 120 - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 -#endif - -#define RGBLIGHT_VAL_STEP (RGBLIGHT_LIMIT_VAL / 10) -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 - -#define RGBLIGHT_ANIMATIONS - -#define LED_HITS_TO_REMEMBER 5 - -#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) -// USB_MAX_POWER_CONSUMPTION value for Helix keyboard -// 120 RGBoff, OLEDoff -// 120 OLED -// 330 RGB 6 -// 300 RGB 32 -// 310 OLED & RGB 32 - #define USB_MAX_POWER_CONSUMPTION 500 -#else - // fix iPhone and iPad power adapter issue - // iOS device need lessthan 100 - #define USB_MAX_POWER_CONSUMPTION 100 -#endif - -/* - * 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/sol/rev1/matrix.c b/keyboards/sol/rev1/matrix.c deleted file mode 100644 index 804d8b98096..00000000000 --- a/keyboards/sol/rev1/matrix.c +++ /dev/null @@ -1,304 +0,0 @@ -/* -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 - -#include "serial.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#ifdef ENCODER_ENABLE_CUSTOM - #include "common/knob_v2.h" -#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_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(); - - #ifdef ENCODER_ENABLE_CUSTOM - knob_init(); //FOR ENCODER - #endif - 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]; - } - } - } - - #ifdef ENCODER_ENABLE_CUSTOM - knob_report_t knob_report = knob_report_read(); - - knob_report_reset(); - - matrix[5 + offset] &= 0b11111100; - if (knob_report.phase) { // I check for phase to avoid handling the rotation twice (on 90 and 270 degrees). - if (knob_report.dir > 0) { - matrix[5 + offset] |= 0b00000001; - } else if (knob_report.dir < 0) { - matrix[5 + offset] |= 0b00000010; - } - } - #endif - - return 1; -} - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int ret=serial_update_buffers(); - if (ret ) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} - -uint8_t matrix_scan(void) -{ - if (is_master) { - matrix_master_scan(); - }else{ - matrix_slave_scan(); - - int offset = (isLeftHand) ? ROWS_PER_HAND : 0; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[offset+i] = serial_master_buffer[i]; - } - - matrix_scan_quantum(); - } - return 1; -} - - -uint8_t matrix_master_scan(void) { - - int ret = _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_master_buffer[i] = matrix[offset+i]; - } - - if( serial_transaction() ) { - // 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; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -} - -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/sol/rev1/rev1.c b/keyboards/sol/rev1/rev1.c index b668b02e994..23896860e58 100644 --- a/keyboards/sol/rev1/rev1.c +++ b/keyboards/sol/rev1/rev1.c @@ -1,4 +1,4 @@ -#include "sol.h" +#include "quantum.h" #ifdef RGB_MATRIX_ENABLE rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { @@ -81,7 +81,3 @@ }; #endif -void matrix_init_kb(void) { - matrix_init_user(); -}; - diff --git a/keyboards/sol/rev1/rev1.h b/keyboards/sol/rev1/rev1.h index 27b5ac8966c..6f70f09beec 100644 --- a/keyboards/sol/rev1/rev1.h +++ b/keyboards/sol/rev1/rev1.h @@ -1,70 +1 @@ -#ifndef REV1_H -#define REV1_H - -#include "sol.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); -// LEL/LER/REL/RER are -// LeftEncoderLeft, LeftEncoderRight, RightEncoderLeft, and RightEncoderRight - -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, L26, R26, 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, \ - LEL, LER, L55, L56, R56, R50, REL, RER \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { LEL, LER, KC_NO, KC_NO, KC_NO, L55, L56 }, \ - { R05, R04, R03, R02, R01, R00, R06 }, \ - { R15, R14, R13, R12, R11, R10, R16 }, \ - { R25, R24, R23, R22, R21, R20, R26 }, \ - { R35, R34, R33, R32, R31, R30, R36 }, \ - { R45, R44, R43, R42, R41, R40, R46 }, \ - { REL, RER, KC_NO, KC_NO, KC_NO, R50, R56 } \ - } - -#define KC________ KC_TRNS -#define KC_RGB_MOD RGB_MOD -#define KC_FN FN -#define KC_ADJ ADJ -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, L26, R26, 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, \ - LEL, LER, L55, L56, R56, R50, REL, RER \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R06, 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_##L16, KC_##R16, 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_##L26, KC_##R26, 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_##L36, KC_##R36, 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_##L46, KC_##R46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, \ - KC_##LEL, KC_##LER, KC_##L55, KC_##L56, KC_##R56, KC_##R50, KC_##REL, KC_##RER \ - ) - -#endif +#pragma once diff --git a/keyboards/sol/rev1/rules.mk b/keyboards/sol/rev1/rules.mk index 99f4dd896c8..e69de29bb2d 100644 --- a/keyboards/sol/rev1/rules.mk +++ b/keyboards/sol/rev1/rules.mk @@ -1,2 +0,0 @@ -SRC += rev1/matrix.c \ - rev1/split_util.c diff --git a/keyboards/sol/rev1/split_util.c b/keyboards/sol/rev1/split_util.c deleted file mode 100644 index c645bbdfef7..00000000000 --- a/keyboards/sol/rev1/split_util.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "serial.h" - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - #if defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { - serial_master_init(); -} - -static void keyboard_slave_setup(void) { - serial_slave_init(); -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -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); - -#endif diff --git a/keyboards/sol/rules.mk b/keyboards/sol/rules.mk index bafdd9c52da..b7d689c0346 100644 --- a/keyboards/sol/rules.mk +++ b/keyboards/sol/rules.mk @@ -1,5 +1,3 @@ -SRC += serial.c - # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -48,6 +46,9 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Custom local font file OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" +SPLIT_KEYBOARD = yes +ENCODER_ENABLE = yes + # 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 @@ -62,6 +63,4 @@ 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. -CUSTOM_MATRIX = yes - DEFAULT_FOLDER = sol/rev1 diff --git a/keyboards/sol/serial.c b/keyboards/sol/serial.c deleted file mode 100644 index 169b4b176ce..00000000000 --- a/keyboards/sol/serial.c +++ /dev/null @@ -1,288 +0,0 @@ -/* - * 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 - -#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) - -// Serial pulse period in microseconds. -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 - // Very High speed - #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 1 - // High speed - #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 23 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 2 - // Middle speed - #define SERIAL_DELAY 12 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 3 - // Low speed - #define SERIAL_DELAY 24 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 4 - // Very Low speed - #define SERIAL_DELAY 50 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#else -#error Illegal Serial Speed -#endif - - -#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) -#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) - -#define SLAVE_INT_WIDTH 1 -#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY - -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_delay_half1(void) { - _delay_us(SERIAL_DELAY_HALF1); -} - -inline static -void serial_delay_half2(void) { - _delay_us(SERIAL_DELAY_HALF2); -} - -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_with_pullup(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_with_pullup(); - - -// Enable INT3 -EIMSK |= _BV(INT3); -// Trigger on falling edge of INT3 -EICRA &= ~(_BV(ISC30) | _BV(ISC31)); - -} - -// Used by the sender to synchronize timing with the reciver. -static -void sync_recv(void) { - for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { - } - // 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()); -} - -// Used by the reciver to send a synchronization signal to the sender. -static -void sync_send(void) { - serial_low(); - serial_delay(); - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - _delay_sub_us(READ_WRITE_START_ADJUST); - for ( uint8_t i = 0; i < 8; ++i) { - serial_delay_half1(); // read the middle of pulses - byte = (byte << 1) | serial_read_pin(); - _delay_sub_us(READ_WRITE_WIDTH_ADJUST); - serial_delay_half2(); - } - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 1<<7; - while( b ) { - if(data & b) { - serial_high(); - } else { - serial_low(); - } - b >>= 1; - serial_delay(); - } - serial_low(); // sync_send() / senc_recv() need raise edge -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - serial_output(); - - // slave send phase - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - sync_send(); - serial_write_byte(serial_slave_buffer[i]); - checksum += serial_slave_buffer[i]; - } - sync_send(); - serial_write_byte(checksum); - - // slave switch to input - sync_send(); //0 - serial_delay_half1(); //1 - serial_low(); //2 - serial_input_with_pullup(); //2 - serial_delay_half1(); //3 - - // slave recive phase - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - sync_recv(); - serial_master_buffer[i] = serial_read_byte(); - checksum_computed += serial_master_buffer[i]; - } - sync_recv(); - uint8_t checksum_received = serial_read_byte(); - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } - - sync_recv(); //weit master output to high -} - -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 -// 2 => checksum error -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(SLAVE_INT_WIDTH); - - // wait for the slaves response - serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - sei(); - return 1; - } - - // master recive phase - // if the slave is present syncronize with it - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - sync_recv(); - serial_slave_buffer[i] = serial_read_byte(); - checksum_computed += serial_slave_buffer[i]; - } - sync_recv(); - uint8_t checksum_received = serial_read_byte(); - - if (checksum_computed != checksum_received) { - serial_output(); - serial_high(); - sei(); - return 2; - } - - // master switch to output - sync_recv(); //0 - serial_delay(); //1 - serial_low(); //3 - serial_output(); // 3 - serial_delay_half1(); //4 - - // master send phase - uint8_t checksum = 0; - - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - sync_send(); - serial_write_byte(serial_master_buffer[i]); - checksum += serial_master_buffer[i]; - } - sync_send(); - serial_write_byte(checksum); - - // always, release the line when not in use - sync_send(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/sol/serial.h b/keyboards/sol/serial.h deleted file mode 100644 index cd6bcc76bc5..00000000000 --- a/keyboards/sol/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_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(PD3) //SErial pin goes here, D0-D3 -#define SERIAL_PIN_INTERRUPT INT3_vect //"INT#" of your serial pin - - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 - -// 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/sol/sol.h b/keyboards/sol/sol.h index 8f451ce56b0..8a41702df93 100644 --- a/keyboards/sol/sol.h +++ b/keyboards/sol/sol.h @@ -1,7 +1,53 @@ -#ifndef SOL_H -#define SOL_H +#pragma once -#include "rev1.h" #include "quantum.h" - +#ifdef KEYBOARD_sol_rev1 +#include "rev1.h" +#elif KEYBOARD_sol_rev2 +#include "rev2.h" #endif + + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, L26, R26, 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, \ + L55, L56, R56, R50 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, L55, L56 }, \ + { R05, R04, R03, R02, R01, R00, R06 }, \ + { R15, R14, R13, R12, R11, R10, R16 }, \ + { R25, R24, R23, R22, R21, R20, R26 }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + { R45, R44, R43, R42, R41, R40, R46 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, R50, R56 } \ + } + +#define KC________ KC_TRNS +#define KC_RGB_MOD RGB_MOD +#define KC_FN FN +#define KC_ADJ ADJ +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, L26, R26, 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, \ + L55, L56, R56, R50 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R06, 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_##L16, KC_##R16, 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_##L26, KC_##R26, 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_##L36, KC_##R36, 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_##L46, KC_##R46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, \ + KC_##L55, KC_##L56, KC_##R56, KC_##R50 \ + ) diff --git a/quantum/quantum.c b/quantum/quantum.c index fcedf0bc18b..d4fa7f2efce 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -247,12 +247,6 @@ bool process_record_quantum(keyrecord_t *record) { preprocess_tap_dance(keycode, record); #endif - #if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT) - // Wake up oled if user is using those fabulous keys! - if (record->event.pressed) - oled_on(); - #endif - if (!( #if defined(KEY_LOCK_ENABLE) // Must run first to be able to mask key_up events. @@ -976,9 +970,6 @@ void matrix_init_quantum() { #ifdef OUTPUT_AUTO_ENABLE set_output(OUTPUT_AUTO); #endif - #ifdef OLED_DRIVER_ENABLE - oled_init(OLED_ROTATION_0); - #endif matrix_init_kb(); } @@ -1015,10 +1006,6 @@ void matrix_scan_quantum() { haptic_task(); #endif - #ifdef OLED_DRIVER_ENABLE - oled_task(); - #endif - matrix_scan_kb(); } #if defined(BACKLIGHT_ENABLE) && (defined(BACKLIGHT_PIN) || defined(BACKLIGHT_PINS)) @@ -1214,10 +1201,10 @@ void backlight_task(void) { // (which is not possible since the backlight is not wired to PWM pins on the // CPU), we do the LED on/off by oursleves. // The timer is setup to count up to 0xFFFF, and we set the Output Compare -// register to the current 16bits backlight level (after CIE correction). -// This means the CPU will trigger a compare match interrupt when the counter -// reaches the backlight level, where we turn off the LEDs, -// but also an overflow interrupt when the counter rolls back to 0, +// register to the current 16bits backlight level (after CIE correction). +// This means the CPU will trigger a compare match interrupt when the counter +// reaches the backlight level, where we turn off the LEDs, +// but also an overflow interrupt when the counter rolls back to 0, // in which we're going to turn on the LEDs. // The LED will then be on for OCRxx/0xFFFF time, adjusted every 244Hz. @@ -1229,7 +1216,7 @@ ISR(TIMERx_COMPA_vect) { } // Triggered when the counter reaches the TOP value -// this one triggers at F_CPU/65536 =~ 244 Hz +// this one triggers at F_CPU/65536 =~ 244 Hz ISR(TIMERx_OVF_vect) { #ifdef BACKLIGHT_BREATHING breathing_task(); diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index eb110bd23ad..3c3daf3d3b5 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -299,7 +299,7 @@ uint8_t _matrix_scan(void) { debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); - return 1; + return (uint8_t)changed; } uint8_t matrix_scan(void) { diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 52546866eb7..85d25254808 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -75,6 +75,9 @@ along with this program. If not, see . #ifdef QWIIC_ENABLE # include "qwiic.h" #endif +#ifdef OLED_DRIVER_ENABLE + #include "oled_driver.h" +#endif #ifdef VELOCIKEY_ENABLE #include "velocikey.h" #endif @@ -205,6 +208,9 @@ void keyboard_init(void) { #ifdef QWIIC_ENABLE qwiic_init(); #endif +#ifdef OLED_DRIVER_ENABLE + oled_init(OLED_ROTATION_0); +#endif #ifdef PS2_MOUSE_ENABLE ps2_mouse_init(); #endif @@ -262,7 +268,11 @@ void keyboard_task(void) uint8_t keys_processed = 0; #endif +#if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT) + uint8_t ret = matrix_scan(); +#else matrix_scan(); +#endif if (is_keyboard_master()) { for (uint8_t r = 0; r < MATRIX_ROWS; r++) { @@ -306,6 +316,15 @@ MATRIX_LOOP_END: qwiic_task(); #endif +#ifdef OLED_DRIVER_ENABLE + oled_task(); +#ifndef OLED_DISABLE_TIMEOUT + // Wake up oled if user is using those fabulous keys! + if (ret) + oled_on(); +#endif +#endif + #ifdef MOUSEKEY_ENABLE // mousekey repeat & acceleration mousekey_task(); From e83e3165559eba17a965541726b5c09112bab9d5 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Mon, 6 May 2019 17:29:13 -0500 Subject: [PATCH 110/129] [Keyboard] Enable RGBLIGHT_ANIMATIONS by default on the Zen rev2 (#5805) * Enable RGBLIGHT_ANIMATIONS by default on the Zen rev2 * Also fixing OLED as it is upside down --- keyboards/zen/rev2/config.h | 1 + keyboards/zen/rev2/rev2.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/keyboards/zen/rev2/config.h b/keyboards/zen/rev2/config.h index 5fa26276025..c56956108d7 100644 --- a/keyboards/zen/rev2/config.h +++ b/keyboards/zen/rev2/config.h @@ -65,6 +65,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGBLED_NUM 34 // Number of LEDs +#define RGBLIGHT_ANIMATIONS /* * Feature disable options diff --git a/keyboards/zen/rev2/rev2.c b/keyboards/zen/rev2/rev2.c index 3f4a92c63d6..28a5a9f203d 100644 --- a/keyboards/zen/rev2/rev2.c +++ b/keyboards/zen/rev2/rev2.c @@ -24,7 +24,7 @@ const char* layer_name_user(uint32_t layer) { __attribute__((weak)) void render_status(void) { - // Setup for 90 degree rendering because it's awesome! + // Setup for 270 degree rendering because it's awesome! // It can house 16 lines of text, with 5 letters each line // Render to mode icon static const char PROGMEM mode_logo[2][4] = { @@ -49,7 +49,7 @@ void render_status(void) { oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (is_keyboard_master()) - return OLED_ROTATION_90; // flips the display 90 degrees if mainhand + return OLED_ROTATION_270; // flips the display 270 degrees if mainhand return rotation; } From 7a751f114114bf3b78d5d8fc8bedf2b42b665dba Mon Sep 17 00:00:00 2001 From: Brendan Wrafter Date: Tue, 7 May 2019 01:33:41 -0400 Subject: [PATCH 111/129] Add Boardwalk keymap (#5806) * Add Boardwalk keyboard layout * Remove backslashes --- .../boardwalk/keymaps/brendanwr/config.h | 16 ++++ .../boardwalk/keymaps/brendanwr/keymap.c | 95 +++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 keyboards/boardwalk/keymaps/brendanwr/config.h create mode 100644 keyboards/boardwalk/keymaps/brendanwr/keymap.c diff --git a/keyboards/boardwalk/keymaps/brendanwr/config.h b/keyboards/boardwalk/keymaps/brendanwr/config.h new file mode 100644 index 00000000000..a2530241f47 --- /dev/null +++ b/keyboards/boardwalk/keymaps/brendanwr/config.h @@ -0,0 +1,16 @@ +/* + * 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 . + */ + +#pragma once diff --git a/keyboards/boardwalk/keymaps/brendanwr/keymap.c b/keyboards/boardwalk/keymaps/brendanwr/keymap.c new file mode 100644 index 00000000000..b428651e73e --- /dev/null +++ b/keyboards/boardwalk/keymaps/brendanwr/keymap.c @@ -0,0 +1,95 @@ +/* + * 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 QMK_KEYBOARD_H + +enum layer { + _BASE, + _FN, + _BACKLIT +}; + + +#define FN MO(_FN) +#define BACKLIT MO(_BACKLIT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* BASE + * .-----------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | LCTRL | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | HOME | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | FN | END | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | LALT | LGUI | SPACE | RGUI | RALT | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_BASE] = LAYOUT_ortho_7u( + 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_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_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN, KC_END, + KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT + ), + +/* FUNCTION + * .-----------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | ` | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | | | | | | | | | | UP | | | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | | VOLD | VOLU | MUTE | | | | | | | LEFT | RIGHT | | PG_UP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | | | | | | | | | | | DOWN | | | PG_DN | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_7u( + _______, 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_UP, _______, _______, KC_DEL, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, KC_PGUP, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______, _______, KC_PGDN, + _______, _______, _______, _______, _______ + ), + +/* BACKLIT + * .-----------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | RGBTOG | RGBMOD | RGBHUI | RGBHUD | RGBSAI | RGBSAD | RGBVAI | RGBVAD | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_BACKLIT] = LAYOUT_ortho_7u( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______ + ) +}; From f3d5b1091d364468cd9f5510aef9e723d8542279 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 6 May 2019 22:34:09 -0700 Subject: [PATCH 112/129] [Keymap] RGB Changes for Drashna Keyboards (#5803) * Disable a bunch of reactive modes * Enable rgb matrix for Corne Keyboard * Convert CRKBD to rgb matrix * Add Gergo keyboard layout * Make Diablo 3 tap dance better * Add basic support for Planck EZ * Fix RGB Matrix stuff * Fix keycodes for Planck EZ * Update CRKBD OLED stuff * Fix typo for sleep on ergodox glow * Improve my gergo layout * Scrolling OLED key logger! * Change gergo layout * Hnadle unicode keycodes if unicode is disabled * Disable COMMAND/CONSOLE for gergo * Fix right side control * Re-enable LTO for all platforms Since I got updated arm gcc binaries that no longer error out on lto * Update formatting to match newer community standards Poor 2 space * Re-alight startup animation to use new HUE range * Streamline gitlab ci scripts * Disabled Space Cadet * Add support for breathing table * Enable new LTO Option And clean up defines that will now be repeatitive * Remove vscode settings * Additional formatting cleanup of config.h files --- keyboards/crkbd/keymaps/drashna/config.h | 42 +- keyboards/crkbd/keymaps/drashna/keymap.c | 382 +++++---------- keyboards/crkbd/keymaps/drashna/rules.mk | 7 +- keyboards/gergo/keymaps/drashna/keymap.c | 14 +- keyboards/gergo/keymaps/drashna/rules.mk | 2 + .../keebio/iris/keymaps/drashna/config.h | 29 +- .../keebio/iris/keymaps/drashna/keymap.c | 16 +- .../keebio/iris/keymaps/drashna/rules.mk | 1 + .../keebio/iris/keymaps/drashna_lp/config.h | 10 +- .../keebio/iris/keymaps/drashna_old/config.h | 10 +- .../keebio/viterbi/keymaps/drashna/config.h | 28 +- .../keebio/viterbi/keymaps/drashna/rules.mk | 1 + .../viterbi/keymaps/drashna_old/config.h | 4 +- keyboards/orthodox/keymaps/drashna/config.h | 33 +- keyboards/orthodox/keymaps/drashna/keymap.c | 8 +- keyboards/orthodox/keymaps/drashna/rules.mk | 1 + layouts/community/ergodox/drashna/config.h | 9 +- layouts/community/ergodox/drashna/keymap.c | 296 ++++++------ layouts/community/ergodox/drashna/rules.mk | 23 +- .../community/ergodox/drashna_glow/config.h | 15 +- layouts/community/numpad_5x6/drashna/config.h | 19 +- layouts/community/ortho_4x12/drashna/config.h | 59 +-- layouts/community/ortho_4x12/drashna/keymap.c | 308 ++++++------ layouts/community/ortho_4x12/drashna/rules.mk | 25 +- layouts/community/ortho_5x12/drashna/config.h | 29 +- users/drashna/.gitlab-ci.yml | 35 +- users/drashna/config.h | 68 ++- users/drashna/drashna.c | 198 ++++---- users/drashna/drashna.h | 76 +-- users/drashna/process_records.c | 232 ++++----- users/drashna/process_records.h | 76 +-- users/drashna/rgb_stuff.c | 441 ++++++++---------- users/drashna/rgblight_breathe_table.h | 116 +++++ users/drashna/rules.mk | 46 +- users/drashna/send_unicode.h | 104 ++--- users/drashna/tap_dances.c | 77 +-- users/drashna/tap_dances.h | 15 +- users/drashna/wrappers.h | 3 +- 38 files changed, 1414 insertions(+), 1444 deletions(-) create mode 100644 users/drashna/rgblight_breathe_table.h diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index 6f2665f3acb..0b035ba3c36 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h @@ -27,7 +27,8 @@ along with this program. If not, see . // #define MASTER_RIGHT #define EE_HANDS -// #define SSD1306OLED +#undef USE_I2C +#undef SSD1306OLED #define USE_SERIAL_PD2 @@ -35,17 +36,42 @@ along with this program. If not, see . // #define TAPPING_TERM 100 #ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 27 +# undef RGBLED_NUM +# define RGBLED_NUM 27 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_LIMIT_VAL 100 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_LIMIT_VAL 100 #endif +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended + +# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define DISABLE_RGB_MATRIX_CYCLE_ALL +# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define DISABLE_RGB_MATRIX_DUAL_BEACON +# define DISABLE_RGB_MATRIX_RAINBOW_BEACON +# define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +// #define DISABLE_RGB_MATRIX_RAINDROPS +// #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# define DISABLE_RGB_MATRIX_DIGITAL_RAIN +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define DISABLE_RGB_MATRIX_SOLID_SPLASH +# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + #ifdef AUDIO_ENABLE -#define B6_AUDIO +# define B6_AUDIO // #define NO_MUSIC_MODE #endif diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index aaace9483aa..3eea7af9f97 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -1,15 +1,5 @@ #include QMK_KEYBOARD_H #include "drashna.h" -#ifdef PROTOCOL_LUFA - #include "lufa.h" - #include "split_util.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif -#ifdef OLED_DRIVER_ENABLE - #include "oled_driver.h" -#endif extern keymap_config_t keymap_config; extern uint8_t is_master; @@ -20,7 +10,7 @@ extern rgblight_config_t rgblight_config; #endif enum crkbd_keycodes { - RGBRST = NEW_SAFE_RANGE + RGBRST = NEW_SAFE_RANGE }; #define LAYOUT_crkbd_base( \ @@ -31,7 +21,7 @@ enum crkbd_keycodes { LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ - OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ ) #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) @@ -115,35 +105,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; void matrix_init_keymap(void) { - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif - - #ifndef CONVERT_TO_PROTON_C +#ifndef CONVERT_TO_PROTON_C setPinOutput(D5); writePinHigh(D5); setPinOutput(B0); writePinHigh(B0); - #endif +#endif } -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED -// When add source files to SRC in rules.mk, you can use functions. -const char *read_logo(void); -char layer_state_str[24]; -char modifier_state_str[24]; -char host_led_state_str[24]; -char keylog_str[24] = {}; -char keylogs_str[21] = {}; -int keylogs_str_idx = 0; +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_master) { + return OLED_ROTATION_270; + } else { + return rotation; + } +} -// const char *read_mode_icon(bool swap); -// void set_timelog(void); -// const char *read_timelog(void); +void render_crkbd_logo(void) { + static const char PROGMEM crkbd_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}; + oled_write_P(crkbd_logo, false); +} + +#define KEYLOG_LEN (int)(32 / OLED_FONT_WIDTH) +char keylog_str[KEYLOG_LEN] = {}; +uint8_t keylogs_str_idx = 0; +uint16_t log_timer = 0; const char code_to_name[60] = { ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', @@ -153,261 +146,124 @@ const char code_to_name[60] = { 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; -void set_keylog(uint16_t keycode, keyrecord_t *record) { - char name = ' '; - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } - if (keycode < 60) { - name = code_to_name[keycode]; - } - // update keylog - snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", - record->event.key.row, record->event.key.col, - keycode, name); +void add_keylog(uint16_t keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || + (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } - // update keylogs - if (keylogs_str_idx == sizeof(keylogs_str) - 1) { - keylogs_str_idx = 0; - for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { - keylogs_str[i] = ' '; + for (uint8_t i = KEYLOG_LEN - 1; i > 0; i--) { + keylog_str[i] = keylog_str[i - 1]; } - } - - keylogs_str[keylogs_str_idx] = name; - keylogs_str_idx++; + if (keycode < 60) { + keylog_str[0] = code_to_name[keycode]; + } + log_timer = timer_read(); } -const char *read_keylog(void) { - return keylog_str; +void update_log(void) { + if (timer_elapsed(log_timer) > 750) { + add_keylog(0); + } } -const char *read_keylogs(void) { - return keylogs_str; -} - - -const char* read_modifier_state(void) { - uint8_t modifiers = get_mods(); - uint8_t one_shot = get_oneshot_mods(); - - snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s", - (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL) ? "CTL" : " ", - (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI) ? "GUI" : " ", - (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT) ? "ALT" : " ", - (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? "SFT" : " " - ); - - return modifier_state_str; -} - -const char *read_host_led_state(void) { - uint8_t leds = host_keyboard_leds(); - - snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", - (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", - (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", - (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- " - ); - - return host_led_state_str; -} - -const char* read_layer_state(void) { - switch (biton32(layer_state)) { - case _RAISE: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise "); - break; - case _LOWER: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower "); - break; - case _ADJUST: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust "); - break; - default: - switch (biton32(default_layer_state)) { - case _QWERTY: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Qwerty "); - break; - case _COLEMAK: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); - break; - case _DVORAK: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak "); - break; - case _WORKMAN: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); - break; - } - break; - } - - return layer_state_str; -} - -void matrix_scan_keymap(void) { - iota_gfx_task(); -} - -void matrix_render_user(struct CharacterMatrix *matrix) { - if (is_master) { - //If you want to change the display of OLED, you need to change here - matrix_write_ln(matrix, read_layer_state()); - matrix_write_ln(matrix, read_modifier_state()); - // matrix_write_ln(matrix, read_keylog()); - matrix_write_ln(matrix, read_keylogs()); - // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - // matrix_write(matrix, read_host_led_state()); - //matrix_write_ln(matrix, read_timelog()); - } else { - matrix_write(matrix, read_logo()); - } -} - -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) { - struct CharacterMatrix matrix; - matrix_clear(&matrix); - matrix_render_user(&matrix); - matrix_update(&display, &matrix); -} bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_A ... KC_SLASH: - case KC_F1 ... KC_F12: - case KC_INSERT ... KC_UP: - case KC_KP_SLASH ... KC_KP_DOT: - case KC_F13 ... KC_F24: - if (record->event.pressed) { set_keylog(keycode, record); } - break; - // set_timelog(); - } - return true; + if (record->event.pressed) { add_keylog(keycode); } + return true; } -#endif - - -#ifdef OLED_DRIVER_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (is_master) { - return OLED_ROTATION_270; - } else { - return rotation; - } -} - -void render_crkbd_logo(void) { - static const char PROGMEM crkbd_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}; - oled_write_P(crkbd_logo, false); -} - - void render_status(void) { - oled_write_P(PSTR("Layer"), false); - switch (biton32(layer_state)) { - case 0: - oled_write_P(PSTR("Base "), false); - break; - case _RAISE: - oled_write_P(PSTR("Raise"), false); - break; - case _LOWER: - oled_write_P(PSTR("Lower"), false); - break; - case _ADJUST: - oled_write_P(PSTR("Adjst"), false); - break; - default: - oled_write_P(PSTR("Unkn "), false); - break; - } - oled_write_P(PSTR("Lyout"), false); - switch (biton32(default_layer_state)) { - case _QWERTY: - oled_write_P(PSTR("QWRTY"), false); - break; - case _COLEMAK: - oled_write_P(PSTR("COLMK"), false); - break; - case _DVORAK: - oled_write_P(PSTR("DVRAK"), false); - break; - case _WORKMAN: - oled_write_P(PSTR("WRKMN"), false); - break; - case _NORMAN: - oled_write_P(PSTR("NORMN"), false); - break; - case _MALTRON: - oled_write_P(PSTR("MLTRN"), false); - break; - case _EUCALYN: - oled_write_P(PSTR("ECLYN"), false); - break; - case _CARPLAX: - oled_write_P(PSTR("CRPLX"), false); - break; - } + oled_write_P(PSTR("Layer"), false); + switch (biton32(layer_state)) { + case 0: + oled_write_P(PSTR("Base "), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjst"), false); + break; + default: + oled_write_P(PSTR("Unkn "), false); + break; + } + oled_write_P(PSTR("Lyout"), false); + switch (biton32(default_layer_state)) { + case _QWERTY: + oled_write_P(PSTR("QWRTY"), false); + break; + case _COLEMAK: + oled_write_P(PSTR("COLMK"), false); + break; + case _DVORAK: + oled_write_P(PSTR("DVRAK"), false); + break; + case _WORKMAN: + oled_write_P(PSTR("WRKMN"), false); + break; + case _NORMAN: + oled_write_P(PSTR("NORMN"), false); + break; + case _MALTRON: + oled_write_P(PSTR("MLTRN"), false); + break; + case _EUCALYN: + oled_write_P(PSTR("ECLYN"), false); + break; + case _CARPLAX: + oled_write_P(PSTR("CRPLX"), false); + break; + } - uint8_t modifiers = get_mods(); - uint8_t one_shot = get_oneshot_mods(); + uint8_t modifiers = get_mods(); + uint8_t one_shot = get_oneshot_mods(); - oled_write_P(PSTR("Mods:"), false); - oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false); - oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false); - oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false); - oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false); + oled_write_P(PSTR("Mods:"), false); + oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false); + oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false); + oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false); + oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false); - oled_write_P(PSTR("BTMGK"), false); - static const char PROGMEM mode_logo[4][4] = { - {0x95,0x96,0x0a,0}, - {0xb5,0xb6,0x0a,0}, - {0x97,0x98,0x0a,0}, - {0xb7,0xb8,0x0a,0} }; + oled_write_P(PSTR("BTMGK"), false); - if (keymap_config.swap_lalt_lgui != false) { - oled_write_P(mode_logo[0], false); - oled_write_P(mode_logo[1], false); - } else { - oled_write_P(mode_logo[2], false); - oled_write_P(mode_logo[3], false); - } + if (keymap_config.swap_lalt_lgui) { + oled_write_P(PSTR(" Mac "), false); + } else { + oled_write_P(PSTR(" Win "), false); + } - uint8_t led_usb_state = host_keyboard_leds(); - oled_write_P(PSTR("Lock:"), false); - oled_write_P(led_usb_state & (1<. #define EE_HANDS #ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 18 // Number of LEDs -#define RGBLED_SPLIT { 9, 9 } -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +# undef RGBLED_NUM +# define RGBLED_NUM 18 // Number of LEDs +# define RGBLED_SPLIT { 9, 9 } +# define RGBLIGHT_HUE_STEP 12 +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_VAL_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_LIMIT_VAL 225 +# define RGBLIGHT_LIMIT_VAL 225 #endif // RGBLIGHT_ENABLE #ifdef AUDIO_ENABLE -#define C6_AUDIO -#ifdef RGBLIGHT_ENABLE -#define NO_MUSIC_MODE -#endif //RGBLIGHT_ENABLE +# define C6_AUDIO +# ifdef RGBLIGHT_ENABLE +# define NO_MUSIC_MODE +# endif //RGBLIGHT_ENABLE #endif //AUDIO_ENABLE #define QMK_ESC_OUTPUT F6 // usually COL @@ -56,7 +55,7 @@ along with this program. If not, see . #undef PRODUCT #ifdef KEYBOARD_keebio_iris_rev2 -#define PRODUCT Drashna Hacked Iris Rev.2 +# define PRODUCT Drashna Hacked Iris Rev.2 #endif #define SHFT_LED1 6 diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index b306b6928a2..95092cc5210 100644 --- a/keyboards/keebio/iris/keymaps/drashna/keymap.c +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c @@ -12,7 +12,7 @@ KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ ) #define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) @@ -113,22 +113,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void matrix_init_keymap(void) { - #ifndef CONVERT_TO_PROTON_C +#ifndef CONVERT_TO_PROTON_C setPinOutput(D5); writePinHigh(D5); setPinOutput(B0); writePinHigh(B0); - #endif +#endif } void keyboard_post_init_keymap(void) { #if BACKLIGHT_ENABLE - backlight_enable(); - backlight_level(5); - #ifdef BACKLIGHT_BREATHING - breathing_enable(); - #endif + backlight_enable(); + backlight_level(5); + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif #endif } diff --git a/keyboards/keebio/iris/keymaps/drashna/rules.mk b/keyboards/keebio/iris/keymaps/drashna/rules.mk index bac5f95f3a1..1311ab28015 100644 --- a/keyboards/keebio/iris/keymaps/drashna/rules.mk +++ b/keyboards/keebio/iris/keymaps/drashna/rules.mk @@ -9,6 +9,7 @@ AUDIO_ENABLE = no NKRO_ENABLE = yes BACKLIGHT_ENABLE = no SWAP_HANDS_ENABLE = no +SPACE_CADET_ENABLE = no INDICATOR_LIGHTS = no MACROS_ENABLED = no diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/config.h b/keyboards/keebio/iris/keymaps/drashna_lp/config.h index 4e2bf729f22..d59890b46a3 100644 --- a/keyboards/keebio/iris/keymaps/drashna_lp/config.h +++ b/keyboards/keebio/iris/keymaps/drashna_lp/config.h @@ -21,15 +21,15 @@ along with this program. If not, see . #include "../drashna/config.h" #ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 16 // Number of LEDs -#undef RGBLED_SPLIT -#define RGBLED_SPLIT { 8, 8 } +# undef RGBLED_NUM +# define RGBLED_NUM 16 // Number of LEDs +# undef RGBLED_SPLIT +# define RGBLED_SPLIT { 8, 8 } #endif #undef PRODUCT #ifdef KEYBOARD_keebio_iris_rev2 -#define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) +# define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) #endif #undef SHFT_LED1 diff --git a/keyboards/keebio/iris/keymaps/drashna_old/config.h b/keyboards/keebio/iris/keymaps/drashna_old/config.h index 1b462d8cad6..5adf014e356 100644 --- a/keyboards/keebio/iris/keymaps/drashna_old/config.h +++ b/keyboards/keebio/iris/keymaps/drashna_old/config.h @@ -21,15 +21,15 @@ along with this program. If not, see . #include "../drashna/config.h" #ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 16 // Number of LEDs -#undef RGBLED_SPLIT -#define RGBLED_SPLIT { 8, 8 } +# undef RGBLED_NUM +# define RGBLED_NUM 16 // Number of LEDs +# undef RGBLED_SPLIT +# define RGBLED_SPLIT { 8, 8 } #endif #undef PRODUCT #ifdef KEYBOARD_keebio_iris_rev2 -#define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) +# define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) #endif #undef SHFT_LED1 diff --git a/keyboards/keebio/viterbi/keymaps/drashna/config.h b/keyboards/keebio/viterbi/keymaps/drashna/config.h index c0a50cc04b2..201c02e4199 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/config.h +++ b/keyboards/keebio/viterbi/keymaps/drashna/config.h @@ -21,35 +21,25 @@ along with this program. If not, see . #define MATRIX_ROWS 5 #ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 16 +# undef RGBLED_NUM +# 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_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 #endif // RGBLIGHT_ENABLE -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - #undef PRODUCT #define PRODUCT Drashnas Viterbi Macro Pad #ifdef AUDIO_ENABLE -#define C6_AUDIO -#define NO_MUSIC_MODE +# define C6_AUDIO +# define NO_MUSIC_MODE #endif #define LAYOUT_ortho_5x7( \ diff --git a/keyboards/keebio/viterbi/keymaps/drashna/rules.mk b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk index f28ecc5332a..f42e065d51e 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/rules.mk +++ b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk @@ -8,6 +8,7 @@ RGBLIGHT_ENABLE = yes AUDIO_ENABLE = yes NKRO_ENABLE = yes SPLIT_KEYBOARD = no +SPACE_CADET_ENABLE = no NO_SECRETS = yes MACROS_ENABLED = yes diff --git a/keyboards/keebio/viterbi/keymaps/drashna_old/config.h b/keyboards/keebio/viterbi/keymaps/drashna_old/config.h index b36a4edd4f9..5697f7f1109 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna_old/config.h +++ b/keyboards/keebio/viterbi/keymaps/drashna_old/config.h @@ -20,6 +20,6 @@ along with this program. If not, see . #include "../drashna/config.h" #ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 12 +# undef RGBLED_NUM +# define RGBLED_NUM 12 #endif diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 1f04d5298c9..4719c22696c 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -39,37 +39,36 @@ along with this program. If not, see . ) #ifdef RGBLIGHT_ENABLE -#define RGB_DI_PIN D3 -#define RGBLED_NUM 16 // Number of LEDs -#define RGBLED_SPLIT { 8, 8 } +# define RGB_DI_PIN D3 +# define RGBLED_NUM 16 // Number of LEDs +# define RGBLED_SPLIT { 8, 8 } -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +# define RGBLIGHT_HUE_STEP 12 +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_VAL_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 #endif // RGBLIGHT_ENABLE #ifdef AUDIO_ENABLE -#define C6_AUDIO -#ifdef RGBLIGHT_ENABLE -#define NO_MUSIC_MODE -#endif +# define C6_AUDIO +# ifdef RGBLIGHT_ENABLE +# define NO_MUSIC_MODE +# endif #endif //AUDIO_ENABLE #undef PRODUCT #ifdef KEYBOARD_orthodox_rev1 -#define PRODUCT Drashna Hacked Orthodox Rev.1 +# define PRODUCT Drashna Hacked Orthodox Rev.1 #elif KEYBOARD_orthodox_rev3 -#define PRODUCT Drashna Hacked Orthodox Rev.3 +# define PRODUCT Drashna Hacked Orthodox Rev.3 #endif #define QMK_ESC_OUTPUT D7 // usually COL #ifdef KEYBOARD_orthodox_rev1 -#define QMK_ESC_INPUT D4 // usually ROW +# define QMK_ESC_INPUT D4 // usually ROW #else -#define QMK_ESC_INPUT D2 // usually ROW +# define QMK_ESC_INPUT D2 // usually ROW #endif #define QMK_LED B0 #define QMK_SPEAKER C6 diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index b1d40690558..bde959f5e74 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -38,8 +38,8 @@ uint8_t last_osm; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \ + KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF \ ) #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) @@ -123,11 +123,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; void matrix_init_keymap(void) { - #ifndef CONVERT_TO_PROTON_C +#ifndef CONVERT_TO_PROTON_C setPinOutput(D5); writePinHigh(D5); setPinOutput(B0); writePinHigh(B0); - #endif +#endif } diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index fdbfc94c9ba..a122b9e0f15 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -7,6 +7,7 @@ TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes AUDIO_ENABLE = no NKRO_ENABLE = yes +SPACE_CADET_ENABLE = no INDICATOR_LIGHTS = yes MACROS_ENABLED = no diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 7b2ad4fa1ca..7feaf6f252a 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -1,12 +1,11 @@ #pragma once #ifdef RGBLIGHT_ENABLE -#undef RGBLIGHT_SAT_STEP -#define RGBLIGHT_SAT_STEP 12 +# undef RGBLIGHT_SAT_STEP +# define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 #endif // RGBLIGHT_ENABLE diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 26c2e33040c..eeb21501bab 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -20,6 +20,9 @@ along with this program. If not, see . #ifdef UNICODEMAP_ENABLE #include "drashna_unicode.h" #endif // UNICODEMAP_ENABLE +#ifndef UNICODE_ENABLE +# define UC(x) KC_NO +#endif #ifdef RGB_MATRIX_ENABLE extern bool g_suspend_state; @@ -28,7 +31,7 @@ extern rgb_config_t rgb_matrix_config; extern userspace_config_t userspace_config; enum more_custom_keycodes { - KC_SWAP_NUM = NEW_SAFE_RANGE + KC_SWAP_NUM = NEW_SAFE_RANGE }; //define layer change stuff for underglow indicator @@ -43,7 +46,7 @@ bool skip_leds = false; KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ KC_APP, KC_MENU, \ @@ -305,87 +308,88 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_1: - if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { - if (record->event.pressed) { - register_code(KC_2); - } else { - unregister_code(KC_2); - } - return false; - } - break; - case KC_2: - if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { - if (record->event.pressed) { - register_code(KC_1); - } else { - unregister_code(KC_1); - } - return false; - } - break; - case KC_SWAP_NUM: - if (record->event.pressed) { - userspace_config.swapped_numbers ^= 1; - eeconfig_update_user(userspace_config.raw); - } - } - //switch (keycode) { - // case KC_P00: - // if (!record->event.pressed) { - // register_code(KC_KP_0); - // unregister_code(KC_KP_0); - // register_code(KC_KP_0); - // unregister_code(KC_KP_0); - // } - // return false; - // break; - //} - return true; + switch (keycode) { + case KC_1: + if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { + if (record->event.pressed) { + register_code(KC_2); + } else { + unregister_code(KC_2); + } + return false; + } + break; + case KC_2: + if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { + if (record->event.pressed) { + register_code(KC_1); + } else { + unregister_code(KC_1); + } + return false; + } + break; + case KC_SWAP_NUM: + if (record->event.pressed) { + userspace_config.swapped_numbers ^= 1; + eeconfig_update_user(userspace_config.raw); + } + break; + } + //switch (keycode) { + // case KC_P00: + // if (!record->event.pressed) { + // register_code(KC_KP_0); + // unregister_code(KC_KP_0); + // register_code(KC_KP_0); + // unregister_code(KC_KP_0); + // } + // return false; + // break; + //} + return true; } void matrix_scan_keymap(void) { // runs frequently to update info - uint8_t modifiers = get_mods(); - uint8_t led_usb_state = host_keyboard_leds(); - uint8_t one_shot = get_oneshot_mods(); + uint8_t modifiers = get_mods(); + uint8_t led_usb_state = host_keyboard_leds(); + uint8_t one_shot = get_oneshot_mods(); - if (!skip_leds) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); + if (!skip_leds) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + + // Since we're not using the LEDs here for layer indication anymore, + // then lets use them for modifier indicators. Shame we don't have 4... + // Also, no "else", since we want to know each, independently. + if ( ( modifiers | one_shot ) & MOD_MASK_SHIFT || led_usb_state & (1<event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; + switch (keycode) { + #ifdef BACKLIGHT_ENABLE + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; #endif - } - return true; + } + return true; } bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - case BK_LWER: - case SP_LWER: - case DL_RAIS: - case ET_RAIS: - return false; - default: - return true; - } + switch (keycode) { + case RAISE: + case LOWER: + case BK_LWER: + case SP_LWER: + case DL_RAIS: + case ET_RAIS: + return false; + default: + return true; + } } #ifdef RGB_MATRIX_ENABLE void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); - rgb_matrix_config.enable = false; } void suspend_wakeup_init_keymap(void) { - rgb_matrix_config.enable = true; rgb_matrix_set_suspend_state(false); } -void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { - rgb_matrix_set_color( i, red, green, blue ); +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { + rgb_led led; + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + led = g_rgb_leds[i]; + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } } - } } void rgb_matrix_indicators_user(void) { - uint8_t this_mod = get_mods(); - uint8_t this_led = host_keyboard_leds(); - uint8_t this_osm = get_oneshot_mods(); + uint8_t this_mod = get_mods(); + uint8_t this_led = host_keyboard_leds(); + uint8_t this_osm = get_oneshot_mods(); + bool is_ez; + #ifdef KEYBOARD_planck_ez + is_ez = true; + #endif - if (!g_suspend_state && userspace_config.rgb_layer_change && -#if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) - (!rgblight_config.enable && rgb_matrix_config.enable) -#else - rgb_matrix_config.enable + if ( userspace_config.rgb_layer_change && +#ifdef RGB_DISABLE_WHEN_USB_SUSPENDED + !g_suspend_state && #endif - ) { - switch (biton32(layer_state)) { - case _RAISE: - rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; - case _LOWER: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; - case _ADJUST: - rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; - default: - switch (biton32(default_layer_state)) { - case _QWERTY: - rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; - case _COLEMAK: - rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; - case _DVORAK: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; - case _WORKMAN: - rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; - case _NORMAN: - rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D, true); break; - case _MALTRON: - rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, true); break; - case _EUCALYN: - rgb_matrix_layer_helper(0xFF, 0x80, 0xBF, true); break; - case _CARPLAX: - rgb_matrix_layer_helper(0x00, 0x00, 0xFF, true); break; +#if defined(RGBLIGHT_ENABLE) + (!rgblight_config.enable && rgb_matrix_config.enable) +#else + rgb_matrix_config.enable +#endif + ) { + switch (biton32(layer_state)) { + case _RAISE: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; + case _LOWER: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; + case _ADJUST: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; + default: + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; + case _COLEMAK: + rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; + case _DVORAK: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; + case _WORKMAN: + rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; + case _NORMAN: + rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; + case _MALTRON: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; + case _EUCALYN: + rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; + case _CARPLAX: + rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; + } } } - } - switch (biton32(default_layer_state)) { - case _QWERTY: - rgb_matrix_set_color(42, 0x00, 0xFF, 0xFF); break; - case _COLEMAK: - rgb_matrix_set_color(42, 0xFF, 0x00, 0xFF); break; - case _DVORAK: - rgb_matrix_set_color(42, 0x00, 0xFF, 0x00); break; - case _WORKMAN: - rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break; - } - if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<. userspace_config_t userspace_config; #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - #define DRASHNA_UNICODE_MODE UC_WIN + #define DRASHNA_UNICODE_MODE UC_WIN #else // set to 2 for UC_WIN, set to 4 for UC_WINC - #define DRASHNA_UNICODE_MODE 2 + #define DRASHNA_UNICODE_MODE 2 #endif // This block is for all of the gaming macros, as they were all doing // the same thing, but with differring text sent. bool send_game_macro(const char *str, keyrecord_t *record, bool override) { - if (!record->event.pressed || override) { - uint16_t keycode; - if (userspace_config.is_overwatch) { - keycode = KC_BSPC; - } else { - keycode = KC_ENTER; + if (!record->event.pressed || override) { + uint16_t keycode; + if (userspace_config.is_overwatch) { + keycode = KC_BSPC; + } else { + keycode = KC_ENTER; + } + clear_keyboard(); + tap_code(keycode); + wait_ms(TAP_CODE_DELAY); + send_string_with_delay(str, TAP_CODE_DELAY); + wait_ms(TAP_CODE_DELAY); + tap_code(KC_ENTER); } - clear_keyboard(); - tap_code(keycode); - wait_ms(TAP_CODE_DELAY); - send_string_with_delay(str, TAP_CODE_DELAY); - wait_ms(TAP_CODE_DELAY); - tap_code(KC_ENTER); - } - if (override) wait_ms(3000); - return false; + if (override) wait_ms(3000); + return false; } bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { - static uint16_t this_timer; - if(pressed) { - this_timer= timer_read(); - } else { - if (timer_elapsed(this_timer) < TAPPING_TERM){ - tap_code(code); - } else { - register_code(mod_code); - tap_code(code); - unregister_code(mod_code); - } - } - return false; + static uint16_t this_timer; + if(pressed) { + this_timer= timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM){ + tap_code(code); + } else { + register_code(mod_code); + tap_code(code); + unregister_code(mod_code); + } + } + return false; } bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { - if(pressed) { - this_timer= timer_read(); - } else { - if (timer_elapsed(this_timer) < TAPPING_TERM){ - tap_code(code); - } else { - register_code(mod_code); - tap_code(code); - unregister_code(mod_code); - } - } - return false; + if(pressed) { + this_timer= timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM){ + tap_code(code); + } else { + register_code(mod_code); + tap_code(code); + unregister_code(mod_code); + } + } + return false; } void bootmagic_lite(void) { - matrix_scan(); - #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 - wait_ms(DEBOUNCING_DELAY * 2); - #elif defined(DEBOUNCE) && DEBOUNCE > 0 - wait_ms(DEBOUNCE * 2); - #else - wait_ms(30); - #endif - matrix_scan(); - if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { - bootloader_jump(); - } + matrix_scan(); + #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 + wait_ms(DEBOUNCING_DELAY * 2); + #elif defined(DEBOUNCE) && DEBOUNCE > 0 + wait_ms(DEBOUNCE * 2); + #else + wait_ms(30); + #endif + matrix_scan(); + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + bootloader_jump(); + } } // Add reconfigurable functions here, for keymap customization @@ -103,21 +103,21 @@ void matrix_init_keymap(void) {} // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - userspace_config.raw = eeconfig_read_user(); + userspace_config.raw = eeconfig_read_user(); - #ifdef BOOTLOADER_CATERINA - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); + #ifdef BOOTLOADER_CATERINA + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); - #endif + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); + #endif - #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(DRASHNA_UNICODE_MODE); - get_unicode_input_mode(); - #endif //UNICODE_ENABLE - matrix_init_keymap(); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(DRASHNA_UNICODE_MODE); + get_unicode_input_mode(); + #endif //UNICODE_ENABLE + matrix_init_keymap(); } __attribute__((weak)) @@ -125,26 +125,26 @@ void keyboard_post_init_keymap(void){ } void keyboard_post_init_user(void){ #ifdef RGBLIGHT_ENABLE - keyboard_post_init_rgb(); + keyboard_post_init_rgb(); #endif - keyboard_post_init_keymap(); + keyboard_post_init_keymap(); } __attribute__ ((weak)) void shutdown_keymap(void) {} void shutdown_user (void) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(1); - rgblight_setrgb_red(); - #endif // RGBLIGHT_ENABLE - #ifdef RGB_MATRIX_ENABLE - // uint16_t timer_start = timer_read(); - // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); - // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } - #endif //RGB_MATRIX_ENABLE - shutdown_keymap(); + #ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(1); + rgblight_setrgb_red(); + #endif // RGBLIGHT_ENABLE + #ifdef RGB_MATRIX_ENABLE + // uint16_t timer_start = timer_read(); + // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); + // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } + #endif //RGB_MATRIX_ENABLE + shutdown_keymap(); } __attribute__ ((weak)) @@ -158,7 +158,7 @@ __attribute__ ((weak)) void suspend_wakeup_init_keymap(void) {} void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); + suspend_wakeup_init_keymap(); } @@ -168,54 +168,54 @@ void matrix_scan_keymap(void) {} // No global matrix scan code, so just run keymap's matrix // scan function void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + startup_user(); + } #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. - run_diablo_macro_check(); + run_diablo_macro_check(); #endif // TAP_DANCE_ENABLE #ifdef RGBLIGHT_ENABLE - matrix_scan_rgb(); + matrix_scan_rgb(); #endif // RGBLIGHT_ENABLE - matrix_scan_keymap(); + matrix_scan_keymap(); } __attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { - return state; + return state; } // on layer change, no matter where the change was initiated // Then runs keymap's layer change check uint32_t layer_state_set_user(uint32_t state) { - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); + state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); #ifdef RGBLIGHT_ENABLE - state = layer_state_set_rgb(state); + state = layer_state_set_rgb(state); #endif // RGBLIGHT_ENABLE - return layer_state_set_keymap (state); + return layer_state_set_keymap (state); } __attribute__ ((weak)) uint32_t default_layer_state_set_keymap (uint32_t state) { - return state; + return state; } // Runs state check and changes underglow color and animation uint32_t default_layer_state_set_user(uint32_t state) { - state = default_layer_state_set_keymap(state); + state = default_layer_state_set_keymap(state); #if 0 #ifdef RGBLIGHT_ENABLE state = default_layer_state_set_rgb(state); #endif // RGBLIGHT_ENABLE #endif - return state; + return state; } __attribute__ ((weak)) @@ -225,16 +225,16 @@ void led_set_keymap(uint8_t usb_led) {} // So far, I only have keyboard specific code, // So nothing goes here. void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); + led_set_keymap(usb_led); } __attribute__ ((weak)) void eeconfig_init_keymap(void) {} void eeconfig_init_user(void) { - userspace_config.raw = 0; - userspace_config.rgb_layer_change = true; - eeconfig_update_user(userspace_config.raw); + userspace_config.raw = 0; + userspace_config.rgb_layer_change = true; + eeconfig_update_user(userspace_config.raw); #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) set_unicode_input_mode(DRASHNA_UNICODE_MODE); get_unicode_input_mode(); diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 6645626d981..5df67792a5f 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -22,36 +22,36 @@ along with this program. If not, see . #include "wrappers.h" #include "process_records.h" #ifdef TAP_DANCE_ENABLE - #include "tap_dances.h" +# include "tap_dances.h" #endif // TAP_DANCE_ENABLE #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #include "rgb_stuff.h" +# include "rgb_stuff.h" #endif #if defined(AUDIO_ENABLE) && __GNUC__ > 7 - #if __has_include("drashna_song_list.h") - #include "drashna_song_list.h" - #endif +# if __has_include("drashna_song_list.h") +# include "drashna_song_list.h" +# endif #endif /* Define layer names */ enum userspace_layers { - _QWERTY = 0, - _NUMLOCK = 0, - _COLEMAK, - _DVORAK, - _WORKMAN, - _NORMAN, - _MALTRON, - _EUCALYN, - _CARPLAX, - _MODS, /* layer 8 */ - _GAMEPAD, - _DIABLO, - _MACROS, - _MEDIA, - _LOWER, - _RAISE, - _ADJUST, + _QWERTY = 0, + _NUMLOCK = 0, + _COLEMAK, + _DVORAK, + _WORKMAN, + _NORMAN, + _MALTRON, + _EUCALYN, + _CARPLAX, + _MODS, /* layer 8 */ + _GAMEPAD, + _DIABLO, + _MACROS, + _MEDIA, + _LOWER, + _RAISE, + _ADJUST, }; /* @@ -73,14 +73,14 @@ void led_set_keymap(uint8_t usb_led); void eeconfig_init_keymap(void); typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - bool is_overwatch :1; - bool nuke_switch :1; - uint8_t unicode_mod :4; - bool swapped_numbers :1; - }; + uint32_t raw; + struct { + bool rgb_layer_change :1; + bool is_overwatch :1; + bool nuke_switch :1; + uint8_t unicode_mod :4; + bool swapped_numbers :1; + }; } userspace_config_t; extern userspace_config_t userspace_config; @@ -92,13 +92,13 @@ But since TD() doesn't work when tap dance is disabled We use custom codes here, so we can substitute the right stuff */ #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) +# 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 // TAP_DANCE_ENABLE -#define KC_D3_1 KC_1 -#define KC_D3_2 KC_2 -#define KC_D3_3 KC_3 -#define KC_D3_4 KC_4 +# 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 // TAP_DANCE_ENABLE diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 2b6ccf510cb..a5487b5855f 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -4,12 +4,12 @@ uint16_t copy_paste_timer; __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } __attribute__ ((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } // Defines actions tor my global custom keycodes. Defined in drashna.h file @@ -18,140 +18,140 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // If console is enabled, it will print the matrix position and status of each key pressed #ifdef KEYLOGGER_ENABLE - #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) - xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); - #else - xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); - #endif +# if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) + xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); +# else + xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); +# endif #endif //KEYLOGGER_ENABLE - switch (keycode) { - case KC_QWERTY ... KC_CARPLAX: - if (record->event.pressed) { - set_single_persistent_default_layer(keycode - KC_QWERTY); - } - break; + switch (keycode) { + case KC_QWERTY ... KC_CARPLAX: + if (record->event.pressed) { + set_single_persistent_default_layer(keycode - KC_QWERTY); + } + break; - case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader - if (!record->event.pressed) { - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - clear_mods(); clear_oneshot_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); clear_oneshot_mods(); + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); #ifndef MAKE_BOOTLOADER - if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) + if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) #endif - { - #if defined(__arm__) - send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); - #endif // bootloader options - } - if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); - } - break; + { + #if defined(__arm__) + send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); + #endif // bootloader options + } + if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); + } + break; - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - break; + case VRSN: // Prints firmware version + if (record->event.pressed) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); + } + break; -// These are a serious of gaming macros. -// Only enables for the viterbi, basically, -// to save on firmware space, since it's limited. + // These are a serious of gaming macros. + // Only enables for the viterbi, basically, + // to save on firmware space, since it's limited. #ifdef MACROS_ENABLED - case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros - if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } + case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros + if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } #ifdef RGBLIGHT_ENABLE - userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); + userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); #endif //RGBLIGHT_ENABLE - break; - case KC_SALT: - return send_game_macro("Salt, salt, salt...", record, false); - case KC_MORESALT: - return send_game_macro("Please sir, can I have some more salt?!", record, false); - case KC_SALTHARD: - return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); - case KC_GOODGAME: - return send_game_macro("Good game, everyone!", record, false); - case KC_GLHF: - return send_game_macro("Good luck, have fun!!!", record, false); - case KC_SYMM: - return send_game_macro("Left click to win!", record, false); - case KC_JUSTGAME: - return send_game_macro("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.", record, false); - case KC_TORB: - return send_game_macro("That was positively riveting!", record, false); - case KC_AIM: - send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); - return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); - case KC_C9: - return send_game_macro("OMG!!! C9!!!", record, false); - case KC_GGEZ: - return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); + break; + case KC_SALT: + return send_game_macro("Salt, salt, salt...", record, false); + case KC_MORESALT: + return send_game_macro("Please sir, can I have some more salt?!", record, false); + case KC_SALTHARD: + return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); + case KC_GOODGAME: + return send_game_macro("Good game, everyone!", record, false); + case KC_GLHF: + return send_game_macro("Good luck, have fun!!!", record, false); + case KC_SYMM: + return send_game_macro("Left click to win!", record, false); + case KC_JUSTGAME: + return send_game_macro("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.", record, false); + case KC_TORB: + return send_game_macro("That was positively riveting!", record, false); + case KC_AIM: + send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); + return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); + case KC_C9: + return send_game_macro("OMG!!! C9!!!", record, false); + case KC_GGEZ: + return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); #endif // MACROS_ENABLED - case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them + case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them #ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_timer[dtime].key_time = diablo_times[0]; + } + } #endif // TAP_DANCE_ENABLE - break; + break; case KC_CCCV: // One key copy/paste - if(record->event.pressed){ - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - register_code(KC_LCTL); - tap_code(KC_C); - unregister_code(KC_LCTL); - } else { // Tap, paste - register_code(KC_LCTL); - tap_code(KC_V); - unregister_code(KC_LCTL); - } - } - break; + if(record->event.pressed){ + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + register_code(KC_LCTL); + tap_code(KC_C); + unregister_code(KC_LCTL); + } else { // Tap, paste + register_code(KC_LCTL); + tap_code(KC_V); + unregister_code(KC_LCTL); + } + } + break; #ifdef UNICODE_ENABLE - case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ - if (record->event.pressed) { - send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); - } - break; - case UC_TABL: // ┬─┬ノ( º _ ºノ) - if (record->event.pressed) { - send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); - } - break; - case UC_SHRG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); - } - break; - case UC_DISA: // ಠ_ಠ - if (record->event.pressed) { - send_unicode_hex_string("0CA0 005F 0CA0"); - } - break; + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ + if (record->event.pressed) { + send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + } + break; + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); + } + break; + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + break; + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 0CA0"); + } + break; #endif - } - return process_record_keymap(keycode, record) && + } + return process_record_keymap(keycode, record) && #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - process_record_user_rgb(keycode, record) && + process_record_user_rgb(keycode, record) && #endif // RGBLIGHT_ENABLE - process_record_secrets(keycode, record); + process_record_secrets(keycode, record); } diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index 5e3374d3f2c..35adec84cc7 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h @@ -2,48 +2,48 @@ #include "drashna.h" #if defined(KEYMAP_SAFE_RANGE) - #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE #else - #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE #endif enum userspace_custom_keycodes { - VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - KC_COLEMAK, // Sets default layer to COLEMAK - KC_DVORAK, // Sets default layer to DVORAK - KC_WORKMAN, // Sets default layer to WORKMAN - KC_NORMAN, // Sets default layer to NORMAN - KC_MALTRON, // Sets default layer to MALTRON - KC_EUCALYN, // Sets default layer to EUCALYN - KC_CARPLAX, // Sets default layer to CARPLAX - KC_DIABLO_CLEAR, // Clears all Diablo Timers - KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) - KC_SALT, // See drashna.c for details - KC_MORESALT, - KC_SALTHARD, - KC_GOODGAME, - KC_SYMM, - KC_JUSTGAME, - KC_GLHF, - KC_TORB, - KC_AIM, - KC_C9, - KC_GGEZ, - KC_MAKE, // Run keyboard's customized make command - KC_RGB_T, // Toggles RGB Layer Indication mode - KC_SECRET_1, // test1 - KC_SECRET_2, // test2 - KC_SECRET_3, // test3 - KC_SECRET_4, // test4 - KC_SECRET_5, // test5 - KC_CCCV, // Hold to copy, tap to paste - KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬─┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes + VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + KC_COLEMAK, // Sets default layer to COLEMAK + KC_DVORAK, // Sets default layer to DVORAK + KC_WORKMAN, // Sets default layer to WORKMAN + KC_NORMAN, // Sets default layer to NORMAN + KC_MALTRON, // Sets default layer to MALTRON + KC_EUCALYN, // Sets default layer to EUCALYN + KC_CARPLAX, // Sets default layer to CARPLAX + KC_DIABLO_CLEAR, // Clears all Diablo Timers + KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) + KC_SALT, // See drashna.c for details + KC_MORESALT, + KC_SALTHARD, + KC_GOODGAME, + KC_SYMM, + KC_JUSTGAME, + KC_GLHF, + KC_TORB, + KC_AIM, + KC_C9, + KC_GGEZ, + KC_MAKE, // Run keyboard's customized make command + KC_RGB_T, // Toggles RGB Layer Indication mode + KC_SECRET_1, // test1 + KC_SECRET_2, // test2 + KC_SECRET_3, // test3 + KC_SECRET_4, // test4 + KC_SECRET_5, // test5 + KC_CCCV, // Hold to copy, tap to paste + KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! + UC_FLIP, // (ಠ痊ಠ)┻━┻ + UC_TABL, // ┬─┬ノ( º _ ºノ) + UC_SHRG, // ¯\_(ツ)_/¯ + UC_DISA, // ಠ_ಠ + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes }; bool process_record_secrets(uint16_t keycode, keyrecord_t *record); diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index b5e145842f6..38e86ae0ea7 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -11,80 +11,80 @@ extern rgb_config_t rgb_matrix_config; #ifdef RGBLIGHT_ENABLE void rgblight_sethsv_default_helper(uint8_t index) { - rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); + rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); } #endif // RGBLIGHT_ENABLE #ifdef INDICATOR_LIGHTS void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { - if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { - if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1< 10) { - rgblight_fadeout *light = &lights[light_index]; - litup = true; + bool litup = false; + for (uint8_t light_index = 0 ; light_index < RGBLED_NUM ; ++light_index ) { + if (lights[light_index].enabled && timer_elapsed(lights[light_index].timer) > 10) { + rgblight_fadeout *light = &lights[light_index]; + litup = true; - if (light->life) { - light->life -= 1; - if (biton32(layer_state) == 0) { - sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); + if (light->life) { + light->life -= 1; + if (biton32(layer_state) == 0) { + sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); + } + light->timer = timer_read(); + } + else { + if (light->enabled && biton32(layer_state) == 0) { + rgblight_sethsv_default_helper(light_index); + } + litup = light->enabled = false; + } } - light->timer = timer_read(); - } - else { - if (light->enabled && biton32(layer_state) == 0) { rgblight_sethsv_default_helper(light_index); } - litup = light->enabled = false; - } } - } - if (litup && biton32(layer_state) == 0) { - rgblight_set(); - } + if (litup && biton32(layer_state) == 0) { + rgblight_set(); + } } void start_rgb_light(void) { @@ -203,42 +205,42 @@ void start_rgb_light(void) { bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { - keycode = keycode & 0xFF; - } - switch (keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + keycode = keycode & 0xFF; + } + switch (keycode) { #ifdef RGBLIGHT_TWINKLE - case KC_A ... KC_SLASH: - case KC_F1 ... KC_F12: - case KC_INSERT ... KC_UP: - case KC_KP_SLASH ... KC_KP_DOT: - case KC_F13 ... KC_F24: - case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: - if (record->event.pressed) { start_rgb_light(); } - return true; break; + case KC_A ... KC_SLASH: + case KC_F1 ... KC_F12: + case KC_INSERT ... KC_UP: + case KC_KP_SLASH ... KC_KP_DOT: + case KC_F13 ... KC_F24: + case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: + if (record->event.pressed) { start_rgb_light(); } + return true; break; #endif // RGBLIGHT_TWINKLE - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal + case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) - } - } + if (record->event.pressed) { + userspace_config.rgb_layer_change ^= 1; + xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + eeconfig_update_user(userspace_config.raw); + if (userspace_config.rgb_layer_change) { + layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) + } + } #endif // RGBLIGHT_ENABLE - return false; break; + return false; break; #ifdef RGBLIGHT_ENABLE - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (userspace_config.rgb_layer_change) { - userspace_config.rgb_layer_change = false; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - } - } - return true; break; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions + if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (userspace_config.rgb_layer_change) { + userspace_config.rgb_layer_change = false; + xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + eeconfig_update_user(userspace_config.raw); + } + } + return true; break; #endif // RGBLIGHT_ENABLE } return true; @@ -248,28 +250,28 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { void keyboard_post_init_rgb(void) { #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) - if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } - if (rgblight_config.enable) { - layer_state_set_user(layer_state); - uint16_t old_hue = rgblight_config.hue; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 360; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); - matrix_scan(); - wait_ms(10); + if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } + if (rgblight_config.enable) { + layer_state_set_user(layer_state); + uint16_t old_hue = rgblight_config.hue; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); + matrix_scan(); + wait_ms(10); + } } - } #endif - layer_state_set_user(layer_state); + layer_state_set_user(layer_state); } void matrix_scan_rgb(void) { #ifdef RGBLIGHT_TWINKLE - scan_rgblight_fadeout(); + scan_rgblight_fadeout(); #endif // RGBLIGHT_ENABLE #ifdef INDICATOR_LIGHTS - matrix_scan_indicator(); + matrix_scan_indicator(); #endif } @@ -277,99 +279,60 @@ void matrix_scan_rgb(void) { uint32_t layer_state_set_rgb(uint32_t state) { #ifdef RGBLIGHT_ENABLE - if (userspace_config.rgb_layer_change) { - switch (biton32(state)) { - case _MACROS: - rgblight_sethsv_noeeprom_orange(); - userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); - break; - case _MEDIA: - rgblight_sethsv_noeeprom_chartreuse(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); - break; - case _GAMEPAD: - rgblight_sethsv_noeeprom_orange(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); - break; - case _DIABLO: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _RAISE: - rgblight_sethsv_noeeprom_yellow(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _LOWER: - rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _ADJUST: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - break; - default: // for any other layers, or the default layer - switch (biton32(default_layer_state)) { - case _COLEMAK: - rgblight_sethsv_noeeprom_magenta(); break; - case _DVORAK: - rgblight_sethsv_noeeprom_springgreen(); break; - case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); break; - case _NORMAN: - rgblight_sethsv_noeeprom_coral(); break; - case _MALTRON: - rgblight_sethsv_noeeprom_yellow(); break; - case _EUCALYN: - rgblight_sethsv_noeeprom_pink(); break; - case _CARPLAX: - rgblight_sethsv_noeeprom_blue(); break; - default: - rgblight_sethsv_noeeprom_cyan(); break; - } - biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it - break; + if (userspace_config.rgb_layer_change) { + switch (biton32(state)) { + case _MACROS: + rgblight_sethsv_noeeprom_orange(); + userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); + break; + case _MEDIA: + rgblight_sethsv_noeeprom_chartreuse(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); + break; + case _GAMEPAD: + rgblight_sethsv_noeeprom_orange(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); + break; + case _DIABLO: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + break; + case _RAISE: + rgblight_sethsv_noeeprom_yellow(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + break; + case _LOWER: + rgblight_sethsv_noeeprom_green(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + break; + case _ADJUST: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + break; + default: // for any other layers, or the default layer + switch (biton32(default_layer_state)) { + case _COLEMAK: + rgblight_sethsv_noeeprom_magenta(); break; + case _DVORAK: + rgblight_sethsv_noeeprom_springgreen(); break; + case _WORKMAN: + rgblight_sethsv_noeeprom_goldenrod(); break; + case _NORMAN: + rgblight_sethsv_noeeprom_coral(); break; + case _MALTRON: + rgblight_sethsv_noeeprom_yellow(); break; + case _EUCALYN: + rgblight_sethsv_noeeprom_pink(); break; + case _CARPLAX: + rgblight_sethsv_noeeprom_blue(); break; + default: + rgblight_sethsv_noeeprom_cyan(); break; + } + biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it + break; + } } -// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow - } #endif // RGBLIGHT_ENABLE - return state; + return state; } - -#if 0 -uint32_t default_layer_state_set_rgb(uint32_t state) { -#ifdef RGBLIGHT_ENABLE - if (userspace_config.rgb_layer_change) { - rgblight_config_t temp_rgblight_config = rgblight_config; - switch (biton32(state)) { - case _COLEMAK: - temp_rgblight_config.hue = 300; - temp_rgblight_config.val = 255; - temp_rgblight_config.sat = 255; - temp_rgblight_config.mode = 1; - break; - case _DVORAK: - temp_rgblight_config.hue = 150; - temp_rgblight_config.val = 255; - temp_rgblight_config.sat = 255; - temp_rgblight_config.mode = 1; - case _WORKMAN: - temp_rgblight_config.hue = 43; - temp_rgblight_config.val = 218; - temp_rgblight_config.sat = 218; - temp_rgblight_config.mode = 1; - default: - temp_rgblight_config.hue = 180; - temp_rgblight_config.val = 255; - temp_rgblight_config.sat = 255; - temp_rgblight_config.mode = 1; - } - if (temp_rgblight_config.raw != eeconfig_read_rgblight()) { - xprintf("rgblight set default layer hsv [EEPROM]: %u,%u,%u,%u\n", temp_rgblight_config.hue, temp_rgblight_config.sat, temp_rgblight_config.val, temp_rgblight_config.mode); - eeconfig_update_rgblight(temp_rgblight_config.raw); - } - } -#endif // RGBLIGHT_ENABLE - return state; -} -#endif diff --git a/users/drashna/rgblight_breathe_table.h b/users/drashna/rgblight_breathe_table.h new file mode 100644 index 00000000000..05d347fcd3b --- /dev/null +++ b/users/drashna/rgblight_breathe_table.h @@ -0,0 +1,116 @@ +#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE +#define RGBLIGHT_EFFECT_BREATHE_TABLE + +const uint8_t rgblight_effect_breathe_table[] PROGMEM = { + /* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */ + /* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 + 0x44, 0x45, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4e, + 0x4f, 0x51, 0x52, 0x54, 0x55, 0x57, 0x58, 0x5a, + 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x64, 0x65, 0x67, + 0x69, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x73, 0x75, + 0x77, 0x79, 0x7b, 0x7c, 0x7e, 0x80, 0x82, 0x84, + 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x91, 0x93, + 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9f, 0xa1, 0xa3, + 0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xae, 0xb0, 0xb2, + 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xbf, 0xc1, + 0xc3, 0xc5, 0xc7, 0xc9, 0xca, 0xcc, 0xce, 0xd0, + 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda, 0xdb, 0xdd, + 0xde, 0xe0, 0xe1, 0xe3, 0xe4, 0xe5, 0xe7, 0xe8, + 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, + 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf8, + 0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd, + 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, + 0xfd, 0xfc, 0xfc, 0xfc, 0xfb, 0xfa, 0xfa, 0xf9, + 0xf8, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, + 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xe9, + 0xe8, 0xe7, 0xe5, 0xe4, 0xe3, 0xe1, 0xe0, 0xde, + 0xdd, 0xdb, 0xda, 0xd8, 0xd6, 0xd5, 0xd3, 0xd1, + 0xd0, 0xce, 0xcc, 0xca, 0xc9, 0xc7, 0xc5, 0xc3, + 0xc1, 0xbf, 0xbe, 0xbc, 0xba, 0xb8, 0xb6, 0xb4, + 0xb2, 0xb0, 0xae, 0xac, 0xaa, 0xa9, 0xa7, 0xa5, + 0xa3, 0xa1, 0x9f, 0x9d, 0x9b, 0x99, 0x97, 0x95, + 0x93, 0x91, 0x8f, 0x8d, 0x8b, 0x8a, 0x88, 0x86, + 0x84, 0x82, 0x80, 0x7e, 0x7c, 0x7b, 0x79, 0x77, + 0x75, 0x73, 0x72, 0x70, 0x6e, 0x6c, 0x6a, 0x69, + 0x67, 0x65, 0x64, 0x62, 0x60, 0x5f, 0x5d, 0x5c, + 0x5a, 0x58, 0x57, 0x55, 0x54, 0x52, 0x51, 0x4f, + 0x4e, 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x45, 0x44 + #endif /* 256 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 128 + 0x44, 0x47, 0x4a, 0x4c, + 0x4f, 0x52, 0x55, 0x58, + 0x5c, 0x5f, 0x62, 0x65, + 0x69, 0x6c, 0x70, 0x73, + 0x77, 0x7b, 0x7e, 0x82, + 0x86, 0x8a, 0x8d, 0x91, + 0x95, 0x99, 0x9d, 0xa1, + 0xa5, 0xa9, 0xac, 0xb0, + 0xb4, 0xb8, 0xbc, 0xbf, + 0xc3, 0xc7, 0xca, 0xce, + 0xd1, 0xd5, 0xd8, 0xdb, + 0xde, 0xe1, 0xe4, 0xe7, + 0xe9, 0xec, 0xee, 0xf0, + 0xf2, 0xf4, 0xf6, 0xf8, + 0xf9, 0xfa, 0xfc, 0xfc, + 0xfd, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, + 0xfd, 0xfc, 0xfb, 0xfa, + 0xf8, 0xf7, 0xf5, 0xf3, + 0xf1, 0xef, 0xed, 0xeb, + 0xe8, 0xe5, 0xe3, 0xe0, + 0xdd, 0xda, 0xd6, 0xd3, + 0xd0, 0xcc, 0xc9, 0xc5, + 0xc1, 0xbe, 0xba, 0xb6, + 0xb2, 0xae, 0xaa, 0xa7, + 0xa3, 0x9f, 0x9b, 0x97, + 0x93, 0x8f, 0x8b, 0x88, + 0x84, 0x80, 0x7c, 0x79, + 0x75, 0x72, 0x6e, 0x6a, + 0x67, 0x64, 0x60, 0x5d, + 0x5a, 0x57, 0x54, 0x51, + 0x4e, 0x4b, 0x48, 0x45 + #endif /* 128 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 64 + 0x44, 0x4a, + 0x4f, 0x55, + 0x5c, 0x62, + 0x69, 0x70, + 0x77, 0x7e, + 0x86, 0x8d, + 0x95, 0x9d, + 0xa5, 0xac, + 0xb4, 0xbc, + 0xc3, 0xca, + 0xd1, 0xd8, + 0xde, 0xe4, + 0xe9, 0xee, + 0xf2, 0xf6, + 0xf9, 0xfc, + 0xfd, 0xfe, + 0xfe, 0xfe, + 0xfd, 0xfb, + 0xf8, 0xf5, + 0xf1, 0xed, + 0xe8, 0xe3, + 0xdd, 0xd6, + 0xd0, 0xc9, + 0xc1, 0xba, + 0xb2, 0xaa, + 0xa3, 0x9b, + 0x93, 0x8b, + 0x84, 0x7c, + 0x75, 0x6e, + 0x67, 0x60, + 0x5a, 0x54, + 0x4e, 0x48 + #endif /* 64 bytes table */ +}; + +static const int table_scale = 256/sizeof(rgblight_effect_breathe_table); + +#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index bef25e25948..085840f1cc8 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,40 +1,40 @@ SRC += drashna.c \ process_records.c +LINK_TIME_OPTIMIZATION_ENABLE = yes + ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c + SRC += secrets.c endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c + SRC += tap_dances.c endif -ifeq ($(PLATFORM),AVR) - EXTRAFLAGS += -flto -endif + ifeq ($(strip $(NO_SECRETS)), yes) OPT_DEFS += -DNO_SECRETS endif ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += rgb_stuff.c - ifeq ($(strip $(INDICATOR_LIGHTS)), yes) - OPT_DEFS += -DINDICATOR_LIGHTS - endif - ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes) - OPT_DEFS += -DRGBLIGHT_TWINKLE - endif - ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) - OPT_DEFS += -DRGBLIGHT_NOEEPROM - endif - ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) - OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION - endif + SRC += rgb_stuff.c + ifeq ($(strip $(INDICATOR_LIGHTS)), yes) + OPT_DEFS += -DINDICATOR_LIGHTS + endif + ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes) + OPT_DEFS += -DRGBLIGHT_TWINKLE + endif + ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) + OPT_DEFS += -DRGBLIGHT_NOEEPROM + endif + ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) + OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION + endif endif -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) - SRC += rgb_stuff.c +ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += rgb_stuff.c endif @@ -43,9 +43,9 @@ ifeq ($(strip $(MACROS_ENABLED)), yes) endif ifdef CONSOLE_ENABLE - ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) - OPT_DEFS += -DKEYLOGGER_ENABLE - endif + ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) + OPT_DEFS += -DKEYLOGGER_ENABLE + endif endif ifeq ($(strip $(MAKE_BOOTLOADER)), yes) diff --git a/users/drashna/send_unicode.h b/users/drashna/send_unicode.h index 818b6e571b2..743abc58b42 100644 --- a/users/drashna/send_unicode.h +++ b/users/drashna/send_unicode.h @@ -7,65 +7,65 @@ void send_unicode_hex_string(const char* str); /* use X(n) to call the */ #ifdef UNICODEMAP_ENABLE enum unicode_name { - THINK, // thinking face 🤔 - GRIN, // grinning face 😊 - SMRK, // smirk 😏 - WEARY, // good shit 😩 - UNAMU, // unamused 😒 + THINK, // thinking face 🤔 + GRIN, // grinning face 😊 + SMRK, // smirk 😏 + WEARY, // good shit 😩 + UNAMU, // unamused 😒 - SNEK, // snke 🐍 - PENGUIN, // 🐧 - DRAGON, // 🐉 - MONKEY, // 🐒 - CHICK, // 🐥 - BOAR, // 🐗 + SNEK, // snke 🐍 + PENGUIN, // 🐧 + DRAGON, // 🐉 + MONKEY, // 🐒 + CHICK, // 🐥 + BOAR, // 🐗 - OKOK, // 👌 - EFFU, // 🖕 - INUP, // 👆 - THUP, // 👍 - THDN, // 👎 + OKOK, // 👌 + EFFU, // 🖕 + INUP, // 👆 + THUP, // 👍 + THDN, // 👎 - BBB, // dat B 🅱 - POO, // poop 💩 - HUNDR, // 100 💯 - EGGPL, // EGGPLANT 🍆 - WATER, // wet 💦 - TUMBLER, // 🥃 + BBB, // dat B 🅱 + POO, // poop 💩 + HUNDR, // 100 💯 + EGGPL, // EGGPLANT 🍆 + WATER, // wet 💦 + TUMBLER, // 🥃 - LIT, // fire 🔥 - BANG, // ‽ - IRONY, // ⸮ - DEGREE // ° + LIT, // fire 🔥 + BANG, // ‽ + IRONY, // ⸮ + DEGREE // ° }; const uint32_t PROGMEM unicode_map[] = { - [THINK] = 0x1F914, - [GRIN] = 0x1F600, - [BBB] = 0x1F171, - [POO] = 0x1F4A9, - [HUNDR] = 0x1F4AF, - [SMRK] = 0x1F60F, - [WEARY] = 0x1F629, - [EGGPL] = 0x1F346, - [WATER] = 0x1F4A6, - [LIT] = 0x1F525, - [UNAMU] = 0x1F612, - [SNEK] = 0x1F40D, - [PENGUIN] = 0x1F427, - [BOAR] = 0x1F417, - [MONKEY] = 0x1F412, - [CHICK] = 0x1F425, - [DRAGON] = 0x1F409, - [OKOK] = 0x1F44C, - [EFFU] = 0x1F595, - [INUP] = 0x1F446, - [THDN] = 0x1F44E, - [THUP] = 0x1F44D, - [TUMBLER] = 0x1F943, - [BANG] = 0x0203D, - [IRONY] = 0x02E2E, - [DEGREE] = 0x000B0 + [THINK] = 0x1F914, + [GRIN] = 0x1F600, + [BBB] = 0x1F171, + [POO] = 0x1F4A9, + [HUNDR] = 0x1F4AF, + [SMRK] = 0x1F60F, + [WEARY] = 0x1F629, + [EGGPL] = 0x1F346, + [WATER] = 0x1F4A6, + [LIT] = 0x1F525, + [UNAMU] = 0x1F612, + [SNEK] = 0x1F40D, + [PENGUIN] = 0x1F427, + [BOAR] = 0x1F417, + [MONKEY] = 0x1F412, + [CHICK] = 0x1F425, + [DRAGON] = 0x1F409, + [OKOK] = 0x1F44C, + [EFFU] = 0x1F595, + [INUP] = 0x1F446, + [THDN] = 0x1F44E, + [THUP] = 0x1F44D, + [TUMBLER] = 0x1F943, + [BANG] = 0x0203D, + [IRONY] = 0x02E2E, + [DEGREE] = 0x000B0 }; #endif // UNICODEMAP_ENABLE diff --git a/users/drashna/tap_dances.c b/users/drashna/tap_dances.c index cbb3cf54efe..18ca96e187e 100644 --- a/users/drashna/tap_dances.c +++ b/users/drashna/tap_dances.c @@ -2,63 +2,64 @@ //define diablo macro timer variables -uint16_t diablo_timer[4]; -uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -uint8_t diablo_key_time[4]; +diablo_timer_t diablo_timer[4]; + +uint8_t diablo_times[] = { 0, 0, 1, 3, 5, 10, 30 }; // has the correct number of seconds elapsed (as defined by diablo_times) -bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; +bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer].key_time) < (diablo_timer[dtimer].timer * 1000)) ? false : true; }; // Cycle through the times for the macro, starting at 0, for disabled. // Max of six values, so don't exceed -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { + int index = (int)user_data; + if (state->count >= 7) { + diablo_timer[index].key_time = diablo_times[0]; + reset_tap_dance(state); + } else { + diablo_timer[index].key_time = diablo_times[state->count]; + } } -// Would rather have one function for all of this, but no idea how to do that... -void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); } -void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); } -void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); } -void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); } +// One funtion to rule them all!! +#define ACTION_TAP_DANCE_DIABLO(arg) { \ + .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ + .user_data = (void *)arg, \ + } //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), + // tap once to disable, and more to enable timed micros + [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0), + [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1), + [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2), + [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3), }; // Sends the key press to system, but only if on the Diablo layer void send_diablo_keystroke(uint8_t diablo_key) { - if (IS_LAYER_ON(_DIABLO)) { - switch (diablo_key) { - case 0: - tap_code(KC_1); break; - case 1: - tap_code(KC_2); break; - case 2: - tap_code(KC_3); break; - case 3: - tap_code(KC_4); break; + if (IS_LAYER_ON(_DIABLO)) { + switch (diablo_key) { + case 0: + tap_code(KC_1); break; + case 1: + tap_code(KC_2); break; + case 2: + tap_code(KC_3); break; + case 3: + tap_code(KC_4); break; + } } - } } // Checks each of the 4 timers/keys to see if enough time has elapsed // Runs the "send string" command if enough time has passed, and resets the timer. void run_diablo_macro_check(void) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + if (check_dtimer(dtime) && diablo_timer[dtime].key_time) { + diablo_timer[dtime].timer = timer_read(); + send_diablo_keystroke(dtime); + } } - } } diff --git a/users/drashna/tap_dances.h b/users/drashna/tap_dances.h index 41d2bacb7b3..4a293b25820 100644 --- a/users/drashna/tap_dances.h +++ b/users/drashna/tap_dances.h @@ -2,18 +2,21 @@ #include "drashna.h" //define diablo macro timer variables -extern uint16_t diablo_timer[4]; extern uint8_t diablo_times[]; -extern uint8_t diablo_key_time[4]; +typedef struct { + uint16_t timer; + uint8_t key_time; +} diablo_timer_t; +extern diablo_timer_t diablo_timer[4]; void run_diablo_macro_check(void); #ifdef TAP_DANCE_ENABLE enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4 + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 }; #endif // TAP_DANCE_ENABLE diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h index 3260c58ae2d..93f842f4b2b 100644 --- a/users/drashna/wrappers.h +++ b/users/drashna/wrappers.h @@ -6,7 +6,7 @@ arguments, we need a wrapper in order for these definitions to be expanded before being used as arguments to the LAYOUT_xxx macro. */ #if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP +# define LAYOUT KEYMAP #endif #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) @@ -15,6 +15,7 @@ expanded before being used as arguments to the LAYOUT_xxx macro. #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) +#define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__) /* Blocks for each of the four major keyboard layouts From 97b8567a1f4a64fe1d43cf54683472aeb534489b Mon Sep 17 00:00:00 2001 From: Chuck Lauer Vose Date: Mon, 6 May 2019 22:36:21 -0700 Subject: [PATCH 113/129] Adding bdn9 keymap examples for company event (#5800) * Adding bdn9 keymap examples for company event * Simplify some code w/ tap_code16 [pr feedback] - Also remove backslashes - Remove xxx and ___ layer definitions - Properly name enums - Add newline after slack reaction --- .../bdn9/keymaps/vosechu-browser/keymap.c | 57 ++++++ .../keebio/bdn9/keymaps/vosechu-ksp/keymap.c | 172 ++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c create mode 100644 keyboards/keebio/bdn9/keymaps/vosechu-ksp/keymap.c diff --git a/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c b/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c new file mode 100644 index 00000000000..ca8679d5749 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c @@ -0,0 +1,57 @@ +#include QMK_KEYBOARD_H + +// Macro keys for some apps +#define SLACKUP LALT(LSFT(KC_UP)) +#define SLACKDN LALT(LSFT(KC_DOWN)) +#define RELOAD LGUI(KC_R) + +enum custom_keycodes { + PAWFIVE = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + RESET , PAWFIVE, RELOAD , + SLACKUP, KC_UP , KC_PGUP, + SLACKDN, KC_DOWN, KC_PGDN + ), +}; + +void keyboard_post_init_user(void) { + // Call the post init code. + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); // sets mode to Slow breathing without saving +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PAWFIVE: + if (record->event.pressed) { + SEND_STRING("+:pawfive:\n"); + return false; + } + } + + return true; +} + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + // Tab right + tap_code16(LSFT(LGUI(KC_RBRC))); + } else { + // Tab left + tap_code16(LSFT(LGUI(KC_LBRC))); + } + } + else if (index == 1) { + if (clockwise) { + // History forward + tap_code16(LGUI(KC_RBRC)); + } else { + // History back + tap_code16(LGUI(KC_LBRC)); + } + } +} diff --git a/keyboards/keebio/bdn9/keymaps/vosechu-ksp/keymap.c b/keyboards/keebio/bdn9/keymaps/vosechu-ksp/keymap.c new file mode 100644 index 00000000000..7687ea2bfb5 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/vosechu-ksp/keymap.c @@ -0,0 +1,172 @@ +/* Copyright 2019 Chuck Lauer Vose + * + * 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 QMK_KEYBOARD_H + +// // Debugging +// #include + +#define BASE TO(_BASE) +#define PANIC TO(_PANIC) +#define FLIGHT TO(_FLIGHT) +#define RCS TO(_RCS) + +enum my_layers { + _BASE = 0, + _PANIC, + _FLIGHT, + _RCS +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_MUTE, PANIC , XXXXXXX, + FLIGHT , XXXXXXX, RCS , + XXXXXXX, XXXXXXX, XXXXXXX + ), + [_PANIC] = LAYOUT( + RESET , BASE , XXXXXXX, + _______, XXXXXXX, _______, + KC_F2 , KC_F5 , KC_F9 + ), + [_FLIGHT] = LAYOUT( + XXXXXXX, _______, KC_M , + BASE , KC_W , _______, + KC_A , KC_S , KC_D + ), + [_RCS] = LAYOUT( + XXXXXXX, _______, XXXXXXX, + _______, KC_I , BASE , + KC_J , KC_K , KC_L + ) +}; + +bool base_mode = false; +bool panic_mode = false; +bool flight_mode = false; +bool rcs_mode = false; + +uint32_t layer_state_set_user(uint32_t state) { + base_mode = false; + panic_mode = false; + flight_mode = false; + rcs_mode = false; + + switch (biton32(state)) { + case _PANIC: + panic_mode = true; // For use in encoder evaluation + rgblight_sethsv_noeeprom(HSV_RED); + break; + case _FLIGHT: + flight_mode = true; // For use in encoder evaluation + rgblight_sethsv_noeeprom(HSV_CYAN); + break; + case _RCS: + rcs_mode = true; // For use in encoder evaluation + rgblight_sethsv_noeeprom(HSV_BLUE); + break; + default: // for any other layers, or the default layer + base_mode = true; + rgblight_sethsv_noeeprom(HSV_SPRINGGREEN); + break; + } + return state; +} + +void keyboard_post_init_user(void) { + // Call the post init code. + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 1); // sets mode to Slow breathing without saving + rgblight_sethsv_noeeprom(HSV_SPRINGGREEN); +} + +// bool process_record_user(uint16_t keycode, keyrecord_t *record) { +// switch (keycode) { +// uprintf("Keycode: %s\n", keycode); +// if (record->event.pressed) { +// print("pressed"); +// // Do something when pressed +// } else { +// print("unpressed"); +// // Do something else when release +// } +// } +// return true; +// } + +void encoder_update_user(uint8_t index, bool clockwise) { + if(base_mode == true) { + if (index == 0) { + if (clockwise) { + // Volume up + tap_code(KC_VOLU); + } else { + // Volume down + tap_code(KC_VOLD); + } + } + else if (index == 1) { + if (clockwise) { + // Time warp faster + tap_code(KC_DOT); + } else { + // Time warp slower + tap_code(KC_COMM); + } + } + } + + if(rcs_mode == true) { + if (index == 0) { + if (clockwise) { + // RCS Forward + tap_code(KC_H); + } else { + // RCS Backward + tap_code(KC_N); + } + } + else if (index == 1) { + if (clockwise) { + // RCS Rotate Left + tap_code(KC_Q); + } else { + // RCS Rotate Right + tap_code(KC_E); + } + } + } + + if(flight_mode == true) { + if (index == 0) { + if (clockwise) { + // Throttle up + tap_code(KC_LSFT); + } else { + // Throttle down + tap_code(KC_LCTL); + } + } + else if (index == 1) { + if (clockwise) { + // Trim left + tap_code16(LALT(KC_A)); + } else { + // Trim right + tap_code16(LALT(KC_D)); + } + } + } +} From 3b132599427a648b1f14aaf30312f05f855625ea Mon Sep 17 00:00:00 2001 From: kaylanm <1063516+kaylanm@users.noreply.github.com> Date: Tue, 7 May 2019 09:36:40 -0400 Subject: [PATCH 114/129] Add remaining RGB light components. (#5785) --- keyboards/singa/singa.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c index 26a7e463751..ee49ba65c10 100644 --- a/keyboards/singa/singa.c +++ b/keyboards/singa/singa.c @@ -34,6 +34,25 @@ void rgblight_set(void) { } #endif +void matrix_init_kb(void) { +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ +} + __attribute__ ((weak)) void matrix_scan_user(void) { } @@ -45,7 +64,7 @@ void backlight_init_ports(void) { setPinOutput(D4); setPinOutput(D6); - // turn RGB LEDs on + // turn backlight LEDs on writePinHigh(D0); writePinHigh(D1); writePinHigh(D4); @@ -54,13 +73,13 @@ void backlight_init_ports(void) { void backlight_set(uint8_t level) { if (level == 0) { - // turn RGB LEDs off + // turn backlight LEDs off writePinLow(D0); writePinLow(D1); writePinLow(D4); writePinLow(D6); } else { - // turn RGB LEDs on + // turn backlight LEDs on writePinHigh(D0); writePinHigh(D1); writePinHigh(D4); From 2d5c16dfd4ef193c4f692722157aa2b526a4c877 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Tue, 7 May 2019 10:43:08 -0700 Subject: [PATCH 115/129] [Keymap] crkbd/keymaps/rs: add rs keymap to corne keyboard and adapt others (#5181) Update all my keymaps to work with 40 keys. Refactor code using Userspace. --- keyboards/crkbd/keymaps/like_jis/keymap.c | 6 +- keyboards/crkbd/keymaps/rs/config.h | 44 +++++ keyboards/crkbd/keymaps/rs/keymap.c | 39 +++++ keyboards/crkbd/keymaps/rs/oled.c | 104 ++++++++++++ keyboards/crkbd/keymaps/rs/readme.md | 19 +++ keyboards/crkbd/keymaps/rs/rules.mk | 32 ++++ keyboards/dz60/keymaps/macos_arrow/keymap.c | 41 ++--- keyboards/dz60/keymaps/macos_arrow/rules.mk | 4 +- keyboards/ergotravel/keymaps/rs/keymap.c | 45 ++--- keyboards/ergotravel/keymaps/rs/readme.md | 14 +- keyboards/keebio/iris/keymaps/rs/config.h | 2 +- keyboards/keebio/iris/keymaps/rs/keymap.c | 51 +++--- keyboards/keebio/iris/keymaps/rs/readme.md | 14 +- keyboards/keebio/iris/keymaps/rs/rules.mk | 1 + layouts/community/ortho_4x12/rs/config.h | 1 + layouts/community/ortho_4x12/rs/keymap.c | 52 ++++++ layouts/community/ortho_4x12/rs/readme.md | 1 + layouts/community/ortho_5x12/rs/config.h | 34 ---- .../community/ortho_5x12/rs/karabiner.json | 154 ------------------ layouts/community/ortho_5x12/rs/keymap.c | 48 +++--- layouts/community/ortho_5x12/rs/readme.md | 18 +- .../iris/keymaps => users}/rs/karabiner.json | 0 users/rs/readme.md | 30 ++++ users/rs/rs.c | 74 +++++++++ users/rs/rs.h | 50 ++++++ users/rs/rules.mk | 1 + 26 files changed, 525 insertions(+), 354 deletions(-) create mode 100644 keyboards/crkbd/keymaps/rs/config.h create mode 100644 keyboards/crkbd/keymaps/rs/keymap.c create mode 100644 keyboards/crkbd/keymaps/rs/oled.c create mode 100644 keyboards/crkbd/keymaps/rs/readme.md create mode 100644 keyboards/crkbd/keymaps/rs/rules.mk create mode 100644 layouts/community/ortho_4x12/rs/config.h create mode 100644 layouts/community/ortho_4x12/rs/keymap.c create mode 100644 layouts/community/ortho_4x12/rs/readme.md delete mode 100644 layouts/community/ortho_5x12/rs/karabiner.json rename {keyboards/keebio/iris/keymaps => users}/rs/karabiner.json (100%) create mode 100644 users/rs/readme.md create mode 100644 users/rs/rs.c create mode 100644 users/rs/rs.h create mode 100644 users/rs/rules.mk diff --git a/keyboards/crkbd/keymaps/like_jis/keymap.c b/keyboards/crkbd/keymaps/like_jis/keymap.c index b1b6c64b1ec..41df6330f51 100644 --- a/keyboards/crkbd/keymaps/like_jis/keymap.c +++ b/keyboards/crkbd/keymaps/like_jis/keymap.c @@ -11,11 +11,6 @@ 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. @@ -241,6 +236,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void matrix_init_user(void) { #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; + UPDATE_KEYMAP_STATUS(); #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED diff --git a/keyboards/crkbd/keymaps/rs/config.h b/keyboards/crkbd/keymaps/rs/config.h new file mode 100644 index 00000000000..9701c2b3f2c --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/config.h @@ -0,0 +1,44 @@ +/* +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 . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 300 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/rs/keymap.c b/keyboards/crkbd/keymaps/rs/keymap.c new file mode 100644 index 00000000000..135ccb076c0 --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/keymap.c @@ -0,0 +1,39 @@ +#include QMK_KEYBOARD_H +#include "rs.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P ,EQL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LGUI,SPC , BSPC,CODE,FN + // `----+----+----' `+---+----+----'c + ), + [_CODE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV ,EXLM, AT ,HASH, DLR,PERC, CIRC,LPLT,ASTR,RPGT,NEQL, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , MINS,LBRC, UP ,RBRC, ,BSLS, + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + , 6 , 7 , 8 , 9 , 0 , AMPR,LEFT,DOWN,RGHT, ,PIPE, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DOT , , , + // `----+----+----' `----+----+----' + ), + [_FN] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10, F11, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LTOG,LHUI,LSAI,LVAI,LRST,BRMU, VOLU, ,PGUP, , , , + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + LMOD,LHUD,LSAD,LVAD,RST ,BRMD, VOLD,CTRA,PGDN,CTRE, , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , MUTE, , + // `----+----+----' `----+----+----' + ), +}; + diff --git a/keyboards/crkbd/keymaps/rs/oled.c b/keyboards/crkbd/keymaps/rs/oled.c new file mode 100644 index 00000000000..c94dff9eda9 --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/oled.c @@ -0,0 +1,104 @@ +#ifdef SSD1306OLED +#include QMK_KEYBOARD_H +#include "ssd1306.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +extern uint8_t is_master; + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_logo(void); +const char *read_keylog(void); +const char *read_keylogs(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); + +void matrix_scan_user(void) { iota_gfx_task(); } + +typedef struct { + uint8_t state; + char name[8]; +} LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {0, "Base"}, + {2, "Code"}, + {4, "Fn"}, + {6, "Fn+Code"}, + {__UINT8_MAX__, "?"}, +}; +static uint8_t layer_name_idx; +static char layer_status_buf[24] = "Layer: Base\n"; + +#ifdef RGBLIGHT_ENABLE +// Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +void update_keymap_status(void) { + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "Layer:%s RGB: %d\n", + layer_display_name[layer_name_idx].name, rgblight_config.mode); +} +#else +void update_keymap_status(void) { + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "Layer:%s\n", + layer_display_name[layer_name_idx].name); +} +#endif + +void matrix_init_user(void) { + iota_gfx_init(!has_usb()); // turns on the display + update_keymap_status(); +} + +// declared in users/rs/rs.c +void rgb_mod_changed_keymap(void) { + update_keymap_status(); +} + +// declared in users/rs/rs.c +void keylog_set_keymap(uint16_t keycode, keyrecord_t *record) { + set_keylog(keycode, record); +} + +uint32_t layer_state_set_user(uint32_t state) { + for (layer_name_idx = 0; layer_name_idx < LAYER_DISPLAY_MAX; ++layer_name_idx) { + if (state == 0 && layer_display_name[layer_name_idx].state == default_layer_state) { + break; + } else if (state != 0 && layer_display_name[layer_name_idx].state == state) { + break; + } + } + update_keymap_status(); + return state; +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + matrix_write(matrix, layer_status_buf); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + render_keymap_status(matrix); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + } else { + matrix_write(matrix, read_logo()); + } +} + +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) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/crkbd/keymaps/rs/readme.md b/keyboards/crkbd/keymaps/rs/readme.md new file mode 100644 index 00000000000..d7f7bb6459e --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/readme.md @@ -0,0 +1,19 @@ +# RS40: Code Friendly 40% Keymap + +This keymap is an evolution of my previous keymap optimized for coding with a 60% keyboards like the Iris. I tried to keep the simplicity of my previous keymap with all the keys necessary for coding on a single layer in addition to the base one. + +Because I sometime have to use my internal keyboard I my macbook, a karabiner configuration is also provided to get most of the features of this keyboard, including the code layer / backspace on right command key etc. + +See [rs readme](../../../../users/rs/readme.md) for a list of other keyboards supported by this keymap. + +## Base Layer + +[![](http://poitr.us/moooMf+)](http://www.keyboard-layout-editor.com/##@_backcolor=%23d8c1f5&switchMount=cherry&pcb:false&plate:true%3B&@_x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=E&_x:8%3B&=I%3B&@_y:-0.87&x:2%3B&=W&_x:1%3B&=R&_x:6%3B&=U&_x:1%3B&=O%3B&@_y:-0.8799999999999999&x:5%3B&=T&_x:4%3B&=Y%3B&@_y:-0.87&c=%233a1ee6&t=%23b84465%3B&=Tab&_c=%236750f2&t=%2344b8b8%3B&=Q&_x:12%3B&=P&_c=%233a1ee6&t=%23b84465&a:5%3B&=+%0A%2F=%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=D&_x:8%3B&=K%3B&@_y:-0.8700000000000001&x:2%3B&=S&_x:1%3B&=F&_x:6%3B&=J&_x:1%3B&=L%3B&@_y:-0.8799999999999999&x:5%3B&=G&_x:4%3B&=H%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465&a:5%3B&=Esc%0ACtrl&_c=%236750f2&t=%2344b8b8&a:7%3B&=A&_x:12&a:5%3B&=%2F:%0A%2F%3B&_c=%233a1ee6&t=%23b84465%3B&=%22%0A'%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=C&_x:8&a:5%3B&=%3C%0A,%3B&@_y:-0.8700000000000001&x:2&a:7%3B&=X&_x:1%3B&=V&_x:6%3B&=M&_x:1&a:5%3B&=%3E%0A.%3B&@_y:-0.8799999999999999&x:5&a:7%3B&=B&_x:4%3B&=N%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=Shift&_c=%236750f2&t=%2344b8b8%3B&=Z&_x:12&a:5%3B&=%3F%0A%2F%2F&_c=%233a1ee6&t=%23b84465&a:7%3B&=Enter%3B&@_y:-0.17999999999999972&x:11.75%3B&=Fn%3B&@_ry:0.25&y:2.95&x:3.3%3B&=Alt%3B&@_r:12&ry:1.75&y:0.5&x:4.8%3B&=Cmd%3B&@_r:35&rx:6.5&ry:4.25&y:-0.75&x:-0.75&c=%23d12424&t=%23ffffff&h:1.5%3B&=Space%3B&@_r:-35&rx:13&y:-2.75&x:-3.0999999999999996&h:1.5%3B&=Back%20Space%3B&@_r:-12&rx:0&ry:0&y:5.55&x:9.55&c=%233a1ee6&t=%23b84465%3B&=Code) + +## Code Layer + +[![](http://poitr.us/GvljvC+)](http://www.keyboard-layout-editor.com/##@_backcolor=%23d8c1f5&switchMount=cherry&pcb:false&plate:true%3B&@_x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=%23&_x:8%3B&=*%3B&@_y:-0.87&x:2%3B&=%2F@&_x:1%3B&=$&_x:6&a:5%3B&=%3C%0A(&_x:1%3B&=%3E%0A)%3B&@_y:-0.8799999999999999&x:5&a:7%3B&=%25&_x:4%3B&=%5E%3B&@_y:-0.87&c=%233a1ee6&t=%23b84465%3B&=Tab&_c=%236750f2&t=%2344b8b8%3B&=!&_x:12%3B&=!%2F=&_c=%233a1ee6&t=%23b84465&a:5%3B&=+%0A%2F=%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=3&_x:8%3B&=↑%3B&@_y:-0.8700000000000001&x:2%3B&=2&_x:1%3B&=4&_x:6&a:5%3B&=%7B%0A%5B&_x:1%3B&=%7D%0A%5D%3B&@_y:-0.8799999999999999&x:5&a:7%3B&=5&_x:4&a:5%3B&=%2F_%0A-%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=Esc%0ACtrl&_c=%236750f2&t=%2344b8b8&a:7%3B&=1&_x:12&a:5%3B&=%2F:%0A%2F%3B&_c=%233a1ee6&t=%23b84465%3B&=%7C%0A%5C%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=8&_x:8%3B&=↓%3B&@_y:-0.8700000000000001&x:2%3B&=7&_x:1%3B&=9&_x:6%3B&=←&_x:1%3B&=→%3B&@_y:-0.8799999999999999&x:5%3B&=0&_x:4%3B&=%2F&%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=Shift&_c=%236750f2&t=%2344b8b8%3B&=6&_x:12&a:5%3B&=%3F%0A%2F%2F&_c=%233a1ee6&t=%23b84465&a:7%3B&=Enter%3B&@_y:-0.17999999999999972&x:11.75%3B&=Fn%3B&@_ry:0.25&y:2.95&x:3.3%3B&=Alt%3B&@_r:12&ry:1.75&y:0.5&x:4.8%3B&=Cmd%3B&@_r:35&rx:6.5&ry:4.25&y:-0.75&x:-0.75&c=%23d12424&t=%23ffffff&h:1.5%3B&=.%3B&@_r:-35&rx:13&y:-2.75&x:-3.0999999999999996&h:1.5%3B&=Back%20Space%3B&@_r:-12&rx:0&ry:0&y:5.55&x:9.55&c=%233a1ee6&t=%23b84465%3B&=Code) + +## Fn Layer + +[![](http://poitr.us/OXwmBK+)](http://www.keyboard-layout-editor.com/##@_backcolor=%23d8c1f5&switchMount=cherry&pcb:false&plate:true%3B&@_x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=F3&_x:8%3B&=F8%3B&@_y:-0.87&x:2%3B&=F2&_x:1%3B&=F4&_x:6%3B&=F7&_x:1%3B&=F9%3B&@_y:-0.8799999999999999&x:5%3B&=F5&_x:4%3B&=F6%3B&@_y:-0.87&c=%233a1ee6&t=%23b84465%3B&=&_c=%236750f2&t=%2344b8b8%3B&=F1&_x:12%3B&=F10&_c=%233a1ee6&t=%23b84465%3B&=F11%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8%3B&=RGB%20Value+&_x:8%3B&=Page%20Up%3B&@_y:-0.8700000000000001&x:2%3B&=RGB%20Sat+&_x:1%3B&=RGB%20Reset&_x:6%3B&=&_x:1%3B&=%3B&@_y:-0.8799999999999999&x:5%3B&=Bright+&_x:4%3B&=Vol+%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=RGB%20Toggle&_c=%236750f2&t=%2344b8b8%3B&=RGB%20Hue+&_x:12%3B&=&_c=%233a1ee6&t=%23b84465%3B&=%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8%3B&=RGB%20Value-&_x:8%3B&=Page%20Down%3B&@_y:-0.8700000000000001&x:2%3B&=RGB%20Sat-&_x:1%3B&=Reset&_x:6%3B&=Ctrl+A&_x:1%3B&=Ctrl+E%3B&@_y:-0.8799999999999999&x:5%3B&=Bright-&_x:4%3B&=Vol-%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=RGB%20Mode&_c=%236750f2&t=%2344b8b8%3B&=RGB%20Hue-&_x:12%3B&=&_c=%233a1ee6&t=%23b84465%3B&=%3B&@_y:-0.17999999999999972&x:11.75%3B&=Fn%3B&@_ry:0.25&y:2.95&x:3.3%3B&=%3B&@_r:12&ry:1.75&y:0.5&x:4.8%3B&=%3B&@_r:35&rx:6.5&ry:4.25&y:-0.75&x:-0.75&c=%23d12424&t=%23ffffff&h:1.5%3B&=%3B&@_r:-35&rx:13&y:-2.75&x:-3.0999999999999996&h:1.5%3B&=Mute%3B&@_r:-12&rx:0&ry:0&y:5.55&x:9.55&c=%233a1ee6&t=%23b84465%3B&=Code) \ No newline at end of file diff --git a/keyboards/crkbd/keymaps/rs/rules.mk b/keyboards/crkbd/keymaps/rs/rules.mk new file mode 100644 index 00000000000..683b4b70ddd --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/rules.mk @@ -0,0 +1,32 @@ + +# 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 = 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 = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = no + +BOOTLOADER = atmel-dfu + +# 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 you want to change the display of OLED, you need to change here +SRC += oled.c \ + ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ diff --git a/keyboards/dz60/keymaps/macos_arrow/keymap.c b/keyboards/dz60/keymaps/macos_arrow/keymap.c index 81d61a59aec..0675a7954ab 100644 --- a/keyboards/dz60/keymaps/macos_arrow/keymap.c +++ b/keyboards/dz60/keymaps/macos_arrow/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------------------------+ * | Shift | Z | X | C | V | B | N | M | , | . | / | | Up |Shift| * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Alt | Gui | Space / _NL |Gui/_ML| Alt | Left| Down|Right| + * | Ctrl | Alt | Gui | Space |Gui/_ML| Alt | Left| Down|Right| * `-----------------------------------------------------------------------------------------' */ [_BL] = LAYOUT_all( @@ -30,25 +30,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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(_FL, 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_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_A, KC_UP, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, KC_NO, LT(_NL, KC_SPC), KC_NO, LM(_ML, MOD_RGUI), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), + KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_NO, LM(_ML, MOD_RGUI), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), /* ,-----------------------------------------------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | |PgUp | | | | | | | + * | | | | PgUp| | | | | Up | | | | | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | Left| Down| Up |Right| | | | + * | | |Home |PgDwn| End | | | Left| Down|Right| | | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | |PgDwn| | | | | | | + * | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ [_FL] = LAYOUT_all( _______, 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_NO, KC_DEL, - _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, - _______, KC_NO, _______, _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_PGUP, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, + _______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), /* ,-----------------------------------------------------------------------------------------. @@ -64,30 +64,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ [_ML] = LAYOUT_all( - KC_MEDIA_EJECT, BR_DOWN, BR_UP, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, _______, + KC_MEDIA_EJECT, BR_DOWN, BR_UP, BL_TOGG, RGB_TOG, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - /* ,-----------------------------------------------------------------------------------------. - * | | | | | | | | | % | ( | ) | < | > | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | * | 0 | 1 | 2 | 3 | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | . | - | 4 | 5 | 6 | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | , | = | 7 | 8 | 9 | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | - * `-----------------------------------------------------------------------------------------' - */ - [_NL] = LAYOUT_all( - _______, _______, _______, _______, _______, _______, _______, _______, KC_PERCENT, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_LEFT_ANGLE_BRACKET, KC_RIGHT_ANGLE_BRACKET, KC_NO, _______, - _______, _______, _______, _______, _______, _______, _______, KC_ASTERISK, KC_0, KC_1, KC_2, KC_3, _______, RESET, - _______, _______, _______, _______, _______, _______, _______, KC_DOT, KC_MINS, KC_4, KC_5, KC_6, _______, - _______, KC_NO, _______, _______, _______, _______, _______, _______, KC_COMMA, KC_EQL, KC_7, KC_8, KC_9, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_BRTG, BL_INC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_MODE_REVERSE, BL_DEC, RGB_MODE_FORWARD), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/dz60/keymaps/macos_arrow/rules.mk b/keyboards/dz60/keymaps/macos_arrow/rules.mk index e1cfb3e508c..1572f18c79a 100644 --- a/keyboards/dz60/keymaps/macos_arrow/rules.mk +++ b/keyboards/dz60/keymaps/macos_arrow/rules.mk @@ -1,2 +1,2 @@ -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no \ No newline at end of file +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/ergotravel/keymaps/rs/keymap.c b/keyboards/ergotravel/keymaps/rs/keymap.c index 634e97c49c7..1ac0a94d938 100644 --- a/keyboards/ergotravel/keymaps/rs/keymap.c +++ b/keyboards/ergotravel/keymaps/rs/keymap.c @@ -1,25 +1,7 @@ #include QMK_KEYBOARD_H - -enum layers { - _QWERTY, - _HYPER, - _SIGN -}; - - -#define KC_ KC_TRNS - -#define KC_ESCC MT(MOD_LCTL, KC_ESC) -#define KC_ENTS MT(MOD_LSFT, KC_ENT) -#define KC_HYPE MO(_HYPER) -#define KC_SIGN MO(_SIGN) -#define KC_RST RESET -// Brightness -#define KC_BRUP KC_PAUS -#define KC_BRDN KC_SLCK +#include "rs.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. TAB , Q , W , E , R , T , GRV, BSLS, Y , U , I , O , P ,EQL , @@ -28,32 +10,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| LSFT, Z , X , C , V , B , SPC, BSPC, N , M ,COMM,DOT ,SLSH,ENTS, //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| - SIGN, ,LCTL,LALT,LGUI, SPC, BSPC, HYPE,LEFT, UP ,DOWN,RIGHT + FN , ,LCTL,LALT,LGUI, SPC, BSPC, CODE,LEFT, UP ,DOWN,RIGHT //`----+----+----+--+-+----/----/ \----\----+----+----+----+----' ), - - - [_HYPER] = LAYOUT_kc( + [_CODE] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , , , 6 , 7 , 8 , 9 , 0 , , + GRV ,EXLM, AT ,HASH, DLR,PERC, , ,CIRC,LPLT,ASTR,RPGT,NEQL, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , ,PGUP, , , , , , , UP ,LBRC,RBRC,BSLS, + , 1 , 2 , 3 , 4 , 5 , , ,MINS,LBRC, UP ,RBRC, ,BSLS, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , ,HOME,PGDN,END , , , VOLU, ,LEFT,DOWN,RGHT, ,PIPE, + , 6 , 7 , 8 , 9 , 0 , DOT, ,AMPR,LEFT,DOWN,RGHT, ,PIPE, //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| - , , , , , , VOLD, ,MUTE, , , + , , , , , , , , , , , //`----+----+----+----+----/----/ \----\----+----+----+----+----' ), - - [_SIGN] = LAYOUT_kc( + [_FN] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, , ,CIRC,AMPR,ASTR,LBRC,RBRC, , + , F1 , F2 , F3 , F4 , F5 , , , F6 , F7 , F8 , F9 , F10,F11 , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - RST , F1 , F2 , F3 , F4 , F5 , F6 , , , , ,LCBR,RCBR,PIPE, + , , , , , ,BRMU, , , ,PGUP, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , 1 , 2 , 3 , 4 , 5 , , BRUP, 6 , 7 , 8 , 9 , 0 , , + , , , , , RST,BRMD, VOLU, ,CTRA,PGDN,CTRE, , , //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| - , , , , , , BRDN, , , , , + , , , , , , VOLD,MUTE, , , , //`----+----+----+----+----/----/ \----\----+----+----+----+----' ), }; \ No newline at end of file diff --git a/keyboards/ergotravel/keymaps/rs/readme.md b/keyboards/ergotravel/keymaps/rs/readme.md index 93b87cc23a1..d23ab66877a 100644 --- a/keyboards/ergotravel/keymaps/rs/readme.md +++ b/keyboards/ergotravel/keymaps/rs/readme.md @@ -1,13 +1 @@ -# Code friendly 60% keymap - -I developped this keymap to make a better use of 60% ortho keyboards I use like the preonic of the iris. Instead of trying to mimic the Planck layout like the default preonic keymap, this keymap removes the raise and lower layers and offers a simpler hyper layer concept for a few missing sign keys and cursors / media keys. - -The important part for coders is that most important signs needed to code are available at their usual position on a full keyboard, without complex layer gymnastic. Access to [] and {} are available on the hyper layer at their usual emplacement. - -The right thumb is used for both backspace and hyper layer switching. On the hyper layer, in addition to some coding signs, you get the cursor keys arranged in cross, just under your right fingers, so you don't have to move your hand when navigating in code or command line. Other hand gets the home/end page up/down in a similar layout. - -Because you sometime have to use your internal keyboard when you use a macbook, a karabiner configuration is also provided to get most of the features of this keyboard, including the hyper layer / backspace on right command key etc. - -This keymap is also available for other keyboards: -- [ortho_5x12/rs](../../../../layouts/community/ortho_5x12/rs/keymap.c) -- [Iris/rs](../../../iris/keymaps/rs/keymap.c) +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/rs/config.h b/keyboards/keebio/iris/keymaps/rs/config.h index 7c5b5ca4330..412862c8724 100644 --- a/keyboards/keebio/iris/keymaps/rs/config.h +++ b/keyboards/keebio/iris/keymaps/rs/config.h @@ -35,4 +35,4 @@ along with this program. If not, see . #define RGBLIGHT_SLEEP #define RGBLIGHT_HUE_STEP 1 #define RGBLIGHT_SAT_STEP 1 -#define RGBLIGHT_VAL_STEP 1 \ No newline at end of file +#define RGBLIGHT_VAL_STEP 1 diff --git a/keyboards/keebio/iris/keymaps/rs/keymap.c b/keyboards/keebio/iris/keymaps/rs/keymap.c index 43374e59f39..0e254ea190b 100644 --- a/keyboards/keebio/iris/keymaps/rs/keymap.c +++ b/keyboards/keebio/iris/keymaps/rs/keymap.c @@ -1,48 +1,45 @@ #include QMK_KEYBOARD_H - -enum layers { - _QWERTY, - _HYPER, -}; - -#define KC_ KC_TRNS - -#define KC_ESCC MT(MOD_LCTL, KC_ESC) -#define KC_ENTS MT(MOD_LSFT, KC_ENT) -#define KC_HYPE MO(_HYPER) -#define KC_RST RESET -// Brightness -#define KC_BRUP KC_PAUS -#define KC_BRDN KC_SLCK -#define KC_BLTG BL_TOGG +#include "rs.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,EQL, + TAB , Q , W , E , R , T , Y , U , I , O , P ,EQL , //|----+----+----+----+----+----| |----+----+----+----+----+----| ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| LSFT, Z , X , C , V , B ,SPC, BSPC, N , M ,COMM,DOT ,SLSH,ENTS, //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LGUI,SPC, BSPC,HYPE,ENT + LALT,LGUI,SPC , BSPC,CODE,FN // `----+----+----' `+---+----+----' - ), // | - // | - [_HYPER] = LAYOUT_kc( // V + ), + [_CODE] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - RST , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 ,LBRC,RBRC, , + , , , , , , , , , , , , //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , ,PGUP, ,BRUP, , , UP ,LCBR,RCBR,BSLS, + GRV ,EXLM, AT ,HASH, DLR,PERC, CIRC,LPLT,ASTR,RPGT,NEQL, , //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,HOME,PGDN,END ,BRDN, MINS,LEFT,DOWN,RGHT, ,PIPE, + , 1 , 2 , 3 , 4 , 5 , MINS,LBRC, UP ,RBRC, ,BSLS, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , ,BLTG, VOLU, , , , , , , + , 6 , 7 , 8 , 9 , 0 , , ,AMPR,LEFT,DOWN,RGHT, ,PIPE, //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , VOLD, ,MUTE + , , DOT, , , + // `----+----+----' `----+----+----' + ), + [_FN] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10, F11, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + BLTG,BLUP, , , ,BRMU, , ,PGUP, , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,BLDN, , ,RST ,BRMD, , VOLU, ,CTRA,PGDN,CTRE, , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , VOLD,MUTE, // `----+----+----' `----+----+----' ), }; + diff --git a/keyboards/keebio/iris/keymaps/rs/readme.md b/keyboards/keebio/iris/keymaps/rs/readme.md index bdf44121e4b..d23ab66877a 100644 --- a/keyboards/keebio/iris/keymaps/rs/readme.md +++ b/keyboards/keebio/iris/keymaps/rs/readme.md @@ -1,13 +1 @@ -# Code friendly 60% keymap - -I developped this keymap to make a better use of 60% ortho keyboards I use like the preonic of the iris. Instead of trying to mimic the Planck layout like the default preonic keymap, this keymap removes the raise and lower layers and offers a simpler hyper layer concept for a few missing sign keys and cursors / media keys. - -The important part for coders is that most important signs needed to code are available at their usual position on a full keyboard, without complex layer gymnastic. Access to [] and {} are available on the hyper layer at their usual emplacement. - -The right thumb is used for both backspace and hyper layer switching. On the hyper layer, in addition to some coding signs, you get the cursor keys arranged in cross, just under your right fingers, so you don't have to move your hand when navigating in code or command line. Other hand gets the home/end page up/down in a similar layout. - -Because you sometime have to use your internal keyboard when you use a macbook, a karabiner configuration is also provided to get most of the features of this keyboard, including the hyper layer / backspace on right command key etc. - -This keymap is also available for other keyboards: -- [ortho_5x12/rs](../../../../layouts/community/ortho_5x12/rs/keymap.c) -- [ErgoTravel/rs](../../../ergotravel/keymaps/rs/keymap.c) +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/rs/rules.mk b/keyboards/keebio/iris/keymaps/rs/rules.mk index bd518d8f273..b4f058b4b90 100644 --- a/keyboards/keebio/iris/keymaps/rs/rules.mk +++ b/keyboards/keebio/iris/keymaps/rs/rules.mk @@ -1 +1,2 @@ BACKLIGHT_ENABLE = yes +BOOTLOADER = atmel-dfu diff --git a/layouts/community/ortho_4x12/rs/config.h b/layouts/community/ortho_4x12/rs/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/layouts/community/ortho_4x12/rs/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/layouts/community/ortho_4x12/rs/keymap.c b/layouts/community/ortho_4x12/rs/keymap.c new file mode 100644 index 00000000000..c6d6f14cad0 --- /dev/null +++ b/layouts/community/ortho_4x12/rs/keymap.c @@ -0,0 +1,52 @@ +#include QMK_KEYBOARD_H +#include "rs.h" + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ + ) \ + LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ + ) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( \ + // ,-----------------------------------------------------------------------------------. + TAB , Q , W , E , R , T , Y , U , I , O , P , EQL , + // |------+------+------+------+------+------+------+------+------+------+------+------| + ESCC , A , S , D , F , G , H , J , K , L , SCLN , QUOT , + // |------+------+------+------+------+------+------+------+------+------+------+------| + LSFT , Z , X , C , V , B , N , M , COMM , DOT , SLSH , ENTS , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , LCTL , LALT , LGUI , SPC , SPC , BCOD , FN , , LEFT , RGHT + // `-----------------------------------------------------------------------------------' + ), + [_CODE] = LAYOUT_kc( + // ,-----------------------------------------------------------------------------------. + GRV , EXLM , AT , HASH , DLR , PERC , CIRC , LPLT , ASTR , RPGT , NEQL , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , 1 , 2 , 3 , 4 , 5 , MINS , LBRC , UP , RBRC , , BSLS , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , 6 , 7 , 8 , 9 , 0 , AMPR , LEFT , DOWN , RGHT , , PIPE , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , DOT , , , , , , + // `-----------------------------------------------------------------------------------' + ), + [_FN] = LAYOUT_kc( + // ,-----------------------------------------------------------------------------------. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10 , F11 , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLUP , , , , BRMU , VOLU , , PGUP , , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLDN , , , RST , BRMD , VOLD , CTRA , PGDN , CTRE , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , , MUTE , , , , , + // `-----------------------------------------------------------------------------------' + ), +}; diff --git a/layouts/community/ortho_4x12/rs/readme.md b/layouts/community/ortho_4x12/rs/readme.md new file mode 100644 index 00000000000..d23ab66877a --- /dev/null +++ b/layouts/community/ortho_4x12/rs/readme.md @@ -0,0 +1 @@ +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/layouts/community/ortho_5x12/rs/config.h b/layouts/community/ortho_5x12/rs/config.h index 02076e8728d..6f70f09beec 100644 --- a/layouts/community/ortho_5x12/rs/config.h +++ b/layouts/community/ortho_5x12/rs/config.h @@ -1,35 +1 @@ #pragma once - -#ifdef AUDIO_ENABLE -//#define STARTUP_SONG SONG(PREONIC_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 diff --git a/layouts/community/ortho_5x12/rs/karabiner.json b/layouts/community/ortho_5x12/rs/karabiner.json deleted file mode 100644 index f5214650ade..00000000000 --- a/layouts/community/ortho_5x12/rs/karabiner.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "title": "RS", - "rules": [{ - "description": "CapsLock to Escape / Control Mod-Tap", - "manipulators": [{ - "type": "basic", - "from": { - "key_code": "caps_lock", - "modifiers": { - "optional": ["any"] - } - }, - "to": [{"key_code": "left_control"}], - "to_if_alone": [{"key_code": "escape"}] - }] - }, - { - "description": "Right-Shift / Enter Mod-Tap", - "manipulators": [{ - "type": "basic", - "from": { - "key_code": "right_shift", - "modifiers": { - "optional": ["any"] - } - }, - "to": [{"key_code": "right_shift"}], - "to_if_alone": [{"key_code": "return_or_enter"}] - }] - }, - { - "description": "Right-Command / Backspace Mod-Tap", - "manipulators": [{ - "type": "basic", - "from": { - "key_code": "right_command", - "modifiers": { - "optional": ["any"] - } - }, - "to": [{"key_code": "right_command"}], - "to_if_alone": [{"key_code": "delete_or_backspace"}] - }] - }, - { - "description": "Right-Command Accents", - "manipulators": [ - { - "type": "basic", - "from": { - "key_code": "a", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["left_shift", "right_shift"] - } - }, - "to": [ - {"key_code": "grave_accent_and_tilde", "modifiers": ["left_option"]}, - {"key_code": "a"} - ] - }] - }, - { - "description": "Right Command Navigation", - "manipulators": [{ - "type": "basic", - "from": { - "key_code": "j", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "left_arrow"}] - }, - { - "type": "basic", - "from": { - "key_code": "k", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "down_arrow"}] - }, - { - "type": "basic", - "from": { - "key_code": "i", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "up_arrow"}] - }, - { - "type": "basic", - "from": { - "key_code": "l", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "right_arrow"}] - }, - { - "type": "basic", - "from": { - "key_code": "e", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "page_up"}] - }, - { - "type": "basic", - "from": { - "key_code": "d", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "page_down"}] - }, - { - "type": "basic", - "from": { - "key_code": "s", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "home"}] - }, - { - "type": "basic", - "from": { - "key_code": "f", - "modifiers": { - "mandatory": ["right_command"], - "optional": ["any"] - } - }, - "to": [{"key_code": "end"}] - }] - }] -} diff --git a/layouts/community/ortho_5x12/rs/keymap.c b/layouts/community/ortho_5x12/rs/keymap.c index e4e590669f2..15cbabaac14 100644 --- a/layouts/community/ortho_5x12/rs/keymap.c +++ b/layouts/community/ortho_5x12/rs/keymap.c @@ -1,19 +1,5 @@ #include QMK_KEYBOARD_H - -enum layers { - _QWERTY, - _HYPER, -}; - -#define KC_ KC_TRNS - -#define KC_ESCC MT(MOD_LCTL, KC_ESC) -#define KC_RST RESET -#define KC_BSPH LT(_HYPER, KC_BSPC) -#define KC_ENTS MT(MOD_LSFT, KC_ENT) -// Brightness -#define KC_BRUP KC_PAUS -#define KC_BRDN KC_SLCK +#include "rs.h" // Used to create a keymap using only KC_ prefixed keys #ifndef LAYOUT_kc @@ -34,7 +20,6 @@ enum layers { #endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( \ // ,-----------------------------------------------------------------------------------. GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , MINS , @@ -45,21 +30,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // |------+------+------+------+------+------+------+------+------+------+------+------| LSFT , Z , X , C , V , B , N , M , COMM , DOT , SLSH , ENTS , // |------+------+------+------+------+------+------+------+------+------+------+------| - , LCTL , LALT , LGUI , SPC , SPC , BSPC , BSPH , LEFT , DOWN , UP , RGHT + , , LCTL , LALT , LGUI , SPC , SPC , BCOD , FN , , LEFT , RGHT // `---------------------------------------------------+-------------------------------' - ), // | - // | - [_HYPER] = LAYOUT_kc( /* V */ \ + ), + [_CODE] = LAYOUT_kc( // ,-----------------------------------------------------------------------------------. - RST , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , LBRC , RBRC , , + , , , , , , , , , , , , // |------+------+------+------+------+------+------+------+------+------+------+------| - , , , PGUP , , , , , UP , LCBR , RCBR , BSLS , + GRV , EXLM , AT , HASH , DLR , PERC , CIRC , LPLT , ASTR , RPGT , NEQL , , // |------+------+------+------+------+------+------+------+------+------+------+------| - , , HOME , PGDN , END , , MINS , LEFT , DOWN , RGHT , , PIPE , + , 1 , 2 , 3 , 4 , 5 , MINS , LBRC , UP , RBRC , , BSLS , // |------+------+------+------+------+------+------+------+------+------+------+------| - , , , , , , , , , BRDN , BRUP , , + , 6 , 7 , 8 , 9 , 0 , AMPR , LEFT , DOWN , RGHT , , PIPE , // |------+------+------+------+------+------+------+------+------+------+------+------| - , , , , , , , , MUTE , VOLD , VOLU , MPLY + , , , , , DOT , , , , , , + // `-----------------------------------------------------------------------------------' + ), + [_FN] = LAYOUT_kc( + // ,-----------------------------------------------------------------------------------. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10 , F11 , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , , , , , , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLUP , , , , BRMU , VOLU , , PGUP , , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLDN , , , RST , BRMD , VOLD , CTRA , PGDN , CTRE , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , , MUTE , , , , , // `-----------------------------------------------------------------------------------' ), }; + diff --git a/layouts/community/ortho_5x12/rs/readme.md b/layouts/community/ortho_5x12/rs/readme.md index d75eefd5b9c..d23ab66877a 100644 --- a/layouts/community/ortho_5x12/rs/readme.md +++ b/layouts/community/ortho_5x12/rs/readme.md @@ -1,17 +1 @@ -# Code friendly 60% keymap - -I developped this keymap to make a better use of 60% ortho keyboards I use like the preonic of the iris. Instead of trying to mimic the Planck layout like the default preonic keymap, this keymap removes the raise and lower layers and offers a simpler hyper layer concept for a few missing sign keys and cursors / media keys. - -The important part for coders is that most important signs needed to code are available at their usual position on a full keyboard, without complex layer gymnastic. Access to [] and {} are available on the hyper layer at their usual emplacement. - -The right thumb is used for both backspace and hyper layer switching. On the hyper layer, in addition to some coding signs, you get the cursor keys arranged in cross, just under your right fingers, so you don't have to move your hand when navigating in code or command line. Other hand gets the home/end page up/down in a similar layout. - -Because you sometime have to use your internal keyboard when you use a macbook, a karabiner configuration is also provided to get most of the features of this keyboard, including the hyper layer / backspace on right command key etc. - -This keymap has been tested with those keyboards: -- [Preonic](../../../../keyboards/preonic/) -- [My preonic clone](../../../rs60/) - -Checkout an adaptation of this keymap for other keyboards: -- [Iris/rs](../../../../keyboards/iris/keymaps/rs/keymap.c) -- [ErgoTravel/rs](../../../../keyboards/ergotravel/keymaps/rs/keymap.c) \ No newline at end of file +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/rs/karabiner.json b/users/rs/karabiner.json similarity index 100% rename from keyboards/keebio/iris/keymaps/rs/karabiner.json rename to users/rs/karabiner.json diff --git a/users/rs/readme.md b/users/rs/readme.md new file mode 100644 index 00000000000..60b34ea32fb --- /dev/null +++ b/users/rs/readme.md @@ -0,0 +1,30 @@ +# RS: Code Friendly 40% – 60% Keymaps + +The rs keymap collection is an evolution of my previous keymap optimized for coding with a 60% keyboards like the Iris. I tried to keep the simplicity of my previous keymap with all the keys necessary for coding on a single layer in addition to the base one. It work well with any 40% and 60% keyboard, split or not. + +To build it, use: + + make :rs + +Example: + + make keebio/iris:rs + make crkbd:rs + make planck:rs + make preonic:rs + make ergotravel:rs + make handwired/rs60:rs + +Because I sometime have to use my internal keyboard I my macbook, a [karabiner configuration](karabiner.json) is also provided to get most of the features of this keyboard, including the code layer / backspace on right command key etc. + +This set of keymaps have been tested with those keyboards: +- [Planck](../../keyboards/planck/) +- [Preonic](../../keyboards/preonic/) +- [My preonic clone](../../keyboards/handwired/rs60/) + +This keymap in is also available for other keyboards: +- [Crkdb/rs](../../keyboards/crkbd/keymaps/rs/keymap.c) +- [Iris/rs](../../keyboards/keebio/iris/keymaps/rs/keymap.c) +- [Ergotravel/rs](../../keyboards/ergotravel/keymaps/rs/keymap.c) +- [ortho_5x12/rs](../../layouts/community/ortho_5x12/rs/keymap.c) +- [ortho_4x12/rs](../../layouts/community/ortho_4x12/rs/keymap.c) diff --git a/users/rs/rs.c b/users/rs/rs.c new file mode 100644 index 00000000000..fa634bb9284 --- /dev/null +++ b/users/rs/rs.c @@ -0,0 +1,74 @@ + +#include "rs.h" + +// process_record_user is like process_record_user for keymaps including this file. +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +// rgb_mod_changed_keymap is called any time the RGB mod has been changed. +__attribute__ ((weak)) +void rgb_mod_changed_keymap(void) { +} + +// keylog_set_keymap is called for every key press. +__attribute__ ((weak)) +void keylog_set_keymap(uint16_t keycode, keyrecord_t *record) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + keylog_set_keymap(keycode, record); + } + + switch (keycode) { + case NEQL: // != + if (record->event.pressed) { + SEND_STRING("!="); + } + return false; + case LPLT: // ( or < with shift + if (record->event.pressed) { + if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) { + // < + tap_code(KC_COMM); // shift is already registered + } else { + // ( + register_mods(MOD_BIT(KC_LSFT)); + tap_code(KC_9); + unregister_mods(MOD_BIT(KC_LSFT)); + } + } + return false; + case RPGT: // ) or > with shift + if (record->event.pressed) { + if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) { + // < + tap_code(KC_DOT); // shift is already registered + } else { + // ) + register_mods(MOD_BIT(KC_LSFT)); + tap_code(KC_0); + unregister_mods(MOD_BIT(KC_LSFT)); + } + } + return false; +#ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_step(); + rgb_mod_changed_keymap(); + } + return false; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + rgb_mod_changed_keymap(); + } + return false; +#endif + } + return process_record_keymap(keycode, record); +} \ No newline at end of file diff --git a/users/rs/rs.h b/users/rs/rs.h new file mode 100644 index 00000000000..722d6ed19e3 --- /dev/null +++ b/users/rs/rs.h @@ -0,0 +1,50 @@ +#pragma once +#include "quantum.h" + +enum layers { + _QWERTY, + _CODE, + _FN, +}; + +enum custom_keycodes { + CODE = SAFE_RANGE, + FN, + LPLT, + RPGT, + NEQL, +#ifdef RGBLIGHT_ENABLE + RGBRST, +#endif +}; + +#define KC_ KC_TRNS + +#define KC_ESCC MT(MOD_LCTL, KC_ESC) +#define KC_ENTS MT(MOD_LSFT, KC_ENT) +#define KC_LTGT LTGT // > or < with shift +#define KC_LPLT LPLT // ( or < with shift +#define KC_RPGT RPGT // ) or > with shift +#define KC_NEQL NEQL // != +#define KC_CODE MO(_CODE) +#define KC_BCOD LT(_CODE, KC_BSPC) +#define KC_FN MO(_FN) +#define KC_RST RESET +#define KC_CTRA LCTL(KC_A) +#define KC_CTRE LCTL(KC_E) +#define KC_BLTG BL_TOGG +#define KC_BLUP BL_INC +#define KC_BLDN BL_DEC +#define KC_BLBR BL_BRTG + +#ifdef RGBLIGHT_ENABLE +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD +#endif \ No newline at end of file diff --git a/users/rs/rules.mk b/users/rs/rules.mk new file mode 100644 index 00000000000..edb5be0f5bb --- /dev/null +++ b/users/rs/rules.mk @@ -0,0 +1 @@ +SRC += rs.c \ No newline at end of file From 12e6d412023b23c64980d30704ae11892e33c512 Mon Sep 17 00:00:00 2001 From: Rainer Clasen Date: Tue, 7 May 2019 19:45:10 +0200 Subject: [PATCH 116/129] [Split] fix split_common i2c backlight disabling (#3886) slave backlight was always on - as get_backlight_level() doesn't indicate if the backlight is enabled or not. also updated the corosponding code for serial transport to stop peeking directly at 'internal' backlight_config structure. --- quantum/split_common/transport.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 7ea1a9cec9f..a3539576f51 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -13,7 +13,6 @@ #ifdef BACKLIGHT_ENABLE # include "backlight.h" -extern backlight_config_t backlight_config; #endif #ifdef ENCODER_ENABLE @@ -55,7 +54,7 @@ bool transport_master(matrix_row_t matrix[]) { // write backlight info # ifdef BACKLIGHT_ENABLE - uint8_t level = get_backlight_level(); + uint8_t level = is_backlight_enabled() ? get_backlight_level() : 0; if (level != i2c_buffer->backlight_level) { if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_BACKLIGHT_START, (void *)&level, sizeof(level), TIMEOUT) >= 0) { i2c_buffer->backlight_level = level; @@ -223,7 +222,7 @@ bool transport_master(matrix_row_t matrix[]) { # ifdef BACKLIGHT_ENABLE // Write backlight level for slave to read - serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; + serial_m2s_buffer.backlight_level = is_backlight_enabled() ? get_backlight_level() : 0; # endif # ifdef ENCODER_ENABLE From c7f8548d9af2045996294602d2a4bd9a214ae23c Mon Sep 17 00:00:00 2001 From: Chuck Lauer Vose Date: Tue, 7 May 2019 14:43:00 -0700 Subject: [PATCH 117/129] Add layout description to keymap.c (#5810) --- .../keebio/bdn9/keymaps/default/keymap.c | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/keyboards/keebio/bdn9/keymaps/default/keymap.c b/keyboards/keebio/bdn9/keymaps/default/keymap.c index 3bab86ae546..c700019dc06 100644 --- a/keyboards/keebio/bdn9/keymaps/default/keymap.c +++ b/keyboards/keebio/bdn9/keymaps/default/keymap.c @@ -16,15 +16,26 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + | Knob 1: Vol Dn/Up | | Knob 2: Page Dn/Up | + | Press: Mute | Home | Press: Play/Pause | + | Hold: Layer 2 | Up | RGB Mode | + | Left | Down | Right | + */ [0] = LAYOUT( - KC_MUTE, KC_HOME, KC_MPLY, \ - MO(1), KC_UP, RGB_MOD, \ - KC_LEFT, KC_DOWN, KC_RGHT \ + KC_MUTE, KC_HOME, KC_MPLY, + MO(1) , KC_UP , RGB_MOD, + KC_LEFT, KC_DOWN, KC_RGHT ), + /* + | RESET | N/A | Media Stop | + | Held: Layer 2 | Home | RGB Mode | + | Media Previous | End | Media Next | + */ [1] = LAYOUT( - RESET, BL_STEP, KC_STOP, \ - _______, KC_HOME, RGB_MOD, \ - KC_MPRV, KC_END, KC_MNXT \ + RESET , BL_STEP, KC_STOP, + _______, KC_HOME, RGB_MOD, + KC_MPRV, KC_END , KC_MNXT ), }; From af89752bffbaf5dcea30ea16be66b4d682701bc4 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 7 May 2019 18:22:46 -0500 Subject: [PATCH 118/129] rgb_led struct conversion (aka: Per led (key) type rgb matrix effects - part 2) (#5783) * Initial conversion of the rgb_led struct * Converting last keyboard & updating effects to take advantage of the new structure * New struct should not be const * Updated docs * Changing define ___ for no led to NO_LED * Missed converting some keymap usages of the old struct layout --- docs/feature_rgb_matrix.md | 32 +- keyboards/boston_meetup/2019/2019.c | 38 +- keyboards/crkbd/rev1/rev1.c | 125 +++--- keyboards/doro67/rgb/rgb.c | 103 ++--- keyboards/dztech/dz40rgb/dz40rgb.c | 163 ++----- .../dztech/dz40rgb/keymaps/default/keymap.c | 6 +- .../dz40rgb/keymaps/split_space/keymap.c | 6 +- keyboards/dztech/dz60rgb/dz60rgb.c | 419 +++++------------- .../dztech/dz60rgb/keymaps/ansi/keymap.c | 5 +- .../dztech/dz60rgb/keymaps/hhkb/keymap.c | 5 +- .../dztech/dz60rgb/keymaps/hhkb_iso/keymap.c | 5 +- keyboards/dztech/dz60rgb/keymaps/iso/keymap.c | 5 +- .../dztech/dz60rgb/keymaps/mekanist/keymap.c | 30 +- keyboards/dztech/dz65rgb/dz65rgb.c | 90 +--- keyboards/ergodox_ez/ergodox_ez.c | 97 ++-- keyboards/exclusive/e6_rgb/e6_rgb.c | 130 +++--- keyboards/hadron/ver3/ver3.c | 43 +- keyboards/hs60/v1/v1.c | 218 +++------ keyboards/massdrop/alt/config_led.c | 143 ++---- keyboards/massdrop/ctrl/config_led.c | 180 +++----- keyboards/model01/leds.c | 95 ++-- keyboards/planck/ez/ez.c | 76 +--- keyboards/planck/keymaps/tom/keymap.c | 11 +- keyboards/planck/light/light.c | 87 ++-- keyboards/sol/rev1/rev1.c | 115 ++--- keyboards/sol/sol.c | 19 - layouts/community/ergodox/drashna/keymap.c | 7 +- layouts/community/ortho_4x12/drashna/keymap.c | 5 +- quantum/rgb_matrix.c | 16 +- quantum/rgb_matrix.h | 4 +- .../rgb_matrix_animations/alpha_mods_anim.h | 4 +- .../rgb_matrix_animations/cycle_all_anim.h | 2 +- .../cycle_left_right_anim.h | 5 +- .../cycle_up_down_anim.h | 5 +- .../rgb_matrix_animations/dual_beacon_anim.h | 5 +- .../gradient_up_down_anim.h | 5 +- .../jellybean_raindrops_anim.h | 4 +- .../rainbow_beacon_anim.h | 5 +- .../rainbow_moving_chevron_anim.h | 5 +- .../rainbow_pinwheels_anim.h | 5 +- .../rgb_matrix_animations/raindrops_anim.h | 3 +- .../rgb_matrix_animations/solid_color_anim.h | 1 + .../solid_reactive_anim.h | 1 + .../solid_reactive_cross.h | 7 +- .../solid_reactive_nexus.h | 7 +- .../solid_reactive_simple_anim.h | 1 + .../solid_reactive_wide.h | 7 +- .../rgb_matrix_animations/solid_splash_anim.h | 7 +- quantum/rgb_matrix_animations/splash_anim.h | 7 +- quantum/rgb_matrix_types.h | 18 +- tmk_core/protocol/arm_atsam/led_matrix.c | 9 +- 51 files changed, 751 insertions(+), 1640 deletions(-) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 91ec77ace08..5eb9d5536e1 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -124,21 +124,25 @@ Configure the hardware via your `config.h`: --- -From this point forward the configuration is the same for all the drivers. The struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example: +From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example: ```C -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, - .... -} +const led_config_t g_led_config = { { + // Key Matrix to LED Index + { 5, NO_LED, NO_LED, 0 }, + { NO_LED, NO_LED, NO_LED, NO_LED }, + { 4, NO_LED, NO_LED, 1 }, + { 3, NO_LED, NO_LED, 2 } +}, { + // LED Index to Physical Position + { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 } +}, { + // LED Index to Flag + 1, 4, 4, 4, 4, 1 +} }; ``` -The first part, `{row | col << 4}`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `{x=0..224, y=0..64}` represents the LED's physical position on the keyboard. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64 as the effects are based on this range. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position: +The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical position on the keyboard. The first value, `x`, is between 0-224 (inclusive), and the second value, `y`, is between 0-64 (inclusive). This range is due to effect that calculate the center or halves for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position: ```C x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION @@ -147,7 +151,7 @@ y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. -`flags` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. +`// LED Index to Flag` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. ## Flags @@ -155,8 +159,8 @@ Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based |------------------------------------|-------------------------------------------| |`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.| |`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.| -|`#define LED_FLAG_NONE 0x00` |If thes LED has no flags. | -|`#define LED_FLAG_ALL 0xFF` |If thes LED has all flags. | +|`#define LED_FLAG_NONE 0x00` |If this LED has no flags. | +|`#define LED_FLAG_ALL 0xFF` |If this LED has all flags. | |`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. | |`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. | |`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. | diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c index 45c18554915..933c14dee4f 100644 --- a/keyboards/boston_meetup/2019/2019.c +++ b/keyboards/boston_meetup/2019/2019.c @@ -19,20 +19,18 @@ #include "haptic.h" #ifdef RGB_MATRIX_ENABLE -#include "rgblight.h" +#include "rgb_matrix.h" -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /*{row | col << 4} - | {x=0..224, y=0..64} - | | modifier - | | | */ - {{1|(3<<4)}, {188, 16}, 4}, - {{3|(3<<4)}, {187, 48}, 4}, - {{4|(2<<4)}, {149, 64}, 4}, - {{4|(1<<4)}, {112, 64}, 4}, - {{3|(0<<4)}, {37, 48}, 4}, - {{1|(0<<4)}, {38, 16}, 4} -}; +led_config_t g_led_config = { { + { 5, NO_LED, NO_LED, 0 }, + { NO_LED, NO_LED, NO_LED, NO_LED }, + { 4, NO_LED, NO_LED, 1 }, + { 3, NO_LED, NO_LED, 2 } +}, { + { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 } +}, { + 4, 4, 4, 4, 4, 4 +} }; #endif uint8_t *o_fb; @@ -48,12 +46,12 @@ uint16_t counterst = 0; #define ScreenOffInterval 60000 /* milliseconds */ static uint16_t last_flush; -volatile uint8_t led_numlock = false; -volatile uint8_t led_capslock = false; +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; volatile uint8_t led_scrolllock = false; static uint8_t layer; -static bool queue_for_send = false; +static bool queue_for_send = false; static uint8_t encoder_value = 32; __attribute__ ((weak)) @@ -64,13 +62,13 @@ void draw_ui(void) { /* Boston MK title is 55 x 10 pixels */ #define NAME_X 0 -#define NAME_Y 0 +#define NAME_Y 0 draw_string(NAME_X + 1, NAME_Y + 2, "BOSTON MK", PIXEL_ON, NORM, 0); /* Layer indicator is 41 x 10 pixels */ #define LAYER_INDICATOR_X 60 -#define LAYER_INDICATOR_Y 0 +#define LAYER_INDICATOR_Y 0 draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); @@ -88,7 +86,7 @@ void draw_ui(void) { draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM); } - } + } draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 12, 12, PIXEL_ON, NORM); /* hadron oled location on thumbnail */ draw_rect_filled_soft(MATRIX_DISPLAY_X + 5, MATRIX_DISPLAY_Y + 2, 6, 2, PIXEL_ON, NORM); @@ -195,7 +193,7 @@ void matrix_init_kb(void) { queue_for_send = true; matrix_init_user(); } - + void matrix_scan_kb(void) { if (queue_for_send) { #ifdef QWIIC_MICRO_OLED_ENABLE diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c index 2345028d2c9..38ab927881e 100644 --- a/keyboards/crkbd/rev1/rev1.c +++ b/keyboards/crkbd/rev1/rev1.c @@ -51,78 +51,65 @@ void led_set_kb(uint8_t usb_led) { // 05 06 06 05 // 15 14 07 07 14 15 3 -/* {row | col << 4} logical layout rows/cols - * | {x=0..224, y=0..64} physical layout - * | | | modifier - * | | | */ -#define RGB_MATRIX_LEFT_LEDS \ - { { 0xFF }, { 85, 16 }, 2 }, /* 1 */ \ - { { 0xFF }, { 50, 13 }, 2 }, /* 2 */ \ - { { 0xFF }, { 16, 20 }, 2 }, /* 3 */ \ - { { 0xFF }, { 16, 38 }, 2 }, /* 4 */ \ - { { 0xFF }, { 50, 48 }, 2 }, /* 5 */ \ - { { 0xFF }, { 85, 52 }, 2 }, /* 6 */ \ - { { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, /* 7 */ \ - { { 2 | ( 5 << 4 ) }, { 85, 39 }, 4 }, /* 8 */ \ - { { 1 | ( 5 << 4 ) }, { 85, 21 }, 4 }, /* 9 */ \ - { { 0 | ( 5 << 4 ) }, { 85, 4 }, 4 }, /* 10 */ \ - { { 0 | ( 4 << 4 ) }, { 68, 02 }, 4 }, /* 11 */ \ - { { 1 | ( 4 << 4 ) }, { 68, 19 }, 4 }, /* 12 */ \ - { { 2 | ( 4 << 4 ) }, { 68, 37 }, 4 }, /* 13 */ \ - { { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, /* 14 */ \ - { { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, /* 15 */ \ - { { 2 | ( 3 << 4 ) }, { 50, 35 }, 4 }, /* 16 */ \ - { { 1 | ( 3 << 4 ) }, { 50, 13 }, 4 }, /* 17 */ \ - { { 0 | ( 3 << 4 ) }, { 50, 0 }, 4 }, /* 18 */ \ - { { 0 | ( 2 << 4 ) }, { 33, 3 }, 4 }, /* 19 */ \ - { { 1 | ( 2 << 4 ) }, { 33, 20 }, 4 }, /* 20 */ \ - { { 2 | ( 2 << 4 ) }, { 33, 37 }, 4 }, /* 21 */ \ - { { 2 | ( 1 << 4 ) }, { 16, 42 }, 4 }, /* 22 */ \ - { { 1 | ( 1 << 4 ) }, { 16, 24 }, 4 }, /* 23 */ \ - { { 0 | ( 1 << 4 ) }, { 16, 7 }, 4 }, /* 24 */ \ - { { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, /* 25 */ \ - { { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, /* 26 */ \ - { { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, /* 27 */ - -#define RGB_MATRIX_RIGHT_LEDS \ - { { 0xFF }, { 139, 16 }, 2 }, /* 1 */ \ - { { 0xFF }, { 174, 13 }, 2 }, /* 2 */ \ - { { 0xFF }, { 208, 20 }, 2 }, /* 3 */ \ - { { 0xFF }, { 208, 38 }, 2 }, /* 4 */ \ - { { 0xFF }, { 174, 48 }, 2 }, /* 5 */ \ - { { 0xFF }, { 139, 52 }, 2 }, /* 6 */ \ - { { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, /* 7 */ \ - { { 6 | ( 5 << 4 ) }, { 139, 39 }, 4 }, /* 8 */ \ - { { 5 | ( 5 << 4 ) }, { 139, 21 }, 4 }, /* 9 */ \ - { { 4 | ( 5 << 4 ) }, { 139, 4 }, 4 }, /* 10 */ \ - { { 4 | ( 4 << 4 ) }, { 156, 02 }, 4 }, /* 11 */ \ - { { 5 | ( 4 << 4 ) }, { 156, 19 }, 4 }, /* 12 */ \ - { { 6 | ( 4 << 4 ) }, { 156, 37 }, 4 }, /* 13 */ \ - { { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, /* 14 */ \ - { { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, /* 15 */ \ - { { 6 | ( 3 << 4 ) }, { 174, 35 }, 4 }, /* 16 */ \ - { { 5 | ( 3 << 4 ) }, { 174, 13 }, 4 }, /* 17 */ \ - { { 4 | ( 3 << 4 ) }, { 174, 0 }, 4 }, /* 18 */ \ - { { 4 | ( 2 << 4 ) }, { 191, 3 }, 4 }, /* 19 */ \ - { { 5 | ( 2 << 4 ) }, { 191, 20 }, 4 }, /* 20 */ \ - { { 6 | ( 2 << 4 ) }, { 191, 37 }, 4 }, /* 21 */ \ - { { 6 | ( 1 << 4 ) }, { 208, 42 }, 4 }, /* 22 */ \ - { { 5 | ( 1 << 4 ) }, { 208, 24 }, 4 }, /* 23 */ \ - { { 4 | ( 1 << 4 ) }, { 208, 7 }, 4 }, /* 24 */ \ - { { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, /* 25 */ \ - { { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, /* 26 */ \ - { { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, /* 27 */ #ifdef RGB_MATRIX_SPLIT_RIGHT -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - RGB_MATRIX_RIGHT_LEDS - RGB_MATRIX_LEFT_LEDS - }; +led_config_t g_led_config = { { + { 51, 50, 45, 44, 37, 36, NO_LED }, + { 52, 49, 46, 43, 38, 35, NO_LED }, + { 53, 48, 47, 42, 39, 34, NO_LED }, + { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED }, + { 24, 23, 18, 17, 10, 9, NO_LED }, + { 25, 22, 19, 16, 11, 8, NO_LED }, + { 26, 21, 20, 15, 12, 7, NO_LED }, + { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED } +}, { + { 139, 16 }, { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 }, + { 139, 39 }, { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 }, + { 164, 55 }, { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 }, + { 208, 42 }, { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 }, { 85, 16 }, + { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 }, { 85, 39 }, + { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 }, { 60, 55 }, + { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 }, { 16, 42 }, + { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 } +}, { + 2, 2, 2, 2, 2, 2, 1, + 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 4, + 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1 +} }; #else -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - RGB_MATRIX_LEFT_LEDS - RGB_MATRIX_RIGHT_LEDS - }; +led_config_t g_led_config = { { + { 24, 23, 18, 17, 10, 9, NO_LED }, + { 25, 22, 19, 16, 11, 8, NO_LED }, + { 26, 21, 20, 15, 12, 7, NO_LED }, + { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED }, + { 51, 50, 45, 44, 37, 36, NO_LED }, + { 52, 49, 46, 43, 38, 35, NO_LED }, + { 53, 48, 47, 42, 39, 34, NO_LED }, + { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED } +}, { + { 85, 16 }, { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 }, + { 85, 39 }, { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 }, + { 60, 55 }, { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 }, + { 16, 42 }, { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 }, { 139, 16 }, + { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 }, { 139, 39 }, + { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 }, { 164, 55 }, + { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 }, { 208, 42 }, + { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 } +}, { + 2, 2, 2, 2, 2, 2, 1, + 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 4, + 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1 +} }; #endif #endif diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c index 8aaf6ef4ad3..e8c9ac63216 100644 --- a/keyboards/doro67/rgb/rgb.c +++ b/keyboards/doro67/rgb/rgb.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ #include "rgb.h" +#include "rgb_matrix_types.h" // Optional override functions below. // You can leave any or all of these undefined. @@ -52,76 +53,32 @@ void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(0<<4)}, {15*0, 0}, 4}, // Esc - {{0|(1<<4)}, {15*1, 0}, 4}, // 1 - {{0|(2<<4)}, {15*2, 0}, 4}, // 2 - {{0|(3<<4)}, {15*3, 0}, 4}, // 3 - {{0|(4<<4)}, {15*4, 0}, 4}, // 4 - {{0|(5<<4)}, {15*5, 0}, 4}, // 5 - {{0|(6<<4)}, {15*6, 0}, 4}, // 6 - {{0|(7<<4)}, {15*7, 0}, 4}, // 7 - {{0|(8<<4)}, {15*8, 0}, 4}, // 8 - {{0|(9<<4)}, {15*9, 0}, 4}, // 9 - {{0|(10<<4)}, {15*10, 0}, 4}, // 0 - {{0|(11<<4)}, {15*11, 0}, 4}, // - - {{0|(12<<4)}, {15*12, 0}, 4}, // = - {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace - {{0|(14<<4)}, {15*15, 0}, 1}, // Ins - - {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab - {{1|(1<<4)}, {15*1.5, 16}, 4}, // Q - {{1|(2<<4)}, {15*2.5, 16}, 4}, // W - {{1|(3<<4)}, {15*3.5, 16}, 4}, // E - {{1|(4<<4)}, {15*4.5, 16}, 4}, // R - {{1|(5<<4)}, {15*5.5, 16}, 4}, // T - {{1|(6<<4)}, {15*6.5, 16}, 4}, // Y - {{1|(7<<4)}, {15*7.5, 16}, 4}, // U - {{1|(8<<4)}, {15*8.5, 16}, 4}, // I - {{1|(9<<4)}, {15*9.5, 16}, 4}, // O - {{1|(10<<4)}, {15*10.5, 16}, 4}, // P - {{1|(11<<4)}, {15*11.5, 16}, 4}, // [ - {{1|(12<<4)}, {15*12.5, 16}, 4}, // ] - {{1|(13<<4)}, {15*13.75, 16}, 1}, // - {{1|(14<<4)}, {15*15, 16}, 1}, // Del - - {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock - {{2|(1<<4)}, {15*1.75, 32}, 4}, // A - {{2|(2<<4)}, {15*2.75, 32}, 4}, // S - {{2|(3<<4)}, {15*3.75, 32}, 4}, // D - {{2|(4<<4)}, {15*4.75, 32}, 4}, // F - {{2|(5<<4)}, {15*5.75, 32}, 4}, // G - {{2|(6<<4)}, {15*6.75, 32}, 4}, // H - {{2|(7<<4)}, {15*7.75, 32}, 4}, // J - {{2|(8<<4)}, {15*8.75, 32}, 4}, // K - {{2|(9<<4)}, {15*9.75, 32}, 4}, // L - {{2|(10<<4)}, {15*10.75, 32}, 4}, // ; - {{2|(11<<4)}, {15*11.75, 32}, 4}, // ' - {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter - {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup - - {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift - {{3|(2<<4)}, {15*2, 48}, 4}, // Z - {{3|(3<<4)}, {15*3, 48}, 4}, // X - {{3|(4<<4)}, {15*4, 48}, 4}, // C - {{3|(5<<4)}, {15*5, 48}, 4}, // V - {{3|(6<<4)}, {15*6, 48}, 4}, // B - {{3|(7<<4)}, {15*7, 48}, 4}, // N - {{3|(8<<4)}, {15*8, 48}, 4}, // M - {{3|(9<<4)}, {15*9, 48}, 4}, // , - {{3|(10<<4)}, {15*10, 48}, 4}, // . - {{3|(11<<4)}, {15*11, 48}, 4}, // / - {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift - {{3|(13<<4)}, {15*14, 48}, 1}, // Up - {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn - - {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl - {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI - {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt - {{4|(3<<4)}, {15*6.75, 64}, 4}, // Space - {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt - {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN - {{4|(12<<4)}, {15*13, 64}, 1}, // Left - {{4|(13<<4)}, {15*14, 64}, 1}, // Down - {{4|(14<<4)}, {15*15, 64}, 1}, // Right -}; +led_config_t g_led_config = { { + { 0, 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, NO_LED, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, + { 58, 59, 60, 61, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 62, 63, NO_LED, 64, 65, 66 } +}, { + // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins + { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 202, 0 }, { 225, 0 }, + // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del + { 7, 16 }, { 22, 16 }, { 37, 16 }, { 52, 16 }, { 67, 16 }, { 82, 16 }, { 97, 16 }, { 112, 16 }, { 127, 16 }, { 142, 16 }, { 157, 16 }, { 172, 16 }, { 187, 16 }, { 206, 16 }, { 225, 16 }, + // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup + { 11, 32 }, { 26, 32 }, { 41, 32 }, { 56, 32 }, { 71, 32 }, { 86, 32 }, { 101, 32 }, { 116, 32 }, { 131, 32 }, { 146, 32 }, { 161, 32 }, { 176, 32 }, { 198, 32 }, { 225, 32 }, + // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn + { 18, 48 }, { 30, 48 }, { 45, 48 }, { 60, 48 }, { 75, 48 }, { 90, 48 }, { 105, 48 }, { 120, 48 }, { 135, 48 }, { 150, 48 }, { 165, 48 }, { 191, 48 }, { 210, 48 }, { 225, 48 }, + // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right + { 3, 64 }, { 22, 64 }, { 33, 64 }, { 101, 64 }, { 135, 64 }, { 153, 64 }, { 195, 64 }, { 210, 64 }, { 225, 64 } +}, { + // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right + 1, 1, 1, 4, 1, 1, 1, 1, 1 +} }; diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c index 34bfc4366f3..e5e39c92aba 100644 --- a/keyboards/dztech/dz40rgb/dz40rgb.c +++ b/keyboards/dztech/dz40rgb/dz40rgb.c @@ -52,7 +52,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_3, D_3, F_3}, {0, E_2, D_2, F_2}, {0, E_1, D_1, F_1}, - + {0, E_13, D_13, F_13}, {0, E_14, D_14, F_14}, @@ -71,70 +71,25 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28 }, + { 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42 } +}, { + { 223, 0 }, { 203, 0 }, { 183, 0 }, { 162, 0 }, { 142, 0 }, { 122, 0 }, { 101, 0 }, { 81, 0 }, { 61, 0 }, { 40, 0 }, { 20, 0 }, { 0, 0 }, + { 223, 10 }, { 0, 10 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, + { 20, 21 }, { 0, 21 }, { 223, 31 }, { 0, 31 }, { 223, 42 }, { 203, 42 }, { 183, 42 }, { 162, 42 }, { 142, 42 }, { 122, 42 }, { 101, 42 }, { 81, 42 }, + { 61, 42 }, { 40, 42 }, { 20, 42 }, { 0, 42 }, { 223, 53 }, { 0, 53 }, { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 122, 63 }, + { 101, 63 }, { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1 +} }; - {{0|(11<<4)}, {20.36*11, 0}, 1}, - {{0|(10<<4)}, {20.36*10, 0}, 1}, - {{0|(9<<4)}, {20.36*9, 0}, 1}, - {{0|(8<<4)}, {20.36*8, 0}, 1}, - {{0|(7<<4)}, {20.36*7, 0}, 1}, - {{0|(6<<4)}, { 20.36*6, 0}, 1}, - {{0|(5<<4)}, { 20.36*5, 0}, 1}, - {{0|(4<<4)}, { 20.36*4, 0}, 1}, - {{0|(3<<4)}, { 20.36*3, 0}, 1}, - {{0|(2<<4)}, { 20.36*2, 0}, 1}, - {{0|(1<<4)}, { 20.36*1, 0}, 1}, - {{0|(0<<4)}, { 20.36*0, 0}, 1}, - - {{0|(12<<4)}, {20.36*11, 21.33*0.5}, 1}, - {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, - - {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 4}, - {{1|(9<<4)}, {20.36*9, 21.33}, 4}, - {{1|(8<<4)}, {20.36*8, 21.33}, 4}, - {{1|(7<<4)}, {20.36*7, 21.33}, 4}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, - {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, - - {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, - {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, - - {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, - {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, - - {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, - {{2|(13<<4)}, {20.36*0,21.33*2.5}, 1}, - - {{3|(11<<4)}, {20.36*11, 21.33*3}, 1}, - {{3|(10<<4)}, {20.36*10, 21.33*3}, 1}, - {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, - {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, - {{3|(6<<4)}, { 20.36*6, 21.33*3}, 1}, - {{3|(5<<4)}, { 20.36*5, 21.33*3}, 1}, - {{3|(4<<4)}, { 20.36*4, 21.33*3}, 1}, - {{3|(3<<4)}, { 20.36*3, 21.33*3}, 1}, - {{3|(2<<4)}, { 20.36*2, 21.33*3}, 1}, - {{3|(1<<4)}, { 20.36*1, 21.33*3}, 1}, - {{3|(0<<4)}, { 20.36*0, 21.33*3}, 1} - -}; #else const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations @@ -205,69 +160,25 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28 }, + { 52, 51, 50, 49, 48, NO_LED, 47, 46, 45, 44, 43, 42 } +}, { + { 223, 0 }, { 203, 0 }, { 183, 0 }, { 162, 0 }, { 142, 0 }, { 122, 0 }, { 101, 0 }, { 81, 0 }, { 61, 0 }, { 40, 0 }, { 20, 0 }, { 0, 0 }, + { 223, 10 }, { 0, 10 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, + { 20, 21 }, { 0, 21 }, { 223, 31 }, { 0, 31 }, { 223, 42 }, { 203, 42 }, { 183, 42 }, { 162, 42 }, { 142, 42 }, { 122, 42 }, { 101, 42 }, { 81, 42 }, + { 61, 42 }, { 40, 42 }, { 20, 42 }, { 0, 42 }, { 223, 53 }, { 0, 53 }, { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 111, 63 }, + { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 +} }; - {{0|(11<<4)}, {20.36*11, 0}, 1}, - {{0|(10<<4)}, {20.36*10, 0}, 1}, - {{0|(9<<4)}, {20.36*9, 0}, 1}, - {{0|(8<<4)}, {20.36*8, 0}, 1}, - {{0|(7<<4)}, {20.36*7, 0}, 1}, - {{0|(6<<4)}, { 20.36*6, 0}, 1}, - {{0|(5<<4)}, { 20.36*5, 0}, 1}, - {{0|(4<<4)}, { 20.36*4, 0}, 1}, - {{0|(3<<4)}, { 20.36*3, 0}, 1}, - {{0|(2<<4)}, { 20.36*2, 0}, 1}, - {{0|(1<<4)}, { 20.36*1, 0}, 1}, - {{0|(0<<4)}, { 20.36*0, 0}, 1}, - - {{0|(12<<4)}, {20.36*11, 21.33*0.5}, 1}, - {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, - - {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 4}, - {{1|(9<<4)}, {20.36*9, 21.33}, 4}, - {{1|(8<<4)}, {20.36*8, 21.33}, 4}, - {{1|(7<<4)}, {20.36*7, 21.33}, 4}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, - {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, - - {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, - {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, - - {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, - {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, - - {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, - {{2|(13<<4)}, {20.36*0,21.33*2.5}, 1}, - - {{3|(11<<4)}, {20.36*11, 21.33*3}, 1}, - {{3|(10<<4)}, {20.36*10, 21.33*3}, 1}, - {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, - {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, - {{3|(6<<4)}, { 20.36*5.5, 21.33*3}, 1}, - {{3|(4<<4)}, { 20.36*4, 21.33*3}, 1}, - {{3|(3<<4)}, { 20.36*3, 21.33*3}, 1}, - {{3|(2<<4)}, { 20.36*2, 21.33*3}, 1}, - {{3|(1<<4)}, { 20.36*1, 21.33*3}, 1}, - {{3|(0<<4)}, { 20.36*0, 21.33*3}, 1} - -}; #endif diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c index 59b917121c6..650c178a7e0 100644 --- a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c @@ -31,11 +31,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; + +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c index 5613e350003..80741b19c43 100644 --- a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c @@ -53,12 +53,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/dz60rgb.c b/keyboards/dztech/dz60rgb/dz60rgb.c index 10b2ea7a83d..28ac7ce9e25 100644 --- a/keyboards/dztech/dz60rgb/dz60rgb.c +++ b/keyboards/dztech/dz60rgb/dz60rgb.c @@ -65,69 +65,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(13<<4)}, {16*13.5, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.875, 64}, 1}, - {{4|(11<<4)}, {16*12.625, 64}, 1}, - {{4|(10<<4)}, {16*11.375, 64}, 1}, - {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 4}, - {{4|(2<<4)}, { 16*2.625, 64}, 1}, - {{4|(1<<4)}, { 16*1.375, 64}, 1}, - {{4|(0<<4)}, { 16*0.125, 64}, 1}, -}; +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 28 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 14 }, + { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, NO_LED }, + { 60, 59, 58, NO_LED, NO_LED, 57, NO_LED, NO_LED, NO_LED, 56, 55, 54, NO_LED, 53 } +}, { + { 216, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, 0 }, + { 220, 24 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, + { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 210, 48 }, + { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 222, 64 }, { 202, 64 }, { 182, 64 }, + { 162, 64 }, { 102, 64 }, { 42, 64 }, { 22, 64 }, { 2, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, + 1, 4, 1, 1, 1 +} }; + #elif defined (dzrgb60_hhkb) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_15, G_15, I_15}, @@ -194,70 +151,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{2|(12<<4)}, {16*14, 0}, 1}, - {{0|(13<<4)}, {16*13, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{2|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 4}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.625, 64}, 1}, - {{4|(11<<4)}, {16*12.375, 64}, 1}, - {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 4}, - {{4|(2<<4)}, { 16*2.875, 64}, 1}, - {{4|(1<<4)}, { 16*1.625, 64}, 1}, - {{4|(0<<4)}, { 16*0.375, 64}, 1}, -}; +led_config_t g_led_config = { { + { 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, + { 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15 }, + { 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 0, 29 }, + { 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, NO_LED, 42 }, + { 61, 60, 59, NO_LED, NO_LED, 58, NO_LED, NO_LED, NO_LED, NO_LED, 57, 56, NO_LED, 55 } +}, { + { 224, 0 }, { 208, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, + { 0, 0 }, { 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, + { 4, 16 }, { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, + { 224, 48 }, { 202, 48 }, { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 218, 64 }, + { 198, 64 }, { 178, 64 }, { 112, 64 }, { 46, 64 }, { 26, 64 }, { 6, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 1, 1, 1 +} }; + #elif defined (dzrgb60_hhkb_iso) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_15, G_15, I_15}, @@ -324,70 +237,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{2|(12<<4)}, {16*14, 0}, 1}, - {{0|(13<<4)}, {16*13, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 4}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.625, 64}, 1}, - {{4|(11<<4)}, {16*12.375, 64}, 1}, - {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 4}, - {{4|(2<<4)}, { 16*2.875, 64}, 1}, - {{4|(1<<4)}, { 16*1.625, 64}, 1}, - {{4|(0<<4)}, { 16*0.375, 64}, 1}, -}; +led_config_t g_led_config = { { + { 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, + { 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29 }, + { 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 0, 15 }, + { 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, NO_LED, 42 }, + { 61, 60, 59, NO_LED, NO_LED, 58, NO_LED, NO_LED, NO_LED, NO_LED, 57, 56, NO_LED, 55 } +}, { + { 224, 0 }, { 208, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, + { 0, 0 }, { 220, 24 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, + { 4, 16 }, { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, + { 224, 48 }, { 202, 48 }, { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 218, 64 }, + { 198, 64 }, { 178, 64 }, { 112, 64 }, { 46, 64 }, { 26, 64 }, { 6, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 1, 1, 1 +} }; + #elif defined (dzrgb60_ansi) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_14, J_14, L_14}, @@ -453,69 +322,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(13<<4)}, {16*13.5, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{2|(13<<4)}, {16*13.375, 24}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.875, 64}, 1}, - {{4|(11<<4)}, {16*12.625, 64}, 1}, - {{4|(10<<4)}, {16*11.375, 64}, 1}, - {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 4}, - {{4|(2<<4)}, { 16*2.625, 64}, 1}, - {{4|(1<<4)}, { 16*1.375, 64}, 1}, - {{4|(0<<4)}, { 16*0.125, 64}, 1}, -}; +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 28 }, + { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, NO_LED }, + { 60, 59, 58, NO_LED, NO_LED, 57, NO_LED, NO_LED, NO_LED, 56, 55, 54, NO_LED, 53 } +}, { + { 216, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, 0 }, + { 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, + { 214, 24 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 210, 48 }, + { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 222, 64 }, { 202, 64 }, { 182, 64 }, + { 162, 64 }, { 102, 64 }, { 42, 64 }, { 22, 64 }, { 2, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, + 1, 4, 1, 1, 1 +} }; + #else const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_14, J_14, L_14}, @@ -583,71 +409,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(13<<4)}, {17.23*13, 0}, 1}, - {{0|(12<<4)}, {17.23*12, 0}, 1}, - {{0|(11<<4)}, {17.23*11, 0}, 1}, - {{0|(10<<4)}, {17.23*10, 0}, 1}, - {{0|(9<<4)}, {17.23*9, 0}, 1}, - {{0|(8<<4)}, {17.23*8, 0}, 1}, - {{0|(7<<4)}, {17.23*7, 0}, 1}, - {{0|(6<<4)}, { 17.23*6, 0}, 1}, - {{0|(5<<4)}, { 17.23*5, 0}, 1}, - {{0|(4<<4)}, { 17.23*4, 0}, 1}, - {{0|(3<<4)}, { 17.23*3, 0}, 1}, - {{0|(2<<4)}, { 17.23*2, 0}, 1}, - {{0|(1<<4)}, { 17.23*1, 0}, 1}, - {{0|(0<<4)}, { 17.23*0, 0}, 1}, - {{1|(13<<4)}, {17.23*13, 16}, 1}, - {{1|(12<<4)}, {17.23*12, 16}, 4}, - {{1|(11<<4)}, {17.23*11, 16}, 4}, - {{1|(10<<4)}, {17.23*10, 16}, 4}, - {{1|(9<<4)}, {17.23*9, 16}, 4}, - {{1|(8<<4)}, {17.23*8, 16}, 4}, - {{1|(7<<4)}, {17.23*7, 16}, 4}, - {{1|(6<<4)}, { 17.23*6, 16}, 4}, - {{1|(5<<4)}, { 17.23*5, 16}, 4}, - {{1|(4<<4)}, { 17.23*4, 16}, 4}, - {{1|(3<<4)}, { 17.23*3, 16}, 4}, - {{1|(2<<4)}, { 17.23*2, 16}, 4}, - {{1|(1<<4)}, { 17.23*1, 16}, 4}, - {{1|(0<<4)}, { 17.23*0, 16}, 1}, - {{2|(13<<4)}, {17.23*13, 32}, 1}, - {{2|(11<<4)}, {17.23*11, 32}, 4}, - {{2|(10<<4)}, {17.23*10, 32}, 4}, - {{2|(9<<4)}, {17.23*9, 32}, 4}, - {{2|(8<<4)}, {17.23*8, 32}, 4}, - {{2|(7<<4)}, {17.23*7, 32}, 4}, - {{2|(6<<4)}, { 17.23*6, 32}, 4}, - {{2|(5<<4)}, { 17.23*5, 32}, 4}, - {{2|(4<<4)}, { 17.23*4, 32}, 4}, - {{2|(3<<4)}, { 17.23*3, 32}, 4}, - {{2|(2<<4)}, { 17.23*2, 32}, 4}, - {{2|(1<<4)}, { 17.23*1, 32}, 4}, - {{2|(0<<4)}, { 17.23*0, 32}, 1}, - {{3|(13<<4)}, {17.23*13, 48}, 1}, - {{3|(11<<4)}, {17.23*11, 48}, 4}, - {{3|(10<<4)}, {17.23*10, 48}, 4}, - {{3|(9<<4)}, {17.23*9, 48}, 4}, - {{3|(8<<4)}, {17.23*8, 48}, 4}, - {{3|(7<<4)}, {17.23*7, 48}, 4}, - {{3|(6<<4)}, { 17.23*6, 48}, 4}, - {{3|(5<<4)}, { 17.23*5, 48}, 4}, - {{3|(4<<4)}, { 17.23*4, 48}, 4}, - {{3|(3<<4)}, { 17.23*3, 48}, 4}, - {{3|(2<<4)}, { 17.23*2, 48}, 4}, - {{3|(1<<4)}, { 17.23*1, 48}, 4}, - {{3|(0<<4)}, { 17.23*0, 48}, 1}, - {{4|(13<<4)}, {17.23*13, 64}, 1}, - {{4|(11<<4)}, {17.23*11, 64}, 1}, - {{4|(10<<4)}, {17.23*10, 64}, 1}, - {{4|(9<<4)}, {17.23*9, 64}, 1}, - {{4|(8<<4)}, {17.23*8, 64}, 1}, - {{4|(5<<4)}, { 17.23*5, 64}, 4}, - {{4|(2<<4)}, { 17.23*2, 64}, 1}, - {{4|(1<<4)}, { 17.23*1, 64}, 1}, - {{4|(0<<4)}, { 17.23*0, 64}, 1}, -}; +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 28 }, + { 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, NO_LED, 41 }, + { 62, 61, 60, NO_LED, NO_LED, 59, NO_LED, NO_LED, 58, 57, 56, 55, NO_LED, 54 } +}, { + { 223, 0 }, { 206, 0 }, { 189, 0 }, { 172, 0 }, { 155, 0 }, { 137, 0 }, { 120, 0 }, { 103, 0 }, { 86, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, + { 223, 16 }, { 206, 16 }, { 189, 16 }, { 172, 16 }, { 155, 16 }, { 137, 16 }, { 120, 16 }, { 103, 16 }, { 86, 16 }, { 68, 16 }, { 51, 16 }, { 34, 16 }, { 17, 16 }, { 0, 16 }, + { 223, 32 }, { 189, 32 }, { 172, 32 }, { 155, 32 }, { 137, 32 }, { 120, 32 }, { 103, 32 }, { 86, 32 }, { 68, 32 }, { 51, 32 }, { 34, 32 }, { 17, 32 }, { 0, 32 }, { 223, 48 }, + { 189, 48 }, { 172, 48 }, { 155, 48 }, { 137, 48 }, { 120, 48 }, { 103, 48 }, { 86, 48 }, { 68, 48 }, { 51, 48 }, { 34, 48 }, { 17, 48 }, { 0, 48 }, { 223, 64 }, { 189, 64 }, + { 172, 64 }, { 155, 64 }, { 137, 64 }, { 86, 64 }, { 34, 64 }, { 17, 64 }, { 0, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + 1, 1, 1, 4, 1, 1, 1 +} }; + #endif void matrix_init_kb(void) { diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c index 741fc55fb9e..584f035ef4c 100644 --- a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c @@ -38,11 +38,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c index 1f3807c3b7e..5a7a56801a3 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c @@ -39,11 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c index 4575eb19d58..34c1752ffa7 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c @@ -39,11 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS), }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c index 5e388480359..3a90d2f335d 100644 --- a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c @@ -38,11 +38,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index 3dfa7837444..a6d1e226bd6 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -50,40 +50,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool default_layer) -{ - rgb_led led; - - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { - rgb_matrix_set_color( i, red, green, blue ); - } - } +extern led_config_t g_led_config; +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } } void rgb_matrix_indicators_user(void) { uint8_t this_led = host_keyboard_leds(); - + if (!g_suspend_state) { switch (biton32(layer_state)) { case _LAYER1: rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; - + case _LAYER2: rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; - + case _LAYER4: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; } } - + if (this_led & (1 << USB_LED_CAPS_LOCK)) { rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); } - + switch (biton32(layer_state)) { case _LAYER3: if (this_led & (1 << USB_LED_NUM_LOCK)) { @@ -91,7 +87,7 @@ void rgb_matrix_indicators_user(void) } else { rgb_matrix_set_color(13, 0x00, 0x00, 0x00); } - + rgb_matrix_set_color(0, 0x00, 0xFF, 0x00); rgb_matrix_set_color(1, 0x00, 0x00, 0x00); rgb_matrix_set_color(1, 0x00, 0xFF, 0x00); diff --git a/keyboards/dztech/dz65rgb/dz65rgb.c b/keyboards/dztech/dz65rgb/dz65rgb.c index 78b345843c6..e14943d9745 100644 --- a/keyboards/dztech/dz65rgb/dz65rgb.c +++ b/keyboards/dztech/dz65rgb/dz65rgb.c @@ -73,76 +73,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15}, // LD16 {1, C8_16, C7_16, C6_16}, // LD17 }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{1|(7<<4)}, {16*7, 16}, 4}, - {{1|(6<<4)}, {16*6, 16}, 4}, - {{1|(5<<4)}, {16*5, 16}, 4}, - {{1|(4<<4)}, {16*4, 16}, 4}, - {{1|(3<<4)}, {16*3, 16}, 4}, - {{1|(2<<4)}, {16*2, 16}, 4}, - {{1|(1<<4)}, {16*1, 16}, 4}, - {{1|(0<<4)}, {16*0, 16}, 1}, - {{2|(0<<4)}, {16*0, 32}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(13<<4)}, {16*13, 0}, 1}, - {{0|(14<<4)}, {16*14, 0}, 1}, - {{1|(14<<4)}, {16*14, 16}, 1}, - {{2|(14<<4)}, {16*14, 32}, 1}, - {{1|(8<<4)}, {16*8, 16}, 4}, - {{1|(9<<4)}, {16*9, 16}, 4}, - {{1|(10<<4)}, {16*10, 16}, 4}, - {{1|(11<<4)}, {16*11, 16}, 4}, - {{1|(12<<4)}, {16*12, 16}, 4}, - {{1|(13<<4)}, {16*13, 16}, 4}, - {{3|(14<<4)}, {16*14, 48}, 1}, - {{4|(14<<4)}, {16*14, 64}, 1}, - {{4|(13<<4)}, {16*13, 64}, 1}, - {{4|(5<<4)}, {16*5, 64}, 1}, - {{3|(5<<4)}, {16*5, 48}, 4}, - {{3|(4<<4)}, {16*4, 48}, 4}, - {{3|(3<<4)}, {16*3, 48}, 4}, - {{3|(2<<4)}, {16*2, 48}, 4}, - {{3|(1<<4)}, {16*1, 48}, 4}, - {{4|(2<<4)}, {16*2, 64}, 1}, - {{4|(1<<4)}, {16*1, 64}, 1}, - {{2|(6<<4)}, {16*6, 32}, 4}, - {{2|(5<<4)}, {16*5, 32}, 4}, - {{2|(4<<4)}, {16*4, 32}, 4}, - {{2|(3<<4)}, {16*3, 32}, 4}, - {{2|(2<<4)}, {16*2, 32}, 4}, - {{2|(1<<4)}, {16*1, 32}, 4}, - {{3|(0<<4)}, {16*0, 48}, 1}, - {{4|(0<<4)}, {16*0, 64}, 1}, - {{2|(7<<4)}, {16*7, 32}, 4}, - {{2|(8<<4)}, {16*8, 32}, 4}, - {{2|(9<<4)}, {16*9, 32}, 4}, - {{2|(10<<4)}, {16*10, 32}, 4}, - {{2|(11<<4)}, {16*11, 32}, 4}, - {{2|(13<<4)}, {16*13, 32}, 4}, - {{3|(10<<4)}, {16*10, 48}, 4}, - {{3|(11<<4)}, {16*11, 48}, 4}, - {{3|(13<<4)}, {16*13, 48}, 4}, - {{3|(6<<4)}, {16*6, 48}, 4}, - {{3|(7<<4)}, {16*7, 48}, 4}, - {{3|(8<<4)}, {16*8, 48}, 4}, - {{3|(9<<4)}, {16*9, 48}, 4}, - {{4|(8<<4)}, {16*8, 64}, 1}, - {{4|(9<<4)}, {16*9, 64}, 1}, - {{4|(10<<4)}, {16*10, 64}, 1}, - {{4|(11<<4)}, {16*11, 64}, 1}, -}; + +led_config_t g_led_config = { { + { 17, 16, 15, 14, 13, 12, 11, 10, 9, 18, 19, 20, 21, 22, 23 }, + { 7, 6, 5, 4, 3, 2, 1, 0, 26, 27, 28, 29, 30, 31, 24 }, + { 8, 48, 47, 46, 45, 44, 43, 51, 52, 53, 54, 55, NO_LED, 56, 25 }, + { 49, 40, 39, 38, 37, 36, 60, 61, 62, 63, 57, 58, NO_LED, 59, 32 }, + { 50, 42, 41, NO_LED, NO_LED, 35, NO_LED, NO_LED, 64, 65, 66, 67, NO_LED, 34, 33 } +}, { + { 112, 16 }, { 96, 16 }, { 80, 16 }, { 64, 16 }, { 48, 16 }, { 32, 16 }, { 16, 16 }, { 0, 16 }, { 0, 32 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, + { 32, 0 }, { 16, 0 }, { 0, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 224, 0 }, { 224, 16 }, { 224, 32 }, { 128, 16 }, { 144, 16 }, { 160, 16 }, { 176, 16 }, + { 192, 16 }, { 208, 16 }, { 224, 48 }, { 224, 64 }, { 208, 64 }, { 80, 64 }, { 80, 48 }, { 64, 48 }, { 48, 48 }, { 32, 48 }, { 16, 48 }, { 32, 64 }, { 16, 64 }, { 96, 32 }, { 80, 32 }, + { 64, 32 }, { 48, 32 }, { 32, 32 }, { 16, 32 }, { 0, 48 }, { 0, 64 }, { 112, 32 }, { 128, 32 }, { 144, 32 }, { 160, 32 }, { 176, 32 }, { 208, 32 }, { 160, 48 }, { 176, 48 }, { 208, 48 }, + { 96, 48 }, { 112, 48 }, { 128, 48 }, { 144, 48 }, { 128, 64 }, { 144, 64 }, { 160, 64 }, { 176, 64 } +}, { + 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 1, 1, 4, 4, + 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 1, 1, 1, 1 +} }; void suspend_power_down_kb(void) { diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 13ea843022d..09443cf7252 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -269,68 +269,39 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { 28, 33, 38, 43, 47, NO_LED }, + { 27, 32, 37, 42, 46, NO_LED }, + { 26, 31, 36, 41, 45, NO_LED }, + { 25, 30, 35, 40, 44, NO_LED }, + { 24, 29, 34, 39, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { 0, 5, 10, 15, NO_LED, NO_LED }, + { 1, 6, 11, 16, 20, NO_LED }, + { 2, 7, 12, 17, 21, NO_LED }, + { 3, 8, 13, 18, 22, NO_LED }, + { 4, 9, 14, 19, 23, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } +}, { + { 137, 0 }, { 154, 0 }, { 172, 0 }, { 189, 0 }, { 206, 0 }, { 137, 12 }, + { 154, 12 }, { 172, 12 }, { 189, 12 }, { 206, 12 }, { 137, 25 }, { 154, 25 }, + { 172, 25 }, { 189, 25 }, { 206, 25 }, { 137, 38 }, { 154, 38 }, { 172, 38 }, + { 189, 38 }, { 206, 38 }, { 154, 51 }, { 172, 51 }, { 189, 51 }, { 206, 51 }, + { 86, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 86, 12 }, + { 68, 12 }, { 51, 12 }, { 34, 12 }, { 17, 12 }, { 86, 25 }, { 68, 25 }, + { 51, 25 }, { 34, 25 }, { 17, 25 }, { 86, 38 }, { 68, 38 }, { 51, 38 }, + { 34, 38 }, { 17, 38 }, { 68, 51 }, { 51, 51 }, { 34, 51 }, { 17, 51 } +}, { + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1 +} }; - /*{row | col << 4} - | {x=0..224, y=0..64} - | | flags - | | | */ - {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 4}, // LED 1 on right > Key 6 - {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 4}, // LED 2 > Key 7 - {{10|(0<<4)}, {17.2*10, 12.8*0}, 4}, // LED 3 > Key 8 - {{11|(0<<4)}, {17.2*11, 12.8*0}, 4}, // LED 4 > Key 9 - {{12|(0<<4)}, {17.2*12, 12.8*0}, 4}, // LED 5 > Key 0 - - {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 4}, // LED 6 - {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 4}, // LED 7 - {{10|(1<<4)}, {17.2*10, 12.8*1}, 4}, // LED 8 - {{11|(1<<4)}, {17.2*11, 12.8*1}, 4}, // LED 9 - {{12|(1<<4)}, {17.2*12, 12.8*1}, 4}, // LED 10 - - {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 4}, // LED 11 - {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 4}, // LED 12 - {{10|(2<<4)}, {17.2*10, 12.8*2}, 4}, // LED 13 - {{11|(2<<4)}, {17.2*11, 12.8*2}, 4}, // LED 14 - {{12|(2<<4)}, {17.2*12, 12.8*2}, 4}, // LED 15 - - {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 4}, // LED 16 - {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 4}, // LED 17 - {{10|(3<<4)}, {17.2*10, 12.8*3}, 4}, // LED 18 - {{11|(3<<4)}, {17.2*11, 12.8*3}, 4}, // LED 19 - {{12|(3<<4)}, {17.2*12, 12.8*3}, 4}, // LED 20 - - {{ 9|(4<<4)}, {17.2* 9, 12.8*4}, 1}, // LED 21 - {{10|(4<<4)}, {17.2*10, 12.8*4}, 1}, // LED 22 - {{11|(4<<4)}, {17.2*11, 12.8*4}, 1}, // LED 23 - {{12|(4<<4)}, {17.2*12, 12.8*4}, 1}, // LED 24 - - {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 4}, // LED 1 on left > Key 5 - {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 4}, // LED 2 > Key 4 - {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 4}, // LED 3 > Key 3 - {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 4}, // LED 4 > Key 2 - {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 4}, // LED 5 > Key 1 - - {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 4}, // LED 6 - {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 4}, // LED 7 - {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 4}, // LED 8 - {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 4}, // LED 9 - {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 4}, // LED 10 - - {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 4}, // LED 11 - {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 4}, // LED 12 - {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 4}, // LED 13 - {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 4}, // LED 14 - {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 4}, // LED 15 - - {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 4}, // LED 16 - {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 4}, // LED 17 - {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 4}, // LED 18 - {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 4}, // LED 19 - {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 4}, // LED 20 - - {{ 4|(4<<4)}, {17.2* 4, 12.8*4}, 1}, // LED 21 - {{ 3|(4<<4)}, {17.2* 3, 12.8*4}, 1}, // LED 22 - {{ 2|(4<<4)}, {17.2* 2, 12.8*4}, 1}, // LED 23 - {{ 1|(4<<4)}, {17.2* 1, 12.8*4}, 1}, // LED 24 > Key Hack -}; #endif diff --git a/keyboards/exclusive/e6_rgb/e6_rgb.c b/keyboards/exclusive/e6_rgb/e6_rgb.c index 42f8799904f..106e58497ee 100644 --- a/keyboards/exclusive/e6_rgb/e6_rgb.c +++ b/keyboards/exclusive/e6_rgb/e6_rgb.c @@ -114,91 +114,79 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_16, D_16, F_16}, {0, B_16, A_16, C_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ + +led_config_t g_led_config = { { + { 0, 1, 4, 5, 12, 13, 36, 20, 21, 24, 25, 16, 17, 28 }, + { 2, 6, 7, 14, 15, 37, 38, 22, 23, 26, 27, 18, 19, 30 }, + { 3, 8, 9, 32, 33, 39, 40, 44, 45, 48, 49, 52, 31, NO_LED }, + { 59, 10, 11, 34, 35, 41, 42, 46, 47, 50, 53, 54, 56, NO_LED }, + { 60, 61, 62, NO_LED, NO_LED, 43, 51, 55, 58, 57, NO_LED, NO_LED, NO_LED, NO_LED } +}, { //cs1 - {{0|(0<<4)}, { 0, 0}, 1}, - {{0|(1<<4)}, { 17, 0}, 4}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - + { 0, 0 }, { 17, 0 }, { 0, 16 }, { 0, 32 }, //cs2 - {{0|(2<<4)}, { 34, 0}, 4}, - {{0|(3<<4)}, { 51, 0}, 4}, - {{1|(1<<4)}, { 17, 16}, 4}, - {{1|(2<<4)}, { 34, 16}, 4}, + { 34, 0 }, { 51, 0 }, { 17, 16 }, { 34, 16 }, //cs3 - {{2|(1<<4)}, { 17, 32}, 4}, - {{2|(2<<4)}, { 34, 32}, 4}, - {{3|(1<<4)}, { 17, 48}, 4}, - {{3|(2<<4)}, { 34, 48}, 4}, + { 17, 32 }, { 34, 32 }, { 17, 48 }, { 34, 48 }, //cs4 - {{0|(4<<4)}, { 68, 0}, 4}, - {{0|(5<<4)}, { 85, 0}, 4}, - {{1|(3<<4)}, { 51, 16}, 4}, - {{1|(4<<4)}, { 68, 16}, 4}, + { 68, 0 }, { 85, 0 }, { 51, 16 }, { 68, 16 }, //cs5 - {{0|(11<<4)}, {187, 0}, 4}, - {{0|(12<<4)}, {204, 0}, 4}, - {{1|(11<<4)}, {187, 16}, 4}, - {{1|(12<<4)}, {204, 16}, 4}, + { 187, 0 }, { 204, 0 }, { 187, 16 }, { 204, 16 }, //cs6 - {{0|(7<<4)}, {119, 0}, 4}, - {{0|(8<<4)}, {136, 0}, 4}, - {{1|(7<<4)}, {119, 16}, 4}, - {{1|(8<<4)}, {136, 16}, 4}, + { 119, 0 }, { 136, 0 }, { 119, 16 }, { 136, 16 }, //cs7 - {{0|(9<<4)}, {153, 0}, 4}, - {{0|(10<<4)}, {170, 0}, 4}, - {{1|(9<<4)}, {153, 16}, 4}, - {{1|(10<<4)}, {170, 16}, 4}, + { 153, 0 }, { 170, 0 }, { 153, 16 }, { 170, 16 }, //cs8 - {{0|(13<<4)}, {221, 0}, 4}, - {{0|(14<<4)}, {221, 0}, 4}, - {{1|(13<<4)}, {221, 32}, 1}, - {{2|(12<<4)}, {221, 16}, 1}, + { 221, 0 }, { 221, 0 }, { 221, 32 }, { 221, 16 }, //cs9 - {{2|(3<<4)}, { 51, 32}, 4}, - {{2|(4<<4)}, { 68, 32}, 4}, - {{3|(3<<4)}, { 51, 48}, 4}, - {{3|(4<<4)}, { 68, 48}, 4}, + { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, //cs10 - {{0|(6<<4)}, {102, 0}, 4}, - {{1|(5<<4)}, { 85, 16}, 4}, - {{1|(6<<4)}, {102, 16}, 4}, - {{2|(5<<4)}, { 85, 32}, 4}, + { 102, 0 }, { 85, 16 }, { 102, 16 }, { 85, 32 }, //cs11 - {{2|(6<<4)}, {102, 32}, 4}, - {{3|(5<<4)}, { 85, 48}, 4}, - {{3|(6<<4)}, {102, 48}, 4}, - {{4|(5<<4)}, {102, 64}, 4}, + { 102, 32 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, //cs12 - {{2|(7<<4)}, {119, 32}, 4}, - {{2|(8<<4)}, {136, 32}, 4}, - {{3|(7<<4)}, {119, 48}, 4}, - {{3|(8<<4)}, {136, 48}, 4}, + { 119, 32 }, { 136, 32 }, { 119, 48 }, { 136, 48 }, //cs13 - {{2|(9<<4)}, {153, 32}, 4}, - {{2|(10<<4)}, {170, 32}, 4}, - {{3|(9<<4)}, {153, 48}, 4}, - {{4|(6<<4)}, {136, 48}, 1}, + { 153, 32 }, { 170, 32 }, { 153, 48 }, { 136, 48 }, //cs14 - {{2|(11<<4)}, {187, 32}, 4}, - {{3|(10<<4)}, {170, 48}, 4}, - {{3|(11<<4)}, {187, 48}, 1}, - {{4|(7<<4)}, {153, 48}, 1}, + { 187, 32 }, { 170, 48 }, { 187, 48 }, { 153, 48 }, //cs15 - {{3|(12<<4)}, {221, 48}, 1}, - - {{4|(9<<4)}, {221, 64}, 1}, - {{4|(8<<4)}, {204, 64}, 1}, + { 221, 48 }, { 221, 64 }, { 204, 64 }, //cs16 - {{3|(0<<4)}, { 0, 48}, 1}, - {{4|(0<<4)}, { 0, 64}, 1}, - {{4|(1<<4)}, { 17, 64}, 1}, - {{4|(2<<4)}, { 34, 64}, 1}, -}; + { 0, 48 }, { 0, 64 }, { 17, 64 }, { 34, 64 } +}, { +//cs1 + 1, 4, 1, 1, +//cs2 + 4, 4, 4, 4, +//cs3 + 4, 4, 4, 4, +//cs4 + 4, 4, 4, 4, +//cs5 + 4, 4, 4, 4, +//cs6 + 4, 4, 4, 4, +//cs7 + 4, 4, 4, 4, +//cs8 + 4, 4, 1, 1, +//cs9 + 4, 4, 4, 4, +//cs10 + 4, 4, 4, 4, +//cs11 + 4, 4, 4, 4, +//cs12 + 4, 4, 4, 4, +//cs13 + 4, 4, 4, 1, +//cs14 + 4, 4, 1, 1, +//cs15 + 1, 1, 1, +//cs16 + 1, 1, 1, 1 +} }; + #endif diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c index 5827b42e20f..1491caba43f 100644 --- a/keyboards/hadron/ver3/ver3.c +++ b/keyboards/hadron/ver3/ver3.c @@ -19,24 +19,19 @@ #include "haptic.h" #ifdef RGB_MATRIX_ENABLE -#include "rgblight.h" +#include "rgb_matrix.h" -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /*{row | col << 4} - | {x=0..224, y=0..64} - | | modifier - | | | */ - {{1|(13<<4)}, {195, 3}, 4}, - {{4|(13<<4)}, {195, 16}, 4}, - {{4|(10<<4)}, {150, 16}, 4}, - {{4|(7<<4)}, {105, 16}, 4}, - {{4|(4<<4)}, {60, 16}, 4}, - {{4|(1<<4)}, {15, 16}, 4}, - {{1|(1<<4)}, {15, 3}, 4}, - {{1|(4<<4)}, {60, 3}, 4}, - {{1|(7<<4)}, {105, 3}, 4}, - {{1|(10<<4)}, {150, 3}, 4} -}; +led_config_t g_led_config = { { + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 6, NO_LED, NO_LED, 7, NO_LED, NO_LED, 8, NO_LED, NO_LED, 9, NO_LED, NO_LED, 0, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 5, NO_LED, NO_LED, 4, NO_LED, NO_LED, 3, NO_LED, NO_LED, 2, NO_LED, NO_LED, 1, NO_LED } +}, { + { 195, 3 }, { 195, 16 }, { 150, 16 }, { 105, 16 }, { 60, 16 }, { 15, 16 }, { 15, 3 }, { 60, 3 }, { 105, 3 }, { 150, 3 } +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 +} }; #endif @@ -53,12 +48,12 @@ uint16_t counterst = 0; #define ScreenOffInterval 60000 /* milliseconds */ static uint16_t last_flush; -volatile uint8_t led_numlock = false; -volatile uint8_t led_capslock = false; +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; volatile uint8_t led_scrolllock = false; static uint8_t layer; -static bool queue_for_send = false; +static bool queue_for_send = false; static uint8_t encoder_value = 32; __attribute__ ((weak)) @@ -69,7 +64,7 @@ void draw_ui(void) { /* Layer indicator is 41 x 10 pixels */ #define LAYER_INDICATOR_X 5 -#define LAYER_INDICATOR_Y 0 +#define LAYER_INDICATOR_Y 0 draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); @@ -83,7 +78,7 @@ void draw_ui(void) { for (uint8_t y = 0; y < MATRIX_COLS; y++) { draw_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); } - } + } draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 19, 9, PIXEL_ON, NORM); /* hadron oled location on thumbnail */ draw_rect_filled_soft(MATRIX_DISPLAY_X + 14, MATRIX_DISPLAY_Y + 2, 3, 1, PIXEL_ON, NORM); @@ -162,7 +157,7 @@ void read_host_led_state(void) { if (led_capslock == false){ led_capslock = true;} } else { - if (led_capslock == true){ + if (led_capslock == true){ led_capslock = false;} } if (leds & (1 << USB_LED_SCROLL_LOCK)) { @@ -197,7 +192,7 @@ void matrix_init_kb(void) { queue_for_send = true; matrix_init_user(); } - + void matrix_scan_kb(void) { if (queue_for_send) { #ifdef QWIIC_MICRO_OLED_ENABLE diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c index bd6dd19b2a7..5267c94576e 100644 --- a/keyboards/hs60/v1/v1.c +++ b/keyboards/hs60/v1/v1.c @@ -165,83 +165,37 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, A15, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, ---, A14, -// D3, ---, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 4}, - {{0|(11<<4)}, {187, 0}, 4}, - {{0|(10<<4)}, {170, 0}, 4}, - {{0|(9<<4)}, {153, 0}, 4}, - {{0|(8<<4)}, {136, 0}, 4}, - {{0|(7<<4)}, {119, 0}, 4}, - {{1|(7<<4)}, {119, 16}, 4}, - {{1|(8<<4)}, {136, 16}, 4}, - {{1|(9<<4)}, {153, 16}, 4}, - {{1|(10<<4)}, {170, 16}, 4}, - {{1|(11<<4)}, {187, 16}, 4}, - {{1|(12<<4)}, {204, 16}, 4}, - {{2|(13<<4)}, {224, 32}, 1}, - {{2|(12<<4)}, {224, 16}, 4}, - {{2|(11<<4)}, {197, 32}, 4}, - - {{3|(10<<4)}, {170, 48}, 4}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 4}, - {{3|(8<<4)}, {136, 48}, 4}, - {{3|(7<<4)}, {119, 48}, 4}, - {{2|(7<<4)}, {119, 32}, 4}, - {{2|(8<<4)}, {136, 32}, 4}, - {{2|(9<<4)}, {153, 32}, 4}, - {{2|(10<<4)}, {170, 32}, 4}, - {{3|(11<<4)}, {187, 48}, 4}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 4}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 4}, - {{0|(4<<4)}, { 68, 0}, 4}, - {{0|(3<<4)}, { 51, 0}, 4}, - {{0|(2<<4)}, { 34, 0}, 4}, - {{0|(1<<4)}, { 17, 0}, 4}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 4}, - {{1|(2<<4)}, { 34, 16}, 4}, - {{1|(3<<4)}, { 51, 16}, 4}, - {{1|(4<<4)}, { 68, 16}, 4}, - {{1|(5<<4)}, { 85, 16}, 4}, - {{1|(6<<4)}, {102, 16}, 4}, - {{2|(6<<4)}, {102, 32}, 4}, - {{2|(5<<4)}, { 85, 32}, 4}, - - {{3|(2<<4)}, { 32, 48}, 4}, //D1-D16 - //D2 - {{3|(0<<4)}, { 10, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 4}, - {{2|(2<<4)}, { 34, 32}, 4}, - {{2|(3<<4)}, { 51, 32}, 4}, - {{2|(4<<4)}, { 68, 32}, 4}, - {{3|(3<<4)}, { 51, 48}, 4}, - {{3|(4<<4)}, { 68, 48}, 4}, - {{3|(5<<4)}, { 85, 48}, 4}, - {{3|(6<<4)}, {102, 48}, 4}, - {{4|(3<<4)}, {102, 64}, 4}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; +led_config_t g_led_config = { { + { 36, 35, 34, 33, 32, 31, 30, 6, 5, 4, 3, 2, 1, 0 }, + { 37, 38, 39, 40, 41, 42, 43, 7, 8, 9, 10, 11, 12, NO_LED }, + { 48, 49, 50, 51, 52, 45, 44, 20, 21, 22, 23, 15, 14, 13 }, + { 47, NO_LED, 46, 53, 54, 55, 56, 19, 18, 17, 16, 24, NO_LED, 25 }, + { 60, 59, 58, 57, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 29, 28, 27, 26 } +}, { + //A1-A16 + { 224, 0 }, { 204, 0 }, { 187, 0 }, { 170, 0 }, { 153, 0 }, { 136, 0 }, { 119, 0 }, { 119, 16 }, { 136, 16 }, { 153, 16 }, { 170, 16 }, { 187, 16 }, { 204, 16 }, { 224, 32 }, + { 224, 16 }, { 197, 32 }, + //B1-B14 + { 170, 48 }, { 153, 48 }, { 136, 48 }, { 119, 48 }, { 119, 32 }, { 136, 32 }, { 153, 32 }, { 170, 32 }, { 187, 48 }, { 214, 48 }, { 224, 64 }, { 204, 64 }, { 187, 64 }, { 170, 64 }, + //C1-C16 + { 102, 0 }, { 85, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, { 0, 16 }, { 17, 16 }, { 34, 16 }, { 51, 16 }, { 68, 16 }, { 85, 16 }, { 102, 16 }, + { 102, 32 }, { 85, 32 }, + //D1-D16 + { 32, 48 }, { 10, 48 }, { 0, 32 }, { 17, 32 }, { 34, 32 }, { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, { 34, 68 }, { 17, 68 }, + { 0, 68 } +}, { + //A1-A16 + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, + //B1-B14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, + //C1-C16 + 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, + 4, 4, + //D1-D16 + 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1 +} }; #else @@ -319,83 +273,37 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, ---, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, A15, A14, -// D3, D2, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 4}, - {{0|(11<<4)}, {187, 0}, 4}, - {{0|(10<<4)}, {170, 0}, 4}, - {{0|(9<<4)}, {153, 0}, 4}, - {{0|(8<<4)}, {136, 0}, 4}, - {{0|(7<<4)}, {119, 0}, 4}, - {{1|(7<<4)}, {119, 16}, 4}, - {{1|(8<<4)}, {136, 16}, 4}, - {{1|(9<<4)}, {153, 16}, 4}, - {{1|(10<<4)}, {170, 16}, 4}, - {{1|(11<<4)}, {187, 16}, 4}, - {{1|(12<<4)}, {204, 16}, 4}, - {{2|(13<<4)}, {224, 8}, 1}, - {{2|(12<<4)}, {204, 32}, 4}, - {{2|(11<<4)}, {187, 32}, 4}, - - {{3|(10<<4)}, {170, 48}, 4}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 4}, - {{3|(8<<4)}, {136, 48}, 4}, - {{3|(7<<4)}, {119, 48}, 4}, - {{2|(7<<4)}, {119, 32}, 4}, - {{2|(8<<4)}, {136, 32}, 4}, - {{2|(9<<4)}, {153, 32}, 4}, - {{2|(10<<4)}, {170, 32}, 4}, - {{3|(11<<4)}, {187, 48}, 4}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 4}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 4}, - {{0|(4<<4)}, { 68, 0}, 4}, - {{0|(3<<4)}, { 51, 0}, 4}, - {{0|(2<<4)}, { 34, 0}, 4}, - {{0|(1<<4)}, { 17, 0}, 4}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 4}, - {{1|(2<<4)}, { 34, 16}, 4}, - {{1|(3<<4)}, { 51, 16}, 4}, - {{1|(4<<4)}, { 68, 16}, 4}, - {{1|(5<<4)}, { 85, 16}, 4}, - {{1|(6<<4)}, {102, 16}, 4}, - {{2|(6<<4)}, {102, 32}, 4}, - {{2|(5<<4)}, { 85, 32}, 4}, - - {{3|(2<<4)}, { 32, 48}, 4}, //D1-D16 - {{3|(1<<4)}, { 17, 48}, 4}, - {{3|(0<<4)}, { 0, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 4}, - {{2|(2<<4)}, { 34, 32}, 4}, - {{2|(3<<4)}, { 51, 32}, 4}, - {{2|(4<<4)}, { 68, 32}, 4}, - {{3|(3<<4)}, { 51, 48}, 4}, - {{3|(4<<4)}, { 68, 48}, 4}, - {{3|(5<<4)}, { 85, 48}, 4}, - {{3|(6<<4)}, {102, 48}, 4}, - {{4|(3<<4)}, {102, 64}, 4}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; +led_config_t g_led_config = { { + { 36, 35, 34, 33, 32, 31, 30, 6, 5, 4, 3, 2, 1, 0 }, + { 37, 38, 39, 40, 41, 42, 43, 7, 8, 9, 10, 11, 12, NO_LED }, + { 49, 50, 51, 52, 53, 45, 44, 20, 21, 22, 23, 15, 14, 13 }, + { 48, 47, 46, 54, 55, 56, 57, 19, 18, 17, 16, 24, NO_LED, 25 }, + { 61, 60, 59, 58, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 29, 28, 27, 26 } +}, { + //A1-A16 + { 224, 0 }, { 204, 0 }, { 187, 0 }, { 170, 0 }, { 153, 0 }, { 136, 0 }, { 119, 0 }, { 119, 16 }, { 136, 16 }, { 153, 16 }, { 170, 16 }, { 187, 16 }, { 204, 16 }, { 224, 8 }, + { 204, 32 }, { 187, 32 }, + //B1-B14 + { 170, 48 }, { 153, 48 }, { 136, 48 }, { 119, 48 }, { 119, 32 }, { 136, 32 }, { 153, 32 }, { 170, 32 }, { 187, 48 }, { 214, 48 }, { 224, 64 }, { 204, 64 }, { 187, 64 }, { 170, 64 }, + //C1-C16 + { 102, 0 }, { 85, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, { 0, 16 }, { 17, 16 }, { 34, 16 }, { 51, 16 }, { 68, 16 }, { 85, 16 }, { 102, 16 }, + { 102, 32 }, { 85, 32 }, + //D1-D16 + { 32, 48 }, { 17, 48 }, { 0, 48 }, { 0, 32 }, { 17, 32 }, { 34, 32 }, { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, { 34, 68 }, + { 17, 68 }, { 0, 68 } +}, { + //A1-A16 + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, + //B1-B14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, + //C1-C16 + 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, + 4, 4, + //D1-D16 + 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1 +} }; #endif @@ -492,4 +400,4 @@ void suspend_power_down_kb(void) void suspend_wakeup_init_kb(void) { rgb_matrix_set_suspend_state(false); -} \ No newline at end of file +} diff --git a/keyboards/massdrop/alt/config_led.c b/keyboards/massdrop/alt/config_led.c index 1a9a539a076..42d4d1474bb 100644 --- a/keyboards/massdrop/alt/config_led.c +++ b/keyboards/massdrop/alt/config_led.c @@ -20,123 +20,34 @@ // // There is a quick-and-dirty implementation of this under ledvis.html -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /* 0 */ { { (0)|(0 << 4) }, { 8, 56 }, 4 }, // KC_ESC - /* 1 */ { { (0)|(1 << 4) }, { 22, 56 }, 4 }, // KC_1 - /* 2 */ { { (0)|(2 << 4) }, { 35, 56 }, 4 }, // KC_2 - /* 3 */ { { (0)|(3 << 4) }, { 49, 56 }, 4 }, // KC_3 - /* 4 */ { { (0)|(4 << 4) }, { 63, 56 }, 4 }, // KC_4 - /* 5 */ { { (0)|(5 << 4) }, { 77, 56 }, 4 }, // KC_5 - /* 6 */ { { (0)|(6 << 4) }, { 91, 56 }, 4 }, // KC_6 - /* 7 */ { { (0)|(7 << 4) }, { 105, 56 }, 4 }, // KC_7 - /* 8 */ { { (0)|(8 << 4) }, { 118, 56 }, 4 }, // KC_8 - /* 9 */ { { (0)|(9 << 4) }, { 132, 56 }, 4 }, // KC_9 - /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 4 }, // KC_0 - /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 4 }, // KC_MINS - /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 4 }, // KC_EQL - /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 4 }, // KC_BSPC - /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 4 }, // KC_DEL - /* 15 */ { { (1)|(0 << 4) }, { 11, 44 }, 4 }, // KC_TAB - /* 16 */ { { (1)|(1 << 4) }, { 28, 44 }, 4 }, // KC_Q - /* 17 */ { { (1)|(2 << 4) }, { 42, 44 }, 4 }, // KC_W - /* 18 */ { { (1)|(3 << 4) }, { 56, 44 }, 4 }, // KC_E - /* 19 */ { { (1)|(4 << 4) }, { 70, 44 }, 4 }, // KC_R - /* 20 */ { { (1)|(5 << 4) }, { 84, 44 }, 4 }, // KC_T - /* 21 */ { { (1)|(6 << 4) }, { 98, 44 }, 4 }, // KC_Y - /* 22 */ { { (1)|(7 << 4) }, { 112, 44 }, 4 }, // KC_U - /* 23 */ { { (1)|(8 << 4) }, { 125, 44 }, 4 }, // KC_I - /* 24 */ { { (1)|(9 << 4) }, { 139, 44 }, 4 }, // KC_O - /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 4 }, // KC_P - /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 4 }, // KC_LBRC - /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 4 }, // KC_RBRC - /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 4 }, // KC_BSLS - /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 4 }, // KC_HOME - /* 30 */ { { (2)|(0 << 4) }, { 13, 32 }, 1 }, // KC_CAPS - /* 31 */ { { (2)|(1 << 4) }, { 32, 32 }, 4 }, // KC_A - /* 32 */ { { (2)|(2 << 4) }, { 46, 32 }, 4 }, // KC_S - /* 33 */ { { (2)|(3 << 4) }, { 60, 32 }, 4 }, // KC_D - /* 34 */ { { (2)|(4 << 4) }, { 73, 32 }, 4 }, // KC_F - /* 35 */ { { (2)|(5 << 4) }, { 87, 32 }, 4 }, // KC_G - /* 36 */ { { (2)|(6 << 4) }, { 101, 32 }, 4 }, // KC_H - /* 37 */ { { (2)|(7 << 4) }, { 115, 32 }, 4 }, // KC_J - /* 38 */ { { (2)|(8 << 4) }, { 129, 32 }, 4 }, // KC_K - /* 39 */ { { (2)|(9 << 4) }, { 143, 32 }, 4 }, // KC_L - /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 4 }, // KC_SCLN - /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 4 }, // KC_QUOT - /* _________________________________________ */ // ____ - /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 4 }, // KC_ENT - /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 4 }, // KC_PGUP - /* 44 */ { { (3)|(0 << 4) }, { 16, 19 }, 4 }, // KC_LSFT - /* 45 */ { { (3)|(2 << 4) }, { 39, 19 }, 4 }, // KC_Z - /* 46 */ { { (3)|(3 << 4) }, { 53, 19 }, 4 }, // KC_X - /* 47 */ { { (3)|(4 << 4) }, { 67, 19 }, 4 }, // KC_C - /* 48 */ { { (3)|(5 << 4) }, { 80, 19 }, 4 }, // KC_V - /* 49 */ { { (3)|(6 << 4) }, { 94, 19 }, 4 }, // KC_B - /* 50 */ { { (3)|(7 << 4) }, { 108, 19 }, 4 }, // KC_N - /* 51 */ { { (3)|(8 << 4) }, { 122, 19 }, 4 }, // KC_M - /* 52 */ { { (3)|(9 << 4) }, { 136, 19 }, 4 }, // KC_COMM - /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 4 }, // KC_DOT - /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 4 }, // KC_SLSH - /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 4 }, // KC_RSFT - /* _________________________________________ */ // ____ - /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 4 }, // KC_UP - /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 4 }, // KC_PGDN - /* 58 */ { { (4)|(0 << 4) }, { 9, 7 }, 4 }, // KC_LCTL - /* 59 */ { { (4)|(1 << 4) }, { 27, 7 }, 4 }, // KC_LGUI - /* 60 */ { { (4)|(2 << 4) }, { 44, 7 }, 4 }, // KC_LALT - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* 61 */ { { (4)|(6 << 4) }, { 96, 7 }, 4 }, // KC_SPC - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* 62 */ { { (4)|(10 << 4) }, { 148, 7 }, 4 }, // KC_RALT - /* 63 */ { { (4)|(11 << 4) }, { 165, 7 }, 4 }, // MO(1) - /* 64 */ { { (4)|(12 << 4) }, { 188, 7 }, 4 }, // KC_LEFT - /* 65 */ { { (4)|(13 << 4) }, { 201, 7 }, 4 }, // KC_DOWN - /* 66 */ { { (4)|(14 << 4) }, { 215, 7 }, 4 }, // KC_RGHT - +led_config_t g_led_config = { { + { 0, 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, NO_LED, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66 } +}, { + { 8, 56 }, { 22, 56 }, { 35, 56 }, { 49, 56 }, { 63, 56 }, { 77, 56 }, { 91, 56 }, { 105, 56 }, { 118, 56 }, { 132, 56 }, { 146, 56 }, { 160, 56 }, { 174, 56 }, { 195, 56 }, { 215, 56 }, + { 11, 44 }, { 28, 44 }, { 42, 44 }, { 56, 44 }, { 70, 44 }, { 84, 44 }, { 98, 44 }, { 112, 44 }, { 125, 44 }, { 139, 44 }, { 153, 44 }, { 167, 44 }, { 181, 44 }, { 198, 44 }, { 215, 44 }, + { 13, 32 }, { 32, 32 }, { 46, 32 }, { 60, 32 }, { 73, 32 }, { 87, 32 }, { 101, 32 }, { 115, 32 }, { 129, 32 }, { 143, 32 }, { 156, 32 }, { 170, 32 }, { 193, 32 }, { 215, 32 }, { 16, 19 }, + { 39, 19 }, { 53, 19 }, { 67, 19 }, { 80, 19 }, { 94, 19 }, { 108, 19 }, { 122, 19 }, { 136, 19 }, { 150, 19 }, { 163, 19 }, { 182, 19 }, { 201, 19 }, { 215, 19 }, { 9, 7 }, { 27, 7 }, + { 44, 7 }, { 96, 7 }, { 148, 7 }, { 165, 7 }, { 188, 7 }, { 201, 7 }, { 215, 7 }, // Underglow LEDs - { { 255 }, { 1, 1 }, 2 }, - { { 255 }, { 15, 0 }, 2 }, - { { 255 }, { 31, 0 }, 2 }, - { { 255 }, { 47, 0 }, 2 }, - { { 255 }, { 63, 0 }, 2 }, - { { 255 }, { 79, 0 }, 2 }, - { { 255 }, { 95, 0 }, 2 }, - { { 255 }, { 112, 0 }, 2 }, - { { 255 }, { 128, 0 }, 2 }, - { { 255 }, { 144, 0 }, 2 }, - { { 255 }, { 160, 0 }, 2 }, - { { 255 }, { 176, 0 }, 2 }, - { { 255 }, { 192, 0 }, 2 }, - { { 255 }, { 208, 0 }, 2 }, - { { 255 }, { 222, 1 }, 2 }, - { { 255 }, { 224, 13 }, 2 }, - { { 255 }, { 224, 25 }, 2 }, - { { 255 }, { 224, 38 }, 2 }, - { { 255 }, { 224, 50 }, 2 }, - { { 255 }, { 222, 62 }, 2 }, - { { 255 }, { 191, 64 }, 2 }, - { { 255 }, { 179, 64 }, 2 }, - { { 255 }, { 167, 64 }, 2 }, - { { 255 }, { 153, 64 }, 2 }, - { { 255 }, { 139, 64 }, 2 }, - { { 255 }, { 125, 64 }, 2 }, - { { 255 }, { 112, 64 }, 2 }, - { { 255 }, { 98, 64 }, 2 }, - { { 255 }, { 84, 64 }, 2 }, - { { 255 }, { 70, 64 }, 2 }, - { { 255 }, { 56, 64 }, 2 }, - { { 255 }, { 42, 64 }, 2 }, - { { 255 }, { 28, 64 }, 2 }, - { { 255 }, { 1, 62 }, 2 }, - { { 255 }, { 0, 50 }, 2 }, - { { 255 }, { 0, 38 }, 2 }, - { { 255 }, { 0, 25 }, 2 }, - { { 255 }, { 0, 13 }, 2 }, -}; + { 1, 1 }, { 15, 0 }, { 31, 0 }, { 47, 0 }, { 63, 0 }, { 79, 0 }, { 95, 0 }, { 112, 0 }, { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 222, 1 }, + { 224, 13 }, { 224, 25 }, { 224, 38 }, { 224, 50 }, { 222, 62 }, { 191, 64 }, { 179, 64 }, { 167, 64 }, { 153, 64 }, { 139, 64 }, { 125, 64 }, { 112, 64 }, { 98, 64 }, { 84, 64 }, { 70, 64 }, + { 56, 64 }, { 42, 64 }, { 28, 64 }, { 1, 62 }, { 0, 50 }, { 0, 38 }, { 0, 25 }, { 0, 13 } +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, + // Underglow LEDs + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + #ifdef USB_LED_INDICATOR_ENABLE void rgb_matrix_indicators_kb(void) diff --git a/keyboards/massdrop/ctrl/config_led.c b/keyboards/massdrop/ctrl/config_led.c index 20d9c649ec0..5f1c4520715 100644 --- a/keyboards/massdrop/ctrl/config_led.c +++ b/keyboards/massdrop/ctrl/config_led.c @@ -5,134 +5,72 @@ #include "rgb_matrix.h" #include "config_led.h" -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 16, 17, 18, 19, 20, 21, 22, 23 }, + { 33, 34, 35, 36, 37, 38, 39, 40 }, + { 50, 51, 52, 53, 54, 55, 56, 57 }, + { 63, 64, 65, 66, 67, 68, 69, 70 }, + { 76, 77, 78, 79, 80, 81, 82, 83 }, + { 8, 9, 10, 11, 12, 13, 14, 15 }, + { 24, 25, 26, 27, 28, 29, 30, 31 }, + { 41, 42, 43, 44, 45, 46, 47, 48 }, + { 58, 59, 60, 61, 62, 75, 49, 32 }, + { 71, 72, 73, 74, 84, 85, 86, NO_LED } +}, { // 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 - { { 0|(0<<4) }, { 7, 5 }, 4 }, - { { 0|(1<<4) }, { 31, 5 }, 4 }, - { { 0|(2<<4) }, { 43, 5 }, 4 }, - { { 0|(3<<4) }, { 55, 5 }, 4 }, - { { 0|(4<<4) }, { 67, 5 }, 4 }, - { { 0|(5<<4) }, { 85, 5 }, 4 }, - { { 0|(6<<4) }, { 97, 5 }, 4 }, - { { 0|(7<<4) }, { 109, 5 }, 4 }, - { { 6|(0<<4) }, { 121, 5 }, 4 }, - { { 6|(1<<4) }, { 139, 5 }, 4 }, - { { 6|(2<<4) }, { 151, 5 }, 4 }, - { { 6|(3<<4) }, { 163, 5 }, 4 }, - { { 6|(4<<4) }, { 175, 5 }, 4 }, - { { 6|(5<<4) }, { 193, 5 }, 4 }, - { { 6|(6<<4) }, { 205, 5 }, 1 }, - { { 6|(7<<4) }, { 217, 5 }, 4 }, + { 7, 5 }, { 31, 5 }, { 43, 5 }, { 55, 5 }, { 67, 5 }, { 85, 5 }, { 97, 5 }, { 109, 5 }, + { 121, 5 }, { 139, 5 }, { 151, 5 }, { 163, 5 }, { 175, 5 }, { 193, 5 }, { 205, 5 }, { 217, 5 }, // 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 - { { 1|(0<<4) }, { 7, 20 }, 4 }, - { { 1|(1<<4) }, { 19, 20 }, 4 }, - { { 1|(2<<4) }, { 31, 20 }, 4 }, - { { 1|(3<<4) }, { 43, 20 }, 4 }, - { { 1|(4<<4) }, { 55, 20 }, 4 }, - { { 1|(5<<4) }, { 67, 20 }, 4 }, - { { 1|(6<<4) }, { 79, 20 }, 4 }, - { { 1|(7<<4) }, { 91, 20 }, 4 }, - { { 7|(0<<4) }, { 103, 20 }, 4 }, - { { 7|(1<<4) }, { 115, 20 }, 4 }, - { { 7|(2<<4) }, { 127, 20 }, 4 }, - { { 7|(3<<4) }, { 139, 20 }, 4 }, - { { 7|(4<<4) }, { 151, 20 }, 4 }, - { { 7|(5<<4) }, { 169, 20 }, 4 }, - { { 7|(6<<4) }, { 193, 20 }, 4 }, - { { 7|(7<<4) }, { 205, 20 }, 4 }, - { { 9|(7<<4) }, { 217, 20 }, 4 }, + { 7, 20 }, { 19, 20 }, { 31, 20 }, { 43, 20 }, { 55, 20 }, { 67, 20 }, { 79, 20 }, { 91, 20 }, + { 103, 20 }, { 115, 20 }, { 127, 20 }, { 139, 20 }, { 151, 20 }, { 169, 20 }, { 193, 20 }, { 205, 20 }, + { 217, 20 }, // 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 - { { 2|(0<<4) }, { 10, 30 }, 4 }, - { { 2|(1<<4) }, { 25, 30 }, 4 }, - { { 2|(2<<4) }, { 37, 30 }, 4 }, - { { 2|(3<<4) }, { 49, 30 }, 4 }, - { { 2|(4<<4) }, { 61, 30 }, 4 }, - { { 2|(5<<4) }, { 73, 30 }, 4 }, - { { 2|(6<<4) }, { 85, 30 }, 4 }, - { { 2|(7<<4) }, { 97, 30 }, 4 }, - { { 8|(0<<4) }, { 109, 30 }, 4 }, - { { 8|(1<<4) }, { 121, 30 }, 4 }, - { { 8|(2<<4) }, { 133, 30 }, 4 }, - { { 8|(3<<4) }, { 145, 30 }, 4 }, - { { 8|(4<<4) }, { 157, 30 }, 4 }, - { { 8|(5<<4) }, { 172, 30 }, 4 }, - { { 8|(6<<4) }, { 193, 30 }, 4 }, - { { 8|(7<<4) }, { 205, 30 }, 4 }, - { { 9|(6<<4) }, { 217, 30 }, 4 }, + { 10, 30 }, { 25, 30 }, { 37, 30 }, { 49, 30 }, { 61, 30 }, { 73, 30 }, { 85, 30 }, { 97, 30 }, + { 109, 30 }, { 121, 30 }, { 133, 30 }, { 145, 30 }, { 157, 30 }, { 172, 30 }, { 193, 30 }, { 205, 30 }, + { 217, 30 }, // 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 - { { 3|(0<<4) }, { 11, 39 }, 1 }, - { { 3|(1<<4) }, { 28, 39 }, 4 }, - { { 3|(2<<4) }, { 40, 39 }, 4 }, - { { 3|(3<<4) }, { 52, 39 }, 4 }, - { { 3|(4<<4) }, { 64, 39 }, 4 }, - { { 3|(5<<4) }, { 76, 39 }, 4 }, - { { 3|(6<<4) }, { 88, 39 }, 4 }, - { { 3|(7<<4) }, { 100, 39 }, 4 }, - { { 9|(0<<4) }, { 112, 39 }, 4 }, - { { 9|(1<<4) }, { 124, 39 }, 4 }, - { { 9|(2<<4) }, { 136, 39 }, 4 }, - { { 9|(3<<4) }, { 148, 39 }, 4 }, - { { 9|(4<<4) }, { 168, 39 }, 4 }, + { 11, 39 }, { 28, 39 }, { 40, 39 }, { 52, 39 }, { 64, 39 }, { 76, 39 }, { 88, 39 }, { 100, 39 }, + { 112, 39 }, { 124, 39 }, { 136, 39 }, { 148, 39 }, { 168, 39 }, // 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 - { { 4|(0<<4) }, { 14, 49 }, 4 }, - { { 4|(1<<4) }, { 34, 49 }, 4 }, - { { 4|(2<<4) }, { 46, 49 }, 4 }, - { { 4|(3<<4) }, { 58, 49 }, 4 }, - { { 4|(4<<4) }, { 70, 49 }, 4 }, - { { 4|(5<<4) }, { 82, 49 }, 4 }, - { { 4|(6<<4) }, { 94, 49 }, 4 }, - { { 4|(7<<4) }, { 106, 49 }, 4 }, - { { 10|(0<<4) }, { 118, 49 }, 4 }, - { { 10|(1<<4) }, { 130, 49 }, 4 }, - { { 10|(2<<4) }, { 142, 49 }, 4 }, - { { 10|(3<<4) }, { 165, 49 }, 4 }, - { { 9|(5<<4) }, { 205, 49 }, 4 }, + { 14, 49 }, { 34, 49 }, { 46, 49 }, { 58, 49 }, { 70, 49 }, { 82, 49 }, { 94, 49 }, { 106, 49 }, + { 118, 49 }, { 130, 49 }, { 142, 49 }, { 165, 49 }, { 205, 49 }, // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - { { 5|(0<<4) }, { 8, 59 }, 4 }, - { { 5|(1<<4) }, { 23, 59 }, 4 }, - { { 5|(2<<4) }, { 38, 59 }, 4 }, - { { 5|(3<<4) }, { 83, 59 }, 4 }, - { { 5|(4<<4) }, { 129, 59 }, 4 }, - { { 5|(5<<4) }, { 144, 59 }, 4 }, - { { 5|(6<<4) }, { 159, 59 }, 4 }, - { { 5|(7<<4) }, { 174, 59 }, 4 }, - { { 10|(4<<4) }, { 193, 59 }, 4 }, - { { 10|(5<<4) }, { 205, 59 }, 4 }, - { { 10|(6<<4) }, { 217, 59 }, 4 }, + { 8, 59 }, { 23, 59 }, { 38, 59 }, { 83, 59 }, { 129, 59 }, { 144, 59 }, { 159, 59 }, { 174, 59 }, + { 193, 59 }, { 205, 59 }, { 217, 59 }, // Underglow / Border - { { 0xFF }, { 222, 64 }, 2 }, - { { 0xFF }, { 204, 64 }, 2 }, - { { 0xFF }, { 186, 64 }, 2 }, - { { 0xFF }, { 167, 64 }, 2 }, - { { 0xFF }, { 149, 64 }, 2 }, - { { 0xFF }, { 130, 64 }, 2 }, - { { 0xFF }, { 112, 64 }, 2 }, - { { 0xFF }, { 94, 64 }, 2 }, - { { 0xFF }, { 75, 64 }, 2 }, - { { 0xFF }, { 57, 64 }, 2 }, - { { 0xFF }, { 38, 64 }, 2 }, - { { 0xFF }, { 20, 64 }, 2 }, - { { 0xFF }, { 0, 64 }, 2 }, - { { 0xFF }, { 0, 47 }, 2 }, - { { 0xFF }, { 0, 32 }, 2 }, - { { 0xFF }, { 0, 17 }, 2 }, - { { 0xFF }, { 0, 0 }, 2 }, - { { 0xFF }, { 20, 0 }, 2 }, - { { 0xFF }, { 38, 0 }, 2 }, - { { 0xFF }, { 57, 0 }, 2 }, - { { 0xFF }, { 75, 0 }, 2 }, - { { 0xFF }, { 94, 0 }, 2 }, - { { 0xFF }, { 112, 0 }, 2 }, - { { 0xFF }, { 130, 0 }, 2 }, - { { 0xFF }, { 149, 0 }, 2 }, - { { 0xFF }, { 167, 0 }, 2 }, - { { 0xFF }, { 186, 0 }, 2 }, - { { 0xFF }, { 204, 0 }, 2 }, - { { 0xFF }, { 222, 1 }, 2 }, - { { 0xFF }, { 224, 17 }, 2 }, - { { 0xFF }, { 224, 32 }, 2 }, - { { 0xFF }, { 224, 47 }, 2 }, -}; + { 222, 64 }, { 204, 64 }, { 186, 64 }, { 167, 64 }, { 149, 64 }, { 130, 64 }, { 112, 64 }, { 94, 64 }, + { 75, 64 }, { 57, 64 }, { 38, 64 }, { 20, 64 }, { 0, 64 }, { 0, 47 }, { 0, 32 }, { 0, 17 }, + { 0, 0 }, { 20, 0 }, { 38, 0 }, { 57, 0 }, { 75, 0 }, { 94, 0 }, { 112, 0 }, { 130, 0 }, + { 149, 0 }, { 167, 0 }, { 186, 0 }, { 204, 0 }, { 222, 1 }, { 224, 17 }, { 224, 32 }, { 224, 47 } +}, { + // 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 + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1, 4, + // 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 + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, + // 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 + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, + // 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 + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, + // 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 + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, + // Underglow / Border + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + #ifdef USB_LED_INDICATOR_ENABLE void rgb_matrix_indicators_kb(void) diff --git a/keyboards/model01/leds.c b/keyboards/model01/leds.c index 0abc1f0da80..b21c1a5c8a2 100644 --- a/keyboards/model01/leds.c +++ b/keyboards/model01/leds.c @@ -46,72 +46,35 @@ void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b) { #ifdef RGB_MATRIX_ENABLE __attribute__ ((weak)) -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0x73}, { 3, 35}, 4}, - {{0x72}, { 0, 26}, 4}, - {{0x71}, { 0, 17}, 4}, - {{0x70}, { 0, 6}, 4}, - {{0x60}, { 14, 5}, 4}, - {{0x61}, { 15, 16}, 4}, - {{0x62}, { 16, 25}, 4}, - {{0x63}, { 17, 34}, 4}, - {{0x53}, { 31, 29}, 4}, - {{0x52}, { 31, 19}, 4}, - {{0x51}, { 30, 11}, 4}, - {{0x50}, { 30, 1}, 4}, - {{0x40}, { 45, 0}, 4}, - {{0x41}, { 45, 8}, 4}, - {{0x42}, { 46, 17}, 4}, - {{0x43}, { 46, 27}, 4}, - {{0x33}, { 60, 27}, 4}, - {{0x32}, { 60, 18}, 4}, - {{0x31}, { 60, 9}, 4}, - {{0x30}, { 60, 0}, 4}, - {{0x20}, { 74, 2}, 4}, - {{0x21}, { 74, 11}, 4}, - {{0x22}, { 75, 20}, 4}, - {{0x23}, { 74, 28}, 4}, - {{0x12}, { 89, 30}, 4}, - {{0x11}, { 89, 19}, 4}, - {{0x10}, { 89, 7}, 4}, - {{0x00}, { 70, 38}, 1}, - {{0x01}, { 82, 41}, 1}, - {{0x02}, { 93, 45}, 1}, - {{0x03}, {104, 50}, 1}, - {{0x13}, { 74, 64}, 1}, - {{0x67}, {149, 64}, 1}, - {{0x77}, {119, 50}, 1}, - {{0x76}, {130, 45}, 1}, - {{0x75}, {141, 41}, 1}, - {{0x74}, {153, 38}, 1}, - {{0x64}, {134, 7}, 4}, - {{0x65}, {134, 19}, 4}, - {{0x66}, {134, 30}, 4}, - {{0x57}, {149, 28}, 4}, - {{0x56}, {148, 20}, 4}, - {{0x55}, {149, 11}, 4}, - {{0x54}, {149, 2}, 4}, - {{0x44}, {163, 0}, 4}, - {{0x45}, {163, 9}, 4}, - {{0x46}, {163, 18}, 4}, - {{0x47}, {163, 27}, 4}, - {{0x37}, {177, 27}, 4}, - {{0x36}, {177, 17}, 4}, - {{0x35}, {178, 8}, 4}, - {{0x34}, {178, 0}, 4}, - {{0x24}, {193, 1}, 4}, - {{0x25}, {193, 11}, 4}, - {{0x26}, {192, 19}, 4}, - {{0x27}, {192, 29}, 4}, - {{0x17}, {206, 34}, 4}, - {{0x16}, {207, 25}, 4}, - {{0x15}, {208, 16}, 4}, - {{0x14}, {209, 5}, 4}, - {{0x04}, {224, 6}, 4}, - {{0x05}, {223, 17}, 4}, - {{0x06}, {223, 26}, 4}, - {{0x07}, {220, 35}, 4}, -}; +led_config_t g_led_config = { { + { 27, 26, 20, 19, 12, 11, 4, 3 }, + { 28, 25, 21, 18, 13, 10, 5, 2 }, + { 29, 24, 22, 17, 14, 9, 6, 1 }, + { 30, 31, 23, 16, 15, 8, 7, 0 }, + { 60, 59, 52, 51, 44, 43, 37, 36 }, + { 61, 58, 53, 50, 45, 42, 38, 35 }, + { 62, 57, 54, 49, 46, 41, 39, 34 }, + { 63, 56, 55, 48, 47, 40, 32, 33 } +}, { + { 3, 35 }, { 0, 26 }, { 0, 17 }, { 0, 6 }, { 14, 5 }, { 15, 16 }, { 16, 25 }, { 17, 34 }, + { 31, 29 }, { 31, 19 }, { 30, 11 }, { 30, 1 }, { 45, 0 }, { 45, 8 }, { 46, 17 }, { 46, 27 }, + { 60, 27 }, { 60, 18 }, { 60, 9 }, { 60, 0 }, { 74, 2 }, { 74, 11 }, { 75, 20 }, { 74, 28 }, + { 89, 30 }, { 89, 19 }, { 89, 7 }, { 70, 38 }, { 82, 41 }, { 93, 45 }, { 104, 50 }, { 74, 64 }, + { 149, 64 }, { 119, 50 }, { 130, 45 }, { 141, 41 }, { 153, 38 }, { 134, 7 }, { 134, 19 }, { 134, 30 }, + { 149, 28 }, { 148, 20 }, { 149, 11 }, { 149, 2 }, { 163, 0 }, { 163, 9 }, { 163, 18 }, { 163, 27 }, + { 177, 27 }, { 177, 17 }, { 178, 8 }, { 178, 0 }, { 193, 1 }, { 193, 11 }, { 192, 19 }, { 192, 29 }, + { 206, 34 }, { 207, 25 }, { 208, 16 }, { 209, 5 }, { 224, 6 }, { 223, 17 }, { 223, 26 }, { 220, 35 } +}, { + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4 +} }; + static struct { uint8_t b; diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index 94f50718964..3ad694c4a32 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -79,63 +79,27 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5 }, + { 12, 13, 14, 15, 16, 17 }, + { 24, 25, 26, 27, 28, 29 }, + { 36, 37, 38, 45, 46, NO_LED }, + { 6, 7, 8, 9, 10, 11 }, + { 18, 19, 20, 21, 22, 23 }, + { 30, 31, 32, 33, 34, 35 }, + { 42, 43, 44, 39, 40, 41 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 111, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1 +} }; - /*{row | col << 4} - | {x=0..224, y=0..64} - | | flags - | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, - {{4|(0<<4)}, {20.36*6, 21.33*0}, 4}, - {{4|(1<<4)}, {20.36*7, 21.33*0}, 4}, - {{4|(2<<4)}, {20.36*8, 21.33*0}, 4}, - {{4|(3<<4)}, {20.36*9, 21.33*0}, 4}, - {{4|(4<<4)}, {20.36*10,21.33*0}, 4}, - {{4|(5<<4)}, {20.36*11,21.33*0}, 1}, - - {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, - {{5|(0<<4)}, {20.36*6, 21.33*1}, 4}, - {{5|(1<<4)}, {20.36*7, 21.33*1}, 4}, - {{5|(2<<4)}, {20.36*8, 21.33*1}, 4}, - {{5|(3<<4)}, {20.36*9, 21.33*1}, 4}, - {{5|(4<<4)}, {20.36*10,21.33*1}, 4}, - {{5|(5<<4)}, {20.36*11,21.33*1}, 1}, - - {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, - {{6|(0<<4)}, {20.36*6, 21.33*2}, 4}, - {{6|(1<<4)}, {20.36*7, 21.33*2}, 4}, - {{6|(2<<4)}, {20.36*8, 21.33*2}, 4}, - {{6|(3<<4)}, {20.36*9, 21.33*2}, 4}, - {{6|(4<<4)}, {20.36*10,21.33*2}, 4}, - {{6|(5<<4)}, {20.36*11,21.33*2}, 1}, - - {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, - {{3|(1<<4)}, {20.36*1, 21.33*3}, 1}, - {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, - {{7|(3<<4)}, {20.36*3, 21.33*3}, 1}, - {{7|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{7|(5<<4)}, {20.36*5.5,21.33*3}, 4}, - {{7|(0<<4)}, {20.36*7, 21.33*3}, 1}, - {{7|(1<<4)}, {20.36*8, 21.33*3}, 1}, - {{7|(2<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(3<<4)}, {20.36*10,21.33*3}, 1}, - {{3|(4<<4)}, {20.36*11,21.33*3}, 1} -}; void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c index 5b7177c6c99..0ffff4e695b 100644 --- a/keyboards/planck/keymaps/tom/keymap.c +++ b/keyboards/planck/keymaps/tom/keymap.c @@ -224,14 +224,16 @@ bool music_mask_user(uint16_t keycode) { } } +#ifdef RGB_MATRIX_ENABLE +extern led_config_t g_led_config; +#endif + void rgb_matrix_indicators_user(void) { #ifdef RGB_MATRIX_ENABLE - rgb_led led; switch (biton32(layer_state)) { case _RAISE: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); } else { rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); @@ -241,8 +243,7 @@ void rgb_matrix_indicators_user(void) { case _LOWER: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); } else { rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c index 178d28274c4..896ec44587c 100644 --- a/keyboards/planck/light/light.c +++ b/keyboards/planck/light/light.c @@ -77,65 +77,24 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_14, C8_14, C7_14} }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - - /*{row | col << 4} - | {x=0..224, y=0..64} - | | flags - | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, - {{0|(6<<4)}, {20.36*6, 21.33*0}, 4}, - {{0|(7<<4)}, {20.36*7, 21.33*0}, 4}, - {{0|(8<<4)}, {20.36*8, 21.33*0}, 4}, - {{0|(9<<4)}, {20.36*9, 21.33*0}, 4}, - {{0|(10<<4)}, {20.36*10,21.33*0}, 4}, - {{0|(11<<4)}, {20.36*11,21.33*0}, 1}, - - {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, - {{1|(6<<4)}, {20.36*6, 21.33*1}, 4}, - {{1|(7<<4)}, {20.36*7, 21.33*1}, 4}, - {{1|(8<<4)}, {20.36*8, 21.33*1}, 4}, - {{1|(9<<4)}, {20.36*9, 21.33*1}, 4}, - {{1|(10<<4)}, {20.36*10,21.33*1}, 4}, - {{1|(11<<4)}, {20.36*11,21.33*1}, 1}, - - {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, - {{2|(6<<4)}, {20.36*6, 21.33*2}, 4}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, - {{2|(10<<4)}, {20.36*10,21.33*2}, 4}, - {{2|(11<<4)}, {20.36*11,21.33*2}, 1}, - - {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, - {{3|(1<<4)}, {20.36*1, 21.33*3}, 1}, - {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, - {{3|(3<<4)}, {20.36*3, 21.33*3}, 1}, - {{3|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{3|(5<<4)}, {20.36*5, 21.33*3}, 4}, - {{3|(5<<4)}, {20.36*5.5,21.33*3}, 4}, - {{3|(6<<4)}, {20.36*6, 21.33*3}, 4}, - {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, - {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, - {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(10<<4)}, {20.36*10,21.33*3}, 1}, - {{3|(11<<4)}, {20.36*11,21.33*3}, 1} -}; +led_config_t g_led_config = { { + { 0, 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, 43, 44, 45, 46, 47, 48 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 101, 63 }, { 111, 63 }, { 122, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, + { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 1, + 1 +} }; void matrix_init_kb(void) { @@ -151,6 +110,16 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) return process_record_user(keycode, record); } +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + // Spacebar has 2 leds 41 & 42, so add 42 to the array here, and 41 will be added + // by the default lookup code that runs after this + if (row == 3 && column == 5) { + led_i[0] = 42; + return 1; + } + return 0; +} + void matrix_scan_kb(void) { matrix_scan_user(); diff --git a/keyboards/sol/rev1/rev1.c b/keyboards/sol/rev1/rev1.c index 23896860e58..68e64af79e8 100644 --- a/keyboards/sol/rev1/rev1.c +++ b/keyboards/sol/rev1/rev1.c @@ -1,83 +1,46 @@ #include "quantum.h" #ifdef RGB_MATRIX_ENABLE - rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 0, 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 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 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, 64, 65, 66, 67, 68, 68 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 68, 68 } +}, { // Left Hand Mapped Left to Right - { { 0 | (0 << 4) }, { 0, 0 }, 1}, - { { 0 | (1 << 4) }, { 22, 0 }, 4}, - { { 0 | (2 << 4) }, { 37, 0 }, 4}, - { { 0 | (3 << 4) }, { 37, 0 }, 4}, - { { 0 | (4 << 4) }, { 67, 0 }, 4}, - { { 0 | (5 << 4) }, { 82, 0 }, 4}, - { { 0 | (6 << 4) }, { 104, 0 }, 1}, - { { 1 | (0 << 4) }, { 0, 16 }, 1}, - { { 1 | (1 << 4) }, { 22, 16 }, 4}, - { { 1 | (2 << 4) }, { 37, 16 }, 4}, - { { 1 | (3 << 4) }, { 37, 16 }, 4}, - { { 1 | (4 << 4) }, { 67, 16 }, 4}, - { { 1 | (5 << 4) }, { 82, 16 }, 4}, - { { 1 | (6 << 4) }, { 104, 16 }, 1}, - { { 2 | (0 << 4) }, { 0, 32 }, 1}, - { { 2 | (1 << 4) }, { 22, 32 }, 4}, - { { 2 | (2 << 4) }, { 37, 32 }, 4}, - { { 2 | (3 << 4) }, { 37, 32 }, 4}, - { { 2 | (4 << 4) }, { 67, 32 }, 4}, - { { 2 | (5 << 4) }, { 82, 32 }, 4}, - { { 2 | (6 << 4) }, { 104, 32 }, 1}, - { { 3 | (0 << 4) }, { 0, 48 }, 1}, - { { 3 | (1 << 4) }, { 22, 48 }, 4}, - { { 3 | (2 << 4) }, { 37, 48 }, 4}, - { { 3 | (3 << 4) }, { 37, 48 }, 4}, - { { 3 | (4 << 4) }, { 67, 48 }, 4}, - { { 3 | (5 << 4) }, { 82, 48 }, 4}, - { { 3 | (6 << 4) }, { 104, 48 }, 1}, - { { 4 | (0 << 4) }, { 0, 64 }, 1}, - { { 4 | (1 << 4) }, { 22, 64 }, 1}, - { { 4 | (2 << 4) }, { 37, 64 }, 1}, - { { 4 | (3 << 4) }, { 37, 64 }, 1}, - { { 4 | (4 << 4) }, { 67, 64 }, 1}, - // These two control the 4 LEDs in the thumb cluster - // Top keys are { 4 | (5 << 4) & { 4 | (6 << 4) - { { 5 | (5 << 4) }, { 89, 45 }, 1}, - { { 5 | (6 << 4) }, { 97, 55 }, 1}, + { 0, 0 }, { 22, 0 }, { 37, 0 }, { 37, 0 }, { 67, 0 }, { 82, 0 }, { 104, 0 }, + { 0, 16 }, { 22, 16 }, { 37, 16 }, { 37, 16 }, { 67, 16 }, { 82, 16 }, { 104, 16 }, + { 0, 32 }, { 22, 32 }, { 37, 32 }, { 37, 32 }, { 67, 32 }, { 82, 32 }, { 104, 32 }, + { 0, 48 }, { 22, 48 }, { 37, 48 }, { 37, 48 }, { 67, 48 }, { 82, 48 }, { 104, 48 }, + { 0, 64 }, { 22, 64 }, { 37, 64 }, { 37, 64 }, { 67, 64 }, { 89, 45 }, { 97, 55 }, // Left Hand Mapped Right to Left - { { 6 | (0 << 4) }, { 224, 0 }, 1}, - { { 6 | (1 << 4) }, { 202, 0 }, 4}, - { { 6 | (2 << 4) }, { 187, 0 }, 4}, - { { 6 | (3 << 4) }, { 172, 0 }, 4}, - { { 6 | (4 << 4) }, { 157, 0 }, 4}, - { { 6 | (5 << 4) }, { 142, 0 }, 4}, - { { 6 | (6 << 4) }, { 120, 0 }, 1}, - { { 7 | (0 << 4) }, { 224, 16 }, 1}, - { { 7 | (1 << 4) }, { 202, 16 }, 4}, - { { 7 | (2 << 4) }, { 187, 16 }, 4}, - { { 7 | (3 << 4) }, { 172, 16 }, 4}, - { { 7 | (4 << 4) }, { 157, 16 }, 4}, - { { 7 | (5 << 4) }, { 142, 16 }, 4}, - { { 7 | (6 << 4) }, { 120, 16 }, 1}, - { { 8 | (0 << 4) }, { 224, 32 }, 1}, - { { 8 | (1 << 4) }, { 202, 32 }, 4}, - { { 8 | (2 << 4) }, { 187, 32 }, 4}, - { { 8 | (3 << 4) }, { 172, 32 }, 4}, - { { 8 | (4 << 4) }, { 157, 32 }, 4}, - { { 8 | (5 << 4) }, { 142, 32 }, 4}, - { { 8 | (6 << 4) }, { 120, 32 }, 1}, - { { 9 | (0 << 4) }, { 224, 48 }, 1}, - { { 9 | (1 << 4) }, { 202, 48 }, 4}, - { { 9 | (2 << 4) }, { 187, 48 }, 4}, - { { 9 | (3 << 4) }, { 172, 48 }, 4}, - { { 9 | (4 << 4) }, { 157, 48 }, 4}, - { { 9 | (5 << 4) }, { 142, 48 }, 4}, - { { 9 | (6 << 4) }, { 120, 48 }, 1}, - { { 10 | (0 << 4) }, { 224, 64 }, 1}, - { { 10 | (1 << 4) }, { 202, 64 }, 1}, - { { 10 | (2 << 4) }, { 187, 64 }, 1}, - { { 10 | (3 << 4) }, { 172, 64 }, 1}, - { { 10 | (4 << 4) }, { 157, 64 }, 1}, - // These two control the 4 LEDs in the thumb cluster - // Top keys are { 10 | (5 << 4) & { 10 | (6 << 4) - { { 11 | (5 << 4) }, { 135, 45 }, 1}, - { { 11 | (6 << 4) }, { 127, 55 }, 1} - }; + { 224, 0 }, { 202, 0 }, { 187, 0 }, { 172, 0 }, { 157, 0 }, { 142, 0 }, { 120, 0 }, + { 224, 16 }, { 202, 16 }, { 187, 16 }, { 172, 16 }, { 157, 16 }, { 142, 16 }, { 120, 16 }, + { 224, 32 }, { 202, 32 }, { 187, 32 }, { 172, 32 }, { 157, 32 }, { 142, 32 }, { 120, 32 }, + { 224, 48 }, { 202, 48 }, { 187, 48 }, { 172, 48 }, { 157, 48 }, { 142, 48 }, { 120, 48 }, + { 224, 64 }, { 202, 64 }, { 187, 64 }, { 172, 64 }, { 157, 64 }, { 135, 45 }, { 127, 55 } +}, { + // Left Hand Mapped Left to Right + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, + // Left Hand Mapped Right to Left + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1 +} }; + #endif diff --git a/keyboards/sol/sol.c b/keyboards/sol/sol.c index a65d4c15fc7..5945cc60a4f 100644 --- a/keyboards/sol/sol.c +++ b/keyboards/sol/sol.c @@ -1,20 +1 @@ #include "sol.h" - -#if defined(RGB_MATRIX_ENABLE) -uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { - if (row == 4 && column == 5) { - led_i[0] = 33; - return 1; - } else if (row == 4 && column == 6) { - led_i[0] = 34; - return 1; - } else if (row == 10 && column == 5) { - led_i[0] = 68; - return 1; - } else if (row == 10 && column == 6) { - led_i[0] = 69; - return 1; - } - return 0; -} -#endif diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index eeb21501bab..3cfce966beb 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -403,11 +403,10 @@ void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } -void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { - rgb_led led; +extern led_config_t g_led_config; +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 5eef2e02342..e8dc185a1bb 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -184,11 +184,10 @@ void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 5528a083473..edbcee9cd1f 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -105,6 +105,7 @@ bool g_suspend_state = false; +extern led_config_t g_led_config; rgb_config_t rgb_matrix_config; rgb_counters_t g_rgb_counters; @@ -150,14 +151,11 @@ uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t } uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { - // TODO: This is kinda expensive, fix this soonish uint8_t led_count = rgb_matrix_map_row_column_to_led_kb(row, column, led_i); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL && led_count < LED_HITS_TO_REMEMBER; i++) { - matrix_co_t matrix_co = g_rgb_leds[i].matrix_co; - if (row == matrix_co.row && column == matrix_co.col) { - led_i[led_count] = i; - led_count++; - } + uint8_t led_index = g_led_config.matrix_co[row][column]; + if (led_index != NO_LED) { + led_i[led_count] = led_index; + led_count++; } return led_count; } @@ -201,8 +199,8 @@ bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { for(uint8_t i = 0; i < led_count; i++) { uint8_t index = last_hit_buffer.count; - last_hit_buffer.x[index] = g_rgb_leds[led[i]].point.x; - last_hit_buffer.y[index] = g_rgb_leds[led[i]].point.y; + last_hit_buffer.x[index] = g_led_config.point[led[i]].x; + last_hit_buffer.y[index] = g_led_config.point[led[i]].y; last_hit_buffer.index[index] = led[i]; last_hit_buffer.tick[index] = 0; last_hit_buffer.count++; diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 33665ffff2a..365a92bbf6a 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -54,9 +54,7 @@ uint8_t max = DRIVER_LED_TOTAL; #endif -#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) continue - -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) continue typedef struct { diff --git a/quantum/rgb_matrix_animations/alpha_mods_anim.h b/quantum/rgb_matrix_animations/alpha_mods_anim.h index 4bd01c4fc83..d7f6f4655b8 100644 --- a/quantum/rgb_matrix_animations/alpha_mods_anim.h +++ b/quantum/rgb_matrix_animations/alpha_mods_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; // alphas = color1, mods = color2 @@ -15,7 +15,7 @@ bool rgb_matrix_alphas_mods(effect_params_t* params) { for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - if (HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); } else { rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h index 513dff12812..e93798f9006 100644 --- a/quantum/rgb_matrix_animations/cycle_all_anim.h +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_all(effect_params_t* params) { diff --git a/quantum/rgb_matrix_animations/cycle_left_right_anim.h b/quantum/rgb_matrix_animations/cycle_left_right_anim.h index 428adea2235..4b09d5826b5 100644 --- a/quantum/rgb_matrix_animations/cycle_left_right_anim.h +++ b/quantum/rgb_matrix_animations/cycle_left_right_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_left_right(effect_params_t* params) { @@ -12,8 +12,7 @@ bool rgb_matrix_cycle_left_right(effect_params_t* params) { uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = point.x - time; + hsv.h = g_led_config.point[i].x - time; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/cycle_up_down_anim.h b/quantum/rgb_matrix_animations/cycle_up_down_anim.h index ea63095d2e3..403214bb73b 100644 --- a/quantum/rgb_matrix_animations/cycle_up_down_anim.h +++ b/quantum/rgb_matrix_animations/cycle_up_down_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_up_down(effect_params_t* params) { @@ -12,8 +12,7 @@ bool rgb_matrix_cycle_up_down(effect_params_t* params) { uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = point.y - time; + hsv.h = g_led_config.point[i].y - time; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/dual_beacon_anim.h b/quantum/rgb_matrix_animations/dual_beacon_anim.h index 00f6e508801..dcb594029eb 100644 --- a/quantum/rgb_matrix_animations/dual_beacon_anim.h +++ b/quantum/rgb_matrix_animations/dual_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_dual_beacon(effect_params_t* params) { @@ -14,8 +14,7 @@ bool rgb_matrix_dual_beacon(effect_params_t* params) { int8_t sin_value = sin8(time) - 128; for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; + hsv.h = ((g_led_config.point[i].y - 32) * cos_value + (g_led_config.point[i].x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/gradient_up_down_anim.h b/quantum/rgb_matrix_animations/gradient_up_down_anim.h index 05117540aeb..7a6ed142197 100644 --- a/quantum/rgb_matrix_animations/gradient_up_down_anim.h +++ b/quantum/rgb_matrix_animations/gradient_up_down_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_gradient_up_down(effect_params_t* params) { @@ -11,10 +11,9 @@ bool rgb_matrix_gradient_up_down(effect_params_t* params) { uint8_t scale = scale8(64, rgb_matrix_config.speed); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; // The y range will be 0..64, map this to 0..4 // Relies on hue being 8-bit and wrapping - hsv.h = rgb_matrix_config.hue + scale * (point.y >> 4); + hsv.h = rgb_matrix_config.hue + scale * (g_led_config.point[i].y >> 4); RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h index dffa5326433..5ea971435e9 100644 --- a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h @@ -2,11 +2,11 @@ #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; static void jellybean_raindrops_set_color(int i, effect_params_t* params) { - if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.val }; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); diff --git a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h index 89f6965c33d..d4628807311 100644 --- a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_beacon(effect_params_t* params) { @@ -14,8 +14,7 @@ bool rgb_matrix_rainbow_beacon(effect_params_t* params) { int16_t sin_value = 2 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; + hsv.h = ((g_led_config.point[i].y - 32) * cos_value + (g_led_config.point[i].x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h index 0d57aef57bd..3b7d9689f84 100644 --- a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { @@ -12,8 +12,7 @@ bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = abs8(point.y - 32) + (point.x - time) + rgb_matrix_config.hue; + hsv.h = abs8(g_led_config.point[i].y - 32) + (g_led_config.point[i].x - time) + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h index 03652758c65..e92f351765a 100644 --- a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { @@ -14,8 +14,7 @@ bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { int16_t sin_value = 3 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = ((point.y - 32) * cos_value + (56 - abs8(point.x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; + hsv.h = ((g_led_config.point[i].y - 32) * cos_value + (56 - abs8(g_led_config.point[i].x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index 0e3a878642b..4ce1d65e577 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h @@ -3,10 +3,11 @@ #include "rgb_matrix_types.h" extern rgb_counters_t g_rgb_counters; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; static void raindrops_set_color(int i, effect_params_t* params) { - if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; // Take the shortest path between hues diff --git a/quantum/rgb_matrix_animations/solid_color_anim.h b/quantum/rgb_matrix_animations/solid_color_anim.h index 033c1f93334..ba2cea15e32 100644 --- a/quantum/rgb_matrix_animations/solid_color_anim.h +++ b/quantum/rgb_matrix_animations/solid_color_anim.h @@ -1,5 +1,6 @@ #pragma once +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_solid_color(effect_params_t* params) { diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h index 82483653aeb..c3dba8a5af9 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h @@ -2,6 +2,7 @@ #if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h index 1dec1886d17..8858f71e608 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -13,11 +13,10 @@ static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_par uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { RGB_MATRIX_TEST_LED_FLAGS(); - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); int16_t dist2 = 16; uint8_t dist3; diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h index 8952a1e2bff..c0e3c245079 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -13,11 +13,10 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { RGB_MATRIX_TEST_LED_FLAGS(); - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); int16_t dist2 = 8; uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h index 9fc4d527a87..abc7e36a893 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h @@ -2,6 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h index d86cb128449..3d1d38e8060 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -13,11 +13,10 @@ static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_para uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { RGB_MATRIX_TEST_LED_FLAGS(); - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) + dist * 5; if (effect > 255) diff --git a/quantum/rgb_matrix_animations/solid_splash_anim.h b/quantum/rgb_matrix_animations/solid_splash_anim.h index 14312f33dae..4e5565d0d32 100644 --- a/quantum/rgb_matrix_animations/solid_splash_anim.h +++ b/quantum/rgb_matrix_animations/solid_splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -14,10 +14,9 @@ static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* p for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; if (effect > 255) diff --git a/quantum/rgb_matrix_animations/splash_anim.h b/quantum/rgb_matrix_animations/splash_anim.h index 3c96d451e1a..fbe7761117b 100644 --- a/quantum/rgb_matrix_animations/splash_anim.h +++ b/quantum/rgb_matrix_animations/splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,10 +15,9 @@ static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) RGB_MATRIX_TEST_LED_FLAGS(); hsv.h = rgb_matrix_config.hue; hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; if (effect > 255) diff --git a/quantum/rgb_matrix_types.h b/quantum/rgb_matrix_types.h index 7a3bc6714f5..f890edd94f8 100644 --- a/quantum/rgb_matrix_types.h +++ b/quantum/rgb_matrix_types.h @@ -59,14 +59,6 @@ typedef struct PACKED { uint8_t y; } point_t; -typedef union { - uint8_t raw; - struct { - uint8_t row:4; // 16 max - uint8_t col:4; // 16 max - }; -} matrix_co_t; - #define HAS_FLAGS(bits, flags) ((bits & flags) == flags) #define HAS_ANY_FLAGS(bits, flags) ((bits & flags) != 0x00) @@ -76,11 +68,13 @@ typedef union { #define LED_FLAG_UNDERGLOW 0x02 #define LED_FLAG_KEYLIGHT 0x04 +#define NO_LED 255 + typedef struct PACKED { - matrix_co_t matrix_co; - point_t point; - uint8_t flags; -} rgb_led; + uint8_t matrix_co[MATRIX_ROWS][MATRIX_COLS]; + point_t point[DRIVER_LED_TOTAL]; + uint8_t flags[DRIVER_LED_TOTAL]; +} led_config_t; typedef union { uint32_t raw; diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index a2eab1b563e..ea067a7439a 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -431,6 +431,7 @@ static void led_run_pattern(led_setup_t *f, float* ro, float* go, float* bo, flo } } +extern led_config_t g_led_config; static void led_matrix_massdrop_config_override(int i) { float ro = 0; @@ -438,14 +439,14 @@ static void led_matrix_massdrop_config_override(int i) float bo = 0; float po = (led_animation_orientation) - ? (float)g_rgb_leds[i].point.y / 64.f * 100 - : (float)g_rgb_leds[i].point.x / 224.f * 100; + ? (float)g_led_config.point[i].y / 64.f * 100 + : (float)g_led_config.point[i].x / 224.f * 100; uint8_t highest_active_layer = biton32(layer_state); - if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { + if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { //Do not act on this LED - } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { + } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { //Do not act on this LED } else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) { //Do not act on this LED (Only show indicators) From 60eae7335b711e8d4be7d48ad2290141e04debe7 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 7 May 2019 21:17:00 -0500 Subject: [PATCH 119/129] RGB Matrix Typing Heatmap (#5786) * RGB Matrix Typing Heatmap Effect * Fixing file name and effect init --- docs/feature_rgb_matrix.md | 4 + quantum/rgb_matrix.c | 21 ++++++ quantum/rgb_matrix.h | 5 ++ .../rgb_matrix_animations/digital_rain_anim.h | 33 ++++---- .../typing_heatmap_anim.h | 75 +++++++++++++++++++ 5 files changed, 123 insertions(+), 15 deletions(-) create mode 100644 quantum/rgb_matrix_animations/typing_heatmap_anim.h diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 5eb9d5536e1..1e434146761 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -201,7 +201,10 @@ enum rgb_matrix_effects { RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard RGB_MATRIX_RAINDROPS, // Randomly changes a single key's hue RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation +#if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM! RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation +#endif #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) RGB_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit to hue & value then fades value out RGB_MATRIX_SOLID_REACTIVE, // Static single hue, pulses keys hit to shifted hue then fades to current hue @@ -237,6 +240,7 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con |`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | |`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` | |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` | diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index edbcee9cd1f..92a94df80ff 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -38,6 +38,7 @@ #include "rgb_matrix_animations/rainbow_pinwheels_anim.h" #include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" #include "rgb_matrix_animations/jellybean_raindrops_anim.h" +#include "rgb_matrix_animations/typing_heatmap_anim.h" #include "rgb_matrix_animations/digital_rain_anim.h" #include "rgb_matrix_animations/solid_reactive_simple_anim.h" #include "rgb_matrix_animations/solid_reactive_anim.h" @@ -111,6 +112,10 @@ rgb_config_t rgb_matrix_config; rgb_counters_t g_rgb_counters; static uint32_t rgb_counters_buffer; +#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS +uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS] = {{0}}; +#endif + #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED last_hit_t g_last_hit_tracker; static last_hit_t last_hit_buffer; @@ -206,6 +211,13 @@ bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { last_hit_buffer.count++; } #endif // RGB_MATRIX_KEYREACTIVE_ENABLED + +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) + if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) { + process_rgb_matrix_typing_heatmap(record); + } +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) + return true; } @@ -370,11 +382,20 @@ static void rgb_task_render(uint8_t effect) { rendering = rgb_matrix_jellybean_raindrops(&rgb_effect_params); // Max 1ms Avg 0ms break; #endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS + +#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS +#ifndef DISABLE_RGB_MATRIX_TYPING_HEATMAP + case RGB_MATRIX_TYPING_HEATMAP: + rendering = rgb_matrix_typing_heatmap(&rgb_effect_params); // Max 4ms Avg 3ms + break; +#endif // DISABLE_RGB_MATRIX_TYPING_HEATMAP #ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN case RGB_MATRIX_DIGITAL_RAIN: rendering = rgb_matrix_digital_rain(&rgb_effect_params); // Max 9ms Avg 8ms | this is expensive, fix it break; #endif // DISABLE_RGB_MATRIX_DIGITAL_RAIN +#endif // RGB_MATRIX_FRAMEBUFFER_EFFECTS + #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE case RGB_MATRIX_SOLID_REACTIVE_SIMPLE: diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 365a92bbf6a..add0715d9f3 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -101,9 +101,14 @@ enum rgb_matrix_effects { #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS RGB_MATRIX_JELLYBEAN_RAINDROPS, #endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS +#ifndef DISABLE_RGB_MATRIX_TYPING_HEATMAP + RGB_MATRIX_TYPING_HEATMAP, +#endif // DISABLE_RGB_MATRIX_TYPING_HEATMAP #ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN RGB_MATRIX_DIGITAL_RAIN, #endif // DISABLE_RGB_MATRIX_DIGITAL_RAIN +#endif // RGB_MATRIX_FRAMEBUFFER_EFFECTS #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE RGB_MATRIX_SOLID_REACTIVE_SIMPLE, diff --git a/quantum/rgb_matrix_animations/digital_rain_anim.h b/quantum/rgb_matrix_animations/digital_rain_anim.h index 4ba3c1c87d6..6ccba392aab 100644 --- a/quantum/rgb_matrix_animations/digital_rain_anim.h +++ b/quantum/rgb_matrix_animations/digital_rain_anim.h @@ -1,11 +1,13 @@ #pragma once -#ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) #ifndef RGB_DIGITAL_RAIN_DROPS // lower the number for denser effect/wider keyboard #define RGB_DIGITAL_RAIN_DROPS 24 #endif +extern uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS]; + bool rgb_matrix_digital_rain(effect_params_t* params) { // algorithm ported from https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain const uint8_t drop_ticks = 28; @@ -13,24 +15,24 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { const uint8_t max_brightness_boost = 0xc0; const uint8_t max_intensity = 0xff; - static uint8_t map[MATRIX_COLS][MATRIX_ROWS] = {{0}}; static uint8_t drop = 0; if (params->init) { rgb_matrix_set_color_all(0, 0, 0); - memset(map, 0, sizeof map); + memset(rgb_frame_buffer, 0, sizeof rgb_frame_buffer); drop = 0; } + for (uint8_t col = 0; col < MATRIX_COLS; col++) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { // top row, pixels have just fallen and we're // making a new rain drop in this column - map[col][row] = max_intensity; + rgb_frame_buffer[col][row] = max_intensity; } - else if (map[col][row] > 0 && map[col][row] < max_intensity) { + else if (rgb_frame_buffer[col][row] > 0 && rgb_frame_buffer[col][row] < max_intensity) { // neither fully bright nor dark, decay it - map[col][row]--; + rgb_frame_buffer[col][row]--; } // set the pixel colour uint8_t led[LED_HITS_TO_REMEMBER]; @@ -38,32 +40,33 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { // TODO: multiple leds are supported mapped to the same row/column if (led_count > 0) { - if (map[col][row] > pure_green_intensity) { - const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (map[col][row] - pure_green_intensity) / (max_intensity - pure_green_intensity)); + if (rgb_frame_buffer[col][row] > pure_green_intensity) { + const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (rgb_frame_buffer[col][row] - pure_green_intensity) / (max_intensity - pure_green_intensity)); rgb_matrix_set_color(led[0], boost, max_intensity, boost); } else { - const uint8_t green = (uint8_t) ((uint16_t) max_intensity * map[col][row] / pure_green_intensity); + const uint8_t green = (uint8_t) ((uint16_t) max_intensity * rgb_frame_buffer[col][row] / pure_green_intensity); rgb_matrix_set_color(led[0], 0, green, 0); } } } } + if (++drop > drop_ticks) { // reset drop timer drop = 0; for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { // if ths is on the bottom row and bright allow decay - if (row == MATRIX_ROWS - 1 && map[col][row] == max_intensity) { - map[col][row]--; + if (row == MATRIX_ROWS - 1 && rgb_frame_buffer[col][row] == max_intensity) { + rgb_frame_buffer[col][row]--; } // check if the pixel above is bright - if (map[col][row - 1] == max_intensity) { + if (rgb_frame_buffer[col][row - 1] == max_intensity) { // allow old bright pixel to decay - map[col][row - 1]--; + rgb_frame_buffer[col][row - 1]--; // make this pixel bright - map[col][row] = max_intensity; + rgb_frame_buffer[col][row] = max_intensity; } } } @@ -71,4 +74,4 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { return false; } -#endif // DISABLE_RGB_MATRIX_DIGITAL_RAIN +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) diff --git a/quantum/rgb_matrix_animations/typing_heatmap_anim.h b/quantum/rgb_matrix_animations/typing_heatmap_anim.h new file mode 100644 index 00000000000..aade53fccc1 --- /dev/null +++ b/quantum/rgb_matrix_animations/typing_heatmap_anim.h @@ -0,0 +1,75 @@ +#pragma once +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) + +extern rgb_config_t rgb_matrix_config; +extern uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS]; + +void process_rgb_matrix_typing_heatmap(keyrecord_t *record) { + uint8_t row = record->event.key.row; + uint8_t col = record->event.key.col; + uint8_t m_row = row - 1; + uint8_t p_row = row + 1; + uint8_t m_col = col - 1; + uint8_t p_col = col + 1; + + if (m_col < col) + rgb_frame_buffer[row][m_col] = qadd8(rgb_frame_buffer[row][m_col], 16); + rgb_frame_buffer[row][col] = qadd8(rgb_frame_buffer[row][col], 32); + if (p_col < MATRIX_COLS) + rgb_frame_buffer[row][p_col] = qadd8(rgb_frame_buffer[row][p_col], 16); + + if (p_row < MATRIX_ROWS) { + if (m_col < col) + rgb_frame_buffer[p_row][m_col] = qadd8(rgb_frame_buffer[p_row][m_col], 13); + rgb_frame_buffer[p_row][col] = qadd8(rgb_frame_buffer[p_row][col], 16); + if (p_col < MATRIX_COLS) + rgb_frame_buffer[p_row][p_col] = qadd8(rgb_frame_buffer[p_row][p_col], 13); + } + + if (m_row < row) { + if (m_col < col) + rgb_frame_buffer[m_row][m_col] = qadd8(rgb_frame_buffer[m_row][m_col], 13); + rgb_frame_buffer[m_row][col] = qadd8(rgb_frame_buffer[m_row][col], 16); + if (p_col < MATRIX_COLS) + rgb_frame_buffer[m_row][p_col] = qadd8(rgb_frame_buffer[m_row][p_col], 13); + } +} + +bool rgb_matrix_typing_heatmap(effect_params_t* params) { + // Modified version of RGB_MATRIX_USE_LIMITS to work off of matrix row / col size + uint8_t led_min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; + uint8_t led_max = led_min + RGB_MATRIX_LED_PROCESS_LIMIT; + if (led_max > sizeof(rgb_frame_buffer)) + led_max = sizeof(rgb_frame_buffer); + + if (params->init) { + rgb_matrix_set_color_all(0, 0, 0); + memset(rgb_frame_buffer, 0, sizeof rgb_frame_buffer); + } + + // Render heatmap & decrease + for (int i = led_min; i < led_max; i++) { + uint8_t row = i % MATRIX_ROWS; + uint8_t col = i / MATRIX_ROWS; + uint8_t val = rgb_frame_buffer[row][col]; + + // set the pixel colour + uint8_t led[LED_HITS_TO_REMEMBER]; + uint8_t led_count = rgb_matrix_map_row_column_to_led(row, col, led); + for (uint8_t j = 0; j < led_count; ++j) + { + if (!HAS_ANY_FLAGS(g_led_config.flags[led[j]], params->flags)) + continue; + + HSV hsv = { 170 - qsub8(val, 85), rgb_matrix_config.sat, scale8((qadd8(170, val) - 170) * 3, rgb_matrix_config.val) }; + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(led[j], rgb.r, rgb.g, rgb.b); + } + + rgb_frame_buffer[row][col] = qsub8(val, 1); + } + + return led_max < sizeof(rgb_frame_buffer); +} + +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) From e52930df245137fdc4cfdda2db94e8ca927f3301 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 7 May 2019 21:39:31 -0700 Subject: [PATCH 120/129] [Keyboard] Add Noxary 280 (#5814) * initial commit * fixup script issues * define pins used and create an appropriate LAYOUT macro * create an appropriate keymap * turn on backlight and bootmagic lite * add QMK Configurator support * fixup readme * remove doubly defined KC_TRNS from keymap * add support for Caps lock and Scroll lock LEDs --- keyboards/noxary/280/280.c | 70 +++++ keyboards/noxary/280/280.h | 49 ++++ keyboards/noxary/280/config.h | 251 ++++++++++++++++++ keyboards/noxary/280/info.json | 12 + keyboards/noxary/280/keymaps/default/config.h | 19 ++ keyboards/noxary/280/keymaps/default/keymap.c | 102 +++++++ .../noxary/280/keymaps/default/readme.md | 1 + keyboards/noxary/280/readme.md | 13 + keyboards/noxary/280/rules.mk | 81 ++++++ 9 files changed, 598 insertions(+) create mode 100644 keyboards/noxary/280/280.c create mode 100644 keyboards/noxary/280/280.h create mode 100644 keyboards/noxary/280/config.h create mode 100644 keyboards/noxary/280/info.json create mode 100644 keyboards/noxary/280/keymaps/default/config.h create mode 100644 keyboards/noxary/280/keymaps/default/keymap.c create mode 100644 keyboards/noxary/280/keymaps/default/readme.md create mode 100644 keyboards/noxary/280/readme.md create mode 100644 keyboards/noxary/280/rules.mk diff --git a/keyboards/noxary/280/280.c b/keyboards/noxary/280/280.c new file mode 100644 index 00000000000..441f0ad84a7 --- /dev/null +++ b/keyboards/noxary/280/280.c @@ -0,0 +1,70 @@ +/* Copyright 2019 %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 "280.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(D5); + setPinOutput(D0); + 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); +} + +*/ + + +void led_set_kb(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(D5); + } else { + writePinHigh(D5); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(D0); + } else { + writePinHigh(D0); + } + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/noxary/280/280.h b/keyboards/noxary/280/280.h new file mode 100644 index 00000000000..1a93c8c6be7 --- /dev/null +++ b/keyboards/noxary/280/280.h @@ -0,0 +1,49 @@ +/* Copyright 2019 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT( \ + K000, K002, K103, K004, K105, K006, K107, K008, K109, K111, K012, K113, K014, K115, K016, K117, \ + K200, K301, K202, K303, K204, K305, K206, K307, K208, K309, K210, K311, K212, K313, K214, K315, K216, K317, \ + K400, K501, K402, K503, K404, K505, K406, K507, K408, K509, K410, K511, K412, K414, K515, K416, K517, \ + K600, K701, K602, K703, K604, K705, K606, K707, K608, K709, K610, K711, K612, K614, \ + K800, K901, K802, K903, K804, K905, K806, K907, K808, K909, K810, K911, K812, K814, K816, \ + K1000,K1101,K1002, K1006, K1010,K1111,K1012, K1014,K1115,K1016,K1117\ +) { \ + { K000, K002, K004, K006, K008, KC_NO, K012, K014, K016 },\ + { KC_NO, K103, K105, K107, K109, K111, K113, K115, K117 },\ + { K200, K202, K204, K206, K208, K210, K212, K214, K216 },\ + { K301, K303, K305, K307, K309, K311, K313, K315, K317 },\ + { K400, K402, K404, K406, K408, K410, K412, K414, K416 },\ + { K501, K503, K505, K507, K509, K511, KC_NO, K515, K517 },\ + { K600, K602, K604, K606, K608, K610, K612, K614, KC_NO },\ + { K701, K703, K705, K707, K709, K711, KC_NO, KC_NO, KC_NO },\ + { K800, K802, K804, K806, K808, K810, K812, K814, K816 },\ + { K901, K903, K905, K907, K909, K911, KC_NO, KC_NO, KC_NO },\ + { K1000, K1002, KC_NO, K1006, KC_NO, K1010, K1012, K1014, K1016 },\ + { K1101, KC_NO, KC_NO, KC_NO, KC_NO, K1111, KC_NO, K1115, K1117 }\ +} diff --git a/keyboards/noxary/280/config.h b/keyboards/noxary/280/config.h new file mode 100644 index 00000000000..427709d1b48 --- /dev/null +++ b/keyboards/noxary/280/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x0050 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Noxary +#define PRODUCT 280 +#define DESCRIPTION A custom TKL + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* + * 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 { F0, E6, D6, D4, F6, F5, F4, F1, B2, D3, D2, D1} +#define MATRIX_COL_PINS { F7, C7, C6, B6, B5, B4, D7, B0, B3} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* 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 */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/280/info.json b/keyboards/noxary/280/info.json new file mode 100644 index 00000000000..f75d276564d --- /dev/null +++ b/keyboards/noxary/280/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary 280", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5}, {"x":14, "y":1.5}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"x":13.75, "y":3.5, "w":1.25}, {"x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/noxary/280/keymaps/default/config.h b/keyboards/noxary/280/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/noxary/280/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/280/keymaps/default/keymap.c b/keyboards/noxary/280/keymaps/default/keymap.c new file mode 100644 index 00000000000..3d993e04253 --- /dev/null +++ b/keyboards/noxary/280/keymaps/default/keymap.c @@ -0,0 +1,102 @@ +/* Copyright 2019 Rozakin + * + * 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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +// 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 _FL1 1 +#define _FL2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer(Default) - For ISO enter use ANSI enter + * ,------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11| f12| |Prnt|ScLk|Paus| + * |------------------------------------------------------------| |--------------| + * | ~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BSpc| | Ins|Home|PgUp| + * |------------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | Del| End|PgDn| + * |------------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent| + * |------------------------------------------------------------| ,----. + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift|Mo(1)| | Up | + * |------------------------------------------------------------| ,--------------. + * |Ctrl|Win |Alt | Space |Alt |Win |Mo(1) |Ctrl | |Left| Dn |Rght| + * `------------------------------------------------------------' `--------------' + */ + [_BL] = LAYOUT( + 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_BSLS, 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_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(_FL1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL1), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT), + /* _FL1: Function Layer 1 - For ISO enter use ANSI enter + * ,------------------------------------------------------------. ,--------------. + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | |RST| | | | | | | | | | | | | | + * |------------------------------------------------------------| `--------------' + * | | | | | | | | | | | | | | | + * |------------------------------------------------------------| ,----. + * | | | | | | | | | |Bl-|Bl+| | Mute| | |Vol+| + * |------------------------------------------------------------| ,--------------. + * | | | | BL_Toggle | | | | | | |Vol-| | + * `------------------------------------------------------------' `--------------' + */ + [_FL1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, _______, KC_VOLU, + _______, _______, _______, BL_TOGG, _______, _______, _______, _______, _______, KC_VOLD, _______), + /* _FL2: Function Layer 2 - For ISO enter use ANSI enter + * ,------------------------------------------------------------. ,--------------. + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| `--------------' + * | | | | | | | | | | | | | | | + * |------------------------------------------------------------| ,----. + * | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| ,--------------. + * | | | | | | | | | | | | | + * `------------------------------------------------------------' `--------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + + }; + diff --git a/keyboards/noxary/280/keymaps/default/readme.md b/keyboards/noxary/280/keymaps/default/readme.md new file mode 100644 index 00000000000..e1a03dc002d --- /dev/null +++ b/keyboards/noxary/280/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Noxary 280 \ No newline at end of file diff --git a/keyboards/noxary/280/readme.md b/keyboards/noxary/280/readme.md new file mode 100644 index 00000000000..5af7441ddf7 --- /dev/null +++ b/keyboards/noxary/280/readme.md @@ -0,0 +1,13 @@ +Noxary 280 + +A fully customizable TKL keyboard. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Rozakin](https://github.com/rozakiin) +Hardware Supported: 280 PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=95660.0) + +Make example for this keyboard (after setting up your build environment): + + make noxary/280:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/280/rules.mk b/keyboards/noxary/280/rules.mk new file mode 100644 index 00000000000..ad6117f16c2 --- /dev/null +++ b/keyboards/noxary/280/rules.mk @@ -0,0 +1,81 @@ +# 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 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 = lite # 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 = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) From 9d5b4ec97549f3b20465b1e96fb781176a1814ea Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 7 May 2019 21:40:45 -0700 Subject: [PATCH 121/129] [Keyboard] Add Noxary 260 (#5815) * initial commit * fix script issues * define pins used and electrical matrix size and an appropriate LAYOUT macro * add an appropriate keymap * turn on bootmagic lite and backlight support * Add QMK Configurator support * add caps lock led support * update readme with group buy links --- keyboards/noxary/260/260.c | 61 +++++ keyboards/noxary/260/260.h | 40 +++ keyboards/noxary/260/config.h | 251 ++++++++++++++++++ keyboards/noxary/260/info.json | 12 + keyboards/noxary/260/keymaps/default/config.h | 19 ++ keyboards/noxary/260/keymaps/default/keymap.c | 87 ++++++ .../noxary/260/keymaps/default/readme.md | 1 + keyboards/noxary/260/readme.md | 15 ++ keyboards/noxary/260/rules.mk | 81 ++++++ 9 files changed, 567 insertions(+) create mode 100644 keyboards/noxary/260/260.c create mode 100644 keyboards/noxary/260/260.h create mode 100644 keyboards/noxary/260/config.h create mode 100644 keyboards/noxary/260/info.json create mode 100644 keyboards/noxary/260/keymaps/default/config.h create mode 100644 keyboards/noxary/260/keymaps/default/keymap.c create mode 100644 keyboards/noxary/260/keymaps/default/readme.md create mode 100644 keyboards/noxary/260/readme.md create mode 100644 keyboards/noxary/260/rules.mk diff --git a/keyboards/noxary/260/260.c b/keyboards/noxary/260/260.c new file mode 100644 index 00000000000..9f577a2aee6 --- /dev/null +++ b/keyboards/noxary/260/260.c @@ -0,0 +1,61 @@ +/* Copyright 2019 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 "260.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(B1); + 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); +} + +*/ + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B1); + } else { + writePinHigh(B1); + } + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/noxary/260/260.h b/keyboards/noxary/260/260.h new file mode 100644 index 00000000000..2c62bd2a54d --- /dev/null +++ b/keyboards/noxary/260/260.h @@ -0,0 +1,40 @@ +/* Copyright 2019 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, \ + K400, K401, K402, K406, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, KC_NO, K414 } \ +} diff --git a/keyboards/noxary/260/config.h b/keyboards/noxary/260/config.h new file mode 100644 index 00000000000..984712dd105 --- /dev/null +++ b/keyboards/noxary/260/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x003C +#define DEVICE_VER 0x0001 +#define MANUFACTURER Noxary +#define PRODUCT 260 +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * 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 { F7, F6, F5, F0, B5 } +#define MATRIX_COL_PINS { C7, C6, B6, F4, E6, D0, B4, D1, D2, D3, D7, D6, D4, F1, D5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* 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 */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/260/info.json b/keyboards/noxary/260/info.json new file mode 100644 index 00000000000..e5b449ff36f --- /dev/null +++ b/keyboards/noxary/260/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary 260", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "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, "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":13.5, "y":1, "w":1.5}, {"x":0, "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":12.75, "y":2}, {"x":13.75, "y":2, "w":1.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"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":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/noxary/260/keymaps/default/config.h b/keyboards/noxary/260/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/noxary/260/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/260/keymaps/default/keymap.c b/keyboards/noxary/260/keymaps/default/keymap.c new file mode 100644 index 00000000000..061e3d24073 --- /dev/null +++ b/keyboards/noxary/260/keymaps/default/keymap.c @@ -0,0 +1,87 @@ +/* Copyright 2019 Rozakiin + * + * 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 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 _BL 0 +#define _FL1 1 +#define _FL2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer(Default) - For ISO enter use ANSI enter + * ,-----------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BSpc| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent| + * |-----------------------------------------------------------| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift |Del| + * |-----------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Win |Mo(1) |Ctrl | + * `-----------------------------------------------------------' + */ + [_BL] = LAYOUT( + 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_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_DEL, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_RGUI, MO(_FL1), KC_RCTL), + /* _FL1: Function Layer 1 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | `|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |PScr| | + * |----------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | Ins| + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | |Home| + * |----------------------------------------------------------------| + * | | | | | | | | | |Bl-|Bl+| |Mute|Vol+| End| + * |----------------------------------------------------------------| + * | | | | BL_Toggle | | | | |Vol-| | + * `----------------------------------------------------------------' + */ + [_FL1] = LAYOUT( + 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_PSCR, + _______, KC_VOLU, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_VOLD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, _______, + _______, _______, _______, BL_TOGG, _______, _______, _______, _______), + /* _FL2: Function Layer 2 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______), + + +}; + diff --git a/keyboards/noxary/260/keymaps/default/readme.md b/keyboards/noxary/260/keymaps/default/readme.md new file mode 100644 index 00000000000..af0cd4ee276 --- /dev/null +++ b/keyboards/noxary/260/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Noxary 260 \ No newline at end of file diff --git a/keyboards/noxary/260/readme.md b/keyboards/noxary/260/readme.md new file mode 100644 index 00000000000..48cbbbf2297 --- /dev/null +++ b/keyboards/noxary/260/readme.md @@ -0,0 +1,15 @@ +Noxary 260 + +![260](https://cdn.discordapp.com/attachments/438429095303315456/489188948749451276/image0.jpg) + +A fully customizable 60% keyboard. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Rozakiin](https://github.com/rozakiin) +Hardware Supported: Noxary 260 PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=93572.0) + +Make example for this keyboard (after setting up your build environment): + + make noxary/260:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/260/rules.mk b/keyboards/noxary/260/rules.mk new file mode 100644 index 00000000000..0fffc2d3878 --- /dev/null +++ b/keyboards/noxary/260/rules.mk @@ -0,0 +1,81 @@ +# 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 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 = lite # 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 = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) From 0f0062b4929b4598aa45d5aeb20d4678b4e06d37 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 7 May 2019 22:15:01 -0700 Subject: [PATCH 122/129] [Keyboard] Noxary 220 (#5816) * initial commit and script error fixes * add matrix and pin definitions along with LAYOUT macro * add an appropriate keymap * add num lock led support * turn on bootmagic lite along with backlight led support * add QMK Configurator support --- keyboards/noxary/220/220.c | 62 +++++ keyboards/noxary/220/220.h | 42 +++ keyboards/noxary/220/config.h | 251 ++++++++++++++++++ keyboards/noxary/220/info.json | 12 + keyboards/noxary/220/keymaps/default/config.h | 19 ++ keyboards/noxary/220/keymaps/default/keymap.c | 76 ++++++ .../noxary/220/keymaps/default/readme.md | 1 + keyboards/noxary/220/readme.md | 13 + keyboards/noxary/220/rules.mk | 83 ++++++ 9 files changed, 559 insertions(+) create mode 100644 keyboards/noxary/220/220.c create mode 100644 keyboards/noxary/220/220.h create mode 100644 keyboards/noxary/220/config.h create mode 100644 keyboards/noxary/220/info.json create mode 100644 keyboards/noxary/220/keymaps/default/config.h create mode 100644 keyboards/noxary/220/keymaps/default/keymap.c create mode 100644 keyboards/noxary/220/keymaps/default/readme.md create mode 100644 keyboards/noxary/220/readme.md create mode 100644 keyboards/noxary/220/rules.mk diff --git a/keyboards/noxary/220/220.c b/keyboards/noxary/220/220.c new file mode 100644 index 00000000000..e671e15a43a --- /dev/null +++ b/keyboards/noxary/220/220.c @@ -0,0 +1,62 @@ +/* Copyright 2019 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 "220.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(C6); + 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); +} + +*/ + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(C6); + } else { + writePinHigh(C6); + } + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/noxary/220/220.h b/keyboards/noxary/220/220.h new file mode 100644 index 00000000000..3f1375e2a6a --- /dev/null +++ b/keyboards/noxary/220/220.h @@ -0,0 +1,42 @@ +/* Copyright 2019 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_6x4( \ + 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 } \ +} diff --git a/keyboards/noxary/220/config.h b/keyboards/noxary/220/config.h new file mode 100644 index 00000000000..e5a6be2de70 --- /dev/null +++ b/keyboards/noxary/220/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Noxary +#define PRODUCT 220 +#define DESCRIPTION A custom 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 { C4, B0, D3, D4, D5, D6 } +#define MATRIX_COL_PINS { B4, C5, D2, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* 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 */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/220/info.json b/keyboards/noxary/220/info.json new file mode 100644 index 00000000000..252c824aa8e --- /dev/null +++ b/keyboards/noxary/220/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary 220", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6.5, + "layouts": { + "LAYOUT_ortho_6x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":0, "y":2.5}, {"x":1, "y":2.5}, {"x":2, "y":2.5}, {"x":3, "y":2.5}, {"x":0, "y":3.5}, {"x":1, "y":3.5}, {"x":2, "y":3.5}, {"x":3, "y":3.5}, {"x":0, "y":4.5}, {"x":1, "y":4.5}, {"x":2, "y":4.5}, {"x":3, "y":4.5}, {"x":0, "y":5.5}, {"x":1, "y":5.5}, {"x":2, "y":5.5}, {"x":3, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/noxary/220/keymaps/default/config.h b/keyboards/noxary/220/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/noxary/220/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/220/keymaps/default/keymap.c b/keyboards/noxary/220/keymaps/default/keymap.c new file mode 100644 index 00000000000..a72841db546 --- /dev/null +++ b/keyboards/noxary/220/keymaps/default/keymap.c @@ -0,0 +1,76 @@ +/* Copyright 2019 Rozakiin + * + * 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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ortho_6x4( + KC_ESC, BL_TOGG, BL_DEC, BL_INC, + KC_NLCK, KC_SLSH, KC_ASTR, KC_PEQL, + KC_7, KC_8, KC_9, KC_PMNS, + KC_4, KC_5, KC_6, KC_PPLS, + KC_1, KC_2, KC_3, KC_PENT, + KC_0, KC_0, KC_DEL, KC_PENT), + + LAYOUT_ortho_6x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/noxary/220/keymaps/default/readme.md b/keyboards/noxary/220/keymaps/default/readme.md new file mode 100644 index 00000000000..bff7feda38a --- /dev/null +++ b/keyboards/noxary/220/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Noxary 220 \ No newline at end of file diff --git a/keyboards/noxary/220/readme.md b/keyboards/noxary/220/readme.md new file mode 100644 index 00000000000..1fcdfcc3c74 --- /dev/null +++ b/keyboards/noxary/220/readme.md @@ -0,0 +1,13 @@ +# Noxary 220 + +A fully customizable numpad + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Rozakiin](https://github.com/rozakiin) +Hardware Supported: Noxary 220 PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=95660.0) + +Make example for this keyboard (after setting up your build environment): + + make noxary/220:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/220/rules.mk b/keyboards/noxary/220/rules.mk new file mode 100644 index 00000000000..0f8cae92696 --- /dev/null +++ b/keyboards/noxary/220/rules.mk @@ -0,0 +1,83 @@ +# 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 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# 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 = lite # 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 = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_6x4 \ No newline at end of file From 86532fa8d34e9395fe1b41fd22eaaf9a2ecd0e8e Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Wed, 8 May 2019 20:03:53 +0200 Subject: [PATCH 123/129] [Keymap] Signum 3.0, fix, move and change keys (#5820) --- .../3_0/elitec/keymaps/default/keymap.c | 52 +++++++++---------- .../3_0/elitec/keymaps/default/layout.py | 37 ++++++------- 2 files changed, 45 insertions(+), 44 deletions(-) diff --git a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c index c94890edae5..bd625452450 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c +++ b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c @@ -627,53 +627,53 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- ------------------------------------------------- * | Tab | q | w | e | r | t | | y | u | i | o | p | [ | * ------------------------------------------------- ------------------------------------------------- - * | LCtrl | a | s | d | f | g | | h | j | k | l | ; | ' | + * |LCtTEsc| a | s | d | f | g | | h | j | k | l | ; | ' | * ------------------------------------------------- ------------------------------------------------- * |LShift(| z | x | c | v | b | | n | m | , | . | / |RShift)| * ----------------------------------------------------------------------------------------------------------------- - * MO2 LGui LAlt | TT2 |LT6_SPC| TT4 | Enter | Space | TT2 | RAlt RGui RCtrl + * LCtrl LAlt LGui | TT2 |LT6_SPC|LT4_DEL|LT4_ENT| Space |LT2_BSP| RGui RAlt RCtrl * ------------------------------------------------- */ LAYOUT_ortho_4x12( 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_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + LCTL_T(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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - MO(2), KC_LGUI, KC_LALT, TT(2), LT(6, KC_SPC), TT(4), KC_ENT, KC_SPC, TT(2), KC_RALT, KC_RGUI, KC_RCTRL + KC_LCTL, KC_LALT, KC_LGUI, TT(2), LT(6,KC_SPC), LT(4,KC_DEL), LT(4,KC_ENT), KC_SPC, LT(2,KC_BSPC), KC_RGUI, KC_RALT, KC_RCTL ), /* Layer 1 * ------------------------------------------------- ------------------------------------------------- * | Tab | q | w | f | p | g | | j | l | u | y | ; | [ | * ------------------------------------------------- ------------------------------------------------- - * | LCtrl | a | r | s | t | d | | h | n | e | i | o | ' | + * |LCtTEsc| a | r | s | t | d | | h | n | e | i | o | ' | * ------------------------------------------------- ------------------------------------------------- * |LShift(| z | x | c | v | b | | k | m | , | . | / |RShift)| * ----------------------------------------------------------------------------------------------------------------- - * MO2 LGui LAlt | TT2 |LT6_SPC| TT4 | Enter | Space | TT2 | RAlt RGui RCtrl + * LCtrl LAlt LGui | TT2 |LT6_SPC|LT4_DEL|LT4_ENT| Space |LT2_BSP| RGui RAlt RCtrl * ------------------------------------------------- */ LAYOUT_ortho_4x12( 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_LCTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + LCTL_T(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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - MO(2), KC_LGUI, KC_LALT, TT(2), LT(6, KC_SPC), TT(4), KC_ENT, KC_SPC, TT(2), KC_RALT, KC_RGUI, KC_RCTRL + KC_LCTL, KC_LALT, KC_LGUI, TT(2), LT(6,KC_SPC), LT(4,KC_DEL), LT(4,KC_ENT), KC_SPC, LT(2,KC_BSPC), KC_RGUI, KC_RALT, KC_RCTL ), /* Layer 2 * ------------------------------------------------- ------------------------------------------------- * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ] | * ------------------------------------------------- ------------------------------------------------- - * | | DF0 | DF1 | XXX | XXX | MO3 | | 4 | 4 | 5 | 6 | - | = | + * | | DF0 | DF1 | XXX | MO3 | XXX | | 4 | 4 | 5 | 6 | - | = | * ------------------------------------------------- ------------------------------------------------- - * | | XXX | XXX | XXX | XXX | MO5 | | 1 | 1 | 2 | 3 | \ | | + * | | MO5 | XXX | XXX | XXX | XXX | | 1 | 1 | 2 | 3 | \ | | * ----------------------------------------------------------------------------------------------------------------- * TG2 | | Del | | |BSpace | 0 | * ------------------------------------------------- */ LAYOUT_ortho_4x12( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, - KC_TRNS, DF(0), DF(1), KC_NO, KC_NO, MO(3), KC_4, KC_4, KC_5, KC_6, KC_MINS, KC_EQL, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, MO(5), KC_1, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS, DF(0), DF(1), KC_NO, MO(3), KC_NO, KC_4, KC_4, KC_5, KC_6, KC_MINS, KC_EQL, + KC_TRNS, MO(5), KC_NO, KC_NO, KC_NO, KC_NO, KC_1, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_0, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -681,18 +681,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- ------------------------------------------------- * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | XXX | * ------------------------------------------------- ------------------------------------------------- - * | | XXX | XXX | XXX | XXX | MO3 | | F4 | F4 | F5 | F6 | XXX | XXX | + * | | XXX | XXX | XXX | MO3 | XXX | | F4 | F4 | F5 | F6 | F11 | XXX | * ------------------------------------------------- ------------------------------------------------- - * | | XXX | XXX | XXX | XXX | XXX | | F1 | F1 | F2 | F3 | XXX | | + * | | XXX | XXX | XXX | XXX | XXX | | F1 | F1 | F2 | F3 | F12 | | * ----------------------------------------------------------------------------------------------------------------- - * TG3 | | | | F10 | F11 | F12 | + * TG3 | | | | | | | * ------------------------------------------------- */ LAYOUT_ortho_4x12( KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, MO(3), KC_F4, KC_F4, KC_F5, KC_F6, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F1, KC_F2, KC_F3, KC_NO, KC_TRNS, - TG(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS + KC_TRNS, KC_NO, KC_NO, KC_NO, MO(3), KC_NO, KC_F4, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F1, KC_F2, KC_F3, KC_F12, KC_TRNS, + TG(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), /* Layer 4 @@ -701,15 +701,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- ------------------------------------------------- * | | Caps | < Gui |Gui Tab| > Gui | > Gui | |< Arrow|< Arrow|v Arrow|> Arrow| End |Pr Scr | * ------------------------------------------------- ------------------------------------------------- - * | | XXX | XXX | XXX |CPg Up |CPg Up | | Pg Up | XXX |v Arrow| XXX | App | | + * | | XXX | XXX | XXX |CPg Up |CPg Up | | Pg Up | |v Arrow| XXX | App | | * ----------------------------------------------------------------------------------------------------------------- * TG4 | | Del | | |BSpace | | * ------------------------------------------------- */ LAYOUT_ortho_4x12( - KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), CTL_T(KC_PGDN), CTL_T(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, LSFT(KC_INS), KC_ESC, - KC_TRNS, KC_CAPS, LGUI_T(KC_LEFT), LGUI_T(KC_TAB), LGUI_T(KC_RIGHT), LGUI_T(KC_RIGHT), KC_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, KC_PSCR, - KC_TRNS, KC_NO, KC_NO, KC_NO, CTL_T(KC_PGUP), CTL_T(KC_PGUP), KC_PGUP, KC_NO, KC_DOWN, KC_NO, KC_APP, KC_TRNS, + KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), LCTL(KC_PGDN), LCTL(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, LSFT(KC_INS), KC_ESC, + KC_TRNS, KC_CAPS, LGUI(KC_LEFT), LGUI(KC_TAB), LGUI(KC_RGHT), LGUI(KC_RGHT), KC_LEFT, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_PSCR, + KC_TRNS, KC_NO, KC_NO, KC_NO, LCTL(KC_PGUP), LCTL(KC_PGUP), KC_PGUP, KC_TRNS, KC_DOWN, KC_NO, KC_APP, KC_TRNS, TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -719,7 +719,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- ------------------------------------------------- * | | XXX | |<< | Vol 0 | >>| | XXX | | XXX | XXX | XXX | XXX | XXX | Sleep | * ------------------------------------------------- ------------------------------------------------- - * | | XXX | XXX | Vol - | Vol - | MO5 | | XXX | XXX | XXX | XXX | XXX | XXX | + * | | MO5 | XXX | Vol - | Vol - | XXX | | XXX | XXX | XXX | XXX | XXX | XXX | * ----------------------------------------------------------------------------------------------------------------- * TG5 | | | | | | | * ------------------------------------------------- @@ -727,7 +727,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_4x12( KC_TRNS, KC_NO, KC_MPLY, KC_VOLU, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_PWR, KC_TRNS, KC_NO, KC_MPRV, KC_MUTE, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP, - KC_TRNS, KC_NO, KC_NO, KC_VOLD, KC_VOLD, MO(5), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, MO(5), KC_NO, KC_VOLD, KC_VOLD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TG(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -735,7 +735,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------- ------------------------------------------------- * | | acc1 | XXX | XXX | XXX | XXX | |^ Wheel|< Wheel|^ Mouse|> Wheel| XXX | XXX | * ------------------------------------------------- ------------------------------------------------- - * | | acc2 |Mouse 3|Mouse 2|Mouse 1|Mouse 1| |< Mouse|< Mouse|v Mouse|> Mouse| XXX | XXX | + * | | acc2 |Mouse 2|Mouse 3|Mouse 1|Mouse 1| |< Mouse|< Mouse|v Mouse|> Mouse| XXX | XXX | * ------------------------------------------------- ------------------------------------------------- * | | acc0 | XXX | XXX | XXX | XXX | |v Wheel| XXX |v Mouse| XXX | XXX | | * ----------------------------------------------------------------------------------------------------------------- @@ -744,7 +744,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ LAYOUT_ortho_4x12( KC_TRNS, KC_ACL1, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, KC_NO, KC_NO, - KC_TRNS, KC_ACL2, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_MS_L, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, + KC_TRNS, KC_ACL2, KC_BTN2, KC_BTN3, KC_BTN1, KC_BTN1, KC_MS_L, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, KC_TRNS, KC_ACL0, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_D, KC_NO, KC_MS_D, KC_NO, KC_NO, KC_TRNS, TG(6), 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/signum/3_0/elitec/keymaps/default/layout.py b/keyboards/signum/3_0/elitec/keymaps/default/layout.py index 69cc059f189..dd5fd333427 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/layout.py +++ b/keyboards/signum/3_0/elitec/keymaps/default/layout.py @@ -350,17 +350,18 @@ qmk_dict = { ">": "S(KC_DOT)", "/": "KC_SLSH", "?": "S(KC_SLSH)", "Caps": "KC_CAPS", "Pr Scr": "KC_PSCR", "Scr Lck": "KC_SLCK", "Pause": "KC_BRK", "Insert": "KC_INS", "SInsert": "LSFT(KC_INS)", "Home": "KC_HOME", "Pg Up": "KC_PGUP", "Del": "KC_DEL", "End": "KC_END", - "Pg Down": "KC_PGDN", "> Arrow": "KC_RIGHT", "< Arrow": "KC_LEFT", + "Pg Down": "KC_PGDN", "> Arrow": "KC_RGHT", "< Arrow": "KC_LEFT", "v Arrow": "KC_DOWN", "^ Arrow": "KC_UP", # Keypad keycodes missing "App": "KC_APP", "Menu": "KC_MENU", # Command keycodes missing (Execute, Help, ..., Find) # Basic Keycodes missing from Print Screen onwards, included as fallback # random Keycodes - "RGui": "KC_RGUI", "LGui": "KC_LGUI", "LAlt": "KC_LALT", "RAlt": "KC_RALT", "LShift": "KC_LSFT", "LCtrl": "KC_LCTRL", "RCtrl": "KC_RCTRL", + "RGui": "KC_RGUI", "LGui": "KC_LGUI", "LAlt": "KC_LALT", "RAlt": "KC_RALT", "LShift": "KC_LSFT", "LCtrl": "KC_LCTL", "LCtTEsc": "LCTL_T(KC_ESC)", "RCtrl": "KC_RCTL", "LShift(": "KC_LSPO", "RShift)": "KC_RSPC", - "L1_ENT": "LT(1, KC_ENT)", "LT6_SPC": "LT(6, KC_SPC)", - "CPg Dn": "CTL_T(KC_PGDN)", "CPg Up": "CTL_T(KC_PGUP)", + # "LShift(": "LSFT_T(KC_9)", "RShift)": "RSFT_T(RSFT(KC_0))", + "L1_ENT": "LT(1, KC_ENT)", "LT2_BSP": "LT(2,KC_BSPC)", "LT4_DEL": "LT(4,KC_DEL)", "LT4_ENT": "LT(4,KC_ENT)", "LT6_SPC": "LT(6,KC_SPC)", + "CPg Dn": "LCTL(KC_PGDN)", "CPg Up": "LCTL(KC_PGUP)", "S_Enter": "S(KC_ENT)", "S_Tab": "S(KC_TAB)", "Compose": "KC_ALGR", "RShift": "KC_RSFT", "Vol 0": "KC_MUTE", "Vol +": "KC_VOLU", "Vol -": "KC_VOLD", @@ -402,7 +403,7 @@ qmk_dict = { "Undo": "LCTL(KC_Z)", "Cut": "LCTL(KC_X)", "Copy": "LCTL(KC_C)", "Paste": "LCTL(KC_V)", "< Tab": "LCTL(S(KC_TAB))", "> Tab": "LCTL(KC_TAB)", "Tab x": "LCTL(KC_W)", "Tab n": "LCTL(KC_T)", - "Gui Tab": "LGUI_T(KC_TAB)", "< Gui": "LGUI_T(KC_LEFT)", "> Gui": "LGUI_T(KC_RIGHT)", + "Gui Tab": "LGUI(KC_TAB)", "< Gui": "LGUI(KC_LEFT)", "> Gui": "LGUI(KC_RGHT)", "C+A+Del": "LCTL(LALT(KC_DEL))", "Mic 0": "LCTL(KC_M)", "Power": "KC_PWR", "Sleep": "KC_SLEP", @@ -429,40 +430,40 @@ static = ["NEO", "GREEK", "GREEK", "GREEK", "GREEK", "MOUSE"] # 0 qwerty = [ "Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", - "LCtrl", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", - "LShift(", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "RShift)", - "MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl", + "LCtTEsc", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", + "LShift(", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "RShift)", + "LCtrl", "LAlt", "LGui", "TT2", "LT6_SPC", "LT4_DEL", "LT4_ENT", "Space", "LT2_BSP", "RGui", "RAlt", "RCtrl", ] # 1 colemak = [ "Tab", "q", "w", "f", "p", "g", "j", "l", "u", "y", ";", "[", - "LCtrl", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'", + "LCtTEsc", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'", "LShift(", "z", "x", "c", "v", "b", "k", "m", ",", ".", "/", "RShift)", - "MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl", + "LCtrl", "LAlt", "LGui", "TT2", "LT6_SPC", "LT4_DEL", "LT4_ENT", "Space", "LT2_BSP", "RGui", "RAlt", "RCtrl", ] # 2 numpad = [ "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "]", - "", "DF0", "DF1", "XXX", "XXX", "MO3", "4", "4", "5", "6", "-", "=", - "", "XXX", "XXX", "XXX", "XXX", "MO5", "1", "1", "2", "3", "\\", "", + "", "DF0", "DF1", "XXX", "MO3", "XXX", "4", "4", "5", "6", "-", "=", + "", "MO5", "XXX", "XXX", "XXX", "XXX", "1", "1", "2", "3", "\\", "", "TG2", "", "", "", "Del", "", "", "BSpace", "0", "", "", "", ] # 3 fpad = [ "", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "XXX", - "", "XXX", "XXX", "XXX", "XXX", "MO3", "F4", "F4", "F5", "F6", "XXX", "XXX", - "", "XXX", "XXX", "XXX", "XXX", "XXX", "F1", "F1", "F2", "F3", "XXX", "", - "TG3", "", "", "", "", "", "F10", "F11", "F12", "", "", "", + "", "XXX", "XXX", "XXX", "MO3", "XXX", "F4", "F4", "F5", "F6", "F11", "XXX", + "", "XXX", "XXX", "XXX", "XXX", "XXX", "F1", "F1", "F2", "F3", "F12", "", + "TG3", "", "", "", "", "", "", "", "", "", "", "", ] # 4 movement = [ "Esc", "Esc", "Tab x", "Tab n", "CPg Dn", "CPg Dn", "Pg Down", "Home", "^ Arrow", "Insert", "SInsert", "Esc", "", "Caps", "< Gui", "Gui Tab", "> Gui", "> Gui", "< Arrow", "< Arrow", "v Arrow", "> Arrow", "End", "Pr Scr", - "", "XXX", "XXX", "XXX", "CPg Up", "CPg Up", "Pg Up", "XXX", "v Arrow", "XXX", "App", "", + "", "XXX", "XXX", "XXX", "CPg Up", "CPg Up", "Pg Up", "", "v Arrow", "XXX", "App", "", "TG4", "", "", "", "Del", "", "", "BSpace", "", "", "", "", ] @@ -470,14 +471,14 @@ movement = [ media = [ "", "XXX", "play/ps", "Vol +", "Vol +", "XXX", "XXX", "XXX", "XXX", "XXX", "_reset", "Power", "", "XXX", "|<<", "Vol 0", ">>|", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "Sleep", - "", "XXX", "XXX", "Vol -", "Vol -", "MO5", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", + "", "MO5", "XXX", "Vol -", "Vol -", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "TG5", "", "", "", "", "", "", "", "", "", "", "", ] # 6 mouse = [ "", "acc1", "XXX", "XXX", "XXX", "XXX", "^ Wheel", "< Wheel", "^ Mouse", "> Wheel", "XXX", "XXX", - "", "acc2", "Mouse 3", "Mouse 2", "Mouse 1", "Mouse 1", "< Mouse", "< Mouse", "v Mouse", "> Mouse", "XXX", "XXX", + "", "acc2", "Mouse 2", "Mouse 3", "Mouse 1", "Mouse 1", "< Mouse", "< Mouse", "v Mouse", "> Mouse", "XXX", "XXX", "", "acc0", "XXX", "XXX", "XXX", "XXX", "v Wheel", "XXX", "v Mouse", "XXX", "XXX", "", "TG6", "", "", "", "", "", "", "", "", "", "", "", ] From aa65cd7a905370ab36f37a3562d3f53387fcae92 Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Wed, 8 May 2019 20:04:32 +0200 Subject: [PATCH 124/129] [Keymap] Signum3.0 Generate printable keymap (#5818) * Externalize generation of visual text keymap * Generate keymap in Asciidoc format for further processing * Remove artifacts from a2x call --- .../3_0/elitec/keymaps/default/generate_km.py | 59 ++++++++++++++----- .../3_0/elitec/keymaps/default/keymap.c | 21 ++++--- 2 files changed, 59 insertions(+), 21 deletions(-) diff --git a/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py index 9517a2f1f07..cfa8edf57a7 100755 --- a/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py +++ b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py @@ -56,7 +56,29 @@ def toLgd(s): return _translate(s)[1] -def writeKeymap(f_template, f_keymap, columns, rows): +def quoteC(text): + yield "/*" + for line in text: + yield " * " + line + yield " */\n" + + +def getKeymapText(id, layer, columns, rows): + keymap = [] + keymap.append("Layer %d" % id) + keymap.append("------------------------------------------------- -------------------------------------------------") + keymap.append("|{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|".format(*map(toLgd, layer[:12]))) + keymap.append("------------------------------------------------- -------------------------------------------------") + keymap.append("|{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|".format(*map(toLgd, layer[12:24]))) + keymap.append("------------------------------------------------- -------------------------------------------------") + keymap.append("|{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|".format(*map(toLgd, layer[24:36]))) + keymap.append("-----------------------------------------------------------------------------------------------------------------") + keymap.append(" {0} {1} {2} |{3}|{4}|{5}|{6}|{7}|{8}| {9} {10} {11}".format(*map(toLgd, layer[36:48])).rstrip()) + keymap.append(" -------------------------------------------------") + return keymap + + +def writeKeymap(f_template, f_keymap, layers, columns, rows): doCopy = False for line in f_template: @@ -78,19 +100,9 @@ def writeKeymap(f_template, f_keymap, columns, rows): f_keymap.write(u"\t[{0}] = {1}, // {2}\n".format(k, v, chr(int(v, 0)))) elif line.startswith("//"): doCopy = False - for layer, L in enumerate(layout.layers): + for layer, L in enumerate(layers): r_counter = rows - f_keymap.write("/* Layer %d\n" % layer) - f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n") - f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[:12]))) - f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n") - f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[12:24]))) - f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n") - f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[24:36]))) - f_keymap.write(" * -----------------------------------------------------------------------------------------------------------------\n") - f_keymap.write(" * {0} {1} {2} |{3}|{4}|{5}|{6}|{7}|{8}| {9} {10} {11}".format(*map(toLgd, L[36:48])).rstrip()+"\n") - f_keymap.write(" * -------------------------------------------------\n") - f_keymap.write(" */\n") + f_keymap.write('\n'.join(quoteC(getKeymapText(layer, L, columns, rows)))) l_code = '\tLAYOUT_ortho_4x12(\n' for r in range(r_counter): @@ -123,6 +135,20 @@ def getKeymapJSON(keyboard, keymap, layout, layers): }, sort_keys=True, indent=4) +def getKeymapAsciidoc(title, layers, columns, rows): + yield '= ' + title + yield '' + for id, layer in enumerate(layers): + keymap = getKeymapText(id, layer, columns, rows) + if len(keymap): + yield '.' + keymap[0] + yield '--------------------------' + for line in keymap[1:]: + yield ' ' + line + yield '--------------------------' + yield '' + + def layersToKC(layers): return [list(map(toKC, layer)) for layer in layers] @@ -147,7 +173,7 @@ def pathToKeyboard(path): if __name__ == "__main__": with open("km_template.txt", mode="r") as f_template: with open("keymap.c", mode="w", encoding='utf-8') as f_keymap: - writeKeymap(f_template, f_keymap, columns=12, rows=4) + writeKeymap(f_template, f_keymap, layout.layers, columns=12, rows=4) abspath = os.path.dirname(os.path.abspath(__file__)) keyboard = list(reversed(list(pathToKeyboard(abspath)))) @@ -161,3 +187,8 @@ if __name__ == "__main__": keyboard_layout, layersToKC(layout.layers)) ) + + with open("keymap.adoc", mode="w") as f_keymapasciidoc: + f_keymapasciidoc.write('\n'.join(getKeymapAsciidoc('Signum 3.0 %s_%s' % ('_'.join(keyboard), keymap), layout.layers, columns=12, rows=4))) + print("Run the following command to generate a PDF from the keymap") + print("a2x -f pdf --xsltproc-opts '--stringparam page.orientation landscape --stringparam body.font.master 12' --fop -v keymap.adoc") diff --git a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c index bd625452450..511be8c0d7a 100644 --- a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c +++ b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c @@ -623,7 +623,8 @@ const uint32_t PROGMEM unicode_map[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Layer 0 +/* + * Layer 0 * ------------------------------------------------- ------------------------------------------------- * | Tab | q | w | e | r | t | | y | u | i | o | p | [ | * ------------------------------------------------- ------------------------------------------------- @@ -641,7 +642,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, TT(2), LT(6,KC_SPC), LT(4,KC_DEL), LT(4,KC_ENT), KC_SPC, LT(2,KC_BSPC), KC_RGUI, KC_RALT, KC_RCTL ), -/* Layer 1 +/* + * Layer 1 * ------------------------------------------------- ------------------------------------------------- * | Tab | q | w | f | p | g | | j | l | u | y | ; | [ | * ------------------------------------------------- ------------------------------------------------- @@ -659,7 +661,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, TT(2), LT(6,KC_SPC), LT(4,KC_DEL), LT(4,KC_ENT), KC_SPC, LT(2,KC_BSPC), KC_RGUI, KC_RALT, KC_RCTL ), -/* Layer 2 +/* + * Layer 2 * ------------------------------------------------- ------------------------------------------------- * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ] | * ------------------------------------------------- ------------------------------------------------- @@ -677,7 +680,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_0, KC_TRNS, KC_TRNS, KC_TRNS ), -/* Layer 3 +/* + * Layer 3 * ------------------------------------------------- ------------------------------------------------- * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | XXX | * ------------------------------------------------- ------------------------------------------------- @@ -695,7 +699,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* Layer 4 +/* + * Layer 4 * ------------------------------------------------- ------------------------------------------------- * | Esc | Esc | Tab x | Tab n |CPg Dn |CPg Dn | |Pg Down| Home |^ Arrow|Insert |SInsert| Esc | * ------------------------------------------------- ------------------------------------------------- @@ -713,7 +718,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* Layer 5 +/* + * Layer 5 * ------------------------------------------------- ------------------------------------------------- * | | XXX |play/ps| Vol + | Vol + | XXX | | XXX | XXX | XXX | XXX |_reset | Power | * ------------------------------------------------- ------------------------------------------------- @@ -731,7 +737,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* Layer 6 +/* + * Layer 6 * ------------------------------------------------- ------------------------------------------------- * | | acc1 | XXX | XXX | XXX | XXX | |^ Wheel|< Wheel|^ Mouse|> Wheel| XXX | XXX | * ------------------------------------------------- ------------------------------------------------- From 16f367348a78f10b58fad0c6841c7529f4f73818 Mon Sep 17 00:00:00 2001 From: "Tobias V. Langhoff" Date: Thu, 9 May 2019 06:45:00 +0200 Subject: [PATCH 125/129] [Docs] Fix Space Cadet link (#5825) Fix broken Space Cadet link in Features list --- docs/features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features.md b/docs/features.md index 014d6ef107b..cb69df35d70 100644 --- a/docs/features.md +++ b/docs/features.md @@ -25,7 +25,7 @@ QMK has a staggering number of features for building your keyboard. It can take * [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard. * [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard. * [RGB Matrix](feature_rgb_matrix.md) - RGB Matrix lights for per key lighting. -* [Space Cadet](feature_space_cadet_shift.md) - Use your left/right shift keys to type parenthesis and brackets. +* [Space Cadet](feature_space_cadet.md) - Use your left/right shift keys to type parenthesis and brackets. * [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use. * [Swap Hands](feature_swap_hands.md) - Mirror your keyboard for one handed usage. * [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want. From f5b9690ec79f2bd5c6c74c76c87e870a901c2e8f Mon Sep 17 00:00:00 2001 From: Danu Widatama Date: Thu, 9 May 2019 20:35:47 +0700 Subject: [PATCH 126/129] Add no_caps_lock layout for Satan GH60 (#5829) --- keyboards/satan/keymaps/no_caps_lock/keymap.c | 55 +++++++++++++++++++ .../satan/keymaps/no_caps_lock/readme.md | 1 + 2 files changed, 56 insertions(+) create mode 100644 keyboards/satan/keymaps/no_caps_lock/keymap.c create mode 100644 keyboards/satan/keymaps/no_caps_lock/readme.md diff --git a/keyboards/satan/keymaps/no_caps_lock/keymap.c b/keyboards/satan/keymaps/no_caps_lock/keymap.c new file mode 100644 index 00000000000..48659bb66b0 --- /dev/null +++ b/keyboards/satan/keymaps/no_caps_lock/keymap.c @@ -0,0 +1,55 @@ +#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. +enum layer_names { + _BL, + _FL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * | ~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |ESC | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |FL |Gui |FL(tgl)| + * `-----------------------------------------------------------' + */ + [_BL] = LAYOUT_60_ansi( + 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_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_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, MO(_FL), KC_RGUI, TG(_FL) + ), + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | + * |-----------------------------------------------------------| + * | |Home|PgUp| | | | | | | | |BR- |BR+ | | + * |-----------------------------------------------------------| + * | |End|PgDn| | | |Left|Down|Up|Right|Prv|Nxt|Ply | + * |-----------------------------------------------------------| + * | | | | | | | | |Vdn|Vup|Mute| | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + * hjkl for arrows because vim + */ + [_FL] = LAYOUT_60_ansi( + 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_DEL, \ + KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F14, KC_F15, KC_TRNS, \ + KC_TRNS, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; diff --git a/keyboards/satan/keymaps/no_caps_lock/readme.md b/keyboards/satan/keymaps/no_caps_lock/readme.md new file mode 100644 index 00000000000..b3bfe7988e9 --- /dev/null +++ b/keyboards/satan/keymaps/no_caps_lock/readme.md @@ -0,0 +1 @@ +Standard layout with caps lock replaced by esc. Navigation and multimedia keys are on the second layer. From 94c4b6bd740bf1dbc2ff45a4a5f6385d06440ef0 Mon Sep 17 00:00:00 2001 From: Hannes Egler Date: Thu, 9 May 2019 18:57:56 +0200 Subject: [PATCH 127/129] fixed matrix (#5831) --- keyboards/westfoxtrot/cyclops/cyclops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/westfoxtrot/cyclops/cyclops.h b/keyboards/westfoxtrot/cyclops/cyclops.h index f32d2fd4415..d82c56744cd 100644 --- a/keyboards/westfoxtrot/cyclops/cyclops.h +++ b/keyboards/westfoxtrot/cyclops/cyclops.h @@ -29,9 +29,9 @@ #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K4D, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ + K40, K41, K42, K46, K4A, K4B, K4C, K4E, K2E \ ) { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ From 2835a7074985f25dea9398a7ac211914c9d52fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Thu, 9 May 2019 20:05:33 +0200 Subject: [PATCH 128/129] [Keymap] Fix RGB_MATRIX_ENABLE check in users/konstantin/rules.mk (#5832) --- users/konstantin/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/users/konstantin/rules.mk b/users/konstantin/rules.mk index 1799d2be50a..bf0ab979fb3 100644 --- a/users/konstantin/rules.mk +++ b/users/konstantin/rules.mk @@ -2,6 +2,7 @@ SRC += konstantin.c ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) SRC += rgb.c endif +RGB_MATRIX_ENABLE ?= no ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) SRC += rgb.c endif From bce391a663d2848bff8ffffca0e4bad771bd3890 Mon Sep 17 00:00:00 2001 From: moyi4681 Date: Fri, 10 May 2019 09:48:07 +0800 Subject: [PATCH 129/129] [Keyboard] DZTECH: CODE CLEANUP (#5828) * Delete board.c * Delete board.h * Delete board.mk * Delete bootloader_defs.h * Delete chconf.h * Delete halconf.h * Delete mcuconf.h * Update rules.mk * Update config.h * Update config.h * Update config.h * Update config.h * Update config.h * Update rules.mk * Delete bootloader_defs.h * Delete halconf.h * Delete chconf.h * Delete mcuconf.h * Update rules.mk * Update config.h * Update dz40rgb.c * Update dz65rgb.c --- .../boards/GENERIC_STM32_F303XC/board.c | 126 -- .../boards/GENERIC_STM32_F303XC/board.h | 1187 ----------------- .../boards/GENERIC_STM32_F303XC/board.mk | 5 - keyboards/dztech/dz40rgb/bootloader_defs.h | 7 - keyboards/dztech/dz40rgb/chconf.h | 520 -------- keyboards/dztech/dz40rgb/config.h | 2 +- keyboards/dztech/dz40rgb/dz40rgb.c | 9 +- keyboards/dztech/dz40rgb/halconf.h | 388 ------ keyboards/dztech/dz40rgb/mcuconf.h | 257 ---- keyboards/dztech/dz40rgb/rules.mk | 46 +- keyboards/dztech/dz60rgb/bootloader_defs.h | 7 - keyboards/dztech/dz60rgb/chconf.h | 520 -------- keyboards/dztech/dz60rgb/config.h | 6 + keyboards/dztech/dz60rgb/halconf.h | 388 ------ .../dztech/dz60rgb/keymaps/ansi/config.h | 4 - .../dztech/dz60rgb/keymaps/hhkb/config.h | 4 - .../dztech/dz60rgb/keymaps/hhkb_iso/config.h | 4 - keyboards/dztech/dz60rgb/keymaps/iso/config.h | 4 - keyboards/dztech/dz60rgb/mcuconf.h | 257 ---- keyboards/dztech/dz60rgb/rules.mk | 39 +- keyboards/dztech/dz65rgb/dz65rgb.c | 10 + keyboards/dztech/dz65rgb/rules.mk | 2 + 22 files changed, 23 insertions(+), 3769 deletions(-) delete mode 100644 keyboards/dztech/boards/GENERIC_STM32_F303XC/board.c delete mode 100644 keyboards/dztech/boards/GENERIC_STM32_F303XC/board.h delete mode 100644 keyboards/dztech/boards/GENERIC_STM32_F303XC/board.mk delete mode 100644 keyboards/dztech/dz40rgb/bootloader_defs.h delete mode 100644 keyboards/dztech/dz40rgb/chconf.h delete mode 100644 keyboards/dztech/dz40rgb/halconf.h delete mode 100644 keyboards/dztech/dz40rgb/mcuconf.h delete mode 100644 keyboards/dztech/dz60rgb/bootloader_defs.h delete mode 100644 keyboards/dztech/dz60rgb/chconf.h delete mode 100644 keyboards/dztech/dz60rgb/halconf.h delete mode 100644 keyboards/dztech/dz60rgb/mcuconf.h diff --git a/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.c b/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.c deleted file mode 100644 index 4331155df4b..00000000000 --- a/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = { -#if STM32_HAS_GPIOA - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, -#endif -#if STM32_HAS_GPIOB - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, -#endif -#if STM32_HAS_GPIOC - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, -#endif -#if STM32_HAS_GPIOD - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, -#endif -#if STM32_HAS_GPIOE - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, -#endif -#if STM32_HAS_GPIOF - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, -#endif -#if STM32_HAS_GPIOG - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, -#endif -#if STM32_HAS_GPIOH - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, -#endif -#if STM32_HAS_GPIOI - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -#endif -}; -#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(); -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief SDC card write protection detection. - */ -bool sdc_lld_is_write_protected(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool mmc_lld_is_write_protected(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.h b/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.h deleted file mode 100644 index 988e6af3474..00000000000 --- a/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.h +++ /dev/null @@ -1,1187 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for Clueboard 60% Keyboard - */ - -/* - * Board identifier. - */ -#define BOARD_GENERIC_STM32_F303XC -#define BOARD_NAME "DZ60RGB PCB" - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#define STM32_LSEDRV (3U << 3U) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 8000000U -#endif - -// #define STM32_HSE_BYPASS - -/* - * MCU type as defined in the ST header. - */ -#define STM32F303xC - -/* - * IO pins assignments. - */ -#define GPIOA_PIN0 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_PIN4 4U -#define GPIOA_PIN5 5U -#define GPIOA_PIN6 6U -#define GPIOA_PIN7 7U -#define GPIOA_PIN8 8U -#define GPIOA_PIN9 9U -#define GPIOA_PIN10 10U -#define GPIOA_USB_DM 11U -#define GPIOA_USB_DP 12U -#define GPIOA_SWDIO 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_PIN3 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_PIN6 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_PIN9 9U -#define GPIOB_PIN10 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_PIN0 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PIN3 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_PIN7 7U -#define GPIOC_PIN8 8U -#define GPIOC_PIN9 9U -#define GPIOC_PIN10 10U -#define GPIOC_PIN11 11U -#define GPIOC_PIN12 12U -#define GPIOC_PIN13 13U -#define GPIOC_PIN14 14U -#define GPIOC_PIN15 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_PIN4 4U -#define GPIOD_PIN5 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_PIN12 12U -#define GPIOD_PIN13 13U -#define GPIOD_PIN14 14U -#define GPIOD_PIN15 15U - -#define GPIOE_PIN0 0U -#define GPIOE_PIN1 1U -#define GPIOE_PIN2 2U -#define GPIOE_PIN3 3U -#define GPIOE_PIN4 4U -#define GPIOE_PIN5 5U -#define GPIOE_PIN6 6U -#define GPIOE_PIN7 7U -#define GPIOE_PIN8 8U -#define GPIOE_PIN9 9U -#define GPIOE_PIN10 10U -#define GPIOE_PIN11 11U -#define GPIOE_PIN12 12U -#define GPIOE_PIN13 13U -#define GPIOE_PIN14 14U -#define GPIOE_PIN15 15U - -#define GPIOF_I2C2_SDA 0U -#define GPIOF_I2C2_SCL 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -#define GPIOG_PIN0 0U -#define GPIOG_PIN1 1U -#define GPIOG_PIN2 2U -#define GPIOG_PIN3 3U -#define GPIOG_PIN4 4U -#define GPIOG_PIN5 5U -#define GPIOG_PIN6 6U -#define GPIOG_PIN7 7U -#define GPIOG_PIN8 8U -#define GPIOG_PIN9 9U -#define GPIOG_PIN10 10U -#define GPIOG_PIN11 11U -#define GPIOG_PIN12 12U -#define GPIOG_PIN13 13U -#define GPIOG_PIN14 14U -#define GPIOG_PIN15 15U - -#define GPIOH_PIN0 0U -#define GPIOH_PIN1 1U -#define GPIOH_PIN2 2U -#define GPIOH_PIN3 3U -#define GPIOH_PIN4 4U -#define GPIOH_PIN5 5U -#define GPIOH_PIN6 6U -#define GPIOH_PIN7 7U -#define GPIOH_PIN8 8U -#define GPIOH_PIN9 9U -#define GPIOH_PIN10 10U -#define GPIOH_PIN11 11U -#define GPIOH_PIN12 12U -#define GPIOH_PIN13 13U -#define GPIOH_PIN14 14U -#define GPIOH_PIN15 15U - -/* - * IO lines assignments. - */ -#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) -#define LINE_USB_DM PAL_LINE(GPIOA, 11U) -#define LINE_USB_DP PAL_LINE(GPIOA, 12U) -#define LINE_SWDIO PAL_LINE(GPIOA, 13U) -#define LINE_SWCLK PAL_LINE(GPIOA, 14U) - -#define LINE_PIN6 PAL_LINE(GPIOF, 0U) -#define LINE_PIN7 PAL_LINE(GPIOF, 1U) - -#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) - - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - NC - * PA1 - NC - * PA2 - COL1 - * PA3 - COL2 - * PA4 - SPEAKER1 - * PA5 - SPEAKER2 - * PA6 - COL3 - * PA7 - COL8 - * PA8 - COL6 - * PA9 - COL7 - * PA10 - ROW5 - * PA11 - USB_DM (alternate 14). - * PA12 - USB_DP (alternate 14). - * PA13 - SWDIO (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - ROW4 - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ - PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_PIN5) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_PIN7) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_PIN9) | \ - PIN_MODE_INPUT(GPIOA_PIN10) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ - PIN_OSPEED_HIGH(GPIOA_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ - PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ - PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ - PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ - PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ - PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ - PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_PIN5) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_PIN7) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_PIN9) | \ - PIN_ODR_HIGH(GPIOA_PIN10) | \ - PIN_ODR_HIGH(GPIOA_USB_DM) | \ - PIN_ODR_HIGH(GPIOA_USB_DP) | \ - PIN_ODR_HIGH(GPIOA_SWDIO) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 1) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_PIN4, 0) | \ - PIN_AFIO_AF(GPIOA_PIN5, 5) | \ - PIN_AFIO_AF(GPIOA_PIN6, 5) | \ - PIN_AFIO_AF(GPIOA_PIN7, 5)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_PIN9, 0) | \ - PIN_AFIO_AF(GPIOA_PIN10, 0) | \ - PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ - PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ - PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - PIN3 (alternate 0). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). - * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). - * PB8 - PIN8 (input pullup). - * PB9 - PIN9 (input pullup). - * PB10 - PIN10 (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ - PIN_MODE_OUTPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_PIN10) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ - PIN_OSPEED_HIGH(GPIOB_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ - PIN_OSPEED_HIGH(GPIOB_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ - PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_PIN3) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_LOW(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_PIN10) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_PIN3, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_PIN6, 4) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0) | \ - PIN_AFIO_AF(GPIOB_PIN10, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - PIN0 (input pullup). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PIN3 (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - PIN7 (input pullup). - * PC8 - PIN8 (input pullup). - * PC9 - PIN9 (input pullup). - * PC10 - PIN10 (input pullup). - * PC11 - PIN11 (input pullup). - * PC12 - PIN12 (input pullup). - * PC13 - PIN13 (input pullup). - * PC14 - PIN14 (input floating). - * PC15 - PIN15 (input floating). - */ -#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_INPUT(GPIOC_PIN7) | \ - PIN_MODE_INPUT(GPIOC_PIN8) | \ - PIN_MODE_INPUT(GPIOC_PIN9) | \ - PIN_MODE_INPUT(GPIOC_PIN10) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_PIN14) | \ - PIN_MODE_INPUT(GPIOC_PIN15)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ - PIN_OSPEED_HIGH(GPIOC_PIN14) | \ - PIN_OSPEED_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN15)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_PIN7) | \ - PIN_ODR_HIGH(GPIOC_PIN8) | \ - PIN_ODR_HIGH(GPIOC_PIN9) | \ - PIN_ODR_HIGH(GPIOC_PIN10) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_PIN14) | \ - PIN_ODR_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_PIN7, 0)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ - PIN_AFIO_AF(GPIOC_PIN9, 0) | \ - PIN_AFIO_AF(GPIOC_PIN10, 0) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_PIN14, 0) | \ - PIN_AFIO_AF(GPIOC_PIN15, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - PIN4 (input pullup). - * PD5 - PIN5 (input pullup). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD11 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - PIN12 (input pullup). - * PD13 - PIN13 (input pullup). - * PD14 - PIN14 (input pullup). - * PD15 - PIN15 (input pullup). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_PIN4) | \ - PIN_MODE_INPUT(GPIOD_PIN5) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_INPUT(GPIOD_PIN12) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_PIN14) | \ - PIN_MODE_INPUT(GPIOD_PIN15)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN15)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN15)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_PIN4) | \ - PIN_ODR_HIGH(GPIOD_PIN5) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_HIGH(GPIOD_PIN12) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_PIN14) | \ - PIN_ODR_HIGH(GPIOD_PIN15)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_PIN4, 0) | \ - PIN_AFIO_AF(GPIOD_PIN5, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_PIN12, 0) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0) | \ - PIN_AFIO_AF(GPIOD_PIN14, 0) | \ - PIN_AFIO_AF(GPIOD_PIN15, 0)) - -/* - * GPIOE setup: - * - * PE0 - PIN0 (input pullup). - * PE1 - PIN1 (input pullup). - * PE2 - PIN2 (input pullup). - * PE3 - PIN3 L3GD20_CS (output pushpull maximum). - * PE4 - PIN4 (input pullup). - * PE5 - PIN5 (input pullup). - * PE6 - PIN6 (input pullup). - * PE7 - PIN7 (input pullup). - * PE8 - PIN8 (output pushpull maximum). - * PE9 - PIN9 (output pushpull maximum). - * PE10 - PIN10 (output pushpull maximum). - * PE11 - PIN11 (output pushpull maximum). - * PE12 - PIN12 (output pushpull maximum). - * PE13 - PIN13 (output pushpull maximum). - * PE14 - PIN14 (output pushpull maximum). - * PE15 - PIN15 (output pushpull maximum). - */ -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ - PIN_MODE_INPUT(GPIOE_PIN1) | \ - PIN_MODE_INPUT(GPIOE_PIN2) |\ - PIN_MODE_OUTPUT(GPIOE_PIN3) | \ - PIN_MODE_INPUT(GPIOE_PIN4) |\ - PIN_MODE_INPUT(GPIOE_PIN5) |\ - PIN_MODE_INPUT(GPIOE_PIN6) | \ - PIN_MODE_INPUT(GPIOE_PIN7) | \ - PIN_MODE_OUTPUT(GPIOE_PIN8) | \ - PIN_MODE_OUTPUT(GPIOE_PIN9) | \ - PIN_MODE_OUTPUT(GPIOE_PIN10) | \ - PIN_MODE_OUTPUT(GPIOE_PIN11) | \ - PIN_MODE_OUTPUT(GPIOE_PIN12) | \ - PIN_MODE_OUTPUT(GPIOE_PIN13) | \ - PIN_MODE_OUTPUT(GPIOE_PIN14) | \ - PIN_MODE_OUTPUT(GPIOE_PIN15)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ - PIN_OSPEED_HIGH(GPIOE_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ - PIN_OSPEED_HIGH(GPIOE_PIN8) | \ - PIN_OSPEED_HIGH(GPIOE_PIN9) | \ - PIN_OSPEED_HIGH(GPIOE_PIN10) | \ - PIN_OSPEED_HIGH(GPIOE_PIN11) | \ - PIN_OSPEED_HIGH(GPIOE_PIN12) | \ - PIN_OSPEED_HIGH(GPIOE_PIN13) | \ - PIN_OSPEED_HIGH(GPIOE_PIN14) | \ - PIN_OSPEED_HIGH(GPIOE_PIN15)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN15)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ - PIN_ODR_HIGH(GPIOE_PIN1) | \ - PIN_ODR_HIGH(GPIOE_PIN2) | \ - PIN_ODR_HIGH(GPIOE_PIN3) | \ - PIN_ODR_HIGH(GPIOE_PIN4) | \ - PIN_ODR_HIGH(GPIOE_PIN5) | \ - PIN_ODR_HIGH(GPIOE_PIN6) | \ - PIN_ODR_HIGH(GPIOE_PIN7) | \ - PIN_ODR_LOW(GPIOE_PIN8) | \ - PIN_ODR_LOW(GPIOE_PIN9) | \ - PIN_ODR_LOW(GPIOE_PIN10) | \ - PIN_ODR_LOW(GPIOE_PIN11) | \ - PIN_ODR_LOW(GPIOE_PIN12) | \ - PIN_ODR_LOW(GPIOE_PIN13) | \ - PIN_ODR_LOW(GPIOE_PIN14) | \ - PIN_ODR_LOW(GPIOE_PIN15)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ - PIN_AFIO_AF(GPIOE_PIN1, 0) | \ - PIN_AFIO_AF(GPIOE_PIN2, 0) |\ - PIN_AFIO_AF(GPIOE_PIN3, 0) | \ - PIN_AFIO_AF(GPIOE_PIN4, 0) |\ - PIN_AFIO_AF(GPIOE_PIN5, 0) |\ - PIN_AFIO_AF(GPIOE_PIN6, 0) | \ - PIN_AFIO_AF(GPIOE_PIN7, 0)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ - PIN_AFIO_AF(GPIOE_PIN9, 0) | \ - PIN_AFIO_AF(GPIOE_PIN10, 0) | \ - PIN_AFIO_AF(GPIOE_PIN11, 0) | \ - PIN_AFIO_AF(GPIOE_PIN12, 0) | \ - PIN_AFIO_AF(GPIOE_PIN13, 0) | \ - PIN_AFIO_AF(GPIOE_PIN14, 0) | \ - PIN_AFIO_AF(GPIOE_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - I2C2_SDA (input floating). - * PF1 - I2C2_SCL (input floating). - * PF2 - PIN2 (input pullup). - * PF3 - PIN3 (input pullup). - * PF4 - PIN4 (input pullup). - * PF5 - PIN5 (input pullup). - * PF6 - PIN6 (input pullup). - * PF7 - PIN7 (input pullup). - * PF8 - PIN8 (input pullup). - * PF9 - PIN9 (input pullup). - * PF10 - PIN10 (input pullup). - * PF11 - PIN11 (input pullup). - * PF12 - PIN12 (input pullup). - * PF13 - PIN13 (input pullup). - * PF14 - PIN14 (input pullup). - * PF15 - PIN15 (input pullup). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ - PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ - PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ - PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ - PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ - PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ - PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - -/* - * GPIOG setup: - * - * PG0 - PIN0 (input pullup). - * PG1 - PIN1 (input pullup). - * PG2 - PIN2 (input pullup). - * PG3 - PIN3 (input pullup). - * PG4 - PIN4 (input pullup). - * PG5 - PIN5 (input pullup). - * PG6 - PIN6 (input pullup). - * PG7 - PIN7 (input pullup). - * PG8 - PIN8 (input pullup). - * PG9 - PIN9 (input pullup). - * PG10 - PIN10 (input pullup). - * PG11 - PIN11 (input pullup). - * PG12 - PIN12 (input pullup). - * PG13 - PIN13 (input pullup). - * PG14 - PIN14 (input pullup). - * PG15 - PIN15 (input pullup). - */ -#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ - PIN_MODE_INPUT(GPIOG_PIN1) | \ - PIN_MODE_INPUT(GPIOG_PIN2) | \ - PIN_MODE_INPUT(GPIOG_PIN3) | \ - PIN_MODE_INPUT(GPIOG_PIN4) | \ - PIN_MODE_INPUT(GPIOG_PIN5) | \ - PIN_MODE_INPUT(GPIOG_PIN6) | \ - PIN_MODE_INPUT(GPIOG_PIN7) | \ - PIN_MODE_INPUT(GPIOG_PIN8) | \ - PIN_MODE_INPUT(GPIOG_PIN9) | \ - PIN_MODE_INPUT(GPIOG_PIN10) | \ - PIN_MODE_INPUT(GPIOG_PIN11) | \ - PIN_MODE_INPUT(GPIOG_PIN12) | \ - PIN_MODE_INPUT(GPIOG_PIN13) | \ - PIN_MODE_INPUT(GPIOG_PIN14) | \ - PIN_MODE_INPUT(GPIOG_PIN15)) -#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN15)) -#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN15)) -#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ - PIN_ODR_HIGH(GPIOG_PIN1) | \ - PIN_ODR_HIGH(GPIOG_PIN2) | \ - PIN_ODR_HIGH(GPIOG_PIN3) | \ - PIN_ODR_HIGH(GPIOG_PIN4) | \ - PIN_ODR_HIGH(GPIOG_PIN5) | \ - PIN_ODR_HIGH(GPIOG_PIN6) | \ - PIN_ODR_HIGH(GPIOG_PIN7) | \ - PIN_ODR_HIGH(GPIOG_PIN8) | \ - PIN_ODR_HIGH(GPIOG_PIN9) | \ - PIN_ODR_HIGH(GPIOG_PIN10) | \ - PIN_ODR_HIGH(GPIOG_PIN11) | \ - PIN_ODR_HIGH(GPIOG_PIN12) | \ - PIN_ODR_HIGH(GPIOG_PIN13) | \ - PIN_ODR_HIGH(GPIOG_PIN14) | \ - PIN_ODR_HIGH(GPIOG_PIN15)) -#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ - PIN_AFIO_AF(GPIOG_PIN1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN2, 0) | \ - PIN_AFIO_AF(GPIOG_PIN3, 0) | \ - PIN_AFIO_AF(GPIOG_PIN4, 0) | \ - PIN_AFIO_AF(GPIOG_PIN5, 0) | \ - PIN_AFIO_AF(GPIOG_PIN6, 0) | \ - PIN_AFIO_AF(GPIOG_PIN7, 0)) -#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ - PIN_AFIO_AF(GPIOG_PIN9, 0) | \ - PIN_AFIO_AF(GPIOG_PIN10, 0) | \ - PIN_AFIO_AF(GPIOG_PIN11, 0) | \ - PIN_AFIO_AF(GPIOG_PIN12, 0) | \ - PIN_AFIO_AF(GPIOG_PIN13, 0) | \ - PIN_AFIO_AF(GPIOG_PIN14, 0) | \ - PIN_AFIO_AF(GPIOG_PIN15, 0)) - -/* - * GPIOH setup: - * - * PH0 - PIN0 (input pullup). - * PH1 - PIN1 (input pullup). - * PH2 - PIN2 (input pullup). - * PH3 - PIN3 (input pullup). - * PH4 - PIN4 (input pullup). - * PH5 - PIN5 (input pullup). - * PH6 - PIN6 (input pullup). - * PH7 - PIN7 (input pullup). - * PH8 - PIN8 (input pullup). - * PH9 - PIN9 (input pullup). - * PH10 - PIN10 (input pullup). - * PH11 - PIN11 (input pullup). - * PH12 - PIN12 (input pullup). - * PH13 - PIN13 (input pullup). - * PH14 - PIN14 (input pullup). - * PH15 - PIN15 (input pullup). - */ -#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ - PIN_MODE_INPUT(GPIOH_PIN1) | \ - PIN_MODE_INPUT(GPIOH_PIN2) | \ - PIN_MODE_INPUT(GPIOH_PIN3) | \ - PIN_MODE_INPUT(GPIOH_PIN4) | \ - PIN_MODE_INPUT(GPIOH_PIN5) | \ - PIN_MODE_INPUT(GPIOH_PIN6) | \ - PIN_MODE_INPUT(GPIOH_PIN7) | \ - PIN_MODE_INPUT(GPIOH_PIN8) | \ - PIN_MODE_INPUT(GPIOH_PIN9) | \ - PIN_MODE_INPUT(GPIOH_PIN10) | \ - PIN_MODE_INPUT(GPIOH_PIN11) | \ - PIN_MODE_INPUT(GPIOH_PIN12) | \ - PIN_MODE_INPUT(GPIOH_PIN13) | \ - PIN_MODE_INPUT(GPIOH_PIN14) | \ - PIN_MODE_INPUT(GPIOH_PIN15)) -#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN15)) -#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN15)) -#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ - PIN_ODR_HIGH(GPIOH_PIN1) | \ - PIN_ODR_HIGH(GPIOH_PIN2) | \ - PIN_ODR_HIGH(GPIOH_PIN3) | \ - PIN_ODR_HIGH(GPIOH_PIN4) | \ - PIN_ODR_HIGH(GPIOH_PIN5) | \ - PIN_ODR_HIGH(GPIOH_PIN6) | \ - PIN_ODR_HIGH(GPIOH_PIN7) | \ - PIN_ODR_HIGH(GPIOH_PIN8) | \ - PIN_ODR_HIGH(GPIOH_PIN9) | \ - PIN_ODR_HIGH(GPIOH_PIN10) | \ - PIN_ODR_HIGH(GPIOH_PIN11) | \ - PIN_ODR_HIGH(GPIOH_PIN12) | \ - PIN_ODR_HIGH(GPIOH_PIN13) | \ - PIN_ODR_HIGH(GPIOH_PIN14) | \ - PIN_ODR_HIGH(GPIOH_PIN15)) -#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ - PIN_AFIO_AF(GPIOH_PIN1, 0) | \ - PIN_AFIO_AF(GPIOH_PIN2, 0) | \ - PIN_AFIO_AF(GPIOH_PIN3, 0) | \ - PIN_AFIO_AF(GPIOH_PIN4, 0) | \ - PIN_AFIO_AF(GPIOH_PIN5, 0) | \ - PIN_AFIO_AF(GPIOH_PIN6, 0) | \ - PIN_AFIO_AF(GPIOH_PIN7, 0)) -#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ - PIN_AFIO_AF(GPIOH_PIN9, 0) | \ - PIN_AFIO_AF(GPIOH_PIN10, 0) | \ - PIN_AFIO_AF(GPIOH_PIN11, 0) | \ - PIN_AFIO_AF(GPIOH_PIN12, 0) | \ - PIN_AFIO_AF(GPIOH_PIN13, 0) | \ - PIN_AFIO_AF(GPIOH_PIN14, 0) | \ - PIN_AFIO_AF(GPIOH_PIN15, 0)) - - -/* - * USB bus activation macro, required by the USB driver. - */ -// #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)); 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_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.mk deleted file mode 100644 index 43377629a3c..00000000000 --- a/keyboards/dztech/boards/GENERIC_STM32_F303XC/board.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List of all the board related files. -BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c - -# Required include directories -BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC diff --git a/keyboards/dztech/dz40rgb/bootloader_defs.h b/keyboards/dztech/dz40rgb/bootloader_defs.h deleted file mode 100644 index 3b0e9d20a6a..00000000000 --- a/keyboards/dztech/dz40rgb/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/dztech/dz40rgb/chconf.h b/keyboards/dztech/dz40rgb/chconf.h deleted file mode 100644 index 1d9f12ff1f8..00000000000 --- a/keyboards/dztech/dz40rgb/chconf.h +++ /dev/null @@ -1,520 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 100000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM TRUE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY TRUE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK TRUE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ diff --git a/keyboards/dztech/dz40rgb/config.h b/keyboards/dztech/dz40rgb/config.h index 0d6c4ae39a7..5f1502f4af1 100644 --- a/keyboards/dztech/dz40rgb/config.h +++ b/keyboards/dztech/dz40rgb/config.h @@ -21,7 +21,7 @@ #define DEBOUNCE 3 #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #define RGB_MATRIX_KEYPRESSES #define DISABLE_RGB_MATRIX_SPLASH #define DISABLE_RGB_MATRIX_MULTISPLASH diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c index e5e39c92aba..92e4a7cad30 100644 --- a/keyboards/dztech/dz40rgb/dz40rgb.c +++ b/keyboards/dztech/dz40rgb/dz40rgb.c @@ -181,28 +181,23 @@ led_config_t g_led_config = { { #endif - void matrix_init_kb(void) { matrix_init_user(); } - - void matrix_scan_kb(void) { matrix_scan_user(); } - - bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } - - void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); } void suspend_wakeup_init_kb(void) { rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); } diff --git a/keyboards/dztech/dz40rgb/halconf.h b/keyboards/dztech/dz40rgb/halconf.h deleted file mode 100644 index eda293c49b8..00000000000 --- a/keyboards/dztech/dz40rgb/halconf.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef HALCONF_H -#define HALCONF_H - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC TRUE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT TRUE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C TRUE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the QSPI subsystem. - */ -#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) -#define HAL_USE_QSPI FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 16 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 256 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 1 -#endif - -/** - * @brief Serial over USB number of buffers. - * @note The default is 2 buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_NUMBER 2 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) -#define UART_USE_WAIT FALSE -#endif - -/** - * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define UART_USE_MUTUAL_EXCLUSION FALSE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* HALCONF_H */ - -/** @} */ diff --git a/keyboards/dztech/dz40rgb/mcuconf.h b/keyboards/dztech/dz40rgb/mcuconf.h deleted file mode 100644 index 226da48d593..00000000000 --- a/keyboards/dztech/dz40rgb/mcuconf.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef MCUCONF_H -#define MCUCONF_H - -/* - * STM32F3xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F3xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 -#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_USART2SW STM32_USART2SW_PCLK -#define STM32_USART3SW STM32_USART3SW_PCLK -#define STM32_UART4SW STM32_UART4SW_PCLK -#define STM32_UART5SW STM32_UART5SW_PCLK -#define STM32_I2C1SW STM32_I2C1SW_SYSCLK -#define STM32_I2C2SW STM32_I2C2SW_SYSCLK -#define STM32_TIM1SW STM32_TIM1SW_PCLK2 -#define STM32_TIM8SW STM32_TIM8SW_PCLK2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_USB_CLOCK_REQUIRED TRUE -#define STM32_USBPRE STM32_USBPRE_DIV1P5 - -#undef STM32_HSE_BYPASS -// #error "oh no" -// #endif - -/* - * ADC driver system settings. - */ -#define STM32_ADC_DUAL_MODE FALSE -#define STM32_ADC_COMPACT_SAMPLES FALSE -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_USE_ADC4 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_ADC4_DMA_PRIORITY 2 -#define STM32_ADC_ADC12_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 -#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 TRUE -#define STM32_DAC_USE_DAC1_CH2 TRUE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM6 TRUE -#define STM32_GPT_USE_TIM7 TRUE -#define STM32_GPT_USE_TIM8 TRUE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 TRUE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 10 -#define STM32_I2C_I2C2_IRQ_PRIORITY 10 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 - -/* - * WDG driver system settings. - */ -#define STM32_WDG_USE_IWDG FALSE - -#endif /* MCUCONF_H */ diff --git a/keyboards/dztech/dz40rgb/rules.mk b/keyboards/dztech/dz40rgb/rules.mk index d0ddec838cc..fc4b028d5c0 100644 --- a/keyboards/dztech/dz40rgb/rules.mk +++ b/keyboards/dztech/dz40rgb/rules.mk @@ -1,50 +1,6 @@ -# project specific files - -## chip/board settings -# the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F3xx - -# Linker script to use -# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F303xC - -# Startup code to use -# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f3xx - -# Board: it should exist either in /os/hal/boards/ -# or /boards -BOARD = GENERIC_STM32_F303XC - -# Cortex version -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 = - -# Do not put the microcontroller into power saving mode -# when we get USB suspend event. We want it to keep updating -# backlight effects. -OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - -# Options to pass to dfu-util when flashing +MCU = STM32F303 DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave DFU_SUFFIX_ARGS = -p DF11 -v 0483 - -# Build Options -# comment out to disable the options. -# BACKLIGHT_ENABLE = no BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = yes # Mouse keys diff --git a/keyboards/dztech/dz60rgb/bootloader_defs.h b/keyboards/dztech/dz60rgb/bootloader_defs.h deleted file mode 100644 index 3b0e9d20a6a..00000000000 --- a/keyboards/dztech/dz60rgb/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/dztech/dz60rgb/chconf.h b/keyboards/dztech/dz60rgb/chconf.h deleted file mode 100644 index 1d9f12ff1f8..00000000000 --- a/keyboards/dztech/dz60rgb/chconf.h +++ /dev/null @@ -1,520 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 100000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM TRUE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY TRUE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK TRUE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ diff --git a/keyboards/dztech/dz60rgb/config.h b/keyboards/dztech/dz60rgb/config.h index 0c04acce3fd..edf0982ab20 100644 --- a/keyboards/dztech/dz60rgb/config.h +++ b/keyboards/dztech/dz60rgb/config.h @@ -32,5 +32,11 @@ #define DRIVER_ADDR_1 0b1010000 #define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. #define DRIVER_COUNT 2 +#if defined (dzrgb60_ansi) || defined (dzrgb60_iso) +#define DRIVER_1_LED_TOTAL 61 +#elif defined (dzrgb60_hhkb) || defined (dzrgb60_hhkb_iso) +#define DRIVER_1_LED_TOTAL 62 +#else #define DRIVER_1_LED_TOTAL 63 +#endif #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz60rgb/halconf.h b/keyboards/dztech/dz60rgb/halconf.h deleted file mode 100644 index eda293c49b8..00000000000 --- a/keyboards/dztech/dz60rgb/halconf.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef HALCONF_H -#define HALCONF_H - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC TRUE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT TRUE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C TRUE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the QSPI subsystem. - */ -#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) -#define HAL_USE_QSPI FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 16 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 256 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 1 -#endif - -/** - * @brief Serial over USB number of buffers. - * @note The default is 2 buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_NUMBER 2 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) -#define UART_USE_WAIT FALSE -#endif - -/** - * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define UART_USE_MUTUAL_EXCLUSION FALSE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* HALCONF_H */ - -/** @} */ diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/config.h b/keyboards/dztech/dz60rgb/keymaps/ansi/config.h index 3ca582e84b4..4bfad0df0df 100644 --- a/keyboards/dztech/dz60rgb/keymaps/ansi/config.h +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/config.h @@ -1,6 +1,2 @@ #pragma once #define dzrgb60_ansi -#undef DRIVER_1_LED_TOTAL -#undef DRIVER_LED_TOTAL -#define DRIVER_1_LED_TOTAL 61 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/config.h b/keyboards/dztech/dz60rgb/keymaps/hhkb/config.h index 70f4bde25fe..2b5e7de6a25 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb/config.h +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/config.h @@ -1,6 +1,2 @@ #pragma once #define dzrgb60_hhkb -#undef DRIVER_1_LED_TOTAL -#undef DRIVER_LED_TOTAL -#define DRIVER_1_LED_TOTAL 62 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/config.h b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/config.h index 2bc3519de71..8de5853e1a7 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/config.h +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/config.h @@ -1,6 +1,2 @@ #pragma once #define dzrgb60_hhkb_iso -#undef DRIVER_1_LED_TOTAL -#undef DRIVER_LED_TOTAL -#define DRIVER_1_LED_TOTAL 62 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/config.h b/keyboards/dztech/dz60rgb/keymaps/iso/config.h index 7ad810a162f..c765fe0e25e 100644 --- a/keyboards/dztech/dz60rgb/keymaps/iso/config.h +++ b/keyboards/dztech/dz60rgb/keymaps/iso/config.h @@ -1,6 +1,2 @@ #pragma once #define dzrgb60_iso -#undef DRIVER_1_LED_TOTAL -#undef DRIVER_LED_TOTAL -#define DRIVER_1_LED_TOTAL 61 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz60rgb/mcuconf.h b/keyboards/dztech/dz60rgb/mcuconf.h deleted file mode 100644 index 226da48d593..00000000000 --- a/keyboards/dztech/dz60rgb/mcuconf.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef MCUCONF_H -#define MCUCONF_H - -/* - * STM32F3xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F3xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 -#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_USART2SW STM32_USART2SW_PCLK -#define STM32_USART3SW STM32_USART3SW_PCLK -#define STM32_UART4SW STM32_UART4SW_PCLK -#define STM32_UART5SW STM32_UART5SW_PCLK -#define STM32_I2C1SW STM32_I2C1SW_SYSCLK -#define STM32_I2C2SW STM32_I2C2SW_SYSCLK -#define STM32_TIM1SW STM32_TIM1SW_PCLK2 -#define STM32_TIM8SW STM32_TIM8SW_PCLK2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_USB_CLOCK_REQUIRED TRUE -#define STM32_USBPRE STM32_USBPRE_DIV1P5 - -#undef STM32_HSE_BYPASS -// #error "oh no" -// #endif - -/* - * ADC driver system settings. - */ -#define STM32_ADC_DUAL_MODE FALSE -#define STM32_ADC_COMPACT_SAMPLES FALSE -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_USE_ADC4 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_ADC4_DMA_PRIORITY 2 -#define STM32_ADC_ADC12_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 -#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 TRUE -#define STM32_DAC_USE_DAC1_CH2 TRUE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM6 TRUE -#define STM32_GPT_USE_TIM7 TRUE -#define STM32_GPT_USE_TIM8 TRUE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 TRUE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 10 -#define STM32_I2C_I2C2_IRQ_PRIORITY 10 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 - -/* - * WDG driver system settings. - */ -#define STM32_WDG_USE_IWDG FALSE - -#endif /* MCUCONF_H */ diff --git a/keyboards/dztech/dz60rgb/rules.mk b/keyboards/dztech/dz60rgb/rules.mk index 20ca7f2eb64..8ff1cbdc296 100644 --- a/keyboards/dztech/dz60rgb/rules.mk +++ b/keyboards/dztech/dz60rgb/rules.mk @@ -1,43 +1,6 @@ -# project specific files - -## chip/board settings -# the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F3xx - -# Linker script to use -# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F303xC - -# Startup code to use -# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f3xx - -# Board: it should exist either in /os/hal/boards/ -# or /boards -BOARD = GENERIC_STM32_F303XC - -# Cortex version -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 = - -# Options to pass to dfu-util when flashing +MCU = STM32F303 DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave DFU_SUFFIX_ARGS = -p DF11 -v 0483 - - BACKLIGHT_ENABLE = no BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = yes # Mouse keys diff --git a/keyboards/dztech/dz65rgb/dz65rgb.c b/keyboards/dztech/dz65rgb/dz65rgb.c index e14943d9745..932d3f68b6c 100644 --- a/keyboards/dztech/dz65rgb/dz65rgb.c +++ b/keyboards/dztech/dz65rgb/dz65rgb.c @@ -94,11 +94,21 @@ led_config_t g_led_config = { { 4, 4, 4, 4, 1, 1, 1, 1 } }; +void matrix_init_kb(void) { + matrix_init_user(); +} +void matrix_scan_kb(void) { + matrix_scan_user(); +} +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); suspend_power_down_user(); } + void suspend_wakeup_init_kb(void) { rgb_matrix_set_suspend_state(false); diff --git a/keyboards/dztech/dz65rgb/rules.mk b/keyboards/dztech/dz65rgb/rules.mk index 7dc3bd9690c..bf392b4faad 100644 --- a/keyboards/dztech/dz65rgb/rules.mk +++ b/keyboards/dztech/dz65rgb/rules.mk @@ -1,4 +1,6 @@ MCU = STM32F303 +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 BACKLIGHT_ENABLE = no BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = yes # Mouse keys