We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0556fbf + 042e0a1 commit 5b861f1Copy full SHA for 5b861f1
1 file changed
cores/arduino/zephyrCommon.cpp
@@ -329,6 +329,14 @@ struct adc_channel_cfg channel_cfg[ARRAY_SIZE(arduino_analog_pins)] = {
329
#endif
330
};
331
332
+#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channels) && \
333
+ DT_NODE_HAS_PROP(DT_PATH(zephyr_user), adc_pin_gpios)
334
+#if DT_PROP_LEN(DT_PATH(zephyr_user), io_channels) != \
335
+ DT_PROP_LEN(DT_PATH(zephyr_user), adc_pin_gpios)
336
+#error "io_channels and adc_pin_gpios must have the same length"
337
+#endif
338
339
+
340
size_t analog_pin_index(pin_size_t pinNumber) {
341
for(size_t i=0; i<ARRAY_SIZE(arduino_analog_pins); i++) {
342
if (arduino_analog_pins[i] == pinNumber) {
0 commit comments