summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Nadler <[email protected]>2023-06-28 17:05:19 -0400
committerGitHub <[email protected]>2023-06-28 17:05:19 -0400
commitcca4be6c67e1084d57cc42a917a2c07678182c6e (patch)
tree473187bec31df1d2e3c851e4939f983c7d7c3bf2 /src
parentbd897d9c14b289861150456cb5538aac42ecc69e (diff)
parentfe77b6713bbc0c4faafaead73f11b7a7d4952976 (diff)
Merge branch 'hathach:master' into master
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt7
-rw-r--r--src/class/msc/msc_host.c2
-rw-r--r--src/common/tusb_compiler.h8
-rw-r--r--src/common/tusb_mcu.h2
-rw-r--r--src/portable/raspberrypi/rp2040/dcd_rp2040.c2
-rw-r--r--src/portable/raspberrypi/rp2040/rp2040_usb.c2
-rw-r--r--src/tinyusb.mk19
-rw-r--r--src/tusb_option.h3
8 files changed, 36 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b99c7be6e..8f7f38589 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -75,8 +75,11 @@ endfunction()
#------------------------------------
# TinyUSB as library target
#------------------------------------
-set(TINYUSB_TARGET "tinyusb")
-set(TINYUSB_CONFIG_TARGET "tinyusb_config")
+if (NOT DEFINED TINYUSB_TARGET)
+ set(TINYUSB_TARGET "tinyusb")
+endif ()
+
+set(TINYUSB_CONFIG_TARGET "${TINYUSB_TARGET}_config")
if (DEFINED TINYUSB_TARGET_PREFIX)
set(TINYUSB_TARGET "${TINYUSB_TARGET_PREFIX}${TINYUSB_TARGET}")
diff --git a/src/class/msc/msc_host.c b/src/class/msc/msc_host.c
index 138443de4..d32c0adb0 100644
--- a/src/class/msc/msc_host.c
+++ b/src/class/msc/msc_host.c
@@ -118,7 +118,7 @@ bool tuh_msc_mounted(uint8_t dev_addr)
bool tuh_msc_ready(uint8_t dev_addr)
{
msch_interface_t* p_msc = get_itf(dev_addr);
- return p_msc->mounted && !usbh_edpt_busy(dev_addr, p_msc->ep_in);
+ return p_msc->mounted && !usbh_edpt_busy(dev_addr, p_msc->ep_in) && !usbh_edpt_busy(dev_addr, p_msc->ep_out);
}
//--------------------------------------------------------------------+
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h
index 5ab56e145..6f07bdd53 100644
--- a/src/common/tusb_compiler.h
+++ b/src/common/tusb_compiler.h
@@ -128,7 +128,9 @@
#define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
#define TU_ATTR_PACKED __attribute__ ((packed))
#define TU_ATTR_WEAK __attribute__ ((weak))
- #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #ifndef TU_ATTR_ALWAYS_INLINE // allow to override for debug
+ #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #endif
#define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
#define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
#define TU_ATTR_USED __attribute__ ((used)) // Function/Variable is meant to be used
@@ -205,7 +207,9 @@
#define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
#define TU_ATTR_PACKED __attribute__ ((packed))
#define TU_ATTR_WEAK __attribute__ ((weak))
- #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #ifndef TU_ATTR_ALWAYS_INLINE // allow to override for debug
+ #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #endif
#define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
#define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
#define TU_ATTR_USED __attribute__ ((used)) // Function/Variable is meant to be used
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h
index 56525725e..9f3be78fd 100644
--- a/src/common/tusb_mcu.h
+++ b/src/common/tusb_mcu.h
@@ -97,7 +97,7 @@
#define TUP_DCD_ENDPOINT_MAX 8
#define TUP_RHPORT_HIGHSPEED 1
-#elif TU_CHECK_MCU(OPT_MCU_KINETIS_KL, OPT_MCU_KINETIS_K32)
+#elif TU_CHECK_MCU(OPT_MCU_KINETIS_KL, OPT_MCU_KINETIS_K32L)
#define TUP_USBIP_CHIPIDEA_FS
#define TUP_USBIP_CHIPIDEA_FS_KINETIS
#define TUP_DCD_ENDPOINT_MAX 16
diff --git a/src/portable/raspberrypi/rp2040/dcd_rp2040.c b/src/portable/raspberrypi/rp2040/dcd_rp2040.c
index 500a5373f..479b17b67 100644
--- a/src/portable/raspberrypi/rp2040/dcd_rp2040.c
+++ b/src/portable/raspberrypi/rp2040/dcd_rp2040.c
@@ -189,7 +189,7 @@ static void hw_endpoint_xfer(uint8_t ep_addr, uint8_t *buffer, uint16_t total_by
static void __tusb_irq_path_func(hw_handle_buff_status)(void)
{
uint32_t remaining_buffers = usb_hw->buf_status;
- pico_trace("buf_status = 0x%08x\n", remaining_buffers);
+ pico_trace("buf_status = 0x%08lx\n", remaining_buffers);
uint bit = 1u;
for (uint8_t i = 0; remaining_buffers && i < USB_MAX_ENDPOINTS * 2; i++)
{
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.c b/src/portable/raspberrypi/rp2040/rp2040_usb.c
index cf37cba07..1f49665ff 100644
--- a/src/portable/raspberrypi/rp2040/rp2040_usb.c
+++ b/src/portable/raspberrypi/rp2040/rp2040_usb.c
@@ -419,7 +419,7 @@ static bool __tusb_irq_path_func(e15_is_critical_frame_period) (struct hw_endpoi
if (delta < 800 || delta > 998) {
return false;
}
- TU_LOG(3, "Avoiding sof %u now %lu last %lu\n", (usb_hw->sof_rd + 1) & USB_SOF_RD_BITS, time_us_32(), e15_last_sof);
+ TU_LOG(3, "Avoiding sof %lu now %lu last %lu\n", (usb_hw->sof_rd + 1) & USB_SOF_RD_BITS, time_us_32(), e15_last_sof);
return true;
}
diff --git a/src/tinyusb.mk b/src/tinyusb.mk
new file mode 100644
index 000000000..85052f90f
--- /dev/null
+++ b/src/tinyusb.mk
@@ -0,0 +1,19 @@
+# C source files
+TINYUSB_SRC_C += \
+ src/tusb.c \
+ src/common/tusb_fifo.c \
+ src/device/usbd.c \
+ src/device/usbd_control.c \
+ src/typec/usbc.c \
+ src/class/audio/audio_device.c \
+ src/class/cdc/cdc_device.c \
+ src/class/dfu/dfu_device.c \
+ src/class/dfu/dfu_rt_device.c \
+ src/class/hid/hid_device.c \
+ src/class/midi/midi_device.c \
+ src/class/msc/msc_device.c \
+ src/class/net/ecm_rndis_device.c \
+ src/class/net/ncm_device.c \
+ src/class/usbtmc/usbtmc_device.c \
+ src/class/video/video_device.c \
+ src/class/vendor/vendor_device.c \
diff --git a/src/tusb_option.h b/src/tusb_option.h
index 43e67cf64..f16d8a5d0 100644
--- a/src/tusb_option.h
+++ b/src/tusb_option.h
@@ -119,7 +119,8 @@
// NXP Kinetis
#define OPT_MCU_KINETIS_KL 1200 ///< NXP KL series
-#define OPT_MCU_KINETIS_K32 1201 ///< NXP K32 series
+#define OPT_MCU_KINETIS_K32L 1201 ///< NXP K32L series
+#define OPT_MCU_KINETIS_K32 1201 ///< Alias to K32L
#define OPT_MCU_MKL25ZXX 1200 ///< Alias to KL (obsolete)
#define OPT_MCU_K32L2BXX 1201 ///< Alias to K32 (obsolete)