mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-01 05:52:32 +07:00
unbreak RNDIS examples
This commit is contained in:
@@ -256,7 +256,6 @@ static bool mg_tcpip_driver_rp2040_rmii_init(struct mg_tcpip_if *ifp) {
|
||||
(struct mg_tcpip_driver_rp2040_rmii_data *) ifp->driver_data;
|
||||
uint rx_sm_addr, tx_sm_addr;
|
||||
s_ifp = ifp;
|
||||
if (ifp->queue.len == 0) ifp->queue.len = 8192;
|
||||
rx_sm_addr = pio_add_program(pio0, &rmii_rx_program);
|
||||
tx_sm_addr = pio_add_program(pio0, &rmii_tx_program);
|
||||
smi_wr_addr = pio_add_program(pio0, &smi_wr_program);
|
||||
@@ -338,7 +337,7 @@ static void rx_irq(void) {
|
||||
}
|
||||
|
||||
static size_t mg_tcpip_driver_rp2040_rmii_rx(void *buf, size_t buflen, struct mg_tcpip_if *ifp) {
|
||||
size_t len = mg_tcpip_qread(buf, ifp);
|
||||
size_t len = 0; // mg_tcpip_qread(buf, ifp);
|
||||
if (len == 0) return 0;
|
||||
len -= 4; // exclude CRC from frame length
|
||||
uint32_t crc = crc_calc(buf, len); // calculate CRC and compare
|
||||
|
||||
@@ -56,13 +56,13 @@ int main(void) {
|
||||
mg_mgr_init(&mgr); // and attach it to the MIP interface
|
||||
mg_timer_add(&mgr, 500, MG_TIMER_REPEAT, blink_cb, &mgr);
|
||||
|
||||
struct mg_tcpip_driver driver = {.tx = usb_tx, .rx = mg_tcpip_driver_rx, .up = usb_up};
|
||||
struct mg_tcpip_driver driver = {.tx = usb_tx, .up = usb_up};
|
||||
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 0x77},
|
||||
.ip = mg_htonl(MG_U32(192, 168, 3, 1)),
|
||||
.mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||
.enable_dhcp_server = true,
|
||||
.driver = &driver,
|
||||
.queue.len = 4096};
|
||||
.recv_queue.size = 4096};
|
||||
s_ifp = &mif;
|
||||
mg_tcpip_init(&mgr, &mif);
|
||||
tusb_init();
|
||||
|
||||
@@ -88,8 +88,7 @@ int main(void) {
|
||||
|
||||
|
||||
MG_INFO(("Init TCP/IP stack ..."));
|
||||
struct mg_tcpip_driver driver = {
|
||||
.tx = usb_tx, .rx = mg_tcpip_driver_rx, .up = usb_up};
|
||||
struct mg_tcpip_driver driver = {.tx = usb_tx, .up = usb_up};
|
||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||
.ip = mg_htonl(MG_U32(192, 168, 3, 1)),
|
||||
.mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||
|
||||
@@ -88,14 +88,13 @@ int main(void) {
|
||||
|
||||
|
||||
MG_INFO(("Init TCP/IP stack ..."));
|
||||
struct mg_tcpip_driver driver = {
|
||||
.tx = usb_tx, .rx = mg_tcpip_driver_rx, .up = usb_up};
|
||||
struct mg_tcpip_driver driver = {.tx = usb_tx, .up = usb_up};
|
||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||
.ip = mg_htonl(MG_U32(192, 168, 3, 1)),
|
||||
.mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||
.enable_dhcp_server = true,
|
||||
.driver = &driver,
|
||||
.queue.len = 4096};
|
||||
.recv_queue.size = 4096};
|
||||
s_ifp = &mif;
|
||||
mg_tcpip_init(&mgr, &mif);
|
||||
mg_timer_add(&mgr, 500, MG_TIMER_REPEAT, blink_cb, &mgr);
|
||||
|
||||
Reference in New Issue
Block a user