#include "los_task.h" #include "los_typedef.h" VOID Task1(VOID *arg) while (1) printf("Hello from LiteOS task\n"); LOS_TaskDelay(1000); // sleep 1 second
UINT32 main(VOID) UINT32 taskId; TSK_INIT_PARAM_S task = 0; task.pfnTaskEntry = (TSK_ENTRY_FUNC)Task1; task.uwStackSize = 2048; task.pcName = "Task1"; task.usTaskPrio = 5; LOS_TaskCreate(&taskId, &task); LOS_Start(); return 0; huawei ics lite
Compile and run on a supported board. LiteOS includes an AgentTiny module for cloud connectivity. #include "los_task
Example: MQTT publish (pseudo-code):