检查下你新建的任务有没有加延时函数
while (1) 
{
    tls_os_time_delay (HZ/1000) 
}建议用法
// 可以在网络状态回调函数中发送信号量
static void con_net_status_changed_event (u8 status ) 
{
    switch (status) 
    {
    case NETIF_WIFI_JOIN_SUCCESS: 
        printf ("---" NETIF_WIFI_JOIN_SUCCESS\n") ; 
        break; 
    case NETIF_WIFI_JOIN_FAILED: 
        printf ("---" NETIF_WIFI_JOIN_FAILED\n") ; 
        light_off (&led0) ; 
        break; 
    case NETIF_WIFI_DISCONNECTED: 
        printf ("---" NETIF_WIFI_DISCONNECTED\n") ; 
        break; 
    case NETIF_IP_NET_UP: 
    {
        struct tls_ethif *tmpethif = tls_netif_get_ethif () ; 
        print_ipaddr (&tmpethif-" ip_addr) ; 
#if TLS_CONFIG_IPV6
        print_ipaddr (&tmpethif-" ip6_addr[0]) ; 
        print_ipaddr (&tmpethif-" ip6_addr[1]) ; 
        print_ipaddr (&tmpethif-" ip6_addr[2]) ; 
#endif
    }
    break; 
    default: 
        //printf ("UNKONWN STATE: %d\n",  status) ; 
        break; 
    }
}
void UserMain (void) 
{
    printf ("\n user task \n") ; 
    u8 auto_reconnect = 0xff; 
    tls_wifi_auto_connect_flag (WIFI_AUTO_CNT_FLAG_GET,  &auto_reconnect) ; 
    if (auto_reconnect ! = WIFI_AUTO_CNT_ON) 
    {
        auto_reconnect = WIFI_AUTO_CNT_ON; 
        tls_wifi_auto_connect_flag (WIFI_AUTO_CNT_FLAG_SET,  &auto_reconnect) ;  
        tls_wifi_connect ( (u8 *) "w600",  strlen ("w600") ,   (u8 *) "12345678",  strlen ("12345678") ) ; 
        printf ("---" WIFI_AUTO_CNT_FLAG_SET ON\n") ; 
    }
    // 注册网络状态回调
    tls_netif_add_status_event (con_net_status_changed_event) ; 
#if DEMO_CONSOLE
    CreateDemoTask () ; 
#endif
//用户自己的 task
}
这样会造成 wifi 没连上时别的功能都用不了
@Zhang 不会啊, 你别的功能另起一个线程啊, 在另外的线程中如果需要 wifi 的那就判断等 WiFi 连接上再使能一段代码, 如果线程中跟 wifi 无关那你就直接运行就好了
@Zhang 或者的话你把工程打包一下, 给个链接帮你瞅瞅
嗯, 我明天再试一下, 今天公司旁边发生火灾, 提前下班了, 所以推迟回信息, 不好意思, 随便再问下设备连上路由器后, 通过路由器上看到的设备名称是在哪里改.
@Zhang 在 ethernetif_init (struct netif *netif) 函数中
肯定啊, 你这是 RTOS 啊 上了操作系统了, 你直接 while (1) 死循环的话, 直接系统就死掉了呢, 必须加上 tls_os_time_delay 让出 CPU 使用权, 才能保证其他任务照常运行
@ZYQ 如有有代码的画也要加上 tls_os_time_delay 吗?
@Zhang 这个跟有没有代码没关系, 你建立一个任务 进行 while (1) 循环的话, 那么必须有一步是让出 CPU 使用权的, 要么调用延时 APi , 要么调用调度 API
谢谢! 应该问题就出在这了.