feat(match): 同步比赛计时与装甲板扣血许可
构建客户端 / 检查(类型 + 单元测试) (push) Canceled after 0s
构建客户端 / Linux x64(deb + AppImage) (push) Canceled after 0s
构建客户端 / Windows x64(NSIS 安装包) (push) Canceled after 0s
构建客户端 / macOS 通用(.app + .dmg) (push) Canceled after 0s

- feat(client): 增加裁判比赛计时、技术暂停与选手端局域网同步
- feat(armor): 红蓝共用通用固件,按客户端选队并显示网络连接状态
- feat(armor): 仅在对局进行中允许扣血,其他阶段保留受击闪烁
- feat(client): 将计时置于血条中间并增加开赛前五秒全屏动画
- fix(client): 修复连续血条、对手镜像和图传断连灰度遮罩
- fix(client): 统一界面中文字体并整理各页面文案
- fix(maintenance): 备份迁移装甲板分区,恢复 SDK 构建与固件打包
- refactor(repo): 按 armor、vt 和 client 整理工程与脚本,移除旧参考实现
- test: 补充线路、受击许可、回环 UDP、维护和 HUD 验证
- docs: 同步构建、协议、比赛控制和硬件验证边界

验证:前端构建与 19 项相关测试通过;核心 91 项单元测试与 2 项回环 UDP 集成测试通过;装甲板规则 25 项、线路 26 项、Tauri 51 项测试通过;独立探测器 5 项与目录回归 4 项通过。完成 C3 两组阈值实际编译、导出与 ZIP 校验,检查 900×600 / 1280×720 页面、倒计时和随包中文字体。
未执行烧录、板上运行、跨电脑广播或硬件稳定性验证。
This commit is contained in:
sloray committed 2026-10-22 17:08:49 +08:00
1 parent 72901939c6
commit f7ca246b68
581 files changed
+6596 -7683

No files matched your search

