Explorar el Código

Merge branch 'master' of https://gitee.com/openLuat/LuatOS

alienwalker hace 7 meses
padre
commit
e302429a84

+ 2 - 2
components/ethernet/w5500/w5500.c

@@ -689,7 +689,7 @@ static void w5500_link_state(w5500_ctrl_t *w5500, uint8_t check_state)
 {
 	Buffer_Struct tx_msg_buf = {0,0,0};
 	uint32_t remote_ip;
-	int result;
+	// int result;
 	if (w5500->link_ready != check_state)
 	{
 		LLOGD("link %d -> %d", w5500->link_ready, check_state);
@@ -704,7 +704,7 @@ static void w5500_link_state(w5500_ctrl_t *w5500, uint8_t check_state)
 				uint8_t temp[1];
 				temp[0] = MR_UDP_FARP;
 				w5500_xfer(w5500, W5500_COMMON_MR, is_write, temp, 1);
-				result = ip4_dhcp_run(&w5500->dhcp_client, NULL, &tx_msg_buf, &remote_ip);
+				ip4_dhcp_run(&w5500->dhcp_client, NULL, &tx_msg_buf, &remote_ip);
 				w5500_check_dhcp(w5500);
 				if (tx_msg_buf.Pos)
 				{

+ 5 - 1
components/network/netdrv/src/luat_netdrv.c

@@ -27,6 +27,7 @@ luat_netdrv_t* luat_netdrv_setup(luat_netdrv_conf_t *conf) {
     if (conf->id < 0 || conf->id >= NW_ADAPTER_QTY) {
         return NULL;
     }
+    int ret = 0;
     if (drvs[conf->id] == NULL) {
         // 注册新的设备?
         #ifdef __LUATOS__
@@ -47,7 +48,10 @@ luat_netdrv_t* luat_netdrv_setup(luat_netdrv_conf_t *conf) {
     else {
         if (drvs[conf->id]->boot) {
             //LLOGD("启动网络设备 %p", drvs[conf->id]);
-            drvs[conf->id]->boot(drvs[conf->id], NULL);
+            ret = drvs[conf->id]->boot(drvs[conf->id], NULL);
+            if (ret) {
+                return NULL;
+            }
         }
         return drvs[conf->id];
     }

BIN
module/Air780EPM/demo/modbus/test_core/LuatOS-SoC_V2007_Air780EPM_TEMP_20250610_150400.soc