任务框架

static void L506_task( void const *pvParameters)
{
	L506_init();

	for( ; ; )
	{
		switch(L506Run)
		{
			case INIT:
			{
				L506_module_init();                
			}break;
			case RECEIVE:
			{
				L506_module_receive();
			}break;
			default:
			break;
                }
	}
    read_task_stack(__func__,L506Task);
}


void L506_creat_task( void )
{
    osThreadDef( L506, L506_task , osPriorityRealtime, 0, configMINIMAL_STACK_SIZE*20);
    L506Task = osThreadCreate(osThread(L506), NULL);
    configASSERT(L506Task);
}



/////////////////////////////下面5个句柄接口/////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
int8_t L506_write_data(uint8_t socketId , uint8_t *msg , uint16_t length)
{
}
uint8_t L506_init_is_ok( void )
{
}
int8_t L506_connect_server ( int8_t id , uint8_t *ip , uint16_t port)
{
}
void L506_close( void )
{
}
int8_t L506_disconnect_tcp( int8_t id )
{
}

devComType     L506=
{
  .init =       L506_creat_task,
  .isOK =       L506_init_is_ok,
  .connect =    L506_connect_server,
  .disconnect = L506_disconnect_tcp,
  .send =       L506_write_data,
  .close =      L506_close,
};


创建任务:

任务框架