fix(demo): move dhcp_start in init

Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
sakumisu
2025-05-20 18:45:51 +08:00
parent 7e5713ab89
commit 45ccc810d2
2 changed files with 6 additions and 12 deletions

View File

@@ -276,7 +276,8 @@ void cdc_ecm_lwip_init(void)
eth_device_init(&cdc_ecm_dev, "u0");
eth_device_linkchange(&cdc_ecm_dev, RT_FALSE);
eth_device_linkchange(&cdc_ecm_dev, RT_TRUE);
dhcpd_start("u0");
}
void usbd_cdc_ecm_data_recv_done(uint32_t len)
@@ -439,10 +440,6 @@ static void usbd_event_handler(uint8_t busid, uint8_t event)
case USBD_EVENT_SUSPEND:
break;
case USBD_EVENT_CONFIGURED:
#ifdef RT_USING_LWIP
eth_device_linkchange(&cdc_ecm_dev, RT_TRUE);
dhcpd_start("u0");
#endif
break;
case USBD_EVENT_SET_REMOTE_WAKEUP:
break;