@@ -0,0 +1,137 @@
/*
* GC0308 register definitions.
* Based on GC0308 datasheet specifications
*/
#ifndef __GC0308_REG_REGS_H__
#define __GC0308_REG_REGS_H__
// System Control Registers
#define RESET_RELATED 0xfe // Bit[7]: Software reset
// Bit[6:5]: NA
// Bit[4]: CISCTL_restart_n
// Bit[3:1]: NA
// Bit[0]: page select
// 0:page0
// 1:page1
// Page 0 Registers
// Exposure Control (Manual, when AEC disabled)
#define EXPOSURE_HIGH 0x03 // Exposure time high byte (bits 11:4)
#define EXPOSURE_LOW 0x04 // Exposure time low byte (bits 3:0 in upper nibble)
// Total exposure = (EXPOSURE_HIGH << 4) | (EXPOSURE_LOW >> 4)
// Range: 0-4095 (12-bit value)
// Windowing Registers
#define ROW_START_H 0x05 // Row start address high byte
#define ROW_START_L 0x06 // Row start address low byte
#define COL_START_H 0x07 // Column start address high byte
#define COL_START_L 0x08 // Column start address low byte
#define WIN_HEIGHT_H 0x09 // Window height high byte
#define WIN_HEIGHT_L 0x0a // Window height low byte
#define WIN_WIDTH_H 0x0b // Window width high byte
#define WIN_WIDTH_L 0x0c // Window width low byte
// Sensor Control
#define CISCTL_MODE1 0x14 // Bit[1]: V_flip, Bit[0]: H_mirror
// AAAA_EN - Auto Algorithm Enable (AEC/AGC/AWB/ABB)
#define AAAA_EN 0x22 // Auto control enable register
// Per Linux kernel driver:
// Bit[0]: AEC enable (1=on, 0=off)
// Bit[1]: AWB enable (1=on, 0=off)
// Bit[2]: AGC enable (1=on, 0=off)
// Note: This was previously incorrectly named AEC_MODE1
// Special Effects and Output Control
#define SPECIAL_EFFECT 0x23 // Special effect control
// Bit[1:0]: Effect mode
// 00: Normal
// 01: Negative
// 10: Grayscale/Color tint mode
// Output Format
#define OUTPUT_FMT 0x24 // Output format control
// Bit[3:0]: Output format selection
// 0010: YCbYCr (YUV422)
// 0110: RGB565
// others: see datasheet
// Analog Circuit Control
#define PCLK_DIV 0x28 // PCLK divider control (frequency division)
// Output Control
#define OUT_CTRL 0x2e // Output control
// Bit[0]: Color bar enable
// Global Gain
#define GLOBAL_GAIN 0x50 // Global gain control (hardware: 0-63, 6-bit)
// API uses 0-30 range, mapped to hardware values
// Manual White Balance Gain (when AWB disabled)
// Per Linux kernel driver: registers 0x05a-0x05c control AWB RGB gains
#define AWB_R_GAIN 0x5a // Red channel gain for manual WB
#define AWB_G_GAIN 0x5b // Green channel gain for manual WB
#define AWB_B_GAIN 0x5c // Blue channel gain for manual WB
// Edge Enhancement (INTPEE - Interpolation and Edge-Enhancement)
// Per Linux kernel driver: registers 0x77-0x79 control edge enhancement
#define EDGE12_EFFECT 0x77 // Edge enhancement effect control
#define EDGE_POS_RATIO 0x78 // Edge position ratio
#define EDGE1_MINMAX 0x79 // Edge1 min/max control
// Saturation Control (Page 0)
// According to datasheet, saturation is controlled via 0xb1 and 0xb2
#define SATURATION_Cb 0xb1 // Cb saturation gain (default: 0x40)
#define SATURATION_Cr 0xb2 // Cr saturation gain (default: 0x40)
// Contrast
#define CONTRAST 0xb3 // Contrast control (default: 0x40)
// AEC Registers - Automatic Exposure Control (Page 0)
// Per Linux kernel driver: AEC control registers are at 0xd0-0xd3
#define AEC_MODE1 0xd0 // AEC mode control register 1
#define AEC_MODE2 0xd1 // AEC mode control register 2
#define AEC_MODE3 0xd2 // AEC mode control register 3
#define AEC_TARGET_Y 0xd3 // AEC target Y value / Expected luminance (default: 0x48)
// This controls both brightness and AE level
// Subsample Window (Page 0 for coordinate reference)
#define SUB_COL_N 0xf7 // Subsample column start (units of 4 pixels)
#define SUB_ROW_N 0xf8 // Subsample row start (units of 4 pixels)
#define SUB_COL_N1 0xf9 // Subsample column end (units of 4 pixels)
#define SUB_ROW_N1 0xfa // Subsample row end (units of 4 pixels)
// Page 1 Registers (access after setting 0xfe = 0x01)
// Subsample Control (Page 1)
#define SUBSAMPLE_EN 0x53 // Bit[7]: Subsample enable
#define SUBSAMPLE_MODE 0x54 // Subsample mode control
#define SUBSAMPLE_EN2 0x55 // Bit[0]: Subsample enable 2
#define SUBSAMPLE_Y0 0x56 // Y subsample config 0
#define SUBSAMPLE_Y1 0x57 // Y subsample config 1
#define SUBSAMPLE_UV0 0x58 // UV subsample config 0
#define SUBSAMPLE_UV1 0x59 // UV subsample config 1
/**
* @brief Register bit masks
*/
// AAAA_EN (0x22) bit masks - Auto Algorithm Enable
#define AEC_ENABLE 0x01 // Bit 0: AEC enable
#define AWB_ENABLE 0x02 // Bit 1: AWB enable
#define AGC_ENABLE 0x04 // Bit 2: AGC enable
// CISCTL_MODE1 (0x14) bit masks
#define HMIRROR_MASK 0x01 // Bit 0: Horizontal mirror
#define VFLIP_MASK 0x02 // Bit 1: Vertical flip
// SPECIAL_EFFECT (0x23) bit masks
#define EFFECT_NORMAL 0x00 // Normal mode
#define EFFECT_NEGATIVE 0x01 // Negative/inverse
#define EFFECT_GRAYSCALE 0x02 // B&W or color tint mode
// OUT_CTRL (0x2e) bit masks
#define COLORBAR_ENABLE 0x01 // Bit 0: Color bar test pattern
#endif // __GC0308_REG_REGS_H__