FlexCAN_Ip_HwAccess.c.082i.materialize-all-clones 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958
  1. FlexCAN_ConfigPN (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
  2. {
  3. short unsigned int _1;
  4. <unnamed type> _2;
  5. <unnamed type> _3;
  6. <unnamed type> _4;
  7. <unnamed type> _5;
  8. unsigned char _6;
  9. unsigned char _7;
  10. const uint8[8] * _8;
  11. const uint8[8] * _9;
  12. <unnamed type> _10;
  13. <unnamed type> _11;
  14. const uint8[8] * _12;
  15. const uint8[8] * _13;
  16. <bb 2> :
  17. FlexCAN_SetPNFilteringSelection (pBase_17(D), pPnConfig_18(D));
  18. _1 = pPnConfig_18(D)->u16MatchTimeout;
  19. FlexCAN_SetPNTimeoutValue (pBase_17(D), _1);
  20. FlexCAN_SetPNIdFilter1 (pBase_17(D), pPnConfig_18(D)->idFilter1);
  21. _2 = pPnConfig_18(D)->eIdFilterType;
  22. if (_2 == 0)
  23. goto <bb 4>; [INV]
  24. else
  25. goto <bb 3>; [INV]
  26. <bb 3> :
  27. _3 = pPnConfig_18(D)->eIdFilterType;
  28. if (_3 == 3)
  29. goto <bb 4>; [INV]
  30. else
  31. goto <bb 5>; [INV]
  32. <bb 4> :
  33. FlexCAN_SetPNIdFilter2 (pBase_17(D), pPnConfig_18(D));
  34. goto <bb 6>; [INV]
  35. <bb 5> :
  36. FlexCAN_SetPNIdFilter2Check (pBase_17(D));
  37. <bb 6> :
  38. _4 = pPnConfig_18(D)->eFilterComb;
  39. if (_4 == 1)
  40. goto <bb 8>; [INV]
  41. else
  42. goto <bb 7>; [INV]
  43. <bb 7> :
  44. _5 = pPnConfig_18(D)->eFilterComb;
  45. if (_5 == 3)
  46. goto <bb 8>; [INV]
  47. else
  48. goto <bb 11>; [INV]
  49. <bb 8> :
  50. _6 = pPnConfig_18(D)->payloadFilter.u8DlcLow;
  51. _7 = pPnConfig_18(D)->payloadFilter.u8DlcHigh;
  52. FlexCAN_SetPNDlcFilter (pBase_17(D), _6, _7);
  53. _8 = &pPnConfig_18(D)->payloadFilter.aPayload1;
  54. FlexCAN_SetPNPayloadHighFilter1 (pBase_17(D), _8);
  55. _9 = &pPnConfig_18(D)->payloadFilter.aPayload1;
  56. FlexCAN_SetPNPayloadLowFilter1 (pBase_17(D), _9);
  57. _10 = pPnConfig_18(D)->ePayloadFilterType;
  58. if (_10 == 0)
  59. goto <bb 10>; [INV]
  60. else
  61. goto <bb 9>; [INV]
  62. <bb 9> :
  63. _11 = pPnConfig_18(D)->ePayloadFilterType;
  64. if (_11 == 3)
  65. goto <bb 10>; [INV]
  66. else
  67. goto <bb 11>; [INV]
  68. <bb 10> :
  69. _12 = &pPnConfig_18(D)->payloadFilter.aPayload2;
  70. FlexCAN_SetPNPayloadHighFilter2 (pBase_17(D), _12);
  71. _13 = &pPnConfig_18(D)->payloadFilter.aPayload2;
  72. FlexCAN_SetPNPayloadLowFilter2 (pBase_17(D), _13);
  73. <bb 11> :
  74. return;
  75. }
  76. FlexCAN_ConfigCtrlOptions (struct FLEXCAN_Type * pBase, uint32 u32Options)
  77. {
  78. long unsigned int _1;
  79. long unsigned int _2;
  80. long unsigned int _3;
  81. long unsigned int _4;
  82. long unsigned int _5;
  83. long unsigned int _6;
  84. long unsigned int _7;
  85. long unsigned int _8;
  86. long unsigned int _9;
  87. <bb 2> :
  88. _1 = u32Options_17(D) & 32;
  89. if (_1 != 0)
  90. goto <bb 3>; [INV]
  91. else
  92. goto <bb 4>; [INV]
  93. <bb 3> :
  94. FlexCAN_SetIsoCan (pBase_19(D), 1);
  95. goto <bb 5>; [INV]
  96. <bb 4> :
  97. FlexCAN_SetIsoCan (pBase_19(D), 0);
  98. <bb 5> :
  99. _2 = u32Options_17(D) & 64;
  100. if (_2 != 0)
  101. goto <bb 6>; [INV]
  102. else
  103. goto <bb 7>; [INV]
  104. <bb 6> :
  105. FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase_19(D), 1);
  106. goto <bb 8>; [INV]
  107. <bb 7> :
  108. FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase_19(D), 0);
  109. <bb 8> :
  110. _3 = u32Options_17(D) & 8;
  111. if (_3 != 0)
  112. goto <bb 9>; [INV]
  113. else
  114. goto <bb 10>; [INV]
  115. <bb 9> :
  116. FlexCAN_SetProtocolException (pBase_19(D), 1);
  117. goto <bb 11>; [INV]
  118. <bb 10> :
  119. FlexCAN_SetProtocolException (pBase_19(D), 0);
  120. <bb 11> :
  121. _4 = u32Options_17(D) & 2;
  122. if (_4 != 0)
  123. goto <bb 12>; [INV]
  124. else
  125. goto <bb 14>; [INV]
  126. <bb 12> :
  127. _5 ={v} pBase_19(D)->MCR;
  128. _6 = _5 & 2048;
  129. if (_6 == 0)
  130. goto <bb 13>; [INV]
  131. else
  132. goto <bb 14>; [INV]
  133. <bb 13> :
  134. FlexCAN_CanBitSampling (pBase_19(D), 1);
  135. goto <bb 15>; [INV]
  136. <bb 14> :
  137. FlexCAN_CanBitSampling (pBase_19(D), 0);
  138. <bb 15> :
  139. _7 = u32Options_17(D) & 4;
  140. if (_7 != 0)
  141. goto <bb 16>; [INV]
  142. else
  143. goto <bb 17>; [INV]
  144. <bb 16> :
  145. FlexCAN_SetBusOffAutorecovery (pBase_19(D), 1);
  146. goto <bb 18>; [INV]
  147. <bb 17> :
  148. FlexCAN_SetBusOffAutorecovery (pBase_19(D), 0);
  149. <bb 18> :
  150. _8 = u32Options_17(D) & 1;
  151. if (_8 != 0)
  152. goto <bb 19>; [INV]
  153. else
  154. goto <bb 20>; [INV]
  155. <bb 19> :
  156. FlexCAN_SetRemoteReqStore (pBase_19(D), 1);
  157. goto <bb 21>; [INV]
  158. <bb 20> :
  159. FlexCAN_SetRemoteReqStore (pBase_19(D), 0);
  160. <bb 21> :
  161. _9 = u32Options_17(D) & 16;
  162. if (_9 != 0)
  163. goto <bb 22>; [INV]
  164. else
  165. goto <bb 23>; [INV]
  166. <bb 22> :
  167. FlexCAN_SetEdgeFilter (pBase_19(D), 1);
  168. goto <bb 24>; [INV]
  169. <bb 23> :
  170. FlexCAN_SetEdgeFilter (pBase_19(D), 0);
  171. <bb 24> :
  172. return;
  173. }
  174. FlexCAN_IsMbOutOfRange (const struct FLEXCAN_Type * pBase, uint8 u8MbIndex, boolean bIsLegacyFifoEn, uint32 u32MaxMbNum)
  175. {
  176. uint32 u32NumOfMbOccupiedByFiFo;
  177. uint32 u32NumOfFiFoElement;
  178. boolean ReturnValue;
  179. boolean D.7600;
  180. unsigned char _1;
  181. long unsigned int _2;
  182. long unsigned int _3;
  183. long unsigned int _4;
  184. long unsigned int _5;
  185. long unsigned int _6;
  186. long unsigned int _7;
  187. boolean _22;
  188. <bb 2> :
  189. ReturnValue_9 = 0;
  190. u32NumOfFiFoElement_10 = 0;
  191. u32NumOfMbOccupiedByFiFo_11 = 0;
  192. _1 = (unsigned char) u32MaxMbNum_12(D);
  193. if (u8MbIndex_13(D) >= _1)
  194. goto <bb 3>; [INV]
  195. else
  196. goto <bb 4>; [INV]
  197. <bb 3> :
  198. ReturnValue_21 = 1;
  199. goto <bb 8>; [INV]
  200. <bb 4> :
  201. if (bIsLegacyFifoEn_14(D) != 0)
  202. goto <bb 5>; [INV]
  203. else
  204. goto <bb 7>; [INV]
  205. <bb 5> :
  206. _2 ={v} pBase_17(D)->CTRL2;
  207. _3 = _2 >> 24;
  208. u32NumOfFiFoElement_18 = _3 & 15;
  209. _4 = u32NumOfFiFoElement_18 + 1;
  210. _5 = _4 * 8;
  211. _6 = _5 / 4;
  212. u32NumOfMbOccupiedByFiFo_19 = _6 + 5;
  213. _7 = (long unsigned int) u8MbIndex_13(D);
  214. if (u32NumOfMbOccupiedByFiFo_19 >= _7)
  215. goto <bb 6>; [INV]
  216. else
  217. goto <bb 8>; [INV]
  218. <bb 6> :
  219. ReturnValue_20 = 1;
  220. goto <bb 8>; [INV]
  221. <bb 7> :
  222. ReturnValue_15 = 0;
  223. <bb 8> :
  224. # ReturnValue_8 = PHI <ReturnValue_21(3), ReturnValue_20(6), ReturnValue_15(7), ReturnValue_9(5)>
  225. _22 = ReturnValue_8;
  226. <bb 9> :
  227. <L8>:
  228. return _22;
  229. }
  230. FlexCAN_ReadRxFifo (const struct FLEXCAN_Type * base, struct Flexcan_Ip_MsgBuffType * rxFifo)
  231. {
  232. uint8 can_real_payload;
  233. uint8 flexcan_mb_dlc_value;
  234. uint32 * msgData_32;
  235. const uint32 * flexcan_mb_data_32;
  236. const uint32 * flexcan_mb_id;
  237. const uint32 * flexcan_mb;
  238. uint32 MbWord;
  239. uint32 DataByte;
  240. long unsigned int base.14_1;
  241. long unsigned int _2;
  242. long unsigned int _3;
  243. long unsigned int _4;
  244. unsigned char _5;
  245. _Bool _6;
  246. long unsigned int _7;
  247. long unsigned int _8;
  248. long unsigned int _9;
  249. long unsigned int _10;
  250. long unsigned int _11;
  251. long unsigned int _12;
  252. long unsigned int _13;
  253. unsigned char _14;
  254. long unsigned int _15;
  255. long unsigned int _16;
  256. long unsigned int _17;
  257. long unsigned int _18;
  258. const uint32 * _19;
  259. long unsigned int _20;
  260. long unsigned int _21;
  261. long unsigned int _22;
  262. long unsigned int _23;
  263. long unsigned int _24;
  264. long unsigned int _25;
  265. long unsigned int _26;
  266. long unsigned int _27;
  267. long unsigned int _28;
  268. long unsigned int _29;
  269. uint32 * _30;
  270. long unsigned int _31;
  271. long unsigned int _32;
  272. <bb 2> :
  273. base.14_1 = (long unsigned int) base_37(D);
  274. _2 = base.14_1 + 128;
  275. flexcan_mb_38 = (const uint32 *) _2;
  276. flexcan_mb_id_39 = flexcan_mb_38 + 4;
  277. flexcan_mb_data_32_40 = flexcan_mb_38 + 8;
  278. msgData_32_42 = &rxFifo_41(D)->data;
  279. _3 ={v} *flexcan_mb_38;
  280. _4 = _3 >> 16;
  281. _5 = (unsigned char) _4;
  282. flexcan_mb_dlc_value_44 = _5 & 15;
  283. can_real_payload_46 = FlexCAN_ComputePayloadSize (flexcan_mb_dlc_value_44);
  284. _6 = rxFifo_41(D) != 0B;
  285. DevAssert (_6);
  286. if (can_real_payload_46 > 8)
  287. goto <bb 3>; [INV]
  288. else
  289. goto <bb 4>; [INV]
  290. <bb 3> :
  291. can_real_payload_48 = 8;
  292. <bb 4> :
  293. # can_real_payload_34 = PHI <can_real_payload_46(2), can_real_payload_48(3)>
  294. rxFifo_41(D)->dataLen = can_real_payload_34;
  295. _7 ={v} *flexcan_mb_38;
  296. rxFifo_41(D)->cs = _7;
  297. _8 = rxFifo_41(D)->cs;
  298. _9 = _8 & 2097152;
  299. if (_9 != 0)
  300. goto <bb 5>; [INV]
  301. else
  302. goto <bb 6>; [INV]
  303. <bb 5> :
  304. _10 ={v} *flexcan_mb_id_39;
  305. rxFifo_41(D)->msgId = _10;
  306. goto <bb 7>; [INV]
  307. <bb 6> :
  308. _11 ={v} *flexcan_mb_id_39;
  309. _12 = _11 >> 18;
  310. rxFifo_41(D)->msgId = _12;
  311. <bb 7> :
  312. _13 ={v} base_37(D)->RXFIR;
  313. _14 = (unsigned char) _13;
  314. rxFifo_41(D)->id_hit = _14;
  315. _15 = rxFifo_41(D)->cs;
  316. _16 = _15 & 65535;
  317. rxFifo_41(D)->time_stamp = _16;
  318. DataByte_55 = 0;
  319. goto <bb 9>; [INV]
  320. <bb 8> :
  321. _17 = DataByte_33 >> 2;
  322. _18 = _17 * 4;
  323. _19 = flexcan_mb_data_32_40 + _18;
  324. MbWord_56 ={v} *_19;
  325. _20 = MbWord_56 >> 24;
  326. _21 = MbWord_56 >> 8;
  327. _22 = _21 & 65280;
  328. _23 = _20 | _22;
  329. _24 = MbWord_56 << 8;
  330. _25 = _24 & 16711680;
  331. _26 = _23 | _25;
  332. _27 = MbWord_56 << 24;
  333. _28 = DataByte_33 >> 2;
  334. _29 = _28 * 4;
  335. _30 = msgData_32_42 + _29;
  336. _31 = _26 | _27;
  337. *_30 = _31;
  338. DataByte_58 = DataByte_33 + 4;
  339. <bb 9> :
  340. # DataByte_33 = PHI <DataByte_55(7), DataByte_58(8)>
  341. _32 = (long unsigned int) can_real_payload_34;
  342. if (DataByte_33 < _32)
  343. goto <bb 8>; [INV]
  344. else
  345. goto <bb 10>; [INV]
  346. <bb 10> :
  347. return;
  348. }
  349. FlexCAN_SetRxFifoFilter (struct FLEXCAN_Type * base, Flexcan_Ip_RxFifoIdElementFormatType idFormat, const struct Flexcan_Ip_IdTableType * idFilterTable)
  350. {
  351. volatile uint32 * FilterTable;
  352. uint32 Val;
  353. uint32 Val2;
  354. uint32 Val1;
  355. uint32 NumOfFilters;
  356. uint32 j;
  357. uint32 i;
  358. int iftmp.13;
  359. long unsigned int base.12_1;
  360. long unsigned int _2;
  361. _Bool _3;
  362. long unsigned int _4;
  363. long unsigned int _5;
  364. long unsigned int _6;
  365. long unsigned int _7;
  366. long unsigned int _8;
  367. const struct Flexcan_Ip_IdTableType * _9;
  368. _Bool _10;
  369. long unsigned int _11;
  370. const struct Flexcan_Ip_IdTableType * _12;
  371. _Bool _13;
  372. long unsigned int _14;
  373. const struct Flexcan_Ip_IdTableType * _15;
  374. long unsigned int _16;
  375. long unsigned int _17;
  376. long unsigned int _18;
  377. long unsigned int _19;
  378. volatile uint32 * _20;
  379. long unsigned int _21;
  380. long unsigned int _22;
  381. const struct Flexcan_Ip_IdTableType * _23;
  382. long unsigned int _24;
  383. long unsigned int _25;
  384. long unsigned int _26;
  385. long unsigned int _27;
  386. volatile uint32 * _28;
  387. long unsigned int _29;
  388. long unsigned int _30;
  389. long unsigned int _31;
  390. long unsigned int _32;
  391. long unsigned int _33;
  392. long unsigned int _34;
  393. long unsigned int _35;
  394. const struct Flexcan_Ip_IdTableType * _36;
  395. _Bool _37;
  396. sizetype _38;
  397. sizetype _39;
  398. const struct Flexcan_Ip_IdTableType * _40;
  399. _Bool _41;
  400. long unsigned int _42;
  401. const struct Flexcan_Ip_IdTableType * _43;
  402. _Bool _44;
  403. long unsigned int _45;
  404. const struct Flexcan_Ip_IdTableType * _46;
  405. long unsigned int _47;
  406. long unsigned int _48;
  407. long unsigned int _49;
  408. long unsigned int _50;
  409. long unsigned int _51;
  410. volatile uint32 * _52;
  411. long unsigned int _53;
  412. long unsigned int _54;
  413. const struct Flexcan_Ip_IdTableType * _55;
  414. long unsigned int _56;
  415. long unsigned int _57;
  416. long unsigned int _58;
  417. long unsigned int _59;
  418. volatile uint32 * _60;
  419. long unsigned int _61;
  420. sizetype _62;
  421. sizetype _63;
  422. const struct Flexcan_Ip_IdTableType * _64;
  423. _Bool _65;
  424. long unsigned int _66;
  425. volatile uint32 * _67;
  426. long unsigned int _68;
  427. sizetype _69;
  428. sizetype _70;
  429. const struct Flexcan_Ip_IdTableType * _71;
  430. long unsigned int _72;
  431. long unsigned int _73;
  432. long unsigned int _74;
  433. long unsigned int _75;
  434. long unsigned int _76;
  435. volatile uint32 * _77;
  436. long unsigned int _78;
  437. long unsigned int _79;
  438. volatile uint32 * _80;
  439. long unsigned int _81;
  440. sizetype _82;
  441. sizetype _83;
  442. const struct Flexcan_Ip_IdTableType * _84;
  443. long unsigned int _85;
  444. long unsigned int _86;
  445. long unsigned int _87;
  446. long unsigned int _88;
  447. long unsigned int _89;
  448. volatile uint32 * _90;
  449. long unsigned int _91;
  450. long unsigned int _92;
  451. long unsigned int _93;
  452. long unsigned int _94;
  453. long unsigned int _95;
  454. long unsigned int _96;
  455. long unsigned int _97;
  456. const struct Flexcan_Ip_IdTableType * _98;
  457. _Bool _99;
  458. long unsigned int _100;
  459. const struct Flexcan_Ip_IdTableType * _101;
  460. long unsigned int _102;
  461. long unsigned int _103;
  462. long unsigned int _104;
  463. long unsigned int _105;
  464. volatile uint32 * _106;
  465. long unsigned int _107;
  466. long unsigned int _108;
  467. const struct Flexcan_Ip_IdTableType * _109;
  468. long unsigned int _110;
  469. long unsigned int _111;
  470. long unsigned int _112;
  471. long unsigned int _113;
  472. volatile uint32 * _114;
  473. long unsigned int _115;
  474. sizetype _116;
  475. sizetype _117;
  476. const struct Flexcan_Ip_IdTableType * _118;
  477. _Bool _119;
  478. long unsigned int _120;
  479. volatile uint32 * _121;
  480. long unsigned int _122;
  481. sizetype _123;
  482. sizetype _124;
  483. const struct Flexcan_Ip_IdTableType * _125;
  484. long unsigned int _126;
  485. long unsigned int _127;
  486. long unsigned int _128;
  487. long unsigned int _129;
  488. long unsigned int _130;
  489. long unsigned int _131;
  490. volatile uint32 * _132;
  491. long unsigned int _133;
  492. long unsigned int _134;
  493. volatile uint32 * _135;
  494. long unsigned int _136;
  495. sizetype _137;
  496. sizetype _138;
  497. const struct Flexcan_Ip_IdTableType * _139;
  498. long unsigned int _140;
  499. long unsigned int _141;
  500. long unsigned int _142;
  501. long unsigned int _143;
  502. long unsigned int _144;
  503. long unsigned int _145;
  504. volatile uint32 * _146;
  505. long unsigned int _147;
  506. sizetype _148;
  507. sizetype _149;
  508. const struct Flexcan_Ip_IdTableType * _150;
  509. _Bool _151;
  510. long unsigned int _152;
  511. volatile uint32 * _153;
  512. long unsigned int _154;
  513. sizetype _155;
  514. sizetype _156;
  515. const struct Flexcan_Ip_IdTableType * _157;
  516. long unsigned int _158;
  517. long unsigned int _159;
  518. long unsigned int _160;
  519. long unsigned int _161;
  520. long unsigned int _162;
  521. long unsigned int _163;
  522. volatile uint32 * _164;
  523. long unsigned int _165;
  524. long unsigned int _166;
  525. volatile uint32 * _167;
  526. long unsigned int _168;
  527. sizetype _169;
  528. sizetype _170;
  529. const struct Flexcan_Ip_IdTableType * _171;
  530. long unsigned int _172;
  531. long unsigned int _173;
  532. long unsigned int _174;
  533. long unsigned int _175;
  534. long unsigned int _176;
  535. long unsigned int _177;
  536. volatile uint32 * _178;
  537. long unsigned int _179;
  538. sizetype _180;
  539. sizetype _181;
  540. const struct Flexcan_Ip_IdTableType * _182;
  541. _Bool _183;
  542. long unsigned int _184;
  543. volatile uint32 * _185;
  544. long unsigned int _186;
  545. sizetype _187;
  546. sizetype _188;
  547. const struct Flexcan_Ip_IdTableType * _189;
  548. long unsigned int _190;
  549. long unsigned int _191;
  550. long unsigned int _192;
  551. long unsigned int _193;
  552. long unsigned int _194;
  553. volatile uint32 * _195;
  554. long unsigned int _196;
  555. long unsigned int _197;
  556. volatile uint32 * _198;
  557. long unsigned int _199;
  558. sizetype _200;
  559. sizetype _201;
  560. const struct Flexcan_Ip_IdTableType * _202;
  561. long unsigned int _203;
  562. long unsigned int _204;
  563. long unsigned int _205;
  564. long unsigned int _206;
  565. long unsigned int _207;
  566. volatile uint32 * _208;
  567. long unsigned int _209;
  568. long unsigned int _210;
  569. long unsigned int _211;
  570. long unsigned int _212;
  571. long unsigned int _213;
  572. int iftmp.13_222;
  573. int iftmp.13_241;
  574. int iftmp.13_242;
  575. <bb 2> :
  576. Val1_234 = 0;
  577. Val2_235 = 0;
  578. Val_236 = 0;
  579. base.12_1 = (long unsigned int) base_237(D);
  580. _2 = base.12_1 + 224;
  581. FilterTable_238 = (volatile uint32 *) _2;
  582. if (idFilterTable_239(D) != 0B)
  583. goto <bb 4>; [INV]
  584. else
  585. goto <bb 3>; [INV]
  586. <bb 3> :
  587. if (idFormat_240(D) == 3)
  588. goto <bb 4>; [INV]
  589. else
  590. goto <bb 5>; [INV]
  591. <bb 4> :
  592. iftmp.13_242 = 1;
  593. goto <bb 6>; [INV]
  594. <bb 5> :
  595. iftmp.13_241 = 0;
  596. <bb 6> :
  597. # iftmp.13_222 = PHI <iftmp.13_242(4), iftmp.13_241(5)>
  598. _3 = (_Bool) iftmp.13_222;
  599. DevAssert (_3);
  600. _4 ={v} base_237(D)->CTRL2;
  601. _5 = _4 >> 24;
  602. NumOfFilters_245 = _5 & 15;
  603. switch (idFormat_240(D)) <default: <L44> [INV], case 0: <L4> [INV], case 1: <L13> [INV], case 2: <L27> [INV], case 3: <L43> [INV]>
  604. <bb 7> :
  605. <L4>:
  606. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  607. _6 ={v} base_237(D)->MCR;
  608. _7 = _6 & 4294966527;
  609. base_237(D)->MCR ={v} _7;
  610. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  611. i_284 = 0;
  612. goto <bb 14>; [INV]
  613. <bb 8> :
  614. Val_285 = 0;
  615. _8 = i_214 * 8;
  616. _9 = idFilterTable_239(D) + _8;
  617. _10 = _9->isRemoteFrame;
  618. if (_10 != 0)
  619. goto <bb 9>; [INV]
  620. else
  621. goto <bb 10>; [INV]
  622. <bb 9> :
  623. Val_286 = 2147483648;
  624. <bb 10> :
  625. # Val_221 = PHI <Val_285(8), Val_286(9)>
  626. _11 = i_214 * 8;
  627. _12 = idFilterTable_239(D) + _11;
  628. _13 = _12->isExtendedFrame;
  629. if (_13 != 0)
  630. goto <bb 11>; [INV]
  631. else
  632. goto <bb 12>; [INV]
  633. <bb 11> :
  634. Val_288 = Val_221 | 1073741824;
  635. _14 = i_214 * 8;
  636. _15 = idFilterTable_239(D) + _14;
  637. _16 = _15->id;
  638. _17 = _16 << 1;
  639. _18 = _17 & 1073741823;
  640. _19 = i_214 * 4;
  641. _20 = FilterTable_238 + _19;
  642. _21 = Val_288 + _18;
  643. *_20 ={v} _21;
  644. goto <bb 13>; [INV]
  645. <bb 12> :
  646. _22 = i_214 * 8;
  647. _23 = idFilterTable_239(D) + _22;
  648. _24 = _23->id;
  649. _25 = _24 << 19;
  650. _26 = _25 & 1073217536;
  651. _27 = i_214 * 4;
  652. _28 = FilterTable_238 + _27;
  653. _29 = Val_221 + _26;
  654. *_28 ={v} _29;
  655. <bb 13> :
  656. i_290 = i_214 + 1;
  657. <bb 14> :
  658. # i_214 = PHI <i_284(7), i_290(13)>
  659. _30 = NumOfFilters_245 + 1;
  660. _31 = _30 * 8;
  661. if (i_214 < _31)
  662. goto <bb 8>; [INV]
  663. else
  664. goto <bb 15>; [INV]
  665. <bb 15> :
  666. goto <bb 48>; [INV]
  667. <bb 16> :
  668. <L13>:
  669. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  670. _32 ={v} base_237(D)->MCR;
  671. _33 = _32 & 4294966527;
  672. _34 = _33 | 256;
  673. base_237(D)->MCR ={v} _34;
  674. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  675. j_267 = 0;
  676. i_268 = 0;
  677. goto <bb 28>; [INV]
  678. <bb 17> :
  679. Val1_269 = 0;
  680. Val2_270 = 0;
  681. _35 = j_217 * 8;
  682. _36 = idFilterTable_239(D) + _35;
  683. _37 = _36->isRemoteFrame;
  684. if (_37 != 0)
  685. goto <bb 18>; [INV]
  686. else
  687. goto <bb 19>; [INV]
  688. <bb 18> :
  689. Val1_271 = 2147483648;
  690. <bb 19> :
  691. # Val1_219 = PHI <Val1_269(17), Val1_271(18)>
  692. _38 = j_217 + 1;
  693. _39 = _38 * 8;
  694. _40 = idFilterTable_239(D) + _39;
  695. _41 = _40->isRemoteFrame;
  696. if (_41 != 0)
  697. goto <bb 20>; [INV]
  698. else
  699. goto <bb 21>; [INV]
  700. <bb 20> :
  701. Val2_272 = 32768;
  702. <bb 21> :
  703. # Val2_220 = PHI <Val2_270(19), Val2_272(20)>
  704. _42 = j_217 * 8;
  705. _43 = idFilterTable_239(D) + _42;
  706. _44 = _43->isExtendedFrame;
  707. if (_44 != 0)
  708. goto <bb 22>; [INV]
  709. else
  710. goto <bb 23>; [INV]
  711. <bb 22> :
  712. Val1_274 = Val1_219 | 1073741824;
  713. _45 = j_217 * 8;
  714. _46 = idFilterTable_239(D) + _45;
  715. _47 = _46->id;
  716. _48 = _47 >> 15;
  717. _49 = _48 << 16;
  718. _50 = _49 & 1073676288;
  719. _51 = i_215 * 4;
  720. _52 = FilterTable_238 + _51;
  721. _53 = Val1_274 + _50;
  722. *_52 ={v} _53;
  723. goto <bb 24>; [INV]
  724. <bb 23> :
  725. _54 = j_217 * 8;
  726. _55 = idFilterTable_239(D) + _54;
  727. _56 = _55->id;
  728. _57 = _56 << 19;
  729. _58 = _57 & 1073217536;
  730. _59 = i_215 * 4;
  731. _60 = FilterTable_238 + _59;
  732. _61 = Val1_219 + _58;
  733. *_60 ={v} _61;
  734. <bb 24> :
  735. _62 = j_217 + 1;
  736. _63 = _62 * 8;
  737. _64 = idFilterTable_239(D) + _63;
  738. _65 = _64->isExtendedFrame;
  739. if (_65 != 0)
  740. goto <bb 25>; [INV]
  741. else
  742. goto <bb 26>; [INV]
  743. <bb 25> :
  744. Val2_277 = Val2_220 | 16384;
  745. _66 = i_215 * 4;
  746. _67 = FilterTable_238 + _66;
  747. _68 ={v} *_67;
  748. _69 = j_217 + 1;
  749. _70 = _69 * 8;
  750. _71 = idFilterTable_239(D) + _70;
  751. _72 = _71->id;
  752. _73 = _72 >> 15;
  753. _74 = _73 & 16383;
  754. _75 = Val2_277 + _74;
  755. _76 = i_215 * 4;
  756. _77 = FilterTable_238 + _76;
  757. _78 = _68 | _75;
  758. *_77 ={v} _78;
  759. goto <bb 27>; [INV]
  760. <bb 26> :
  761. _79 = i_215 * 4;
  762. _80 = FilterTable_238 + _79;
  763. _81 ={v} *_80;
  764. _82 = j_217 + 1;
  765. _83 = _82 * 8;
  766. _84 = idFilterTable_239(D) + _83;
  767. _85 = _84->id;
  768. _86 = _85 << 3;
  769. _87 = _86 & 16376;
  770. _88 = Val2_220 + _87;
  771. _89 = i_215 * 4;
  772. _90 = FilterTable_238 + _89;
  773. _91 = _81 | _88;
  774. *_90 ={v} _91;
  775. <bb 27> :
  776. j_279 = j_217 + 2;
  777. i_280 = i_215 + 1;
  778. <bb 28> :
  779. # i_215 = PHI <i_268(16), i_280(27)>
  780. # j_217 = PHI <j_267(16), j_279(27)>
  781. _92 = NumOfFilters_245 + 1;
  782. _93 = _92 * 8;
  783. if (i_215 < _93)
  784. goto <bb 17>; [INV]
  785. else
  786. goto <bb 29>; [INV]
  787. <bb 29> :
  788. goto <bb 48>; [INV]
  789. <bb 30> :
  790. <L27>:
  791. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  792. _94 ={v} base_237(D)->MCR;
  793. _95 = _94 & 4294966527;
  794. _96 = _95 | 512;
  795. base_237(D)->MCR ={v} _96;
  796. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  797. j_252 = 0;
  798. i_253 = 0;
  799. goto <bb 44>; [INV]
  800. <bb 31> :
  801. _97 = j_218 * 8;
  802. _98 = idFilterTable_239(D) + _97;
  803. _99 = _98->isExtendedFrame;
  804. if (_99 != 0)
  805. goto <bb 32>; [INV]
  806. else
  807. goto <bb 33>; [INV]
  808. <bb 32> :
  809. _100 = j_218 * 8;
  810. _101 = idFilterTable_239(D) + _100;
  811. _102 = _101->id;
  812. _103 = _102 >> 21;
  813. _104 = _103 << 24;
  814. _105 = i_216 * 4;
  815. _106 = FilterTable_238 + _105;
  816. _107 = Val1_234 + _104;
  817. *_106 ={v} _107;
  818. goto <bb 34>; [INV]
  819. <bb 33> :
  820. _108 = j_218 * 8;
  821. _109 = idFilterTable_239(D) + _108;
  822. _110 = _109->id;
  823. _111 = _110 >> 3;
  824. _112 = _111 << 24;
  825. _113 = i_216 * 4;
  826. _114 = FilterTable_238 + _113;
  827. _115 = Val1_234 + _112;
  828. *_114 ={v} _115;
  829. <bb 34> :
  830. _116 = j_218 + 1;
  831. _117 = _116 * 8;
  832. _118 = idFilterTable_239(D) + _117;
  833. _119 = _118->isExtendedFrame;
  834. if (_119 != 0)
  835. goto <bb 35>; [INV]
  836. else
  837. goto <bb 36>; [INV]
  838. <bb 35> :
  839. _120 = i_216 * 4;
  840. _121 = FilterTable_238 + _120;
  841. _122 ={v} *_121;
  842. _123 = j_218 + 1;
  843. _124 = _123 * 8;
  844. _125 = idFilterTable_239(D) + _124;
  845. _126 = _125->id;
  846. _127 = _126 >> 21;
  847. _128 = _127 << 16;
  848. _129 = _128 & 16711680;
  849. _130 = Val1_234 + _129;
  850. _131 = i_216 * 4;
  851. _132 = FilterTable_238 + _131;
  852. _133 = _122 | _130;
  853. *_132 ={v} _133;
  854. goto <bb 37>; [INV]
  855. <bb 36> :
  856. _134 = i_216 * 4;
  857. _135 = FilterTable_238 + _134;
  858. _136 ={v} *_135;
  859. _137 = j_218 + 1;
  860. _138 = _137 * 8;
  861. _139 = idFilterTable_239(D) + _138;
  862. _140 = _139->id;
  863. _141 = _140 >> 3;
  864. _142 = _141 << 16;
  865. _143 = _142 & 16711680;
  866. _144 = Val1_234 + _143;
  867. _145 = i_216 * 4;
  868. _146 = FilterTable_238 + _145;
  869. _147 = _136 | _144;
  870. *_146 ={v} _147;
  871. <bb 37> :
  872. _148 = j_218 + 2;
  873. _149 = _148 * 8;
  874. _150 = idFilterTable_239(D) + _149;
  875. _151 = _150->isExtendedFrame;
  876. if (_151 != 0)
  877. goto <bb 38>; [INV]
  878. else
  879. goto <bb 39>; [INV]
  880. <bb 38> :
  881. _152 = i_216 * 4;
  882. _153 = FilterTable_238 + _152;
  883. _154 ={v} *_153;
  884. _155 = j_218 + 2;
  885. _156 = _155 * 8;
  886. _157 = idFilterTable_239(D) + _156;
  887. _158 = _157->id;
  888. _159 = _158 >> 21;
  889. _160 = _159 << 8;
  890. _161 = _160 & 65535;
  891. _162 = Val1_234 + _161;
  892. _163 = i_216 * 4;
  893. _164 = FilterTable_238 + _163;
  894. _165 = _154 | _162;
  895. *_164 ={v} _165;
  896. goto <bb 40>; [INV]
  897. <bb 39> :
  898. _166 = i_216 * 4;
  899. _167 = FilterTable_238 + _166;
  900. _168 ={v} *_167;
  901. _169 = j_218 + 2;
  902. _170 = _169 * 8;
  903. _171 = idFilterTable_239(D) + _170;
  904. _172 = _171->id;
  905. _173 = _172 >> 3;
  906. _174 = _173 << 8;
  907. _175 = _174 & 65535;
  908. _176 = Val1_234 + _175;
  909. _177 = i_216 * 4;
  910. _178 = FilterTable_238 + _177;
  911. _179 = _168 | _176;
  912. *_178 ={v} _179;
  913. <bb 40> :
  914. _180 = j_218 + 3;
  915. _181 = _180 * 8;
  916. _182 = idFilterTable_239(D) + _181;
  917. _183 = _182->isExtendedFrame;
  918. if (_183 != 0)
  919. goto <bb 41>; [INV]
  920. else
  921. goto <bb 42>; [INV]
  922. <bb 41> :
  923. _184 = i_216 * 4;
  924. _185 = FilterTable_238 + _184;
  925. _186 ={v} *_185;
  926. _187 = j_218 + 3;
  927. _188 = _187 * 8;
  928. _189 = idFilterTable_239(D) + _188;
  929. _190 = _189->id;
  930. _191 = _190 >> 21;
  931. _192 = _191 & 255;
  932. _193 = Val1_234 + _192;
  933. _194 = i_216 * 4;
  934. _195 = FilterTable_238 + _194;
  935. _196 = _186 | _193;
  936. *_195 ={v} _196;
  937. goto <bb 43>; [INV]
  938. <bb 42> :
  939. _197 = i_216 * 4;
  940. _198 = FilterTable_238 + _197;
  941. _199 ={v} *_198;
  942. _200 = j_218 + 3;
  943. _201 = _200 * 8;
  944. _202 = idFilterTable_239(D) + _201;
  945. _203 = _202->id;
  946. _204 = _203 >> 3;
  947. _205 = _204 & 255;
  948. _206 = Val1_234 + _205;
  949. _207 = i_216 * 4;
  950. _208 = FilterTable_238 + _207;
  951. _209 = _199 | _206;
  952. *_208 ={v} _209;
  953. <bb 43> :
  954. j_262 = j_218 + 4;
  955. i_263 = i_216 + 1;
  956. <bb 44> :
  957. # i_216 = PHI <i_253(30), i_263(43)>
  958. # j_218 = PHI <j_252(30), j_262(43)>
  959. _210 = NumOfFilters_245 + 1;
  960. _211 = _210 * 8;
  961. if (i_216 < _211)
  962. goto <bb 31>; [INV]
  963. else
  964. goto <bb 45>; [INV]
  965. <bb 45> :
  966. goto <bb 48>; [INV]
  967. <bb 46> :
  968. <L43>:
  969. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  970. _212 ={v} base_237(D)->MCR;
  971. _213 = _212 | 768;
  972. base_237(D)->MCR ={v} _213;
  973. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  974. goto <bb 48>; [INV]
  975. <bb 47> :
  976. <L44>:
  977. <bb 48> :
  978. return;
  979. }
  980. FlexCAN_SetOperationMode (struct FLEXCAN_Type * base, Flexcan_Ip_ModesType mode)
  981. {
  982. long unsigned int _1;
  983. long unsigned int _2;
  984. long unsigned int _3;
  985. long unsigned int _4;
  986. long unsigned int _5;
  987. long unsigned int _6;
  988. long unsigned int _7;
  989. long unsigned int _8;
  990. long unsigned int _9;
  991. long unsigned int _10;
  992. <bb 2> :
  993. switch (mode_12(D)) <default: <L3> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV]>
  994. <bb 3> :
  995. <L0>:
  996. _1 ={v} base_14(D)->CTRL1;
  997. _2 = _1 & 4294967287;
  998. base_14(D)->CTRL1 ={v} _2;
  999. _3 ={v} base_14(D)->CTRL1;
  1000. _4 = _3 & 4294963199;
  1001. base_14(D)->CTRL1 ={v} _4;
  1002. goto <bb 7>; [INV]
  1003. <bb 4> :
  1004. <L1>:
  1005. _5 ={v} base_14(D)->CTRL1;
  1006. _6 = _5 | 8;
  1007. base_14(D)->CTRL1 ={v} _6;
  1008. goto <bb 7>; [INV]
  1009. <bb 5> :
  1010. <L2>:
  1011. _7 ={v} base_14(D)->CTRL1;
  1012. _8 = _7 | 4096;
  1013. base_14(D)->CTRL1 ={v} _8;
  1014. _9 ={v} base_14(D)->CTRL1;
  1015. _10 = _9 & 4294967287;
  1016. base_14(D)->CTRL1 ={v} _10;
  1017. FlexCAN_SetSelfReception (base_14(D), 1);
  1018. goto <bb 7>; [INV]
  1019. <bb 6> :
  1020. <L3>:
  1021. <bb 7> :
  1022. return;
  1023. }
  1024. FlexCAN_SetMaxMsgBuffNum (struct FLEXCAN_Type * base, uint32 maxMsgBuffNum)
  1025. {
  1026. Flexcan_Ip_StatusType Status;
  1027. uint32 ValEndRam;
  1028. uint32 ValEndMb;
  1029. uint8 Can_Real_Payload;
  1030. uint8 Arbitration_Field_Size;
  1031. volatile uint8 * Flexcan_Mb_Data;
  1032. volatile uint32 * Flexcan_Mb_Id;
  1033. volatile uint32 * Flexcan_Mb;
  1034. const uint32 * ValEndMbPointer;
  1035. const uint32 * RAM;
  1036. uint32 DataByte;
  1037. uint8 MsgBuffIdx;
  1038. Flexcan_Ip_StatusType D.7549;
  1039. long unsigned int base.8_1;
  1040. long unsigned int _2;
  1041. long unsigned int _3;
  1042. _Bool _4;
  1043. long unsigned int _5;
  1044. long unsigned int _6;
  1045. long unsigned int ValEndMbPointer.9_7;
  1046. long unsigned int _8;
  1047. long unsigned int _9;
  1048. const uint32 * _10;
  1049. long unsigned int _11;
  1050. long unsigned int _12;
  1051. long unsigned int _13;
  1052. long unsigned int _14;
  1053. long unsigned int _15;
  1054. long unsigned int _16;
  1055. long unsigned int _17;
  1056. long unsigned int _18;
  1057. long unsigned int _19;
  1058. long unsigned int _20;
  1059. volatile uint8 * _21;
  1060. long unsigned int _22;
  1061. unsigned char MsgBuffIdx.10_23;
  1062. long unsigned int _24;
  1063. Flexcan_Ip_StatusType _68;
  1064. <bb 2> :
  1065. base.8_1 = (long unsigned int) base_33(D);
  1066. _2 = base.8_1 + 128;
  1067. RAM_34 = (const uint32 *) _2;
  1068. ValEndMbPointer_35 = 0B;
  1069. Flexcan_Mb_36 = 0B;
  1070. Flexcan_Mb_Id_37 = 0B;
  1071. Flexcan_Mb_Data_38 = 0B;
  1072. Arbitration_Field_Size_39 = 8;
  1073. _3 = maxMsgBuffNum_40(D) + 4294967295;
  1074. Can_Real_Payload_43 = FlexCAN_GetMbPayloadSize (base_33(D), _3);
  1075. ValEndMb_44 = 0;
  1076. ValEndRam_45 = 0;
  1077. Status_46 = 0;
  1078. _4 = maxMsgBuffNum_40(D) != 0;
  1079. DevAssert (_4);
  1080. _5 = maxMsgBuffNum_40(D) + 4294967295;
  1081. ValEndMbPointer_49 = FlexCAN_GetMsgBuffRegion (base_33(D), _5);
  1082. _6 = (long unsigned int) Can_Real_Payload_43;
  1083. ValEndMbPointer.9_7 = (long unsigned int) ValEndMbPointer_49;
  1084. _8 = _6 + ValEndMbPointer.9_7;
  1085. _9 = (long unsigned int) Arbitration_Field_Size_39;
  1086. ValEndMb_50 = _8 + _9;
  1087. _10 = RAM_34 + 512;
  1088. ValEndRam_51 = (uint32) _10;
  1089. if (ValEndMb_50 > ValEndRam_51)
  1090. goto <bb 4>; [INV]
  1091. else
  1092. goto <bb 3>; [INV]
  1093. <bb 3> :
  1094. _11 = FlexCAN_GetMaxMbNum (base_33(D));
  1095. if (maxMsgBuffNum_40(D) > _11)
  1096. goto <bb 4>; [INV]
  1097. else
  1098. goto <bb 5>; [INV]
  1099. <bb 4> :
  1100. Status_53 = 4;
  1101. <bb 5> :
  1102. # Status_27 = PHI <Status_46(3), Status_53(4)>
  1103. if (Status_27 == 0)
  1104. goto <bb 6>; [INV]
  1105. else
  1106. goto <bb 13>; [INV]
  1107. <bb 6> :
  1108. _12 ={v} base_33(D)->MCR;
  1109. _13 = _12 & 4294967168;
  1110. _14 = maxMsgBuffNum_40(D) + 4294967295;
  1111. _15 = _14 & 127;
  1112. _16 = _13 | _15;
  1113. base_33(D)->MCR ={v} _16;
  1114. _17 ={v} base_33(D)->MCR;
  1115. _18 = _17 & 536870912;
  1116. if (_18 == 0)
  1117. goto <bb 7>; [INV]
  1118. else
  1119. goto <bb 13>; [INV]
  1120. <bb 7> :
  1121. MsgBuffIdx_55 = 0;
  1122. goto <bb 12>; [INV]
  1123. <bb 8> :
  1124. _19 = (long unsigned int) MsgBuffIdx_25;
  1125. Flexcan_Mb_57 = FlexCAN_GetMsgBuffRegion (base_33(D), _19);
  1126. Flexcan_Mb_Id_58 = Flexcan_Mb_57 + 4;
  1127. Flexcan_Mb_Data_59 = Flexcan_Mb_57 + 8;
  1128. *Flexcan_Mb_57 ={v} 0;
  1129. *Flexcan_Mb_Id_58 ={v} 0;
  1130. _20 = (long unsigned int) MsgBuffIdx_25;
  1131. Can_Real_Payload_63 = FlexCAN_GetMbPayloadSize (base_33(D), _20);
  1132. DataByte_64 = 0;
  1133. goto <bb 10>; [INV]
  1134. <bb 9> :
  1135. _21 = Flexcan_Mb_Data_59 + DataByte_26;
  1136. *_21 ={v} 0;
  1137. DataByte_67 = DataByte_26 + 1;
  1138. <bb 10> :
  1139. # DataByte_26 = PHI <DataByte_64(8), DataByte_67(9)>
  1140. _22 = (long unsigned int) Can_Real_Payload_63;
  1141. if (DataByte_26 < _22)
  1142. goto <bb 9>; [INV]
  1143. else
  1144. goto <bb 11>; [INV]
  1145. <bb 11> :
  1146. MsgBuffIdx.10_23 = MsgBuffIdx_25;
  1147. MsgBuffIdx_65 = MsgBuffIdx.10_23 + 1;
  1148. <bb 12> :
  1149. # MsgBuffIdx_25 = PHI <MsgBuffIdx_55(7), MsgBuffIdx_65(11)>
  1150. _24 = (long unsigned int) MsgBuffIdx_25;
  1151. if (maxMsgBuffNum_40(D) > _24)
  1152. goto <bb 8>; [INV]
  1153. else
  1154. goto <bb 13>; [INV]
  1155. <bb 13> :
  1156. _68 = Status_27;
  1157. <bb 14> :
  1158. <L13>:
  1159. return _68;
  1160. }
  1161. FlexCAN_SetTxMsgBuff (volatile uint32 * const pMbAddr, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId, const uint8 * msgData, const boolean isRemote)
  1162. {
  1163. const uint32 * MsgData_32;
  1164. volatile uint32 * Flexcan_Mb_Data_32;
  1165. volatile uint8 * Flexcan_Mb_Data;
  1166. volatile uint32 * Flexcan_Mb_Id;
  1167. volatile uint32 * Flexcan_Mb;
  1168. uint8 Payload_Size;
  1169. uint8 Dlc_Value;
  1170. uint32 DataByte;
  1171. uint32 Flexcan_Mb_Config;
  1172. _Bool _1;
  1173. long unsigned int _2;
  1174. unsigned char _3;
  1175. long unsigned int _4;
  1176. long unsigned int _5;
  1177. const uint32 * _6;
  1178. long unsigned int _7;
  1179. long unsigned int _8;
  1180. long unsigned int _9;
  1181. long unsigned int _10;
  1182. const uint32 * _11;
  1183. long unsigned int _12;
  1184. long unsigned int _13;
  1185. long unsigned int _14;
  1186. long unsigned int _15;
  1187. long unsigned int _16;
  1188. long unsigned int _17;
  1189. const uint32 * _18;
  1190. long unsigned int _19;
  1191. long unsigned int _20;
  1192. long unsigned int _21;
  1193. long unsigned int _22;
  1194. long unsigned int _23;
  1195. long unsigned int _24;
  1196. const uint32 * _25;
  1197. long unsigned int _26;
  1198. long unsigned int _27;
  1199. long unsigned int _28;
  1200. long unsigned int _29;
  1201. volatile uint32 * _30;
  1202. long unsigned int _31;
  1203. long unsigned int _32;
  1204. long unsigned int _33;
  1205. const uint8 * _34;
  1206. long unsigned int _35;
  1207. volatile uint8 * _36;
  1208. unsigned char _37;
  1209. long unsigned int _38;
  1210. long unsigned int _39;
  1211. volatile uint8 * _40;
  1212. unsigned char _41;
  1213. long unsigned int _42;
  1214. <unnamed type> _43;
  1215. long unsigned int _44;
  1216. long unsigned int _45;
  1217. long unsigned int _46;
  1218. long unsigned int _47;
  1219. long unsigned int _48;
  1220. <unnamed type> _49;
  1221. long unsigned int _50;
  1222. long unsigned int _51;
  1223. long unsigned int _52;
  1224. long unsigned int _53;
  1225. long unsigned int _54;
  1226. long unsigned int _55;
  1227. long unsigned int _56;
  1228. long unsigned int _57;
  1229. long unsigned int _58;
  1230. long unsigned int _59;
  1231. long unsigned int _60;
  1232. _Bool _61;
  1233. long unsigned int _62;
  1234. long unsigned int _63;
  1235. long unsigned int _64;
  1236. long unsigned int _65;
  1237. long unsigned int _66;
  1238. long unsigned int _67;
  1239. long unsigned int _68;
  1240. _Bool _69;
  1241. long unsigned int _70;
  1242. long unsigned int _71;
  1243. <bb 2> :
  1244. Flexcan_Mb_Config_87 = 0;
  1245. Flexcan_Mb_89 = pMbAddr_88(D);
  1246. Flexcan_Mb_Id_90 = Flexcan_Mb_89 + 4;
  1247. Flexcan_Mb_Data_91 = Flexcan_Mb_89 + 8;
  1248. Flexcan_Mb_Data_32_92 = Flexcan_Mb_89 + 8;
  1249. MsgData_32_94 = msgData_93(D);
  1250. _1 = cs_95(D) != 0B;
  1251. DevAssert (_1);
  1252. *Flexcan_Mb_89 ={v} 134217728;
  1253. *Flexcan_Mb_Id_90 ={v} 0;
  1254. _2 = cs_95(D)->dataLen;
  1255. _3 = (unsigned char) _2;
  1256. Dlc_Value_101 = FlexCAN_ComputeDLCValue (_3);
  1257. if (msgData_93(D) != 0B)
  1258. goto <bb 3>; [INV]
  1259. else
  1260. goto <bb 12>; [INV]
  1261. <bb 3> :
  1262. DataByte_102 = 0;
  1263. goto <bb 5>; [INV]
  1264. <bb 4> :
  1265. _4 = DataByte_77 >> 2;
  1266. _5 = _4 * 4;
  1267. _6 = MsgData_32_94 + _5;
  1268. _7 = *_6;
  1269. _8 = _7 >> 24;
  1270. _9 = DataByte_77 >> 2;
  1271. _10 = _9 * 4;
  1272. _11 = MsgData_32_94 + _10;
  1273. _12 = *_11;
  1274. _13 = _12 >> 8;
  1275. _14 = _13 & 65280;
  1276. _15 = _8 | _14;
  1277. _16 = DataByte_77 >> 2;
  1278. _17 = _16 * 4;
  1279. _18 = MsgData_32_94 + _17;
  1280. _19 = *_18;
  1281. _20 = _19 << 8;
  1282. _21 = _20 & 16711680;
  1283. _22 = _15 | _21;
  1284. _23 = DataByte_77 >> 2;
  1285. _24 = _23 * 4;
  1286. _25 = MsgData_32_94 + _24;
  1287. _26 = *_25;
  1288. _27 = _26 << 24;
  1289. _28 = DataByte_77 >> 2;
  1290. _29 = _28 * 4;
  1291. _30 = Flexcan_Mb_Data_32_92 + _29;
  1292. _31 = _22 | _27;
  1293. *_30 ={v} _31;
  1294. DataByte_111 = DataByte_77 + 4;
  1295. <bb 5> :
  1296. # DataByte_77 = PHI <DataByte_102(3), DataByte_111(4)>
  1297. _32 = cs_95(D)->dataLen;
  1298. _33 = _32 & 4294967292;
  1299. if (DataByte_77 < _33)
  1300. goto <bb 4>; [INV]
  1301. else
  1302. goto <bb 6>; [INV]
  1303. <bb 6> :
  1304. goto <bb 8>; [INV]
  1305. <bb 7> :
  1306. _34 = msgData_93(D) + DataByte_78;
  1307. _35 = DataByte_78 ^ 3;
  1308. _36 = Flexcan_Mb_Data_91 + _35;
  1309. _37 = *_34;
  1310. *_36 ={v} _37;
  1311. DataByte_109 = DataByte_78 + 1;
  1312. <bb 8> :
  1313. # DataByte_78 = PHI <DataByte_77(6), DataByte_109(7)>
  1314. _38 = cs_95(D)->dataLen;
  1315. if (DataByte_78 < _38)
  1316. goto <bb 7>; [INV]
  1317. else
  1318. goto <bb 9>; [INV]
  1319. <bb 9> :
  1320. Payload_Size_104 = FlexCAN_ComputePayloadSize (Dlc_Value_101);
  1321. DataByte_105 = cs_95(D)->dataLen;
  1322. goto <bb 11>; [INV]
  1323. <bb 10> :
  1324. _39 = DataByte_79 ^ 3;
  1325. _40 = Flexcan_Mb_Data_91 + _39;
  1326. _41 = cs_95(D)->fd_padding;
  1327. *_40 ={v} _41;
  1328. DataByte_107 = DataByte_79 + 1;
  1329. <bb 11> :
  1330. # DataByte_79 = PHI <DataByte_105(9), DataByte_107(10)>
  1331. _42 = (long unsigned int) Payload_Size_104;
  1332. if (DataByte_79 < _42)
  1333. goto <bb 10>; [INV]
  1334. else
  1335. goto <bb 12>; [INV]
  1336. <bb 12> :
  1337. _43 = cs_95(D)->msgIdType;
  1338. if (_43 == 1)
  1339. goto <bb 13>; [INV]
  1340. else
  1341. goto <bb 14>; [INV]
  1342. <bb 13> :
  1343. _44 ={v} *Flexcan_Mb_Id_90;
  1344. _45 = _44 & 3758096384;
  1345. *Flexcan_Mb_Id_90 ={v} _45;
  1346. _46 ={v} *Flexcan_Mb_Id_90;
  1347. _47 = msgId_113(D) & 536870911;
  1348. _48 = _46 | _47;
  1349. *Flexcan_Mb_Id_90 ={v} _48;
  1350. Flexcan_Mb_Config_115 = Flexcan_Mb_Config_87 | 6291456;
  1351. <bb 14> :
  1352. # Flexcan_Mb_Config_72 = PHI <Flexcan_Mb_Config_87(12), Flexcan_Mb_Config_115(13)>
  1353. _49 = cs_95(D)->msgIdType;
  1354. if (_49 == 0)
  1355. goto <bb 15>; [INV]
  1356. else
  1357. goto <bb 16>; [INV]
  1358. <bb 15> :
  1359. _50 ={v} *Flexcan_Mb_Id_90;
  1360. _51 = _50 & 3758358527;
  1361. *Flexcan_Mb_Id_90 ={v} _51;
  1362. _52 ={v} *Flexcan_Mb_Id_90;
  1363. _53 = msgId_113(D) << 18;
  1364. _54 = _53 & 536608768;
  1365. _55 = _52 | _54;
  1366. *Flexcan_Mb_Id_90 ={v} _55;
  1367. Flexcan_Mb_Config_118 = Flexcan_Mb_Config_72 & 4288675839;
  1368. <bb 16> :
  1369. # Flexcan_Mb_Config_73 = PHI <Flexcan_Mb_Config_72(14), Flexcan_Mb_Config_118(15)>
  1370. Flexcan_Mb_Config_119 = Flexcan_Mb_Config_73 & 4293984255;
  1371. _56 = (long unsigned int) Dlc_Value_101;
  1372. _57 = _56 << 16;
  1373. _58 = _57 & 983040;
  1374. Flexcan_Mb_Config_120 = Flexcan_Mb_Config_119 | _58;
  1375. _59 = cs_95(D)->code;
  1376. if (_59 != 15)
  1377. goto <bb 17>; [INV]
  1378. else
  1379. goto <bb 27>; [INV]
  1380. <bb 17> :
  1381. _60 = cs_95(D)->code;
  1382. if (_60 == 28)
  1383. goto <bb 18>; [INV]
  1384. else
  1385. goto <bb 19>; [INV]
  1386. <bb 18> :
  1387. Flexcan_Mb_Config_123 = Flexcan_Mb_Config_120 | 1048576;
  1388. goto <bb 21>; [INV]
  1389. <bb 19> :
  1390. if (isRemote_121(D) != 0)
  1391. goto <bb 20>; [INV]
  1392. else
  1393. goto <bb 21>; [INV]
  1394. <bb 20> :
  1395. Flexcan_Mb_Config_122 = Flexcan_Mb_Config_120 | 1048576;
  1396. <bb 21> :
  1397. # Flexcan_Mb_Config_74 = PHI <Flexcan_Mb_Config_123(18), Flexcan_Mb_Config_120(19), Flexcan_Mb_Config_122(20)>
  1398. Flexcan_Mb_Config_124 = Flexcan_Mb_Config_74 & 4043309055;
  1399. _61 = cs_95(D)->fd_enable;
  1400. if (_61 != 0)
  1401. goto <bb 22>; [INV]
  1402. else
  1403. goto <bb 23>; [INV]
  1404. <bb 22> :
  1405. _62 = cs_95(D)->code;
  1406. _63 = _62 << 24;
  1407. _64 = _63 & 251658240;
  1408. _65 = Flexcan_Mb_Config_124 | _64;
  1409. Flexcan_Mb_Config_126 = _65 | 2147483648;
  1410. Flexcan_Mb_Config_127 = Flexcan_Mb_Config_126 & 4293918719;
  1411. goto <bb 24>; [INV]
  1412. <bb 23> :
  1413. _66 = cs_95(D)->code;
  1414. _67 = _66 << 24;
  1415. _68 = _67 & 251658240;
  1416. Flexcan_Mb_Config_125 = Flexcan_Mb_Config_124 | _68;
  1417. <bb 24> :
  1418. # Flexcan_Mb_Config_75 = PHI <Flexcan_Mb_Config_127(22), Flexcan_Mb_Config_125(23)>
  1419. _69 = cs_95(D)->enable_brs;
  1420. if (_69 != 0)
  1421. goto <bb 25>; [INV]
  1422. else
  1423. goto <bb 26>; [INV]
  1424. <bb 25> :
  1425. Flexcan_Mb_Config_128 = Flexcan_Mb_Config_75 | 1073741824;
  1426. <bb 26> :
  1427. # Flexcan_Mb_Config_76 = PHI <Flexcan_Mb_Config_75(24), Flexcan_Mb_Config_128(25)>
  1428. _70 ={v} *Flexcan_Mb_89;
  1429. _71 = Flexcan_Mb_Config_76 | _70;
  1430. *Flexcan_Mb_89 ={v} _71;
  1431. <bb 27> :
  1432. return;
  1433. }
  1434. FlexCAN_GetMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, struct Flexcan_Ip_MsgBuffType * msgBuff)
  1435. {
  1436. uint8 Payload_Size;
  1437. uint8 Flexcan_Mb_Dlc_Value;
  1438. uint32 MbWord;
  1439. uint32 * MsgBuff_Data_32;
  1440. const uint32 * Flexcan_Mb_Data_32;
  1441. const uint8 * Flexcan_Mb_Data;
  1442. const uint32 * Flexcan_Mb_Id;
  1443. const uint32 * Flexcan_Mb;
  1444. uint8 i;
  1445. long unsigned int _1;
  1446. long unsigned int _2;
  1447. unsigned char _3;
  1448. _Bool _4;
  1449. unsigned char _5;
  1450. long unsigned int _6;
  1451. long unsigned int _7;
  1452. long unsigned int _8;
  1453. long unsigned int _9;
  1454. long unsigned int _10;
  1455. long unsigned int _11;
  1456. long unsigned int _12;
  1457. long unsigned int _13;
  1458. unsigned char _14;
  1459. unsigned int _15;
  1460. unsigned int _16;
  1461. const uint32 * _17;
  1462. long unsigned int _18;
  1463. long unsigned int _19;
  1464. long unsigned int _20;
  1465. long unsigned int _21;
  1466. long unsigned int _22;
  1467. long unsigned int _23;
  1468. long unsigned int _24;
  1469. long unsigned int _25;
  1470. unsigned char _26;
  1471. unsigned int _27;
  1472. unsigned int _28;
  1473. uint32 * _29;
  1474. long unsigned int _30;
  1475. unsigned int _31;
  1476. unsigned int _32;
  1477. unsigned int _33;
  1478. unsigned char _34;
  1479. sizetype _35;
  1480. const uint8 * _36;
  1481. int _37;
  1482. unsigned char _38;
  1483. unsigned char i.7_39;
  1484. <bb 2> :
  1485. Flexcan_Mb_51 = FlexCAN_GetMsgBuffRegion (base_48(D), msgBuffIdx_49(D));
  1486. Flexcan_Mb_Id_52 = Flexcan_Mb_51 + 4;
  1487. Flexcan_Mb_Data_53 = Flexcan_Mb_51 + 8;
  1488. Flexcan_Mb_Data_32_54 = Flexcan_Mb_51 + 8;
  1489. MsgBuff_Data_32_56 = &msgBuff_55(D)->data;
  1490. _1 ={v} *Flexcan_Mb_51;
  1491. _2 = _1 >> 16;
  1492. _3 = (unsigned char) _2;
  1493. Flexcan_Mb_Dlc_Value_57 = _3 & 15;
  1494. Payload_Size_59 = FlexCAN_ComputePayloadSize (Flexcan_Mb_Dlc_Value_57);
  1495. _4 = msgBuff_55(D) != 0B;
  1496. DevAssert (_4);
  1497. _5 = FlexCAN_GetMbPayloadSize (base_48(D), msgBuffIdx_49(D));
  1498. if (Payload_Size_59 > _5)
  1499. goto <bb 3>; [INV]
  1500. else
  1501. goto <bb 4>; [INV]
  1502. <bb 3> :
  1503. Payload_Size_63 = FlexCAN_GetMbPayloadSize (base_48(D), msgBuffIdx_49(D));
  1504. <bb 4> :
  1505. # Payload_Size_42 = PHI <Payload_Size_59(2), Payload_Size_63(3)>
  1506. msgBuff_55(D)->dataLen = Payload_Size_42;
  1507. _6 ={v} *Flexcan_Mb_51;
  1508. msgBuff_55(D)->cs = _6;
  1509. _7 = msgBuff_55(D)->cs;
  1510. _8 = _7 & 2097152;
  1511. if (_8 != 0)
  1512. goto <bb 5>; [INV]
  1513. else
  1514. goto <bb 6>; [INV]
  1515. <bb 5> :
  1516. _9 ={v} *Flexcan_Mb_Id_52;
  1517. msgBuff_55(D)->msgId = _9;
  1518. goto <bb 7>; [INV]
  1519. <bb 6> :
  1520. _10 ={v} *Flexcan_Mb_Id_52;
  1521. _11 = _10 >> 18;
  1522. msgBuff_55(D)->msgId = _11;
  1523. <bb 7> :
  1524. _12 = msgBuff_55(D)->cs;
  1525. _13 = _12 & 65535;
  1526. msgBuff_55(D)->time_stamp = _13;
  1527. i_69 = 0;
  1528. goto <bb 9>; [INV]
  1529. <bb 8> :
  1530. _14 = i_40 >> 2;
  1531. _15 = (unsigned int) _14;
  1532. _16 = _15 * 4;
  1533. _17 = Flexcan_Mb_Data_32_54 + _16;
  1534. MbWord_72 ={v} *_17;
  1535. _18 = MbWord_72 >> 24;
  1536. _19 = MbWord_72 >> 8;
  1537. _20 = _19 & 65280;
  1538. _21 = _18 | _20;
  1539. _22 = MbWord_72 << 8;
  1540. _23 = _22 & 16711680;
  1541. _24 = _21 | _23;
  1542. _25 = MbWord_72 << 24;
  1543. _26 = i_40 >> 2;
  1544. _27 = (unsigned int) _26;
  1545. _28 = _27 * 4;
  1546. _29 = MsgBuff_Data_32_56 + _28;
  1547. _30 = _24 | _25;
  1548. *_29 = _30;
  1549. i_74 = i_40 + 4;
  1550. <bb 9> :
  1551. # i_40 = PHI <i_69(7), i_74(8)>
  1552. _31 = (unsigned int) i_40;
  1553. _32 = (unsigned int) Payload_Size_42;
  1554. _33 = _32 & 4294967292;
  1555. if (_31 < _33)
  1556. goto <bb 8>; [INV]
  1557. else
  1558. goto <bb 10>; [INV]
  1559. <bb 10> :
  1560. goto <bb 12>; [INV]
  1561. <bb 11> :
  1562. _34 = i_41 ^ 3;
  1563. _35 = (sizetype) _34;
  1564. _36 = Flexcan_Mb_Data_53 + _35;
  1565. _37 = (int) i_41;
  1566. _38 ={v} *_36;
  1567. msgBuff_55(D)->data[_37] = _38;
  1568. i.7_39 = i_41;
  1569. i_71 = i.7_39 + 1;
  1570. <bb 12> :
  1571. # i_41 = PHI <i_40(10), i_71(11)>
  1572. if (i_41 < Payload_Size_42)
  1573. goto <bb 11>; [INV]
  1574. else
  1575. goto <bb 13>; [INV]
  1576. <bb 13> :
  1577. return;
  1578. }
  1579. FlexCAN_GetMsgBuffTimestamp (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
  1580. {
  1581. const uint32 * Flexcan_Mb;
  1582. uint32 TimeStamp;
  1583. uint32 D.7517;
  1584. long unsigned int _1;
  1585. uint32 _9;
  1586. <bb 2> :
  1587. TimeStamp_2 = 0;
  1588. Flexcan_Mb_7 = FlexCAN_GetMsgBuffRegion (base_4(D), msgBuffIdx_5(D));
  1589. _1 ={v} *Flexcan_Mb_7;
  1590. TimeStamp_8 = _1 & 65535;
  1591. _9 = TimeStamp_8;
  1592. <bb 3> :
  1593. <L0>:
  1594. return _9;
  1595. }
  1596. FlexCAN_SetRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId)
  1597. {
  1598. volatile uint32 * flexcan_mb_id;
  1599. volatile uint32 * flexcan_mb;
  1600. _Bool _1;
  1601. <unnamed type> _2;
  1602. long unsigned int _3;
  1603. long unsigned int _4;
  1604. long unsigned int _5;
  1605. long unsigned int _6;
  1606. long unsigned int _7;
  1607. long unsigned int _8;
  1608. long unsigned int _9;
  1609. long unsigned int _10;
  1610. long unsigned int _11;
  1611. <unnamed type> _12;
  1612. long unsigned int _13;
  1613. long unsigned int _14;
  1614. long unsigned int _15;
  1615. long unsigned int _16;
  1616. long unsigned int _17;
  1617. long unsigned int _18;
  1618. long unsigned int _19;
  1619. long unsigned int _20;
  1620. long unsigned int _21;
  1621. long unsigned int _22;
  1622. long unsigned int _23;
  1623. long unsigned int _24;
  1624. long unsigned int _25;
  1625. long unsigned int _26;
  1626. long unsigned int _27;
  1627. long unsigned int _28;
  1628. <bb 2> :
  1629. flexcan_mb_36 = FlexCAN_GetMsgBuffRegion (base_33(D), msgBuffIdx_34(D));
  1630. flexcan_mb_id_37 = flexcan_mb_36 + 4;
  1631. _1 = cs_38(D) != 0B;
  1632. DevAssert (_1);
  1633. *flexcan_mb_36 ={v} 0;
  1634. *flexcan_mb_id_37 ={v} 0;
  1635. _2 = cs_38(D)->msgIdType;
  1636. if (_2 == 1)
  1637. goto <bb 3>; [INV]
  1638. else
  1639. goto <bb 4>; [INV]
  1640. <bb 3> :
  1641. _3 ={v} *flexcan_mb_36;
  1642. _4 = _3 | 2097152;
  1643. *flexcan_mb_36 ={v} _4;
  1644. _5 ={v} *flexcan_mb_36;
  1645. _6 = _5 & 4290772991;
  1646. *flexcan_mb_36 ={v} _6;
  1647. _7 ={v} *flexcan_mb_id_37;
  1648. _8 = _7 & 3758096384;
  1649. *flexcan_mb_id_37 ={v} _8;
  1650. _9 ={v} *flexcan_mb_id_37;
  1651. _10 = msgId_45(D) & 536870911;
  1652. _11 = _9 | _10;
  1653. *flexcan_mb_id_37 ={v} _11;
  1654. <bb 4> :
  1655. _12 = cs_38(D)->msgIdType;
  1656. if (_12 == 0)
  1657. goto <bb 5>; [INV]
  1658. else
  1659. goto <bb 6>; [INV]
  1660. <bb 5> :
  1661. _13 ={v} *flexcan_mb_36;
  1662. _14 = _13 & 4288675839;
  1663. *flexcan_mb_36 ={v} _14;
  1664. _15 ={v} *flexcan_mb_id_37;
  1665. _16 = _15 & 3758358527;
  1666. *flexcan_mb_id_37 ={v} _16;
  1667. _17 ={v} *flexcan_mb_id_37;
  1668. _18 = msgId_45(D) << 18;
  1669. _19 = _18 & 536608768;
  1670. _20 = _17 | _19;
  1671. *flexcan_mb_id_37 ={v} _20;
  1672. <bb 6> :
  1673. _21 = cs_38(D)->code;
  1674. if (_21 != 15)
  1675. goto <bb 7>; [INV]
  1676. else
  1677. goto <bb 8>; [INV]
  1678. <bb 7> :
  1679. _22 ={v} *flexcan_mb_36;
  1680. _23 = _22 & 4043309055;
  1681. *flexcan_mb_36 ={v} _23;
  1682. _24 ={v} *flexcan_mb_36;
  1683. _25 = cs_38(D)->code;
  1684. _26 = _25 << 24;
  1685. _27 = _26 & 251658240;
  1686. _28 = _24 | _27;
  1687. *flexcan_mb_36 ={v} _28;
  1688. <bb 8> :
  1689. return;
  1690. }
  1691. FlexCAN_EnableInterrupts (struct FLEXCAN_Type * pBase, uint8 u8Instance)
  1692. {
  1693. int _1;
  1694. long unsigned int _2;
  1695. <bb 2> :
  1696. _1 = (int) u8Instance_3(D);
  1697. _2 ={v} FlexCAN_Ip_au32ImaskBuff[_1][0];
  1698. pBase_5(D)->IMASK1 ={v} _2;
  1699. return;
  1700. }
  1701. FlexCAN_DisableInterrupts (struct FLEXCAN_Type * pBase)
  1702. {
  1703. <bb 2> :
  1704. pBase_2(D)->IMASK1 ={v} 0;
  1705. return;
  1706. }
  1707. FLEXCAN_ClearMsgBuffIntCmd (struct FLEXCAN_Type * pBase, uint8 u8Instance, uint32 mb_idx, boolean bIsIntActive)
  1708. {
  1709. uint32 temp;
  1710. long unsigned int _1;
  1711. long unsigned int _2;
  1712. long unsigned int _3;
  1713. int _4;
  1714. long unsigned int _5;
  1715. int _6;
  1716. long unsigned int _7;
  1717. <bb 2> :
  1718. _1 = mb_idx_10(D) & 31;
  1719. temp_11 = 1 << _1;
  1720. if (mb_idx_10(D) <= 31)
  1721. goto <bb 3>; [INV]
  1722. else
  1723. goto <bb 6>; [INV]
  1724. <bb 3> :
  1725. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_11 ();
  1726. _2 ={v} pBase_14(D)->IMASK1;
  1727. _3 = ~temp_11;
  1728. _4 = (int) u8Instance_15(D);
  1729. _5 = _2 & _3;
  1730. FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5;
  1731. if (bIsIntActive_17(D) != 0)
  1732. goto <bb 4>; [INV]
  1733. else
  1734. goto <bb 5>; [INV]
  1735. <bb 4> :
  1736. _6 = (int) u8Instance_15(D);
  1737. _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0];
  1738. pBase_14(D)->IMASK1 ={v} _7;
  1739. <bb 5> :
  1740. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_11 ();
  1741. <bb 6> :
  1742. return;
  1743. }
  1744. FlexCAN_SetMsgBuffIntCmd (struct FLEXCAN_Type * base, uint8 u8Instance, uint32 msgBuffIdx, boolean enable, boolean bIsIntActive)
  1745. {
  1746. Flexcan_Ip_StatusType stat;
  1747. uint32 temp;
  1748. Flexcan_Ip_StatusType D.7505;
  1749. long unsigned int _1;
  1750. int _2;
  1751. long unsigned int _3;
  1752. int _4;
  1753. long unsigned int _5;
  1754. int _6;
  1755. long unsigned int _7;
  1756. int _8;
  1757. long unsigned int _9;
  1758. long unsigned int _10;
  1759. int _11;
  1760. long unsigned int _12;
  1761. int _13;
  1762. long unsigned int _14;
  1763. Flexcan_Ip_StatusType _33;
  1764. <bb 2> :
  1765. stat_17 = 0;
  1766. _1 = msgBuffIdx_18(D) & 31;
  1767. temp_19 = 1 << _1;
  1768. if (msgBuffIdx_18(D) <= 31)
  1769. goto <bb 3>; [INV]
  1770. else
  1771. goto <bb 8>; [INV]
  1772. <bb 3> :
  1773. if (enable_21(D) != 0)
  1774. goto <bb 4>; [INV]
  1775. else
  1776. goto <bb 7>; [INV]
  1777. <bb 4> :
  1778. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  1779. _2 = (int) u8Instance_23(D);
  1780. _3 ={v} FlexCAN_Ip_au32ImaskBuff[_2][0];
  1781. _4 = (int) u8Instance_23(D);
  1782. _5 = temp_19 | _3;
  1783. FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5;
  1784. if (bIsIntActive_30(D) != 0)
  1785. goto <bb 5>; [INV]
  1786. else
  1787. goto <bb 6>; [INV]
  1788. <bb 5> :
  1789. _6 = (int) u8Instance_23(D);
  1790. _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0];
  1791. base_25(D)->IMASK1 ={v} _7;
  1792. <bb 6> :
  1793. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();
  1794. goto <bb 8>; [INV]
  1795. <bb 7> :
  1796. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  1797. _8 = (int) u8Instance_23(D);
  1798. _9 ={v} FlexCAN_Ip_au32ImaskBuff[_8][0];
  1799. _10 = ~temp_19;
  1800. _11 = (int) u8Instance_23(D);
  1801. _12 = _9 & _10;
  1802. FlexCAN_Ip_au32ImaskBuff[_11][0] ={v} _12;
  1803. _13 = (int) u8Instance_23(D);
  1804. _14 ={v} FlexCAN_Ip_au32ImaskBuff[_13][0];
  1805. base_25(D)->IMASK1 ={v} _14;
  1806. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();
  1807. <bb 8> :
  1808. _33 = stat_17;
  1809. <bb 9> :
  1810. <L7>:
  1811. return _33;
  1812. }
  1813. FlexCAN_LockRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
  1814. {
  1815. const uint32 * flexcan_mb;
  1816. long unsigned int vol.6;
  1817. long unsigned int vol.6_6;
  1818. <bb 2> :
  1819. flexcan_mb_5 = FlexCAN_GetMsgBuffRegion (base_2(D), msgBuffIdx_3(D));
  1820. vol.6_6 ={v} *flexcan_mb_5;
  1821. return;
  1822. }
  1823. FlexCAN_GetMbPayloadSize (const struct FLEXCAN_Type * base, uint32 maxMsgBuffNum)
  1824. {
  1825. uint8 mb_size;
  1826. uint8 i;
  1827. uint8 maxMbBlockNum;
  1828. uint8 can_real_payload;
  1829. uint32 ramBlockSize;
  1830. uint8 arbitration_field_size;
  1831. uint8 D.7495;
  1832. long unsigned int _1;
  1833. long unsigned int _2;
  1834. unsigned char _3;
  1835. long unsigned int _4;
  1836. unsigned char i.5_5;
  1837. uint8 _27;
  1838. <bb 2> :
  1839. arbitration_field_size_12 = 8;
  1840. ramBlockSize_13 = 512;
  1841. can_real_payload_14 = 8;
  1842. maxMbBlockNum_15 = 0;
  1843. i_16 = 0;
  1844. mb_size_17 = 0;
  1845. i_18 = 0;
  1846. goto <bb 6>; [INV]
  1847. <bb 3> :
  1848. can_real_payload_22 = FlexCAN_GetPayloadSize (base_20(D), i_9);
  1849. mb_size_23 = can_real_payload_22 + arbitration_field_size_12;
  1850. _1 = (long unsigned int) mb_size_23;
  1851. _2 = ramBlockSize_13 / _1;
  1852. _3 = (unsigned char) _2;
  1853. maxMbBlockNum_24 = maxMbBlockNum_8 + _3;
  1854. _4 = (long unsigned int) maxMbBlockNum_24;
  1855. if (maxMsgBuffNum_25(D) < _4)
  1856. goto <bb 4>; [INV]
  1857. else
  1858. goto <bb 5>; [INV]
  1859. <bb 4> :
  1860. goto <bb 7>; [INV]
  1861. <bb 5> :
  1862. i.5_5 = i_9;
  1863. i_26 = i.5_5 + 1;
  1864. <bb 6> :
  1865. # can_real_payload_6 = PHI <can_real_payload_14(2), can_real_payload_22(5)>
  1866. # maxMbBlockNum_8 = PHI <maxMbBlockNum_15(2), maxMbBlockNum_24(5)>
  1867. # i_9 = PHI <i_18(2), i_26(5)>
  1868. if (i_9 == 0)
  1869. goto <bb 3>; [INV]
  1870. else
  1871. goto <bb 7>; [INV]
  1872. <bb 7> :
  1873. # can_real_payload_7 = PHI <can_real_payload_22(4), can_real_payload_6(6)>
  1874. _27 = can_real_payload_7;
  1875. <bb 8> :
  1876. <L5>:
  1877. return _27;
  1878. }
  1879. FlexCAN_GetPayloadSize (const struct FLEXCAN_Type * base, uint8 mbdsrIdx)
  1880. {
  1881. uint32 payloadSize;
  1882. uint8 D.7491;
  1883. _Bool _1;
  1884. int _2;
  1885. long unsigned int _3;
  1886. long unsigned int _4;
  1887. long unsigned int _5;
  1888. long unsigned int _6;
  1889. long unsigned int _7;
  1890. long unsigned int _8;
  1891. uint8 _17;
  1892. <bb 2> :
  1893. payloadSize_10 = 8;
  1894. _1 = FlexCAN_IsFDAvailable (base_12(D));
  1895. if (_1 != 0)
  1896. goto <bb 3>; [INV]
  1897. else
  1898. goto <bb 6>; [INV]
  1899. <bb 3> :
  1900. _2 = (int) mbdsrIdx_14(D);
  1901. if (_2 == 0)
  1902. goto <bb 4>; [INV]
  1903. else
  1904. goto <bb 5>; [INV]
  1905. <bb 4> :
  1906. <L1>:
  1907. _3 ={v} base_12(D)->FDCTRL;
  1908. _4 = _3 >> 16;
  1909. _5 = _4 & 3;
  1910. payloadSize_15 = 8 << _5;
  1911. goto <bb 6>; [INV]
  1912. <bb 5> :
  1913. <L2>:
  1914. _6 ={v} base_12(D)->FDCTRL;
  1915. _7 = _6 >> 16;
  1916. _8 = _7 & 3;
  1917. payloadSize_16 = 8 << _8;
  1918. <bb 6> :
  1919. # payloadSize_9 = PHI <payloadSize_10(2), payloadSize_15(4), payloadSize_16(5)>
  1920. _17 = (uint8) payloadSize_9;
  1921. <bb 7> :
  1922. <L5>:
  1923. return _17;
  1924. }
  1925. FlexCAN_SetPayloadSize (struct FLEXCAN_Type * base, const struct Flexcan_Ip_PayloadSizeType * payloadSize)
  1926. {
  1927. uint32 tmp;
  1928. int iftmp.3;
  1929. _Bool _1;
  1930. <unnamed type> _2;
  1931. _Bool _3;
  1932. _Bool _4;
  1933. <unnamed type> _5;
  1934. long unsigned int _6;
  1935. int iftmp.3_7;
  1936. int iftmp.3_13;
  1937. int iftmp.3_14;
  1938. <bb 2> :
  1939. _1 = FlexCAN_IsFDEnabled (base_10(D));
  1940. if (_1 != 0)
  1941. goto <bb 4>; [INV]
  1942. else
  1943. goto <bb 3>; [INV]
  1944. <bb 3> :
  1945. _2 = payloadSize_12(D)->payloadBlock0;
  1946. if (_2 == 0)
  1947. goto <bb 4>; [INV]
  1948. else
  1949. goto <bb 5>; [INV]
  1950. <bb 4> :
  1951. iftmp.3_14 = 1;
  1952. goto <bb 6>; [INV]
  1953. <bb 5> :
  1954. iftmp.3_13 = 0;
  1955. <bb 6> :
  1956. # iftmp.3_7 = PHI <iftmp.3_14(4), iftmp.3_13(5)>
  1957. _3 = (_Bool) iftmp.3_7;
  1958. DevAssert (_3);
  1959. _4 = FlexCAN_IsFDEnabled (base_10(D));
  1960. if (_4 != 0)
  1961. goto <bb 7>; [INV]
  1962. else
  1963. goto <bb 8>; [INV]
  1964. <bb 7> :
  1965. tmp_17 ={v} base_10(D)->FDCTRL;
  1966. tmp_18 = tmp_17 & 4294770687;
  1967. _5 = payloadSize_12(D)->payloadBlock0;
  1968. _6 = _5 << 16;
  1969. tmp_19 = tmp_18 | _6;
  1970. base_10(D)->FDCTRL ={v} tmp_19;
  1971. <bb 8> :
  1972. return;
  1973. }
  1974. FlexCAN_IsFDAvailable (const struct FLEXCAN_Type * base)
  1975. {
  1976. boolean returnValue;
  1977. static struct FLEXCAN_Type * const flexcanBase[1] = {1073889280B};
  1978. uint32 i;
  1979. boolean D.7475;
  1980. struct FLEXCAN_Type * _1;
  1981. boolean _11;
  1982. <bb 2> :
  1983. i_4 = 0;
  1984. returnValue_5 = 0;
  1985. i_6 = 0;
  1986. goto <bb 6>; [INV]
  1987. <bb 3> :
  1988. _1 = flexcanBase[i_2];
  1989. if (base_8(D) == _1)
  1990. goto <bb 4>; [INV]
  1991. else
  1992. goto <bb 5>; [INV]
  1993. <bb 4> :
  1994. returnValue_10 = 1;
  1995. goto <bb 7>; [INV]
  1996. <bb 5> :
  1997. i_9 = i_2 + 1;
  1998. <bb 6> :
  1999. # i_2 = PHI <i_6(2), i_9(5)>
  2000. if (i_2 == 0)
  2001. goto <bb 3>; [INV]
  2002. else
  2003. goto <bb 7>; [INV]
  2004. <bb 7> :
  2005. # returnValue_3 = PHI <returnValue_10(4), returnValue_5(6)>
  2006. _11 = returnValue_3;
  2007. <bb 8> :
  2008. <L5>:
  2009. return _11;
  2010. }
  2011. FlexCAN_EnableRxFifo (struct FLEXCAN_Type * base, uint32 numOfFilters)
  2012. {
  2013. Flexcan_Ip_StatusType stat;
  2014. uint16 noOfMbx;
  2015. uint32 i;
  2016. Flexcan_Ip_StatusType D.7471;
  2017. long unsigned int _1;
  2018. long unsigned int _2;
  2019. long unsigned int _3;
  2020. long unsigned int _4;
  2021. long unsigned int _5;
  2022. long unsigned int _6;
  2023. long unsigned int _7;
  2024. long unsigned int _8;
  2025. long unsigned int _9;
  2026. long unsigned int _10;
  2027. long unsigned int _11;
  2028. Flexcan_Ip_StatusType _29;
  2029. <bb 2> :
  2030. _1 = FlexCAN_GetMaxMbNum (base_17(D));
  2031. noOfMbx_19 = (uint16) _1;
  2032. stat_20 = 0;
  2033. _2 ={v} base_17(D)->MCR;
  2034. _3 = _2 & 2048;
  2035. if (_3 != 0)
  2036. goto <bb 3>; [INV]
  2037. else
  2038. goto <bb 4>; [INV]
  2039. <bb 3> :
  2040. stat_21 = 1;
  2041. <bb 4> :
  2042. # stat_13 = PHI <stat_20(2), stat_21(3)>
  2043. if (stat_13 == 0)
  2044. goto <bb 5>; [INV]
  2045. else
  2046. goto <bb 8>; [INV]
  2047. <bb 5> :
  2048. _4 ={v} base_17(D)->MCR;
  2049. _5 = _4 | 536870912;
  2050. base_17(D)->MCR ={v} _5;
  2051. _6 ={v} base_17(D)->CTRL2;
  2052. _7 = _6 & 4043309055;
  2053. _8 = numOfFilters_23(D) << 24;
  2054. _9 = _8 & 251658240;
  2055. _10 = _7 | _9;
  2056. base_17(D)->CTRL2 ={v} _10;
  2057. base_17(D)->RXFGMASK ={v} 4294967295;
  2058. i_26 = 0;
  2059. goto <bb 7>; [INV]
  2060. <bb 6> :
  2061. base_17(D)->RXIMR[i_12] ={v} 536870911;
  2062. i_28 = i_12 + 1;
  2063. <bb 7> :
  2064. # i_12 = PHI <i_26(5), i_28(6)>
  2065. _11 = (long unsigned int) noOfMbx_19;
  2066. if (i_12 < _11)
  2067. goto <bb 6>; [INV]
  2068. else
  2069. goto <bb 8>; [INV]
  2070. <bb 8> :
  2071. _29 = stat_13;
  2072. <bb 9> :
  2073. <L7>:
  2074. return _29;
  2075. }
  2076. FlexCAN_Init (struct FLEXCAN_Type * base)
  2077. {
  2078. Flexcan_Ip_StatusType returnResult;
  2079. uint32 uS2Ticks;
  2080. uint32 timeElapsed;
  2081. uint32 timeStart;
  2082. Flexcan_Ip_StatusType D.7464;
  2083. long unsigned int D.7457;
  2084. long unsigned int _1;
  2085. long unsigned int _2;
  2086. long unsigned int _3;
  2087. long unsigned int _4;
  2088. long unsigned int _5;
  2089. long unsigned int _6;
  2090. long unsigned int _7;
  2091. _Bool _8;
  2092. long unsigned int _25;
  2093. Flexcan_Ip_StatusType _42;
  2094. <bb 2> :
  2095. timeStart = 0;
  2096. timeElapsed_16 = 0;
  2097. uS2Ticks_18 = OsIf_MicrosToTicks (1000000, 0);
  2098. returnResult_19 = 0;
  2099. _1 ={v} base_20(D)->MCR;
  2100. _2 = _1 | 33554432;
  2101. base_20(D)->MCR ={v} _2;
  2102. _3 = OsIf_GetCounter (0);
  2103. timeStart = _3;
  2104. goto <bb 5>; [INV]
  2105. <bb 3> :
  2106. _25 = OsIf_GetElapsed (&timeStart, 0);
  2107. timeElapsed_26 = _25 + timeElapsed_9;
  2108. if (timeElapsed_26 >= uS2Ticks_18)
  2109. goto <bb 4>; [INV]
  2110. else
  2111. goto <bb 5>; [INV]
  2112. <bb 4> :
  2113. returnResult_27 = 3;
  2114. goto <bb 6>; [INV]
  2115. <bb 5> :
  2116. # timeElapsed_9 = PHI <timeElapsed_16(2), timeElapsed_26(3)>
  2117. _4 ={v} base_20(D)->MCR;
  2118. _5 = _4 & 33554432;
  2119. if (_5 != 0)
  2120. goto <bb 3>; [INV]
  2121. else
  2122. goto <bb 6>; [INV]
  2123. <bb 6> :
  2124. # returnResult_10 = PHI <returnResult_27(4), returnResult_19(5)>
  2125. if (returnResult_10 == 0)
  2126. goto <bb 7>; [INV]
  2127. else
  2128. goto <bb 9>; [INV]
  2129. <bb 7> :
  2130. _6 ={v} base_20(D)->MCR;
  2131. _7 = _6 | 4096;
  2132. base_20(D)->MCR ={v} _7;
  2133. FlexCAN_ClearRAM (base_20(D));
  2134. base_20(D)->RXMGMASK ={v} 4294967295;
  2135. base_20(D)->RX14MASK ={v} 4294967295;
  2136. base_20(D)->RX15MASK ={v} 4294967295;
  2137. base_20(D)->IMASK1 ={v} 0;
  2138. base_20(D)->IFLAG1 ={v} 4294967295;
  2139. base_20(D)->ESR1 ={v} 3866630;
  2140. base_20(D)->CTRL1 ={v} 0;
  2141. base_20(D)->CTRL2 ={v} 1048576;
  2142. base_20(D)->CBT ={v} 0;
  2143. _8 = FlexCAN_IsFDAvailable (base_20(D));
  2144. if (_8 != 0)
  2145. goto <bb 8>; [INV]
  2146. else
  2147. goto <bb 9>; [INV]
  2148. <bb 8> :
  2149. base_20(D)->FDCBT ={v} 0;
  2150. base_20(D)->FDCTRL ={v} 2147500288;
  2151. <bb 9> :
  2152. _42 = returnResult_10;
  2153. timeStart ={v} {CLOBBER};
  2154. <bb 10> :
  2155. <L10>:
  2156. return _42;
  2157. }
  2158. FlexCAN_SetErrIntCmd (struct FLEXCAN_Type * base, flexcan_int_type_t errType, boolean enable)
  2159. {
  2160. uint32 temp;
  2161. long unsigned int _1;
  2162. long unsigned int _2;
  2163. long unsigned int _3;
  2164. long unsigned int _4;
  2165. long unsigned int _5;
  2166. long unsigned int _6;
  2167. long unsigned int _7;
  2168. long unsigned int _8;
  2169. long unsigned int _9;
  2170. long unsigned int _10;
  2171. long unsigned int _11;
  2172. long unsigned int _12;
  2173. long unsigned int _13;
  2174. long unsigned int _14;
  2175. long unsigned int _15;
  2176. <bb 2> :
  2177. temp_19 = errType_18(D);
  2178. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_06 ();
  2179. if (enable_22(D) != 0)
  2180. goto <bb 3>; [INV]
  2181. else
  2182. goto <bb 9>; [INV]
  2183. <bb 3> :
  2184. if (errType_18(D) == 16385)
  2185. goto <bb 4>; [INV]
  2186. else
  2187. goto <bb 5>; [INV]
  2188. <bb 4> :
  2189. _1 ={v} base_23(D)->CTRL2;
  2190. _2 = _1 | 2147483648;
  2191. base_23(D)->CTRL2 ={v} _2;
  2192. goto <bb 14>; [INV]
  2193. <bb 5> :
  2194. if (errType_18(D) == 1024)
  2195. goto <bb 7>; [INV]
  2196. else
  2197. goto <bb 6>; [INV]
  2198. <bb 6> :
  2199. if (errType_18(D) == 2048)
  2200. goto <bb 7>; [INV]
  2201. else
  2202. goto <bb 8>; [INV]
  2203. <bb 7> :
  2204. _3 ={v} base_23(D)->MCR;
  2205. _4 = _3 | 2097152;
  2206. base_23(D)->MCR ={v} _4;
  2207. <bb 8> :
  2208. _5 ={v} base_23(D)->CTRL1;
  2209. _6 = temp_19 | _5;
  2210. base_23(D)->CTRL1 ={v} _6;
  2211. goto <bb 14>; [INV]
  2212. <bb 9> :
  2213. if (errType_18(D) == 16385)
  2214. goto <bb 10>; [INV]
  2215. else
  2216. goto <bb 11>; [INV]
  2217. <bb 10> :
  2218. _7 ={v} base_23(D)->CTRL2;
  2219. _8 = _7 & 2147483647;
  2220. base_23(D)->CTRL2 ={v} _8;
  2221. goto <bb 14>; [INV]
  2222. <bb 11> :
  2223. _9 ={v} base_23(D)->CTRL1;
  2224. _10 = ~temp_19;
  2225. _11 = _9 & _10;
  2226. base_23(D)->CTRL1 ={v} _11;
  2227. temp_25 ={v} base_23(D)->CTRL1;
  2228. _12 = temp_25 & 1024;
  2229. if (_12 == 0)
  2230. goto <bb 12>; [INV]
  2231. else
  2232. goto <bb 14>; [INV]
  2233. <bb 12> :
  2234. _13 = temp_25 & 2048;
  2235. if (_13 == 0)
  2236. goto <bb 13>; [INV]
  2237. else
  2238. goto <bb 14>; [INV]
  2239. <bb 13> :
  2240. _14 ={v} base_23(D)->MCR;
  2241. _15 = _14 & 4292870143;
  2242. base_23(D)->MCR ={v} _15;
  2243. <bb 14> :
  2244. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_06 ();
  2245. return;
  2246. }
  2247. FlexCAN_Disable (struct FLEXCAN_Type * base)
  2248. {
  2249. Flexcan_Ip_StatusType returnResult;
  2250. uint32 uS2Ticks;
  2251. uint32 timeElapsed;
  2252. uint32 timeStart;
  2253. Flexcan_Ip_StatusType D.7438;
  2254. long unsigned int D.7435;
  2255. long unsigned int _1;
  2256. signed int _2;
  2257. long unsigned int _3;
  2258. long unsigned int _4;
  2259. long unsigned int _5;
  2260. long unsigned int _6;
  2261. long unsigned int _7;
  2262. long unsigned int _25;
  2263. Flexcan_Ip_StatusType _28;
  2264. <bb 2> :
  2265. timeStart = 0;
  2266. timeElapsed_14 = 0;
  2267. uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0);
  2268. returnResult_17 = 0;
  2269. _1 ={v} base_18(D)->MCR;
  2270. _2 = (signed int) _1;
  2271. if (_2 >= 0)
  2272. goto <bb 3>; [INV]
  2273. else
  2274. goto <bb 7>; [INV]
  2275. <bb 3> :
  2276. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_05 ();
  2277. _3 ={v} base_18(D)->MCR;
  2278. _4 = _3 | 2147483648;
  2279. base_18(D)->MCR ={v} _4;
  2280. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_05 ();
  2281. _5 = OsIf_GetCounter (0);
  2282. timeStart = _5;
  2283. goto <bb 6>; [INV]
  2284. <bb 4> :
  2285. _25 = OsIf_GetElapsed (&timeStart, 0);
  2286. timeElapsed_26 = _25 + timeElapsed_8;
  2287. if (timeElapsed_26 >= uS2Ticks_16)
  2288. goto <bb 5>; [INV]
  2289. else
  2290. goto <bb 6>; [INV]
  2291. <bb 5> :
  2292. returnResult_27 = 3;
  2293. goto <bb 7>; [INV]
  2294. <bb 6> :
  2295. # timeElapsed_8 = PHI <timeElapsed_14(3), timeElapsed_26(4)>
  2296. _6 ={v} base_18(D)->MCR;
  2297. _7 = _6 & 1048576;
  2298. if (_7 == 0)
  2299. goto <bb 4>; [INV]
  2300. else
  2301. goto <bb 7>; [INV]
  2302. <bb 7> :
  2303. # returnResult_9 = PHI <returnResult_17(2), returnResult_27(5), returnResult_17(6)>
  2304. _28 = returnResult_9;
  2305. timeStart ={v} {CLOBBER};
  2306. <bb 8> :
  2307. <L8>:
  2308. return _28;
  2309. }
  2310. FlexCAN_ExitFreezeMode (struct FLEXCAN_Type * base)
  2311. {
  2312. Flexcan_Ip_StatusType returnValue;
  2313. uint32 uS2Ticks;
  2314. uint32 timeElapsed;
  2315. uint32 timeStart;
  2316. Flexcan_Ip_StatusType D.7430;
  2317. long unsigned int D.7427;
  2318. long unsigned int _1;
  2319. long unsigned int _2;
  2320. long unsigned int _3;
  2321. long unsigned int _4;
  2322. long unsigned int _5;
  2323. long unsigned int _6;
  2324. long unsigned int _7;
  2325. long unsigned int _26;
  2326. Flexcan_Ip_StatusType _29;
  2327. <bb 2> :
  2328. timeStart = 0;
  2329. timeElapsed_14 = 0;
  2330. uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0);
  2331. returnValue_17 = 0;
  2332. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_04 ();
  2333. _1 ={v} base_19(D)->MCR;
  2334. _2 = _1 & 4026531839;
  2335. base_19(D)->MCR ={v} _2;
  2336. _3 ={v} base_19(D)->MCR;
  2337. _4 = _3 & 3221225471;
  2338. base_19(D)->MCR ={v} _4;
  2339. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_04 ();
  2340. _5 = OsIf_GetCounter (0);
  2341. timeStart = _5;
  2342. goto <bb 5>; [INV]
  2343. <bb 3> :
  2344. _26 = OsIf_GetElapsed (&timeStart, 0);
  2345. timeElapsed_27 = _26 + timeElapsed_8;
  2346. if (timeElapsed_27 >= uS2Ticks_16)
  2347. goto <bb 4>; [INV]
  2348. else
  2349. goto <bb 5>; [INV]
  2350. <bb 4> :
  2351. returnValue_28 = 3;
  2352. goto <bb 6>; [INV]
  2353. <bb 5> :
  2354. # timeElapsed_8 = PHI <timeElapsed_14(2), timeElapsed_27(3)>
  2355. _6 ={v} base_19(D)->MCR;
  2356. _7 = _6 & 16777216;
  2357. if (_7 != 0)
  2358. goto <bb 3>; [INV]
  2359. else
  2360. goto <bb 6>; [INV]
  2361. <bb 6> :
  2362. # returnValue_9 = PHI <returnValue_28(4), returnValue_17(5)>
  2363. _29 = returnValue_9;
  2364. timeStart ={v} {CLOBBER};
  2365. <bb 7> :
  2366. <L6>:
  2367. return _29;
  2368. }
  2369. FlexCAN_Enable (struct FLEXCAN_Type * base)
  2370. {
  2371. Flexcan_Ip_StatusType returnValue;
  2372. uint32 uS2Ticks;
  2373. uint32 timeElapsed;
  2374. uint32 timeStart;
  2375. Flexcan_Ip_StatusType D.7424;
  2376. long unsigned int D.7421;
  2377. long unsigned int _1;
  2378. long unsigned int _2;
  2379. long unsigned int _3;
  2380. long unsigned int _4;
  2381. long unsigned int _5;
  2382. long unsigned int _23;
  2383. Flexcan_Ip_StatusType _26;
  2384. <bb 2> :
  2385. timeStart = 0;
  2386. timeElapsed_12 = 0;
  2387. uS2Ticks_14 = OsIf_MicrosToTicks (1000000, 0);
  2388. returnValue_15 = 0;
  2389. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_03 ();
  2390. _1 ={v} base_17(D)->MCR;
  2391. _2 = _1 & 2147483647;
  2392. base_17(D)->MCR ={v} _2;
  2393. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_03 ();
  2394. _3 = OsIf_GetCounter (0);
  2395. timeStart = _3;
  2396. goto <bb 5>; [INV]
  2397. <bb 3> :
  2398. _23 = OsIf_GetElapsed (&timeStart, 0);
  2399. timeElapsed_24 = _23 + timeElapsed_6;
  2400. if (timeElapsed_24 >= uS2Ticks_14)
  2401. goto <bb 4>; [INV]
  2402. else
  2403. goto <bb 5>; [INV]
  2404. <bb 4> :
  2405. returnValue_25 = 3;
  2406. goto <bb 6>; [INV]
  2407. <bb 5> :
  2408. # timeElapsed_6 = PHI <timeElapsed_12(2), timeElapsed_24(3)>
  2409. _4 ={v} base_17(D)->MCR;
  2410. _5 = _4 & 16777216;
  2411. if (_5 == 0)
  2412. goto <bb 3>; [INV]
  2413. else
  2414. goto <bb 6>; [INV]
  2415. <bb 6> :
  2416. # returnValue_7 = PHI <returnValue_25(4), returnValue_15(5)>
  2417. _26 = returnValue_7;
  2418. timeStart ={v} {CLOBBER};
  2419. <bb 7> :
  2420. <L6>:
  2421. return _26;
  2422. }
  2423. FlexCAN_EnterFreezeMode (struct FLEXCAN_Type * base)
  2424. {
  2425. Flexcan_Ip_StatusType returnResult;
  2426. uint32 uS2Ticks;
  2427. uint32 timeElapsed;
  2428. uint32 timeStart;
  2429. Flexcan_Ip_StatusType D.7418;
  2430. long unsigned int D.7415;
  2431. long unsigned int _1;
  2432. long unsigned int _2;
  2433. long unsigned int _3;
  2434. long unsigned int _4;
  2435. long unsigned int _5;
  2436. signed int _6;
  2437. long unsigned int _7;
  2438. long unsigned int _8;
  2439. long unsigned int _9;
  2440. long unsigned int _10;
  2441. long unsigned int _11;
  2442. long unsigned int _32;
  2443. Flexcan_Ip_StatusType _35;
  2444. <bb 2> :
  2445. timeStart = 0;
  2446. timeElapsed_19 = 0;
  2447. uS2Ticks_21 = OsIf_MicrosToTicks (1000000, 0);
  2448. returnResult_22 = 0;
  2449. SchM_Enter_Can_CAN_EXCLUSIVE_AREA_02 ();
  2450. _1 ={v} base_24(D)->MCR;
  2451. _2 = _1 | 1073741824;
  2452. base_24(D)->MCR ={v} _2;
  2453. _3 ={v} base_24(D)->MCR;
  2454. _4 = _3 | 268435456;
  2455. base_24(D)->MCR ={v} _4;
  2456. _5 ={v} base_24(D)->MCR;
  2457. _6 = (signed int) _5;
  2458. if (_6 < 0)
  2459. goto <bb 3>; [INV]
  2460. else
  2461. goto <bb 4>; [INV]
  2462. <bb 3> :
  2463. _7 ={v} base_24(D)->MCR;
  2464. _8 = _7 & 2147483647;
  2465. base_24(D)->MCR ={v} _8;
  2466. <bb 4> :
  2467. SchM_Exit_Can_CAN_EXCLUSIVE_AREA_02 ();
  2468. _9 = OsIf_GetCounter (0);
  2469. timeStart = _9;
  2470. goto <bb 7>; [INV]
  2471. <bb 5> :
  2472. _32 = OsIf_GetElapsed (&timeStart, 0);
  2473. timeElapsed_33 = _32 + timeElapsed_12;
  2474. if (timeElapsed_33 >= uS2Ticks_21)
  2475. goto <bb 6>; [INV]
  2476. else
  2477. goto <bb 7>; [INV]
  2478. <bb 6> :
  2479. returnResult_34 = 3;
  2480. goto <bb 8>; [INV]
  2481. <bb 7> :
  2482. # timeElapsed_12 = PHI <timeElapsed_19(4), timeElapsed_33(5)>
  2483. _10 ={v} base_24(D)->MCR;
  2484. _11 = _10 & 16777216;
  2485. if (_11 == 0)
  2486. goto <bb 5>; [INV]
  2487. else
  2488. goto <bb 8>; [INV]
  2489. <bb 8> :
  2490. # returnResult_13 = PHI <returnResult_34(6), returnResult_22(7)>
  2491. _35 = returnResult_13;
  2492. timeStart ={v} {CLOBBER};
  2493. <bb 9> :
  2494. <L8>:
  2495. return _35;
  2496. }
  2497. FlexCAN_GetMaxMbNum (const struct FLEXCAN_Type * base)
  2498. {
  2499. static const uint32 maxMbNum[3] = {32, 16, 16};
  2500. static struct FLEXCAN_Type * const flexcanBase[3] = {1073889280B, 1073893376B, 1073917952B};
  2501. uint32 ret;
  2502. uint32 i;
  2503. uint32 D.7411;
  2504. struct FLEXCAN_Type * _1;
  2505. uint32 _7;
  2506. <bb 2> :
  2507. ret_5 = 0;
  2508. i_6 = 0;
  2509. goto <bb 6>; [INV]
  2510. <bb 3> :
  2511. _1 = flexcanBase[i_2];
  2512. if (base_9(D) == _1)
  2513. goto <bb 4>; [INV]
  2514. else
  2515. goto <bb 5>; [INV]
  2516. <bb 4> :
  2517. ret_10 = maxMbNum[i_2];
  2518. <bb 5> :
  2519. # ret_3 = PHI <ret_4(3), ret_10(4)>
  2520. i_11 = i_2 + 1;
  2521. <bb 6> :
  2522. # i_2 = PHI <i_6(2), i_11(5)>
  2523. # ret_4 = PHI <ret_5(2), ret_3(5)>
  2524. if (i_2 <= 2)
  2525. goto <bb 3>; [INV]
  2526. else
  2527. goto <bb 7>; [INV]
  2528. <bb 7> :
  2529. _7 = ret_4;
  2530. <bb 8> :
  2531. <L5>:
  2532. return _7;
  2533. }
  2534. FlexCAN_GetMsgBuffRegion (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
  2535. {
  2536. volatile uint32 * pAddressRet;
  2537. volatile uint32 * RAM;
  2538. uint8 payload_size;
  2539. uint32 mb_index;
  2540. uint8 maxMbNum;
  2541. uint8 i;
  2542. uint32 msgBuffIdxBackup;
  2543. uint32 ramBlockOffset;
  2544. uint32 ramBlockSize;
  2545. uint8 mb_size;
  2546. uint8 arbitration_field_size;
  2547. volatile uint32 * D.7407;
  2548. long unsigned int base.1_1;
  2549. long unsigned int _2;
  2550. long unsigned int _3;
  2551. long unsigned int _4;
  2552. long unsigned int _5;
  2553. long unsigned int _6;
  2554. unsigned char i.2_7;
  2555. long unsigned int _8;
  2556. long unsigned int _9;
  2557. unsigned char _10;
  2558. long unsigned int _11;
  2559. long unsigned int _12;
  2560. long unsigned int _13;
  2561. volatile uint32 * _47;
  2562. <bb 2> :
  2563. arbitration_field_size_23 = 8;
  2564. mb_size_24 = 0;
  2565. ramBlockSize_25 = 512;
  2566. ramBlockOffset_26 = 0;
  2567. msgBuffIdxBackup_28 = msgBuffIdx_27(D);
  2568. i_29 = 0;
  2569. maxMbNum_30 = 0;
  2570. mb_index_31 = 0;
  2571. payload_size_32 = 0;
  2572. base.1_1 = (long unsigned int) base_33(D);
  2573. _2 = base.1_1 + 128;
  2574. RAM_34 = (volatile uint32 *) _2;
  2575. pAddressRet_35 = 0B;
  2576. i_36 = 0;
  2577. goto <bb 6>; [INV]
  2578. <bb 3> :
  2579. payload_size_39 = FlexCAN_GetPayloadSize (base_33(D), i_18);
  2580. mb_size_40 = payload_size_39 + arbitration_field_size_23;
  2581. _3 = (long unsigned int) mb_size_40;
  2582. _4 = ramBlockSize_25 / _3;
  2583. maxMbNum_41 = (uint8) _4;
  2584. _5 = (long unsigned int) maxMbNum_41;
  2585. if (msgBuffIdxBackup_17 < _5)
  2586. goto <bb 4>; [INV]
  2587. else
  2588. goto <bb 5>; [INV]
  2589. <bb 4> :
  2590. goto <bb 7>; [INV]
  2591. <bb 5> :
  2592. ramBlockOffset_42 = ramBlockOffset_16 + 128;
  2593. _6 = (long unsigned int) maxMbNum_41;
  2594. msgBuffIdxBackup_43 = msgBuffIdxBackup_17 - _6;
  2595. i.2_7 = i_18;
  2596. i_44 = i.2_7 + 1;
  2597. <bb 6> :
  2598. # mb_size_14 = PHI <mb_size_24(2), mb_size_40(5)>
  2599. # ramBlockOffset_16 = PHI <ramBlockOffset_26(2), ramBlockOffset_42(5)>
  2600. # msgBuffIdxBackup_17 = PHI <msgBuffIdxBackup_28(2), msgBuffIdxBackup_43(5)>
  2601. # i_18 = PHI <i_36(2), i_44(5)>
  2602. # maxMbNum_19 = PHI <maxMbNum_30(2), maxMbNum_41(5)>
  2603. if (i_18 == 0)
  2604. goto <bb 3>; [INV]
  2605. else
  2606. goto <bb 7>; [INV]
  2607. <bb 7> :
  2608. # mb_size_15 = PHI <mb_size_40(4), mb_size_14(6)>
  2609. # maxMbNum_20 = PHI <maxMbNum_41(4), maxMbNum_19(6)>
  2610. _8 = (long unsigned int) maxMbNum_20;
  2611. _9 = msgBuffIdxBackup_17 % _8;
  2612. _10 = mb_size_15 >> 2;
  2613. _11 = (long unsigned int) _10;
  2614. _12 = _9 * _11;
  2615. mb_index_45 = ramBlockOffset_16 + _12;
  2616. _13 = mb_index_45 * 4;
  2617. pAddressRet_46 = RAM_34 + _13;
  2618. _47 = pAddressRet_46;
  2619. <bb 8> :
  2620. <L5>:
  2621. return _47;
  2622. }
  2623. FlexCAN_ComputePayloadSize (uint8 dlcValue)
  2624. {
  2625. uint8 ret;
  2626. uint8 D.7403;
  2627. int _1;
  2628. uint8 _13;
  2629. <bb 2> :
  2630. ret_3 = 8;
  2631. if (dlcValue_4(D) <= 8)
  2632. goto <bb 3>; [INV]
  2633. else
  2634. goto <bb 4>; [INV]
  2635. <bb 3> :
  2636. ret_12 = dlcValue_4(D);
  2637. goto <bb 13>; [INV]
  2638. <bb 4> :
  2639. _1 = (int) dlcValue_4(D);
  2640. switch (_1) <default: <L9> [INV], case 9: <L2> [INV], case 10: <L3> [INV], case 11: <L4> [INV], case 12: <L5> [INV], case 13: <L6> [INV], case 14: <L7> [INV], case 15: <L8> [INV]>
  2641. <bb 5> :
  2642. <L2>:
  2643. ret_11 = 12;
  2644. goto <bb 13>; [INV]
  2645. <bb 6> :
  2646. <L3>:
  2647. ret_10 = 16;
  2648. goto <bb 13>; [INV]
  2649. <bb 7> :
  2650. <L4>:
  2651. ret_9 = 20;
  2652. goto <bb 13>; [INV]
  2653. <bb 8> :
  2654. <L5>:
  2655. ret_8 = 24;
  2656. goto <bb 13>; [INV]
  2657. <bb 9> :
  2658. <L6>:
  2659. ret_7 = 32;
  2660. goto <bb 13>; [INV]
  2661. <bb 10> :
  2662. <L7>:
  2663. ret_6 = 48;
  2664. goto <bb 13>; [INV]
  2665. <bb 11> :
  2666. <L8>:
  2667. ret_5 = 64;
  2668. goto <bb 13>; [INV]
  2669. <bb 12> :
  2670. <L9>:
  2671. <bb 13> :
  2672. # ret_2 = PHI <ret_12(3), ret_11(5), ret_10(6), ret_9(7), ret_8(8), ret_7(9), ret_6(10), ret_5(11), ret_3(12)>
  2673. _13 = ret_2;
  2674. <bb 14> :
  2675. <L12>:
  2676. return _13;
  2677. }
  2678. FlexCAN_ClearRAM (struct FLEXCAN_Type * base)
  2679. {
  2680. volatile uint32 * RAM;
  2681. uint32 RXIMR_size;
  2682. uint32 RAM_size;
  2683. uint32 databyte;
  2684. long unsigned int _1;
  2685. long unsigned int base.0_2;
  2686. long unsigned int _3;
  2687. long unsigned int _4;
  2688. volatile uint32 * _5;
  2689. long unsigned int _6;
  2690. volatile uint32 * _7;
  2691. <bb 2> :
  2692. _1 = FlexCAN_GetMaxMbNum (base_13(D));
  2693. RAM_size_15 = _1 * 4;
  2694. RXIMR_size_17 = FlexCAN_GetMaxMbNum (base_13(D));
  2695. base.0_2 = (long unsigned int) base_13(D);
  2696. _3 = base.0_2 + 128;
  2697. RAM_18 = (volatile uint32 *) _3;
  2698. databyte_19 = 0;
  2699. goto <bb 4>; [INV]
  2700. <bb 3> :
  2701. _4 = databyte_8 * 4;
  2702. _5 = RAM_18 + _4;
  2703. *_5 ={v} 0;
  2704. databyte_25 = databyte_8 + 1;
  2705. <bb 4> :
  2706. # databyte_8 = PHI <databyte_19(2), databyte_25(3)>
  2707. if (databyte_8 < RAM_size_15)
  2708. goto <bb 3>; [INV]
  2709. else
  2710. goto <bb 5>; [INV]
  2711. <bb 5> :
  2712. RAM_20 = &base_13(D)->RXIMR;
  2713. databyte_21 = 0;
  2714. goto <bb 7>; [INV]
  2715. <bb 6> :
  2716. _6 = databyte_9 * 4;
  2717. _7 = RAM_20 + _6;
  2718. *_7 ={v} 0;
  2719. databyte_23 = databyte_9 + 1;
  2720. <bb 7> :
  2721. # databyte_9 = PHI <databyte_21(5), databyte_23(6)>
  2722. if (databyte_9 < RXIMR_size_17)
  2723. goto <bb 6>; [INV]
  2724. else
  2725. goto <bb 8>; [INV]
  2726. <bb 8> :
  2727. return;
  2728. }
  2729. FlexCAN_ComputeDLCValue (uint8 payloadSize)
  2730. {
  2731. static const uint8 payload_code[65] = "\x00\x01\x02\x03\x04\x05\x06\x07\b\t\t\t\t\n\n\n\n\v\v\v\v\f\f\f\f\r\r\r\r\r\r\r\r\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f";
  2732. uint32 ret;
  2733. uint8 D.7398;
  2734. int _1;
  2735. unsigned char _2;
  2736. uint8 _8;
  2737. <bb 2> :
  2738. ret_4 = 255;
  2739. if (payloadSize_5(D) <= 64)
  2740. goto <bb 3>; [INV]
  2741. else
  2742. goto <bb 4>; [INV]
  2743. <bb 3> :
  2744. _1 = (int) payloadSize_5(D);
  2745. _2 = payload_code[_1];
  2746. ret_7 = (uint32) _2;
  2747. <bb 4> :
  2748. # ret_3 = PHI <ret_4(2), ret_7(3)>
  2749. _8 = (uint8) ret_3;
  2750. <bb 5> :
  2751. <L3>:
  2752. return _8;
  2753. }
  2754. FlexCAN_SetPNPayloadLowFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
  2755. {
  2756. unsigned char _1;
  2757. long unsigned int _2;
  2758. long unsigned int _3;
  2759. const uint8 * _4;
  2760. unsigned char _5;
  2761. long unsigned int _6;
  2762. long unsigned int _7;
  2763. long unsigned int _8;
  2764. long unsigned int _9;
  2765. const uint8 * _10;
  2766. unsigned char _11;
  2767. long unsigned int _12;
  2768. long unsigned int _13;
  2769. long unsigned int _14;
  2770. long unsigned int _15;
  2771. const uint8 * _16;
  2772. unsigned char _17;
  2773. long unsigned int _18;
  2774. long unsigned int _19;
  2775. <bb 2> :
  2776. _1 = *pPayload_21(D);
  2777. _2 = (long unsigned int) _1;
  2778. _3 = _2 << 24;
  2779. _4 = pPayload_21(D) + 1;
  2780. _5 = *_4;
  2781. _6 = (long unsigned int) _5;
  2782. _7 = _6 << 16;
  2783. _8 = _7 & 16711680;
  2784. _9 = _3 | _8;
  2785. _10 = pPayload_21(D) + 2;
  2786. _11 = *_10;
  2787. _12 = (long unsigned int) _11;
  2788. _13 = _12 << 8;
  2789. _14 = _13 & 65535;
  2790. _15 = _9 | _14;
  2791. _16 = pPayload_21(D) + 3;
  2792. _17 = *_16;
  2793. _18 = (long unsigned int) _17;
  2794. _19 = _15 | _18;
  2795. pBase_22(D)->PL2_PLMASK_LO ={v} _19;
  2796. return;
  2797. }
  2798. FlexCAN_SetPNPayloadHighFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
  2799. {
  2800. const uint8 * _1;
  2801. unsigned char _2;
  2802. long unsigned int _3;
  2803. long unsigned int _4;
  2804. const uint8 * _5;
  2805. unsigned char _6;
  2806. long unsigned int _7;
  2807. long unsigned int _8;
  2808. long unsigned int _9;
  2809. long unsigned int _10;
  2810. const uint8 * _11;
  2811. unsigned char _12;
  2812. long unsigned int _13;
  2813. long unsigned int _14;
  2814. long unsigned int _15;
  2815. long unsigned int _16;
  2816. const uint8 * _17;
  2817. unsigned char _18;
  2818. long unsigned int _19;
  2819. long unsigned int _20;
  2820. <bb 2> :
  2821. _1 = pPayload_21(D) + 4;
  2822. _2 = *_1;
  2823. _3 = (long unsigned int) _2;
  2824. _4 = _3 << 24;
  2825. _5 = pPayload_21(D) + 5;
  2826. _6 = *_5;
  2827. _7 = (long unsigned int) _6;
  2828. _8 = _7 << 16;
  2829. _9 = _8 & 16711680;
  2830. _10 = _4 | _9;
  2831. _11 = pPayload_21(D) + 6;
  2832. _12 = *_11;
  2833. _13 = (long unsigned int) _12;
  2834. _14 = _13 << 8;
  2835. _15 = _14 & 65535;
  2836. _16 = _10 | _15;
  2837. _17 = pPayload_21(D) + 7;
  2838. _18 = *_17;
  2839. _19 = (long unsigned int) _18;
  2840. _20 = _16 | _19;
  2841. pBase_23(D)->PL2_PLMASK_HI ={v} _20;
  2842. return;
  2843. }
  2844. FlexCAN_SetPNPayloadLowFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
  2845. {
  2846. unsigned char _1;
  2847. long unsigned int _2;
  2848. long unsigned int _3;
  2849. const uint8 * _4;
  2850. unsigned char _5;
  2851. long unsigned int _6;
  2852. long unsigned int _7;
  2853. long unsigned int _8;
  2854. long unsigned int _9;
  2855. const uint8 * _10;
  2856. unsigned char _11;
  2857. long unsigned int _12;
  2858. long unsigned int _13;
  2859. long unsigned int _14;
  2860. long unsigned int _15;
  2861. const uint8 * _16;
  2862. unsigned char _17;
  2863. long unsigned int _18;
  2864. long unsigned int _19;
  2865. <bb 2> :
  2866. _1 = *pPayload_21(D);
  2867. _2 = (long unsigned int) _1;
  2868. _3 = _2 << 24;
  2869. _4 = pPayload_21(D) + 1;
  2870. _5 = *_4;
  2871. _6 = (long unsigned int) _5;
  2872. _7 = _6 << 16;
  2873. _8 = _7 & 16711680;
  2874. _9 = _3 | _8;
  2875. _10 = pPayload_21(D) + 2;
  2876. _11 = *_10;
  2877. _12 = (long unsigned int) _11;
  2878. _13 = _12 << 8;
  2879. _14 = _13 & 65535;
  2880. _15 = _9 | _14;
  2881. _16 = pPayload_21(D) + 3;
  2882. _17 = *_16;
  2883. _18 = (long unsigned int) _17;
  2884. _19 = _15 | _18;
  2885. pBase_22(D)->PL1_LO ={v} _19;
  2886. return;
  2887. }
  2888. FlexCAN_SetPNPayloadHighFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
  2889. {
  2890. const uint8 * _1;
  2891. unsigned char _2;
  2892. long unsigned int _3;
  2893. long unsigned int _4;
  2894. const uint8 * _5;
  2895. unsigned char _6;
  2896. long unsigned int _7;
  2897. long unsigned int _8;
  2898. long unsigned int _9;
  2899. long unsigned int _10;
  2900. const uint8 * _11;
  2901. unsigned char _12;
  2902. long unsigned int _13;
  2903. long unsigned int _14;
  2904. long unsigned int _15;
  2905. long unsigned int _16;
  2906. const uint8 * _17;
  2907. unsigned char _18;
  2908. long unsigned int _19;
  2909. long unsigned int _20;
  2910. <bb 2> :
  2911. _1 = pPayload_21(D) + 4;
  2912. _2 = *_1;
  2913. _3 = (long unsigned int) _2;
  2914. _4 = _3 << 24;
  2915. _5 = pPayload_21(D) + 5;
  2916. _6 = *_5;
  2917. _7 = (long unsigned int) _6;
  2918. _8 = _7 << 16;
  2919. _9 = _8 & 16711680;
  2920. _10 = _4 | _9;
  2921. _11 = pPayload_21(D) + 6;
  2922. _12 = *_11;
  2923. _13 = (long unsigned int) _12;
  2924. _14 = _13 << 8;
  2925. _15 = _14 & 65535;
  2926. _16 = _10 | _15;
  2927. _17 = pPayload_21(D) + 7;
  2928. _18 = *_17;
  2929. _19 = (long unsigned int) _18;
  2930. _20 = _16 | _19;
  2931. pBase_23(D)->PL1_HI ={v} _20;
  2932. return;
  2933. }
  2934. FlexCAN_SetPNDlcFilter (struct FLEXCAN_Type * pBase, uint8 u8DlcLow, uint8 u8DlcHigh)
  2935. {
  2936. uint32 tmp;
  2937. long unsigned int _1;
  2938. long unsigned int _2;
  2939. long unsigned int _3;
  2940. long unsigned int _4;
  2941. long unsigned int _5;
  2942. <bb 2> :
  2943. tmp_8 ={v} pBase_7(D)->FLT_DLC;
  2944. tmp_9 = tmp_8 & 4293984240;
  2945. _1 = (long unsigned int) u8DlcHigh_10(D);
  2946. _2 = _1 & 15;
  2947. tmp_11 = tmp_9 | _2;
  2948. _3 = (long unsigned int) u8DlcLow_12(D);
  2949. _4 = _3 << 16;
  2950. _5 = _4 & 983040;
  2951. tmp_13 = tmp_11 | _5;
  2952. pBase_7(D)->FLT_DLC ={v} tmp_13;
  2953. return;
  2954. }
  2955. FlexCAN_SetPNIdFilter2 (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
  2956. {
  2957. uint32 u32Tmp;
  2958. long unsigned int iftmp.27;
  2959. long unsigned int iftmp.26;
  2960. _Bool _1;
  2961. _Bool _2;
  2962. _Bool _3;
  2963. long unsigned int _4;
  2964. long unsigned int _5;
  2965. long unsigned int _6;
  2966. long unsigned int _7;
  2967. long unsigned int _8;
  2968. long unsigned int iftmp.26_10;
  2969. long unsigned int iftmp.27_11;
  2970. long unsigned int iftmp.26_17;
  2971. long unsigned int iftmp.26_18;
  2972. long unsigned int iftmp.27_20;
  2973. long unsigned int iftmp.27_21;
  2974. <bb 2> :
  2975. u32Tmp_14 ={v} pBase_13(D)->FLT_ID2_IDMASK;
  2976. u32Tmp_15 = u32Tmp_14 & 2147483648;
  2977. _1 = pPnConfig_16(D)->idFilter2.bExtendedId;
  2978. if (_1 != 0)
  2979. goto <bb 3>; [INV]
  2980. else
  2981. goto <bb 4>; [INV]
  2982. <bb 3> :
  2983. iftmp.26_18 = 1073741824;
  2984. goto <bb 5>; [INV]
  2985. <bb 4> :
  2986. iftmp.26_17 = 0;
  2987. <bb 5> :
  2988. # iftmp.26_10 = PHI <iftmp.26_18(3), iftmp.26_17(4)>
  2989. u32Tmp_19 = iftmp.26_10 | u32Tmp_15;
  2990. _2 = pPnConfig_16(D)->idFilter2.bRemoteFrame;
  2991. if (_2 != 0)
  2992. goto <bb 6>; [INV]
  2993. else
  2994. goto <bb 7>; [INV]
  2995. <bb 6> :
  2996. iftmp.27_21 = 536870912;
  2997. goto <bb 8>; [INV]
  2998. <bb 7> :
  2999. iftmp.27_20 = 0;
  3000. <bb 8> :
  3001. # iftmp.27_11 = PHI <iftmp.27_21(6), iftmp.27_20(7)>
  3002. u32Tmp_22 = iftmp.27_11 | u32Tmp_19;
  3003. _3 = pPnConfig_16(D)->idFilter1.bExtendedId;
  3004. if (_3 != 0)
  3005. goto <bb 9>; [INV]
  3006. else
  3007. goto <bb 10>; [INV]
  3008. <bb 9> :
  3009. _4 = pPnConfig_16(D)->idFilter2.u32Id;
  3010. _5 = _4 & 536870911;
  3011. u32Tmp_24 = u32Tmp_22 | _5;
  3012. goto <bb 11>; [INV]
  3013. <bb 10> :
  3014. _6 = pPnConfig_16(D)->idFilter2.u32Id;
  3015. _7 = _6 << 18;
  3016. _8 = _7 & 536870911;
  3017. u32Tmp_23 = u32Tmp_22 | _8;
  3018. <bb 11> :
  3019. # u32Tmp_9 = PHI <u32Tmp_24(9), u32Tmp_23(10)>
  3020. pBase_13(D)->FLT_ID2_IDMASK ={v} u32Tmp_9;
  3021. return;
  3022. }
  3023. FlexCAN_SetPNIdFilter2Check (struct FLEXCAN_Type * pBase)
  3024. {
  3025. long unsigned int _1;
  3026. long unsigned int _2;
  3027. <bb 2> :
  3028. _1 ={v} pBase_4(D)->FLT_ID2_IDMASK;
  3029. _2 = _1 | 1610612736;
  3030. pBase_4(D)->FLT_ID2_IDMASK ={v} _2;
  3031. return;
  3032. }
  3033. FlexCAN_SetPNIdFilter1 (struct FLEXCAN_Type * pBase, struct Flexcan_Ip_PnIdFilterType idFilter)
  3034. {
  3035. uint32 u32Tmp;
  3036. long unsigned int iftmp.25;
  3037. long unsigned int iftmp.24;
  3038. _Bool _1;
  3039. _Bool _2;
  3040. _Bool _3;
  3041. long unsigned int _4;
  3042. long unsigned int _5;
  3043. long unsigned int _6;
  3044. long unsigned int _7;
  3045. long unsigned int _8;
  3046. long unsigned int iftmp.24_10;
  3047. long unsigned int iftmp.25_11;
  3048. long unsigned int iftmp.24_16;
  3049. long unsigned int iftmp.24_17;
  3050. long unsigned int iftmp.25_19;
  3051. long unsigned int iftmp.25_20;
  3052. <bb 2> :
  3053. u32Tmp_14 ={v} pBase_13(D)->FLT_ID1;
  3054. u32Tmp_15 = u32Tmp_14 & 2147483648;
  3055. _1 = idFilter.bExtendedId;
  3056. if (_1 != 0)
  3057. goto <bb 3>; [INV]
  3058. else
  3059. goto <bb 4>; [INV]
  3060. <bb 3> :
  3061. iftmp.24_17 = 1073741824;
  3062. goto <bb 5>; [INV]
  3063. <bb 4> :
  3064. iftmp.24_16 = 0;
  3065. <bb 5> :
  3066. # iftmp.24_10 = PHI <iftmp.24_17(3), iftmp.24_16(4)>
  3067. u32Tmp_18 = iftmp.24_10 | u32Tmp_15;
  3068. _2 = idFilter.bRemoteFrame;
  3069. if (_2 != 0)
  3070. goto <bb 6>; [INV]
  3071. else
  3072. goto <bb 7>; [INV]
  3073. <bb 6> :
  3074. iftmp.25_20 = 536870912;
  3075. goto <bb 8>; [INV]
  3076. <bb 7> :
  3077. iftmp.25_19 = 0;
  3078. <bb 8> :
  3079. # iftmp.25_11 = PHI <iftmp.25_20(6), iftmp.25_19(7)>
  3080. u32Tmp_21 = iftmp.25_11 | u32Tmp_18;
  3081. _3 = idFilter.bExtendedId;
  3082. if (_3 != 0)
  3083. goto <bb 9>; [INV]
  3084. else
  3085. goto <bb 10>; [INV]
  3086. <bb 9> :
  3087. _4 = idFilter.u32Id;
  3088. _5 = _4 & 536870911;
  3089. u32Tmp_23 = u32Tmp_21 | _5;
  3090. goto <bb 11>; [INV]
  3091. <bb 10> :
  3092. _6 = idFilter.u32Id;
  3093. _7 = _6 << 18;
  3094. _8 = _7 & 536870911;
  3095. u32Tmp_22 = u32Tmp_21 | _8;
  3096. <bb 11> :
  3097. # u32Tmp_9 = PHI <u32Tmp_23(9), u32Tmp_22(10)>
  3098. pBase_13(D)->FLT_ID1 ={v} u32Tmp_9;
  3099. return;
  3100. }
  3101. FlexCAN_SetPNTimeoutValue (struct FLEXCAN_Type * pBase, uint16 u16TimeoutValue)
  3102. {
  3103. long unsigned int _1;
  3104. long unsigned int _2;
  3105. long unsigned int _3;
  3106. long unsigned int _4;
  3107. <bb 2> :
  3108. _1 ={v} pBase_6(D)->CTRL2_PN;
  3109. _2 = _1 & 4294901760;
  3110. _3 = (long unsigned int) u16TimeoutValue_7(D);
  3111. _4 = _2 | _3;
  3112. pBase_6(D)->CTRL2_PN ={v} _4;
  3113. return;
  3114. }
  3115. FlexCAN_SetPNFilteringSelection (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
  3116. {
  3117. uint32 u32Tmp;
  3118. long unsigned int iftmp.23;
  3119. long unsigned int iftmp.22;
  3120. _Bool _1;
  3121. _Bool _2;
  3122. short unsigned int _3;
  3123. long unsigned int _4;
  3124. long unsigned int _5;
  3125. long unsigned int _6;
  3126. <unnamed type> _7;
  3127. long unsigned int _8;
  3128. <unnamed type> _9;
  3129. long unsigned int _10;
  3130. long unsigned int _11;
  3131. <unnamed type> _12;
  3132. long unsigned int _13;
  3133. long unsigned int _14;
  3134. long unsigned int iftmp.22_15;
  3135. long unsigned int iftmp.23_16;
  3136. long unsigned int iftmp.22_22;
  3137. long unsigned int iftmp.22_23;
  3138. long unsigned int iftmp.23_25;
  3139. long unsigned int iftmp.23_26;
  3140. <bb 2> :
  3141. u32Tmp_19 ={v} pBase_18(D)->CTRL1_PN;
  3142. u32Tmp_20 = u32Tmp_19 & 4294705344;
  3143. _1 = pPnConfig_21(D)->bWakeUpTimeout;
  3144. if (_1 != 0)
  3145. goto <bb 3>; [INV]
  3146. else
  3147. goto <bb 4>; [INV]
  3148. <bb 3> :
  3149. iftmp.22_23 = 131072;
  3150. goto <bb 5>; [INV]
  3151. <bb 4> :
  3152. iftmp.22_22 = 0;
  3153. <bb 5> :
  3154. # iftmp.22_15 = PHI <iftmp.22_23(3), iftmp.22_22(4)>
  3155. u32Tmp_24 = iftmp.22_15 | u32Tmp_20;
  3156. _2 = pPnConfig_21(D)->bWakeUpMatch;
  3157. if (_2 != 0)
  3158. goto <bb 6>; [INV]
  3159. else
  3160. goto <bb 7>; [INV]
  3161. <bb 6> :
  3162. iftmp.23_26 = 65536;
  3163. goto <bb 8>; [INV]
  3164. <bb 7> :
  3165. iftmp.23_25 = 0;
  3166. <bb 8> :
  3167. # iftmp.23_16 = PHI <iftmp.23_26(6), iftmp.23_25(7)>
  3168. u32Tmp_27 = iftmp.23_16 | u32Tmp_24;
  3169. _3 = pPnConfig_21(D)->u16NumMatches;
  3170. _4 = (long unsigned int) _3;
  3171. _5 = _4 << 8;
  3172. _6 = _5 & 65535;
  3173. u32Tmp_28 = u32Tmp_27 | _6;
  3174. _7 = pPnConfig_21(D)->eFilterComb;
  3175. _8 = _7 & 3;
  3176. u32Tmp_29 = u32Tmp_28 | _8;
  3177. _9 = pPnConfig_21(D)->eIdFilterType;
  3178. _10 = _9 << 2;
  3179. _11 = _10 & 12;
  3180. u32Tmp_30 = u32Tmp_29 | _11;
  3181. _12 = pPnConfig_21(D)->ePayloadFilterType;
  3182. _13 = _12 << 4;
  3183. _14 = _13 & 48;
  3184. u32Tmp_31 = u32Tmp_30 | _14;
  3185. pBase_18(D)->CTRL1_PN ={v} u32Tmp_31;
  3186. return;
  3187. }
  3188. FlexCAN_CanBitSampling (struct FLEXCAN_Type * base, boolean enable)
  3189. {
  3190. long unsigned int iftmp.18;
  3191. long unsigned int _1;
  3192. long unsigned int _2;
  3193. long unsigned int _3;
  3194. long unsigned int iftmp.18_4;
  3195. long unsigned int iftmp.18_8;
  3196. long unsigned int iftmp.18_9;
  3197. <bb 2> :
  3198. _1 ={v} base_6(D)->CTRL1;
  3199. _2 = _1 & 4294967167;
  3200. if (enable_7(D) != 0)
  3201. goto <bb 3>; [INV]
  3202. else
  3203. goto <bb 4>; [INV]
  3204. <bb 3> :
  3205. iftmp.18_9 = 128;
  3206. goto <bb 5>; [INV]
  3207. <bb 4> :
  3208. iftmp.18_8 = 0;
  3209. <bb 5> :
  3210. # iftmp.18_4 = PHI <iftmp.18_9(3), iftmp.18_8(4)>
  3211. _3 = iftmp.18_4 | _2;
  3212. base_6(D)->CTRL1 ={v} _3;
  3213. return;
  3214. }
  3215. FlexCAN_SetEdgeFilter (struct FLEXCAN_Type * base, boolean enable)
  3216. {
  3217. long unsigned int iftmp.21;
  3218. long unsigned int _1;
  3219. long unsigned int _2;
  3220. long unsigned int _3;
  3221. long unsigned int iftmp.21_4;
  3222. long unsigned int iftmp.21_8;
  3223. long unsigned int iftmp.21_9;
  3224. <bb 2> :
  3225. _1 ={v} base_6(D)->CTRL2;
  3226. _2 = _1 & 4294965247;
  3227. if (enable_7(D) != 0)
  3228. goto <bb 3>; [INV]
  3229. else
  3230. goto <bb 4>; [INV]
  3231. <bb 3> :
  3232. iftmp.21_9 = 0;
  3233. goto <bb 5>; [INV]
  3234. <bb 4> :
  3235. iftmp.21_8 = 2048;
  3236. <bb 5> :
  3237. # iftmp.21_4 = PHI <iftmp.21_9(3), iftmp.21_8(4)>
  3238. _3 = iftmp.21_4 | _2;
  3239. base_6(D)->CTRL2 ={v} _3;
  3240. return;
  3241. }
  3242. FlexCAN_SetBusOffAutorecovery (struct FLEXCAN_Type * base, boolean enable)
  3243. {
  3244. long unsigned int iftmp.19;
  3245. long unsigned int _1;
  3246. long unsigned int _2;
  3247. long unsigned int _3;
  3248. long unsigned int iftmp.19_4;
  3249. long unsigned int iftmp.19_8;
  3250. long unsigned int iftmp.19_9;
  3251. <bb 2> :
  3252. _1 ={v} base_6(D)->CTRL1;
  3253. _2 = _1 & 4294967231;
  3254. if (enable_7(D) != 0)
  3255. goto <bb 3>; [INV]
  3256. else
  3257. goto <bb 4>; [INV]
  3258. <bb 3> :
  3259. iftmp.19_9 = 0;
  3260. goto <bb 5>; [INV]
  3261. <bb 4> :
  3262. iftmp.19_8 = 64;
  3263. <bb 5> :
  3264. # iftmp.19_4 = PHI <iftmp.19_9(3), iftmp.19_8(4)>
  3265. _3 = iftmp.19_4 | _2;
  3266. base_6(D)->CTRL1 ={v} _3;
  3267. return;
  3268. }
  3269. FlexCAN_SetRemoteReqStore (struct FLEXCAN_Type * base, boolean enable)
  3270. {
  3271. long unsigned int iftmp.20;
  3272. long unsigned int _1;
  3273. long unsigned int _2;
  3274. long unsigned int _3;
  3275. long unsigned int iftmp.20_4;
  3276. long unsigned int iftmp.20_8;
  3277. long unsigned int iftmp.20_9;
  3278. <bb 2> :
  3279. _1 ={v} base_6(D)->CTRL2;
  3280. _2 = _1 & 4294836223;
  3281. if (enable_7(D) != 0)
  3282. goto <bb 3>; [INV]
  3283. else
  3284. goto <bb 4>; [INV]
  3285. <bb 3> :
  3286. iftmp.20_9 = 131072;
  3287. goto <bb 5>; [INV]
  3288. <bb 4> :
  3289. iftmp.20_8 = 0;
  3290. <bb 5> :
  3291. # iftmp.20_4 = PHI <iftmp.20_9(3), iftmp.20_8(4)>
  3292. _3 = iftmp.20_4 | _2;
  3293. base_6(D)->CTRL2 ={v} _3;
  3294. return;
  3295. }
  3296. FlexCAN_SetProtocolException (struct FLEXCAN_Type * base, boolean enable)
  3297. {
  3298. long unsigned int iftmp.17;
  3299. long unsigned int _1;
  3300. long unsigned int _2;
  3301. long unsigned int _3;
  3302. long unsigned int iftmp.17_4;
  3303. long unsigned int iftmp.17_8;
  3304. long unsigned int iftmp.17_9;
  3305. <bb 2> :
  3306. _1 ={v} base_6(D)->CTRL2;
  3307. _2 = _1 & 4294950911;
  3308. if (enable_7(D) != 0)
  3309. goto <bb 3>; [INV]
  3310. else
  3311. goto <bb 4>; [INV]
  3312. <bb 3> :
  3313. iftmp.17_9 = 16384;
  3314. goto <bb 5>; [INV]
  3315. <bb 4> :
  3316. iftmp.17_8 = 0;
  3317. <bb 5> :
  3318. # iftmp.17_4 = PHI <iftmp.17_9(3), iftmp.17_8(4)>
  3319. _3 = iftmp.17_4 | _2;
  3320. base_6(D)->CTRL2 ={v} _3;
  3321. return;
  3322. }
  3323. FlexCAN_SetEntireFrameArbitrationFieldComparison (struct FLEXCAN_Type * base, boolean enable)
  3324. {
  3325. long unsigned int iftmp.16;
  3326. long unsigned int _1;
  3327. long unsigned int _2;
  3328. long unsigned int _3;
  3329. long unsigned int iftmp.16_4;
  3330. long unsigned int iftmp.16_8;
  3331. long unsigned int iftmp.16_9;
  3332. <bb 2> :
  3333. _1 ={v} base_6(D)->CTRL2;
  3334. _2 = _1 & 4294901759;
  3335. if (enable_7(D) != 0)
  3336. goto <bb 3>; [INV]
  3337. else
  3338. goto <bb 4>; [INV]
  3339. <bb 3> :
  3340. iftmp.16_9 = 65536;
  3341. goto <bb 5>; [INV]
  3342. <bb 4> :
  3343. iftmp.16_8 = 0;
  3344. <bb 5> :
  3345. # iftmp.16_4 = PHI <iftmp.16_9(3), iftmp.16_8(4)>
  3346. _3 = iftmp.16_4 | _2;
  3347. base_6(D)->CTRL2 ={v} _3;
  3348. return;
  3349. }
  3350. FlexCAN_SetIsoCan (struct FLEXCAN_Type * base, boolean enable)
  3351. {
  3352. long unsigned int iftmp.15;
  3353. long unsigned int _1;
  3354. long unsigned int _2;
  3355. long unsigned int _3;
  3356. long unsigned int iftmp.15_4;
  3357. long unsigned int iftmp.15_8;
  3358. long unsigned int iftmp.15_9;
  3359. <bb 2> :
  3360. _1 ={v} base_6(D)->CTRL2;
  3361. _2 = _1 & 4294963199;
  3362. if (enable_7(D) != 0)
  3363. goto <bb 3>; [INV]
  3364. else
  3365. goto <bb 4>; [INV]
  3366. <bb 3> :
  3367. iftmp.15_9 = 4096;
  3368. goto <bb 5>; [INV]
  3369. <bb 4> :
  3370. iftmp.15_8 = 0;
  3371. <bb 5> :
  3372. # iftmp.15_4 = PHI <iftmp.15_9(3), iftmp.15_8(4)>
  3373. _3 = iftmp.15_4 | _2;
  3374. base_6(D)->CTRL2 ={v} _3;
  3375. return;
  3376. }
  3377. FlexCAN_IsFDEnabled (const struct FLEXCAN_Type * base)
  3378. {
  3379. boolean D.7487;
  3380. long unsigned int _1;
  3381. long unsigned int _2;
  3382. boolean _5;
  3383. <bb 2> :
  3384. _1 ={v} base_4(D)->MCR;
  3385. _2 = _1 & 2048;
  3386. _5 = _2 != 0;
  3387. <bb 3> :
  3388. <L0>:
  3389. return _5;
  3390. }
  3391. FlexCAN_SetSelfReception (struct FLEXCAN_Type * base, boolean enable)
  3392. {
  3393. long unsigned int iftmp.11;
  3394. long unsigned int _1;
  3395. long unsigned int _2;
  3396. long unsigned int _3;
  3397. long unsigned int iftmp.11_4;
  3398. long unsigned int iftmp.11_8;
  3399. long unsigned int iftmp.11_9;
  3400. <bb 2> :
  3401. _1 ={v} base_6(D)->MCR;
  3402. _2 = _1 & 4294836223;
  3403. if (enable_7(D) != 0)
  3404. goto <bb 3>; [INV]
  3405. else
  3406. goto <bb 4>; [INV]
  3407. <bb 3> :
  3408. iftmp.11_9 = 0;
  3409. goto <bb 5>; [INV]
  3410. <bb 4> :
  3411. iftmp.11_8 = 131072;
  3412. <bb 5> :
  3413. # iftmp.11_4 = PHI <iftmp.11_9(3), iftmp.11_8(4)>
  3414. _3 = iftmp.11_4 | _2;
  3415. base_6(D)->MCR ={v} _3;
  3416. return;
  3417. }
  3418. DevAssert (volatile boolean x)
  3419. {
  3420. _Bool x.4_1;
  3421. <bb 2> :
  3422. x.4_1 ={v} x;
  3423. if (x.4_1 != 0)
  3424. goto <bb 4>; [INV]
  3425. else
  3426. goto <bb 3>; [INV]
  3427. <bb 3> :
  3428. goto <bb 3>; [INV]
  3429. <bb 4> :
  3430. return;
  3431. }