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

Map PRODUCT define to keyboard_name #14372

Merged
merged 3 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/mappings/info_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"RGBLIGHT_SLEEP": {"info_key": "rgblight.sleep", "value_type": "bool"},
"RGBLIGHT_SPLIT": {"info_key": "rgblight.split", "value_type": "bool"},
"RGBW": {"info_key": "rgblight.rgbw", "value_type": "bool"},
"PRODUCT": {"info_key": "keyboard_folder", "to_json": false},
"PRODUCT": {"info_key": "keyboard_name"},
"PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex"},
"VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex"},
"QMK_ESC_OUTPUT": {"info_key": "qmk_lufa_bootloader.esc_output"},
Expand Down
13 changes: 6 additions & 7 deletions keyboards/handwired/pytest/basic/info.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"maintainer": "qmk",
"layouts": {
"LAYOUT_custom": {
"layout": [
{ "label": "KC_Q", "matrix": [0, 0], "w": 1, "x": 0, "y": 0 }
]
"layouts": {
"LAYOUT_custom": {
"layout": [
{ "label": "KC_Q", "matrix": [0, 0], "w": 1, "x": 0, "y": 0 }
]
}
}
}
}
7 changes: 0 additions & 7 deletions keyboards/handwired/pytest/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6465
#define DEVICE_VER 0x0001
#define MANUFACTURER none
#define PRODUCT pytest

/* key matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 1
Expand Down
10 changes: 10 additions & 0 deletions keyboards/handwired/pytest/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"keyboard_name": "pytest",
"manufacturer": "none",
"maintainer": "qmk",
"usb": {
"vid": "0xFEED",
"pid": "0x6465",
"device_ver": "0x0001"
}
}
2 changes: 1 addition & 1 deletion lib/python/qmk/cli/generate/dfu_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def generate_dfu_header(cli):

keyboard_h_lines = ['/* This file was generated by `qmk generate-dfu-header`. Do not edit or copy.' ' */', '', '#pragma once']
keyboard_h_lines.append(f'#define MANUFACTURER {kb_info_json["manufacturer"]}')
keyboard_h_lines.append(f'#define PRODUCT {cli.config.generate_dfu_header.keyboard} Bootloader')
keyboard_h_lines.append(f'#define PRODUCT {kb_info_json["keyboard_name"]} Bootloader')

# Optional
if 'qmk_lufa_bootloader.esc_output' in kb_info_json:
Expand Down
2 changes: 1 addition & 1 deletion lib/python/qmk/tests/minimal_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"layouts": {
"LAYOUT": {
"layout": [
{ "label": "KC_A", "x": 0, "y": 0, "matrix": [0, 0] }
{ "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }
]
}
}
Expand Down
10 changes: 5 additions & 5 deletions lib/python/qmk/tests/test_cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_json2c_stdin():
def test_info():
result = check_subcommand('info', '-kb', 'handwired/pytest/basic')
check_returncode(result)
assert 'Keyboard Name: handwired/pytest/basic' in result.stdout
assert 'Keyboard Name: pytest' in result.stdout
assert 'Processor: atmega32u4' in result.stdout
assert 'Layout:' not in result.stdout
assert 'k0' not in result.stdout
Expand All @@ -160,7 +160,7 @@ def test_info():
def test_info_keyboard_render():
result = check_subcommand('info', '-kb', 'handwired/pytest/basic', '-l')
check_returncode(result)
assert 'Keyboard Name: handwired/pytest/basic' in result.stdout
assert 'Keyboard Name: pytest' in result.stdout
assert 'Processor: atmega32u4' in result.stdout
assert 'Layouts:' in result.stdout
assert 'k0' in result.stdout
Expand All @@ -169,7 +169,7 @@ def test_info_keyboard_render():
def test_info_keymap_render():
result = check_subcommand('info', '-kb', 'handwired/pytest/basic', '-km', 'default_json')
check_returncode(result)
assert 'Keyboard Name: handwired/pytest/basic' in result.stdout
assert 'Keyboard Name: pytest' in result.stdout
assert 'Processor: atmega32u4' in result.stdout

if is_windows:
Expand All @@ -181,7 +181,7 @@ def test_info_keymap_render():
def test_info_matrix_render():
result = check_subcommand('info', '-kb', 'handwired/pytest/basic', '-m')
check_returncode(result)
assert 'Keyboard Name: handwired/pytest/basic' in result.stdout
assert 'Keyboard Name: pytest' in result.stdout
assert 'Processor: atmega32u4' in result.stdout
assert 'LAYOUT_ortho_1x1' in result.stdout

Expand Down Expand Up @@ -242,7 +242,7 @@ def test_generate_config_h():
assert '# define DESCRIPTION handwired/pytest/basic' in result.stdout
assert '# define DIODE_DIRECTION COL2ROW' in result.stdout
assert '# define MANUFACTURER none' in result.stdout
assert '# define PRODUCT handwired/pytest/basic' in result.stdout
assert '# define PRODUCT pytest' in result.stdout
assert '# define PRODUCT_ID 0x6465' in result.stdout
assert '# define VENDOR_ID 0xFEED' in result.stdout
assert '# define MATRIX_COLS 1' in result.stdout
Expand Down