Просмотр исходного кода

fix: Make the UART alias in the Zephyr example more generic

This makes it easier for customers to change the example,
and there isno need to specify the uart number in this case.
Djordje Nedic 2 лет назад
Родитель
Сommit
1edb797959

+ 1 - 1
examples/zephyr_example/boards/esp32_devkitc_wroom.overlay

@@ -12,7 +12,7 @@
 	aliases {
 		en = &en_button;
 		boot = &boot_button;
-		uart1 = &uart1;
+		uart = &uart1;
 	};
 
 	gpio_keys {

+ 1 - 1
examples/zephyr_example/boards/esp32_devkitc_wrover.overlay

@@ -12,7 +12,7 @@
 	aliases {
 		en = &en_button;
 		boot = &boot_button;
-		uart1 = &uart1;
+		uart = &uart1;
 	};
 
 	gpio_keys {

+ 1 - 1
examples/zephyr_example/src/main.c

@@ -25,7 +25,7 @@
 #define DEFAULT_BAUDRATE 115200
 
 /* Get UART DTS entry used as flash interface */
-static const struct device *esp_uart_dev = DEVICE_DT_GET(DT_ALIAS(uart1));
+static const struct device *esp_uart_dev = DEVICE_DT_GET(DT_ALIAS(uart));
 /* Get GPIO pin connected to the ESP's enable pin. */
 static const struct gpio_dt_spec esp_enable_spec = GPIO_DT_SPEC_GET(DT_ALIAS(en), gpios);
 /* Get GPIO pin  connected to the ESP's boot pin. */