Fix 3.5C board support per CYD_PROJECT_GUIDE: BL=27, GT911 INT separate.
Correct ST7796/cyd_35r backlight, leave INT as input after reset, export firmware/cyd_35r. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,10 +25,12 @@ if ($Env -eq "cyd_35r") {
|
||||
$dstName = "cyd_35r"
|
||||
$boardLine = "board: ESP32-3248S035 (ST7796)"
|
||||
$boardIdHint = "esp32-3248s035"
|
||||
$featLine = "features: SoftSPI/GT911 touch, LVGL, capacitive touch btn GPIO22, BL=27"
|
||||
} else {
|
||||
$dstName = "cyd"
|
||||
$boardLine = "board: ESP32-2432S028R (ILI9341)"
|
||||
$boardIdHint = "esp32-2432s028"
|
||||
$featLine = "features: SoftSPI touch, LVGL, capacitive touch btn GPIO22, BL=21"
|
||||
}
|
||||
$dst = Join-Path $root ("firmware\" + $dstName)
|
||||
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
||||
@@ -45,15 +47,31 @@ if (-not (Test-Path $bootApp)) {
|
||||
}
|
||||
Copy-Item $bootApp (Join-Path $dst "boot_app0.bin") -Force
|
||||
|
||||
# Ensure flash scripts exist (copy from sibling folder if needed)
|
||||
foreach ($script in @("flash.ps1", "flash.bat")) {
|
||||
$here = Join-Path $dst $script
|
||||
if (-not (Test-Path $here)) {
|
||||
$sibling = if ($Env -eq "cyd_35r") {
|
||||
Join-Path $root "firmware\cyd\$script"
|
||||
} else {
|
||||
Join-Path $root "firmware\cyd_35r\$script"
|
||||
}
|
||||
if (Test-Path $sibling) {
|
||||
Copy-Item $sibling $here -Force
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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
|
||||
$lines = @(
|
||||
"name: CYD touchbtntest ($dstName)",
|
||||
"name: CYD Touch Button ($dstName)",
|
||||
"git: $git",
|
||||
"date: $date",
|
||||
$boardLine,
|
||||
$featLine,
|
||||
"flash_size: 4MB",
|
||||
"offsets:",
|
||||
" 0x1000 bootloader.bin",
|
||||
@@ -73,8 +91,8 @@ 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\")"
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user