zephyr: prefer DTS mcuboot-led0 alias over bootloader-led0 alias
bootloader-led0 alias will be deprecated and replaced by dedicated
mcuboot-led0 alias.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index bac41a3..c7ce2c3 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -127,8 +127,12 @@
* The led0 devicetree alias is optional. If present, we'll use it
* to turn on the LED whenever the button is pressed.
*/
-
+#if DT_NODE_EXISTS(DT_ALIAS(mcuboot_led0))
+#define LED0_NODE DT_ALIAS(mcuboot_led0))
+#elif DT_NODE_EXISTS(DT_ALIAS(bootloader_led0))
+#warning "bootloader-led0 alias is deprecated; use mcuboot-led0 instead"
#define LED0_NODE DT_ALIAS(bootloader_led0)
+#endif
#if DT_NODE_HAS_STATUS(LED0_NODE, okay) && DT_NODE_HAS_PROP(LED0_NODE, gpios)
#define LED0_GPIO_LABEL DT_GPIO_LABEL(LED0_NODE, gpios)