diff options
author | Anthony Wharton <a.wharton.2015@bristol.ac.uk> | 2018-09-17 21:55:49 +0100 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-09-17 13:55:49 -0700 |
commit | ed2dd3b59c5fc7856a1b01a97ba5b22ed4f69317 (patch) | |
tree | 2967ef6fe41872e607e75ff46943f5c7a9881eda /keyboards/ymd96 | |
parent | fe3bfd91c1a085716baa2b4396709ad5d77c7c75 (diff) | |
download | qmk_firmware-ed2dd3b59c5fc7856a1b01a97ba5b22ed4f69317.tar.gz qmk_firmware-ed2dd3b59c5fc7856a1b01a97ba5b22ed4f69317.zip |
Keyboard: Add YMD96 instructions for Linux + Backlight Fixes (#3908)
* Add flashing instructions for Linux
* Make device/manufacturer name consistent for ymd96
* Disable command mode by default for YMD96
* Add function call to fix backlight for YMD96
* Add personal YMD96 config
* Replace include with QMK macro
* Move KEYMAP macro to keymap-level folder
* Move custom KEYMAP macro to global LAYOUT_iso macro
* Change transparent keymappings to global definition
* Remove unecessary import and change to pragma once
- (instead of repeated ifdef)
* Remove global keymap/layout definition
Diffstat (limited to 'keyboards/ymd96')
-rw-r--r-- | keyboards/ymd96/README.md | 14 | ||||
-rw-r--r-- | keyboards/ymd96/config.h | 1 | ||||
-rw-r--r-- | keyboards/ymd96/keymaps/AnthonyWharton/README.md | 16 | ||||
-rw-r--r-- | keyboards/ymd96/keymaps/AnthonyWharton/config.h | 63 | ||||
-rw-r--r-- | keyboards/ymd96/keymaps/AnthonyWharton/keymap.c | 47 | ||||
-rw-r--r-- | keyboards/ymd96/matrix.c | 12 | ||||
-rw-r--r-- | keyboards/ymd96/rules.mk | 2 | ||||
-rw-r--r-- | keyboards/ymd96/usbconfig.h | 8 | ||||
-rw-r--r-- | keyboards/ymd96/ymd96.h | 17 |
9 files changed, 158 insertions, 22 deletions
diff --git a/keyboards/ymd96/README.md b/keyboards/ymd96/README.md index 7a950223b..9cb376058 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 | |||
31 | 31 | ||
32 | ## Installing and Building | 32 | ## Installing and Building |
33 | 33 | ||
34 | 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! | 34 | 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/). |
35 | On Windows, I use [MINGw](http://www.mingw.org/) to compile the keymaps. On Linux, you can simply use the terminal. | 35 | On Windows, I use [MINGw](http://www.mingw.org/) to compile the keymaps. On Linux, you can simply use the terminal. |
36 | 36 | ||
37 | Once you have those two pieces of software: | 37 | Once you have those two pieces of software: |
38 | Build the keyboard with | 38 | Build the keyboard by navigating to the root folder of the QMK repo and running |
39 | ``` | 39 | ``` |
40 | $ make ymd96-default | 40 | $ make ymd96:default |
41 | ``` | 41 | ``` |
42 | If you make your own layout, change the `default` word to whatever your layout is. | 42 | If you make your own layout, change the `default` word to whatever your layout is. |
43 | 43 | ||
44 | 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. | 44 | To flash the compiled hex file, simply put the board in flashing mode by plugging it in while holding control. |
45 | In `HIDBootFlash` first click `find device`, then you can specify the .hex file and flash it to the device. | ||
46 | For `bootloadHID`, from a terminal that is in the same folder as your firmware file, run | ||
47 | ``` | ||
48 | $ sudo bootloadHID ymd96_default.hex | ||
49 | ``` | ||
50 | Again replacing default with your custom keymap name if required. | ||
45 | 51 | ||
46 | ## Troubleshooting | 52 | ## Troubleshooting |
47 | 53 | ||
diff --git a/keyboards/ymd96/config.h b/keyboards/ymd96/config.h index 3122c694e..1e9497fac 100644 --- a/keyboards/ymd96/config.h +++ b/keyboards/ymd96/config.h | |||
@@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
23 | 23 | ||
24 | #define VENDOR_ID 0x20A0 | 24 | #define VENDOR_ID 0x20A0 |
25 | #define PRODUCT_ID 0x422D | 25 | #define PRODUCT_ID 0x422D |
26 | // TODO: share these strings with usbconfig.h | ||
27 | // Edit usbconfig.h to change these. | 26 | // Edit usbconfig.h to change these. |
28 | #define MANUFACTURER ymdkey | 27 | #define MANUFACTURER ymdkey |
29 | #define PRODUCT ymd96 | 28 | #define PRODUCT ymd96 |
diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/README.md b/keyboards/ymd96/keymaps/AnthonyWharton/README.md new file mode 100644 index 000000000..973e336cb --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/README.md | |||
@@ -0,0 +1,16 @@ | |||
1 | # Personal Config by @AnthonyWharton | ||
2 | |||
3 | The keymap and layout macro's in the main repository are for the following | ||
4 | keyboard: | ||
5 | |||
6 |  | ||
7 | |||
8 | **Note:** This setup has locking Caps Lock and Num Lock keys, so if you wish | ||
9 | to use this layout and do not have such keys, you should : | ||
10 | |||
11 | - Change the keys `KC_LCAP` and `KC_LNUM` to `KC_CAPS` and `KC_NUMLOCK` | ||
12 | respectively. | ||
13 | - Remove the `LOCKING_SUPPORT_ENABLE` and `LOCKING_RESYNC_ENABLE` lines | ||
14 | from `config.h`. | ||
15 | |||
16 | 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 000000000..715e2c9a5 --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/config.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | Base Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
3 | Modified 2017 Andrew Novak <ndrw.nvk@gmail.com> | ||
4 | Modified 2018 Anthony Wharton <th3ant@gmail.com> | ||
5 | |||
6 | This program is free software: you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License as published by | ||
8 | the Free Software Foundation, either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #pragma once | ||
21 | |||
22 | #define VENDOR_ID 0x20A0 | ||
23 | #define PRODUCT_ID 0x422D | ||
24 | // Edit usbconfig.h to change these. | ||
25 | #define MANUFACTURER ymdkey | ||
26 | #define PRODUCT ymd96 | ||
27 | |||
28 | /* Matrix Size */ | ||
29 | #define MATRIX_ROWS 8 | ||
30 | #define MATRIX_COLS 15 | ||
31 | #define DIODE_DIRECTION COL2ROW | ||
32 | |||
33 | /* Required for MX Locks installed */ | ||
34 | #define LOCKING_SUPPORT_ENABLE | ||
35 | #define LOCKING_RESYNC_ENABLE | ||
36 | |||
37 | #define PREVENT_STUCK_MODIFIERS | ||
38 | #define TAPPING_TOGGLE 3 | ||
39 | #define NO_UART 1 | ||
40 | |||
41 | #define BACKLIGHT_LEVELS 12 | ||
42 | |||
43 | /* RGB Underglow */ | ||
44 | // The RGB_DI_PING value seems to be shared between all PS2AVRGB boards. | ||
45 | // The same pin is used on the JJ40, at least. | ||
46 | #define RGBLED_NUM 18 | ||
47 | #define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are send | ||
48 | // via I2C to 0xB0 | ||
49 | |||
50 | #define RGBLIGHT_ANIMATIONS | ||
51 | |||
52 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1.0-2.7 | ||
53 | #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 1-255 | ||
54 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 | ||
55 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 | ||
56 | #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 | ||
57 | #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM | ||
58 | #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 | ||
59 | #define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 500 | ||
60 | |||
61 | /* key combination for command */ | ||
62 | #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) | ||
63 | |||
diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c new file mode 100644 index 000000000..2b3e2e2c7 --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | Base Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
3 | Modified 2017 Andrew Novak <ndrw.nvk@gmail.com> | ||
4 | Modified 2018 Anthony Wharton <th3ant@gmail.com> | ||
5 | |||
6 | This program is free software: you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License as published by | ||
8 | the Free Software Foundation, either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public LicensezZZ | ||
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #include QMK_KEYBOARD_H | ||
21 | |||
22 | #define _DEFLT 0 | ||
23 | #define _RAISE 1 | ||
24 | |||
25 | |||
26 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
27 | |||
28 | /* Layer 0, default layer */ | ||
29 | [_DEFLT] = LAYOUT_iso( | ||
30 | 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, \ | ||
31 | 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, \ | ||
32 | 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, \ | ||
33 | 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, \ | ||
34 | 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, \ | ||
35 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_RAISE), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ | ||
36 | ), | ||
37 | |||
38 | /* Layer 1, raise layer */ | ||
39 | [_RAISE] = LAYOUT_iso( | ||
40 | _______, 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, _______, _______, _______, \ | ||
41 | _______, 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, _______, _______, _______, _______, _______, \ | ||
42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, KC_MUTE, _______, KC_VOLU, _______, _______, \ | ||
43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, BL_TOGG, KC_MPRV, KC_MPLY, KC_MNXT, _______, \ | ||
44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, KC_VOLD, _______, KC_LOCK, \ | ||
45 | _______, _______, KC_RALT, _______, _______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______ \ | ||
46 | ) | ||
47 | }; | ||
diff --git a/keyboards/ymd96/matrix.c b/keyboards/ymd96/matrix.c index f2ecf4d33..2932976dd 100644 --- a/keyboards/ymd96/matrix.c +++ b/keyboards/ymd96/matrix.c | |||
@@ -50,20 +50,8 @@ void matrix_init(void) { | |||
50 | matrix[row] = 0x00; | 50 | matrix[row] = 0x00; |
51 | matrix_debouncing[row] = 0x00; | 51 | matrix_debouncing[row] = 0x00; |
52 | } | 52 | } |
53 | /*} | ||
54 | 53 | ||
55 | matrix_init_quantum(); // missing from original port by Luiz | 54 | matrix_init_quantum(); // missing from original port by Luiz |
56 | void matrix_set_row_status(uint8_t row) { | ||
57 | DDRB = (1 << row); | ||
58 | PORTB = ~(1 << row); | ||
59 | }*/ | ||
60 | |||
61 | |||
62 | /*uint8_t bit_reverse(uint8_t x) { | ||
63 | x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); | ||
64 | x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); | ||
65 | x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); | ||
66 | return x;*/ | ||
67 | } | 55 | } |
68 | 56 | ||
69 | uint8_t matrix_scan(void) { | 57 | uint8_t matrix_scan(void) { |
diff --git a/keyboards/ymd96/rules.mk b/keyboards/ymd96/rules.mk index 42b3d1155..1cc4060b0 100644 --- a/keyboards/ymd96/rules.mk +++ b/keyboards/ymd96/rules.mk | |||
@@ -35,7 +35,7 @@ BOOTMAGIC_ENABLE = no | |||
35 | MOUSEKEY_ENABLE = no | 35 | MOUSEKEY_ENABLE = no |
36 | EXTRAKEY_ENABLE = yes | 36 | EXTRAKEY_ENABLE = yes |
37 | CONSOLE_ENABLE = no | 37 | CONSOLE_ENABLE = no |
38 | COMMAND_ENABLE = yes | 38 | COMMAND_ENABLE = no |
39 | 39 | ||
40 | BACKLIGHT_ENABLE = yes | 40 | BACKLIGHT_ENABLE = yes |
41 | BACKLIGHT_CUSTOM_DRIVER = yes | 41 | BACKLIGHT_CUSTOM_DRIVER = yes |
diff --git a/keyboards/ymd96/usbconfig.h b/keyboards/ymd96/usbconfig.h index 50fe4ed11..a90a36f08 100644 --- a/keyboards/ymd96/usbconfig.h +++ b/keyboards/ymd96/usbconfig.h | |||
@@ -242,8 +242,8 @@ section at the end of this file). | |||
242 | #define USB_CFG_DEVICE_VERSION 0x00, 0x02 | 242 | #define USB_CFG_DEVICE_VERSION 0x00, 0x02 |
243 | /* Version number of the device: Minor number first, then major number. | 243 | /* Version number of the device: Minor number first, then major number. |
244 | */ | 244 | */ |
245 | #define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' | 245 | #define USB_CFG_VENDOR_NAME 'y','m','d','k','e','y' |
246 | #define USB_CFG_VENDOR_NAME_LEN 13 | 246 | #define USB_CFG_VENDOR_NAME_LEN 6 |
247 | /* These two values define the vendor name returned by the USB device. The name | 247 | /* These two values define the vendor name returned by the USB device. The name |
248 | * must be given as a list of characters under single quotes. The characters | 248 | * must be given as a list of characters under single quotes. The characters |
249 | * are interpreted as Unicode (UTF-16) entities. | 249 | * are interpreted as Unicode (UTF-16) entities. |
@@ -252,8 +252,8 @@ section at the end of this file). | |||
252 | * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for | 252 | * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for |
253 | * details. | 253 | * details. |
254 | */ | 254 | */ |
255 | #define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' | 255 | #define USB_CFG_DEVICE_NAME 'y','m','d','9','6' |
256 | #define USB_CFG_DEVICE_NAME_LEN 8 | 256 | #define USB_CFG_DEVICE_NAME_LEN 5 |
257 | /* Same as above for the device name. If you don't want a device name, undefine | 257 | /* Same as above for the device name. If you don't want a device name, undefine |
258 | * the macros. See the file USB-IDs-for-free.txt before you assign a name if | 258 | * the macros. See the file USB-IDs-for-free.txt before you assign a name if |
259 | * you use a shared VID/PID. | 259 | * you use a shared VID/PID. |
diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymd96/ymd96.h index ee0926eee..9c25f2219 100644 --- a/keyboards/ymd96/ymd96.h +++ b/keyboards/ymd96/ymd96.h | |||
@@ -76,5 +76,22 @@ K411, K410, K409, K408, K404, K405, K406, K407, K403, K402, K401, K400 \ | |||
76 | { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \ | 76 | { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \ |
77 | } | 77 | } |
78 | 78 | ||
79 | #define LAYOUT_iso( \ | ||
80 | K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ | ||
81 | K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ | ||
82 | K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ | ||
83 | K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ | ||
84 | K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ | ||
85 | K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ | ||
86 | ) { \ | ||
87 | { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ | ||
88 | { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ | ||
89 | { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ | ||
90 | { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ | ||
91 | { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ | ||
92 | { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ | ||
93 | { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ | ||
94 | { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ | ||
95 | } | ||
79 | 96 | ||
80 | #endif | 97 | #endif |