Fix 3.5 KY-009: backlight GPIO27 and G on GPIO21.

Align cyd_35r with CYD_PROJECT_GUIDE (ST7796/GT911), export flashable firmware/cyd_35r.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-25 11:33:47 +08:00
parent 9f8d8279f0
commit 39fa51c48e
18 changed files with 443 additions and 78 deletions

View File

@@ -49,11 +49,17 @@ $git = ""
try { $git = (git -C $root rev-parse --short HEAD).Trim() } catch { $git = "unknown" }
$date = Get-Date -Format "yyyy-MM-dd"
$hashes = Get-ChildItem (Join-Path $dst "*.bin") | Get-FileHash -Algorithm SHA256
$feat = if ($Env -eq "cyd_35r") {
"features: ST7796, GT911, BL27, KY009 R22/G21/B4"
} else {
"features: ILI9341, SoftSPI, BL21, KY009 R22/G27/B4"
}
$lines = @(
"name: CYD smdky009ledtest ($dstName)",
"git: $git",
"date: $date",
$boardLine,
$feat,
"flash_size: 4MB",
"offsets:",
" 0x1000 bootloader.bin",
@@ -67,21 +73,5 @@ foreach ($h in $hashes) {
}
$lines | Set-Content -Encoding utf8 (Join-Path $dst "VERSION.txt")
# Keep / refresh meta.json boardId for catalog filtering
$metaPath = Join-Path $dst "meta.json"
if (Test-Path $metaPath) {
try {
$meta = Get-Content $metaPath -Raw | ConvertFrom-Json
$meta.boardId = $boardIdHint
if ($Env -eq "cyd_35r" -and $meta.name -notmatch "3\.5") {
$meta.name = ($meta.name -replace "\s*$","") + " (3.5\")"
}
$meta | ConvertTo-Json -Depth 8 | Set-Content -Encoding utf8 $metaPath
} catch {
Write-Host "meta.json update skipped: $_"
}
} elseif ($Env -eq "cyd_35r") {
Write-Host "Note: add firmware/cyd_35r/meta.json with boardId=$boardIdHint for the web catalog"
}
Write-Host "Exported -> $dst (env=$Env git=$git)"