会在发送时卡死
Some checks failed
Build / set-matrix (push) Has been cancelled
Build / cmake (aarch64-gcc) (push) Has been cancelled
Build / cmake (arm-gcc) (push) Has been cancelled
Build / cmake (esp-idf) (push) Has been cancelled
Build / cmake (msp430-gcc) (push) Has been cancelled
Build / cmake (riscv-gcc) (push) Has been cancelled
Build / make (aarch64-gcc) (push) Has been cancelled
Build / make (arm-gcc) (push) Has been cancelled
Build / make (msp430-gcc) (push) Has been cancelled
Build / make (riscv-gcc) (push) Has been cancelled
Build / make (rx-gcc) (push) Has been cancelled
Build / arm-iar (make) (push) Has been cancelled
Build / make-os (macos-latest) (push) Has been cancelled
Build / make-os (windows-latest) (push) Has been cancelled
Build / zephyr (push) Has been cancelled
Build / hil-build (arm-gcc) (push) Has been cancelled
Build / hil-build (esp-idf) (push) Has been cancelled
Build / hil-tinyusb (push) Has been cancelled
Build / hil-hfp (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Some checks failed
Build / set-matrix (push) Has been cancelled
Build / cmake (aarch64-gcc) (push) Has been cancelled
Build / cmake (arm-gcc) (push) Has been cancelled
Build / cmake (esp-idf) (push) Has been cancelled
Build / cmake (msp430-gcc) (push) Has been cancelled
Build / cmake (riscv-gcc) (push) Has been cancelled
Build / make (aarch64-gcc) (push) Has been cancelled
Build / make (arm-gcc) (push) Has been cancelled
Build / make (msp430-gcc) (push) Has been cancelled
Build / make (riscv-gcc) (push) Has been cancelled
Build / make (rx-gcc) (push) Has been cancelled
Build / arm-iar (make) (push) Has been cancelled
Build / make-os (macos-latest) (push) Has been cancelled
Build / make-os (windows-latest) (push) Has been cancelled
Build / zephyr (push) Has been cancelled
Build / hil-build (arm-gcc) (push) Has been cancelled
Build / hil-build (esp-idf) (push) Has been cancelled
Build / hil-tinyusb (push) Has been cancelled
Build / hil-hfp (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CFG_TUSB_DEBUG
|
#ifndef CFG_TUSB_DEBUG
|
||||||
#define CFG_TUSB_DEBUG 3
|
#define CFG_TUSB_DEBUG 0
|
||||||
#endif
|
#endif
|
||||||
#ifdef CFG_TUSB_DEBUG
|
#ifdef CFG_TUSB_DEBUG
|
||||||
#define CFG_TUSB_DEBUG_PRINTF rt_kprintf
|
#define CFG_TUSB_DEBUG_PRINTF rt_kprintf
|
||||||
|
@@ -379,7 +379,7 @@
|
|||||||
#define TCPIP_THREAD_STACKSIZE RT_LWIP_TCPTHREAD_STACKSIZE
|
#define TCPIP_THREAD_STACKSIZE RT_LWIP_TCPTHREAD_STACKSIZE
|
||||||
#else
|
#else
|
||||||
#define TCPIP_MBOX_SIZE 8
|
#define TCPIP_MBOX_SIZE 8
|
||||||
#define TCPIP_THREAD_PRIO 128
|
#define TCPIP_THREAD_PRIO 7
|
||||||
#define TCPIP_THREAD_STACKSIZE 4096
|
#define TCPIP_THREAD_STACKSIZE 4096
|
||||||
#endif
|
#endif
|
||||||
#define TCPIP_THREAD_NAME "tcpip"
|
#define TCPIP_THREAD_NAME "tcpip"
|
||||||
|
@@ -116,7 +116,7 @@ static err_t linkoutput_fn(struct netif *netif, struct pbuf *p) {
|
|||||||
tud_network_xmit(p, 0 /* unused for this example */);
|
tud_network_xmit(p, 0 /* unused for this example */);
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
return ERR_USE;
|
||||||
/* transfer execution to TinyUSB in the hopes that it will finish transmitting the prior packet */
|
/* transfer execution to TinyUSB in the hopes that it will finish transmitting the prior packet */
|
||||||
/*rc: if use rtos, this function still will be called? */
|
/*rc: if use rtos, this function still will be called? */
|
||||||
// tud_task();
|
// tud_task();
|
||||||
@@ -195,6 +195,7 @@ bool dns_query_proc(const char *name, ip4_addr_t *addr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool tud_network_recv_cb(const uint8_t *src, uint16_t size) {
|
bool tud_network_recv_cb(const uint8_t *src, uint16_t size) {
|
||||||
|
err_t err = ERR_OK;
|
||||||
struct netif *netif = &netif_data;
|
struct netif *netif = &netif_data;
|
||||||
|
|
||||||
if (size) {
|
if (size) {
|
||||||
@@ -212,8 +213,8 @@ bool tud_network_recv_cb(const uint8_t *src, uint16_t size) {
|
|||||||
// Only call pbuf_free if not Ok else it will panic with "pbuf_free: p->ref > 0"
|
// Only call pbuf_free if not Ok else it will panic with "pbuf_free: p->ref > 0"
|
||||||
// or steal it from whatever took ownership of it with undefined consequences.
|
// or steal it from whatever took ownership of it with undefined consequences.
|
||||||
// See: https://savannah.nongnu.org/patch/index.php?10121
|
// See: https://savannah.nongnu.org/patch/index.php?10121
|
||||||
if (netif->input(p, netif) != ERR_OK) {
|
if (err=netif->input(p, netif),err != ERR_OK) {
|
||||||
TU_LOG(2,"ERROR: netif input failed\n");
|
rt_kprintf("ERROR: netif input failed, err=%d\n", err);
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
}
|
}
|
||||||
// Signal tinyusb that the current frame has been processed.
|
// Signal tinyusb that the current frame has been processed.
|
||||||
@@ -290,9 +291,9 @@ void usb_irq_enable(){
|
|||||||
|
|
||||||
static void tusb_thread_entry(void *parameter)
|
static void tusb_thread_entry(void *parameter)
|
||||||
{
|
{
|
||||||
(void) parameter;
|
TU_LOG(2, "TinyUSB task started\n");
|
||||||
while (1)
|
(void) parameter;
|
||||||
{
|
while (1) {
|
||||||
#if CFG_TUH_ENABLED
|
#if CFG_TUH_ENABLED
|
||||||
tuh_task();
|
tuh_task();
|
||||||
#endif
|
#endif
|
||||||
@@ -349,9 +350,9 @@ int init_tinyusb(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUD_NCM
|
#if CFG_TUD_NCM
|
||||||
TU_LOG(2,"USB NCM network interface initialized\n");
|
rt_kprintf("USB NCM network interface initialized\n");
|
||||||
#elif CFG_TUD_ECM_RNDIS
|
#elif CFG_TUD_ECM_RNDIS
|
||||||
TU_LOG(2,"USB RNDIS/ECM network interface initialized\n");
|
rt_kprintf("USB RNDIS/ECM network interface initialized\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RT_USING_HEAP
|
#ifdef RT_USING_HEAP
|
||||||
|
@@ -64,6 +64,9 @@ extern "C" {
|
|||||||
#ifndef CFG_TUSB_DEBUG
|
#ifndef CFG_TUSB_DEBUG
|
||||||
#define CFG_TUSB_DEBUG 3
|
#define CFG_TUSB_DEBUG 3
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CFG_TUSB_DEBUG
|
||||||
|
#define CFG_TUSB_DEBUG_PRINTF rt_kprintf
|
||||||
|
#endif /* CFG_TUSB_DEBUG */
|
||||||
|
|
||||||
// Enable Device stack
|
// Enable Device stack
|
||||||
#define CFG_TUD_ENABLED 1
|
#define CFG_TUD_ENABLED 1
|
||||||
|
Reference in New Issue
Block a user