|
42 | 42 | DIGITAL_PIN_GPIOS_FIND_PIN(DT_REG_ADDR(DT_PHANDLE_BY_IDX(node, gpios, 0)), \ |
43 | 43 | DT_PHA_BY_IDX(node, gpios, 0, pin)) |
44 | 44 |
|
45 | | -#ifndef LED_BUILTIN |
46 | | - |
47 | 45 | /* Return the index of it if matched, oterwise return 0 */ |
48 | 46 | #define LED_BUILTIN_INDEX_BY_REG_AND_PINNUM(n, p, i, dev, num) \ |
49 | 47 | (DIGITAL_PIN_EXISTS(n, p, i, dev, num) ? i : 0) |
|
62 | 60 | DT_PHA_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0, pin)) > 0) |
63 | 61 | #warning "pin not found in digital_pin_gpios" |
64 | 62 | #else |
65 | | -#define LED_BUILTIN \ |
| 63 | +#define ZARD_LED_BUILTIN \ |
66 | 64 | DIGITAL_PIN_GPIOS_FIND_PIN( \ |
67 | 65 | DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0)), \ |
68 | 66 | DT_PHA_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0, pin)) |
|
77 | 75 | DT_PHA_BY_IDX(DT_ALIAS(led0), gpios, 0, pin)) > 0) |
78 | 76 | #warning "pin not found in digital_pin_gpios" |
79 | 77 | #else |
80 | | -#define LED_BUILTIN \ |
| 78 | +#define ZARD_LED_BUILTIN \ |
81 | 79 | DIGITAL_PIN_GPIOS_FIND_PIN(DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_ALIAS(led0), gpios, 0)), \ |
82 | 80 | DT_PHA_BY_IDX(DT_ALIAS(led0), gpios, 0, pin)) |
83 | 81 | #endif |
84 | 82 |
|
85 | 83 | #endif // builtin_led_gpios |
86 | 84 |
|
87 | | -#endif // LED_BUILTIN |
88 | | - |
89 | 85 | #define DN_ENUMS(n, p, i) D##i = i |
90 | 86 |
|
91 | 87 | /* |
@@ -142,6 +138,11 @@ void analogReadResolution(int bits); |
142 | 138 | void analogWriteResolution(int bits); |
143 | 139 |
|
144 | 140 | #include <variant.h> |
| 141 | + |
| 142 | +#if !defined(LED_BUILTIN) && defined(ZARD_LED_BUILTIN) |
| 143 | +#define LED_BUILTIN ZARD_LED_BUILTIN |
| 144 | +#endif // LED_BUILTIN |
| 145 | + |
145 | 146 | #ifdef __cplusplus |
146 | 147 | #include <SerialUSB.h> |
147 | 148 | #include <zephyrSerial.h> |
|
0 commit comments