diff options
| author | Ryan <fauxpark@gmail.com> | 2021-01-08 06:39:38 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-07 11:39:38 -0800 |
| commit | 985b8cab7ca7103aee2b83696824683bd5159888 (patch) | |
| tree | 47c3d1b05948181af09abd75518b4b513ffeb963 | |
| parent | 581368596ed724bd96ca1792c143e12670c11572 (diff) | |
| download | qmk_firmware-985b8cab7ca7103aee2b83696824683bd5159888.tar.gz qmk_firmware-985b8cab7ca7103aee2b83696824683bd5159888.zip | |
[Keyboard] JM60 refactor (#11421)
| -rw-r--r-- | keyboards/jm60/config.h | 114 | ||||
| -rw-r--r-- | keyboards/jm60/info.json | 78 | ||||
| -rw-r--r-- | keyboards/jm60/jm60.c | 3 | ||||
| -rw-r--r-- | keyboards/jm60/jm60.h | 45 | ||||
| -rw-r--r-- | keyboards/jm60/keymaps/default/keymap.c | 71 | ||||
| -rw-r--r-- | keyboards/jm60/keymaps/poker3/keymap.c | 43 | ||||
| -rw-r--r-- | keyboards/jm60/led.c | 24 | ||||
| -rw-r--r-- | keyboards/jm60/matrix.c | 128 | ||||
| -rw-r--r-- | keyboards/jm60/readme.md | 24 | ||||
| -rw-r--r-- | keyboards/jm60/rules.mk | 29 |
10 files changed, 261 insertions, 298 deletions
diff --git a/keyboards/jm60/config.h b/keyboards/jm60/config.h index f490037f6..2409142e0 100644 --- a/keyboards/jm60/config.h +++ b/keyboards/jm60/config.h | |||
| @@ -15,39 +15,105 @@ You should have received a copy of the GNU General Public License | |||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #ifndef CONFIG_H | 18 | #pragma once |
| 19 | #define CONFIG_H | ||
| 20 | 19 | ||
| 21 | /* USB Device descriptor parameter */ | 20 | /* USB Device descriptor parameter */ |
| 22 | #define VENDOR_ID 0xFEED | 21 | #define VENDOR_ID 0xFEED |
| 23 | #define PRODUCT_ID 0x6464 | 22 | #define PRODUCT_ID 0x6464 |
| 24 | #define DEVICE_VER 0x0001 | 23 | #define DEVICE_VER 0x0001 |
| 25 | #define MANUFACTURER JMWS | 24 | #define MANUFACTURER JMWS |
| 26 | #define PRODUCT JM60 RGB Keyboard(QMK) | 25 | #define PRODUCT JM60 |
| 27 | #define DESCRIPTION QMK keyboard firmware for JM60 RGB Keyboard | ||
| 28 | 26 | ||
| 29 | /* key matrix size */ | 27 | /* key matrix size */ |
| 30 | #define MATRIX_ROWS 5 | 28 | #define MATRIX_ROWS 5 |
| 31 | #define MATRIX_COLS 14 | 29 | #define MATRIX_COLS 14 |
| 32 | 30 | ||
| 33 | /* number of backlight levels */ | 31 | /* |
| 34 | //#define BACKLIGHT_LEVELS 1 | 32 | * Keyboard Matrix Assignments |
| 35 | 33 | * | |
| 36 | //#define LED_BRIGHTNESS_LO 100 | 34 | * Change this to how you wired your keyboard |
| 37 | //#define LED_BRIGHTNESS_HI 255 | 35 | * COLS: AVR pins used for columns, left to right |
| 38 | 36 | * ROWS: AVR pins used for rows, top to bottom | |
| 39 | /* define if matrix has ghost */ | 37 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) |
| 38 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
| 39 | * | ||
| 40 | */ | ||
| 41 | #define MATRIX_ROW_PINS { B11, B10, B2, B1, B0 } | ||
| 42 | #define MATRIX_COL_PINS { A15, C10, C11, C12, D2, B3, B4, B5, B6, B7, B8, B9, A2, A3 } | ||
| 43 | #define UNUSED_PINS | ||
| 44 | |||
| 45 | /* COL2ROW, ROW2COL */ | ||
| 46 | #define DIODE_DIRECTION ROW2COL | ||
| 47 | |||
| 48 | //#define BACKLIGHT_PIN B7 | ||
| 49 | //#define BACKLIGHT_LEVELS 3 | ||
| 50 | //#define BACKLIGHT_BREATHING | ||
| 51 | |||
| 52 | //#define RGB_DI_PIN E2 | ||
| 53 | //#ifdef RGB_DI_PIN | ||
| 54 | //# define RGBLED_NUM 16 | ||
| 55 | //# define RGBLIGHT_HUE_STEP 8 | ||
| 56 | //# define RGBLIGHT_SAT_STEP 8 | ||
| 57 | //# define RGBLIGHT_VAL_STEP 8 | ||
| 58 | //# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ | ||
| 59 | //# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ | ||
| 60 | /*== all animations enable ==*/ | ||
| 61 | //# define RGBLIGHT_ANIMATIONS | ||
| 62 | /*== or choose animations ==*/ | ||
| 63 | //# define RGBLIGHT_EFFECT_BREATHING | ||
| 64 | //# define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
| 65 | //# define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
| 66 | //# define RGBLIGHT_EFFECT_SNAKE | ||
| 67 | //# define RGBLIGHT_EFFECT_KNIGHT | ||
| 68 | //# define RGBLIGHT_EFFECT_CHRISTMAS | ||
| 69 | //# define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
| 70 | //# define RGBLIGHT_EFFECT_RGB_TEST | ||
| 71 | //# define RGBLIGHT_EFFECT_ALTERNATING | ||
| 72 | /*== customize breathing effect ==*/ | ||
| 73 | /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ | ||
| 74 | //# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 | ||
| 75 | /*==== use exp() and sin() ====*/ | ||
| 76 | //# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 | ||
| 77 | //# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 | ||
| 78 | //#endif | ||
| 79 | |||
| 80 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 81 | #define DEBOUNCE 5 | ||
| 82 | |||
| 83 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
| 40 | //#define MATRIX_HAS_GHOST | 84 | //#define MATRIX_HAS_GHOST |
| 41 | 85 | ||
| 42 | /* Set 0 if debouncing isn't needed */ | ||
| 43 | #define DEBOUNCE 5 | ||
| 44 | |||
| 45 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | 86 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ |
| 46 | //#define LOCKING_SUPPORT_ENABLE | 87 | #define LOCKING_SUPPORT_ENABLE |
| 47 | |||
| 48 | /* Locking resynchronize hack */ | 88 | /* Locking resynchronize hack */ |
| 49 | #define LOCKING_RESYNC_ENABLE | 89 | #define LOCKING_RESYNC_ENABLE |
| 50 | 90 | ||
| 91 | /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. | ||
| 92 | * This is useful for the Windows task manager shortcut (ctrl+shift+esc). | ||
| 93 | */ | ||
| 94 | //#define GRAVE_ESC_CTRL_OVERRIDE | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Force NKRO | ||
| 98 | * | ||
| 99 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
| 100 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
| 101 | * makefile for this to work.) | ||
| 102 | * | ||
| 103 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
| 104 | * until the next keyboard reset. | ||
| 105 | * | ||
| 106 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
| 107 | * fully operational during normal computer usage. | ||
| 108 | * | ||
| 109 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
| 110 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
| 111 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
| 112 | * power-up. | ||
| 113 | * | ||
| 114 | */ | ||
| 115 | //#define FORCE_NKRO | ||
| 116 | |||
| 51 | /* | 117 | /* |
| 52 | * Feature disable options | 118 | * Feature disable options |
| 53 | * These options are also useful to firmware size reduction. | 119 | * These options are also useful to firmware size reduction. |
| @@ -63,7 +129,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 63 | //#define NO_ACTION_LAYER | 129 | //#define NO_ACTION_LAYER |
| 64 | //#define NO_ACTION_TAPPING | 130 | //#define NO_ACTION_TAPPING |
| 65 | //#define NO_ACTION_ONESHOT | 131 | //#define NO_ACTION_ONESHOT |
| 66 | //#define NO_ACTION_MACRO | ||
| 67 | //#define NO_ACTION_FUNCTION | ||
| 68 | 132 | ||
| 69 | #endif | 133 | /* disable these deprecated features by default */ |
| 134 | #define NO_ACTION_MACRO | ||
| 135 | #define NO_ACTION_FUNCTION | ||
| 136 | |||
| 137 | /* Bootmagic Lite key configuration */ | ||
| 138 | //#define BOOTMAGIC_LITE_ROW 0 | ||
| 139 | //#define BOOTMAGIC_LITE_COLUMN 0 | ||
diff --git a/keyboards/jm60/info.json b/keyboards/jm60/info.json new file mode 100644 index 000000000..2cc2ce4e3 --- /dev/null +++ b/keyboards/jm60/info.json | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "JM60", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "qmk", | ||
| 5 | "width": 15, | ||
| 6 | "height": 5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT_60_ansi": { | ||
| 9 | "layout": [ | ||
| 10 | {"x": 0, "y": 0}, | ||
| 11 | {"x": 1, "y": 0}, | ||
| 12 | {"x": 2, "y": 0}, | ||
| 13 | {"x": 3, "y": 0}, | ||
| 14 | {"x": 4, "y": 0}, | ||
| 15 | {"x": 5, "y": 0}, | ||
| 16 | {"x": 6, "y": 0}, | ||
| 17 | {"x": 7, "y": 0}, | ||
| 18 | {"x": 8, "y": 0}, | ||
| 19 | {"x": 9, "y": 0}, | ||
| 20 | {"x": 10, "y": 0}, | ||
| 21 | {"x": 11, "y": 0}, | ||
| 22 | {"x": 12, "y": 0}, | ||
| 23 | {"x": 13, "y": 0, "w": 2}, | ||
| 24 | |||
| 25 | {"x": 0, "y": 1, "w": 1.5}, | ||
| 26 | {"x": 1.5, "y": 1}, | ||
| 27 | {"x": 2.5, "y": 1}, | ||
| 28 | {"x": 3.5, "y": 1}, | ||
| 29 | {"x": 4.5, "y": 1}, | ||
| 30 | {"x": 5.5, "y": 1}, | ||
| 31 | {"x": 6.5, "y": 1}, | ||
| 32 | {"x": 7.5, "y": 1}, | ||
| 33 | {"x": 8.5, "y": 1}, | ||
| 34 | {"x": 9.5, "y": 1}, | ||
| 35 | {"x": 10.5, "y": 1}, | ||
| 36 | {"x": 11.5, "y": 1}, | ||
| 37 | {"x": 12.5, "y": 1}, | ||
| 38 | {"x": 13.5, "y": 1, "w": 1.5}, | ||
| 39 | |||
| 40 | {"x": 0, "y": 2, "w": 1.75}, | ||
| 41 | {"x": 1.75, "y": 2}, | ||
| 42 | {"x": 2.75, "y": 2}, | ||
| 43 | {"x": 3.75, "y": 2}, | ||
| 44 | {"x": 4.75, "y": 2}, | ||
| 45 | {"x": 5.75, "y": 2}, | ||
| 46 | {"x": 6.75, "y": 2}, | ||
| 47 | {"x": 7.75, "y": 2}, | ||
| 48 | {"x": 8.75, "y": 2}, | ||
| 49 | {"x": 9.75, "y": 2}, | ||
| 50 | {"x": 10.75, "y": 2}, | ||
| 51 | {"x": 11.75, "y": 2}, | ||
| 52 | {"x": 12.75, "y": 2, "w": 2.25}, | ||
| 53 | |||
| 54 | {"x": 0, "y": 3, "w": 2.25}, | ||
| 55 | {"x": 2.25, "y": 3}, | ||
| 56 | {"x": 3.25, "y": 3}, | ||
| 57 | {"x": 4.25, "y": 3}, | ||
| 58 | {"x": 5.25, "y": 3}, | ||
| 59 | {"x": 6.25, "y": 3}, | ||
| 60 | {"x": 7.25, "y": 3}, | ||
| 61 | {"x": 8.25, "y": 3}, | ||
| 62 | {"x": 9.25, "y": 3}, | ||
| 63 | {"x": 10.25, "y": 3}, | ||
| 64 | {"x": 11.25, "y": 3}, | ||
| 65 | {"x": 12.25, "y": 3, "w": 2.75}, | ||
| 66 | |||
| 67 | {"x": 0, "y": 4, "w": 1.25}, | ||
| 68 | {"x": 1.25, "y": 4, "w": 1.25}, | ||
| 69 | {"x": 2.5, "y": 4, "w": 1.25}, | ||
| 70 | {"x": 3.75, "y": 4, "w": 6.25}, | ||
| 71 | {"x": 10, "y": 4, "w": 1.25}, | ||
| 72 | {"x": 11.25, "y": 4, "w": 1.25}, | ||
| 73 | {"x": 12.5, "y": 4, "w": 1.25}, | ||
| 74 | {"x": 13.75, "y": 4, "w": 1.25} | ||
| 75 | ] | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
diff --git a/keyboards/jm60/jm60.c b/keyboards/jm60/jm60.c index 3c8b43db9..d8fe9cecc 100644 --- a/keyboards/jm60/jm60.c +++ b/keyboards/jm60/jm60.c | |||
| @@ -14,4 +14,5 @@ GNU General Public License for more details. | |||
| 14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | #include QMK_KEYBOARD_H | 17 | |
| 18 | #include "jm60.h" | ||
diff --git a/keyboards/jm60/jm60.h b/keyboards/jm60/jm60.h index f83b94f90..bea4451a0 100644 --- a/keyboards/jm60/jm60.h +++ b/keyboards/jm60/jm60.h | |||
| @@ -14,40 +14,23 @@ GNU General Public License for more details. | |||
| 14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | #ifndef JM60_H | 17 | |
| 18 | #define JM60_H | 18 | #pragma once |
| 19 | 19 | ||
| 20 | #include "quantum.h" | 20 | #include "quantum.h" |
| 21 | 21 | ||
| 22 | // readability | ||
| 23 | #define XXX KC_NO | 22 | #define XXX KC_NO |
| 24 | 23 | ||
| 25 | /* Satan GH60 ANSI layout | 24 | #define LAYOUT_60_ansi( \ |
| 26 | * ,-----------------------------------------------------------. | 25 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ |
| 27 | * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | | 26 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ |
| 28 | * |-----------------------------------------------------------| | 27 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2C, k2D, \ |
| 29 | * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | | 28 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3B, k3D, \ |
| 30 | * |-----------------------------------------------------------| | 29 | k40, k41, k42, k46, k4A, k4B, k4C, k4D \ |
| 31 | * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2c| 2d | | 30 | ) { \ |
| 32 | * |-----------------------------------------------------------| | 31 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D }, \ |
| 33 | * | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3b| 3d | | 32 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \ |
| 34 | * |-----------------------------------------------------------| | 33 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, XXX, k2C, k2D }, \ |
| 35 | * | 40 | 41 | 42 | 46 | 4a | 4b | 4c | 4d | | 34 | { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, XXX, k3B, XXX, k3D }, \ |
| 36 | * `-----------------------------------------------------------' | 35 | { k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4A, k4B, k4C, k4D } \ |
| 37 | */ | ||
| 38 | #define KEYMAP_ANSI( \ | ||
| 39 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ | ||
| 40 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ | ||
| 41 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2c, k2d, \ | ||
| 42 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3b, k3d, \ | ||
| 43 | k40, k41, k42, k46, k4a, k4b, k4c, k4d \ | ||
| 44 | ) \ | ||
| 45 | { \ | ||
| 46 | {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ | ||
| 47 | {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ | ||
| 48 | {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, XXX, k2c, k2d}, \ | ||
| 49 | {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, XXX, k3b, XXX, k3d}, \ | ||
| 50 | {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ | ||
| 51 | } | 36 | } |
| 52 | |||
| 53 | #endif | ||
diff --git a/keyboards/jm60/keymaps/default/keymap.c b/keyboards/jm60/keymaps/default/keymap.c index 6ca04c505..0940d7efc 100644 --- a/keyboards/jm60/keymaps/default/keymap.c +++ b/keyboards/jm60/keymaps/default/keymap.c | |||
| @@ -1,44 +1,39 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | 2 | ||
| 3 | 3 | enum layer_names { | |
| 4 | // Used for SHIFT_ESC | 4 | _BL, |
| 5 | #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | 5 | _FL |
| 6 | 6 | }; | |
| 7 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 8 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 9 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 10 | // entirely and just use numbers. | ||
| 11 | #define _BL 0 | ||
| 12 | #define _FL 1 | ||
| 13 | 7 | ||
| 14 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 8 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 15 | /* Keymap _BL: (Base Layer) Default Layer | 9 | /* Keymap _BL: (Base Layer) Default Layer |
| 16 | * ,-----------------------------------------------------------. | 10 | * ,-----------------------------------------------------------. |
| 17 | * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | | 11 | * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |
| 18 | * |-----------------------------------------------------------| | 12 | * |-----------------------------------------------------------| |
| 19 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 13 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |
| 20 | * |-----------------------------------------------------------| | 14 | * |-----------------------------------------------------------| |
| 21 | * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 15 | * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | |
| 22 | * |-----------------------------------------------------------| | 16 | * |-----------------------------------------------------------| |
| 23 | * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | 17 | * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |
| 24 | * |-----------------------------------------------------------| | 18 | * |-----------------------------------------------------------| |
| 25 | * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | | 19 | * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | |
| 26 | * `-----------------------------------------------------------' | 20 | * `-----------------------------------------------------------' |
| 27 | */ | 21 | */ |
| 28 | [_BL] = KEYMAP_ANSI( | 22 | [_BL] = LAYOUT_60_ansi( |
| 29 | 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, \ | 23 | 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, |
| 30 | 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, \ | 24 | 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, |
| 31 | 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, \ | 25 | 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, |
| 32 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ | 26 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, |
| 33 | KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), | 27 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL |
| 28 | ), | ||
| 34 | 29 | ||
| 35 | /* Keymap _FL: Function Layer | 30 | /* Keymap _FL: Function Layer |
| 36 | */ | 31 | */ |
| 37 | [_FL] = KEYMAP_ANSI( | 32 | [_FL] = LAYOUT_60_ansi( |
| 38 | KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \ | 33 | KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, |
| 39 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC, BL_INC,BL_TOGG, \ | 34 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, BL_TOGG, |
| 40 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ | 35 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 41 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ | 36 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 42 | _______,_______,_______, _______, _______,_______,_______,_______), | 37 | _______, _______, _______, _______, _______, _______, _______, _______ |
| 38 | ) | ||
| 43 | }; | 39 | }; |
| 44 | |||
diff --git a/keyboards/jm60/keymaps/poker3/keymap.c b/keyboards/jm60/keymaps/poker3/keymap.c index 07f432dcd..72e64bbcc 100644 --- a/keyboards/jm60/keymaps/poker3/keymap.c +++ b/keyboards/jm60/keymaps/poker3/keymap.c | |||
| @@ -1,31 +1,24 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | 2 | ||
| 3 | // Used for SHIFT_ESC | 3 | enum layer_names { |
| 4 | #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | 4 | _BL, |
| 5 | 5 | _FL | |
| 6 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 6 | }; |
| 7 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 8 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 9 | // entirely and just use numbers. | ||
| 10 | #define _BL 0 | ||
| 11 | #define _FL 1 | ||
| 12 | 7 | ||
| 13 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 8 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 14 | /* Keymap _BL: (Base Layer) Default Layer | 9 | [_BL] = LAYOUT_60_ansi( |
| 15 | */ | 10 | 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, |
| 16 | [_BL] = KEYMAP_ANSI( | 11 | 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, |
| 17 | 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, \ | 12 | MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, |
| 18 | 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, \ | 13 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, |
| 19 | MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ | 14 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL |
| 20 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ | 15 | ), |
| 21 | KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), | ||
| 22 | 16 | ||
| 23 | /* Keymap _FL: Function Layer | 17 | [_FL] = LAYOUT_60_ansi( |
| 24 | */ | 18 | 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, |
| 25 | [_FL] = KEYMAP_ANSI( | 19 | _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, |
| 26 | 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, \ | 20 | KC_CAPS, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_DEL, _______, |
| 27 | _______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR, KC_SLCK, KC_PAUS,_______, \ | 21 | _______, KC_APP, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, |
| 28 | KC_CAPS,_______,KC_VOLD,KC_VOLU,KC_MUTE,_______,KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_INS,KC_DEL,_______, \ | 22 | _______, _______, _______, _______, _______, _______, _______, _______ |
| 29 | _______,KC_APP,_______,_______,_______,_______,KC_END,_______,_______,_______,_______,_______, \ | 23 | ) |
| 30 | _______,_______,_______, _______, _______,_______,_______,_______), | ||
| 31 | }; | 24 | }; |
diff --git a/keyboards/jm60/led.c b/keyboards/jm60/led.c deleted file mode 100644 index 4ce0b3e26..000000000 --- a/keyboards/jm60/led.c +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include <hal.h> | ||
| 19 | |||
| 20 | #include "led.h" | ||
| 21 | |||
| 22 | |||
| 23 | void led_set(uint8_t usb_led) { | ||
| 24 | } | ||
diff --git a/keyboards/jm60/matrix.c b/keyboards/jm60/matrix.c deleted file mode 100644 index e19d4f02b..000000000 --- a/keyboards/jm60/matrix.c +++ /dev/null | |||
| @@ -1,128 +0,0 @@ | |||
| 1 | #include <stdint.h> | ||
| 2 | #include <stdbool.h> | ||
| 3 | #include <string.h> | ||
| 4 | #include <hal.h> | ||
| 5 | #include "timer.h" | ||
| 6 | #include "wait.h" | ||
| 7 | #include "print.h" | ||
| 8 | #include "matrix.h" | ||
| 9 | |||
| 10 | |||
| 11 | /* | ||
| 12 | * JM60 | ||
| 13 | * Column pins are input with internal pull-down. Row pins are output and strobe with high. | ||
| 14 | * Key is high or 1 when it turns on. | ||
| 15 | * | ||
| 16 | * col: { PTA15, PTC10, PTC11, PTC12, PTD2, PTB3, PTB4, PTB5, PTB6, PTB7, PTB8, PTB9, PTA2, PTA3 } | ||
| 17 | * row: { PTB11, PTB10, PTB2, PTB1, PTB0} | ||
| 18 | */ | ||
| 19 | /* matrix state(1:on, 0:off) */ | ||
| 20 | static matrix_row_t matrix[MATRIX_ROWS]; | ||
| 21 | static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | ||
| 22 | static bool debouncing = false; | ||
| 23 | static uint16_t debouncing_time = 0; | ||
| 24 | |||
| 25 | |||
| 26 | void matrix_init(void) | ||
| 27 | { | ||
| 28 | //debug_matrix = true; | ||
| 29 | /* Column(sense) */ | ||
| 30 | palSetPadMode(GPIOA, 15, PAL_MODE_INPUT_PULLDOWN); | ||
| 31 | palSetPadMode(GPIOC, 10, PAL_MODE_INPUT_PULLDOWN); | ||
| 32 | palSetPadMode(GPIOC, 11, PAL_MODE_INPUT_PULLDOWN); | ||
| 33 | palSetPadMode(GPIOC, 12, PAL_MODE_INPUT_PULLDOWN); | ||
| 34 | palSetPadMode(GPIOD, 2, PAL_MODE_INPUT_PULLDOWN); | ||
| 35 | palSetPadMode(GPIOB, 3, PAL_MODE_INPUT_PULLDOWN); | ||
| 36 | palSetPadMode(GPIOB, 4, PAL_MODE_INPUT_PULLDOWN); | ||
| 37 | palSetPadMode(GPIOB, 5, PAL_MODE_INPUT_PULLDOWN); | ||
| 38 | palSetPadMode(GPIOB, 6, PAL_MODE_INPUT_PULLDOWN); | ||
| 39 | palSetPadMode(GPIOB, 7, PAL_MODE_INPUT_PULLDOWN); | ||
| 40 | palSetPadMode(GPIOB, 8, PAL_MODE_INPUT_PULLDOWN); | ||
| 41 | palSetPadMode(GPIOB, 9, PAL_MODE_INPUT_PULLDOWN); | ||
| 42 | palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN); | ||
| 43 | palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_PULLDOWN); | ||
| 44 | |||
| 45 | /* Row(strobe) */ | ||
| 46 | palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); | ||
| 47 | palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); | ||
| 48 | palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); | ||
| 49 | palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); | ||
| 50 | palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); | ||
| 51 | |||
| 52 | memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); | ||
| 53 | memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); | ||
| 54 | } | ||
| 55 | |||
| 56 | uint8_t matrix_scan(void) | ||
| 57 | { | ||
| 58 | for (int row = 0; row < MATRIX_ROWS; row++) { | ||
| 59 | matrix_row_t data = 0; | ||
| 60 | |||
| 61 | // strobe row | ||
| 62 | switch (row) { | ||
| 63 | case 0: palSetPad(GPIOB, 11); break; | ||
| 64 | case 1: palSetPad(GPIOB, 10); break; | ||
| 65 | case 2: palSetPad(GPIOB, 2); break; | ||
| 66 | case 3: palSetPad(GPIOB, 1); break; | ||
| 67 | case 4: palSetPad(GPIOB, 0); break; | ||
| 68 | } | ||
| 69 | |||
| 70 | wait_us(20); // need wait to settle pin state | ||
| 71 | |||
| 72 | // read col data: { PTA15, PTC10, PTC11, PTC12, PTD2, PTB3, PTB4, PTB5, PTB6, PTB7, PTB8, PTB9, PTA2, PTA3 } | ||
| 73 | data = ((palReadPort(GPIOA) & 0x8000UL) >> 15) | // 0 | ||
| 74 | ((palReadPort(GPIOC) & 0x1C00UL) >> 9) | // 1, 2, 3 | ||
| 75 | ((palReadPort(GPIOD) & 0x0004UL) << 2) | // 4 | ||
| 76 | ((palReadPort(GPIOB) & 0x03F8UL) << 2) | // 5, 6, 7, 8, 9, 10, 11 | ||
| 77 | ((palReadPort(GPIOA) & 0x000CUL) << 10); // 12, 13 | ||
| 78 | |||
| 79 | // un-strobe row | ||
| 80 | switch (row) { | ||
| 81 | case 0: palClearPad(GPIOB, 11); break; | ||
| 82 | case 1: palClearPad(GPIOB, 10); break; | ||
| 83 | case 2: palClearPad(GPIOB, 2); break; | ||
| 84 | case 3: palClearPad(GPIOB, 1); break; | ||
| 85 | case 4: palClearPad(GPIOB, 0); break; | ||
| 86 | } | ||
| 87 | |||
| 88 | if (matrix_debouncing[row] != data) { | ||
| 89 | matrix_debouncing[row] = data; | ||
| 90 | debouncing = true; | ||
| 91 | debouncing_time = timer_read(); | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 95 | if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { | ||
| 96 | for (int row = 0; row < MATRIX_ROWS; row++) { | ||
| 97 | matrix[row] = matrix_debouncing[row]; | ||
| 98 | } | ||
| 99 | debouncing = false; | ||
| 100 | } | ||
| 101 | return 1; | ||
| 102 | } | ||
| 103 | |||
| 104 | bool matrix_is_on(uint8_t row, uint8_t col) | ||
| 105 | { | ||
| 106 | return (matrix[row] & (1<<col)); | ||
| 107 | } | ||
| 108 | |||
| 109 | matrix_row_t matrix_get_row(uint8_t row) | ||
| 110 | { | ||
| 111 | return matrix[row]; | ||
| 112 | } | ||
| 113 | |||
| 114 | void matrix_print(void) | ||
| 115 | { | ||
| 116 | xprintf("\nr/c 01234567\n"); | ||
| 117 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
| 118 | xprintf("%X0: ", row); | ||
| 119 | matrix_row_t data = matrix_get_row(row); | ||
| 120 | for (int col = 0; col < MATRIX_COLS; col++) { | ||
| 121 | if (data & (1<<col)) | ||
| 122 | xprintf("1"); | ||
| 123 | else | ||
| 124 | xprintf("0"); | ||
| 125 | } | ||
| 126 | xprintf("\n"); | ||
| 127 | } | ||
| 128 | } | ||
diff --git a/keyboards/jm60/readme.md b/keyboards/jm60/readme.md index 51473fc09..bb790d6d0 100644 --- a/keyboards/jm60/readme.md +++ b/keyboards/jm60/readme.md | |||
| @@ -1,27 +1,21 @@ | |||
| 1 | JM60 | 1 | # JM60 |
| 2 | ======== | ||
| 3 | 2 | ||
| 4 | A compact 60% keyboard with full RGB led support. | 3 | A compact 60% keyboard with full RGB led support. |
| 5 | 4 | ||
| 6 | Keyboard Maintainer: QMK Community | 5 | * Keyboard Maintainer: QMK Community |
| 7 | Hardware Supported: JM60 | 6 | * Hardware Supported: JM60 |
| 8 | Hardware Availability: https://kbdfans.myshopify.com/ (is no longer sold) | 7 | * Hardware Availability: https://kbdfans.myshopify.com/ (is no longer sold) |
| 9 | 8 | ||
| 10 | Make example for this keyboard (after setting up your build environment): | 9 | Make example for this keyboard (after setting up your build environment): |
| 11 | 10 | ||
| 12 | make jm60:default:bin | 11 | make jm60:default |
| 13 | 12 | ||
| 14 | 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. | 13 | 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). |
| 15 | 14 | ||
| 16 | ## Flashing Instructions | 15 | ## Flashing Instructions |
| 17 | 16 | ||
| 18 | 1) from the `qmk_firmware` directory run: | 17 | 1) rename 'jm60_default.bin' to 'jm60_default.firmware' |
| 19 | ``` | ||
| 20 | $ make jm60:default:bin | ||
| 21 | ``` | ||
| 22 | 18 | ||
| 23 | 2) rename 'jm60_default.bin' to 'jm60_default.firmware' | 19 | 2) Press 'R' and reconnect the keyboard. |
| 24 | 20 | ||
| 25 | 3) Press 'R' and reconnect the keyboard. | 21 | 3) Start the original Configuration Tool and flash 'jm60_default.bin' |
| 26 | |||
| 27 | 4) Start the original Configuration Tool and flash 'jm60_default.bin' | ||
diff --git a/keyboards/jm60/rules.mk b/keyboards/jm60/rules.mk index 2a2a080b7..5992cc055 100644 --- a/keyboards/jm60/rules.mk +++ b/keyboards/jm60/rules.mk | |||
| @@ -5,22 +5,23 @@ MCU_LDSCRIPT = jm60_bootloader | |||
| 5 | BOARD = JM60_BOARD | 5 | BOARD = JM60_BOARD |
| 6 | 6 | ||
| 7 | # Build Options | 7 | # Build Options |
| 8 | # comment out to disable the options. | 8 | # change yes to no to disable |
| 9 | # | 9 | # |
| 10 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration | 10 | BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration |
| 11 | MOUSEKEY_ENABLE = no # Mouse keys | 11 | MOUSEKEY_ENABLE = no # Mouse keys |
| 12 | EXTRAKEY_ENABLE = yes # Audio control and System control | 12 | EXTRAKEY_ENABLE = yes # Audio control and System control |
| 13 | CONSOLE_ENABLE = no # Console for debug | 13 | CONSOLE_ENABLE = no # Console for debug |
| 14 | COMMAND_ENABLE = no # Commands for debug and configuration | 14 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 15 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 16 | NKRO_ENABLE = yes # USB Nkey Rollover | 16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 17 | CUSTOM_MATRIX = yes # Custom matrix file | 17 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 18 | BACKLIGHT_ENABLE = no | 18 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 19 | VISUALIZER_ENABLE = no | 19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
| 20 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
| 21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
| 22 | AUDIO_ENABLE = no # Audio output | ||
| 20 | 23 | ||
| 21 | # Enter lower-power sleep mode when on the ChibiOS idle thread | 24 | # Enter lower-power sleep mode when on the ChibiOS idle thread |
| 22 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | 25 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE |
| 23 | 26 | ||
| 24 | # project specific files | 27 | LAYOUTS = 60_ansi |
| 25 | SRC = matrix.c \ | ||
| 26 | led.c | ||
