-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_algos.ps1
More file actions
35 lines (29 loc) · 1004 Bytes
/
update_algos.ps1
File metadata and controls
35 lines (29 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$lpcs = @('lpc8xx', 'lpc11xx', 'lpc13xx', 'lpc15xx', 'lpc177x_8x')
Push-Location "lpc-probers-target"
foreach ($lpc in $lpcs) {
$jsonPath = "..\docs\$($lpc)_targets.json"
$generated = "$($lpc)_generated.yaml"
$template = "..\algos\$($lpc)\template.yaml"
# Write-Host "json: $jsonPath, generated: $generated, template: $template"
cargo run -- $jsonPath
Copy-Item "$generated" "$template"
}
Pop-Location
foreach ($lpc in $lpcs) {
Push-Location "algos\$lpc"
cargo build --release
$v6mPath = "target\thumbv6m-none-eabi\release\$lpc"
$v7mPath = "target\thumbv7m-none-eabi\release\$lpc"
if (Test-Path $v6mPath) {
target-gen elf $v6mPath -u template.yaml
Copy-Item template.yaml "..\..\$lpc.yaml" -Force
}
elseif (Test-Path $v7mPath) {
target-gen elf $v7mPath -u template.yaml
Copy-Item template.yaml "..\..\$lpc.yaml" -Force
}
else {
Write-Host "No output found for target $lpc"
}
Pop-Location
}