From 5ddbabfa2a8ee7ce75dcbc30397eb5d588f9e51d Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 21 Sep 2021 22:51:54 -0700 Subject: [PATCH] [Keyboard] Fix jkb65 compile issues (#14554) --- keyboards/jadookb/jkb65/config.h | 48 +++++------ keyboards/jadookb/jkb65/info.json | 10 +-- keyboards/jadookb/jkb65/jkb65.c | 80 ++++--------------- .../jadookb/jkb65/keymaps/default/keymap.c | 39 +++++---- keyboards/jadookb/jkb65/keymaps/via/keymap.c | 39 +++++---- 5 files changed, 79 insertions(+), 137 deletions(-) diff --git a/keyboards/jadookb/jkb65/config.h b/keyboards/jadookb/jkb65/config.h index 7ad707252e..8af9b04fc8 100644 --- a/keyboards/jadookb/jkb65/config.h +++ b/keyboards/jadookb/jkb65/config.h @@ -1,24 +1,24 @@ - /* Copyright 2021 Wizad-GG - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ + /* Copyright 2021 Wizad-GG + * + * 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" -#define VENDOR_ID 0x4A4B +#define VENDOR_ID 0x4A4B #define PRODUCT_ID 0xEF6A #define DEVICE_VER 0x0001 #define MANUFACTURER JadooKB @@ -37,18 +37,11 @@ #define RGB_DI_PIN F0 #define DRIVER_LED_TOTAL 67 -#ifdef RGB_DI_PIN - #define RGBLED_NUM 67 - #define RGB_DISABLE_WHEN_USB_SUSPENDED - #define RGB_MATRIX_FRAMEBUFFER_EFFECTS - #define RGB_MATRIX_KEYPRESSES - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_SLEEP - #define RGB_DISABLE_TIMEOUT 0 - #define RGB_DISABLE_AFTER_TIMEOUT 0 - #define RGBLIGHT_TIMEOUT 60000 -#endif +#define RGB_DISABLE_WHEN_USB_SUSPENDED +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_MATRIX_KEYPRESSES +#define RGB_DISABLE_TIMEOUT 60000 #define DEBOUNCE 5 @@ -57,4 +50,3 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION - diff --git a/keyboards/jadookb/jkb65/info.json b/keyboards/jadookb/jkb65/info.json index 6d1953834f..8bb0ab7524 100644 --- a/keyboards/jadookb/jkb65/info.json +++ b/keyboards/jadookb/jkb65/info.json @@ -1,10 +1,10 @@ { - "keyboard_name": "jkb65", - "url": "https://jadookb.com/", - "maintainer": "Wizard-GG", + "keyboard_name": "jkb65", + "url": "https://jadookb.com/", + "maintainer": "Wizard-GG", "layouts": { - "LAYOUT": { + "LAYOUT_67_ansi": { "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":"Backspace", "x":13, "y":0, "w":2}, {"label":"~", "x":15, "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":"Delete", "x":15, "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":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"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":"\u2191", "x":14, "y":3}, {"label":"PgDn", "x":15, "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":"Fn", "x":10, "y":4, "w":1.25}, {"label":"Menu", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] } } -} \ No newline at end of file +} diff --git a/keyboards/jadookb/jkb65/jkb65.c b/keyboards/jadookb/jkb65/jkb65.c index 1f22b30a79..aabdce7d20 100644 --- a/keyboards/jadookb/jkb65/jkb65.c +++ b/keyboards/jadookb/jkb65/jkb65.c @@ -1,17 +1,17 @@ - /* Copyright 2021 Wizard-GG - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + /* Copyright 2021 Wizard-GG + * + * 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 "jkb65.h" @@ -32,7 +32,7 @@ led_config_t g_led_config = { { { 6, 32}, { 26, 32}, { 41, 32}, { 56, 32}, { 71, 32}, { 86, 32}, {101, 32}, {116, 32}, {131, 32}, {146, 32}, {161, 32}, {176, 32}, {201, 32}, {225, 32}, // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up { 9, 48}, { 34, 48}, { 49, 48}, { 64, 48}, { 79, 48}, { 94, 48}, {109, 48}, {124, 48}, {139, 48}, {154, 48}, {169, 48}, {189, 48}, {208, 48}, {225, 48}, // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down { 2, 64}, { 21, 64}, { 39, 64}, { 94, 64}, {148, 64}, {163, 64}, {193, 64}, {208, 64}, {225, 64}, // Ctrl, GUI, Alt, Space, RAlt, FN, Ctrl, Left, Down, Right - + }, { // LED Index to Flag 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Delete @@ -40,57 +40,9 @@ led_config_t g_led_config = { { 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down 1, 1, 1, 4, 1, 1, 1, 1, 1, // Ctrl, GUI, Alt, Space, Alt, FN, Left, Down, Right - + } }; -static uint16_t key_timer; -static void refresh_rgb(void); -static void check_rgb_timeout(void); -bool is_rgb_timeout = false; - - -void refresh_rgb() { - key_timer = timer_read(); - if (is_rgb_timeout) { - - is_rgb_timeout = false; - rgblight_wakeup(); - } -} - -void check_rgb_timeout() { - if (!is_rgb_timeout && timer_elapsed(key_timer) > RGBLIGHT_TIMEOUT) { - rgblight_suspend(); - is_rgb_timeout = true; - } -} - - - -void housekeeping_task_kb(void) { - #ifdef RGBLIGHT_TIMEOUT - check_rgb_timeout(); - #endif - -} - -void post_process_record_kb(uint16_t keycode, keyrecord_t *record) { -#ifdef RGBLIGHT_TIMEOUT - if (record->event.pressed) { refresh_rgb(); } -#endif - post_process_record_user(keycode, record); -} - -bool encoder_update_kb(uint8_t index, bool clockwise) { -#ifdef RGBLIGHT_TIMEOUT - refresh_rgb(); -#endif - - return encoder_update_user(index, clockwise); -} - - - __attribute__ ((weak)) void rgb_matrix_indicators_user(void) { diff --git a/keyboards/jadookb/jkb65/keymaps/default/keymap.c b/keyboards/jadookb/jkb65/keymaps/default/keymap.c index e866ef597f..9a01fb6165 100644 --- a/keyboards/jadookb/jkb65/keymaps/default/keymap.c +++ b/keyboards/jadookb/jkb65/keymaps/default/keymap.c @@ -1,47 +1,47 @@ /* Copyright 2021 Wizard-GG - * - * 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 . - */ + * + * 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( + + [0] = LAYOUT_67_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_TILD, 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, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [1] = LAYOUT( + [1] = LAYOUT_67_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_PSCR, _______, RGB_RMOD, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, MAGIC_UNNO_GUI,MAGIC_NO_GUI, _______, RGB_TOG, _______, MO(2), RGB_SPD, RGB_VAD, RGB_SPI ), - [2] = LAYOUT( + [2] = LAYOUT_67_ansi( RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [3] = LAYOUT( + [3] = LAYOUT_67_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -49,4 +49,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; - diff --git a/keyboards/jadookb/jkb65/keymaps/via/keymap.c b/keyboards/jadookb/jkb65/keymaps/via/keymap.c index e866ef597f..9a01fb6165 100644 --- a/keyboards/jadookb/jkb65/keymaps/via/keymap.c +++ b/keyboards/jadookb/jkb65/keymaps/via/keymap.c @@ -1,47 +1,47 @@ /* Copyright 2021 Wizard-GG - * - * 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 . - */ + * + * 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( + + [0] = LAYOUT_67_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_TILD, 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, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [1] = LAYOUT( + [1] = LAYOUT_67_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_PSCR, _______, RGB_RMOD, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, MAGIC_UNNO_GUI,MAGIC_NO_GUI, _______, RGB_TOG, _______, MO(2), RGB_SPD, RGB_VAD, RGB_SPI ), - [2] = LAYOUT( + [2] = LAYOUT_67_ansi( RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [3] = LAYOUT( + [3] = LAYOUT_67_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -49,4 +49,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; -