mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-07-07 09:24:42 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da481f5cc4 | |||
| 7a15cd2482 | |||
| 428b1cd568 |
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"manufacturer": "Harry Cutts",
|
||||
"keyboard_name": "TwentyPad",
|
||||
"maintainer": "HarryCutts",
|
||||
"bootloader": "atmel-dfu",
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true
|
||||
},
|
||||
"matrix_pins": {
|
||||
"direct": [
|
||||
["B7", "D5", "B5", "F6"],
|
||||
["B3", "D3", "B4", "F7"],
|
||||
["B2", "D2", "D7", "C7"],
|
||||
["B1", "D1", "D6", "C6"],
|
||||
["B0", "D0", "D4", "B6"]
|
||||
]
|
||||
},
|
||||
"processor": "atmega32u4",
|
||||
"url": "https://github.com/HarryCutts/twentypad/",
|
||||
"usb": {
|
||||
"device_version": "1.0.0",
|
||||
"pid": "0x209D",
|
||||
"vid": "0xFEED"
|
||||
},
|
||||
"community_layouts": ["ortho_5x4"],
|
||||
"layouts": {
|
||||
"LAYOUT_ortho_5x4": {
|
||||
"layout": [
|
||||
{"label": "B7", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "D5", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "B5", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "F6", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
{"label": "B3", "matrix": [1, 0], "x": 0, "y": 1},
|
||||
{"label": "D3", "matrix": [1, 1], "x": 1, "y": 1},
|
||||
{"label": "B4", "matrix": [1, 2], "x": 2, "y": 1},
|
||||
{"label": "F7", "matrix": [1, 3], "x": 3, "y": 1},
|
||||
{"label": "B2", "matrix": [2, 0], "x": 0, "y": 2},
|
||||
{"label": "D2", "matrix": [2, 1], "x": 1, "y": 2},
|
||||
{"label": "D7", "matrix": [2, 2], "x": 2, "y": 2},
|
||||
{"label": "C7", "matrix": [2, 3], "x": 3, "y": 2},
|
||||
{"label": "B1", "matrix": [3, 0], "x": 0, "y": 3},
|
||||
{"label": "D1", "matrix": [3, 1], "x": 1, "y": 3},
|
||||
{"label": "D6", "matrix": [3, 2], "x": 2, "y": 3},
|
||||
{"label": "C6", "matrix": [3, 3], "x": 3, "y": 3},
|
||||
{"label": "B0", "matrix": [4, 0], "x": 0, "y": 4},
|
||||
{"label": "D0", "matrix": [4, 1], "x": 1, "y": 4},
|
||||
{"label": "D4", "matrix": [4, 2], "x": 2, "y": 4},
|
||||
{"label": "B6", "matrix": [4, 3], "x": 3, "y": 4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"keyboard": "handwired/twentypad",
|
||||
"keymap": "default",
|
||||
"layout": "LAYOUT_ortho_5x4",
|
||||
"layers": [
|
||||
[
|
||||
"KC_CALCULATOR", "KC_KP_SLASH", "KC_KP_ASTERISK", "KC_KP_MINUS",
|
||||
"KC_KP_7", "KC_KP_8", "KC_KP_9", "KC_KP_PLUS",
|
||||
"KC_KP_4", "KC_KP_5", "KC_KP_6", "KC_LEFT_PAREN",
|
||||
"KC_KP_1", "KC_KP_2", "KC_KP_3", "KC_RIGHT_PAREN",
|
||||
"KC_KP_0", "KC_KP_DOT", "KC_KP_EQUAL", "KC_KP_ENTER"
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# TwentyPad
|
||||
|
||||

|
||||
|
||||
A simple twenty-key macro pad, built to learn PCB design.
|
||||
|
||||
* Keyboard Maintainer: [Harry Cutts](https://github.com/HarryCutts)
|
||||
* Hardware Supported: ATMEGA32U4 on a [custom PCB](https://github.com/HarryCutts/twentypad/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
qmk compile -kb handwired/twentypad -km default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
qmk flash -kb handwired/twentypad -km default
|
||||
|
||||
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).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Enter the bootloader in 3 ways:
|
||||
|
||||
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (the top left key) and plug in the keyboard
|
||||
* **Physical reset button**: Press the button marked `SWR1` in the top-left of the PCB
|
||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
||||
@@ -316,7 +316,7 @@ def _render_eeconfig_implementation(modules):
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-e', '--escape', arg_only=True, action='store_true', help="Escape spaces in quiet mode")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rules.mk for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rules.mk for.')
|
||||
@cli.argument('filename', nargs='?', arg_only=True, type=qmk.path.FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON to be compiled and flashed or a pre-compiled binary firmware file (bin/hex) to be flashed.')
|
||||
@cli.subcommand('Creates a community_modules_rules_mk from a keymap.json file.')
|
||||
def generate_community_modules_rules_mk(cli):
|
||||
@@ -340,7 +340,7 @@ def generate_community_modules_rules_mk(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_post_config.h for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_post_config.h for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_post_config.h from a keymap.json file.')
|
||||
def generate_community_post_config_h(cli):
|
||||
@@ -387,7 +387,7 @@ def generate_community_post_config_h(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.h for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.h for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules.h from a keymap.json file.')
|
||||
def generate_community_modules_h(cli):
|
||||
@@ -443,7 +443,7 @@ def generate_community_modules_h(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules.c from a keymap.json file.')
|
||||
def generate_community_modules_c(cli):
|
||||
@@ -495,7 +495,7 @@ def _generate_include_per_module(cli, include_file_name):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules_introspection.h for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules_introspection.h for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules_introspection.h from a keymap.json file.')
|
||||
def generate_community_modules_introspection_h(cli):
|
||||
@@ -506,7 +506,7 @@ def generate_community_modules_introspection_h(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules_introspection.c from a keymap.json file.')
|
||||
def generate_community_modules_introspection_c(cli):
|
||||
@@ -517,7 +517,7 @@ def generate_community_modules_introspection_c(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate led_matrix_community_modules.inc for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate led_matrix_community_modules.inc for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates an led_matrix_community_modules.inc from a keymap.json file.')
|
||||
def generate_led_matrix_community_modules_inc(cli):
|
||||
@@ -528,7 +528,7 @@ def generate_led_matrix_community_modules_inc(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rgb_matrix_community_modules.inc for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rgb_matrix_community_modules.inc for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates an rgb_matrix_community_modules.inc from a keymap.json file.')
|
||||
def generate_rgb_matrix_community_modules_inc(cli):
|
||||
@@ -539,7 +539,7 @@ def generate_rgb_matrix_community_modules_inc(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate split_transaction_id_community_modules.inc for.')
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate split_transaction_id_community_modules.inc for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates an split_transaction_id_community_modules.inc from a keymap.json file.')
|
||||
def generate_split_transaction_id_community_modules_inc(cli):
|
||||
|
||||
@@ -5,22 +5,32 @@ from milc import cli
|
||||
|
||||
from qmk.decorators import automagic_keyboard
|
||||
from qmk.info import info_json
|
||||
from qmk.path import normpath
|
||||
from qmk.keyboard import keyboard_completer, keyboard_folder
|
||||
from qmk.path import is_keyboard, normpath
|
||||
from qmk.keyboard import keyboard_completer
|
||||
from qmk.commands import dump_lines
|
||||
from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE
|
||||
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate LUFA Keyboard.h for.')
|
||||
@cli.argument('-kb', '--keyboard', completer=keyboard_completer, help='Keyboard to generate LUFA Keyboard.h for.')
|
||||
@cli.subcommand('Used by the make system to generate LUFA Keyboard.h from info.json', hidden=True)
|
||||
@automagic_keyboard
|
||||
def generate_dfu_header(cli):
|
||||
"""Generates the Keyboard.h file.
|
||||
"""
|
||||
# Determine our keyboard(s)
|
||||
if not cli.config.generate_dfu_header.keyboard:
|
||||
cli.log.error('Missing parameter: --keyboard')
|
||||
cli.subcommands['info'].print_help()
|
||||
return False
|
||||
|
||||
if not is_keyboard(cli.config.generate_dfu_header.keyboard):
|
||||
cli.log.error('Invalid keyboard: "%s"', cli.config.generate_dfu_header.keyboard)
|
||||
return False
|
||||
|
||||
# Build the Keyboard.h file.
|
||||
kb_info_json = dotty(info_json(cli.args.keyboard))
|
||||
kb_info_json = dotty(info_json(cli.config.generate_dfu_header.keyboard))
|
||||
|
||||
keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once']
|
||||
keyboard_h_lines.append(f'#define MANUFACTURER "{kb_info_json["manufacturer"]}"')
|
||||
|
||||
@@ -14,7 +14,7 @@ from qmk.info import info_json
|
||||
from qmk.json_encoders import InfoJSONEncoder
|
||||
from qmk.json_schema import compile_schema_store
|
||||
from qmk.keyboard import keyboard_completer, keyboard_folder
|
||||
from qmk.path import normpath
|
||||
from qmk.path import is_keyboard, normpath
|
||||
|
||||
|
||||
def pruning_validator(validator_class):
|
||||
@@ -45,7 +45,7 @@ def strip_info_json(kb_info_json):
|
||||
return validator(kb_info_json)
|
||||
|
||||
|
||||
@cli.argument('-kb', '--keyboard', required=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to show info for.')
|
||||
@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='Keyboard to show info for.')
|
||||
@cli.argument('-km', '--keymap', help='Show the layers for a JSON keymap too.')
|
||||
@cli.argument('-o', '--output', arg_only=True, completer=FilesCompleter, help='Write the output the specified file, overwriting if necessary.')
|
||||
@cli.argument('-ow', '--overwrite', arg_only=True, action='store_true', help='Overwrite the existing info.json. (Overrides the location of --output)')
|
||||
@@ -55,8 +55,18 @@ def strip_info_json(kb_info_json):
|
||||
def generate_info_json(cli):
|
||||
"""Generate an info.json file for a keyboard
|
||||
"""
|
||||
# Determine our keyboard(s)
|
||||
if not cli.config.generate_info_json.keyboard:
|
||||
cli.log.error('Missing parameter: --keyboard')
|
||||
cli.subcommands['info'].print_help()
|
||||
return False
|
||||
|
||||
if not is_keyboard(cli.config.generate_info_json.keyboard):
|
||||
cli.log.error('Invalid keyboard: "%s"', cli.config.generate_info_json.keyboard)
|
||||
return False
|
||||
|
||||
if cli.args.overwrite:
|
||||
output_path = (Path('keyboards') / cli.args.keyboard / 'info.json').resolve()
|
||||
output_path = (Path('keyboards') / cli.config.generate_info_json.keyboard / 'info.json').resolve()
|
||||
|
||||
if cli.args.output:
|
||||
cli.log.warning('Overwriting user supplied --output with %s', output_path)
|
||||
@@ -64,7 +74,7 @@ def generate_info_json(cli):
|
||||
cli.args.output = output_path
|
||||
|
||||
# Build the info.json file
|
||||
kb_info_json = info_json(cli.args.keyboard)
|
||||
kb_info_json = info_json(cli.config.generate_info_json.keyboard)
|
||||
strip_info_json(kb_info_json)
|
||||
info_json_text = json.dumps(kb_info_json, indent=4, cls=InfoJSONEncoder, sort_keys=True)
|
||||
|
||||
|
||||
@@ -200,10 +200,10 @@ void led_matrix_handle_key_event(uint8_t row, uint8_t col, bool pressed) {
|
||||
}
|
||||
|
||||
if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) {
|
||||
memcpy(&last_hit_buffer.x[0], &last_hit_buffer.x[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memcpy(&last_hit_buffer.y[0], &last_hit_buffer.y[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memcpy(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit
|
||||
memcpy(&last_hit_buffer.index[0], &last_hit_buffer.index[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memmove(&last_hit_buffer.x[0], &last_hit_buffer.x[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memmove(&last_hit_buffer.y[0], &last_hit_buffer.y[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memmove(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit
|
||||
memmove(&last_hit_buffer.index[0], &last_hit_buffer.index[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
last_hit_buffer.count = LED_HITS_TO_REMEMBER - led_count;
|
||||
}
|
||||
|
||||
|
||||
@@ -213,10 +213,10 @@ void rgb_matrix_handle_key_event(uint8_t row, uint8_t col, bool pressed) {
|
||||
}
|
||||
|
||||
if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) {
|
||||
memcpy(&last_hit_buffer.x[0], &last_hit_buffer.x[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memcpy(&last_hit_buffer.y[0], &last_hit_buffer.y[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memcpy(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit
|
||||
memcpy(&last_hit_buffer.index[0], &last_hit_buffer.index[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memmove(&last_hit_buffer.x[0], &last_hit_buffer.x[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memmove(&last_hit_buffer.y[0], &last_hit_buffer.y[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
memmove(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit
|
||||
memmove(&last_hit_buffer.index[0], &last_hit_buffer.index[led_count], LED_HITS_TO_REMEMBER - led_count);
|
||||
last_hit_buffer.count = LED_HITS_TO_REMEMBER - led_count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user