summaryrefslogtreecommitdiff
path: root/ports/esp32/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp32/uart.c')
-rw-r--r--ports/esp32/uart.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ports/esp32/uart.c b/ports/esp32/uart.c
index 358d43470..fc69e279e 100644
--- a/ports/esp32/uart.c
+++ b/ports/esp32/uart.c
@@ -26,14 +26,16 @@
* THE SOFTWARE.
*/
-#include <stdio.h>
-
-#include "hal/uart_hal.h"
#include "py/runtime.h"
#include "py/mphal.h"
#include "uart.h"
+#if MICROPY_HW_ENABLE_UART_REPL
+
+#include <stdio.h>
+#include "hal/uart_hal.h"
+
// Backwards compatibility for when MICROPY_HW_UART_REPL was a ESP-IDF UART
// driver enum. Only UART_NUM_0 was supported with that version of the driver.
#define UART_NUM_0 0
@@ -118,3 +120,5 @@ STATIC void IRAM_ATTR uart_irq_handler(void *arg) {
}
}
}
+
+#endif // MICROPY_HW_ENABLE_UART_REPL