Skip to content

Commit 48a2832

Browse files
committed
docs/core: align LED_BUILTIN precedence and fix dts examples
1 parent 74d6469 commit 48a2832

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

cores/arduino/Arduino.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@
161161
DT_MAP_ENTRY_PARENT_BY_IDX(DT_NODELABEL(ZARD_CONNECTOR), gpio_map, i)) + \
162162
DT_MAP_ENTRY_PARENT_SPECIFIER_BY_IDX(DT_NODELABEL(ZARD_CONNECTOR), gpio_map, i, 0)
163163

164-
#if DT_NODE_EXISTS(DT_ALIAS(led0))
164+
#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), builtin_led_gpios) && \
165+
(DT_PROP_LEN(DT_PATH(zephyr_user), builtin_led_gpios) > 0)
166+
#define ZARD_LED_BUILTIN \
167+
ZARD_GLOBAL_GPIO_OFFSET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0)) + \
168+
DT_PHA_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0, pin)
169+
#elif DT_NODE_EXISTS(DT_ALIAS(led0))
165170
#define ZARD_LED_BUILTIN \
166171
ZARD_GLOBAL_GPIO_OFFSET(DT_PHANDLE_BY_IDX(DT_ALIAS(led0), gpios, 0)) + \
167172
DT_PHA_BY_IDX(DT_ALIAS(led0), gpios, 0, pin)

documentation/configuration-guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Two ways to reach it (**lowest precedence rule first**):
134134
/* ---- snip ---- */
135135
<ARDUINO_HEADER_R3_D15 0 &ioport1 0 0>;
136136
};
137+
};
137138
```
138139
139140
2. **Define `/zephyr,user/digital-pin-gpios`**

documentation/configuration-reference.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ B. Board devicetree constructs (board-provided defaults)
203203
/* ---- snip ---- */
204204
<ARDUINO_HEADER_R3_D15 0 &ioport1 0 0>;
205205
};
206+
};
206207
```
207208
208209
@@ -215,9 +216,9 @@ B. Board devicetree constructs (board-provided defaults)
215216
- **Precedence:**
216217
- Lower than `/zephyr,user/adc-pin-gpios` (association)
217218
- Lower than `/zephyr,user/io-channels` (provisioning)
218-
- **Notes:** `io-channel-map`: left = connector pin id, right = target ADC controller/channel; ADC still needs per-channel config under the ADC device node.
219-
- ADC still requires per-channel configuration under the ADC device node,
220-
regardless of how the channel list is obtained.
219+
- **Notes:** `io-channel-map`: left = connector pin id, right = target ADC controller/channel.
220+
ADC still requires per-channel configuration under the ADC device node,
221+
regardless of how the channel list is obtained.
221222
- **Example:**
222223
```dts
223224
/ {

0 commit comments

Comments
 (0)