#include "main.h" #include "os-app.h" #include #include #include ALIGN(RT_ALIGN_SIZE) static char thread_stack[4096]; static struct rt_thread netapp_thread; static enum { netDrvInit = 0, // 初始化网络驱动 netDrvJoin = 1, // 等待网络注册成功 netDrvSend = 2, // 发送数据 netDrvRecv = 3, // 读取数据 netDrvIdle = 4, // 读取数据 }eDrvStatus; static netWorkInterface_t interface; static void thread_entry(void * argument) { eDrvStatus = netDrvInit; rt_kprintf("%s was start!\r\n",__FILE__); // 注册网络驱动 // 注册网络驱动 while (1) { switch (eDrvStatus) { case netDrvInit: break; case netDrvJoin: break; case netDrvSend: break; case netDrvRecv: break; case netDrvIdle: break; default : break; } rt_thread_delay(10); } } void NET_APPThreadStart(void ) { /* 创建线程1,名称是thread1,入口是thread1_entry*/ rt_thread_init(&netapp_thread, "netapp_thread", thread_entry, RT_NULL, &thread_stack[0], sizeof(thread_stack), NET_APP_THREAD_PRIORITY, NET_APP_THREAD_TIMESLICE); rt_thread_startup(&netapp_thread); return ; }