host msc example work well with rp2040 pio-usb
This commit is contained in:
@@ -29,4 +29,16 @@ target_include_directories(${PROJECT} PUBLIC
|
||||
family_configure_host_example(${PROJECT})
|
||||
|
||||
# For rp2040, un-comment to enable pico-pio-usb
|
||||
# family_add_pico_pio_usb(${PROJECT})
|
||||
family_add_pico_pio_usb(${PROJECT})
|
||||
|
||||
# due to warnings from Pico-PIO-USB
|
||||
target_compile_options(${PROJECT} PUBLIC
|
||||
-Wno-error=shadow
|
||||
-Wno-error=cast-align
|
||||
-Wno-error=cast-qual
|
||||
-Wno-error=redundant-decls
|
||||
-Wno-error=sign-conversion
|
||||
-Wno-error=conversion
|
||||
-Wno-error=sign-compare
|
||||
-Wno-error=unused-function
|
||||
)
|
||||
|
||||
@@ -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
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user