瀏覽代碼

Various fixes for new-keyboard (#16358)

Joel Challis 3 年之前
父節點
當前提交
b0621223bc
共有 4 個文件被更改,包括 31 次插入1 次删除
  1. 20 0
      data/templates/keyboard/config.h
  2. 1 0
      data/templates/keyboard/info.json
  3. 9 1
      lib/python/qmk/cli/new/keyboard.py
  4. 1 0
      lib/python/qmk/info.py

+ 20 - 0
data/templates/keyboard/config.h

@@ -0,0 +1,20 @@
+// Copyright %YEAR% %REAL_NAME% (@%USER_NAME%)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT

+ 1 - 0
data/templates/keyboard/info.json

@@ -1,6 +1,7 @@
 {
     "keyboard_name": "%KEYBOARD%",
     "maintainer": "%USER_NAME%",
+    "manufacturer": "%REAL_NAME%",
     "processor": "%MCU%",
     "bootloader": "%BOOTLOADER%",
     "diode_direction": "COL2ROW",

+ 9 - 1
lib/python/qmk/cli/new/keyboard.py

@@ -208,7 +208,15 @@ def new_keyboard(cli):
         cli.log.error(f'Keyboard {{fg_cyan}}{kb_name}{{fg_reset}} already exists! Please choose a different name.')
         return 1
 
-    tokens = {'YEAR': str(date.today().year), 'KEYBOARD': kb_name, 'USER_NAME': user_name, 'REAL_NAME': real_name, 'LAYOUT': default_layout, 'MCU': mcu, 'BOOTLOADER': bootloader}
+    tokens = {  # Comment here is to force multiline formatting
+        'YEAR': str(date.today().year),
+        'KEYBOARD': kb_name,
+        'USER_NAME': user_name,
+        'REAL_NAME': real_name,
+        'LAYOUT': default_layout,
+        'MCU': mcu,
+        'BOOTLOADER': bootloader
+    }
 
     if cli.config.general.verbose:
         cli.log.info("Creating keyboard with:")

+ 1 - 0
lib/python/qmk/info.py

@@ -49,6 +49,7 @@ def info_json(keyboard):
         'parse_errors': [],
         'parse_warnings': [],
         'maintainer': 'qmk',
+        'manufacturer': 'qmk',
     }
 
     # Populate the list of JSON keymaps