[Keyboard] Refactor jj4x4 to enable ortho_4x4 LAYOUT (#5112)

* Correct configurator info.json

* Refactor to support ortho_4x4

* Refactor to support ortho_4x4 - remove commented out code
This commit is contained in:
zvecr 2019-02-13 01:04:47 +00:00 committed by Drashna Jaelre
parent b2ee290c9f
commit 6fcc6538c7
5 changed files with 29 additions and 35 deletions

View file

@ -15,10 +15,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once
#include "config_common.h" #include "config_common.h"
#ifndef CONFIG_H
#define CONFIG_H
#define VENDOR_ID 0x20A0 #define VENDOR_ID 0x20A0
#define PRODUCT_ID 0x422D #define PRODUCT_ID 0x422D
@ -49,5 +49,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLED_NUM 5 #define RGBLED_NUM 5
#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. #define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0.
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#endif

View file

@ -1,23 +1,30 @@
{ {
"keyboard_name": "jj40", "keyboard_name": "jj4x4",
"url": "", "url": "",
"maintainer": "qmk", "maintainer": "qmk",
"width": 12, "width": 4,
"height": 4, "height": 4,
"layouts": { "layouts": {
"LAYOUT_planck_mit": { "LAYOUT_ortho_4x4": {
"key_count": 47, "key_count": 16,
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3, "w":2}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] "layout": [
}, {"x":0, "y":0},
{"x":1, "y":0},
"LAYOUT_ortho_4x12": { {"x":2, "y":0},
"key_count": 48, {"x":3, "y":0},
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] {"x":0, "y":1},
}, {"x":1, "y":1},
{"x":2, "y":1},
"LAYOUT_planck_1x2uR": { {"x":3, "y":1},
"key_count": 47, {"x":0, "y":2},
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3, "w":2}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] {"x":1, "y":2},
{"x":2, "y":2},
{"x":3, "y":2},
{"x":0, "y":3},
{"x":1, "y":3},
{"x":2, "y":3},
{"x":3, "y":3}
]
} }
} }
} }

View file

@ -15,20 +15,13 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef KEYMAP_COMMON_H #pragma once
#define KEYMAP_COMMON_H
#include "quantum.h" #include "quantum.h"
#include "quantum_keycodes.h"
#include "keycode.h"
#include "action.h"
void matrix_init_user(void); // TODO port this to other PS2AVRGB boards void matrix_init_user(void); // TODO port this to other PS2AVRGB boards
#define XXX KC_NO
#define LAYOUT( \ #define LAYOUT_ortho_4x4( \
K01, K02, K03, K04, \ K01, K02, K03, K04, \
K11, K12, K13, K14, \ K11, K12, K13, K14, \
K21, K22, K23, K24, \ K21, K22, K23, K24, \
@ -40,7 +33,3 @@ void matrix_init_user(void); // TODO port this to other PS2AVRGB boards
{ K21, K22, K23, K24 }, \ { K21, K22, K23, K24 }, \
{ K31, K32, K33, K34 } \ { K31, K32, K33, K34 } \
} }
#endif

View file

@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | M | N | O | P | * | M | N | O | P |
* ----------------------------' * ----------------------------'
*/ */
[_QWERTY] = LAYOUT( \ [_QWERTY] = LAYOUT_ortho_4x4( \
KC_A, KC_B, KC_C, KC_D, \ KC_A, KC_B, KC_C, KC_D, \
KC_E, KC_F, KC_G, KC_H, \ KC_E, KC_F, KC_G, KC_H, \
KC_I, KC_J, KC_K, KC_L, \ KC_I, KC_J, KC_K, KC_L, \

View file

@ -55,4 +55,4 @@ SRC = i2c.c backlight.c
# programming options # programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
LAYOUTS = ortho_4x4