- 固件:新增 link_control / stream_control,覆盖运行中 Wi-Fi 断线恢复、取帧节拍、 温控与质量/帧率减载;UDP 发送增加有界重试预算与帧期限,PSRAM JPEG 直发减少拷贝。 - 协议:重组器严格校验分片布局,统计未收齐、超时与完全缺失的帧,处理帧号回绕与设备重启。 - 桌面端:视频改 latest-value 通道并前置帧时间标记,拒绝积压和慢解码的过期画面;新增 延迟标记页与 --latency-report 校准,完善录制、服务端与退出流程。 - 文档与脚本:新增硬件、开发、延迟、功耗、实时性、稳定性文档和改动记录,重写根 README; 新增构建、性能、延迟与串口长测脚本,以及长测客户端脚本。 - 构建:固定 esp-1.97.0.0 工具链,分区表随构建复制,更新 sdkconfig 与忽略规则。
57 lines
2.2 KiB
PowerShell
57 lines
2.2 KiB
PowerShell
# Build the ESP32-S3 firmware from PowerShell without executing .env as code.
|
|
[CmdletBinding()]
|
|
param(
|
|
[string]$EnvFile = '.env',
|
|
[Parameter(ValueFromRemainingArguments = $true)]
|
|
[string[]]$CargoArgs = @()
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
Set-StrictMode -Version Latest
|
|
Push-Location (Split-Path -Parent $PSScriptRoot)
|
|
$buildEnvironment = @{}
|
|
foreach ($name in @('CARGO_WORKSPACE_DIR', 'ESP_IDF_GLOB_BASE', 'ESP_IDF_GLOB_PARTITIONS')) {
|
|
$buildEnvironment[$name] = [Environment]::GetEnvironmentVariable($name, 'Process')
|
|
}
|
|
try {
|
|
if (Test-Path -LiteralPath $EnvFile) {
|
|
$lineNumber = 0
|
|
foreach ($line in Get-Content -LiteralPath $EnvFile -Encoding UTF8) {
|
|
$lineNumber++
|
|
if ($line -match '^\s*(#|$)') { continue }
|
|
if ($line -notmatch '^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=(.*)$') {
|
|
throw "Invalid assignment in ${EnvFile}:${lineNumber}"
|
|
}
|
|
$key = $Matches[1]
|
|
$value = $Matches[2].Trim()
|
|
if ($value.StartsWith("'") -or $value.StartsWith('"')) {
|
|
$quote = $value.Substring(0, 1)
|
|
if ($value.Length -lt 2 -or -not $value.EndsWith($quote)) {
|
|
throw "Unclosed quote in ${EnvFile}:${lineNumber}"
|
|
}
|
|
$value = $value.Substring(1, $value.Length - 2)
|
|
} else {
|
|
$value = ($value -replace '\s+#.*$', '').TrimEnd()
|
|
}
|
|
[Environment]::SetEnvironmentVariable($key, $value, 'Process')
|
|
}
|
|
}
|
|
|
|
if ([string]::IsNullOrWhiteSpace($env:WIFI_SSID) -or $env:WIFI_SSID -eq 'your-ssid') {
|
|
throw 'Set WIFI_SSID in .env (copy .env.example) or the environment before building.'
|
|
}
|
|
if ($null -eq $env:WIFI_PASS) { $env:WIFI_PASS = '' }
|
|
|
|
$env:CARGO_WORKSPACE_DIR = (Get-Location).Path
|
|
$env:ESP_IDF_GLOB_BASE = (Get-Location).Path
|
|
$env:ESP_IDF_GLOB_PARTITIONS = 'partitions.csv'
|
|
|
|
& cargo build --release --locked @CargoArgs
|
|
if ($LASTEXITCODE -ne 0) { throw "cargo build failed (exit $LASTEXITCODE)." }
|
|
} finally {
|
|
foreach ($name in $buildEnvironment.Keys) {
|
|
[Environment]::SetEnvironmentVariable($name, $buildEnvironment[$name], 'Process')
|
|
}
|
|
Pop-Location
|
|
}
|