File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
components/drivers/usb/cherryusb/demo Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -183,20 +183,20 @@ void usbd_rndis_data_send_done(uint32_t len)
183183 rndis_tx_done = true; // suggest you to use semaphore in os
184184}
185185
186+ #include <rtthread.h>
187+ #include <rtdevice.h>
188+ #include <netif/ethernetif.h>
189+ #include <netdev.h>
190+
186191#ifdef RT_USING_LWIP
187192
188193#ifndef RT_LWIP_DHCP
189194#error rndis must enable RT_LWIP_DHCP
190195#endif
191196
192- #ifndef LWIP_USING_DHCPD
193- #error rndis must enable LWIP_USING_DHCPD
194- #endif
195-
196- #include <rtthread.h>
197- #include <rtdevice.h>
198- #include <netif/ethernetif.h>
197+ #ifdef LWIP_USING_DHCPD
199198#include <dhcp_server.h>
199+ #endif
200200
201201struct eth_device rndis_dev ;
202202
@@ -250,7 +250,14 @@ void rndis_lwip_init(void)
250250 eth_device_init (& rndis_dev , "u0" );
251251
252252 eth_device_linkchange (& rndis_dev , RT_TRUE );
253+ #ifdef LWIP_USING_DHCPD
253254 dhcpd_start ("u0" );
255+ #else
256+ struct netdev * netdev = netdev_get_by_name ("u0" );
257+ if (netdev ) {
258+ netdev_dhcp_enabled (netdev , RT_TRUE );
259+ }
260+ #endif
254261}
255262
256263void usbd_rndis_data_recv_done (uint32_t len )
You can’t perform that action at this time.
0 commit comments