Skip to content

Commit d0ebfd7

Browse files
cmaglieper1234
andauthored
Apply suggestions from code review
Co-authored-by: per1234 <accounts@perglass.com>
1 parent 1bcdd33 commit d0ebfd7

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

docs/pluggable-discovery-specification.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,26 @@ will match on both `pears=20, apples=30` and `pears=30, apples=40` but not `pear
380380

381381
#### Identification of board options
382382

383-
The board identification can also identify [custom board options](platform-specification.md#custom-board-options) if the
384-
corresponding `upload_port` properties are defined:
383+
[Custom board options](platform-specification.md#custom-board-options) can also be identified.
384+
385+
Identification property values are associated with a custom board option by the board definition in
386+
[`boards.txt`](platform-specification.md#boardstxt). Two formats are available.
387+
388+
If only a single set of identification properties are associated with the option:
389+
390+
```
391+
BOARD_ID.menu.MENU_ID.OPTION_ID.upload_port.PORT_PROPERTY_KEY=PORT_PROPERTY_VALUE
392+
```
393+
394+
If one or more sets of identification properties are associated with the option, an index number is used for each set:
385395

386396
```
387-
BOARDNAME.menu.MENUNAME.MENUOPTION.upload_port.IDENTIFIER=Value
388-
BOARDNAME.menu.MENUNAME.MENUOPTION.upload_port.#.IDENTIFIER=Value
397+
BOARD_ID.menu.MENU_ID.OPTION_ID.upload_port.SET_INDEX.PORT_PROPERTY_KEY=PORT_PROPERTY_VALUE
389398
```
390399

391-
a discovery tools capable of detecting which menu options where used could report properties to match those lines. Let's
392-
see an example to clarify it, in the following `boards.txt`:
400+
If multiple identification properties are associated within a set, all must match for the option to be identified.
401+
402+
Let's see an example to clarify it, in the following `boards.txt`:
393403

394404
```
395405
myboard.upload_port.pid=0x0010
@@ -410,18 +420,19 @@ myboard.menu.mem.2k.upload_port.2.cd=gh <---+-- identifica
410420
myboard.menu.mem.2k.build_mem=2048
411421
```
412422

413-
we have a board called `myboard` with two custom menu options `cpu` and `mem`. The discovery may provide extra
414-
identification properties to determine the custom menu options of the connected board, for example the following
415-
properties:
423+
we have a board called `myboard` with two custom menu options `cpu` and `mem`.
424+
425+
A port with the following identification properties:
416426

417427
```
418428
vid=0x0010
419429
pid=0x2341
420430
c=atmega2560
421431
```
422432

423-
will match the FQBN `mypackage:avr:myboard:cpu=atmega2560` becuase of the property `c=atmega2560`. The identification
424-
properties:
433+
will be identified as FQBN `mypackage:avr:myboard:cpu=atmega2560` because of the property `c=atmega2560`.
434+
435+
A port with the following identification properties:
425436

426437
```
427438
vid=0x0010
@@ -430,7 +441,9 @@ c=atmega2560
430441
mem=2
431442
```
432443

433-
will match the FQBN `mypackage:avr:myboard:cpu=atmega2560,mem=2k`. The identification properties:
444+
will be identified as FQBN `mypackage:avr:myboard:cpu=atmega2560,mem=2k`.
445+
446+
A port with the following identification properties:
434447

435448
```
436449
vid=0x0010
@@ -440,4 +453,5 @@ ab=ef
440453
cd=gh
441454
```
442455

443-
will match the FQBN `mypackage:avr:myboard:cpu=atmega2560,mem=2k` too (they will match the second set for `mem=2k`).
456+
will be identified as FQBN `mypackage:avr:myboard:cpu=atmega2560,mem=2k` too (they will match the second identification
457+
properties set for `mem=2k`).

0 commit comments

Comments
 (0)