Skip to content

Commit ceeb967

Browse files
committed
x
1 parent 211d5dc commit ceeb967

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cores/arduino/Arduino.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
#include <zephyr/drivers/adc.h>
1515
#include <zephyr/drivers/i2c.h>
1616

17+
#if DT_NODE_EXISTS(DT_NODELABEL(arduino_header))
18+
#define ARDUINO_HEADER_LABEL arduino_header
19+
#error
20+
#elif DT_NODE_EXISTS(DT_NODELABEL(arduino_mkr_header))
21+
#define ARDUINO_HEADER_LABEL arduino_mkr_header
22+
#endif
23+
1724
#define DIGITAL_PIN_EXISTS(n, p, i, dev, num) \
1825
(((dev == DT_REG_ADDR(DT_PHANDLE_BY_IDX(n, p, i))) && \
1926
(num == DT_PHA_BY_IDX(n, p, i, pin))) \
@@ -83,7 +90,7 @@
8390
* enum digitalPins { D0, D1, ... LED... NUM_OF_DIGITAL_PINS };
8491
*/
8592
enum digitalPins {
86-
DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), digital_pin_gpios, DN_ENUMS, (, )),
93+
DT_FOREACH_PROP_ELEM_SEP(DT_NODELABEL(ARDUINO_HEADER_LABEL), gpio_map, DN_ENUMS, (, )),
8794
NUM_OF_DIGITAL_PINS
8895
};
8996

0 commit comments

Comments
 (0)