Skip to content

Commit 18f2bc3

Browse files
authored
Merge pull request #27 from MeowKJ/dev
Dev
2 parents 4d0e4fc + af83cb3 commit 18f2bc3

5 files changed

Lines changed: 22 additions & 17 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'Firmware/**'
9-
- 'Software/**'
8+
- 'firmware/**'
9+
- 'tools/**'
1010
- '.github/workflows/code-quality.yml'
1111
push:
1212
branches:
1313
- main
1414
paths:
15-
- 'Firmware/**'
16-
- 'Software/**'
15+
- 'firmware/**'
16+
- 'tools/**'
1717
schedule:
1818
# 每天凌晨 2 点运行一次完整扫描
1919
- cron: '0 2 * * *'
@@ -71,22 +71,22 @@ jobs:
7171
with:
7272
node-version: '20'
7373
cache: 'pnpm'
74-
cache-dependency-path: Software/binary-keyboard-studio-ui/pnpm-lock.yaml
74+
cache-dependency-path: tools/studio/pnpm-lock.yaml
7575

7676
- name: Install dependencies
77-
working-directory: Software/binary-keyboard-studio-ui
77+
working-directory: tools/studio
7878
run: pnpm install
7979

8080
- name: Run ESLint
81-
working-directory: Software/binary-keyboard-studio-ui
81+
working-directory: tools/studio
8282
run: pnpm run lint || echo "ESLint check completed with warnings"
8383

8484
- name: Run TypeScript type check
85-
working-directory: Software/binary-keyboard-studio-ui
85+
working-directory: tools/studio
8686
run: pnpm run type-check
8787

8888
- name: Build check
89-
working-directory: Software/binary-keyboard-studio-ui
89+
working-directory: tools/studio
9090
run: pnpm run build-only
9191

9292
# C/C++ 代码质量检查
@@ -103,15 +103,15 @@ jobs:
103103
sudo apt-get update
104104
sudo apt-get install -y cppcheck
105105
106-
- name: Run cppcheck on Firmware
106+
- name: Run cppcheck on firmware
107107
continue-on-error: true
108108
run: |
109109
cppcheck --enable=all --suppress=missingIncludeSystem \
110110
--xml --xml-version=2 \
111-
Firmware/CH592F/ 2> cppcheck-result.xml || true
111+
firmware/CH592F/ 2> cppcheck-result.xml || true
112112
cppcheck --enable=all --suppress=missingIncludeSystem \
113113
--xml --xml-version=2 \
114-
Firmware/CH552G/ 2> cppcheck-result2.xml || true
114+
firmware/CH552G/ 2> cppcheck-result2.xml || true
115115
116116
- name: Upload cppcheck results
117117
uses: actions/upload-artifact@v4
@@ -142,7 +142,7 @@ jobs:
142142
- name: Check code duplication (JavaScript/TypeScript)
143143
continue-on-error: true
144144
run: |
145-
jscpd Software/ --min-lines 5 --min-tokens 50 --format markdown > duplication-report.md || true
145+
jscpd tools/studio/ --min-lines 5 --min-tokens 50 --format markdown > duplication-report.md || true
146146
147147
- name: Upload complexity report
148148
uses: actions/upload-artifact@v4

firmware/CH592F/MeowBLE/profile/src/devinfoservice.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/********************************** (C) COPYRIGHT *******************************
1+
/********************************** (C) COPYRIGHT *******************************
22
* File Name : devinfoservice.c
33
* Author : WCH
44
* Version : V1.0
@@ -15,6 +15,7 @@
1515
*/
1616
#include "ble_config.h"
1717
#include "devinfoservice.h"
18+
#include "kbd_types.h"
1819

1920
/*********************************************************************
2021
* MACROS
@@ -132,7 +133,7 @@ static uint8_t devInfoPnpId[DEVINFO_PNP_ID_LEN] = {
132133
1, // Vendor ID source (1=Bluetooth SIG)
133134
LO_UINT16(0x07D7), HI_UINT16(0x07D7), // Vendor ID (WCH)
134135
LO_UINT16(0x0000), HI_UINT16(0x0000), // Product ID (vendor-specific)
135-
LO_UINT16(0x0110), HI_UINT16(0x0110) // Product version (JJ.M.N)
136+
LO_UINT16(KBD_VERSION_BCD16), HI_UINT16(KBD_VERSION_BCD16) // Product version (与 kbd_types.h 同步)
136137
};
137138

138139
/*********************************************************************

firmware/CH592F/MeowKeyboard/include/kbd_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ extern "C" {
5252
*/
5353
#define KBD_VENDOR_ID 0x413D /**< USB Vendor ID */
5454
#define KBD_PRODUCT_ID 0x2107 /**< USB Product ID */
55-
#define KBD_VERSION_MAJOR 2 /**< 固件主版本 */
55+
#define KBD_VERSION_MAJOR 3 /**< 固件主版本 */
5656
#define KBD_VERSION_MINOR 0 /**< 固件次版本 */
5757
#define KBD_VERSION_PATCH 0 /**< 固件补丁版本 */
58+
/** 主.次 版本 BCD 16 位,供 USB bcdDevice、BLE PnP 等使用,改主/次版本后自动同步 */
59+
#define KBD_VERSION_BCD16 ((KBD_VERSION_MAJOR << 8) | KBD_VERSION_MINOR)
5860

5961
/** @} */ /* end of KBD_Constants */
6062

firmware/CH592F/MeowKeyboard/src/kbd_log.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "kbd_log.h"
1717
#include "kbd_storage.h"
18+
#include "kbd_mode.h"
1819
#include <string.h>
1920

2021
/*============================================================================*/

firmware/CH592F/MeowUSB/src/usb_descriptors.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*******************************************************************************/
88

99
#include "usb_descriptors.h"
10+
#include "kbd_types.h"
1011

1112
/* USB 设备描述符 */
1213
const uint8_t USB_DeviceDescriptor[] = {
@@ -19,7 +20,7 @@ const uint8_t USB_DeviceDescriptor[] = {
1920
DevEP0SIZE, // bMaxPacketSize0
2021
(USB_VID & 0xFF), (USB_VID >> 8), // idVendor
2122
(USB_PID & 0xFF), (USB_PID >> 8), // idProduct
22-
0x00, 0x01, // bcdDevice (1.00)
23+
(KBD_VERSION_BCD16 & 0xFF), (KBD_VERSION_BCD16 >> 8), // bcdDevice (与 kbd_types.h 同步)
2324
0x01, // iManufacturer
2425
0x02, // iProduct
2526
0x00, // iSerialNumber

0 commit comments

Comments
 (0)