Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with data driven split keyboards #16457

Merged
merged 3 commits into from
Feb 27, 2022

Conversation

zvecr
Copy link
Member

@zvecr zvecr commented Feb 27, 2022

Description

Using the following qmk new-keyboard -t atmega32u4 -kb asdf -u zvecr -n asdf -l split_3x6_3 and info.json updated to:

{
    "manufacturer": "asdf",
    "keyboard_name": "asdf",
    "maintainer": "zvecr",
    "bootloader": "atmel-dfu",
    "diode_direction": "COL2ROW",
    "matrix_pins": {
        "cols": ["C2", "C2", "C2", "C2", "C2", "C2", "C2"],
        "rows": ["D1", "D1", "D1", "D1"]
    },
    "split":{
        "enabled": true,
        "soft_serial_pin": "D2",
        "matrix_pins": {
            "right": {
                "cols": ["C2", "C2", "C2", "C2", "C2", "C2", "C2"],
                "rows": ["D1", "D1", "D1", "D1"]
            }
        }
    },
    "processor": "atmega32u4",
    "usb": {
        "device_version": "1.0.0",
        "pid": "0x0000",
        "vid": "0xFEED"
    },
    "layouts": {
        "LAYOUT_split_3x6_3": {
            "layout": [
                { "matrix": [0, 0], "x": 0, "y": 0.25 },
                { "matrix": [0, 1], "x": 1, "y": 0.25 },
                { "matrix": [0, 2], "x": 2, "y": 0.125 },
                { "matrix": [0, 3], "x": 3, "y": 0 },
                { "matrix": [0, 4], "x": 4, "y": 0.125 },
                { "matrix": [0, 5], "x": 5, "y": 0.25 },
                { "matrix": [4, 0], "x": 8, "y": 0.25 },
                { "matrix": [4, 1], "x": 9, "y": 0.125 },
                { "matrix": [4, 2], "x": 10, "y": 0 },
                { "matrix": [4, 3], "x": 11, "y": 0.125 },
                { "matrix": [4, 4], "x": 12, "y": 0.25 },
                { "matrix": [4, 5], "x": 13, "y": 0.25 },
                { "matrix": [1, 0], "x": 0, "y": 1.25 },
                { "matrix": [1, 1], "x": 1, "y": 1.25 },
                { "matrix": [1, 2], "x": 2, "y": 1.125 },
                { "matrix": [1, 3], "x": 3, "y": 1 },
                { "matrix": [1, 4], "x": 4, "y": 1.125 },
                { "matrix": [1, 5], "x": 5, "y": 1.25 },
                { "matrix": [5, 0], "x": 8, "y": 1.25 },
                { "matrix": [5, 1], "x": 9, "y": 1.125 },
                { "matrix": [5, 2], "x": 10, "y": 1 },
                { "matrix": [5, 3], "x": 11, "y": 1.125 },
                { "matrix": [5, 4], "x": 12, "y": 1.25 },
                { "matrix": [5, 5], "x": 13, "y": 1.25 },
                { "matrix": [2, 0], "x": 0, "y": 2.25 },
                { "matrix": [2, 1], "x": 1, "y": 2.25 },
                { "matrix": [2, 2], "x": 2, "y": 2.125 },
                { "matrix": [2, 3], "x": 3, "y": 2 },
                { "matrix": [2, 4], "x": 4, "y": 2.125 },
                { "matrix": [2, 5], "x": 5, "y": 2.25 },
                { "matrix": [6, 0], "x": 8, "y": 2.25 },
                { "matrix": [6, 1], "x": 9, "y": 2.125 },
                { "matrix": [6, 2], "x": 10, "y": 2 },
                { "matrix": [6, 3], "x": 11, "y": 2.125 },
                { "matrix": [6, 4], "x": 12, "y": 2.25 },
                { "matrix": [6, 5], "x": 13, "y": 2.25 },
                { "matrix": [3, 3], "x": 3.5, "y": 3.25 },
                { "matrix": [3, 4], "x": 4.5, "y": 3.5 },
                { "matrix": [3, 5], "x": 5.5, "y": 3.75 },
                { "matrix": [7, 3], "x": 7.5, "y": 3.75 },
                { "matrix": [7, 4], "x": 8.5, "y": 3.5 },
                { "matrix": [7, 5], "x": 9.5, "y": 3.25 }
            ]
        }
    }
}

This PR contains fixes for:

  • rules.mk incorrectly generating SPLIT_KEYBOARD ?= on
  • Matrix data out of bounds for layout LAYOUT_split_3x6_3 at index 6 (k4A): 4, 0
  • config.h declaring matrix size incorrectly

This at least produces a working config that can be iterated on.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@zvecr zvecr added the bug label Feb 27, 2022
@zvecr zvecr requested a review from a team February 27, 2022 00:03
@github-actions github-actions bot added cli qmk cli command python labels Feb 27, 2022
@drashna drashna requested review from a team February 27, 2022 02:35
@Erovia Erovia merged commit 779c7de into qmk:master Feb 27, 2022
Comment on lines +63 to +65
if 'matrix_pins' in kb_info_json:
col_count = kb_info_json['matrix_size']['cols']
row_count = kb_info_json['matrix_size']['rows']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still remember why this code checks 'matrix_pins' in kb_info_json, and not 'matrix_size' in kb_info_json? With the matrix_pins check it is impossible to specify the matrix size in info.json if a custom matrix is used, and therefore matrix_pins is not defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli qmk cli command python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants