Skip to content

Commit d013e34

Browse files
committed
x
1 parent c9ed948 commit d013e34

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cores/arduino/Arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ enum digitalPins {
6363
enum digitalPins {
6464
DT_FOREACH_PROP_ELEM_SEP(DT_NODELABEL(ZARD_CONNECTOR), gpio_map, ZARD_MKR_HDR_DN_ENUMS, (, )),
6565
NUM_OF_DIGITAL_PINS
66-
}
66+
};
6767
#endif
6868

6969
#endif

cores/arduino/zephyrCommon.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,15 @@ constexpr const N max_in_list(const N max, const Head &head, const Tail &...tail
7979
return max_in_list((max >= head) ? max : head, tail...);
8080
}
8181

82+
#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), digital_pin_gpios)
8283
#define GPIO_NGPIOS(n, p, i) DT_PROP(DT_GPIO_CTLR_BY_IDX(n, p, i), ngpios)
8384
constexpr int max_ngpios = max_in_list(
8485
0, DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), digital_pin_gpios, GPIO_NGPIOS, (, )));
86+
#elif defined(ZARD_CONNECTOR)
87+
#define MAP_NGPIOS(n, p, i) DT_PROP(DT_MAP_PARENT_ARG_BY_IDX(n, p, i), ngpios)
88+
constexpr int max_ngpios = max_in_list(
89+
0, DT_FOREACH_PROP_ELEM_SEP(DT_NODELABEL(ZARD_CONNECTOR), gpio_map, MAP_NGPIOS, (, )));
90+
#endif
8591

8692
/*
8793
* GPIO callback implementation

0 commit comments

Comments
 (0)