summaryrefslogtreecommitdiff
path: root/examples/device/cdc_dual_ports
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device/cdc_dual_ports')
-rw-r--r--examples/device/cdc_dual_ports/CMakeLists.txt3
-rw-r--r--examples/device/cdc_dual_ports/src/main.c6
-rw-r--r--examples/device/cdc_dual_ports/src/tusb_config.h2
3 files changed, 6 insertions, 5 deletions
diff --git a/examples/device/cdc_dual_ports/CMakeLists.txt b/examples/device/cdc_dual_ports/CMakeLists.txt
index 5e3ec0909..94e4fc1fa 100644
--- a/examples/device/cdc_dual_ports/CMakeLists.txt
+++ b/examples/device/cdc_dual_ports/CMakeLists.txt
@@ -9,10 +9,11 @@ get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
+
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
+
project(${PROJECT})
- pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
diff --git a/examples/device/cdc_dual_ports/src/main.c b/examples/device/cdc_dual_ports/src/main.c
index 198c4252b..34cd29edd 100644
--- a/examples/device/cdc_dual_ports/src/main.c
+++ b/examples/device/cdc_dual_ports/src/main.c
@@ -63,13 +63,11 @@ static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
}
else
{
- // echo back additional ports as upper case
+ // echo back 2nd port as upper case
if (islower(buf[i])) buf[i] -= 'a' - 'A';
}
tud_cdc_n_write_char(itf, buf[i]);
-
- if ( buf[i] == '\r' ) tud_cdc_n_write_char(itf, '\n');
}
tud_cdc_n_write_flush(itf);
}
@@ -85,7 +83,7 @@ static void cdc_task(void)
{
// connected() check for DTR bit
// Most but not all terminal client set this when making connection
- if ( tud_cdc_n_connected(itf) )
+ // if ( tud_cdc_n_connected(itf) )
{
if ( tud_cdc_n_available(itf) )
{
diff --git a/examples/device/cdc_dual_ports/src/tusb_config.h b/examples/device/cdc_dual_ports/src/tusb_config.h
index 69001bdec..7db520dd1 100644
--- a/examples/device/cdc_dual_ports/src/tusb_config.h
+++ b/examples/device/cdc_dual_ports/src/tusb_config.h
@@ -104,6 +104,8 @@
#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
+// CDC Endpoint transfer buffer size, more is faster
+#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#ifdef __cplusplus
}