os_stat.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. /*
  2. *********************************************************************************************************
  3. * uC/OS-III
  4. * The Real-Time Kernel
  5. *
  6. * Copyright 2009-2022 Silicon Laboratories Inc. www.silabs.com
  7. *
  8. * SPDX-License-Identifier: APACHE-2.0
  9. *
  10. * This software is subject to an open source license and is distributed by
  11. * Silicon Laboratories Inc. pursuant to the terms of the Apache License,
  12. * Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
  13. *
  14. *********************************************************************************************************
  15. */
  16. /*
  17. *********************************************************************************************************
  18. * STATISTICS MODULE
  19. *
  20. * File : os_stat.c
  21. * Version : V3.08.02
  22. *********************************************************************************************************
  23. */
  24. #define MICRIUM_SOURCE
  25. #include "os.h"
  26. #ifdef VSC_INCLUDE_SOURCE_FILE_NAMES
  27. const CPU_CHAR *os_stat__c = "$Id: $";
  28. #endif
  29. #if (OS_CFG_STAT_TASK_EN > 0u)
  30. /*
  31. ************************************************************************************************************************
  32. * RESET STATISTICS
  33. *
  34. * Description: This function is called by your application to reset the statistics.
  35. *
  36. * Argument(s): p_err is a pointer to a variable that will contain an error code returned by this function.
  37. *
  38. * OS_ERR_NONE The call succeeded
  39. *
  40. * Returns : none
  41. *
  42. * Note(s) : none
  43. ************************************************************************************************************************
  44. */
  45. void OSStatReset (OS_ERR *p_err)
  46. {
  47. #if (OS_CFG_DBG_EN > 0u)
  48. OS_TCB *p_tcb;
  49. #if (OS_MSG_EN > 0u)
  50. OS_MSG_Q *p_msg_q;
  51. #endif
  52. #if (OS_CFG_Q_EN > 0u)
  53. OS_Q *p_q;
  54. #endif
  55. #endif
  56. CPU_SR_ALLOC();
  57. #ifdef OS_SAFETY_CRITICAL
  58. if (p_err == (OS_ERR *)0) {
  59. OS_SAFETY_CRITICAL_EXCEPTION();
  60. return;
  61. }
  62. #endif
  63. CPU_CRITICAL_ENTER();
  64. #if (OS_CFG_STAT_TASK_EN > 0u)
  65. OSStatTaskCPUUsageMax = 0u;
  66. #if (OS_CFG_TS_EN > 0u)
  67. OSStatTaskTimeMax = 0u;
  68. #endif
  69. #endif
  70. #if (OS_CFG_TS_EN > 0u) && (OS_CFG_TICK_EN > 0u)
  71. OSTickTime = 0u;
  72. OSTickTimeMax = 0u;
  73. #endif
  74. #if (OS_CFG_TMR_EN > 0u)
  75. #if (OS_CFG_TS_EN > 0u)
  76. OSTmrTaskTime = 0u;
  77. OSTmrTaskTimeMax = 0u;
  78. #endif
  79. #endif
  80. #ifdef CPU_CFG_INT_DIS_MEAS_EN
  81. #if (OS_CFG_TS_EN > 0u)
  82. OSIntDisTimeMax = 0u; /* Reset the maximum interrupt disable time */
  83. CPU_StatReset(); /* Reset CPU-specific performance monitors. */
  84. #endif
  85. #endif
  86. #if (OS_CFG_SCHED_LOCK_TIME_MEAS_EN > 0u)
  87. OSSchedLockTimeMax = 0u; /* Reset the maximum scheduler lock time */
  88. #endif
  89. #if ((OS_MSG_EN > 0u) && (OS_CFG_DBG_EN > 0u))
  90. OSMsgPool.NbrUsedMax = 0u;
  91. #endif
  92. CPU_CRITICAL_EXIT();
  93. #if (OS_CFG_DBG_EN > 0u)
  94. CPU_CRITICAL_ENTER();
  95. p_tcb = OSTaskDbgListPtr;
  96. CPU_CRITICAL_EXIT();
  97. while (p_tcb != (OS_TCB *)0) { /* Reset per-Task statistics */
  98. CPU_CRITICAL_ENTER();
  99. #ifdef CPU_CFG_INT_DIS_MEAS_EN
  100. p_tcb->IntDisTimeMax = 0u;
  101. #endif
  102. #if (OS_CFG_SCHED_LOCK_TIME_MEAS_EN > 0u)
  103. p_tcb->SchedLockTimeMax = 0u;
  104. #endif
  105. #if (OS_CFG_TASK_PROFILE_EN > 0u)
  106. #if (OS_CFG_TASK_Q_EN > 0u)
  107. p_tcb->MsgQPendTimeMax = 0u;
  108. #endif
  109. p_tcb->SemPendTimeMax = 0u;
  110. p_tcb->CtxSwCtr = 0u;
  111. p_tcb->CPUUsage = 0u;
  112. p_tcb->CPUUsageMax = 0u;
  113. p_tcb->CyclesTotal = 0u;
  114. p_tcb->CyclesTotalPrev = 0u;
  115. #if (OS_CFG_TS_EN > 0u)
  116. p_tcb->CyclesStart = OS_TS_GET();
  117. #endif
  118. #endif
  119. #if (OS_CFG_TASK_Q_EN > 0u)
  120. p_msg_q = &p_tcb->MsgQ;
  121. p_msg_q->NbrEntriesMax = 0u;
  122. #endif
  123. p_tcb = p_tcb->DbgNextPtr;
  124. CPU_CRITICAL_EXIT();
  125. }
  126. #endif
  127. #if (OS_CFG_Q_EN > 0u) && (OS_CFG_DBG_EN > 0u)
  128. CPU_CRITICAL_ENTER();
  129. p_q = OSQDbgListPtr;
  130. CPU_CRITICAL_EXIT();
  131. while (p_q != (OS_Q *)0) { /* Reset message queues statistics */
  132. CPU_CRITICAL_ENTER();
  133. p_msg_q = &p_q->MsgQ;
  134. p_msg_q->NbrEntriesMax = 0u;
  135. p_q = p_q->DbgNextPtr;
  136. CPU_CRITICAL_EXIT();
  137. }
  138. #endif
  139. *p_err = OS_ERR_NONE;
  140. }
  141. /*
  142. ************************************************************************************************************************
  143. * DETERMINE THE CPU CAPACITY
  144. *
  145. * Description: This function is called by your application to establish CPU usage by first determining how high a 32-bit
  146. * counter would count to in 1/10 second if no other tasks were to execute during that time. CPU usage is
  147. * then determined by a low priority task which keeps track of this 32-bit counter every second but this
  148. * time, with other tasks running. CPU usage is determined by:
  149. *
  150. * OS_Stat_IdleCtr
  151. * CPU Usage (%) = 100 * (1 - ------------------)
  152. * OS_Stat_IdleCtrMax
  153. *
  154. * Argument(s): p_err is a pointer to a variable that will contain an error code returned by this function.
  155. *
  156. * OS_ERR_NONE The call was successful
  157. * OS_ERR_OS_NOT_RUNNING If uC/OS-III is not running yet
  158. *
  159. * Returns : none
  160. *
  161. * Note(s) : none
  162. ************************************************************************************************************************
  163. */
  164. void OSStatTaskCPUUsageInit (OS_ERR *p_err)
  165. {
  166. OS_ERR err;
  167. OS_TICK dly;
  168. CPU_SR_ALLOC();
  169. err = OS_ERR_NONE; /* Initialize err explicitly for static analysis. */
  170. #ifdef OS_SAFETY_CRITICAL
  171. if (p_err == (OS_ERR *)0) {
  172. OS_SAFETY_CRITICAL_EXCEPTION();
  173. return;
  174. }
  175. #endif
  176. #if (OS_CFG_INVALID_OS_CALLS_CHK_EN > 0u)
  177. if (OSRunning != OS_STATE_OS_RUNNING) { /* Is the kernel running? */
  178. *p_err = OS_ERR_OS_NOT_RUNNING;
  179. return;
  180. }
  181. #endif
  182. #if ((OS_CFG_TMR_EN > 0u) && (OS_CFG_TASK_SUSPEND_EN > 0u))
  183. OSTaskSuspend(&OSTmrTaskTCB, &err);
  184. if (err != OS_ERR_NONE) {
  185. *p_err = err;
  186. return;
  187. }
  188. #endif
  189. OSTimeDly(2u, /* Synchronize with clock tick */
  190. (OS_OPT )OS_OPT_TIME_DLY,
  191. (OS_ERR *)&err);
  192. if (err != OS_ERR_NONE) {
  193. *p_err = err;
  194. return;
  195. }
  196. CPU_CRITICAL_ENTER();
  197. OSStatTaskCtr = 0u; /* Clear idle counter */
  198. CPU_CRITICAL_EXIT();
  199. dly = 0u;
  200. if (OSCfg_TickRate_Hz > OSCfg_StatTaskRate_Hz) {
  201. dly = (OS_TICK)(OSCfg_TickRate_Hz / OSCfg_StatTaskRate_Hz);
  202. }
  203. if (dly == 0u) {
  204. dly = (OSCfg_TickRate_Hz / 10u);
  205. }
  206. OSTimeDly(dly, /* Determine MAX. idle counter value */
  207. OS_OPT_TIME_DLY,
  208. &err);
  209. #if ((OS_CFG_TMR_EN > 0u) && (OS_CFG_TASK_SUSPEND_EN > 0u))
  210. OSTaskResume(&OSTmrTaskTCB, &err);
  211. if (err != OS_ERR_NONE) {
  212. *p_err = err;
  213. return;
  214. }
  215. #endif
  216. CPU_CRITICAL_ENTER();
  217. #if (OS_CFG_TS_EN > 0u)
  218. OSStatTaskTimeMax = 0u;
  219. #endif
  220. OSStatTaskCtrMax = OSStatTaskCtr; /* Store maximum idle counter count */
  221. OSStatTaskRdy = OS_STATE_RDY;
  222. CPU_CRITICAL_EXIT();
  223. *p_err = OS_ERR_NONE;
  224. }
  225. /*
  226. ************************************************************************************************************************
  227. * STATISTICS TASK
  228. *
  229. * Description: This task is internal to uC/OS-III and is used to compute some statistics about the multitasking
  230. * environment. Specifically, OS_StatTask() computes the CPU usage. CPU usage is determined by:
  231. *
  232. * OSStatTaskCtr
  233. * OSStatTaskCPUUsage = 100 * (1 - ------------------) (units are in %)
  234. * OSStatTaskCtrMax
  235. *
  236. * Arguments : p_arg this pointer is not used at this time.
  237. *
  238. * Returns : none
  239. *
  240. * Note(s) : 1) This task runs at a priority level higher than the idle task.
  241. *
  242. * 2) You can disable this task by setting the configuration #define OS_CFG_STAT_TASK_EN to 0.
  243. *
  244. * 3) You MUST have at least a delay of 2/10 seconds to allow for the system to establish the maximum value
  245. * for the idle counter.
  246. *
  247. * 4) This function is INTERNAL to uC/OS-III and your application should not call it.
  248. ************************************************************************************************************************
  249. */
  250. void OS_StatTask (void *p_arg)
  251. {
  252. #if (OS_CFG_DBG_EN > 0u)
  253. #if (OS_CFG_TASK_PROFILE_EN > 0u)
  254. OS_CPU_USAGE usage;
  255. OS_CYCLES cycles_total;
  256. OS_CYCLES cycles_div;
  257. OS_CYCLES cycles_mult;
  258. OS_CYCLES cycles_max;
  259. #endif
  260. OS_TCB *p_tcb;
  261. #endif
  262. OS_TICK ctr_max;
  263. OS_TICK ctr_mult;
  264. OS_TICK ctr_div;
  265. OS_ERR err;
  266. OS_TICK dly;
  267. #if (OS_CFG_TS_EN > 0u)
  268. CPU_TS ts_start;
  269. #endif
  270. #if (OS_CFG_STAT_TASK_STK_CHK_EN > 0u) && (OS_CFG_ISR_STK_SIZE > 0u)
  271. CPU_STK *p_stk;
  272. CPU_INT32U free_stk;
  273. CPU_INT32U size_stk;
  274. #endif
  275. CPU_SR_ALLOC();
  276. (void)p_arg; /* Prevent compiler warning for not using 'p_arg' */
  277. while (OSStatTaskRdy != OS_TRUE) {
  278. OSTimeDly(2u * OSCfg_StatTaskRate_Hz, /* Wait until statistic task is ready */
  279. OS_OPT_TIME_DLY,
  280. &err);
  281. }
  282. OSStatReset(&err); /* Reset statistics */
  283. dly = (OS_TICK)0; /* Compute statistic task sleep delay */
  284. if (OSCfg_TickRate_Hz > OSCfg_StatTaskRate_Hz) {
  285. dly = (OSCfg_TickRate_Hz / OSCfg_StatTaskRate_Hz);
  286. }
  287. if (dly == 0u) {
  288. dly = (OSCfg_TickRate_Hz / 10u);
  289. }
  290. for (;;) {
  291. #if (OS_CFG_TS_EN > 0u)
  292. ts_start = OS_TS_GET();
  293. #ifdef CPU_CFG_INT_DIS_MEAS_EN
  294. OSIntDisTimeMax = CPU_IntDisMeasMaxGet();
  295. #endif
  296. #endif
  297. CPU_CRITICAL_ENTER(); /* ---------------- OVERALL CPU USAGE ----------------- */
  298. OSStatTaskCtrRun = OSStatTaskCtr; /* Obtain the of the stat counter for the past .1 second*/
  299. OSStatTaskCtr = 0u; /* Reset the stat counter for the next .1 second */
  300. CPU_CRITICAL_EXIT();
  301. if (OSStatTaskCtrMax > OSStatTaskCtrRun) { /* Compute CPU Usage with best resolution */
  302. if (OSStatTaskCtrMax < 400000u) { /* 1 to 400,000 */
  303. ctr_mult = 10000u;
  304. ctr_div = 1u;
  305. } else if (OSStatTaskCtrMax < 4000000u) { /* 400,000 to 4,000,000 */
  306. ctr_mult = 1000u;
  307. ctr_div = 10u;
  308. } else if (OSStatTaskCtrMax < 40000000u) { /* 4,000,000 to 40,000,000 */
  309. ctr_mult = 100u;
  310. ctr_div = 100u;
  311. } else if (OSStatTaskCtrMax < 400000000u) { /* 40,000,000 to 400,000,000 */
  312. ctr_mult = 10u;
  313. ctr_div = 1000u;
  314. } else { /* 400,000,000 and up */
  315. ctr_mult = 1u;
  316. ctr_div = 10000u;
  317. }
  318. ctr_max = OSStatTaskCtrMax / ctr_div;
  319. OSStatTaskCPUUsage = (OS_CPU_USAGE)((OS_TICK)10000u - ((ctr_mult * OSStatTaskCtrRun) / ctr_max));
  320. if (OSStatTaskCPUUsageMax < OSStatTaskCPUUsage) {
  321. OSStatTaskCPUUsageMax = OSStatTaskCPUUsage;
  322. }
  323. } else {
  324. OSStatTaskCPUUsage = 0u;
  325. }
  326. OSStatTaskHook(); /* Invoke user definable hook */
  327. #if (OS_CFG_DBG_EN > 0u)
  328. #if (OS_CFG_TASK_PROFILE_EN > 0u)
  329. cycles_total = 0u;
  330. CPU_CRITICAL_ENTER();
  331. p_tcb = OSTaskDbgListPtr;
  332. CPU_CRITICAL_EXIT();
  333. while (p_tcb != (OS_TCB *)0) { /* ---------------- TOTAL CYCLES COUNT ---------------- */
  334. CPU_CRITICAL_ENTER();
  335. p_tcb->CyclesTotalPrev = p_tcb->CyclesTotal; /* Save accumulated # cycles into a temp variable */
  336. p_tcb->CyclesTotal = 0u; /* Reset total cycles for task for next run */
  337. CPU_CRITICAL_EXIT();
  338. cycles_total += p_tcb->CyclesTotalPrev; /* Perform sum of all task # cycles */
  339. CPU_CRITICAL_ENTER();
  340. p_tcb = p_tcb->DbgNextPtr;
  341. CPU_CRITICAL_EXIT();
  342. }
  343. #endif
  344. #if (OS_CFG_TASK_PROFILE_EN > 0u)
  345. /* ------------ INDIVIDUAL TASK CPU USAGE ------------- */
  346. if (cycles_total > 0u) { /* 'cycles_total' scaling ... */
  347. if (cycles_total < 400000u) { /* 1 to 400,000 */
  348. cycles_mult = 10000u;
  349. cycles_div = 1u;
  350. } else if (cycles_total < 4000000u) { /* 400,000 to 4,000,000 */
  351. cycles_mult = 1000u;
  352. cycles_div = 10u;
  353. } else if (cycles_total < 40000000u) { /* 4,000,000 to 40,000,000 */
  354. cycles_mult = 100u;
  355. cycles_div = 100u;
  356. } else if (cycles_total < 400000000u) { /* 40,000,000 to 400,000,000 */
  357. cycles_mult = 10u;
  358. cycles_div = 1000u;
  359. } else { /* 400,000,000 and up */
  360. cycles_mult = 1u;
  361. cycles_div = 10000u;
  362. }
  363. cycles_max = cycles_total / cycles_div;
  364. } else {
  365. cycles_mult = 0u;
  366. cycles_max = 1u;
  367. }
  368. #endif
  369. CPU_CRITICAL_ENTER();
  370. p_tcb = OSTaskDbgListPtr;
  371. CPU_CRITICAL_EXIT();
  372. while (p_tcb != (OS_TCB *)0) {
  373. #if (OS_CFG_TASK_PROFILE_EN > 0u) /* Compute execution time of each task */
  374. usage = (OS_CPU_USAGE)(cycles_mult * p_tcb->CyclesTotalPrev / cycles_max);
  375. if (usage > 10000u) {
  376. usage = 10000u;
  377. }
  378. p_tcb->CPUUsage = usage;
  379. if (p_tcb->CPUUsageMax < usage) { /* Detect peak CPU usage */
  380. p_tcb->CPUUsageMax = usage;
  381. }
  382. #endif
  383. #if (OS_CFG_STAT_TASK_STK_CHK_EN > 0u)
  384. OSTaskStkChk( p_tcb, /* Compute stack usage of active tasks only */
  385. &p_tcb->StkFree,
  386. &p_tcb->StkUsed,
  387. &err);
  388. #endif
  389. CPU_CRITICAL_ENTER();
  390. p_tcb = p_tcb->DbgNextPtr;
  391. CPU_CRITICAL_EXIT();
  392. }
  393. #endif
  394. /*------------------ Check ISR Stack -------------------*/
  395. #if (OS_CFG_STAT_TASK_STK_CHK_EN > 0u) && (OS_CFG_ISR_STK_SIZE > 0u)
  396. free_stk = 0u;
  397. #if (CPU_CFG_STK_GROWTH == CPU_STK_GROWTH_HI_TO_LO)
  398. p_stk = OSCfg_ISRStkBasePtr; /* Start at the lowest memory and go up */
  399. #if (OS_CFG_TASK_STK_REDZONE_EN > 0u)
  400. p_stk += OS_CFG_TASK_STK_REDZONE_DEPTH;
  401. size_stk = OSCfg_ISRStkSize - OS_CFG_TASK_STK_REDZONE_DEPTH;
  402. #else
  403. size_stk = OSCfg_ISRStkSize;
  404. #endif
  405. while ((*p_stk == 0u) && (free_stk < size_stk)) { /* Compute the number of zero entries on the stk */
  406. p_stk++;
  407. free_stk++;
  408. }
  409. #else
  410. p_stk = OSCfg_ISRStkBasePtr + OSCfg_ISRStkSize - 1u;/* Start at the highest memory and go down */
  411. #if (OS_CFG_TASK_STK_REDZONE_EN > 0u)
  412. p_stk -= OS_CFG_TASK_STK_REDZONE_DEPTH;
  413. size_stk = OSCfg_ISRStkSize - OS_CFG_TASK_STK_REDZONE_DEPTH;
  414. #else
  415. size_stk = OSCfg_ISRStkSize;
  416. #endif
  417. while ((*p_stk == 0u) && (free_stk < size_stk)) { /* Compute the number of zero entries on the stk */
  418. free_stk++;
  419. p_stk--;
  420. }
  421. #endif
  422. OSISRStkFree = free_stk;
  423. OSISRStkUsed = OSCfg_ISRStkSize - free_stk;
  424. #endif
  425. if (OSStatResetFlag == OS_TRUE) { /* Check if need to reset statistics */
  426. OSStatResetFlag = OS_FALSE;
  427. OSStatReset(&err);
  428. }
  429. #if (OS_CFG_TS_EN > 0u)
  430. OSStatTaskTime = OS_TS_GET() - ts_start; /*----- Measure execution time of statistic task -------*/
  431. if (OSStatTaskTimeMax < OSStatTaskTime) {
  432. OSStatTaskTimeMax = OSStatTaskTime;
  433. }
  434. #endif
  435. OSTimeDly(dly,
  436. OS_OPT_TIME_DLY,
  437. &err);
  438. }
  439. }
  440. /*
  441. ************************************************************************************************************************
  442. * INITIALIZE THE STATISTICS
  443. *
  444. * Description: This function is called by OSInit() to initialize the statistic task.
  445. *
  446. * Argument(s): p_err is a pointer to a variable that will contain an error code returned by this function.
  447. *
  448. * OS_ERR_STAT_STK_INVALID If you specified a NULL stack pointer during configuration
  449. * OS_ERR_STAT_STK_SIZE_INVALID If you didn't specify a large enough stack.
  450. * OS_ERR_STAT_PRIO_INVALID If you specified a priority for the statistic task equal to or
  451. * lower (i.e. higher number) than the idle task.
  452. * OS_ERR_xxx An error code returned by OSTaskCreate()
  453. *
  454. * Returns : none
  455. *
  456. * Note(s) : This function is INTERNAL to uC/OS-III and your application should not call it.
  457. ************************************************************************************************************************
  458. */
  459. void OS_StatTaskInit (OS_ERR *p_err)
  460. {
  461. OSStatTaskCtr = 0u;
  462. OSStatTaskCtrRun = 0u;
  463. OSStatTaskCtrMax = 0u;
  464. OSStatTaskRdy = OS_STATE_NOT_RDY; /* Statistic task is not ready */
  465. OSStatResetFlag = OS_FALSE;
  466. #if (OS_CFG_STAT_TASK_STK_CHK_EN > 0u) && (OS_CFG_ISR_STK_SIZE > 0u)
  467. OSISRStkFree = 0u;
  468. OSISRStkUsed = 0u;
  469. #endif
  470. /* --------------- CREATE THE STAT TASK --------------- */
  471. if (OSCfg_StatTaskStkBasePtr == (CPU_STK *)0) {
  472. *p_err = OS_ERR_STAT_STK_INVALID;
  473. return;
  474. }
  475. if (OSCfg_StatTaskStkSize < OSCfg_StkSizeMin) {
  476. *p_err = OS_ERR_STAT_STK_SIZE_INVALID;
  477. return;
  478. }
  479. if (OSCfg_StatTaskPrio >= (OS_CFG_PRIO_MAX - 1u)) {
  480. *p_err = OS_ERR_STAT_PRIO_INVALID;
  481. return;
  482. }
  483. OSTaskCreate(&OSStatTaskTCB,
  484. #if (OS_CFG_DBG_EN == 0u)
  485. (CPU_CHAR *)0,
  486. #else
  487. (CPU_CHAR *)"uC/OS-III Stat Task",
  488. #endif
  489. OS_StatTask,
  490. (void *)0,
  491. OSCfg_StatTaskPrio,
  492. OSCfg_StatTaskStkBasePtr,
  493. OSCfg_StatTaskStkLimit,
  494. OSCfg_StatTaskStkSize,
  495. 0u,
  496. 0u,
  497. (void *)0,
  498. (OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR),
  499. p_err);
  500. }
  501. #endif