Skip to content

Commit 32519f8

Browse files
committed
analog
1 parent 90807d4 commit 32519f8

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

cores/arduino/Arduino.h

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525
DT_PHA_BY_IDX(n, p, i, pin)
2626

2727
#ifndef LED_BUILTIN
28-
29-
/* Return the index of it if matched, oterwise return 0 */
30-
#define LED_BUILTIN_INDEX_BY_REG_AND_PINNUM(n, p, i, dev, num) \
31-
(DIGITAL_PIN_EXISTS(n, p, i, dev, num) ? i : 0)
32-
33-
/* Only matched pin returns non-zero value, so the sum is matched pin's index */
34-
#define DIGITAL_PIN_GPIOS_FIND_PIN(dev, pin) \
35-
DT_FOREACH_PROP_ELEM_SEP_VARGS(DT_PATH(zephyr_user), digital_pin_gpios, \
36-
LED_BUILTIN_INDEX_BY_REG_AND_PINNUM, (+), dev, pin)
37-
3828
#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), builtin_led_gpios) && \
3929
(DT_PROP_LEN(DT_PATH(zephyr_user), builtin_led_gpios) > 0)
4030
#define LED_BUILTIN ZARD_GLOBAL_GPIO_NUM(DT_PATH(zephyr_user), builtin_led_gpios, 0)
@@ -53,17 +43,10 @@ enum digitalPins {
5343
};
5444

5545
#ifdef CONFIG_ADC
56-
57-
#define ZARD_AN_ENUMS(n, p, i) AX##i = ZARD_GLOBAL_GPIO_NUM(n, p, i)
58-
enum analogPinsx {
46+
#define ZARD_AN_ENUMS(n, p, i) A##i = ZARD_GLOBAL_GPIO_NUM(n, p, i)
47+
enum analogPins {
5948
DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), adc_pin_gpios, ZARD_AN_ENUMS, (,))
6049
};
61-
#define AN_ENUMS(n, p, i) A ## i = DIGITAL_PIN_GPIOS_FIND_PIN( \
62-
DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), p, i)), \
63-
DT_PHA_BY_IDX(DT_PATH(zephyr_user), p, i, pin)),
64-
enum analogPins { DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user),
65-
adc_pin_gpios, AN_ENUMS) };
66-
6750
#endif
6851

6952
void interrupts(void);

0 commit comments

Comments
 (0)