Exemple #1
0
/*
*********************************************************************************************************
*                                   TASK START FUNCTION
*********************************************************************************************************
*/
void TaskStart(void * pdata)
{
#if OS_CRITICAL_METHOD == 3         /* Allocate storage for CPU status register             */
  OS_CPU_SR  cpu_sr;
#endif

  pdata = pdata;

  printf("Task start!\r\n");
  OS_ENTER_CRITICAL();
  os_timer_init();
  OS_EXIT_CRITICAL();
  
#if OS_TASK_STAT_EN > 0
  OSStatInit();                   /* Initialize Statistics Task */
#endif
  
  TaskStartCreateTasks();         /* Create Tasks */
  
  for(;;) {
    printf("OS context switch counter:%d\r\n", OSCtxSwCtr);
    printf("OS CPU Usage:%d%%\r\n", OSCPUUsage);
    OSCtxSwCtr = 0;
    OSTimeDly(OS_TICKS_PER_SEC);
  }
}
Exemple #2
0
void navilnux_init(void)
{
    mem_init();
    task_init();
    msg_init();
    syscall_init();

    os_timer_init();
    gpio0_init();

    os_timer_start();
}
Exemple #3
0
/*****************************************************************************
 Function    : LOS_Start
 Description : Task start function
 Input       : None
 Output      : None
 Return      : LOS_OK on success or error code on failure
 *****************************************************************************/
LITE_OS_SEC_TEXT_INIT UINT32 LOS_Start(VOID)
{
    UINT32 uwRet;
#if (LOSCFG_BASE_CORE_TICK_HW_TIME == NO)
    uwRet = osTickStart();

    if (uwRet != LOS_OK)
    {
        PRINT_ERR("osTickStart error\n");
        return uwRet;
    }
#else
    extern int os_timer_init(void);
    uwRet = os_timer_init();
    if (uwRet != LOS_OK)
    {
        PRINT_ERR("os_timer_init error\n");
        return uwRet;
    }
#endif
    LOS_StartToRun();

    return uwRet;
}