File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
components/drivers/usb/cherryusb/demo Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -189,14 +189,14 @@ void usbd_rndis_data_send_done(uint32_t len)
189189#error rndis must enable RT_LWIP_DHCP
190190#endif
191191
192- #ifndef LWIP_USING_DHCPD
193- #error rndis must enable LWIP_USING_DHCPD
192+ #ifdef LWIP_USING_DHCPD
193+ #include <dhcp_server.h>
194194#endif
195195
196196#include <rtthread.h>
197197#include <rtdevice.h>
198198#include <netif/ethernetif.h>
199- #include <dhcp_server .h>
199+ #include <netdev .h>
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