timers.c.022i.opt_local_passes 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  1. vTimerSetTimerNumber (struct tmrTimerControl * xTimer, UBaseType_t uxTimerNumber)
  2. {
  3. <bb 2> :
  4. # DEBUG BEGIN_STMT
  5. MEM[(struct Timer_t *)xTimer_2(D)].uxTimerNumber = uxTimerNumber_3(D);
  6. return;
  7. }
  8. uxTimerGetTimerNumber (struct tmrTimerControl * xTimer)
  9. {
  10. UBaseType_t _3;
  11. <bb 2> :
  12. # DEBUG BEGIN_STMT
  13. _3 = MEM[(struct Timer_t *)xTimer_2(D)].uxTimerNumber;
  14. return _3;
  15. }
  16. xTimerPendFunctionCall (void (*PendedFunction_t) (void *, uint32_t) xFunctionToPend, void * pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait)
  17. {
  18. BaseType_t xReturn;
  19. struct DaemonTaskMessage_t xMessage;
  20. struct QueueDefinition * xTimerQueue.26_1;
  21. struct QueueDefinition * xTimerQueue.27_2;
  22. BaseType_t _14;
  23. <bb 2> :
  24. # DEBUG BEGIN_STMT
  25. # DEBUG BEGIN_STMT
  26. # DEBUG BEGIN_STMT
  27. xTimerQueue.26_1 = xTimerQueue;
  28. if (xTimerQueue.26_1 == 0B)
  29. goto <bb 3>; [INV]
  30. else
  31. goto <bb 5>; [INV]
  32. <bb 3> :
  33. # DEBUG BEGIN_STMT
  34. vPortRaiseBASEPRI ();
  35. <bb 4> :
  36. # DEBUG BEGIN_STMT
  37. # DEBUG BEGIN_STMT
  38. # DEBUG BEGIN_STMT
  39. goto <bb 4>; [INV]
  40. <bb 5> :
  41. # DEBUG BEGIN_STMT
  42. # DEBUG BEGIN_STMT
  43. xMessage.xMessageID = -1;
  44. # DEBUG BEGIN_STMT
  45. xMessage.u.xCallbackParameters.pxCallbackFunction = xFunctionToPend_5(D);
  46. # DEBUG BEGIN_STMT
  47. xMessage.u.xCallbackParameters.pvParameter1 = pvParameter1_7(D);
  48. # DEBUG BEGIN_STMT
  49. xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2_9(D);
  50. # DEBUG BEGIN_STMT
  51. xTimerQueue.27_2 = xTimerQueue;
  52. xReturn_13 = xQueueGenericSend (xTimerQueue.27_2, &xMessage, xTicksToWait_11(D), 0);
  53. # DEBUG xReturn => xReturn_13
  54. # DEBUG BEGIN_STMT
  55. # DEBUG BEGIN_STMT
  56. _14 = xReturn_13;
  57. xMessage ={v} {CLOBBER};
  58. return _14;
  59. }
  60. xTimerPendFunctionCallFromISR (void (*PendedFunction_t) (void *, uint32_t) xFunctionToPend, void * pvParameter1, uint32_t ulParameter2, BaseType_t * pxHigherPriorityTaskWoken)
  61. {
  62. BaseType_t xReturn;
  63. struct DaemonTaskMessage_t xMessage;
  64. struct QueueDefinition * xTimerQueue.25_1;
  65. BaseType_t _13;
  66. <bb 2> :
  67. # DEBUG BEGIN_STMT
  68. # DEBUG BEGIN_STMT
  69. # DEBUG BEGIN_STMT
  70. xMessage.xMessageID = -2;
  71. # DEBUG BEGIN_STMT
  72. xMessage.u.xCallbackParameters.pxCallbackFunction = xFunctionToPend_4(D);
  73. # DEBUG BEGIN_STMT
  74. xMessage.u.xCallbackParameters.pvParameter1 = pvParameter1_6(D);
  75. # DEBUG BEGIN_STMT
  76. xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2_8(D);
  77. # DEBUG BEGIN_STMT
  78. xTimerQueue.25_1 = xTimerQueue;
  79. xReturn_12 = xQueueGenericSendFromISR (xTimerQueue.25_1, &xMessage, pxHigherPriorityTaskWoken_10(D), 0);
  80. # DEBUG xReturn => xReturn_12
  81. # DEBUG BEGIN_STMT
  82. # DEBUG BEGIN_STMT
  83. _13 = xReturn_12;
  84. xMessage ={v} {CLOBBER};
  85. return _13;
  86. }
  87. vTimerSetTimerID (struct tmrTimerControl * xTimer, void * pvNewID)
  88. {
  89. struct Timer_t * const pxTimer;
  90. <bb 2> :
  91. # DEBUG BEGIN_STMT
  92. pxTimer_2 = xTimer_1(D);
  93. # DEBUG pxTimer => pxTimer_2
  94. # DEBUG BEGIN_STMT
  95. if (xTimer_1(D) == 0B)
  96. goto <bb 3>; [INV]
  97. else
  98. goto <bb 5>; [INV]
  99. <bb 3> :
  100. # DEBUG BEGIN_STMT
  101. vPortRaiseBASEPRI ();
  102. <bb 4> :
  103. # DEBUG BEGIN_STMT
  104. # DEBUG BEGIN_STMT
  105. # DEBUG BEGIN_STMT
  106. goto <bb 4>; [INV]
  107. <bb 5> :
  108. # DEBUG BEGIN_STMT
  109. # DEBUG BEGIN_STMT
  110. vPortEnterCritical ();
  111. # DEBUG BEGIN_STMT
  112. pxTimer_2->pvTimerID = pvNewID_5(D);
  113. # DEBUG BEGIN_STMT
  114. vPortExitCritical ();
  115. return;
  116. }
  117. pvTimerGetTimerID (struct tmrTimerControl * const xTimer)
  118. {
  119. void * pvReturn;
  120. struct Timer_t * const pxTimer;
  121. void * _7;
  122. <bb 2> :
  123. # DEBUG BEGIN_STMT
  124. pxTimer_2 = xTimer_1(D);
  125. # DEBUG pxTimer => pxTimer_2
  126. # DEBUG BEGIN_STMT
  127. # DEBUG BEGIN_STMT
  128. if (xTimer_1(D) == 0B)
  129. goto <bb 3>; [INV]
  130. else
  131. goto <bb 5>; [INV]
  132. <bb 3> :
  133. # DEBUG BEGIN_STMT
  134. vPortRaiseBASEPRI ();
  135. <bb 4> :
  136. # DEBUG BEGIN_STMT
  137. # DEBUG BEGIN_STMT
  138. # DEBUG BEGIN_STMT
  139. goto <bb 4>; [INV]
  140. <bb 5> :
  141. # DEBUG BEGIN_STMT
  142. # DEBUG BEGIN_STMT
  143. vPortEnterCritical ();
  144. # DEBUG BEGIN_STMT
  145. pvReturn_5 = pxTimer_2->pvTimerID;
  146. # DEBUG pvReturn => pvReturn_5
  147. # DEBUG BEGIN_STMT
  148. vPortExitCritical ();
  149. # DEBUG BEGIN_STMT
  150. _7 = pvReturn_5;
  151. return _7;
  152. }
  153. xTimerIsTimerActive (struct tmrTimerControl * xTimer)
  154. {
  155. struct Timer_t * pxTimer;
  156. BaseType_t xReturn;
  157. unsigned char _1;
  158. int _2;
  159. int _3;
  160. BaseType_t _12;
  161. <bb 2> :
  162. # DEBUG BEGIN_STMT
  163. # DEBUG BEGIN_STMT
  164. pxTimer_6 = xTimer_5(D);
  165. # DEBUG pxTimer => pxTimer_6
  166. # DEBUG BEGIN_STMT
  167. if (xTimer_5(D) == 0B)
  168. goto <bb 3>; [INV]
  169. else
  170. goto <bb 5>; [INV]
  171. <bb 3> :
  172. # DEBUG BEGIN_STMT
  173. vPortRaiseBASEPRI ();
  174. <bb 4> :
  175. # DEBUG BEGIN_STMT
  176. # DEBUG BEGIN_STMT
  177. # DEBUG BEGIN_STMT
  178. goto <bb 4>; [INV]
  179. <bb 5> :
  180. # DEBUG BEGIN_STMT
  181. # DEBUG BEGIN_STMT
  182. vPortEnterCritical ();
  183. # DEBUG BEGIN_STMT
  184. _1 = pxTimer_6->ucStatus;
  185. _2 = (int) _1;
  186. _3 = _2 & 1;
  187. if (_3 == 0)
  188. goto <bb 6>; [INV]
  189. else
  190. goto <bb 7>; [INV]
  191. <bb 6> :
  192. # DEBUG BEGIN_STMT
  193. xReturn_10 = 0;
  194. # DEBUG xReturn => xReturn_10
  195. goto <bb 8>; [INV]
  196. <bb 7> :
  197. # DEBUG BEGIN_STMT
  198. xReturn_9 = 1;
  199. # DEBUG xReturn => xReturn_9
  200. <bb 8> :
  201. # xReturn_4 = PHI <xReturn_10(6), xReturn_9(7)>
  202. # DEBUG xReturn => xReturn_4
  203. # DEBUG BEGIN_STMT
  204. vPortExitCritical ();
  205. # DEBUG BEGIN_STMT
  206. _12 = xReturn_4;
  207. return _12;
  208. }
  209. prvCheckForValidListAndQueue ()
  210. {
  211. struct QueueDefinition * xTimerQueue.17_1;
  212. struct QueueDefinition * _2;
  213. struct QueueDefinition * xTimerQueue.18_3;
  214. struct QueueDefinition * xTimerQueue.19_4;
  215. <bb 2> :
  216. # DEBUG BEGIN_STMT
  217. vPortEnterCritical ();
  218. # DEBUG BEGIN_STMT
  219. xTimerQueue.17_1 = xTimerQueue;
  220. if (xTimerQueue.17_1 == 0B)
  221. goto <bb 3>; [INV]
  222. else
  223. goto <bb 5>; [INV]
  224. <bb 3> :
  225. # DEBUG BEGIN_STMT
  226. vListInitialise (&xActiveTimerList1);
  227. # DEBUG BEGIN_STMT
  228. vListInitialise (&xActiveTimerList2);
  229. # DEBUG BEGIN_STMT
  230. pxCurrentTimerList = &xActiveTimerList1;
  231. # DEBUG BEGIN_STMT
  232. pxOverflowTimerList = &xActiveTimerList2;
  233. # DEBUG BEGIN_STMT
  234. _2 = xQueueGenericCreate (10, 16, 0);
  235. xTimerQueue = _2;
  236. # DEBUG BEGIN_STMT
  237. xTimerQueue.18_3 = xTimerQueue;
  238. if (xTimerQueue.18_3 != 0B)
  239. goto <bb 4>; [INV]
  240. else
  241. goto <bb 5>; [INV]
  242. <bb 4> :
  243. # DEBUG BEGIN_STMT
  244. xTimerQueue.19_4 = xTimerQueue;
  245. vQueueAddToRegistry (xTimerQueue.19_4, "TmrQ");
  246. <bb 5> :
  247. # DEBUG BEGIN_STMT
  248. # DEBUG BEGIN_STMT
  249. vPortExitCritical ();
  250. return;
  251. }
  252. prvSwitchTimerLists ()
  253. {
  254. struct List_t * pxTemp;
  255. TickType_t xNextExpireTime;
  256. struct List_t * pxCurrentTimerList.10_1;
  257. struct xLIST_ITEM * _2;
  258. struct List_t * pxCurrentTimerList.11_3;
  259. long unsigned int _4;
  260. struct List_t * pxOverflowTimerList.12_5;
  261. <bb 2> :
  262. # DEBUG BEGIN_STMT
  263. # DEBUG BEGIN_STMT
  264. # DEBUG BEGIN_STMT
  265. goto <bb 4>; [INV]
  266. <bb 3> :
  267. # DEBUG BEGIN_STMT
  268. pxCurrentTimerList.10_1 = pxCurrentTimerList;
  269. _2 = pxCurrentTimerList.10_1->xListEnd.pxNext;
  270. xNextExpireTime_11 = _2->xItemValue;
  271. # DEBUG xNextExpireTime => xNextExpireTime_11
  272. # DEBUG BEGIN_STMT
  273. prvProcessExpiredTimer (xNextExpireTime_11, 4294967295);
  274. <bb 4> :
  275. # DEBUG BEGIN_STMT
  276. pxCurrentTimerList.11_3 = pxCurrentTimerList;
  277. _4 ={v} pxCurrentTimerList.11_3->uxNumberOfItems;
  278. if (_4 != 0)
  279. goto <bb 3>; [INV]
  280. else
  281. goto <bb 5>; [INV]
  282. <bb 5> :
  283. # DEBUG BEGIN_STMT
  284. pxTemp_8 = pxCurrentTimerList;
  285. # DEBUG pxTemp => pxTemp_8
  286. # DEBUG BEGIN_STMT
  287. pxOverflowTimerList.12_5 = pxOverflowTimerList;
  288. pxCurrentTimerList = pxOverflowTimerList.12_5;
  289. # DEBUG BEGIN_STMT
  290. pxOverflowTimerList = pxTemp_8;
  291. return;
  292. }
  293. prvProcessReceivedCommands ()
  294. {
  295. const struct CallbackParameters_t * const pxCallback;
  296. TickType_t xTimeNow;
  297. BaseType_t xTimerListsWereSwitched;
  298. struct Timer_t * pxTimer;
  299. struct DaemonTaskMessage_t xMessage;
  300. long int _1;
  301. void (*<T68e>) (void *, uint32_t) _2;
  302. void * _3;
  303. long unsigned int _4;
  304. long int _5;
  305. struct xLIST * _6;
  306. struct ListItem_t * _7;
  307. long int _8;
  308. unsigned char _9;
  309. unsigned char _10;
  310. long unsigned int _11;
  311. long unsigned int _12;
  312. long unsigned int _13;
  313. long unsigned int _14;
  314. long int _15;
  315. unsigned char _16;
  316. int _17;
  317. int _18;
  318. long unsigned int _19;
  319. long unsigned int _20;
  320. long unsigned int _21;
  321. unsigned char _22;
  322. unsigned char _23;
  323. void (*<T689>) (struct tmrTimerControl *) _24;
  324. unsigned char _25;
  325. unsigned char _26;
  326. unsigned char _27;
  327. unsigned char _28;
  328. long unsigned int _29;
  329. long unsigned int _30;
  330. long unsigned int _31;
  331. long unsigned int _32;
  332. unsigned char _33;
  333. int _34;
  334. int _35;
  335. unsigned char _36;
  336. unsigned char _37;
  337. struct QueueDefinition * xTimerQueue.16_38;
  338. long int _39;
  339. <bb 2> :
  340. # DEBUG BEGIN_STMT
  341. # DEBUG BEGIN_STMT
  342. # DEBUG BEGIN_STMT
  343. # DEBUG BEGIN_STMT
  344. # DEBUG BEGIN_STMT
  345. goto <bb 25>; [INV]
  346. <bb 3> :
  347. # DEBUG BEGIN_STMT
  348. _1 = xMessage.xMessageID;
  349. if (_1 < 0)
  350. goto <bb 4>; [INV]
  351. else
  352. goto <bb 8>; [INV]
  353. <bb 4> :
  354. # DEBUG BEGIN_STMT
  355. pxCallback_48 = &xMessage.u.xCallbackParameters;
  356. # DEBUG pxCallback => pxCallback_48
  357. # DEBUG BEGIN_STMT
  358. if (pxCallback_48 == 0B)
  359. goto <bb 5>; [INV]
  360. else
  361. goto <bb 7>; [INV]
  362. <bb 5> :
  363. # DEBUG BEGIN_STMT
  364. vPortRaiseBASEPRI ();
  365. <bb 6> :
  366. # DEBUG BEGIN_STMT
  367. # DEBUG BEGIN_STMT
  368. # DEBUG BEGIN_STMT
  369. goto <bb 6>; [INV]
  370. <bb 7> :
  371. # DEBUG BEGIN_STMT
  372. # DEBUG BEGIN_STMT
  373. _2 = pxCallback_48->pxCallbackFunction;
  374. _3 = pxCallback_48->pvParameter1;
  375. _4 = pxCallback_48->ulParameter2;
  376. _2 (_3, _4);
  377. <bb 8> :
  378. # DEBUG BEGIN_STMT
  379. # DEBUG BEGIN_STMT
  380. _5 = xMessage.xMessageID;
  381. if (_5 >= 0)
  382. goto <bb 9>; [INV]
  383. else
  384. goto <bb 25>; [INV]
  385. <bb 9> :
  386. # DEBUG BEGIN_STMT
  387. pxTimer_51 = xMessage.u.xTimerParameters.pxTimer;
  388. # DEBUG pxTimer => pxTimer_51
  389. # DEBUG BEGIN_STMT
  390. _6 = pxTimer_51->xTimerListItem.pvContainer;
  391. if (_6 != 0B)
  392. goto <bb 10>; [INV]
  393. else
  394. goto <bb 11>; [INV]
  395. <bb 10> :
  396. # DEBUG BEGIN_STMT
  397. _7 = &pxTimer_51->xTimerListItem;
  398. uxListRemove (_7);
  399. <bb 11> :
  400. # DEBUG BEGIN_STMT
  401. # DEBUG BEGIN_STMT
  402. # DEBUG BEGIN_STMT
  403. xTimeNow_54 = prvSampleTimeNow (&xTimerListsWereSwitched);
  404. # DEBUG xTimeNow => xTimeNow_54
  405. # DEBUG BEGIN_STMT
  406. _8 = xMessage.xMessageID;
  407. switch (_8) <default: <L37> [INV], case 1 ... 2: <L11> [INV], case 3: <L21> [INV], case 4: <L23> [INV], case 5: <L28> [INV], case 6 ... 7: <L11> [INV], case 8: <L21> [INV], case 9: <L23> [INV]>
  408. <bb 12> :
  409. <L11>:
  410. # DEBUG BEGIN_STMT
  411. _9 = pxTimer_51->ucStatus;
  412. _10 = _9 | 1;
  413. pxTimer_51->ucStatus = _10;
  414. # DEBUG BEGIN_STMT
  415. _11 = xMessage.u.xTimerParameters.xMessageValue;
  416. _12 = pxTimer_51->xTimerPeriodInTicks;
  417. _13 = _11 + _12;
  418. _14 = xMessage.u.xTimerParameters.xMessageValue;
  419. _15 = prvInsertTimerInActiveList (pxTimer_51, _13, xTimeNow_54, _14);
  420. if (_15 != 0)
  421. goto <bb 13>; [INV]
  422. else
  423. goto <bb 25>; [INV]
  424. <bb 13> :
  425. # DEBUG BEGIN_STMT
  426. _16 = pxTimer_51->ucStatus;
  427. _17 = (int) _16;
  428. _18 = _17 & 4;
  429. if (_18 != 0)
  430. goto <bb 14>; [INV]
  431. else
  432. goto <bb 15>; [INV]
  433. <bb 14> :
  434. # DEBUG BEGIN_STMT
  435. _19 = xMessage.u.xTimerParameters.xMessageValue;
  436. _20 = pxTimer_51->xTimerPeriodInTicks;
  437. _21 = _19 + _20;
  438. prvReloadTimer (pxTimer_51, _21, xTimeNow_54);
  439. goto <bb 16>; [INV]
  440. <bb 15> :
  441. # DEBUG BEGIN_STMT
  442. _22 = pxTimer_51->ucStatus;
  443. _23 = _22 & 254;
  444. pxTimer_51->ucStatus = _23;
  445. <bb 16> :
  446. # DEBUG BEGIN_STMT
  447. # DEBUG BEGIN_STMT
  448. _24 = pxTimer_51->pxCallbackFunction;
  449. _24 (pxTimer_51);
  450. goto <bb 25>; [INV]
  451. <bb 17> :
  452. <L21>:
  453. # DEBUG BEGIN_STMT
  454. _25 = pxTimer_51->ucStatus;
  455. _26 = _25 & 254;
  456. pxTimer_51->ucStatus = _26;
  457. # DEBUG BEGIN_STMT
  458. goto <bb 25>; [INV]
  459. <bb 18> :
  460. <L23>:
  461. # DEBUG BEGIN_STMT
  462. _27 = pxTimer_51->ucStatus;
  463. _28 = _27 | 1;
  464. pxTimer_51->ucStatus = _28;
  465. # DEBUG BEGIN_STMT
  466. _29 = xMessage.u.xTimerParameters.xMessageValue;
  467. pxTimer_51->xTimerPeriodInTicks = _29;
  468. # DEBUG BEGIN_STMT
  469. _30 = pxTimer_51->xTimerPeriodInTicks;
  470. if (_30 == 0)
  471. goto <bb 19>; [INV]
  472. else
  473. goto <bb 21>; [INV]
  474. <bb 19> :
  475. # DEBUG BEGIN_STMT
  476. vPortRaiseBASEPRI ();
  477. <bb 20> :
  478. # DEBUG BEGIN_STMT
  479. # DEBUG BEGIN_STMT
  480. # DEBUG BEGIN_STMT
  481. goto <bb 20>; [INV]
  482. <bb 21> :
  483. # DEBUG BEGIN_STMT
  484. # DEBUG BEGIN_STMT
  485. _31 = pxTimer_51->xTimerPeriodInTicks;
  486. _32 = xTimeNow_54 + _31;
  487. prvInsertTimerInActiveList (pxTimer_51, _32, xTimeNow_54, xTimeNow_54);
  488. # DEBUG BEGIN_STMT
  489. goto <bb 25>; [INV]
  490. <bb 22> :
  491. <L28>:
  492. # DEBUG BEGIN_STMT
  493. _33 = pxTimer_51->ucStatus;
  494. _34 = (int) _33;
  495. _35 = _34 & 2;
  496. if (_35 == 0)
  497. goto <bb 23>; [INV]
  498. else
  499. goto <bb 24>; [INV]
  500. <bb 23> :
  501. # DEBUG BEGIN_STMT
  502. vPortFree (pxTimer_51);
  503. goto <bb 25>; [INV]
  504. <bb 24> :
  505. # DEBUG BEGIN_STMT
  506. _36 = pxTimer_51->ucStatus;
  507. _37 = _36 & 254;
  508. pxTimer_51->ucStatus = _37;
  509. <bb 25> :
  510. <L37>:
  511. # DEBUG BEGIN_STMT
  512. xTimerQueue.16_38 = xTimerQueue;
  513. _39 = xQueueReceive (xTimerQueue.16_38, &xMessage, 0);
  514. if (_39 != 0)
  515. goto <bb 3>; [INV]
  516. else
  517. goto <bb 26>; [INV]
  518. <bb 26> :
  519. xMessage ={v} {CLOBBER};
  520. xTimerListsWereSwitched ={v} {CLOBBER};
  521. return;
  522. }
  523. prvInsertTimerInActiveList (struct Timer_t * const pxTimer, const TickType_t xNextExpiryTime, const TickType_t xTimeNow, const TickType_t xCommandTime)
  524. {
  525. BaseType_t xProcessTimerNow;
  526. long unsigned int _1;
  527. long unsigned int _2;
  528. struct List_t * pxOverflowTimerList.14_3;
  529. struct ListItem_t * _4;
  530. struct List_t * pxCurrentTimerList.15_5;
  531. struct ListItem_t * _6;
  532. BaseType_t _21;
  533. <bb 2> :
  534. # DEBUG BEGIN_STMT
  535. xProcessTimerNow_9 = 0;
  536. # DEBUG xProcessTimerNow => xProcessTimerNow_9
  537. # DEBUG BEGIN_STMT
  538. pxTimer_11(D)->xTimerListItem.xItemValue = xNextExpiryTime_12(D);
  539. # DEBUG BEGIN_STMT
  540. pxTimer_11(D)->xTimerListItem.pvOwner = pxTimer_11(D);
  541. # DEBUG BEGIN_STMT
  542. if (xNextExpiryTime_12(D) <= xTimeNow_15(D))
  543. goto <bb 3>; [INV]
  544. else
  545. goto <bb 6>; [INV]
  546. <bb 3> :
  547. # DEBUG BEGIN_STMT
  548. _1 = xTimeNow_15(D) - xCommandTime_16(D);
  549. _2 = pxTimer_11(D)->xTimerPeriodInTicks;
  550. if (_1 >= _2)
  551. goto <bb 4>; [INV]
  552. else
  553. goto <bb 5>; [INV]
  554. <bb 4> :
  555. # DEBUG BEGIN_STMT
  556. xProcessTimerNow_20 = 1;
  557. # DEBUG xProcessTimerNow => xProcessTimerNow_20
  558. goto <bb 10>; [INV]
  559. <bb 5> :
  560. # DEBUG BEGIN_STMT
  561. pxOverflowTimerList.14_3 = pxOverflowTimerList;
  562. _4 = &pxTimer_11(D)->xTimerListItem;
  563. vListInsert (pxOverflowTimerList.14_3, _4);
  564. goto <bb 10>; [INV]
  565. <bb 6> :
  566. # DEBUG BEGIN_STMT
  567. if (xTimeNow_15(D) < xCommandTime_16(D))
  568. goto <bb 7>; [INV]
  569. else
  570. goto <bb 9>; [INV]
  571. <bb 7> :
  572. if (xNextExpiryTime_12(D) >= xCommandTime_16(D))
  573. goto <bb 8>; [INV]
  574. else
  575. goto <bb 9>; [INV]
  576. <bb 8> :
  577. # DEBUG BEGIN_STMT
  578. xProcessTimerNow_17 = 1;
  579. # DEBUG xProcessTimerNow => xProcessTimerNow_17
  580. goto <bb 10>; [INV]
  581. <bb 9> :
  582. # DEBUG BEGIN_STMT
  583. pxCurrentTimerList.15_5 = pxCurrentTimerList;
  584. _6 = &pxTimer_11(D)->xTimerListItem;
  585. vListInsert (pxCurrentTimerList.15_5, _6);
  586. <bb 10> :
  587. # xProcessTimerNow_7 = PHI <xProcessTimerNow_9(5), xProcessTimerNow_17(8), xProcessTimerNow_9(9), xProcessTimerNow_20(4)>
  588. # DEBUG xProcessTimerNow => xProcessTimerNow_7
  589. # DEBUG BEGIN_STMT
  590. _21 = xProcessTimerNow_7;
  591. return _21;
  592. }
  593. prvSampleTimeNow (BaseType_t * const pxTimerListsWereSwitched)
  594. {
  595. static TickType_t xLastTime = 0;
  596. TickType_t xTimeNow;
  597. long unsigned int xLastTime.9_1;
  598. TickType_t _11;
  599. <bb 2> :
  600. # DEBUG BEGIN_STMT
  601. # DEBUG BEGIN_STMT
  602. # DEBUG BEGIN_STMT
  603. xTimeNow_5 = xTaskGetTickCount ();
  604. # DEBUG xTimeNow => xTimeNow_5
  605. # DEBUG BEGIN_STMT
  606. xLastTime.9_1 = xLastTime;
  607. if (xTimeNow_5 < xLastTime.9_1)
  608. goto <bb 3>; [INV]
  609. else
  610. goto <bb 4>; [INV]
  611. <bb 3> :
  612. # DEBUG BEGIN_STMT
  613. prvSwitchTimerLists ();
  614. # DEBUG BEGIN_STMT
  615. *pxTimerListsWereSwitched_6(D) = 1;
  616. goto <bb 5>; [INV]
  617. <bb 4> :
  618. # DEBUG BEGIN_STMT
  619. *pxTimerListsWereSwitched_6(D) = 0;
  620. <bb 5> :
  621. # DEBUG BEGIN_STMT
  622. xLastTime = xTimeNow_5;
  623. # DEBUG BEGIN_STMT
  624. _11 = xTimeNow_5;
  625. return _11;
  626. }
  627. prvGetNextExpireTime (BaseType_t * const pxListWasEmpty)
  628. {
  629. TickType_t xNextExpireTime;
  630. struct List_t * pxCurrentTimerList.3_1;
  631. long unsigned int _2;
  632. long int _3;
  633. struct List_t * pxCurrentTimerList.4_4;
  634. struct xLIST_ITEM * _5;
  635. long int iftmp.2_7;
  636. long int iftmp.2_9;
  637. long int iftmp.2_10;
  638. TickType_t _15;
  639. <bb 2> :
  640. # DEBUG BEGIN_STMT
  641. # DEBUG BEGIN_STMT
  642. pxCurrentTimerList.3_1 = pxCurrentTimerList;
  643. _2 ={v} pxCurrentTimerList.3_1->uxNumberOfItems;
  644. if (_2 == 0)
  645. goto <bb 3>; [INV]
  646. else
  647. goto <bb 4>; [INV]
  648. <bb 3> :
  649. iftmp.2_10 = 1;
  650. goto <bb 5>; [INV]
  651. <bb 4> :
  652. iftmp.2_9 = 0;
  653. <bb 5> :
  654. # iftmp.2_7 = PHI <iftmp.2_10(3), iftmp.2_9(4)>
  655. *pxListWasEmpty_11(D) = iftmp.2_7;
  656. # DEBUG BEGIN_STMT
  657. _3 = *pxListWasEmpty_11(D);
  658. if (_3 == 0)
  659. goto <bb 6>; [INV]
  660. else
  661. goto <bb 7>; [INV]
  662. <bb 6> :
  663. # DEBUG BEGIN_STMT
  664. pxCurrentTimerList.4_4 = pxCurrentTimerList;
  665. _5 = pxCurrentTimerList.4_4->xListEnd.pxNext;
  666. xNextExpireTime_14 = _5->xItemValue;
  667. # DEBUG xNextExpireTime => xNextExpireTime_14
  668. goto <bb 8>; [INV]
  669. <bb 7> :
  670. # DEBUG BEGIN_STMT
  671. xNextExpireTime_13 = 0;
  672. # DEBUG xNextExpireTime => xNextExpireTime_13
  673. <bb 8> :
  674. # xNextExpireTime_6 = PHI <xNextExpireTime_14(6), xNextExpireTime_13(7)>
  675. # DEBUG xNextExpireTime => xNextExpireTime_6
  676. # DEBUG BEGIN_STMT
  677. _15 = xNextExpireTime_6;
  678. return _15;
  679. }
  680. prvProcessTimerOrBlockTask (const TickType_t xNextExpireTime, BaseType_t xListWasEmpty)
  681. {
  682. BaseType_t xTimerListsWereSwitched;
  683. TickType_t xTimeNow;
  684. long int xTimerListsWereSwitched.5_1;
  685. struct List_t * pxOverflowTimerList.7_2;
  686. long unsigned int _3;
  687. struct QueueDefinition * xTimerQueue.8_4;
  688. long unsigned int _5;
  689. long int _6;
  690. volatile uint32_t * _7;
  691. long int iftmp.6_9;
  692. long int iftmp.6_20;
  693. long int iftmp.6_21;
  694. <bb 2> :
  695. # DEBUG BEGIN_STMT
  696. # DEBUG BEGIN_STMT
  697. # DEBUG BEGIN_STMT
  698. vTaskSuspendAll ();
  699. # DEBUG BEGIN_STMT
  700. xTimeNow_14 = prvSampleTimeNow (&xTimerListsWereSwitched);
  701. # DEBUG xTimeNow => xTimeNow_14
  702. # DEBUG BEGIN_STMT
  703. xTimerListsWereSwitched.5_1 = xTimerListsWereSwitched;
  704. if (xTimerListsWereSwitched.5_1 == 0)
  705. goto <bb 3>; [INV]
  706. else
  707. goto <bb 13>; [INV]
  708. <bb 3> :
  709. # DEBUG BEGIN_STMT
  710. if (xListWasEmpty_16(D) == 0)
  711. goto <bb 4>; [INV]
  712. else
  713. goto <bb 6>; [INV]
  714. <bb 4> :
  715. if (xNextExpireTime_17(D) <= xTimeNow_14)
  716. goto <bb 5>; [INV]
  717. else
  718. goto <bb 6>; [INV]
  719. <bb 5> :
  720. # DEBUG BEGIN_STMT
  721. xTaskResumeAll ();
  722. # DEBUG BEGIN_STMT
  723. prvProcessExpiredTimer (xNextExpireTime_17(D), xTimeNow_14);
  724. goto <bb 14>; [INV]
  725. <bb 6> :
  726. # DEBUG BEGIN_STMT
  727. if (xListWasEmpty_16(D) != 0)
  728. goto <bb 7>; [INV]
  729. else
  730. goto <bb 11>; [INV]
  731. <bb 7> :
  732. # DEBUG BEGIN_STMT
  733. pxOverflowTimerList.7_2 = pxOverflowTimerList;
  734. _3 ={v} pxOverflowTimerList.7_2->uxNumberOfItems;
  735. if (_3 == 0)
  736. goto <bb 8>; [INV]
  737. else
  738. goto <bb 9>; [INV]
  739. <bb 8> :
  740. iftmp.6_21 = 1;
  741. goto <bb 10>; [INV]
  742. <bb 9> :
  743. iftmp.6_20 = 0;
  744. <bb 10> :
  745. # iftmp.6_9 = PHI <iftmp.6_21(8), iftmp.6_20(9)>
  746. xListWasEmpty_22 = iftmp.6_9;
  747. # DEBUG xListWasEmpty => xListWasEmpty_22
  748. <bb 11> :
  749. # xListWasEmpty_8 = PHI <xListWasEmpty_16(D)(6), xListWasEmpty_22(10)>
  750. # DEBUG xListWasEmpty => xListWasEmpty_8
  751. # DEBUG BEGIN_STMT
  752. xTimerQueue.8_4 = xTimerQueue;
  753. _5 = xNextExpireTime_17(D) - xTimeNow_14;
  754. vQueueWaitForMessageRestricted (xTimerQueue.8_4, _5, xListWasEmpty_8);
  755. # DEBUG BEGIN_STMT
  756. _6 = xTaskResumeAll ();
  757. if (_6 == 0)
  758. goto <bb 12>; [INV]
  759. else
  760. goto <bb 14>; [INV]
  761. <bb 12> :
  762. # DEBUG BEGIN_STMT
  763. _7 = 3758157060B;
  764. *_7 ={v} 268435456;
  765. # DEBUG BEGIN_STMT
  766. __asm__ __volatile__("dsb" : : : "memory");
  767. # DEBUG BEGIN_STMT
  768. __asm__ __volatile__("isb");
  769. # DEBUG BEGIN_STMT
  770. goto <bb 14>; [INV]
  771. <bb 13> :
  772. # DEBUG BEGIN_STMT
  773. xTaskResumeAll ();
  774. <bb 14> :
  775. xTimerListsWereSwitched ={v} {CLOBBER};
  776. return;
  777. }
  778. prvTimerTask (void * pvParameters)
  779. {
  780. BaseType_t xListWasEmpty;
  781. TickType_t xNextExpireTime;
  782. long int xListWasEmpty.1_1;
  783. <bb 2> :
  784. # DEBUG BEGIN_STMT
  785. # DEBUG BEGIN_STMT
  786. # DEBUG BEGIN_STMT
  787. # DEBUG BEGIN_STMT
  788. # DEBUG BEGIN_STMT
  789. xNextExpireTime_5 = prvGetNextExpireTime (&xListWasEmpty);
  790. # DEBUG xNextExpireTime => xNextExpireTime_5
  791. # DEBUG BEGIN_STMT
  792. xListWasEmpty.1_1 = xListWasEmpty;
  793. prvProcessTimerOrBlockTask (xNextExpireTime_5, xListWasEmpty.1_1);
  794. # DEBUG BEGIN_STMT
  795. prvProcessReceivedCommands ();
  796. # DEBUG BEGIN_STMT
  797. goto <bb 2>; [INV]
  798. }
  799. prvProcessExpiredTimer (const TickType_t xNextExpireTime, const TickType_t xTimeNow)
  800. {
  801. struct Timer_t * const pxTimer;
  802. struct List_t * pxCurrentTimerList.13_1;
  803. struct xLIST_ITEM * _2;
  804. struct ListItem_t * _3;
  805. unsigned char _4;
  806. int _5;
  807. int _6;
  808. unsigned char _7;
  809. unsigned char _8;
  810. void (*<T689>) (struct tmrTimerControl *) _9;
  811. <bb 2> :
  812. # DEBUG BEGIN_STMT
  813. pxCurrentTimerList.13_1 = pxCurrentTimerList;
  814. _2 = pxCurrentTimerList.13_1->xListEnd.pxNext;
  815. pxTimer_12 = _2->pvOwner;
  816. # DEBUG pxTimer => pxTimer_12
  817. # DEBUG BEGIN_STMT
  818. _3 = &pxTimer_12->xTimerListItem;
  819. uxListRemove (_3);
  820. # DEBUG BEGIN_STMT
  821. _4 = pxTimer_12->ucStatus;
  822. _5 = (int) _4;
  823. _6 = _5 & 4;
  824. if (_6 != 0)
  825. goto <bb 3>; [INV]
  826. else
  827. goto <bb 4>; [INV]
  828. <bb 3> :
  829. # DEBUG BEGIN_STMT
  830. prvReloadTimer (pxTimer_12, xNextExpireTime_15(D), xTimeNow_16(D));
  831. goto <bb 5>; [INV]
  832. <bb 4> :
  833. # DEBUG BEGIN_STMT
  834. _7 = pxTimer_12->ucStatus;
  835. _8 = _7 & 254;
  836. pxTimer_12->ucStatus = _8;
  837. <bb 5> :
  838. # DEBUG BEGIN_STMT
  839. # DEBUG BEGIN_STMT
  840. _9 = pxTimer_12->pxCallbackFunction;
  841. _9 (pxTimer_12);
  842. return;
  843. }
  844. prvReloadTimer (struct Timer_t * const pxTimer, TickType_t xExpiredTime, const TickType_t xTimeNow)
  845. {
  846. long unsigned int _1;
  847. void (*<T689>) (struct tmrTimerControl *) _2;
  848. long unsigned int _3;
  849. long unsigned int _4;
  850. long int _5;
  851. <bb 2> :
  852. # DEBUG BEGIN_STMT
  853. goto <bb 4>; [INV]
  854. <bb 3> :
  855. # DEBUG BEGIN_STMT
  856. _1 = pxTimer_10(D)->xTimerPeriodInTicks;
  857. xExpiredTime_13 = xExpiredTime_6 + _1;
  858. # DEBUG xExpiredTime => xExpiredTime_13
  859. # DEBUG BEGIN_STMT
  860. # DEBUG BEGIN_STMT
  861. _2 = pxTimer_10(D)->pxCallbackFunction;
  862. _2 (pxTimer_10(D));
  863. <bb 4> :
  864. # xExpiredTime_6 = PHI <xExpiredTime_8(D)(2), xExpiredTime_13(3)>
  865. # DEBUG xExpiredTime => xExpiredTime_6
  866. # DEBUG BEGIN_STMT
  867. _3 = pxTimer_10(D)->xTimerPeriodInTicks;
  868. _4 = xExpiredTime_6 + _3;
  869. _5 = prvInsertTimerInActiveList (pxTimer_10(D), _4, xTimeNow_11(D), xExpiredTime_6);
  870. if (_5 != 0)
  871. goto <bb 3>; [INV]
  872. else
  873. goto <bb 5>; [INV]
  874. <bb 5> :
  875. return;
  876. }
  877. pcTimerGetName (struct tmrTimerControl * xTimer)
  878. {
  879. struct Timer_t * pxTimer;
  880. const char * _4;
  881. <bb 2> :
  882. # DEBUG BEGIN_STMT
  883. pxTimer_2 = xTimer_1(D);
  884. # DEBUG pxTimer => pxTimer_2
  885. # DEBUG BEGIN_STMT
  886. if (xTimer_1(D) == 0B)
  887. goto <bb 3>; [INV]
  888. else
  889. goto <bb 5>; [INV]
  890. <bb 3> :
  891. # DEBUG BEGIN_STMT
  892. vPortRaiseBASEPRI ();
  893. <bb 4> :
  894. # DEBUG BEGIN_STMT
  895. # DEBUG BEGIN_STMT
  896. # DEBUG BEGIN_STMT
  897. goto <bb 4>; [INV]
  898. <bb 5> :
  899. # DEBUG BEGIN_STMT
  900. # DEBUG BEGIN_STMT
  901. _4 = pxTimer_2->pcTimerName;
  902. return _4;
  903. }
  904. xTimerGetExpiryTime (struct tmrTimerControl * xTimer)
  905. {
  906. TickType_t xReturn;
  907. struct Timer_t * pxTimer;
  908. TickType_t _5;
  909. <bb 2> :
  910. # DEBUG BEGIN_STMT
  911. pxTimer_2 = xTimer_1(D);
  912. # DEBUG pxTimer => pxTimer_2
  913. # DEBUG BEGIN_STMT
  914. # DEBUG BEGIN_STMT
  915. if (xTimer_1(D) == 0B)
  916. goto <bb 3>; [INV]
  917. else
  918. goto <bb 5>; [INV]
  919. <bb 3> :
  920. # DEBUG BEGIN_STMT
  921. vPortRaiseBASEPRI ();
  922. <bb 4> :
  923. # DEBUG BEGIN_STMT
  924. # DEBUG BEGIN_STMT
  925. # DEBUG BEGIN_STMT
  926. goto <bb 4>; [INV]
  927. <bb 5> :
  928. # DEBUG BEGIN_STMT
  929. # DEBUG BEGIN_STMT
  930. xReturn_4 = pxTimer_2->xTimerListItem.xItemValue;
  931. # DEBUG xReturn => xReturn_4
  932. # DEBUG BEGIN_STMT
  933. _5 = xReturn_4;
  934. return _5;
  935. }
  936. uxTimerGetReloadMode (struct tmrTimerControl * xTimer)
  937. {
  938. UBaseType_t uxReturn;
  939. struct Timer_t * pxTimer;
  940. unsigned char _1;
  941. int _2;
  942. int _3;
  943. UBaseType_t _12;
  944. <bb 2> :
  945. # DEBUG BEGIN_STMT
  946. pxTimer_6 = xTimer_5(D);
  947. # DEBUG pxTimer => pxTimer_6
  948. # DEBUG BEGIN_STMT
  949. # DEBUG BEGIN_STMT
  950. if (xTimer_5(D) == 0B)
  951. goto <bb 3>; [INV]
  952. else
  953. goto <bb 5>; [INV]
  954. <bb 3> :
  955. # DEBUG BEGIN_STMT
  956. vPortRaiseBASEPRI ();
  957. <bb 4> :
  958. # DEBUG BEGIN_STMT
  959. # DEBUG BEGIN_STMT
  960. # DEBUG BEGIN_STMT
  961. goto <bb 4>; [INV]
  962. <bb 5> :
  963. # DEBUG BEGIN_STMT
  964. # DEBUG BEGIN_STMT
  965. vPortEnterCritical ();
  966. # DEBUG BEGIN_STMT
  967. _1 = pxTimer_6->ucStatus;
  968. _2 = (int) _1;
  969. _3 = _2 & 4;
  970. if (_3 == 0)
  971. goto <bb 6>; [INV]
  972. else
  973. goto <bb 7>; [INV]
  974. <bb 6> :
  975. # DEBUG BEGIN_STMT
  976. uxReturn_10 = 0;
  977. # DEBUG uxReturn => uxReturn_10
  978. goto <bb 8>; [INV]
  979. <bb 7> :
  980. # DEBUG BEGIN_STMT
  981. uxReturn_9 = 1;
  982. # DEBUG uxReturn => uxReturn_9
  983. <bb 8> :
  984. # uxReturn_4 = PHI <uxReturn_10(6), uxReturn_9(7)>
  985. # DEBUG uxReturn => uxReturn_4
  986. # DEBUG BEGIN_STMT
  987. vPortExitCritical ();
  988. # DEBUG BEGIN_STMT
  989. _12 = uxReturn_4;
  990. return _12;
  991. }
  992. vTimerSetReloadMode (struct tmrTimerControl * xTimer, const UBaseType_t uxAutoReload)
  993. {
  994. struct Timer_t * pxTimer;
  995. unsigned char _1;
  996. unsigned char _2;
  997. unsigned char _3;
  998. unsigned char _4;
  999. <bb 2> :
  1000. # DEBUG BEGIN_STMT
  1001. pxTimer_7 = xTimer_6(D);
  1002. # DEBUG pxTimer => pxTimer_7
  1003. # DEBUG BEGIN_STMT
  1004. if (xTimer_6(D) == 0B)
  1005. goto <bb 3>; [INV]
  1006. else
  1007. goto <bb 5>; [INV]
  1008. <bb 3> :
  1009. # DEBUG BEGIN_STMT
  1010. vPortRaiseBASEPRI ();
  1011. <bb 4> :
  1012. # DEBUG BEGIN_STMT
  1013. # DEBUG BEGIN_STMT
  1014. # DEBUG BEGIN_STMT
  1015. goto <bb 4>; [INV]
  1016. <bb 5> :
  1017. # DEBUG BEGIN_STMT
  1018. # DEBUG BEGIN_STMT
  1019. vPortEnterCritical ();
  1020. # DEBUG BEGIN_STMT
  1021. if (uxAutoReload_10(D) != 0)
  1022. goto <bb 6>; [INV]
  1023. else
  1024. goto <bb 7>; [INV]
  1025. <bb 6> :
  1026. # DEBUG BEGIN_STMT
  1027. _1 = pxTimer_7->ucStatus;
  1028. _2 = _1 | 4;
  1029. pxTimer_7->ucStatus = _2;
  1030. goto <bb 8>; [INV]
  1031. <bb 7> :
  1032. # DEBUG BEGIN_STMT
  1033. _3 = pxTimer_7->ucStatus;
  1034. _4 = _3 & 251;
  1035. pxTimer_7->ucStatus = _4;
  1036. <bb 8> :
  1037. # DEBUG BEGIN_STMT
  1038. vPortExitCritical ();
  1039. return;
  1040. }
  1041. xTimerGetPeriod (struct tmrTimerControl * xTimer)
  1042. {
  1043. struct Timer_t * pxTimer;
  1044. TickType_t _4;
  1045. <bb 2> :
  1046. # DEBUG BEGIN_STMT
  1047. pxTimer_2 = xTimer_1(D);
  1048. # DEBUG pxTimer => pxTimer_2
  1049. # DEBUG BEGIN_STMT
  1050. if (xTimer_1(D) == 0B)
  1051. goto <bb 3>; [INV]
  1052. else
  1053. goto <bb 5>; [INV]
  1054. <bb 3> :
  1055. # DEBUG BEGIN_STMT
  1056. vPortRaiseBASEPRI ();
  1057. <bb 4> :
  1058. # DEBUG BEGIN_STMT
  1059. # DEBUG BEGIN_STMT
  1060. # DEBUG BEGIN_STMT
  1061. goto <bb 4>; [INV]
  1062. <bb 5> :
  1063. # DEBUG BEGIN_STMT
  1064. # DEBUG BEGIN_STMT
  1065. _4 = pxTimer_2->xTimerPeriodInTicks;
  1066. return _4;
  1067. }
  1068. xTimerGetTimerDaemonTaskHandle ()
  1069. {
  1070. struct tskTaskControlBlock * xTimerTaskHandle.24_1;
  1071. struct tskTaskControlBlock * _3;
  1072. <bb 2> :
  1073. # DEBUG BEGIN_STMT
  1074. xTimerTaskHandle.24_1 = xTimerTaskHandle;
  1075. if (xTimerTaskHandle.24_1 == 0B)
  1076. goto <bb 3>; [INV]
  1077. else
  1078. goto <bb 5>; [INV]
  1079. <bb 3> :
  1080. # DEBUG BEGIN_STMT
  1081. vPortRaiseBASEPRI ();
  1082. <bb 4> :
  1083. # DEBUG BEGIN_STMT
  1084. # DEBUG BEGIN_STMT
  1085. # DEBUG BEGIN_STMT
  1086. goto <bb 4>; [INV]
  1087. <bb 5> :
  1088. # DEBUG BEGIN_STMT
  1089. # DEBUG BEGIN_STMT
  1090. _3 = xTimerTaskHandle;
  1091. return _3;
  1092. }
  1093. xTimerGenericCommand (struct tmrTimerControl * xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait)
  1094. {
  1095. struct DaemonTaskMessage_t xMessage;
  1096. BaseType_t xReturn;
  1097. struct QueueDefinition * xTimerQueue.20_1;
  1098. long int _2;
  1099. struct QueueDefinition * xTimerQueue.21_3;
  1100. struct QueueDefinition * xTimerQueue.22_4;
  1101. struct QueueDefinition * xTimerQueue.23_5;
  1102. BaseType_t _25;
  1103. <bb 2> :
  1104. # DEBUG BEGIN_STMT
  1105. xReturn_8 = 0;
  1106. # DEBUG xReturn => xReturn_8
  1107. # DEBUG BEGIN_STMT
  1108. # DEBUG BEGIN_STMT
  1109. if (xTimer_9(D) == 0B)
  1110. goto <bb 3>; [INV]
  1111. else
  1112. goto <bb 5>; [INV]
  1113. <bb 3> :
  1114. # DEBUG BEGIN_STMT
  1115. vPortRaiseBASEPRI ();
  1116. <bb 4> :
  1117. # DEBUG BEGIN_STMT
  1118. # DEBUG BEGIN_STMT
  1119. # DEBUG BEGIN_STMT
  1120. goto <bb 4>; [INV]
  1121. <bb 5> :
  1122. # DEBUG BEGIN_STMT
  1123. # DEBUG BEGIN_STMT
  1124. xTimerQueue.20_1 = xTimerQueue;
  1125. if (xTimerQueue.20_1 != 0B)
  1126. goto <bb 6>; [INV]
  1127. else
  1128. goto <bb 11>; [INV]
  1129. <bb 6> :
  1130. # DEBUG BEGIN_STMT
  1131. xMessage.xMessageID = xCommandID_11(D);
  1132. # DEBUG BEGIN_STMT
  1133. xMessage.u.xTimerParameters.xMessageValue = xOptionalValue_13(D);
  1134. # DEBUG BEGIN_STMT
  1135. xMessage.u.xTimerParameters.pxTimer = xTimer_9(D);
  1136. # DEBUG BEGIN_STMT
  1137. if (xCommandID_11(D) <= 5)
  1138. goto <bb 7>; [INV]
  1139. else
  1140. goto <bb 10>; [INV]
  1141. <bb 7> :
  1142. # DEBUG BEGIN_STMT
  1143. _2 = xTaskGetSchedulerState ();
  1144. if (_2 == 2)
  1145. goto <bb 8>; [INV]
  1146. else
  1147. goto <bb 9>; [INV]
  1148. <bb 8> :
  1149. # DEBUG BEGIN_STMT
  1150. xTimerQueue.21_3 = xTimerQueue;
  1151. xReturn_24 = xQueueGenericSend (xTimerQueue.21_3, &xMessage, xTicksToWait_22(D), 0);
  1152. # DEBUG xReturn => xReturn_24
  1153. goto <bb 11>; [INV]
  1154. <bb 9> :
  1155. # DEBUG BEGIN_STMT
  1156. xTimerQueue.22_4 = xTimerQueue;
  1157. xReturn_21 = xQueueGenericSend (xTimerQueue.22_4, &xMessage, 0, 0);
  1158. # DEBUG xReturn => xReturn_21
  1159. goto <bb 11>; [INV]
  1160. <bb 10> :
  1161. # DEBUG BEGIN_STMT
  1162. xTimerQueue.23_5 = xTimerQueue;
  1163. xReturn_18 = xQueueGenericSendFromISR (xTimerQueue.23_5, &xMessage, pxHigherPriorityTaskWoken_16(D), 0);
  1164. # DEBUG xReturn => xReturn_18
  1165. <bb 11> :
  1166. # xReturn_6 = PHI <xReturn_8(5), xReturn_18(10), xReturn_21(9), xReturn_24(8)>
  1167. # DEBUG xReturn => xReturn_6
  1168. # DEBUG BEGIN_STMT
  1169. # DEBUG BEGIN_STMT
  1170. _25 = xReturn_6;
  1171. xMessage ={v} {CLOBBER};
  1172. return _25;
  1173. }
  1174. prvInitialiseNewTimer (const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, void (*TimerCallbackFunction_t) (struct tmrTimerControl *) pxCallbackFunction, struct Timer_t * pxNewTimer)
  1175. {
  1176. struct ListItem_t * _1;
  1177. unsigned char _2;
  1178. unsigned char _3;
  1179. <bb 2> :
  1180. # DEBUG BEGIN_STMT
  1181. if (xTimerPeriodInTicks_5(D) == 0)
  1182. goto <bb 3>; [INV]
  1183. else
  1184. goto <bb 5>; [INV]
  1185. <bb 3> :
  1186. # DEBUG BEGIN_STMT
  1187. vPortRaiseBASEPRI ();
  1188. <bb 4> :
  1189. # DEBUG BEGIN_STMT
  1190. # DEBUG BEGIN_STMT
  1191. # DEBUG BEGIN_STMT
  1192. goto <bb 4>; [INV]
  1193. <bb 5> :
  1194. # DEBUG BEGIN_STMT
  1195. # DEBUG BEGIN_STMT
  1196. prvCheckForValidListAndQueue ();
  1197. # DEBUG BEGIN_STMT
  1198. pxNewTimer_8(D)->pcTimerName = pcTimerName_9(D);
  1199. # DEBUG BEGIN_STMT
  1200. pxNewTimer_8(D)->xTimerPeriodInTicks = xTimerPeriodInTicks_5(D);
  1201. # DEBUG BEGIN_STMT
  1202. pxNewTimer_8(D)->pvTimerID = pvTimerID_12(D);
  1203. # DEBUG BEGIN_STMT
  1204. pxNewTimer_8(D)->pxCallbackFunction = pxCallbackFunction_14(D);
  1205. # DEBUG BEGIN_STMT
  1206. _1 = &pxNewTimer_8(D)->xTimerListItem;
  1207. vListInitialiseItem (_1);
  1208. # DEBUG BEGIN_STMT
  1209. if (uxAutoReload_17(D) != 0)
  1210. goto <bb 6>; [INV]
  1211. else
  1212. goto <bb 7>; [INV]
  1213. <bb 6> :
  1214. # DEBUG BEGIN_STMT
  1215. _2 = pxNewTimer_8(D)->ucStatus;
  1216. _3 = _2 | 4;
  1217. pxNewTimer_8(D)->ucStatus = _3;
  1218. <bb 7> :
  1219. # DEBUG BEGIN_STMT
  1220. return;
  1221. }
  1222. xTimerCreate (const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, void (*TimerCallbackFunction_t) (struct tmrTimerControl *) pxCallbackFunction)
  1223. {
  1224. struct Timer_t * pxNewTimer;
  1225. struct tmrTimerControl * _12;
  1226. <bb 2> :
  1227. # DEBUG BEGIN_STMT
  1228. # DEBUG BEGIN_STMT
  1229. pxNewTimer_4 = pvPortMalloc (44);
  1230. # DEBUG pxNewTimer => pxNewTimer_4
  1231. # DEBUG BEGIN_STMT
  1232. if (pxNewTimer_4 != 0B)
  1233. goto <bb 3>; [INV]
  1234. else
  1235. goto <bb 4>; [INV]
  1236. <bb 3> :
  1237. # DEBUG BEGIN_STMT
  1238. pxNewTimer_4->ucStatus = 0;
  1239. # DEBUG BEGIN_STMT
  1240. prvInitialiseNewTimer (pcTimerName_6(D), xTimerPeriodInTicks_7(D), uxAutoReload_8(D), pvTimerID_9(D), pxCallbackFunction_10(D), pxNewTimer_4);
  1241. <bb 4> :
  1242. # DEBUG BEGIN_STMT
  1243. _12 = pxNewTimer_4;
  1244. return _12;
  1245. }
  1246. xTimerCreateTimerTask ()
  1247. {
  1248. BaseType_t xReturn;
  1249. struct QueueDefinition * xTimerQueue.0_1;
  1250. BaseType_t _9;
  1251. <bb 2> :
  1252. # DEBUG BEGIN_STMT
  1253. xReturn_4 = 0;
  1254. # DEBUG xReturn => xReturn_4
  1255. # DEBUG BEGIN_STMT
  1256. prvCheckForValidListAndQueue ();
  1257. # DEBUG BEGIN_STMT
  1258. xTimerQueue.0_1 = xTimerQueue;
  1259. if (xTimerQueue.0_1 != 0B)
  1260. goto <bb 3>; [INV]
  1261. else
  1262. goto <bb 4>; [INV]
  1263. <bb 3> :
  1264. # DEBUG BEGIN_STMT
  1265. xReturn_8 = xTaskCreate (prvTimerTask, "Tmr Svc", 180, 0B, 2, &xTimerTaskHandle);
  1266. # DEBUG xReturn => xReturn_8
  1267. <bb 4> :
  1268. # xReturn_2 = PHI <xReturn_4(2), xReturn_8(3)>
  1269. # DEBUG xReturn => xReturn_2
  1270. # DEBUG BEGIN_STMT
  1271. # DEBUG BEGIN_STMT
  1272. if (xReturn_2 == 0)
  1273. goto <bb 5>; [INV]
  1274. else
  1275. goto <bb 7>; [INV]
  1276. <bb 5> :
  1277. # DEBUG BEGIN_STMT
  1278. vPortRaiseBASEPRI ();
  1279. <bb 6> :
  1280. # DEBUG BEGIN_STMT
  1281. # DEBUG BEGIN_STMT
  1282. # DEBUG BEGIN_STMT
  1283. goto <bb 6>; [INV]
  1284. <bb 7> :
  1285. # DEBUG BEGIN_STMT
  1286. # DEBUG BEGIN_STMT
  1287. _9 = xReturn_2;
  1288. return _9;
  1289. }
  1290. __attribute__((always_inline))
  1291. vPortRaiseBASEPRI ()
  1292. {
  1293. uint32_t ulNewBASEPRI;
  1294. <bb 2> :
  1295. # DEBUG BEGIN_STMT
  1296. # DEBUG BEGIN_STMT
  1297. __asm__ __volatile__(" mov %0, %1
  1298. msr basepri, %0
  1299. isb
  1300. dsb
  1301. " : "=r" ulNewBASEPRI_3 : "i" 16 : "memory");
  1302. # DEBUG ulNewBASEPRI => ulNewBASEPRI_3
  1303. return;
  1304. }