diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index f75c50f6..67226d57 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -87,9 +87,6 @@ enum digitalPins { NUM_OF_DIGITAL_PINS }; -const struct gpio_dt_spec arduino_pins[] = {DT_FOREACH_PROP_ELEM_SEP( - DT_PATH(zephyr_user), digital_pin_gpios, GPIO_DT_SPEC_GET_BY_IDX, (, ))}; - #ifdef CONFIG_ADC #define AN_ENUMS(n, p, i) A ## i = DIGITAL_PIN_GPIOS_FIND_PIN( \ @@ -101,5 +98,7 @@ enum analogPins { DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), #endif #include +#ifdef __cplusplus #include #include +#endif // __cplusplus diff --git a/cores/arduino/zephyrCommon.cpp b/cores/arduino/zephyrCommon.cpp index b98c24da..1d4cbdbe 100644 --- a/cores/arduino/zephyrCommon.cpp +++ b/cores/arduino/zephyrCommon.cpp @@ -7,6 +7,9 @@ #include #include "zephyrInternal.h" +static const struct gpio_dt_spec arduino_pins[] = {DT_FOREACH_PROP_ELEM_SEP( + DT_PATH(zephyr_user), digital_pin_gpios, GPIO_DT_SPEC_GET_BY_IDX, (, ))}; + namespace { /*