docs: address Copilot review on the example READMEs

- Order CFG_TUH_DEVICE_MAX before CFG_TUH_HID in the host config snippets
  (cdc_msc_hid, hid_controller) so the documented snippet has no forward
  macro reference when copied into tusb_config.h.
- Fix stale `examples.rst` references: the generator now writes per-group
  `docs/examples/<group>/index.rst` pages, so update the conf.py comment and
  the build-doc SKILL.md accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hathach
2026-06-29 10:42:41 +07:00
parent 4b1c8d16f7
commit ba32b46ebd
4 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ python3 tools/build_doc.py -o # build docs/_build/ and open it
`tools/build_doc.py` wraps `sphinx-build`: `-c` clean, `-W` fail on warnings, `-o` open. Raw form: `sphinx-build -b html docs docs/_build`.
- Pages can be `.rst` or `.md` (MyST). Example `README.md`s under `examples/{device,host,dual}/*/` are **auto-collected** at build time into `docs/examples/` + `examples.rst` (both git-ignored) — add/rename an example and just rebuild; edit the source README, never the generated copies.
- Pages can be `.rst` or `.md` (MyST). Example `README.md`s under `examples/{device,host,dual}/*/` are **auto-collected** at build time into `docs/examples/` (per-group `index` pages, git-ignored) — add/rename an example and just rebuild; edit the source README, never the generated copies.
- Watch the output for `WARNING:` (broken refs, missing toctree entries).
## Regenerate after adding a board or dependency

View File

@ -83,7 +83,7 @@ def preprocess_readme():
preprocess_readme()
# scan example READMEs into docs/examples/ and (re)generate examples.rst
# scan example READMEs into docs/examples/ and generate a per-group index page
EXAMPLE_GROUPS = ('device', 'host', 'dual')
_HEADING_RE = re.compile(r'^(#{1,6})(\s.*)$')

View File

@ -20,6 +20,7 @@ Notable `tusb_config.h` settings:
```c
#define CFG_TUH_ENABLED 1
#define CFG_TUH_HUB 1
#define CFG_TUH_DEVICE_MAX (3*CFG_TUH_HUB + 1)
#define CFG_TUH_CDC 1
#define CFG_TUH_CDC_FTDI 1
#define CFG_TUH_CDC_CP210X 1
@ -27,7 +28,6 @@ Notable `tusb_config.h` settings:
#define CFG_TUH_CDC_PL2303 1
#define CFG_TUH_HID (3*CFG_TUH_DEVICE_MAX)
#define CFG_TUH_MSC 1
#define CFG_TUH_DEVICE_MAX (3*CFG_TUH_HUB + 1)
#define CFG_TUH_HID_EPIN_BUFSIZE 64
#define CFG_TUH_HID_EPOUT_BUFSIZE 64
#define CFG_TUH_CDC_LINE_CONTROL_ON_ENUM (CDC_CONTROL_LINE_STATE_DTR | CDC_CONTROL_LINE_STATE_RTS)

View File

@ -22,8 +22,8 @@ Notable `tusb_config.h` settings:
```c
#define CFG_TUH_ENABLED 1
#define CFG_TUH_HUB 0
#define CFG_TUH_HID (3*CFG_TUH_DEVICE_MAX)
#define CFG_TUH_DEVICE_MAX (3*CFG_TUH_HUB + 1)
#define CFG_TUH_HID (3*CFG_TUH_DEVICE_MAX)
#define CFG_TUH_HID_EP_BUFSIZE 64
```