@@ -380,16 +380,26 @@ will match on both `pears=20, apples=30` and `pears=30, apples=40` but not `pear
380
380
381
381
#### Identification of board options
382
382
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:
385
395
386
396
```
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
389
398
```
390
399
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 ` :
393
403
394
404
```
395
405
myboard.upload_port.pid=0x0010
@@ -410,18 +420,19 @@ myboard.menu.mem.2k.upload_port.2.cd=gh <---+-- identifica
410
420
myboard.menu.mem.2k.build_mem=2048
411
421
```
412
422
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:
416
426
417
427
```
418
428
vid=0x0010
419
429
pid=0x2341
420
430
c=atmega2560
421
431
```
422
432
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:
425
436
426
437
```
427
438
vid=0x0010
@@ -430,7 +441,9 @@ c=atmega2560
430
441
mem=2
431
442
```
432
443
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:
434
447
435
448
```
436
449
vid=0x0010
@@ -440,4 +453,5 @@ ab=ef
440
453
cd=gh
441
454
```
442
455
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