25
25
DT_PHA_BY_IDX(n, p, i, pin)
26
26
27
27
#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
-
38
28
#if DT_NODE_HAS_PROP (DT_PATH (zephyr_user ), builtin_led_gpios ) && \
39
29
(DT_PROP_LEN (DT_PATH (zephyr_user ), builtin_led_gpios ) > 0 )
40
30
#define LED_BUILTIN ZARD_GLOBAL_GPIO_NUM(DT_PATH(zephyr_user), builtin_led_gpios, 0)
@@ -53,17 +43,10 @@ enum digitalPins {
53
43
};
54
44
55
45
#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 {
59
48
DT_FOREACH_PROP_ELEM_SEP (DT_PATH (zephyr_user ), adc_pin_gpios , ZARD_AN_ENUMS , (,))
60
49
};
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
-
67
50
#endif
68
51
69
52
void interrupts (void );
0 commit comments