Skip to content

Commit 9a49ac7

Browse files
authored
Merge pull request #20 from soburi/codex/review-last-3-commits-for-documentation-issues-k1mvua
Codex-generated pull request
2 parents 308fbf7 + 23c6f26 commit 9a49ac7

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

cores/arduino/Arduino.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@
127127
UTIL_CAT(UTIL_CAT(ZARD_, UTIL_CAT(DT_STRING_UPPER_TOKEN_BY_IDX(node, compatible, 0), _DIGITAL_MAP_)), num)
128128

129129
#define ZARD_CHECK_GPIO_CTLR_OKAY(node_id) \
130-
COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_controller), (node_id,), ())
130+
COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_controller), \
131+
(COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(node_id), \
132+
(node_id,), \
133+
())), \
134+
())
131135

132136
#define ZARD_ALL_OKAY_GPIO_CTLR DT_FOREACH_NODE(ZARD_CHECK_GPIO_CTLR_OKAY)
133137

cores/arduino/zephyrCommon.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ static constexpr struct gpio_dt_spec arduino_pins[] = {DT_FOREACH_PROP_ELEM_SEP(
2323

2424
#define GET_GPIO_NGPIOS(node_id) \
2525
COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_controller), \
26-
(DT_PROP_OR(node_id, ngpios, 0),), ())
26+
(COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(node_id), \
27+
(DT_PROP_OR(node_id, ngpios, 0),), \
28+
(0,))), \
29+
())
2730

2831
static constexpr const struct device *gpio_ports[] = {DT_FOREACH_NODE(GET_GPIO_DEVICES)};
2932
static constexpr uint32_t gpio_ngpios[] = {DT_FOREACH_NODE(GET_GPIO_NGPIOS)};

documentation/configuration-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ B. Board devicetree constructs (board-provided defaults)
355355
For example, if you have gpio0, gpio1 which has 16 ports,
356356
then pin0 of gpio0 will be 0, pin1 will be 1, ...
357357
pin0 of gpio1 will be 16, pin1 will be 17, ... etc.
358-
- The numbers will be counted even if the gpio device is disabled.
358+
- Only GPIO controllers with `status = "okay"` are counted.
359359
- The order of GPIOs depends on their appearance in the device tree.
360360
361361
### Dx availability (`D0`, `D1`, …)

0 commit comments

Comments
 (0)