aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>2021-11-04 22:14:43 +0100
committerGitHub <noreply@github.com>2021-11-05 08:14:43 +1100
commitfefd7fdc5145b677da7b0e1d75bab11eac9db605 (patch)
treee624f8f4ca57006f4ba9451b927b571663e1c180 /data
parent6437045166cafab14f2fbe5fcae44f6b066adbc5 (diff)
downloadqmk_firmware-fefd7fdc5145b677da7b0e1d75bab11eac9db605.tar.gz
qmk_firmware-fefd7fdc5145b677da7b0e1d75bab11eac9db605.zip
Refactor new-keyboard to be python3.7 compatible (#14707)
* Use copy_tree from distutils for python 3.7 support * Bump python version in docs * Changed new-keyboard to use printf-style format strings * Use username for manunfacturer / maintainer * Update lib/python/qmk/cli/new/keyboard.py Co-authored-by: Zach White <skullydazed@drpepper.org> Co-authored-by: Zach White <skullydazed@drpepper.org>
Diffstat (limited to 'data')
-rw-r--r--data/templates/avr/config.h22
-rw-r--r--data/templates/avr/readme.md10
-rw-r--r--data/templates/base/%(KEYBOARD)s.c4
-rw-r--r--data/templates/base/%(KEYBOARD)s.h22
-rw-r--r--data/templates/base/info.json4
-rw-r--r--data/templates/base/keyboard.c17
-rw-r--r--data/templates/base/keyboard.h35
-rw-r--r--data/templates/base/keymaps/default/keymap.c48
-rw-r--r--data/templates/base/keymaps/default/readme.md2
-rw-r--r--data/templates/ps2avrgb/config.h22
-rw-r--r--data/templates/ps2avrgb/readme.md10
11 files changed, 51 insertions, 145 deletions
diff --git a/data/templates/avr/config.h b/data/templates/avr/config.h
index 4192bbcfa..7c15e8e70 100644
--- a/data/templates/avr/config.h
+++ b/data/templates/avr/config.h
@@ -1,19 +1,5 @@
1/* 1// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s)
2Copyright %YEAR% %YOUR_NAME% 2// SPDX-License-Identifier: GPL-2.0-or-later
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17 3
18#pragma once 4#pragma once
19 5
@@ -23,8 +9,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23#define VENDOR_ID 0xFEED 9#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0000 10#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001 11#define DEVICE_VER 0x0001
26#define MANUFACTURER %YOUR_NAME% 12#define MANUFACTURER %(USER_NAME)s
27#define PRODUCT %KEYBOARD% 13#define PRODUCT %(KEYBOARD)s
28 14
29/* key matrix size */ 15/* key matrix size */
30#define MATRIX_ROWS 2 16#define MATRIX_ROWS 2
diff --git a/data/templates/avr/readme.md b/data/templates/avr/readme.md
index b099ed726..207850e06 100644
--- a/data/templates/avr/readme.md
+++ b/data/templates/avr/readme.md
@@ -1,20 +1,20 @@
1# %KEYBOARD% 1# %(KEYBOARD)s
2 2
3![%KEYBOARD%](imgur.com image replace me!) 3![%(KEYBOARD)s](imgur.com image replace me!)
4 4
5*A short description of the keyboard/project* 5*A short description of the keyboard/project*
6 6
7* Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) 7* Keyboard Maintainer: [%(YOUR_NAME)s](https://github.com/%(USER_NAME)s)
8* Hardware Supported: *The PCBs, controllers supported* 8* Hardware Supported: *The PCBs, controllers supported*
9* Hardware Availability: *Links to where you can find this hardware* 9* Hardware Availability: *Links to where you can find this hardware*
10 10
11Make example for this keyboard (after setting up your build environment): 11Make example for this keyboard (after setting up your build environment):
12 12
13 make %KEYBOARD%:default 13 make %(KEYBOARD)s:default
14 14
15Flashing example for this keyboard: 15Flashing example for this keyboard:
16 16
17 make %KEYBOARD%:default:flash 17 make %(KEYBOARD)s:default:flash
18 18
19See 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). 19See 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).
20 20
diff --git a/data/templates/base/%(KEYBOARD)s.c b/data/templates/base/%(KEYBOARD)s.c
new file mode 100644
index 000000000..0c509aff6
--- /dev/null
+++ b/data/templates/base/%(KEYBOARD)s.c
@@ -0,0 +1,4 @@
1// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "%(KEYBOARD)s.h"
diff --git a/data/templates/base/%(KEYBOARD)s.h b/data/templates/base/%(KEYBOARD)s.h
new file mode 100644
index 000000000..3e8ca3912
--- /dev/null
+++ b/data/templates/base/%(KEYBOARD)s.h
@@ -0,0 +1,22 @@
1// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "quantum.h"
7
8/* This is a shortcut to help you visually see your layout.
9 *
10 * The first section contains all of the arguments representing the physical
11 * layout of the board and position of the keys.
12 *
13 * The second converts the arguments into a two-dimensional array which
14 * represents the switch matrix.
15 */
16#define LAYOUT( \
17 k00, k01, k02, \
18 k10, k12 \
19) { \
20 { k00, k01, k02 }, \
21 { k10, KC_NO, k12 } \
22}
diff --git a/data/templates/base/info.json b/data/templates/base/info.json
index 3993d8546..a50ccba7b 100644
--- a/data/templates/base/info.json
+++ b/data/templates/base/info.json
@@ -1,7 +1,7 @@
1{ 1{
2 "keyboard_name": "%KEYBOARD%", 2 "keyboard_name": "%(KEYBOARD)s",
3 "url": "", 3 "url": "",
4 "maintainer": "%YOUR_NAME%", 4 "maintainer": "%(USER_NAME)s",
5 "layouts": { 5 "layouts": {
6 "LAYOUT": { 6 "LAYOUT": {
7 "layout": [ 7 "layout": [
diff --git a/data/templates/base/keyboard.c b/data/templates/base/keyboard.c
deleted file mode 100644
index f69ae16ed..000000000
--- a/data/templates/base/keyboard.c
+++ /dev/null
@@ -1,17 +0,0 @@
1/* Copyright %YEAR% %YOUR_NAME%
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "%KEYBOARD%.h"
diff --git a/data/templates/base/keyboard.h b/data/templates/base/keyboard.h
deleted file mode 100644
index bd2e88d12..000000000
--- a/data/templates/base/keyboard.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/* Copyright %YEAR% %YOUR_NAME%
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include "quantum.h"
20
21/* This is a shortcut to help you visually see your layout.
22 *
23 * The first section contains all of the arguments representing the physical
24 * layout of the board and position of the keys.
25 *
26 * The second converts the arguments into a two-dimensional array which
27 * represents the switch matrix.
28 */
29#define LAYOUT( \
30 k00, k01, k02, \
31 k10, k12 \
32) { \
33 { k00, k01, k02 }, \
34 { k10, KC_NO, k12 } \
35}
diff --git a/data/templates/base/keymaps/default/keymap.c b/data/templates/base/keymaps/default/keymap.c
index d8020ab3e..3fec3d512 100644
--- a/data/templates/base/keymaps/default/keymap.c
+++ b/data/templates/base/keymaps/default/keymap.c
@@ -1,18 +1,6 @@
1/* Copyright %YEAR% %YOUR_NAME% 1// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s)
2 * 2// SPDX-License-Identifier: GPL-2.0-or-later
3 * This program is free software: you can redistribute it and/or modify 3
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H 4#include QMK_KEYBOARD_H
17 5
18// Defines names for use in layer keycodes and the keymap 6// Defines names for use in layer keycodes and the keymap
@@ -21,12 +9,6 @@ enum layer_names {
21 _FN 9 _FN
22}; 10};
23 11
24// Defines the keycodes used by our macros in process_record_user
25enum custom_keycodes {
26 QMKBEST = SAFE_RANGE,
27 QMKURL
28};
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 12const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 /* Base */ 13 /* Base */
32 [_BASE] = LAYOUT( 14 [_BASE] = LAYOUT(
@@ -34,29 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34 KC_TAB, KC_SPC 16 KC_TAB, KC_SPC
35 ), 17 ),
36 [_FN] = LAYOUT( 18 [_FN] = LAYOUT(
37 QMKBEST, QMKURL, _______, 19 _______, _______, _______,
38 RESET, XXXXXXX 20 RESET, XXXXXXX
39 ) 21 )
40}; 22};
41
42bool process_record_user(uint16_t keycode, keyrecord_t *record) {
43 switch (keycode) {
44 case QMKBEST:
45 if (record->event.pressed) {
46 // when keycode QMKBEST is pressed
47 SEND_STRING("QMK is the best thing ever!");
48 } else {
49 // when keycode QMKBEST is released
50 }
51 break;
52 case QMKURL:
53 if (record->event.pressed) {
54 // when keycode QMKURL is pressed
55 SEND_STRING("https://qmk.fm/\n");
56 } else {
57 // when keycode QMKURL is released
58 }
59 break;
60 }
61 return true;
62}
diff --git a/data/templates/base/keymaps/default/readme.md b/data/templates/base/keymaps/default/readme.md
index e052ed80f..63a064327 100644
--- a/data/templates/base/keymaps/default/readme.md
+++ b/data/templates/base/keymaps/default/readme.md
@@ -1 +1 @@
# The default keymap for %KEYBOARD% # The default keymap for %(KEYBOARD)s
diff --git a/data/templates/ps2avrgb/config.h b/data/templates/ps2avrgb/config.h
index 6150bcce6..876a60252 100644
--- a/data/templates/ps2avrgb/config.h
+++ b/data/templates/ps2avrgb/config.h
@@ -1,19 +1,5 @@
1/* 1// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s)
2Copyright %YEAR% %YOUR_NAME% 2// SPDX-License-Identifier: GPL-2.0-or-later
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17 3
18#pragma once 4#pragma once
19 5
@@ -23,8 +9,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23#define VENDOR_ID 0xFEED 9#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0000 10#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001 11#define DEVICE_VER 0x0001
26#define MANUFACTURER %YOUR_NAME% 12#define MANUFACTURER %(USER_NAME)s
27#define PRODUCT %KEYBOARD% 13#define PRODUCT %(KEYBOARD)s
28 14
29/* key matrix size */ 15/* key matrix size */
30#define MATRIX_ROWS 8 16#define MATRIX_ROWS 8
diff --git a/data/templates/ps2avrgb/readme.md b/data/templates/ps2avrgb/readme.md
index 94063f9eb..a2ac4495b 100644
--- a/data/templates/ps2avrgb/readme.md
+++ b/data/templates/ps2avrgb/readme.md
@@ -1,20 +1,20 @@
1# %KEYBOARD% 1# %(KEYBOARD)s
2 2
3![%KEYBOARD%](imgur.com image replace me!) 3![%(KEYBOARD)s](imgur.com image replace me!)
4 4
5*A short description of the keyboard/project* 5*A short description of the keyboard/project*
6 6
7* Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) 7* Keyboard Maintainer: [%(YOUR_NAME)s](https://github.com/yourusername)
8* Hardware Supported: *The PCBs, controllers supported* 8* Hardware Supported: *The PCBs, controllers supported*
9* Hardware Availability: *Links to where you can find this hardware* 9* Hardware Availability: *Links to where you can find this hardware*
10 10
11Make example for this keyboard (after setting up your build environment): 11Make example for this keyboard (after setting up your build environment):
12 12
13 make %KEYBOARD%:default 13 make %(KEYBOARD)s:default
14 14
15Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) 15Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid))
16 16
17 make %KEYBOARD%:default:flash 17 make %(KEYBOARD)s:default:flash
18 18
19See 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). 19See 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).
20 20