|
33 | 33 |
|
34 | 34 | #undef DIGITAL_PIN_CHECK_UNIQUE |
35 | 35 |
|
36 | | -#ifndef LED_BUILTIN |
37 | | - |
38 | 36 | /* Return the index of it if matched, oterwise return 0 */ |
39 | 37 | #define LED_BUILTIN_INDEX_BY_REG_AND_PINNUM(n, p, i, dev, num) \ |
40 | 38 | (DIGITAL_PIN_EXISTS(n, p, i, dev, num) ? i : 0) |
|
53 | 51 | DT_PHA_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0, pin)) > 0) |
54 | 52 | #warning "pin not found in digital_pin_gpios" |
55 | 53 | #else |
56 | | -#define LED_BUILTIN \ |
| 54 | +#define LED_BUILTIN_ \ |
57 | 55 | DIGITAL_PIN_GPIOS_FIND_PIN( \ |
58 | 56 | DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0)), \ |
59 | 57 | DT_PHA_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0, pin)) |
|
67 | 65 | DT_PHA_BY_IDX(DT_ALIAS(led0), gpios, 0, pin)) > 0) |
68 | 66 | #warning "pin not found in digital_pin_gpios" |
69 | 67 | #else |
70 | | -#define LED_BUILTIN \ |
| 68 | +#define LED_BUILTIN_ \ |
71 | 69 | DIGITAL_PIN_GPIOS_FIND_PIN(DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_ALIAS(led0), gpios, 0)), \ |
72 | 70 | DT_PHA_BY_IDX(DT_ALIAS(led0), gpios, 0, pin)) |
73 | 71 | #endif |
74 | 72 |
|
75 | 73 | #endif // builtin_led_gpios |
76 | 74 |
|
77 | | -#endif // LED_BUILTIN |
78 | | - |
79 | 75 | #define DN_ENUMS(n, p, i) D##i = i |
80 | 76 |
|
81 | 77 | /* |
@@ -103,6 +99,11 @@ void noInterrupts(void); |
103 | 99 | int digitalPinToInterrupt(pin_size_t pin); |
104 | 100 |
|
105 | 101 | #include <variant.h> |
| 102 | + |
| 103 | +#ifndef LED_BUILTIN |
| 104 | +#define LED_BUILTIN LED_BUILTIN_ |
| 105 | +#endif // LED_BUILTIN |
| 106 | + |
106 | 107 | #ifdef __cplusplus |
107 | 108 | #include <zephyrPrint.h> |
108 | 109 | #include <zephyrSerial.h> |
|
0 commit comments