From 7228cf1108a4bf7a169ec6c154a0067a4634b77b Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 6 Dec 2023 09:25:15 +0100 Subject: [PATCH] boards/esp32*-devkit: add TTY board filter When using `make flash` or `make term` with `MOST_RECENT_PORT=1`, RIOT should now only consider plausible TTYs and select the most recently connected one. The filter is a bit broad, though, and will match any board with a CP2102N USB2UART bridge. But depending on the boards attached, it might be good enough to reliably tell it apart from other boards. --- boards/esp32c3-devkit/Makefile.include | 4 ++++ boards/esp32s2-devkit/Makefile.include | 4 ++++ boards/esp32s3-devkit/Makefile.include | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/boards/esp32c3-devkit/Makefile.include b/boards/esp32c3-devkit/Makefile.include index 5bd8fde8dd..728ae3c44d 100644 --- a/boards/esp32c3-devkit/Makefile.include +++ b/boards/esp32c3-devkit/Makefile.include @@ -1 +1,5 @@ include $(RIOTBOARD)/common/esp32c3/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102N USB to UART Bridge Controller' diff --git a/boards/esp32s2-devkit/Makefile.include b/boards/esp32s2-devkit/Makefile.include index 43032c89f2..12997eb0f6 100644 --- a/boards/esp32s2-devkit/Makefile.include +++ b/boards/esp32s2-devkit/Makefile.include @@ -6,3 +6,7 @@ PSEUDOMODULES += esp32s2_saola_1 PSEUDOMODULES += esp32s2_saola_1r include $(RIOTBOARD)/common/esp32s2/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102N USB to UART Bridge Controller' diff --git a/boards/esp32s3-devkit/Makefile.include b/boards/esp32s3-devkit/Makefile.include index c1027951e0..403fb40c37 100644 --- a/boards/esp32s3-devkit/Makefile.include +++ b/boards/esp32s3-devkit/Makefile.include @@ -10,3 +10,7 @@ PSEUDOMODULES += esp32s3_devkitm_1_n8r8 PSEUDOMODULES += esp32s3_devkitm_1u_n8r8 include $(RIOTBOARD)/common/esp32s3/Makefile.include + +# Only consider TTYs matching the following filter when auto-selecting the TTY +# with `MOST_RECENT_PORT=1`. +TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102N USB to UART Bridge Controller'