mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-04 14:45:40 +00:00
clean up
This commit is contained in:
13
.idea/debugServers/mcxa153.xml
generated
Normal file
13
.idea/debugServers/mcxa153.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="mcxa153" uniqueID="6a023429-69e6-4f8c-a592-4995cdf255db">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="MCXA153" reset-before="false" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
13
.idea/debugServers/ra6m1.xml
generated
Normal file
13
.idea/debugServers/ra6m1.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="ra6m1" uniqueID="c8cdc79a-939b-4342-92b1-d24da72d12fe">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="R7FA6M1AD" reset-before="false" frequency="16000" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
13
.idea/debugServers/ra6m5.xml
generated
Normal file
13
.idea/debugServers/ra6m5.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="ra6m5" uniqueID="19100d9f-7329-47da-b566-f9faf297f47c">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="R7FA6M5BH" reset-before="false" frequency="16000" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
13
.idea/debugServers/rt1011.xml
generated
Normal file
13
.idea/debugServers/rt1011.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="rt1011" uniqueID="e10c53c4-acf5-4a6f-a05d-32b7b042d70a">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="MIMXRT1011xxx5A" reset-before="false" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
13
.idea/debugServers/rt1170.xml
generated
Normal file
13
.idea/debugServers/rt1170.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="rt1170" uniqueID="cfc772e4-782e-49a3-99fb-b6f726e14f9d">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="MIMXRT1176xxxA_M7" reset-before="false" frequency="16000" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
13
.idea/debugServers/stm32f072.xml
generated
Normal file
13
.idea/debugServers/stm32f072.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="stm32f072" uniqueID="f5c65701-0f8d-4923-a7ea-3ee2547147ae">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="STM32F072RB" reset-before="false" frequency="12000" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
13
.idea/debugServers/stm32f303.xml
generated
Normal file
13
.idea/debugServers/stm32f303.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="stm32f303" uniqueID="1cdd63e5-1736-42be-bff3-4c48e1f169fa">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="STM32F303VC" reset-before="false" frequency="12000" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
13
.idea/debugServers/stm32l053.xml
generated
Normal file
13
.idea/debugServers/stm32l053.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="DebugServers">
|
||||
<jlink-debug-target name="stm32l053" uniqueID="51d156d7-86a6-4006-814a-ed14981d7b49">
|
||||
<debugger version="1">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
<env />
|
||||
</debugger>
|
||||
<gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
|
||||
<console port="19021" />
|
||||
<target device="STM32L053R8" reset-before="false" frequency="12000" />
|
||||
<connection extended-remote="false" port="4444" warmup-ms="500" />
|
||||
<swo />
|
||||
</jlink-debug-target>
|
||||
</component>
|
||||
@ -126,7 +126,7 @@ target_compile_definitions(tinyusb_host_base INTERFACE
|
||||
|
||||
#------------------------------------
|
||||
# Host MAX3421
|
||||
#------------------------------------1
|
||||
#------------------------------------
|
||||
add_library(tinyusb_host_max3421 INTERFACE)
|
||||
target_sources(tinyusb_host_max3421 INTERFACE
|
||||
${TOP}/src/portable/analog/max3421/hcd_max3421.c
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
#include "device/dcd.h"
|
||||
|
||||
// Current implementation force vbus detection as always present, causing device think it is always plugged into host.
|
||||
// Therefore it cannot detect disconnect event, mistaken it as suspend.
|
||||
// Therefore, it cannot detect disconnect event, mistaken it as suspend.
|
||||
// Note: won't work if change to 0 (for now)
|
||||
#define FORCE_VBUS_DETECT 1
|
||||
#define FORCE_VBUS_DETECT 1
|
||||
|
||||
#define USB_INTS_ERROR_BITS \
|
||||
(USB_INTS_ERROR_DATA_SEQ_BITS | USB_INTS_ERROR_BIT_STUFF_BITS | USB_INTS_ERROR_CRC_BITS | \
|
||||
|
||||
@ -97,7 +97,7 @@ static void __tusb_irq_path_func(hw_xfer_complete)(struct hw_endpoint *ep, xfer_
|
||||
hcd_event_xfer_complete(dev_addr, ep_addr, xferred_len, xfer_result, true);
|
||||
}
|
||||
|
||||
static void __tusb_irq_path_func(handle_hhwbuf_status_bit)(uint bit, struct hw_endpoint *ep) {
|
||||
static void __tusb_irq_path_func(handle_hwbuf_status_bit)(uint bit, struct hw_endpoint *ep) {
|
||||
usb_hw_clear->buf_status = bit;
|
||||
const bool done = hw_endpoint_xfer_continue(ep);
|
||||
if (done) {
|
||||
@ -110,11 +110,11 @@ static void __tusb_irq_path_func(handle_hwbuf_status)(void) {
|
||||
pico_trace("buf_status 0x%08lx\n", buf_status);
|
||||
|
||||
// Check EPX first
|
||||
uint bit = 0b1;
|
||||
uint32_t bit = 1u;
|
||||
if (buf_status & bit) {
|
||||
buf_status &= ~bit;
|
||||
struct hw_endpoint * ep = &epx;
|
||||
handle_hhwbuf_status_bit(bit, ep);
|
||||
handle_hwbuf_status_bit(bit, ep);
|
||||
}
|
||||
|
||||
// Check "interrupt" (asynchronous) endpoints for both IN and OUT
|
||||
@ -131,7 +131,7 @@ static void __tusb_irq_path_func(handle_hwbuf_status)(void) {
|
||||
bit = 1 << (i * 2 + j);
|
||||
if (buf_status & bit) {
|
||||
buf_status &= ~bit;
|
||||
handle_hhwbuf_status_bit(bit, &ep_pool[i]);
|
||||
handle_hwbuf_status_bit(bit, &ep_pool[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -287,39 +287,37 @@ static void hw_endpoint_init(struct hw_endpoint *ep, uint8_t dev_addr, uint8_t e
|
||||
ep->next_pid = (num == 0 ? 1u : 0u);
|
||||
ep->wMaxPacketSize = wMaxPacketSize;
|
||||
|
||||
pico_trace("hw_endpoint_init dev %d ep %02X xfer %d\n", ep->dev_addr, ep->ep_addr, ep->transfer_type);
|
||||
pico_trace("hw_endpoint_init dev %d ep %02X xfer %d\n", ep->dev_addr, ep->ep_addr, transfer_type);
|
||||
pico_trace("dev %d ep %02X setup buffer @ 0x%p\n", ep->dev_addr, ep->ep_addr, ep->hw_data_buf);
|
||||
uint dpram_offset = hw_data_offset(ep->hw_data_buf);
|
||||
// Bits 0-5 should be 0
|
||||
assert(!(dpram_offset & 0b111111));
|
||||
|
||||
// Fill in endpoint control register with buffer offset
|
||||
uint32_t ep_reg = EP_CTRL_ENABLE_BITS | EP_CTRL_INTERRUPT_PER_BUFFER |
|
||||
((uint)transfer_type << EP_CTRL_BUFFER_TYPE_LSB) | dpram_offset;
|
||||
if ( bmInterval )
|
||||
{
|
||||
ep_reg |= (uint32_t) ((bmInterval - 1) << EP_CTRL_HOST_INTERRUPT_INTERVAL_LSB);
|
||||
uint32_t ctrl_value = EP_CTRL_ENABLE_BITS | EP_CTRL_INTERRUPT_PER_BUFFER |
|
||||
((uint32_t)transfer_type << EP_CTRL_BUFFER_TYPE_LSB) | dpram_offset;
|
||||
if (bmInterval) {
|
||||
ctrl_value |= (uint32_t)((bmInterval - 1) << EP_CTRL_HOST_INTERRUPT_INTERVAL_LSB);
|
||||
}
|
||||
*hwep_ctrl_reg_host(ep) = ep_reg;
|
||||
// pico_trace("endpoint control (0x%p) <- 0x%lx\n", ep->endpoint_control, ep_reg);
|
||||
|
||||
io_rw_32 *ctrl_reg = hwep_ctrl_reg_host(ep);
|
||||
*ctrl_reg = ctrl_value;
|
||||
pico_trace("endpoint control (0x%p) <- 0x%lx\n", ctrl_reg, ctrl_value);
|
||||
ep->configured = true;
|
||||
|
||||
if ( ep != &epx )
|
||||
{
|
||||
if (ep != &epx) {
|
||||
// Endpoint has its own addr_endp and interrupt bits to be setup!
|
||||
// This is an interrupt/async endpoint. so need to set up ADDR_ENDP register with:
|
||||
// - device address
|
||||
// - endpoint number / direction
|
||||
// - preamble
|
||||
uint32_t reg = (uint32_t) (dev_addr | (num << USB_ADDR_ENDP1_ENDPOINT_LSB));
|
||||
uint32_t reg = (uint32_t)(dev_addr | (num << USB_ADDR_ENDP1_ENDPOINT_LSB));
|
||||
|
||||
if ( dir == TUSB_DIR_OUT )
|
||||
{
|
||||
if (dir == TUSB_DIR_OUT) {
|
||||
reg |= USB_ADDR_ENDP1_INTEP_DIR_BITS;
|
||||
}
|
||||
|
||||
if ( need_pre(dev_addr) )
|
||||
{
|
||||
if (need_pre(dev_addr)) {
|
||||
reg |= USB_ADDR_ENDP1_INTEP_PREAMBLE_BITS;
|
||||
}
|
||||
usb_hw->int_ep_addr_ctrl[ep->interrupt_num] = reg;
|
||||
|
||||
@ -335,7 +335,7 @@
|
||||
#define CFG_TUD_EDPT_DEDICATED_HWFIFO 1
|
||||
#endif
|
||||
|
||||
//------------- pio-usb -------------//
|
||||
//------------- Raspberry Pi -------------//
|
||||
// Enable PIO-USB software host controller
|
||||
#ifndef CFG_TUH_RPI_PIO_USB
|
||||
#define CFG_TUH_RPI_PIO_USB 0
|
||||
|
||||
Reference in New Issue
Block a user