Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/codegen_drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ on:
- 'radio/util/yaml_parser.tmpl'
- 'radio/util/hw_defs/**'
- 'radio/src/boards/hw_defs/**'
# web simulator radio list (also fed by the hw_defs above)
- 'fw.json'
- 'web/scripts/gen-radios-json.js'
- 'web/public/radios.json'
pull_request:
paths: *trigger-paths
workflow_dispatch:
Expand All @@ -54,6 +58,7 @@ jobs:
cfn: ${{ steps.filter.outputs.cfn }}
fonts: ${{ steps.filter.outputs.fonts }}
yaml: ${{ steps.filter.outputs.yaml }}
radios: ${{ steps.filter.outputs.radios }}
steps:
- name: Check out the repo
uses: actions/checkout@v7
Expand All @@ -69,7 +74,7 @@ jobs:
- name: Check the recipes this workflow calls still resolve
run: |
just --list >/dev/null
for recipe in cfn-sort gen-fonts gen-yaml; do
for recipe in cfn-sort gen-fonts gen-yaml gen-radios; do
just --show "${recipe}" >/dev/null
done

Expand Down Expand Up @@ -108,6 +113,13 @@ jobs:
- 'radio/util/yaml_parser.tmpl'
- 'radio/util/hw_defs/**'
- 'radio/src/boards/hw_defs/**'
radios:
- '.github/workflows/codegen_drift.yml'
- '.github/actions/codegen_drift/action.yml'
- 'fw.json'
- 'radio/src/boards/hw_defs/**'
- 'web/scripts/gen-radios-json.js'
- 'web/public/radios.json'

cfn-sort:
name: Custom function sort order
Expand Down Expand Up @@ -180,3 +192,25 @@ jobs:
recipe: gen-yaml
paths: radio/src/storage/yaml
label: YAML parsers

radios:
name: Web simulator radio list
needs: changes
if: needs.changes.outputs.radios == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 10
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
- ${{ github.workspace }}:/src
steps:
- name: Check out the repo
uses: actions/checkout@v7

- name: Check for drift
uses: ./.github/actions/codegen_drift
with:
just-version: ${{ env.JUST_VERSION }}
recipe: gen-radios
paths: web/public/radios.json
label: Web simulator radio list
6 changes: 3 additions & 3 deletions .github/workflows/companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ jobs:
- id: color-2
target: [pl18u, t15, t16, t18, t22]
- id: bw-1
target: [zorro, pocket, mt12, commando8, tprov2, tpros, bumblebee, t14]
target: [zorro, pocket, commando8, tprov2, tpros, bumblebee, t14]
- id: bw-2
target: [mt12, gx12, t20, t20v2, t12max, tx12mk2, boxer]
- id: color-3
target: [tx15, tx16s, x12s, f16]
- id: mixed-1
target: [v14, v14lcd, v16, x10, x10express]
target: [v12, v14, v14lcd, v16, x10, x10express]
- id: bw-3
target: [x7access, x9dp2019, x9e, x9e-hall]
target: [x7access, x9dp2019, x9e]
- id: color-4
target: [nb4p, st16, pa01, c14]
- id: color-5
Expand Down
18 changes: 15 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ cfn-sort:
gen-yaml FLAVOR='':
FLAVOR="{{ FLAVOR }}" tools/generate-yaml.sh

[doc('Regenerate the YAML parsers, LVGL fonts and cfn sort order')]
# Needs: node. Which radios are included comes from fw.json, so this only
# picks up a new target once it is listed there.
[doc('Regenerate the web simulator radio list (web/public/radios.json)')]
[group('codegen')]
codegen: gen-fonts cfn-sort gen-yaml
gen-radios:
node web/scripts/gen-radios-json.js

[doc('Regenerate the YAML parsers, LVGL fonts, cfn sort order and radio list')]
[group('codegen')]
codegen: gen-fonts cfn-sort gen-yaml gen-radios

[doc('Regenerate the LVGL fonts in the dev container')]
[group('codegen (docker)')]
Expand All @@ -60,6 +67,11 @@ docker-gen-yaml FLAVOR='':
FETCHCONTENT_BASE_DIR=/src/.cache/fetchcontent-docker \
tools/generate-yaml.sh

[doc('Regenerate the web simulator radio list in the dev container')]
[group('codegen (docker)')]
docker-gen-radios:
{{ _docker }} node web/scripts/gen-radios-json.js

[doc('Regenerate everything in the dev container')]
[group('codegen (docker)')]
docker-codegen: docker-gen-fonts docker-cfn-sort docker-gen-yaml
docker-codegen: docker-gen-fonts docker-cfn-sort docker-gen-yaml docker-gen-radios
4 changes: 2 additions & 2 deletions tools/build-wasm-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ else
boxer bumblebee commando8
gx12 mt12 pocket t12max
t14 t20 t20v2 tpros tprov2
tx12mk2 zorro v12 v14 v14lcd
tx12mk2 zorro v14 v14lcd
x7access x9dp2019 x9e
# colour
c14 el18 nb4p nv14 st16 pa01
pl18 pl18ev pl18u
t15 t15pro t16 t18 t22
tx15 tx16s tx16smk3 f16 v16
tx15 gx15 tx16s tx16smk3 f16 v12 v16
x10 x10express x12s
)
fi
Expand Down
8 changes: 7 additions & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,20 @@ cp output/*.wasm web/public/

### Supported Radios

The radios available in the web UI are defined in `public/radios.json`. This file is **generated** from the authoritative hardware definitions in `radio/src/boards/hw_defs/`. To regenerate it (e.g. after adding a new radio target):
The radios available in the web UI are defined in `public/radios.json`. This file is **generated** from the authoritative hardware definitions in `radio/src/boards/hw_defs/`. To regenerate it (e.g. after adding a new radio target), from the repo root:

```bash
just gen-radios
# or, without just:
node web/scripts/gen-radios-json.js
```

The script extracts inputs, switches, trims, keys, and display info from the hw_defs JSON files. Key left/right side placement matches Companion's layout.

*Which* radios are included comes from the `targets` list in the repo-root `fw.json`, so a new board only appears here once it is a released target. Targets with no matching hw_defs file are skipped with a warning: `x9e-hall` always warns, as it is a build option of `x9e` rather than a board of its own.

Passing flavour names as arguments limits generation to those radios only — the whole file is rewritten, so use that for inspection, not to update the committed list.

## Architecture

```
Expand Down
Loading