summaryrefslogtreecommitdiff
path: root/examples/host/cdc_msc_hid/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-11-21 17:22:52 +0700
committerGitHub <[email protected]>2022-11-21 17:22:52 +0700
commit4a2e424103b0a2626a6cb464a350c68ae109cc7e (patch)
tree4a46f70fc34bc477b5c742b6f5a103322b7753f1 /examples/host/cdc_msc_hid/src
parent95fb11fcffd27a055561d2171aa99199982bb563 (diff)
parenta394273ed28bdbd9ed5cf4ba94a99204bdd841e9 (diff)
Merge pull request #1746 from hathach/host-msc-example
Add host msc explorer example
Diffstat (limited to 'examples/host/cdc_msc_hid/src')
-rw-r--r--examples/host/cdc_msc_hid/src/main.c8
-rw-r--r--examples/host/cdc_msc_hid/src/msc_app.c3
-rw-r--r--examples/host/cdc_msc_hid/src/tusb_config.h6
3 files changed, 6 insertions, 11 deletions
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c
index 664cbf035..d26e41e8d 100644
--- a/examples/host/cdc_msc_hid/src/main.c
+++ b/examples/host/cdc_msc_hid/src/main.c
@@ -54,13 +54,8 @@ int main(void)
tuh_task();
led_blinking_task();
-#if CFG_TUH_CDC
cdc_task();
-#endif
-
-#if CFG_TUH_HID
hid_app_task();
-#endif
}
return 0;
@@ -69,7 +64,6 @@ int main(void)
//--------------------------------------------------------------------+
// USB CDC
//--------------------------------------------------------------------+
-#if CFG_TUH_CDC
CFG_TUSB_MEM_SECTION static char serial_in_buffer[64] = { 0 };
// invoked ISR context
@@ -90,8 +84,6 @@ void cdc_task(void)
}
-#endif
-
//--------------------------------------------------------------------+
// TinyUSB Callbacks
//--------------------------------------------------------------------+
diff --git a/examples/host/cdc_msc_hid/src/msc_app.c b/examples/host/cdc_msc_hid/src/msc_app.c
index 77a72052d..80a5eab6f 100644
--- a/examples/host/cdc_msc_hid/src/msc_app.c
+++ b/examples/host/cdc_msc_hid/src/msc_app.c
@@ -25,8 +25,6 @@
#include "tusb.h"
-#if CFG_TUH_MSC
-
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
//--------------------------------------------------------------------+
@@ -103,4 +101,3 @@ void tuh_msc_umount_cb(uint8_t dev_addr)
// }
}
-#endif
diff --git a/examples/host/cdc_msc_hid/src/tusb_config.h b/examples/host/cdc_msc_hid/src/tusb_config.h
index 33f34315b..c515405cb 100644
--- a/examples/host/cdc_msc_hid/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid/src/tusb_config.h
@@ -34,6 +34,12 @@
// Board Specific Configuration
//--------------------------------------------------------------------+
+#if CFG_TUSB_MCU == OPT_MCU_RP2040
+// change to 1 if using pico-pio-usb as host controller for raspberry rp2040
+#define CFG_TUH_RPI_PIO_USB 0
+#define BOARD_TUH_RHPORT CFG_TUH_RPI_PIO_USB
+#endif
+
// RHPort number used for host can be defined by board.mk, default to port 0
#ifndef BOARD_TUH_RHPORT
#define BOARD_TUH_RHPORT 0