From 724a4d6ba29c3bc998d8e3919611c955045a5125 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 15:49:49 +0100 Subject: [PATCH 01/11] Add flashing instructions for Linux --- keyboards/ymd96/README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/keyboards/ymd96/README.md b/keyboards/ymd96/README.md index 7a950223b673..9cb37605822d 100644 --- a/keyboards/ymd96/README.md +++ b/keyboards/ymd96/README.md @@ -31,17 +31,23 @@ This firmware was modified from [ps2avrGB](https://github.com/qmk/qmk_firmware/t ## Installing and Building -Since the YMD96 uses an ATmega32a chip instead of the 32u4, you need to download [HIDBootFlash v.1.0](http://vusb.wikidot.com/project:hidbootflash) for Windows. If anyone knows of a Linux/Mac bootflasher that works, edit this readme! +Since the YMD96 uses an ATmega32a chip instead of the 32u4, you need to download [HIDBootFlash v.1.0](http://vusb.wikidot.com/project:hidbootflash) for Windows. For Linux you can use the [bootloadHID](https://www.obdev.at/products/vusb/bootloadhid.html) utility (which will require building). Arch Linux users can alternatively install this from the [AUR](https://aur.archlinux.org/packages/bootloadhid/). On Windows, I use [MINGw](http://www.mingw.org/) to compile the keymaps. On Linux, you can simply use the terminal. Once you have those two pieces of software: -Build the keyboard with +Build the keyboard by navigating to the root folder of the QMK repo and running ``` -$ make ymd96-default +$ make ymd96:default ``` If you make your own layout, change the `default` word to whatever your layout is. -And flash the compiled hex file with `HIDBootFlash`. Simply put the board in flashing mode by plugging it in while holding control, and click `find device`. Then you can specify the .hex file and flash it to the device. +To flash the compiled hex file, simply put the board in flashing mode by plugging it in while holding control. +In `HIDBootFlash` first click `find device`, then you can specify the .hex file and flash it to the device. +For `bootloadHID`, from a terminal that is in the same folder as your firmware file, run +``` +$ sudo bootloadHID ymd96_default.hex +``` +Again replacing default with your custom keymap name if required. ## Troubleshooting From d90eda6170ee54de6b6361bce2a19c1add2f6674 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 16:47:54 +0100 Subject: [PATCH 02/11] Make device/manufacturer name consistent for ymd96 --- keyboards/ymd96/config.h | 1 - keyboards/ymd96/usbconfig.h | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/keyboards/ymd96/config.h b/keyboards/ymd96/config.h index 3122c694eb3d..1e9497fac690 100644 --- a/keyboards/ymd96/config.h +++ b/keyboards/ymd96/config.h @@ -23,7 +23,6 @@ along with this program. If not, see . #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D -// TODO: share these strings with usbconfig.h // Edit usbconfig.h to change these. #define MANUFACTURER ymdkey #define PRODUCT ymd96 diff --git a/keyboards/ymd96/usbconfig.h b/keyboards/ymd96/usbconfig.h index 50fe4ed113bc..a90a36f08248 100644 --- a/keyboards/ymd96/usbconfig.h +++ b/keyboards/ymd96/usbconfig.h @@ -242,8 +242,8 @@ section at the end of this file). #define USB_CFG_DEVICE_VERSION 0x00, 0x02 /* Version number of the device: Minor number first, then major number. */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -#define USB_CFG_VENDOR_NAME_LEN 13 +#define USB_CFG_VENDOR_NAME 'y','m','d','k','e','y' +#define USB_CFG_VENDOR_NAME_LEN 6 /* These two values define the vendor name returned by the USB device. The name * must be given as a list of characters under single quotes. The characters * are interpreted as Unicode (UTF-16) entities. @@ -252,8 +252,8 @@ section at the end of this file). * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for * details. */ -#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' -#define USB_CFG_DEVICE_NAME_LEN 8 +#define USB_CFG_DEVICE_NAME 'y','m','d','9','6' +#define USB_CFG_DEVICE_NAME_LEN 5 /* Same as above for the device name. If you don't want a device name, undefine * the macros. See the file USB-IDs-for-free.txt before you assign a name if * you use a shared VID/PID. From 49c8e7da996d811493ab24977733497f773ea1b3 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 16:48:37 +0100 Subject: [PATCH 03/11] Disable command mode by default for YMD96 --- keyboards/ymd96/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ymd96/rules.mk b/keyboards/ymd96/rules.mk index 42b3d11551f6..1cc4060b0157 100644 --- a/keyboards/ymd96/rules.mk +++ b/keyboards/ymd96/rules.mk @@ -35,7 +35,7 @@ BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no -COMMAND_ENABLE = yes +COMMAND_ENABLE = no BACKLIGHT_ENABLE = yes BACKLIGHT_CUSTOM_DRIVER = yes From 1c26ef7fe0787f34fd2b309dc616066839a54ced Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 16:49:01 +0100 Subject: [PATCH 04/11] Add function call to fix backlight for YMD96 --- keyboards/ymd96/matrix.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/keyboards/ymd96/matrix.c b/keyboards/ymd96/matrix.c index f2ecf4d33ceb..2932976dde20 100644 --- a/keyboards/ymd96/matrix.c +++ b/keyboards/ymd96/matrix.c @@ -50,20 +50,8 @@ void matrix_init(void) { matrix[row] = 0x00; matrix_debouncing[row] = 0x00; } -/*} matrix_init_quantum(); // missing from original port by Luiz -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -}*/ - - -/*uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x;*/ } uint8_t matrix_scan(void) { From 3b332984c47b94d26146995e4f4d25e6b62c380f Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 16:57:49 +0100 Subject: [PATCH 05/11] Add personal YMD96 config --- .../ymd96/keymaps/AnthonyWharton/README.md | 16 +++++ .../ymd96/keymaps/AnthonyWharton/config.h | 69 +++++++++++++++++++ .../ymd96/keymaps/AnthonyWharton/keymap.c | 50 ++++++++++++++ keyboards/ymd96/ymd96.h | 18 +++++ 4 files changed, 153 insertions(+) create mode 100644 keyboards/ymd96/keymaps/AnthonyWharton/README.md create mode 100644 keyboards/ymd96/keymaps/AnthonyWharton/config.h create mode 100644 keyboards/ymd96/keymaps/AnthonyWharton/keymap.c diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/README.md b/keyboards/ymd96/keymaps/AnthonyWharton/README.md new file mode 100644 index 000000000000..973e336cb61d --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/README.md @@ -0,0 +1,16 @@ +# Personal Config by @AnthonyWharton + +The keymap and layout macro's in the main repository are for the following +keyboard: + +![@AnthonyWharton's YMD96](https://i.imgur.com/uhKmkBz.jpg) + +**Note:** This setup has locking Caps Lock and Num Lock keys, so if you wish +to use this layout and do not have such keys, you should : + + - Change the keys `KC_LCAP` and `KC_LNUM` to `KC_CAPS` and `KC_NUMLOCK` + respectively. + - Remove the `LOCKING_SUPPORT_ENABLE` and `LOCKING_RESYNC_ENABLE` lines + from `config.h`. + +For any other questions, find my latest contact information on my github page. diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/config.h b/keyboards/ymd96/keymaps/AnthonyWharton/config.h new file mode 100644 index 000000000000..428e5f1b39b2 --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/config.h @@ -0,0 +1,69 @@ +/* +Base Copyright 2017 Luiz Ribeiro +Modified 2017 Andrew Novak + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "config_common.h" + +#ifndef CONFIG_H +#define CONFIG_H + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +// Edit usbconfig.h to change these. +#define MANUFACTURER ymdkey +#define PRODUCT ymd96 + +/* Matrix Size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 +#define DIODE_DIRECTION COL2ROW + +/* Required for MX Locks installed */ +#define LOCKING_SUPPORT_ENABLE +#define LOCKING_RESYNC_ENABLE + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_TOGGLE 3 +#define NO_UART 1 + +#define BACKLIGHT_LEVELS 12 + +/* RGB Underglow */ +// The RGB_DI_PING value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. +#define RGBLED_NUM 18 +#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are send + // via I2C to 0xB0 + +#define RGBLIGHT_ANIMATIONS + +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1.0-2.7 +#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 1-255 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 500 + +// #define NO_UART 1 +// #define BOOTLOADHID_BOOTLOADER 1 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#endif diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c new file mode 100644 index 000000000000..6dd9b49a91c3 --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c @@ -0,0 +1,50 @@ +/* +Base Copyright 2017 Luiz Ribeiro +Modified 2017 Andrew Novak + +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 LicensezZZ +along with this program. If not, see . +*/ + +#include "ymd96.h" +#include "action_layer.h" +#include "rgblight.h" + +#define ______ KC_TRNS +#define _DEFLT 0 +#define _RAISE 1 + +#define KEYMAP KEYMAP_AnthonyWharton + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0, default layer */ + [_DEFLT] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END, KC_INS, KC_DEL, KC_PGUP, \ + 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_LNUM, KC_PSLS, KC_PAST, KC_PGDN, \ + 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_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_LCAP, 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_P4, KC_P5, KC_P6, KC_PPLS, \ + 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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_RAISE), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + + /* Layer 1, raise layer */ + [_RAISE] = KEYMAP( + ______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, ______, KC_PAUS, KC_SLCK, ______, ______, ______, \ + ______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_M_X, RGB_M_G, BL_OFF, BL_ON, BL_DEC, BL_INC, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_VAD, RGB_VAI, KC_MUTE, ______, KC_VOLU, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_TOG, BL_TOGG, KC_MPRV, KC_MPLY, KC_MNXT, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, ______, KC_VOLD, ______, KC_LOCK, \ + ______, ______, KC_RALT, ______, ______, ______, KC_HOME, KC_PGDN, KC_END, ______, ______ \ + ) +}; diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymd96/ymd96.h index ee0926eee83d..ba4c94ab7615 100644 --- a/keyboards/ymd96/ymd96.h +++ b/keyboards/ymd96/ymd96.h @@ -77,4 +77,22 @@ K411, K410, K409, K408, K404, K405, K406, K407, K403, K402, K401, K400 \ } +#define KEYMAP_AnthonyWharton( \ + K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ + K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ + K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ + K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ + K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ + K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ +) { \ + { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ + { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ + { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ + { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ + { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ + { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ + { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ + { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ +} + #endif From 1ad80de1c20e29f1ff8233ffc1e83c64afe57b6c Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 18:09:59 +0100 Subject: [PATCH 06/11] Replace include with QMK macro --- keyboards/ymd96/keymaps/AnthonyWharton/keymap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c index 6dd9b49a91c3..cbb94d6b8dfa 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c @@ -16,9 +16,7 @@ You should have received a copy of the GNU General Public LicensezZZ along with this program. If not, see . */ -#include "ymd96.h" -#include "action_layer.h" -#include "rgblight.h" +#include QMK_KEYBOARD_H #define ______ KC_TRNS #define _DEFLT 0 From 55e9619ba7dcd4dc1902a8d023d51a828c1b9ded Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 18:23:14 +0100 Subject: [PATCH 07/11] Move KEYMAP macro to keymap-level folder --- .../ymd96/keymaps/AnthonyWharton/config.h | 4 +--- .../ymd96/keymaps/AnthonyWharton/keymap.c | 22 ++++++++++++++++++- keyboards/ymd96/ymd96.h | 19 ---------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/config.h b/keyboards/ymd96/keymaps/AnthonyWharton/config.h index 428e5f1b39b2..80b25ea0f22d 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/config.h +++ b/keyboards/ymd96/keymaps/AnthonyWharton/config.h @@ -1,6 +1,7 @@ /* Base Copyright 2017 Luiz Ribeiro Modified 2017 Andrew Novak +Modified 2018 Anthony Wharton 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 @@ -60,9 +61,6 @@ along with this program. If not, see . #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 #define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 500 -// #define NO_UART 1 -// #define BOOTLOADHID_BOOTLOADER 1 - /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c index cbb94d6b8dfa..b4700efe0ba9 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c @@ -1,6 +1,7 @@ /* Base Copyright 2017 Luiz Ribeiro Modified 2017 Andrew Novak +Modified 2018 Anthony Wharton 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 @@ -22,7 +23,26 @@ along with this program. If not, see . #define _DEFLT 0 #define _RAISE 1 -#define KEYMAP KEYMAP_AnthonyWharton +// Custom keymap for ISO Style Layout. Refer to the image in the README for +// an image of the full layout +#define KEYMAP( \ + K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ + K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ + K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ + K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ + K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ + K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ +) { \ + { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ + { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ + { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ + { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ + { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ + { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ + { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ + { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ +} + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymd96/ymd96.h index ba4c94ab7615..c9018a4c351a 100644 --- a/keyboards/ymd96/ymd96.h +++ b/keyboards/ymd96/ymd96.h @@ -76,23 +76,4 @@ K411, K410, K409, K408, K404, K405, K406, K407, K403, K402, K401, K400 \ { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \ } - -#define KEYMAP_AnthonyWharton( \ - K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ - K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ - K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ - K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ - K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ - K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ -) { \ - { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ - { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ - { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ - { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ - { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ - { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ - { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ - { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ -} - #endif From 55a631d83c3f69f1704fbdf821c9843cb6075609 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 22:37:51 +0100 Subject: [PATCH 08/11] Move custom KEYMAP macro to global LAYOUT_iso macro --- .../ymd96/keymaps/AnthonyWharton/keymap.c | 21 +------------------ keyboards/ymd96/ymd96.h | 18 ++++++++++++++++ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c index b4700efe0ba9..3d1288042467 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c @@ -23,26 +23,7 @@ along with this program. If not, see . #define _DEFLT 0 #define _RAISE 1 -// Custom keymap for ISO Style Layout. Refer to the image in the README for -// an image of the full layout -#define KEYMAP( \ - K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ - K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ - K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ - K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ - K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ - K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ -) { \ - { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ - { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ - { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ - { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ - { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ - { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ - { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ - { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ -} - +#define KEYMAP LAYOUT_iso const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymd96/ymd96.h index c9018a4c351a..9c25f2219288 100644 --- a/keyboards/ymd96/ymd96.h +++ b/keyboards/ymd96/ymd96.h @@ -76,4 +76,22 @@ K411, K410, K409, K408, K404, K405, K406, K407, K403, K402, K401, K400 \ { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \ } +#define LAYOUT_iso( \ + K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ + K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ + K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ + K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ + K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ + K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ +) { \ + { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ + { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ + { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ + { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ + { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ + { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ + { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ + { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ +} + #endif From 09cc0354dbcbfff10cfb7eba6ba420d3b6b79386 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Fri, 14 Sep 2018 22:50:07 +0100 Subject: [PATCH 09/11] Change transparent keymappings to global definition --- keyboards/ymd96/keymaps/AnthonyWharton/keymap.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c index 3d1288042467..7c1a94676d7a 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c @@ -19,7 +19,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H -#define ______ KC_TRNS #define _DEFLT 0 #define _RAISE 1 @@ -39,11 +38,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 1, raise layer */ [_RAISE] = KEYMAP( - ______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, ______, KC_PAUS, KC_SLCK, ______, ______, ______, \ - ______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_M_X, RGB_M_G, BL_OFF, BL_ON, BL_DEC, BL_INC, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_VAD, RGB_VAI, KC_MUTE, ______, KC_VOLU, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_TOG, BL_TOGG, KC_MPRV, KC_MPLY, KC_MNXT, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, ______, KC_VOLD, ______, KC_LOCK, \ - ______, ______, KC_RALT, ______, ______, ______, KC_HOME, KC_PGDN, KC_END, ______, ______ \ + _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, KC_PAUS, KC_SLCK, _______, _______, _______, \ + _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_M_X, RGB_M_G, BL_OFF, BL_ON, BL_DEC, BL_INC, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, KC_MUTE, _______, KC_VOLU, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, BL_TOGG, KC_MPRV, KC_MPLY, KC_MNXT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, KC_VOLD, _______, KC_LOCK, \ + _______, _______, KC_RALT, _______, _______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______ \ ) }; From d178bc6e775c239c72ae93f468529178d9076f85 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Sun, 16 Sep 2018 12:30:24 +0100 Subject: [PATCH 10/11] Remove unecessary import and change to pragma once - (instead of repeated ifdef) --- keyboards/ymd96/keymaps/AnthonyWharton/config.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/config.h b/keyboards/ymd96/keymaps/AnthonyWharton/config.h index 80b25ea0f22d..715e2c9a5fdc 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/config.h +++ b/keyboards/ymd96/keymaps/AnthonyWharton/config.h @@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config_common.h" - -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D @@ -64,4 +61,3 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) -#endif From cf87c1238347e057e8ecb1fea5ee73b28579bc4e Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Sun, 16 Sep 2018 12:31:37 +0100 Subject: [PATCH 11/11] Remove global keymap/layout definition --- keyboards/ymd96/keymaps/AnthonyWharton/keymap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c index 7c1a94676d7a..2b3e2e2c7c9d 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c @@ -22,12 +22,11 @@ along with this program. If not, see . #define _DEFLT 0 #define _RAISE 1 -#define KEYMAP LAYOUT_iso const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0, default layer */ - [_DEFLT] = KEYMAP( + [_DEFLT] = LAYOUT_iso( 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_HOME, KC_END, KC_INS, KC_DEL, KC_PGUP, \ 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_LNUM, KC_PSLS, KC_PAST, KC_PGDN, \ 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_P7, KC_P8, KC_P9, KC_PMNS, \ @@ -37,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* Layer 1, raise layer */ - [_RAISE] = KEYMAP( + [_RAISE] = LAYOUT_iso( _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, KC_PAUS, KC_SLCK, _______, _______, _______, \ _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_M_X, RGB_M_G, BL_OFF, BL_ON, BL_DEC, BL_INC, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, KC_MUTE, _______, KC_VOLU, _______, _______, \