esp32: Fix redefinition of BIT() macro
Esp-idf defines the BIT macro that is also defined in Zephyr's
misc/util.h. Fix the issue by including the esp-idf headers first, so
that a check in util.h won't redefine the macro if it's already
defined.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
diff --git a/drivers/serial/uart_esp32.c b/drivers/serial/uart_esp32.c
index 089e641..84b7db3 100644
--- a/drivers/serial/uart_esp32.c
+++ b/drivers/serial/uart_esp32.c
@@ -4,11 +4,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
-/* include rom/uart.h (from the esp-dif package) before Z's uart.h so
- * that the definition of BIT is not overriden */
+/* Include esp-idf headers first to avoid redefining BIT() macro */
#include <rom/uart.h>
-#include <uart.h>
#include <rom/ets_sys.h>
+
+#include <uart.h>
#include <errno.h>
static unsigned char esp32_uart_tx(struct device *dev,