1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958 |
- FlexCAN_ConfigPN (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
- {
- short unsigned int _1;
- <unnamed type> _2;
- <unnamed type> _3;
- <unnamed type> _4;
- <unnamed type> _5;
- unsigned char _6;
- unsigned char _7;
- const uint8[8] * _8;
- const uint8[8] * _9;
- <unnamed type> _10;
- <unnamed type> _11;
- const uint8[8] * _12;
- const uint8[8] * _13;
- <bb 2> :
- FlexCAN_SetPNFilteringSelection (pBase_17(D), pPnConfig_18(D));
- _1 = pPnConfig_18(D)->u16MatchTimeout;
- FlexCAN_SetPNTimeoutValue (pBase_17(D), _1);
- FlexCAN_SetPNIdFilter1 (pBase_17(D), pPnConfig_18(D)->idFilter1);
- _2 = pPnConfig_18(D)->eIdFilterType;
- if (_2 == 0)
- goto <bb 4>; [INV]
- else
- goto <bb 3>; [INV]
- <bb 3> :
- _3 = pPnConfig_18(D)->eIdFilterType;
- if (_3 == 3)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- FlexCAN_SetPNIdFilter2 (pBase_17(D), pPnConfig_18(D));
- goto <bb 6>; [INV]
- <bb 5> :
- FlexCAN_SetPNIdFilter2Check (pBase_17(D));
- <bb 6> :
- _4 = pPnConfig_18(D)->eFilterComb;
- if (_4 == 1)
- goto <bb 8>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 7> :
- _5 = pPnConfig_18(D)->eFilterComb;
- if (_5 == 3)
- goto <bb 8>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 8> :
- _6 = pPnConfig_18(D)->payloadFilter.u8DlcLow;
- _7 = pPnConfig_18(D)->payloadFilter.u8DlcHigh;
- FlexCAN_SetPNDlcFilter (pBase_17(D), _6, _7);
- _8 = &pPnConfig_18(D)->payloadFilter.aPayload1;
- FlexCAN_SetPNPayloadHighFilter1 (pBase_17(D), _8);
- _9 = &pPnConfig_18(D)->payloadFilter.aPayload1;
- FlexCAN_SetPNPayloadLowFilter1 (pBase_17(D), _9);
- _10 = pPnConfig_18(D)->ePayloadFilterType;
- if (_10 == 0)
- goto <bb 10>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 9> :
- _11 = pPnConfig_18(D)->ePayloadFilterType;
- if (_11 == 3)
- goto <bb 10>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 10> :
- _12 = &pPnConfig_18(D)->payloadFilter.aPayload2;
- FlexCAN_SetPNPayloadHighFilter2 (pBase_17(D), _12);
- _13 = &pPnConfig_18(D)->payloadFilter.aPayload2;
- FlexCAN_SetPNPayloadLowFilter2 (pBase_17(D), _13);
- <bb 11> :
- return;
- }
- FlexCAN_ConfigCtrlOptions (struct FLEXCAN_Type * pBase, uint32 u32Options)
- {
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- <bb 2> :
- _1 = u32Options_17(D) & 32;
- if (_1 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- FlexCAN_SetIsoCan (pBase_19(D), 1);
- goto <bb 5>; [INV]
- <bb 4> :
- FlexCAN_SetIsoCan (pBase_19(D), 0);
- <bb 5> :
- _2 = u32Options_17(D) & 64;
- if (_2 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase_19(D), 1);
- goto <bb 8>; [INV]
- <bb 7> :
- FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase_19(D), 0);
- <bb 8> :
- _3 = u32Options_17(D) & 8;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- FlexCAN_SetProtocolException (pBase_19(D), 1);
- goto <bb 11>; [INV]
- <bb 10> :
- FlexCAN_SetProtocolException (pBase_19(D), 0);
- <bb 11> :
- _4 = u32Options_17(D) & 2;
- if (_4 != 0)
- goto <bb 12>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 12> :
- _5 ={v} pBase_19(D)->MCR;
- _6 = _5 & 2048;
- if (_6 == 0)
- goto <bb 13>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 13> :
- FlexCAN_CanBitSampling (pBase_19(D), 1);
- goto <bb 15>; [INV]
- <bb 14> :
- FlexCAN_CanBitSampling (pBase_19(D), 0);
- <bb 15> :
- _7 = u32Options_17(D) & 4;
- if (_7 != 0)
- goto <bb 16>; [INV]
- else
- goto <bb 17>; [INV]
- <bb 16> :
- FlexCAN_SetBusOffAutorecovery (pBase_19(D), 1);
- goto <bb 18>; [INV]
- <bb 17> :
- FlexCAN_SetBusOffAutorecovery (pBase_19(D), 0);
- <bb 18> :
- _8 = u32Options_17(D) & 1;
- if (_8 != 0)
- goto <bb 19>; [INV]
- else
- goto <bb 20>; [INV]
- <bb 19> :
- FlexCAN_SetRemoteReqStore (pBase_19(D), 1);
- goto <bb 21>; [INV]
- <bb 20> :
- FlexCAN_SetRemoteReqStore (pBase_19(D), 0);
- <bb 21> :
- _9 = u32Options_17(D) & 16;
- if (_9 != 0)
- goto <bb 22>; [INV]
- else
- goto <bb 23>; [INV]
- <bb 22> :
- FlexCAN_SetEdgeFilter (pBase_19(D), 1);
- goto <bb 24>; [INV]
- <bb 23> :
- FlexCAN_SetEdgeFilter (pBase_19(D), 0);
- <bb 24> :
- return;
- }
- FlexCAN_IsMbOutOfRange (const struct FLEXCAN_Type * pBase, uint8 u8MbIndex, boolean bIsLegacyFifoEn, uint32 u32MaxMbNum)
- {
- uint32 u32NumOfMbOccupiedByFiFo;
- uint32 u32NumOfFiFoElement;
- boolean ReturnValue;
- boolean D.7600;
- unsigned char _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- boolean _22;
- <bb 2> :
- ReturnValue_9 = 0;
- u32NumOfFiFoElement_10 = 0;
- u32NumOfMbOccupiedByFiFo_11 = 0;
- _1 = (unsigned char) u32MaxMbNum_12(D);
- if (u8MbIndex_13(D) >= _1)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- ReturnValue_21 = 1;
- goto <bb 8>; [INV]
- <bb 4> :
- if (bIsLegacyFifoEn_14(D) != 0)
- goto <bb 5>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 5> :
- _2 ={v} pBase_17(D)->CTRL2;
- _3 = _2 >> 24;
- u32NumOfFiFoElement_18 = _3 & 15;
- _4 = u32NumOfFiFoElement_18 + 1;
- _5 = _4 * 8;
- _6 = _5 / 4;
- u32NumOfMbOccupiedByFiFo_19 = _6 + 5;
- _7 = (long unsigned int) u8MbIndex_13(D);
- if (u32NumOfMbOccupiedByFiFo_19 >= _7)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- ReturnValue_20 = 1;
- goto <bb 8>; [INV]
- <bb 7> :
- ReturnValue_15 = 0;
- <bb 8> :
- # ReturnValue_8 = PHI <ReturnValue_21(3), ReturnValue_20(6), ReturnValue_15(7), ReturnValue_9(5)>
- _22 = ReturnValue_8;
- <bb 9> :
- <L8>:
- return _22;
- }
- FlexCAN_ReadRxFifo (const struct FLEXCAN_Type * base, struct Flexcan_Ip_MsgBuffType * rxFifo)
- {
- uint8 can_real_payload;
- uint8 flexcan_mb_dlc_value;
- uint32 * msgData_32;
- const uint32 * flexcan_mb_data_32;
- const uint32 * flexcan_mb_id;
- const uint32 * flexcan_mb;
- uint32 MbWord;
- uint32 DataByte;
- long unsigned int base.14_1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- unsigned char _5;
- _Bool _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- long unsigned int _11;
- long unsigned int _12;
- long unsigned int _13;
- unsigned char _14;
- long unsigned int _15;
- long unsigned int _16;
- long unsigned int _17;
- long unsigned int _18;
- const uint32 * _19;
- long unsigned int _20;
- long unsigned int _21;
- long unsigned int _22;
- long unsigned int _23;
- long unsigned int _24;
- long unsigned int _25;
- long unsigned int _26;
- long unsigned int _27;
- long unsigned int _28;
- long unsigned int _29;
- uint32 * _30;
- long unsigned int _31;
- long unsigned int _32;
- <bb 2> :
- base.14_1 = (long unsigned int) base_37(D);
- _2 = base.14_1 + 128;
- flexcan_mb_38 = (const uint32 *) _2;
- flexcan_mb_id_39 = flexcan_mb_38 + 4;
- flexcan_mb_data_32_40 = flexcan_mb_38 + 8;
- msgData_32_42 = &rxFifo_41(D)->data;
- _3 ={v} *flexcan_mb_38;
- _4 = _3 >> 16;
- _5 = (unsigned char) _4;
- flexcan_mb_dlc_value_44 = _5 & 15;
- can_real_payload_46 = FlexCAN_ComputePayloadSize (flexcan_mb_dlc_value_44);
- _6 = rxFifo_41(D) != 0B;
- DevAssert (_6);
- if (can_real_payload_46 > 8)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- can_real_payload_48 = 8;
- <bb 4> :
- # can_real_payload_34 = PHI <can_real_payload_46(2), can_real_payload_48(3)>
- rxFifo_41(D)->dataLen = can_real_payload_34;
- _7 ={v} *flexcan_mb_38;
- rxFifo_41(D)->cs = _7;
- _8 = rxFifo_41(D)->cs;
- _9 = _8 & 2097152;
- if (_9 != 0)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- _10 ={v} *flexcan_mb_id_39;
- rxFifo_41(D)->msgId = _10;
- goto <bb 7>; [INV]
- <bb 6> :
- _11 ={v} *flexcan_mb_id_39;
- _12 = _11 >> 18;
- rxFifo_41(D)->msgId = _12;
- <bb 7> :
- _13 ={v} base_37(D)->RXFIR;
- _14 = (unsigned char) _13;
- rxFifo_41(D)->id_hit = _14;
- _15 = rxFifo_41(D)->cs;
- _16 = _15 & 65535;
- rxFifo_41(D)->time_stamp = _16;
- DataByte_55 = 0;
- goto <bb 9>; [INV]
- <bb 8> :
- _17 = DataByte_33 >> 2;
- _18 = _17 * 4;
- _19 = flexcan_mb_data_32_40 + _18;
- MbWord_56 ={v} *_19;
- _20 = MbWord_56 >> 24;
- _21 = MbWord_56 >> 8;
- _22 = _21 & 65280;
- _23 = _20 | _22;
- _24 = MbWord_56 << 8;
- _25 = _24 & 16711680;
- _26 = _23 | _25;
- _27 = MbWord_56 << 24;
- _28 = DataByte_33 >> 2;
- _29 = _28 * 4;
- _30 = msgData_32_42 + _29;
- _31 = _26 | _27;
- *_30 = _31;
- DataByte_58 = DataByte_33 + 4;
- <bb 9> :
- # DataByte_33 = PHI <DataByte_55(7), DataByte_58(8)>
- _32 = (long unsigned int) can_real_payload_34;
- if (DataByte_33 < _32)
- goto <bb 8>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 10> :
- return;
- }
- FlexCAN_SetRxFifoFilter (struct FLEXCAN_Type * base, Flexcan_Ip_RxFifoIdElementFormatType idFormat, const struct Flexcan_Ip_IdTableType * idFilterTable)
- {
- volatile uint32 * FilterTable;
- uint32 Val;
- uint32 Val2;
- uint32 Val1;
- uint32 NumOfFilters;
- uint32 j;
- uint32 i;
- int iftmp.13;
- long unsigned int base.12_1;
- long unsigned int _2;
- _Bool _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- const struct Flexcan_Ip_IdTableType * _9;
- _Bool _10;
- long unsigned int _11;
- const struct Flexcan_Ip_IdTableType * _12;
- _Bool _13;
- long unsigned int _14;
- const struct Flexcan_Ip_IdTableType * _15;
- long unsigned int _16;
- long unsigned int _17;
- long unsigned int _18;
- long unsigned int _19;
- volatile uint32 * _20;
- long unsigned int _21;
- long unsigned int _22;
- const struct Flexcan_Ip_IdTableType * _23;
- long unsigned int _24;
- long unsigned int _25;
- long unsigned int _26;
- long unsigned int _27;
- volatile uint32 * _28;
- long unsigned int _29;
- long unsigned int _30;
- long unsigned int _31;
- long unsigned int _32;
- long unsigned int _33;
- long unsigned int _34;
- long unsigned int _35;
- const struct Flexcan_Ip_IdTableType * _36;
- _Bool _37;
- sizetype _38;
- sizetype _39;
- const struct Flexcan_Ip_IdTableType * _40;
- _Bool _41;
- long unsigned int _42;
- const struct Flexcan_Ip_IdTableType * _43;
- _Bool _44;
- long unsigned int _45;
- const struct Flexcan_Ip_IdTableType * _46;
- long unsigned int _47;
- long unsigned int _48;
- long unsigned int _49;
- long unsigned int _50;
- long unsigned int _51;
- volatile uint32 * _52;
- long unsigned int _53;
- long unsigned int _54;
- const struct Flexcan_Ip_IdTableType * _55;
- long unsigned int _56;
- long unsigned int _57;
- long unsigned int _58;
- long unsigned int _59;
- volatile uint32 * _60;
- long unsigned int _61;
- sizetype _62;
- sizetype _63;
- const struct Flexcan_Ip_IdTableType * _64;
- _Bool _65;
- long unsigned int _66;
- volatile uint32 * _67;
- long unsigned int _68;
- sizetype _69;
- sizetype _70;
- const struct Flexcan_Ip_IdTableType * _71;
- long unsigned int _72;
- long unsigned int _73;
- long unsigned int _74;
- long unsigned int _75;
- long unsigned int _76;
- volatile uint32 * _77;
- long unsigned int _78;
- long unsigned int _79;
- volatile uint32 * _80;
- long unsigned int _81;
- sizetype _82;
- sizetype _83;
- const struct Flexcan_Ip_IdTableType * _84;
- long unsigned int _85;
- long unsigned int _86;
- long unsigned int _87;
- long unsigned int _88;
- long unsigned int _89;
- volatile uint32 * _90;
- long unsigned int _91;
- long unsigned int _92;
- long unsigned int _93;
- long unsigned int _94;
- long unsigned int _95;
- long unsigned int _96;
- long unsigned int _97;
- const struct Flexcan_Ip_IdTableType * _98;
- _Bool _99;
- long unsigned int _100;
- const struct Flexcan_Ip_IdTableType * _101;
- long unsigned int _102;
- long unsigned int _103;
- long unsigned int _104;
- long unsigned int _105;
- volatile uint32 * _106;
- long unsigned int _107;
- long unsigned int _108;
- const struct Flexcan_Ip_IdTableType * _109;
- long unsigned int _110;
- long unsigned int _111;
- long unsigned int _112;
- long unsigned int _113;
- volatile uint32 * _114;
- long unsigned int _115;
- sizetype _116;
- sizetype _117;
- const struct Flexcan_Ip_IdTableType * _118;
- _Bool _119;
- long unsigned int _120;
- volatile uint32 * _121;
- long unsigned int _122;
- sizetype _123;
- sizetype _124;
- const struct Flexcan_Ip_IdTableType * _125;
- long unsigned int _126;
- long unsigned int _127;
- long unsigned int _128;
- long unsigned int _129;
- long unsigned int _130;
- long unsigned int _131;
- volatile uint32 * _132;
- long unsigned int _133;
- long unsigned int _134;
- volatile uint32 * _135;
- long unsigned int _136;
- sizetype _137;
- sizetype _138;
- const struct Flexcan_Ip_IdTableType * _139;
- long unsigned int _140;
- long unsigned int _141;
- long unsigned int _142;
- long unsigned int _143;
- long unsigned int _144;
- long unsigned int _145;
- volatile uint32 * _146;
- long unsigned int _147;
- sizetype _148;
- sizetype _149;
- const struct Flexcan_Ip_IdTableType * _150;
- _Bool _151;
- long unsigned int _152;
- volatile uint32 * _153;
- long unsigned int _154;
- sizetype _155;
- sizetype _156;
- const struct Flexcan_Ip_IdTableType * _157;
- long unsigned int _158;
- long unsigned int _159;
- long unsigned int _160;
- long unsigned int _161;
- long unsigned int _162;
- long unsigned int _163;
- volatile uint32 * _164;
- long unsigned int _165;
- long unsigned int _166;
- volatile uint32 * _167;
- long unsigned int _168;
- sizetype _169;
- sizetype _170;
- const struct Flexcan_Ip_IdTableType * _171;
- long unsigned int _172;
- long unsigned int _173;
- long unsigned int _174;
- long unsigned int _175;
- long unsigned int _176;
- long unsigned int _177;
- volatile uint32 * _178;
- long unsigned int _179;
- sizetype _180;
- sizetype _181;
- const struct Flexcan_Ip_IdTableType * _182;
- _Bool _183;
- long unsigned int _184;
- volatile uint32 * _185;
- long unsigned int _186;
- sizetype _187;
- sizetype _188;
- const struct Flexcan_Ip_IdTableType * _189;
- long unsigned int _190;
- long unsigned int _191;
- long unsigned int _192;
- long unsigned int _193;
- long unsigned int _194;
- volatile uint32 * _195;
- long unsigned int _196;
- long unsigned int _197;
- volatile uint32 * _198;
- long unsigned int _199;
- sizetype _200;
- sizetype _201;
- const struct Flexcan_Ip_IdTableType * _202;
- long unsigned int _203;
- long unsigned int _204;
- long unsigned int _205;
- long unsigned int _206;
- long unsigned int _207;
- volatile uint32 * _208;
- long unsigned int _209;
- long unsigned int _210;
- long unsigned int _211;
- long unsigned int _212;
- long unsigned int _213;
- int iftmp.13_222;
- int iftmp.13_241;
- int iftmp.13_242;
- <bb 2> :
- Val1_234 = 0;
- Val2_235 = 0;
- Val_236 = 0;
- base.12_1 = (long unsigned int) base_237(D);
- _2 = base.12_1 + 224;
- FilterTable_238 = (volatile uint32 *) _2;
- if (idFilterTable_239(D) != 0B)
- goto <bb 4>; [INV]
- else
- goto <bb 3>; [INV]
- <bb 3> :
- if (idFormat_240(D) == 3)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.13_242 = 1;
- goto <bb 6>; [INV]
- <bb 5> :
- iftmp.13_241 = 0;
- <bb 6> :
- # iftmp.13_222 = PHI <iftmp.13_242(4), iftmp.13_241(5)>
- _3 = (_Bool) iftmp.13_222;
- DevAssert (_3);
- _4 ={v} base_237(D)->CTRL2;
- _5 = _4 >> 24;
- NumOfFilters_245 = _5 & 15;
- switch (idFormat_240(D)) <default: <L44> [INV], case 0: <L4> [INV], case 1: <L13> [INV], case 2: <L27> [INV], case 3: <L43> [INV]>
- <bb 7> :
- <L4>:
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
- _6 ={v} base_237(D)->MCR;
- _7 = _6 & 4294966527;
- base_237(D)->MCR ={v} _7;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
- i_284 = 0;
- goto <bb 14>; [INV]
- <bb 8> :
- Val_285 = 0;
- _8 = i_214 * 8;
- _9 = idFilterTable_239(D) + _8;
- _10 = _9->isRemoteFrame;
- if (_10 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- Val_286 = 2147483648;
- <bb 10> :
- # Val_221 = PHI <Val_285(8), Val_286(9)>
- _11 = i_214 * 8;
- _12 = idFilterTable_239(D) + _11;
- _13 = _12->isExtendedFrame;
- if (_13 != 0)
- goto <bb 11>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 11> :
- Val_288 = Val_221 | 1073741824;
- _14 = i_214 * 8;
- _15 = idFilterTable_239(D) + _14;
- _16 = _15->id;
- _17 = _16 << 1;
- _18 = _17 & 1073741823;
- _19 = i_214 * 4;
- _20 = FilterTable_238 + _19;
- _21 = Val_288 + _18;
- *_20 ={v} _21;
- goto <bb 13>; [INV]
- <bb 12> :
- _22 = i_214 * 8;
- _23 = idFilterTable_239(D) + _22;
- _24 = _23->id;
- _25 = _24 << 19;
- _26 = _25 & 1073217536;
- _27 = i_214 * 4;
- _28 = FilterTable_238 + _27;
- _29 = Val_221 + _26;
- *_28 ={v} _29;
- <bb 13> :
- i_290 = i_214 + 1;
- <bb 14> :
- # i_214 = PHI <i_284(7), i_290(13)>
- _30 = NumOfFilters_245 + 1;
- _31 = _30 * 8;
- if (i_214 < _31)
- goto <bb 8>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 15> :
- goto <bb 48>; [INV]
- <bb 16> :
- <L13>:
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
- _32 ={v} base_237(D)->MCR;
- _33 = _32 & 4294966527;
- _34 = _33 | 256;
- base_237(D)->MCR ={v} _34;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
- j_267 = 0;
- i_268 = 0;
- goto <bb 28>; [INV]
- <bb 17> :
- Val1_269 = 0;
- Val2_270 = 0;
- _35 = j_217 * 8;
- _36 = idFilterTable_239(D) + _35;
- _37 = _36->isRemoteFrame;
- if (_37 != 0)
- goto <bb 18>; [INV]
- else
- goto <bb 19>; [INV]
- <bb 18> :
- Val1_271 = 2147483648;
- <bb 19> :
- # Val1_219 = PHI <Val1_269(17), Val1_271(18)>
- _38 = j_217 + 1;
- _39 = _38 * 8;
- _40 = idFilterTable_239(D) + _39;
- _41 = _40->isRemoteFrame;
- if (_41 != 0)
- goto <bb 20>; [INV]
- else
- goto <bb 21>; [INV]
- <bb 20> :
- Val2_272 = 32768;
- <bb 21> :
- # Val2_220 = PHI <Val2_270(19), Val2_272(20)>
- _42 = j_217 * 8;
- _43 = idFilterTable_239(D) + _42;
- _44 = _43->isExtendedFrame;
- if (_44 != 0)
- goto <bb 22>; [INV]
- else
- goto <bb 23>; [INV]
- <bb 22> :
- Val1_274 = Val1_219 | 1073741824;
- _45 = j_217 * 8;
- _46 = idFilterTable_239(D) + _45;
- _47 = _46->id;
- _48 = _47 >> 15;
- _49 = _48 << 16;
- _50 = _49 & 1073676288;
- _51 = i_215 * 4;
- _52 = FilterTable_238 + _51;
- _53 = Val1_274 + _50;
- *_52 ={v} _53;
- goto <bb 24>; [INV]
- <bb 23> :
- _54 = j_217 * 8;
- _55 = idFilterTable_239(D) + _54;
- _56 = _55->id;
- _57 = _56 << 19;
- _58 = _57 & 1073217536;
- _59 = i_215 * 4;
- _60 = FilterTable_238 + _59;
- _61 = Val1_219 + _58;
- *_60 ={v} _61;
- <bb 24> :
- _62 = j_217 + 1;
- _63 = _62 * 8;
- _64 = idFilterTable_239(D) + _63;
- _65 = _64->isExtendedFrame;
- if (_65 != 0)
- goto <bb 25>; [INV]
- else
- goto <bb 26>; [INV]
- <bb 25> :
- Val2_277 = Val2_220 | 16384;
- _66 = i_215 * 4;
- _67 = FilterTable_238 + _66;
- _68 ={v} *_67;
- _69 = j_217 + 1;
- _70 = _69 * 8;
- _71 = idFilterTable_239(D) + _70;
- _72 = _71->id;
- _73 = _72 >> 15;
- _74 = _73 & 16383;
- _75 = Val2_277 + _74;
- _76 = i_215 * 4;
- _77 = FilterTable_238 + _76;
- _78 = _68 | _75;
- *_77 ={v} _78;
- goto <bb 27>; [INV]
- <bb 26> :
- _79 = i_215 * 4;
- _80 = FilterTable_238 + _79;
- _81 ={v} *_80;
- _82 = j_217 + 1;
- _83 = _82 * 8;
- _84 = idFilterTable_239(D) + _83;
- _85 = _84->id;
- _86 = _85 << 3;
- _87 = _86 & 16376;
- _88 = Val2_220 + _87;
- _89 = i_215 * 4;
- _90 = FilterTable_238 + _89;
- _91 = _81 | _88;
- *_90 ={v} _91;
- <bb 27> :
- j_279 = j_217 + 2;
- i_280 = i_215 + 1;
- <bb 28> :
- # i_215 = PHI <i_268(16), i_280(27)>
- # j_217 = PHI <j_267(16), j_279(27)>
- _92 = NumOfFilters_245 + 1;
- _93 = _92 * 8;
- if (i_215 < _93)
- goto <bb 17>; [INV]
- else
- goto <bb 29>; [INV]
- <bb 29> :
- goto <bb 48>; [INV]
- <bb 30> :
- <L27>:
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
- _94 ={v} base_237(D)->MCR;
- _95 = _94 & 4294966527;
- _96 = _95 | 512;
- base_237(D)->MCR ={v} _96;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
- j_252 = 0;
- i_253 = 0;
- goto <bb 44>; [INV]
- <bb 31> :
- _97 = j_218 * 8;
- _98 = idFilterTable_239(D) + _97;
- _99 = _98->isExtendedFrame;
- if (_99 != 0)
- goto <bb 32>; [INV]
- else
- goto <bb 33>; [INV]
- <bb 32> :
- _100 = j_218 * 8;
- _101 = idFilterTable_239(D) + _100;
- _102 = _101->id;
- _103 = _102 >> 21;
- _104 = _103 << 24;
- _105 = i_216 * 4;
- _106 = FilterTable_238 + _105;
- _107 = Val1_234 + _104;
- *_106 ={v} _107;
- goto <bb 34>; [INV]
- <bb 33> :
- _108 = j_218 * 8;
- _109 = idFilterTable_239(D) + _108;
- _110 = _109->id;
- _111 = _110 >> 3;
- _112 = _111 << 24;
- _113 = i_216 * 4;
- _114 = FilterTable_238 + _113;
- _115 = Val1_234 + _112;
- *_114 ={v} _115;
- <bb 34> :
- _116 = j_218 + 1;
- _117 = _116 * 8;
- _118 = idFilterTable_239(D) + _117;
- _119 = _118->isExtendedFrame;
- if (_119 != 0)
- goto <bb 35>; [INV]
- else
- goto <bb 36>; [INV]
- <bb 35> :
- _120 = i_216 * 4;
- _121 = FilterTable_238 + _120;
- _122 ={v} *_121;
- _123 = j_218 + 1;
- _124 = _123 * 8;
- _125 = idFilterTable_239(D) + _124;
- _126 = _125->id;
- _127 = _126 >> 21;
- _128 = _127 << 16;
- _129 = _128 & 16711680;
- _130 = Val1_234 + _129;
- _131 = i_216 * 4;
- _132 = FilterTable_238 + _131;
- _133 = _122 | _130;
- *_132 ={v} _133;
- goto <bb 37>; [INV]
- <bb 36> :
- _134 = i_216 * 4;
- _135 = FilterTable_238 + _134;
- _136 ={v} *_135;
- _137 = j_218 + 1;
- _138 = _137 * 8;
- _139 = idFilterTable_239(D) + _138;
- _140 = _139->id;
- _141 = _140 >> 3;
- _142 = _141 << 16;
- _143 = _142 & 16711680;
- _144 = Val1_234 + _143;
- _145 = i_216 * 4;
- _146 = FilterTable_238 + _145;
- _147 = _136 | _144;
- *_146 ={v} _147;
- <bb 37> :
- _148 = j_218 + 2;
- _149 = _148 * 8;
- _150 = idFilterTable_239(D) + _149;
- _151 = _150->isExtendedFrame;
- if (_151 != 0)
- goto <bb 38>; [INV]
- else
- goto <bb 39>; [INV]
- <bb 38> :
- _152 = i_216 * 4;
- _153 = FilterTable_238 + _152;
- _154 ={v} *_153;
- _155 = j_218 + 2;
- _156 = _155 * 8;
- _157 = idFilterTable_239(D) + _156;
- _158 = _157->id;
- _159 = _158 >> 21;
- _160 = _159 << 8;
- _161 = _160 & 65535;
- _162 = Val1_234 + _161;
- _163 = i_216 * 4;
- _164 = FilterTable_238 + _163;
- _165 = _154 | _162;
- *_164 ={v} _165;
- goto <bb 40>; [INV]
- <bb 39> :
- _166 = i_216 * 4;
- _167 = FilterTable_238 + _166;
- _168 ={v} *_167;
- _169 = j_218 + 2;
- _170 = _169 * 8;
- _171 = idFilterTable_239(D) + _170;
- _172 = _171->id;
- _173 = _172 >> 3;
- _174 = _173 << 8;
- _175 = _174 & 65535;
- _176 = Val1_234 + _175;
- _177 = i_216 * 4;
- _178 = FilterTable_238 + _177;
- _179 = _168 | _176;
- *_178 ={v} _179;
- <bb 40> :
- _180 = j_218 + 3;
- _181 = _180 * 8;
- _182 = idFilterTable_239(D) + _181;
- _183 = _182->isExtendedFrame;
- if (_183 != 0)
- goto <bb 41>; [INV]
- else
- goto <bb 42>; [INV]
- <bb 41> :
- _184 = i_216 * 4;
- _185 = FilterTable_238 + _184;
- _186 ={v} *_185;
- _187 = j_218 + 3;
- _188 = _187 * 8;
- _189 = idFilterTable_239(D) + _188;
- _190 = _189->id;
- _191 = _190 >> 21;
- _192 = _191 & 255;
- _193 = Val1_234 + _192;
- _194 = i_216 * 4;
- _195 = FilterTable_238 + _194;
- _196 = _186 | _193;
- *_195 ={v} _196;
- goto <bb 43>; [INV]
- <bb 42> :
- _197 = i_216 * 4;
- _198 = FilterTable_238 + _197;
- _199 ={v} *_198;
- _200 = j_218 + 3;
- _201 = _200 * 8;
- _202 = idFilterTable_239(D) + _201;
- _203 = _202->id;
- _204 = _203 >> 3;
- _205 = _204 & 255;
- _206 = Val1_234 + _205;
- _207 = i_216 * 4;
- _208 = FilterTable_238 + _207;
- _209 = _199 | _206;
- *_208 ={v} _209;
- <bb 43> :
- j_262 = j_218 + 4;
- i_263 = i_216 + 1;
- <bb 44> :
- # i_216 = PHI <i_253(30), i_263(43)>
- # j_218 = PHI <j_252(30), j_262(43)>
- _210 = NumOfFilters_245 + 1;
- _211 = _210 * 8;
- if (i_216 < _211)
- goto <bb 31>; [INV]
- else
- goto <bb 45>; [INV]
- <bb 45> :
- goto <bb 48>; [INV]
- <bb 46> :
- <L43>:
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
- _212 ={v} base_237(D)->MCR;
- _213 = _212 | 768;
- base_237(D)->MCR ={v} _213;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
- goto <bb 48>; [INV]
- <bb 47> :
- <L44>:
- <bb 48> :
- return;
- }
- FlexCAN_SetOperationMode (struct FLEXCAN_Type * base, Flexcan_Ip_ModesType mode)
- {
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- <bb 2> :
- switch (mode_12(D)) <default: <L3> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV]>
- <bb 3> :
- <L0>:
- _1 ={v} base_14(D)->CTRL1;
- _2 = _1 & 4294967287;
- base_14(D)->CTRL1 ={v} _2;
- _3 ={v} base_14(D)->CTRL1;
- _4 = _3 & 4294963199;
- base_14(D)->CTRL1 ={v} _4;
- goto <bb 7>; [INV]
- <bb 4> :
- <L1>:
- _5 ={v} base_14(D)->CTRL1;
- _6 = _5 | 8;
- base_14(D)->CTRL1 ={v} _6;
- goto <bb 7>; [INV]
- <bb 5> :
- <L2>:
- _7 ={v} base_14(D)->CTRL1;
- _8 = _7 | 4096;
- base_14(D)->CTRL1 ={v} _8;
- _9 ={v} base_14(D)->CTRL1;
- _10 = _9 & 4294967287;
- base_14(D)->CTRL1 ={v} _10;
- FlexCAN_SetSelfReception (base_14(D), 1);
- goto <bb 7>; [INV]
- <bb 6> :
- <L3>:
- <bb 7> :
- return;
- }
- FlexCAN_SetMaxMsgBuffNum (struct FLEXCAN_Type * base, uint32 maxMsgBuffNum)
- {
- Flexcan_Ip_StatusType Status;
- uint32 ValEndRam;
- uint32 ValEndMb;
- uint8 Can_Real_Payload;
- uint8 Arbitration_Field_Size;
- volatile uint8 * Flexcan_Mb_Data;
- volatile uint32 * Flexcan_Mb_Id;
- volatile uint32 * Flexcan_Mb;
- const uint32 * ValEndMbPointer;
- const uint32 * RAM;
- uint32 DataByte;
- uint8 MsgBuffIdx;
- Flexcan_Ip_StatusType D.7549;
- long unsigned int base.8_1;
- long unsigned int _2;
- long unsigned int _3;
- _Bool _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int ValEndMbPointer.9_7;
- long unsigned int _8;
- long unsigned int _9;
- const uint32 * _10;
- long unsigned int _11;
- long unsigned int _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- long unsigned int _16;
- long unsigned int _17;
- long unsigned int _18;
- long unsigned int _19;
- long unsigned int _20;
- volatile uint8 * _21;
- long unsigned int _22;
- unsigned char MsgBuffIdx.10_23;
- long unsigned int _24;
- Flexcan_Ip_StatusType _68;
- <bb 2> :
- base.8_1 = (long unsigned int) base_33(D);
- _2 = base.8_1 + 128;
- RAM_34 = (const uint32 *) _2;
- ValEndMbPointer_35 = 0B;
- Flexcan_Mb_36 = 0B;
- Flexcan_Mb_Id_37 = 0B;
- Flexcan_Mb_Data_38 = 0B;
- Arbitration_Field_Size_39 = 8;
- _3 = maxMsgBuffNum_40(D) + 4294967295;
- Can_Real_Payload_43 = FlexCAN_GetMbPayloadSize (base_33(D), _3);
- ValEndMb_44 = 0;
- ValEndRam_45 = 0;
- Status_46 = 0;
- _4 = maxMsgBuffNum_40(D) != 0;
- DevAssert (_4);
- _5 = maxMsgBuffNum_40(D) + 4294967295;
- ValEndMbPointer_49 = FlexCAN_GetMsgBuffRegion (base_33(D), _5);
- _6 = (long unsigned int) Can_Real_Payload_43;
- ValEndMbPointer.9_7 = (long unsigned int) ValEndMbPointer_49;
- _8 = _6 + ValEndMbPointer.9_7;
- _9 = (long unsigned int) Arbitration_Field_Size_39;
- ValEndMb_50 = _8 + _9;
- _10 = RAM_34 + 512;
- ValEndRam_51 = (uint32) _10;
- if (ValEndMb_50 > ValEndRam_51)
- goto <bb 4>; [INV]
- else
- goto <bb 3>; [INV]
- <bb 3> :
- _11 = FlexCAN_GetMaxMbNum (base_33(D));
- if (maxMsgBuffNum_40(D) > _11)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- Status_53 = 4;
- <bb 5> :
- # Status_27 = PHI <Status_46(3), Status_53(4)>
- if (Status_27 == 0)
- goto <bb 6>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 6> :
- _12 ={v} base_33(D)->MCR;
- _13 = _12 & 4294967168;
- _14 = maxMsgBuffNum_40(D) + 4294967295;
- _15 = _14 & 127;
- _16 = _13 | _15;
- base_33(D)->MCR ={v} _16;
- _17 ={v} base_33(D)->MCR;
- _18 = _17 & 536870912;
- if (_18 == 0)
- goto <bb 7>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 7> :
- MsgBuffIdx_55 = 0;
- goto <bb 12>; [INV]
- <bb 8> :
- _19 = (long unsigned int) MsgBuffIdx_25;
- Flexcan_Mb_57 = FlexCAN_GetMsgBuffRegion (base_33(D), _19);
- Flexcan_Mb_Id_58 = Flexcan_Mb_57 + 4;
- Flexcan_Mb_Data_59 = Flexcan_Mb_57 + 8;
- *Flexcan_Mb_57 ={v} 0;
- *Flexcan_Mb_Id_58 ={v} 0;
- _20 = (long unsigned int) MsgBuffIdx_25;
- Can_Real_Payload_63 = FlexCAN_GetMbPayloadSize (base_33(D), _20);
- DataByte_64 = 0;
- goto <bb 10>; [INV]
- <bb 9> :
- _21 = Flexcan_Mb_Data_59 + DataByte_26;
- *_21 ={v} 0;
- DataByte_67 = DataByte_26 + 1;
- <bb 10> :
- # DataByte_26 = PHI <DataByte_64(8), DataByte_67(9)>
- _22 = (long unsigned int) Can_Real_Payload_63;
- if (DataByte_26 < _22)
- goto <bb 9>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 11> :
- MsgBuffIdx.10_23 = MsgBuffIdx_25;
- MsgBuffIdx_65 = MsgBuffIdx.10_23 + 1;
- <bb 12> :
- # MsgBuffIdx_25 = PHI <MsgBuffIdx_55(7), MsgBuffIdx_65(11)>
- _24 = (long unsigned int) MsgBuffIdx_25;
- if (maxMsgBuffNum_40(D) > _24)
- goto <bb 8>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 13> :
- _68 = Status_27;
- <bb 14> :
- <L13>:
- return _68;
- }
- FlexCAN_SetTxMsgBuff (volatile uint32 * const pMbAddr, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId, const uint8 * msgData, const boolean isRemote)
- {
- const uint32 * MsgData_32;
- volatile uint32 * Flexcan_Mb_Data_32;
- volatile uint8 * Flexcan_Mb_Data;
- volatile uint32 * Flexcan_Mb_Id;
- volatile uint32 * Flexcan_Mb;
- uint8 Payload_Size;
- uint8 Dlc_Value;
- uint32 DataByte;
- uint32 Flexcan_Mb_Config;
- _Bool _1;
- long unsigned int _2;
- unsigned char _3;
- long unsigned int _4;
- long unsigned int _5;
- const uint32 * _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- const uint32 * _11;
- long unsigned int _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- long unsigned int _16;
- long unsigned int _17;
- const uint32 * _18;
- long unsigned int _19;
- long unsigned int _20;
- long unsigned int _21;
- long unsigned int _22;
- long unsigned int _23;
- long unsigned int _24;
- const uint32 * _25;
- long unsigned int _26;
- long unsigned int _27;
- long unsigned int _28;
- long unsigned int _29;
- volatile uint32 * _30;
- long unsigned int _31;
- long unsigned int _32;
- long unsigned int _33;
- const uint8 * _34;
- long unsigned int _35;
- volatile uint8 * _36;
- unsigned char _37;
- long unsigned int _38;
- long unsigned int _39;
- volatile uint8 * _40;
- unsigned char _41;
- long unsigned int _42;
- <unnamed type> _43;
- long unsigned int _44;
- long unsigned int _45;
- long unsigned int _46;
- long unsigned int _47;
- long unsigned int _48;
- <unnamed type> _49;
- long unsigned int _50;
- long unsigned int _51;
- long unsigned int _52;
- long unsigned int _53;
- long unsigned int _54;
- long unsigned int _55;
- long unsigned int _56;
- long unsigned int _57;
- long unsigned int _58;
- long unsigned int _59;
- long unsigned int _60;
- _Bool _61;
- long unsigned int _62;
- long unsigned int _63;
- long unsigned int _64;
- long unsigned int _65;
- long unsigned int _66;
- long unsigned int _67;
- long unsigned int _68;
- _Bool _69;
- long unsigned int _70;
- long unsigned int _71;
- <bb 2> :
- Flexcan_Mb_Config_87 = 0;
- Flexcan_Mb_89 = pMbAddr_88(D);
- Flexcan_Mb_Id_90 = Flexcan_Mb_89 + 4;
- Flexcan_Mb_Data_91 = Flexcan_Mb_89 + 8;
- Flexcan_Mb_Data_32_92 = Flexcan_Mb_89 + 8;
- MsgData_32_94 = msgData_93(D);
- _1 = cs_95(D) != 0B;
- DevAssert (_1);
- *Flexcan_Mb_89 ={v} 134217728;
- *Flexcan_Mb_Id_90 ={v} 0;
- _2 = cs_95(D)->dataLen;
- _3 = (unsigned char) _2;
- Dlc_Value_101 = FlexCAN_ComputeDLCValue (_3);
- if (msgData_93(D) != 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 3> :
- DataByte_102 = 0;
- goto <bb 5>; [INV]
- <bb 4> :
- _4 = DataByte_77 >> 2;
- _5 = _4 * 4;
- _6 = MsgData_32_94 + _5;
- _7 = *_6;
- _8 = _7 >> 24;
- _9 = DataByte_77 >> 2;
- _10 = _9 * 4;
- _11 = MsgData_32_94 + _10;
- _12 = *_11;
- _13 = _12 >> 8;
- _14 = _13 & 65280;
- _15 = _8 | _14;
- _16 = DataByte_77 >> 2;
- _17 = _16 * 4;
- _18 = MsgData_32_94 + _17;
- _19 = *_18;
- _20 = _19 << 8;
- _21 = _20 & 16711680;
- _22 = _15 | _21;
- _23 = DataByte_77 >> 2;
- _24 = _23 * 4;
- _25 = MsgData_32_94 + _24;
- _26 = *_25;
- _27 = _26 << 24;
- _28 = DataByte_77 >> 2;
- _29 = _28 * 4;
- _30 = Flexcan_Mb_Data_32_92 + _29;
- _31 = _22 | _27;
- *_30 ={v} _31;
- DataByte_111 = DataByte_77 + 4;
- <bb 5> :
- # DataByte_77 = PHI <DataByte_102(3), DataByte_111(4)>
- _32 = cs_95(D)->dataLen;
- _33 = _32 & 4294967292;
- if (DataByte_77 < _33)
- goto <bb 4>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 6> :
- goto <bb 8>; [INV]
- <bb 7> :
- _34 = msgData_93(D) + DataByte_78;
- _35 = DataByte_78 ^ 3;
- _36 = Flexcan_Mb_Data_91 + _35;
- _37 = *_34;
- *_36 ={v} _37;
- DataByte_109 = DataByte_78 + 1;
- <bb 8> :
- # DataByte_78 = PHI <DataByte_77(6), DataByte_109(7)>
- _38 = cs_95(D)->dataLen;
- if (DataByte_78 < _38)
- goto <bb 7>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 9> :
- Payload_Size_104 = FlexCAN_ComputePayloadSize (Dlc_Value_101);
- DataByte_105 = cs_95(D)->dataLen;
- goto <bb 11>; [INV]
- <bb 10> :
- _39 = DataByte_79 ^ 3;
- _40 = Flexcan_Mb_Data_91 + _39;
- _41 = cs_95(D)->fd_padding;
- *_40 ={v} _41;
- DataByte_107 = DataByte_79 + 1;
- <bb 11> :
- # DataByte_79 = PHI <DataByte_105(9), DataByte_107(10)>
- _42 = (long unsigned int) Payload_Size_104;
- if (DataByte_79 < _42)
- goto <bb 10>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 12> :
- _43 = cs_95(D)->msgIdType;
- if (_43 == 1)
- goto <bb 13>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 13> :
- _44 ={v} *Flexcan_Mb_Id_90;
- _45 = _44 & 3758096384;
- *Flexcan_Mb_Id_90 ={v} _45;
- _46 ={v} *Flexcan_Mb_Id_90;
- _47 = msgId_113(D) & 536870911;
- _48 = _46 | _47;
- *Flexcan_Mb_Id_90 ={v} _48;
- Flexcan_Mb_Config_115 = Flexcan_Mb_Config_87 | 6291456;
- <bb 14> :
- # Flexcan_Mb_Config_72 = PHI <Flexcan_Mb_Config_87(12), Flexcan_Mb_Config_115(13)>
- _49 = cs_95(D)->msgIdType;
- if (_49 == 0)
- goto <bb 15>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 15> :
- _50 ={v} *Flexcan_Mb_Id_90;
- _51 = _50 & 3758358527;
- *Flexcan_Mb_Id_90 ={v} _51;
- _52 ={v} *Flexcan_Mb_Id_90;
- _53 = msgId_113(D) << 18;
- _54 = _53 & 536608768;
- _55 = _52 | _54;
- *Flexcan_Mb_Id_90 ={v} _55;
- Flexcan_Mb_Config_118 = Flexcan_Mb_Config_72 & 4288675839;
- <bb 16> :
- # Flexcan_Mb_Config_73 = PHI <Flexcan_Mb_Config_72(14), Flexcan_Mb_Config_118(15)>
- Flexcan_Mb_Config_119 = Flexcan_Mb_Config_73 & 4293984255;
- _56 = (long unsigned int) Dlc_Value_101;
- _57 = _56 << 16;
- _58 = _57 & 983040;
- Flexcan_Mb_Config_120 = Flexcan_Mb_Config_119 | _58;
- _59 = cs_95(D)->code;
- if (_59 != 15)
- goto <bb 17>; [INV]
- else
- goto <bb 27>; [INV]
- <bb 17> :
- _60 = cs_95(D)->code;
- if (_60 == 28)
- goto <bb 18>; [INV]
- else
- goto <bb 19>; [INV]
- <bb 18> :
- Flexcan_Mb_Config_123 = Flexcan_Mb_Config_120 | 1048576;
- goto <bb 21>; [INV]
- <bb 19> :
- if (isRemote_121(D) != 0)
- goto <bb 20>; [INV]
- else
- goto <bb 21>; [INV]
- <bb 20> :
- Flexcan_Mb_Config_122 = Flexcan_Mb_Config_120 | 1048576;
- <bb 21> :
- # Flexcan_Mb_Config_74 = PHI <Flexcan_Mb_Config_123(18), Flexcan_Mb_Config_120(19), Flexcan_Mb_Config_122(20)>
- Flexcan_Mb_Config_124 = Flexcan_Mb_Config_74 & 4043309055;
- _61 = cs_95(D)->fd_enable;
- if (_61 != 0)
- goto <bb 22>; [INV]
- else
- goto <bb 23>; [INV]
- <bb 22> :
- _62 = cs_95(D)->code;
- _63 = _62 << 24;
- _64 = _63 & 251658240;
- _65 = Flexcan_Mb_Config_124 | _64;
- Flexcan_Mb_Config_126 = _65 | 2147483648;
- Flexcan_Mb_Config_127 = Flexcan_Mb_Config_126 & 4293918719;
- goto <bb 24>; [INV]
- <bb 23> :
- _66 = cs_95(D)->code;
- _67 = _66 << 24;
- _68 = _67 & 251658240;
- Flexcan_Mb_Config_125 = Flexcan_Mb_Config_124 | _68;
- <bb 24> :
- # Flexcan_Mb_Config_75 = PHI <Flexcan_Mb_Config_127(22), Flexcan_Mb_Config_125(23)>
- _69 = cs_95(D)->enable_brs;
- if (_69 != 0)
- goto <bb 25>; [INV]
- else
- goto <bb 26>; [INV]
- <bb 25> :
- Flexcan_Mb_Config_128 = Flexcan_Mb_Config_75 | 1073741824;
- <bb 26> :
- # Flexcan_Mb_Config_76 = PHI <Flexcan_Mb_Config_75(24), Flexcan_Mb_Config_128(25)>
- _70 ={v} *Flexcan_Mb_89;
- _71 = Flexcan_Mb_Config_76 | _70;
- *Flexcan_Mb_89 ={v} _71;
- <bb 27> :
- return;
- }
- FlexCAN_GetMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, struct Flexcan_Ip_MsgBuffType * msgBuff)
- {
- uint8 Payload_Size;
- uint8 Flexcan_Mb_Dlc_Value;
- uint32 MbWord;
- uint32 * MsgBuff_Data_32;
- const uint32 * Flexcan_Mb_Data_32;
- const uint8 * Flexcan_Mb_Data;
- const uint32 * Flexcan_Mb_Id;
- const uint32 * Flexcan_Mb;
- uint8 i;
- long unsigned int _1;
- long unsigned int _2;
- unsigned char _3;
- _Bool _4;
- unsigned char _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- long unsigned int _11;
- long unsigned int _12;
- long unsigned int _13;
- unsigned char _14;
- unsigned int _15;
- unsigned int _16;
- const uint32 * _17;
- long unsigned int _18;
- long unsigned int _19;
- long unsigned int _20;
- long unsigned int _21;
- long unsigned int _22;
- long unsigned int _23;
- long unsigned int _24;
- long unsigned int _25;
- unsigned char _26;
- unsigned int _27;
- unsigned int _28;
- uint32 * _29;
- long unsigned int _30;
- unsigned int _31;
- unsigned int _32;
- unsigned int _33;
- unsigned char _34;
- sizetype _35;
- const uint8 * _36;
- int _37;
- unsigned char _38;
- unsigned char i.7_39;
- <bb 2> :
- Flexcan_Mb_51 = FlexCAN_GetMsgBuffRegion (base_48(D), msgBuffIdx_49(D));
- Flexcan_Mb_Id_52 = Flexcan_Mb_51 + 4;
- Flexcan_Mb_Data_53 = Flexcan_Mb_51 + 8;
- Flexcan_Mb_Data_32_54 = Flexcan_Mb_51 + 8;
- MsgBuff_Data_32_56 = &msgBuff_55(D)->data;
- _1 ={v} *Flexcan_Mb_51;
- _2 = _1 >> 16;
- _3 = (unsigned char) _2;
- Flexcan_Mb_Dlc_Value_57 = _3 & 15;
- Payload_Size_59 = FlexCAN_ComputePayloadSize (Flexcan_Mb_Dlc_Value_57);
- _4 = msgBuff_55(D) != 0B;
- DevAssert (_4);
- _5 = FlexCAN_GetMbPayloadSize (base_48(D), msgBuffIdx_49(D));
- if (Payload_Size_59 > _5)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- Payload_Size_63 = FlexCAN_GetMbPayloadSize (base_48(D), msgBuffIdx_49(D));
- <bb 4> :
- # Payload_Size_42 = PHI <Payload_Size_59(2), Payload_Size_63(3)>
- msgBuff_55(D)->dataLen = Payload_Size_42;
- _6 ={v} *Flexcan_Mb_51;
- msgBuff_55(D)->cs = _6;
- _7 = msgBuff_55(D)->cs;
- _8 = _7 & 2097152;
- if (_8 != 0)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- _9 ={v} *Flexcan_Mb_Id_52;
- msgBuff_55(D)->msgId = _9;
- goto <bb 7>; [INV]
- <bb 6> :
- _10 ={v} *Flexcan_Mb_Id_52;
- _11 = _10 >> 18;
- msgBuff_55(D)->msgId = _11;
- <bb 7> :
- _12 = msgBuff_55(D)->cs;
- _13 = _12 & 65535;
- msgBuff_55(D)->time_stamp = _13;
- i_69 = 0;
- goto <bb 9>; [INV]
- <bb 8> :
- _14 = i_40 >> 2;
- _15 = (unsigned int) _14;
- _16 = _15 * 4;
- _17 = Flexcan_Mb_Data_32_54 + _16;
- MbWord_72 ={v} *_17;
- _18 = MbWord_72 >> 24;
- _19 = MbWord_72 >> 8;
- _20 = _19 & 65280;
- _21 = _18 | _20;
- _22 = MbWord_72 << 8;
- _23 = _22 & 16711680;
- _24 = _21 | _23;
- _25 = MbWord_72 << 24;
- _26 = i_40 >> 2;
- _27 = (unsigned int) _26;
- _28 = _27 * 4;
- _29 = MsgBuff_Data_32_56 + _28;
- _30 = _24 | _25;
- *_29 = _30;
- i_74 = i_40 + 4;
- <bb 9> :
- # i_40 = PHI <i_69(7), i_74(8)>
- _31 = (unsigned int) i_40;
- _32 = (unsigned int) Payload_Size_42;
- _33 = _32 & 4294967292;
- if (_31 < _33)
- goto <bb 8>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 10> :
- goto <bb 12>; [INV]
- <bb 11> :
- _34 = i_41 ^ 3;
- _35 = (sizetype) _34;
- _36 = Flexcan_Mb_Data_53 + _35;
- _37 = (int) i_41;
- _38 ={v} *_36;
- msgBuff_55(D)->data[_37] = _38;
- i.7_39 = i_41;
- i_71 = i.7_39 + 1;
- <bb 12> :
- # i_41 = PHI <i_40(10), i_71(11)>
- if (i_41 < Payload_Size_42)
- goto <bb 11>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 13> :
- return;
- }
- FlexCAN_GetMsgBuffTimestamp (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
- {
- const uint32 * Flexcan_Mb;
- uint32 TimeStamp;
- uint32 D.7517;
- long unsigned int _1;
- uint32 _9;
- <bb 2> :
- TimeStamp_2 = 0;
- Flexcan_Mb_7 = FlexCAN_GetMsgBuffRegion (base_4(D), msgBuffIdx_5(D));
- _1 ={v} *Flexcan_Mb_7;
- TimeStamp_8 = _1 & 65535;
- _9 = TimeStamp_8;
- <bb 3> :
- <L0>:
- return _9;
- }
- FlexCAN_SetRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId)
- {
- volatile uint32 * flexcan_mb_id;
- volatile uint32 * flexcan_mb;
- _Bool _1;
- <unnamed type> _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- long unsigned int _11;
- <unnamed type> _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- long unsigned int _16;
- long unsigned int _17;
- long unsigned int _18;
- long unsigned int _19;
- long unsigned int _20;
- long unsigned int _21;
- long unsigned int _22;
- long unsigned int _23;
- long unsigned int _24;
- long unsigned int _25;
- long unsigned int _26;
- long unsigned int _27;
- long unsigned int _28;
- <bb 2> :
- flexcan_mb_36 = FlexCAN_GetMsgBuffRegion (base_33(D), msgBuffIdx_34(D));
- flexcan_mb_id_37 = flexcan_mb_36 + 4;
- _1 = cs_38(D) != 0B;
- DevAssert (_1);
- *flexcan_mb_36 ={v} 0;
- *flexcan_mb_id_37 ={v} 0;
- _2 = cs_38(D)->msgIdType;
- if (_2 == 1)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- _3 ={v} *flexcan_mb_36;
- _4 = _3 | 2097152;
- *flexcan_mb_36 ={v} _4;
- _5 ={v} *flexcan_mb_36;
- _6 = _5 & 4290772991;
- *flexcan_mb_36 ={v} _6;
- _7 ={v} *flexcan_mb_id_37;
- _8 = _7 & 3758096384;
- *flexcan_mb_id_37 ={v} _8;
- _9 ={v} *flexcan_mb_id_37;
- _10 = msgId_45(D) & 536870911;
- _11 = _9 | _10;
- *flexcan_mb_id_37 ={v} _11;
- <bb 4> :
- _12 = cs_38(D)->msgIdType;
- if (_12 == 0)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- _13 ={v} *flexcan_mb_36;
- _14 = _13 & 4288675839;
- *flexcan_mb_36 ={v} _14;
- _15 ={v} *flexcan_mb_id_37;
- _16 = _15 & 3758358527;
- *flexcan_mb_id_37 ={v} _16;
- _17 ={v} *flexcan_mb_id_37;
- _18 = msgId_45(D) << 18;
- _19 = _18 & 536608768;
- _20 = _17 | _19;
- *flexcan_mb_id_37 ={v} _20;
- <bb 6> :
- _21 = cs_38(D)->code;
- if (_21 != 15)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- _22 ={v} *flexcan_mb_36;
- _23 = _22 & 4043309055;
- *flexcan_mb_36 ={v} _23;
- _24 ={v} *flexcan_mb_36;
- _25 = cs_38(D)->code;
- _26 = _25 << 24;
- _27 = _26 & 251658240;
- _28 = _24 | _27;
- *flexcan_mb_36 ={v} _28;
- <bb 8> :
- return;
- }
- FlexCAN_EnableInterrupts (struct FLEXCAN_Type * pBase, uint8 u8Instance)
- {
- int _1;
- long unsigned int _2;
- <bb 2> :
- _1 = (int) u8Instance_3(D);
- _2 ={v} FlexCAN_Ip_au32ImaskBuff[_1][0];
- pBase_5(D)->IMASK1 ={v} _2;
- return;
- }
- FlexCAN_DisableInterrupts (struct FLEXCAN_Type * pBase)
- {
- <bb 2> :
- pBase_2(D)->IMASK1 ={v} 0;
- return;
- }
- FLEXCAN_ClearMsgBuffIntCmd (struct FLEXCAN_Type * pBase, uint8 u8Instance, uint32 mb_idx, boolean bIsIntActive)
- {
- uint32 temp;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- int _4;
- long unsigned int _5;
- int _6;
- long unsigned int _7;
- <bb 2> :
- _1 = mb_idx_10(D) & 31;
- temp_11 = 1 << _1;
- if (mb_idx_10(D) <= 31)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 3> :
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_11 ();
- _2 ={v} pBase_14(D)->IMASK1;
- _3 = ~temp_11;
- _4 = (int) u8Instance_15(D);
- _5 = _2 & _3;
- FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5;
- if (bIsIntActive_17(D) != 0)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- _6 = (int) u8Instance_15(D);
- _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0];
- pBase_14(D)->IMASK1 ={v} _7;
- <bb 5> :
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_11 ();
- <bb 6> :
- return;
- }
- FlexCAN_SetMsgBuffIntCmd (struct FLEXCAN_Type * base, uint8 u8Instance, uint32 msgBuffIdx, boolean enable, boolean bIsIntActive)
- {
- Flexcan_Ip_StatusType stat;
- uint32 temp;
- Flexcan_Ip_StatusType D.7505;
- long unsigned int _1;
- int _2;
- long unsigned int _3;
- int _4;
- long unsigned int _5;
- int _6;
- long unsigned int _7;
- int _8;
- long unsigned int _9;
- long unsigned int _10;
- int _11;
- long unsigned int _12;
- int _13;
- long unsigned int _14;
- Flexcan_Ip_StatusType _33;
- <bb 2> :
- stat_17 = 0;
- _1 = msgBuffIdx_18(D) & 31;
- temp_19 = 1 << _1;
- if (msgBuffIdx_18(D) <= 31)
- goto <bb 3>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 3> :
- if (enable_21(D) != 0)
- goto <bb 4>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 4> :
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
- _2 = (int) u8Instance_23(D);
- _3 ={v} FlexCAN_Ip_au32ImaskBuff[_2][0];
- _4 = (int) u8Instance_23(D);
- _5 = temp_19 | _3;
- FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5;
- if (bIsIntActive_30(D) != 0)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- _6 = (int) u8Instance_23(D);
- _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0];
- base_25(D)->IMASK1 ={v} _7;
- <bb 6> :
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();
- goto <bb 8>; [INV]
- <bb 7> :
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
- _8 = (int) u8Instance_23(D);
- _9 ={v} FlexCAN_Ip_au32ImaskBuff[_8][0];
- _10 = ~temp_19;
- _11 = (int) u8Instance_23(D);
- _12 = _9 & _10;
- FlexCAN_Ip_au32ImaskBuff[_11][0] ={v} _12;
- _13 = (int) u8Instance_23(D);
- _14 ={v} FlexCAN_Ip_au32ImaskBuff[_13][0];
- base_25(D)->IMASK1 ={v} _14;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();
- <bb 8> :
- _33 = stat_17;
- <bb 9> :
- <L7>:
- return _33;
- }
- FlexCAN_LockRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
- {
- const uint32 * flexcan_mb;
- long unsigned int vol.6;
- long unsigned int vol.6_6;
- <bb 2> :
- flexcan_mb_5 = FlexCAN_GetMsgBuffRegion (base_2(D), msgBuffIdx_3(D));
- vol.6_6 ={v} *flexcan_mb_5;
- return;
- }
- FlexCAN_GetMbPayloadSize (const struct FLEXCAN_Type * base, uint32 maxMsgBuffNum)
- {
- uint8 mb_size;
- uint8 i;
- uint8 maxMbBlockNum;
- uint8 can_real_payload;
- uint32 ramBlockSize;
- uint8 arbitration_field_size;
- uint8 D.7495;
- long unsigned int _1;
- long unsigned int _2;
- unsigned char _3;
- long unsigned int _4;
- unsigned char i.5_5;
- uint8 _27;
- <bb 2> :
- arbitration_field_size_12 = 8;
- ramBlockSize_13 = 512;
- can_real_payload_14 = 8;
- maxMbBlockNum_15 = 0;
- i_16 = 0;
- mb_size_17 = 0;
- i_18 = 0;
- goto <bb 6>; [INV]
- <bb 3> :
- can_real_payload_22 = FlexCAN_GetPayloadSize (base_20(D), i_9);
- mb_size_23 = can_real_payload_22 + arbitration_field_size_12;
- _1 = (long unsigned int) mb_size_23;
- _2 = ramBlockSize_13 / _1;
- _3 = (unsigned char) _2;
- maxMbBlockNum_24 = maxMbBlockNum_8 + _3;
- _4 = (long unsigned int) maxMbBlockNum_24;
- if (maxMsgBuffNum_25(D) < _4)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- goto <bb 7>; [INV]
- <bb 5> :
- i.5_5 = i_9;
- i_26 = i.5_5 + 1;
- <bb 6> :
- # can_real_payload_6 = PHI <can_real_payload_14(2), can_real_payload_22(5)>
- # maxMbBlockNum_8 = PHI <maxMbBlockNum_15(2), maxMbBlockNum_24(5)>
- # i_9 = PHI <i_18(2), i_26(5)>
- if (i_9 == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 7> :
- # can_real_payload_7 = PHI <can_real_payload_22(4), can_real_payload_6(6)>
- _27 = can_real_payload_7;
- <bb 8> :
- <L5>:
- return _27;
- }
- FlexCAN_GetPayloadSize (const struct FLEXCAN_Type * base, uint8 mbdsrIdx)
- {
- uint32 payloadSize;
- uint8 D.7491;
- _Bool _1;
- int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- uint8 _17;
- <bb 2> :
- payloadSize_10 = 8;
- _1 = FlexCAN_IsFDAvailable (base_12(D));
- if (_1 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 3> :
- _2 = (int) mbdsrIdx_14(D);
- if (_2 == 0)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- <L1>:
- _3 ={v} base_12(D)->FDCTRL;
- _4 = _3 >> 16;
- _5 = _4 & 3;
- payloadSize_15 = 8 << _5;
- goto <bb 6>; [INV]
- <bb 5> :
- <L2>:
- _6 ={v} base_12(D)->FDCTRL;
- _7 = _6 >> 16;
- _8 = _7 & 3;
- payloadSize_16 = 8 << _8;
- <bb 6> :
- # payloadSize_9 = PHI <payloadSize_10(2), payloadSize_15(4), payloadSize_16(5)>
- _17 = (uint8) payloadSize_9;
- <bb 7> :
- <L5>:
- return _17;
- }
- FlexCAN_SetPayloadSize (struct FLEXCAN_Type * base, const struct Flexcan_Ip_PayloadSizeType * payloadSize)
- {
- uint32 tmp;
- int iftmp.3;
- _Bool _1;
- <unnamed type> _2;
- _Bool _3;
- _Bool _4;
- <unnamed type> _5;
- long unsigned int _6;
- int iftmp.3_7;
- int iftmp.3_13;
- int iftmp.3_14;
- <bb 2> :
- _1 = FlexCAN_IsFDEnabled (base_10(D));
- if (_1 != 0)
- goto <bb 4>; [INV]
- else
- goto <bb 3>; [INV]
- <bb 3> :
- _2 = payloadSize_12(D)->payloadBlock0;
- if (_2 == 0)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.3_14 = 1;
- goto <bb 6>; [INV]
- <bb 5> :
- iftmp.3_13 = 0;
- <bb 6> :
- # iftmp.3_7 = PHI <iftmp.3_14(4), iftmp.3_13(5)>
- _3 = (_Bool) iftmp.3_7;
- DevAssert (_3);
- _4 = FlexCAN_IsFDEnabled (base_10(D));
- if (_4 != 0)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- tmp_17 ={v} base_10(D)->FDCTRL;
- tmp_18 = tmp_17 & 4294770687;
- _5 = payloadSize_12(D)->payloadBlock0;
- _6 = _5 << 16;
- tmp_19 = tmp_18 | _6;
- base_10(D)->FDCTRL ={v} tmp_19;
- <bb 8> :
- return;
- }
- FlexCAN_IsFDAvailable (const struct FLEXCAN_Type * base)
- {
- boolean returnValue;
- static struct FLEXCAN_Type * const flexcanBase[1] = {1073889280B};
- uint32 i;
- boolean D.7475;
- struct FLEXCAN_Type * _1;
- boolean _11;
- <bb 2> :
- i_4 = 0;
- returnValue_5 = 0;
- i_6 = 0;
- goto <bb 6>; [INV]
- <bb 3> :
- _1 = flexcanBase[i_2];
- if (base_8(D) == _1)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- returnValue_10 = 1;
- goto <bb 7>; [INV]
- <bb 5> :
- i_9 = i_2 + 1;
- <bb 6> :
- # i_2 = PHI <i_6(2), i_9(5)>
- if (i_2 == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 7> :
- # returnValue_3 = PHI <returnValue_10(4), returnValue_5(6)>
- _11 = returnValue_3;
- <bb 8> :
- <L5>:
- return _11;
- }
- FlexCAN_EnableRxFifo (struct FLEXCAN_Type * base, uint32 numOfFilters)
- {
- Flexcan_Ip_StatusType stat;
- uint16 noOfMbx;
- uint32 i;
- Flexcan_Ip_StatusType D.7471;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- long unsigned int _11;
- Flexcan_Ip_StatusType _29;
- <bb 2> :
- _1 = FlexCAN_GetMaxMbNum (base_17(D));
- noOfMbx_19 = (uint16) _1;
- stat_20 = 0;
- _2 ={v} base_17(D)->MCR;
- _3 = _2 & 2048;
- if (_3 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- stat_21 = 1;
- <bb 4> :
- # stat_13 = PHI <stat_20(2), stat_21(3)>
- if (stat_13 == 0)
- goto <bb 5>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 5> :
- _4 ={v} base_17(D)->MCR;
- _5 = _4 | 536870912;
- base_17(D)->MCR ={v} _5;
- _6 ={v} base_17(D)->CTRL2;
- _7 = _6 & 4043309055;
- _8 = numOfFilters_23(D) << 24;
- _9 = _8 & 251658240;
- _10 = _7 | _9;
- base_17(D)->CTRL2 ={v} _10;
- base_17(D)->RXFGMASK ={v} 4294967295;
- i_26 = 0;
- goto <bb 7>; [INV]
- <bb 6> :
- base_17(D)->RXIMR[i_12] ={v} 536870911;
- i_28 = i_12 + 1;
- <bb 7> :
- # i_12 = PHI <i_26(5), i_28(6)>
- _11 = (long unsigned int) noOfMbx_19;
- if (i_12 < _11)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 8> :
- _29 = stat_13;
- <bb 9> :
- <L7>:
- return _29;
- }
- FlexCAN_Init (struct FLEXCAN_Type * base)
- {
- Flexcan_Ip_StatusType returnResult;
- uint32 uS2Ticks;
- uint32 timeElapsed;
- uint32 timeStart;
- Flexcan_Ip_StatusType D.7464;
- long unsigned int D.7457;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- _Bool _8;
- long unsigned int _25;
- Flexcan_Ip_StatusType _42;
- <bb 2> :
- timeStart = 0;
- timeElapsed_16 = 0;
- uS2Ticks_18 = OsIf_MicrosToTicks (1000000, 0);
- returnResult_19 = 0;
- _1 ={v} base_20(D)->MCR;
- _2 = _1 | 33554432;
- base_20(D)->MCR ={v} _2;
- _3 = OsIf_GetCounter (0);
- timeStart = _3;
- goto <bb 5>; [INV]
- <bb 3> :
- _25 = OsIf_GetElapsed (&timeStart, 0);
- timeElapsed_26 = _25 + timeElapsed_9;
- if (timeElapsed_26 >= uS2Ticks_18)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- returnResult_27 = 3;
- goto <bb 6>; [INV]
- <bb 5> :
- # timeElapsed_9 = PHI <timeElapsed_16(2), timeElapsed_26(3)>
- _4 ={v} base_20(D)->MCR;
- _5 = _4 & 33554432;
- if (_5 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 6> :
- # returnResult_10 = PHI <returnResult_27(4), returnResult_19(5)>
- if (returnResult_10 == 0)
- goto <bb 7>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 7> :
- _6 ={v} base_20(D)->MCR;
- _7 = _6 | 4096;
- base_20(D)->MCR ={v} _7;
- FlexCAN_ClearRAM (base_20(D));
- base_20(D)->RXMGMASK ={v} 4294967295;
- base_20(D)->RX14MASK ={v} 4294967295;
- base_20(D)->RX15MASK ={v} 4294967295;
- base_20(D)->IMASK1 ={v} 0;
- base_20(D)->IFLAG1 ={v} 4294967295;
- base_20(D)->ESR1 ={v} 3866630;
- base_20(D)->CTRL1 ={v} 0;
- base_20(D)->CTRL2 ={v} 1048576;
- base_20(D)->CBT ={v} 0;
- _8 = FlexCAN_IsFDAvailable (base_20(D));
- if (_8 != 0)
- goto <bb 8>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 8> :
- base_20(D)->FDCBT ={v} 0;
- base_20(D)->FDCTRL ={v} 2147500288;
- <bb 9> :
- _42 = returnResult_10;
- timeStart ={v} {CLOBBER};
- <bb 10> :
- <L10>:
- return _42;
- }
- FlexCAN_SetErrIntCmd (struct FLEXCAN_Type * base, flexcan_int_type_t errType, boolean enable)
- {
- uint32 temp;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- long unsigned int _11;
- long unsigned int _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- <bb 2> :
- temp_19 = errType_18(D);
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_06 ();
- if (enable_22(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 3> :
- if (errType_18(D) == 16385)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- _1 ={v} base_23(D)->CTRL2;
- _2 = _1 | 2147483648;
- base_23(D)->CTRL2 ={v} _2;
- goto <bb 14>; [INV]
- <bb 5> :
- if (errType_18(D) == 1024)
- goto <bb 7>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 6> :
- if (errType_18(D) == 2048)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- _3 ={v} base_23(D)->MCR;
- _4 = _3 | 2097152;
- base_23(D)->MCR ={v} _4;
- <bb 8> :
- _5 ={v} base_23(D)->CTRL1;
- _6 = temp_19 | _5;
- base_23(D)->CTRL1 ={v} _6;
- goto <bb 14>; [INV]
- <bb 9> :
- if (errType_18(D) == 16385)
- goto <bb 10>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 10> :
- _7 ={v} base_23(D)->CTRL2;
- _8 = _7 & 2147483647;
- base_23(D)->CTRL2 ={v} _8;
- goto <bb 14>; [INV]
- <bb 11> :
- _9 ={v} base_23(D)->CTRL1;
- _10 = ~temp_19;
- _11 = _9 & _10;
- base_23(D)->CTRL1 ={v} _11;
- temp_25 ={v} base_23(D)->CTRL1;
- _12 = temp_25 & 1024;
- if (_12 == 0)
- goto <bb 12>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 12> :
- _13 = temp_25 & 2048;
- if (_13 == 0)
- goto <bb 13>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 13> :
- _14 ={v} base_23(D)->MCR;
- _15 = _14 & 4292870143;
- base_23(D)->MCR ={v} _15;
- <bb 14> :
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_06 ();
- return;
- }
- FlexCAN_Disable (struct FLEXCAN_Type * base)
- {
- Flexcan_Ip_StatusType returnResult;
- uint32 uS2Ticks;
- uint32 timeElapsed;
- uint32 timeStart;
- Flexcan_Ip_StatusType D.7438;
- long unsigned int D.7435;
- long unsigned int _1;
- signed int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _25;
- Flexcan_Ip_StatusType _28;
- <bb 2> :
- timeStart = 0;
- timeElapsed_14 = 0;
- uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0);
- returnResult_17 = 0;
- _1 ={v} base_18(D)->MCR;
- _2 = (signed int) _1;
- if (_2 >= 0)
- goto <bb 3>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 3> :
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_05 ();
- _3 ={v} base_18(D)->MCR;
- _4 = _3 | 2147483648;
- base_18(D)->MCR ={v} _4;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_05 ();
- _5 = OsIf_GetCounter (0);
- timeStart = _5;
- goto <bb 6>; [INV]
- <bb 4> :
- _25 = OsIf_GetElapsed (&timeStart, 0);
- timeElapsed_26 = _25 + timeElapsed_8;
- if (timeElapsed_26 >= uS2Ticks_16)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- returnResult_27 = 3;
- goto <bb 7>; [INV]
- <bb 6> :
- # timeElapsed_8 = PHI <timeElapsed_14(3), timeElapsed_26(4)>
- _6 ={v} base_18(D)->MCR;
- _7 = _6 & 1048576;
- if (_7 == 0)
- goto <bb 4>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 7> :
- # returnResult_9 = PHI <returnResult_17(2), returnResult_27(5), returnResult_17(6)>
- _28 = returnResult_9;
- timeStart ={v} {CLOBBER};
- <bb 8> :
- <L8>:
- return _28;
- }
- FlexCAN_ExitFreezeMode (struct FLEXCAN_Type * base)
- {
- Flexcan_Ip_StatusType returnValue;
- uint32 uS2Ticks;
- uint32 timeElapsed;
- uint32 timeStart;
- Flexcan_Ip_StatusType D.7430;
- long unsigned int D.7427;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _26;
- Flexcan_Ip_StatusType _29;
- <bb 2> :
- timeStart = 0;
- timeElapsed_14 = 0;
- uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0);
- returnValue_17 = 0;
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_04 ();
- _1 ={v} base_19(D)->MCR;
- _2 = _1 & 4026531839;
- base_19(D)->MCR ={v} _2;
- _3 ={v} base_19(D)->MCR;
- _4 = _3 & 3221225471;
- base_19(D)->MCR ={v} _4;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_04 ();
- _5 = OsIf_GetCounter (0);
- timeStart = _5;
- goto <bb 5>; [INV]
- <bb 3> :
- _26 = OsIf_GetElapsed (&timeStart, 0);
- timeElapsed_27 = _26 + timeElapsed_8;
- if (timeElapsed_27 >= uS2Ticks_16)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- returnValue_28 = 3;
- goto <bb 6>; [INV]
- <bb 5> :
- # timeElapsed_8 = PHI <timeElapsed_14(2), timeElapsed_27(3)>
- _6 ={v} base_19(D)->MCR;
- _7 = _6 & 16777216;
- if (_7 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 6> :
- # returnValue_9 = PHI <returnValue_28(4), returnValue_17(5)>
- _29 = returnValue_9;
- timeStart ={v} {CLOBBER};
- <bb 7> :
- <L6>:
- return _29;
- }
- FlexCAN_Enable (struct FLEXCAN_Type * base)
- {
- Flexcan_Ip_StatusType returnValue;
- uint32 uS2Ticks;
- uint32 timeElapsed;
- uint32 timeStart;
- Flexcan_Ip_StatusType D.7424;
- long unsigned int D.7421;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _23;
- Flexcan_Ip_StatusType _26;
- <bb 2> :
- timeStart = 0;
- timeElapsed_12 = 0;
- uS2Ticks_14 = OsIf_MicrosToTicks (1000000, 0);
- returnValue_15 = 0;
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_03 ();
- _1 ={v} base_17(D)->MCR;
- _2 = _1 & 2147483647;
- base_17(D)->MCR ={v} _2;
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_03 ();
- _3 = OsIf_GetCounter (0);
- timeStart = _3;
- goto <bb 5>; [INV]
- <bb 3> :
- _23 = OsIf_GetElapsed (&timeStart, 0);
- timeElapsed_24 = _23 + timeElapsed_6;
- if (timeElapsed_24 >= uS2Ticks_14)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- returnValue_25 = 3;
- goto <bb 6>; [INV]
- <bb 5> :
- # timeElapsed_6 = PHI <timeElapsed_12(2), timeElapsed_24(3)>
- _4 ={v} base_17(D)->MCR;
- _5 = _4 & 16777216;
- if (_5 == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 6> :
- # returnValue_7 = PHI <returnValue_25(4), returnValue_15(5)>
- _26 = returnValue_7;
- timeStart ={v} {CLOBBER};
- <bb 7> :
- <L6>:
- return _26;
- }
- FlexCAN_EnterFreezeMode (struct FLEXCAN_Type * base)
- {
- Flexcan_Ip_StatusType returnResult;
- uint32 uS2Ticks;
- uint32 timeElapsed;
- uint32 timeStart;
- Flexcan_Ip_StatusType D.7418;
- long unsigned int D.7415;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- signed int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- long unsigned int _11;
- long unsigned int _32;
- Flexcan_Ip_StatusType _35;
- <bb 2> :
- timeStart = 0;
- timeElapsed_19 = 0;
- uS2Ticks_21 = OsIf_MicrosToTicks (1000000, 0);
- returnResult_22 = 0;
- SchM_Enter_Can_CAN_EXCLUSIVE_AREA_02 ();
- _1 ={v} base_24(D)->MCR;
- _2 = _1 | 1073741824;
- base_24(D)->MCR ={v} _2;
- _3 ={v} base_24(D)->MCR;
- _4 = _3 | 268435456;
- base_24(D)->MCR ={v} _4;
- _5 ={v} base_24(D)->MCR;
- _6 = (signed int) _5;
- if (_6 < 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- _7 ={v} base_24(D)->MCR;
- _8 = _7 & 2147483647;
- base_24(D)->MCR ={v} _8;
- <bb 4> :
- SchM_Exit_Can_CAN_EXCLUSIVE_AREA_02 ();
- _9 = OsIf_GetCounter (0);
- timeStart = _9;
- goto <bb 7>; [INV]
- <bb 5> :
- _32 = OsIf_GetElapsed (&timeStart, 0);
- timeElapsed_33 = _32 + timeElapsed_12;
- if (timeElapsed_33 >= uS2Ticks_21)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- returnResult_34 = 3;
- goto <bb 8>; [INV]
- <bb 7> :
- # timeElapsed_12 = PHI <timeElapsed_19(4), timeElapsed_33(5)>
- _10 ={v} base_24(D)->MCR;
- _11 = _10 & 16777216;
- if (_11 == 0)
- goto <bb 5>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 8> :
- # returnResult_13 = PHI <returnResult_34(6), returnResult_22(7)>
- _35 = returnResult_13;
- timeStart ={v} {CLOBBER};
- <bb 9> :
- <L8>:
- return _35;
- }
- FlexCAN_GetMaxMbNum (const struct FLEXCAN_Type * base)
- {
- static const uint32 maxMbNum[3] = {32, 16, 16};
- static struct FLEXCAN_Type * const flexcanBase[3] = {1073889280B, 1073893376B, 1073917952B};
- uint32 ret;
- uint32 i;
- uint32 D.7411;
- struct FLEXCAN_Type * _1;
- uint32 _7;
- <bb 2> :
- ret_5 = 0;
- i_6 = 0;
- goto <bb 6>; [INV]
- <bb 3> :
- _1 = flexcanBase[i_2];
- if (base_9(D) == _1)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- ret_10 = maxMbNum[i_2];
- <bb 5> :
- # ret_3 = PHI <ret_4(3), ret_10(4)>
- i_11 = i_2 + 1;
- <bb 6> :
- # i_2 = PHI <i_6(2), i_11(5)>
- # ret_4 = PHI <ret_5(2), ret_3(5)>
- if (i_2 <= 2)
- goto <bb 3>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 7> :
- _7 = ret_4;
- <bb 8> :
- <L5>:
- return _7;
- }
- FlexCAN_GetMsgBuffRegion (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
- {
- volatile uint32 * pAddressRet;
- volatile uint32 * RAM;
- uint8 payload_size;
- uint32 mb_index;
- uint8 maxMbNum;
- uint8 i;
- uint32 msgBuffIdxBackup;
- uint32 ramBlockOffset;
- uint32 ramBlockSize;
- uint8 mb_size;
- uint8 arbitration_field_size;
- volatile uint32 * D.7407;
- long unsigned int base.1_1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- unsigned char i.2_7;
- long unsigned int _8;
- long unsigned int _9;
- unsigned char _10;
- long unsigned int _11;
- long unsigned int _12;
- long unsigned int _13;
- volatile uint32 * _47;
- <bb 2> :
- arbitration_field_size_23 = 8;
- mb_size_24 = 0;
- ramBlockSize_25 = 512;
- ramBlockOffset_26 = 0;
- msgBuffIdxBackup_28 = msgBuffIdx_27(D);
- i_29 = 0;
- maxMbNum_30 = 0;
- mb_index_31 = 0;
- payload_size_32 = 0;
- base.1_1 = (long unsigned int) base_33(D);
- _2 = base.1_1 + 128;
- RAM_34 = (volatile uint32 *) _2;
- pAddressRet_35 = 0B;
- i_36 = 0;
- goto <bb 6>; [INV]
- <bb 3> :
- payload_size_39 = FlexCAN_GetPayloadSize (base_33(D), i_18);
- mb_size_40 = payload_size_39 + arbitration_field_size_23;
- _3 = (long unsigned int) mb_size_40;
- _4 = ramBlockSize_25 / _3;
- maxMbNum_41 = (uint8) _4;
- _5 = (long unsigned int) maxMbNum_41;
- if (msgBuffIdxBackup_17 < _5)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- goto <bb 7>; [INV]
- <bb 5> :
- ramBlockOffset_42 = ramBlockOffset_16 + 128;
- _6 = (long unsigned int) maxMbNum_41;
- msgBuffIdxBackup_43 = msgBuffIdxBackup_17 - _6;
- i.2_7 = i_18;
- i_44 = i.2_7 + 1;
- <bb 6> :
- # mb_size_14 = PHI <mb_size_24(2), mb_size_40(5)>
- # ramBlockOffset_16 = PHI <ramBlockOffset_26(2), ramBlockOffset_42(5)>
- # msgBuffIdxBackup_17 = PHI <msgBuffIdxBackup_28(2), msgBuffIdxBackup_43(5)>
- # i_18 = PHI <i_36(2), i_44(5)>
- # maxMbNum_19 = PHI <maxMbNum_30(2), maxMbNum_41(5)>
- if (i_18 == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 7> :
- # mb_size_15 = PHI <mb_size_40(4), mb_size_14(6)>
- # maxMbNum_20 = PHI <maxMbNum_41(4), maxMbNum_19(6)>
- _8 = (long unsigned int) maxMbNum_20;
- _9 = msgBuffIdxBackup_17 % _8;
- _10 = mb_size_15 >> 2;
- _11 = (long unsigned int) _10;
- _12 = _9 * _11;
- mb_index_45 = ramBlockOffset_16 + _12;
- _13 = mb_index_45 * 4;
- pAddressRet_46 = RAM_34 + _13;
- _47 = pAddressRet_46;
- <bb 8> :
- <L5>:
- return _47;
- }
- FlexCAN_ComputePayloadSize (uint8 dlcValue)
- {
- uint8 ret;
- uint8 D.7403;
- int _1;
- uint8 _13;
- <bb 2> :
- ret_3 = 8;
- if (dlcValue_4(D) <= 8)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- ret_12 = dlcValue_4(D);
- goto <bb 13>; [INV]
- <bb 4> :
- _1 = (int) dlcValue_4(D);
- 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]>
- <bb 5> :
- <L2>:
- ret_11 = 12;
- goto <bb 13>; [INV]
- <bb 6> :
- <L3>:
- ret_10 = 16;
- goto <bb 13>; [INV]
- <bb 7> :
- <L4>:
- ret_9 = 20;
- goto <bb 13>; [INV]
- <bb 8> :
- <L5>:
- ret_8 = 24;
- goto <bb 13>; [INV]
- <bb 9> :
- <L6>:
- ret_7 = 32;
- goto <bb 13>; [INV]
- <bb 10> :
- <L7>:
- ret_6 = 48;
- goto <bb 13>; [INV]
- <bb 11> :
- <L8>:
- ret_5 = 64;
- goto <bb 13>; [INV]
- <bb 12> :
- <L9>:
- <bb 13> :
- # 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)>
- _13 = ret_2;
- <bb 14> :
- <L12>:
- return _13;
- }
- FlexCAN_ClearRAM (struct FLEXCAN_Type * base)
- {
- volatile uint32 * RAM;
- uint32 RXIMR_size;
- uint32 RAM_size;
- uint32 databyte;
- long unsigned int _1;
- long unsigned int base.0_2;
- long unsigned int _3;
- long unsigned int _4;
- volatile uint32 * _5;
- long unsigned int _6;
- volatile uint32 * _7;
- <bb 2> :
- _1 = FlexCAN_GetMaxMbNum (base_13(D));
- RAM_size_15 = _1 * 4;
- RXIMR_size_17 = FlexCAN_GetMaxMbNum (base_13(D));
- base.0_2 = (long unsigned int) base_13(D);
- _3 = base.0_2 + 128;
- RAM_18 = (volatile uint32 *) _3;
- databyte_19 = 0;
- goto <bb 4>; [INV]
- <bb 3> :
- _4 = databyte_8 * 4;
- _5 = RAM_18 + _4;
- *_5 ={v} 0;
- databyte_25 = databyte_8 + 1;
- <bb 4> :
- # databyte_8 = PHI <databyte_19(2), databyte_25(3)>
- if (databyte_8 < RAM_size_15)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 5> :
- RAM_20 = &base_13(D)->RXIMR;
- databyte_21 = 0;
- goto <bb 7>; [INV]
- <bb 6> :
- _6 = databyte_9 * 4;
- _7 = RAM_20 + _6;
- *_7 ={v} 0;
- databyte_23 = databyte_9 + 1;
- <bb 7> :
- # databyte_9 = PHI <databyte_21(5), databyte_23(6)>
- if (databyte_9 < RXIMR_size_17)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 8> :
- return;
- }
- FlexCAN_ComputeDLCValue (uint8 payloadSize)
- {
- 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";
- uint32 ret;
- uint8 D.7398;
- int _1;
- unsigned char _2;
- uint8 _8;
- <bb 2> :
- ret_4 = 255;
- if (payloadSize_5(D) <= 64)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- _1 = (int) payloadSize_5(D);
- _2 = payload_code[_1];
- ret_7 = (uint32) _2;
- <bb 4> :
- # ret_3 = PHI <ret_4(2), ret_7(3)>
- _8 = (uint8) ret_3;
- <bb 5> :
- <L3>:
- return _8;
- }
- FlexCAN_SetPNPayloadLowFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
- {
- unsigned char _1;
- long unsigned int _2;
- long unsigned int _3;
- const uint8 * _4;
- unsigned char _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- const uint8 * _10;
- unsigned char _11;
- long unsigned int _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- const uint8 * _16;
- unsigned char _17;
- long unsigned int _18;
- long unsigned int _19;
- <bb 2> :
- _1 = *pPayload_21(D);
- _2 = (long unsigned int) _1;
- _3 = _2 << 24;
- _4 = pPayload_21(D) + 1;
- _5 = *_4;
- _6 = (long unsigned int) _5;
- _7 = _6 << 16;
- _8 = _7 & 16711680;
- _9 = _3 | _8;
- _10 = pPayload_21(D) + 2;
- _11 = *_10;
- _12 = (long unsigned int) _11;
- _13 = _12 << 8;
- _14 = _13 & 65535;
- _15 = _9 | _14;
- _16 = pPayload_21(D) + 3;
- _17 = *_16;
- _18 = (long unsigned int) _17;
- _19 = _15 | _18;
- pBase_22(D)->PL2_PLMASK_LO ={v} _19;
- return;
- }
- FlexCAN_SetPNPayloadHighFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
- {
- const uint8 * _1;
- unsigned char _2;
- long unsigned int _3;
- long unsigned int _4;
- const uint8 * _5;
- unsigned char _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- const uint8 * _11;
- unsigned char _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- long unsigned int _16;
- const uint8 * _17;
- unsigned char _18;
- long unsigned int _19;
- long unsigned int _20;
- <bb 2> :
- _1 = pPayload_21(D) + 4;
- _2 = *_1;
- _3 = (long unsigned int) _2;
- _4 = _3 << 24;
- _5 = pPayload_21(D) + 5;
- _6 = *_5;
- _7 = (long unsigned int) _6;
- _8 = _7 << 16;
- _9 = _8 & 16711680;
- _10 = _4 | _9;
- _11 = pPayload_21(D) + 6;
- _12 = *_11;
- _13 = (long unsigned int) _12;
- _14 = _13 << 8;
- _15 = _14 & 65535;
- _16 = _10 | _15;
- _17 = pPayload_21(D) + 7;
- _18 = *_17;
- _19 = (long unsigned int) _18;
- _20 = _16 | _19;
- pBase_23(D)->PL2_PLMASK_HI ={v} _20;
- return;
- }
- FlexCAN_SetPNPayloadLowFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
- {
- unsigned char _1;
- long unsigned int _2;
- long unsigned int _3;
- const uint8 * _4;
- unsigned char _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- const uint8 * _10;
- unsigned char _11;
- long unsigned int _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- const uint8 * _16;
- unsigned char _17;
- long unsigned int _18;
- long unsigned int _19;
- <bb 2> :
- _1 = *pPayload_21(D);
- _2 = (long unsigned int) _1;
- _3 = _2 << 24;
- _4 = pPayload_21(D) + 1;
- _5 = *_4;
- _6 = (long unsigned int) _5;
- _7 = _6 << 16;
- _8 = _7 & 16711680;
- _9 = _3 | _8;
- _10 = pPayload_21(D) + 2;
- _11 = *_10;
- _12 = (long unsigned int) _11;
- _13 = _12 << 8;
- _14 = _13 & 65535;
- _15 = _9 | _14;
- _16 = pPayload_21(D) + 3;
- _17 = *_16;
- _18 = (long unsigned int) _17;
- _19 = _15 | _18;
- pBase_22(D)->PL1_LO ={v} _19;
- return;
- }
- FlexCAN_SetPNPayloadHighFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
- {
- const uint8 * _1;
- unsigned char _2;
- long unsigned int _3;
- long unsigned int _4;
- const uint8 * _5;
- unsigned char _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int _9;
- long unsigned int _10;
- const uint8 * _11;
- unsigned char _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int _15;
- long unsigned int _16;
- const uint8 * _17;
- unsigned char _18;
- long unsigned int _19;
- long unsigned int _20;
- <bb 2> :
- _1 = pPayload_21(D) + 4;
- _2 = *_1;
- _3 = (long unsigned int) _2;
- _4 = _3 << 24;
- _5 = pPayload_21(D) + 5;
- _6 = *_5;
- _7 = (long unsigned int) _6;
- _8 = _7 << 16;
- _9 = _8 & 16711680;
- _10 = _4 | _9;
- _11 = pPayload_21(D) + 6;
- _12 = *_11;
- _13 = (long unsigned int) _12;
- _14 = _13 << 8;
- _15 = _14 & 65535;
- _16 = _10 | _15;
- _17 = pPayload_21(D) + 7;
- _18 = *_17;
- _19 = (long unsigned int) _18;
- _20 = _16 | _19;
- pBase_23(D)->PL1_HI ={v} _20;
- return;
- }
- FlexCAN_SetPNDlcFilter (struct FLEXCAN_Type * pBase, uint8 u8DlcLow, uint8 u8DlcHigh)
- {
- uint32 tmp;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- <bb 2> :
- tmp_8 ={v} pBase_7(D)->FLT_DLC;
- tmp_9 = tmp_8 & 4293984240;
- _1 = (long unsigned int) u8DlcHigh_10(D);
- _2 = _1 & 15;
- tmp_11 = tmp_9 | _2;
- _3 = (long unsigned int) u8DlcLow_12(D);
- _4 = _3 << 16;
- _5 = _4 & 983040;
- tmp_13 = tmp_11 | _5;
- pBase_7(D)->FLT_DLC ={v} tmp_13;
- return;
- }
- FlexCAN_SetPNIdFilter2 (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
- {
- uint32 u32Tmp;
- long unsigned int iftmp.27;
- long unsigned int iftmp.26;
- _Bool _1;
- _Bool _2;
- _Bool _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int iftmp.26_10;
- long unsigned int iftmp.27_11;
- long unsigned int iftmp.26_17;
- long unsigned int iftmp.26_18;
- long unsigned int iftmp.27_20;
- long unsigned int iftmp.27_21;
- <bb 2> :
- u32Tmp_14 ={v} pBase_13(D)->FLT_ID2_IDMASK;
- u32Tmp_15 = u32Tmp_14 & 2147483648;
- _1 = pPnConfig_16(D)->idFilter2.bExtendedId;
- if (_1 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.26_18 = 1073741824;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.26_17 = 0;
- <bb 5> :
- # iftmp.26_10 = PHI <iftmp.26_18(3), iftmp.26_17(4)>
- u32Tmp_19 = iftmp.26_10 | u32Tmp_15;
- _2 = pPnConfig_16(D)->idFilter2.bRemoteFrame;
- if (_2 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- iftmp.27_21 = 536870912;
- goto <bb 8>; [INV]
- <bb 7> :
- iftmp.27_20 = 0;
- <bb 8> :
- # iftmp.27_11 = PHI <iftmp.27_21(6), iftmp.27_20(7)>
- u32Tmp_22 = iftmp.27_11 | u32Tmp_19;
- _3 = pPnConfig_16(D)->idFilter1.bExtendedId;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- _4 = pPnConfig_16(D)->idFilter2.u32Id;
- _5 = _4 & 536870911;
- u32Tmp_24 = u32Tmp_22 | _5;
- goto <bb 11>; [INV]
- <bb 10> :
- _6 = pPnConfig_16(D)->idFilter2.u32Id;
- _7 = _6 << 18;
- _8 = _7 & 536870911;
- u32Tmp_23 = u32Tmp_22 | _8;
- <bb 11> :
- # u32Tmp_9 = PHI <u32Tmp_24(9), u32Tmp_23(10)>
- pBase_13(D)->FLT_ID2_IDMASK ={v} u32Tmp_9;
- return;
- }
- FlexCAN_SetPNIdFilter2Check (struct FLEXCAN_Type * pBase)
- {
- long unsigned int _1;
- long unsigned int _2;
- <bb 2> :
- _1 ={v} pBase_4(D)->FLT_ID2_IDMASK;
- _2 = _1 | 1610612736;
- pBase_4(D)->FLT_ID2_IDMASK ={v} _2;
- return;
- }
- FlexCAN_SetPNIdFilter1 (struct FLEXCAN_Type * pBase, struct Flexcan_Ip_PnIdFilterType idFilter)
- {
- uint32 u32Tmp;
- long unsigned int iftmp.25;
- long unsigned int iftmp.24;
- _Bool _1;
- _Bool _2;
- _Bool _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- long unsigned int _7;
- long unsigned int _8;
- long unsigned int iftmp.24_10;
- long unsigned int iftmp.25_11;
- long unsigned int iftmp.24_16;
- long unsigned int iftmp.24_17;
- long unsigned int iftmp.25_19;
- long unsigned int iftmp.25_20;
- <bb 2> :
- u32Tmp_14 ={v} pBase_13(D)->FLT_ID1;
- u32Tmp_15 = u32Tmp_14 & 2147483648;
- _1 = idFilter.bExtendedId;
- if (_1 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.24_17 = 1073741824;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.24_16 = 0;
- <bb 5> :
- # iftmp.24_10 = PHI <iftmp.24_17(3), iftmp.24_16(4)>
- u32Tmp_18 = iftmp.24_10 | u32Tmp_15;
- _2 = idFilter.bRemoteFrame;
- if (_2 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- iftmp.25_20 = 536870912;
- goto <bb 8>; [INV]
- <bb 7> :
- iftmp.25_19 = 0;
- <bb 8> :
- # iftmp.25_11 = PHI <iftmp.25_20(6), iftmp.25_19(7)>
- u32Tmp_21 = iftmp.25_11 | u32Tmp_18;
- _3 = idFilter.bExtendedId;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- _4 = idFilter.u32Id;
- _5 = _4 & 536870911;
- u32Tmp_23 = u32Tmp_21 | _5;
- goto <bb 11>; [INV]
- <bb 10> :
- _6 = idFilter.u32Id;
- _7 = _6 << 18;
- _8 = _7 & 536870911;
- u32Tmp_22 = u32Tmp_21 | _8;
- <bb 11> :
- # u32Tmp_9 = PHI <u32Tmp_23(9), u32Tmp_22(10)>
- pBase_13(D)->FLT_ID1 ={v} u32Tmp_9;
- return;
- }
- FlexCAN_SetPNTimeoutValue (struct FLEXCAN_Type * pBase, uint16 u16TimeoutValue)
- {
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int _4;
- <bb 2> :
- _1 ={v} pBase_6(D)->CTRL2_PN;
- _2 = _1 & 4294901760;
- _3 = (long unsigned int) u16TimeoutValue_7(D);
- _4 = _2 | _3;
- pBase_6(D)->CTRL2_PN ={v} _4;
- return;
- }
- FlexCAN_SetPNFilteringSelection (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
- {
- uint32 u32Tmp;
- long unsigned int iftmp.23;
- long unsigned int iftmp.22;
- _Bool _1;
- _Bool _2;
- short unsigned int _3;
- long unsigned int _4;
- long unsigned int _5;
- long unsigned int _6;
- <unnamed type> _7;
- long unsigned int _8;
- <unnamed type> _9;
- long unsigned int _10;
- long unsigned int _11;
- <unnamed type> _12;
- long unsigned int _13;
- long unsigned int _14;
- long unsigned int iftmp.22_15;
- long unsigned int iftmp.23_16;
- long unsigned int iftmp.22_22;
- long unsigned int iftmp.22_23;
- long unsigned int iftmp.23_25;
- long unsigned int iftmp.23_26;
- <bb 2> :
- u32Tmp_19 ={v} pBase_18(D)->CTRL1_PN;
- u32Tmp_20 = u32Tmp_19 & 4294705344;
- _1 = pPnConfig_21(D)->bWakeUpTimeout;
- if (_1 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.22_23 = 131072;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.22_22 = 0;
- <bb 5> :
- # iftmp.22_15 = PHI <iftmp.22_23(3), iftmp.22_22(4)>
- u32Tmp_24 = iftmp.22_15 | u32Tmp_20;
- _2 = pPnConfig_21(D)->bWakeUpMatch;
- if (_2 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- iftmp.23_26 = 65536;
- goto <bb 8>; [INV]
- <bb 7> :
- iftmp.23_25 = 0;
- <bb 8> :
- # iftmp.23_16 = PHI <iftmp.23_26(6), iftmp.23_25(7)>
- u32Tmp_27 = iftmp.23_16 | u32Tmp_24;
- _3 = pPnConfig_21(D)->u16NumMatches;
- _4 = (long unsigned int) _3;
- _5 = _4 << 8;
- _6 = _5 & 65535;
- u32Tmp_28 = u32Tmp_27 | _6;
- _7 = pPnConfig_21(D)->eFilterComb;
- _8 = _7 & 3;
- u32Tmp_29 = u32Tmp_28 | _8;
- _9 = pPnConfig_21(D)->eIdFilterType;
- _10 = _9 << 2;
- _11 = _10 & 12;
- u32Tmp_30 = u32Tmp_29 | _11;
- _12 = pPnConfig_21(D)->ePayloadFilterType;
- _13 = _12 << 4;
- _14 = _13 & 48;
- u32Tmp_31 = u32Tmp_30 | _14;
- pBase_18(D)->CTRL1_PN ={v} u32Tmp_31;
- return;
- }
- FlexCAN_CanBitSampling (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.18;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.18_4;
- long unsigned int iftmp.18_8;
- long unsigned int iftmp.18_9;
- <bb 2> :
- _1 ={v} base_6(D)->CTRL1;
- _2 = _1 & 4294967167;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.18_9 = 128;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.18_8 = 0;
- <bb 5> :
- # iftmp.18_4 = PHI <iftmp.18_9(3), iftmp.18_8(4)>
- _3 = iftmp.18_4 | _2;
- base_6(D)->CTRL1 ={v} _3;
- return;
- }
- FlexCAN_SetEdgeFilter (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.21;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.21_4;
- long unsigned int iftmp.21_8;
- long unsigned int iftmp.21_9;
- <bb 2> :
- _1 ={v} base_6(D)->CTRL2;
- _2 = _1 & 4294965247;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.21_9 = 0;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.21_8 = 2048;
- <bb 5> :
- # iftmp.21_4 = PHI <iftmp.21_9(3), iftmp.21_8(4)>
- _3 = iftmp.21_4 | _2;
- base_6(D)->CTRL2 ={v} _3;
- return;
- }
- FlexCAN_SetBusOffAutorecovery (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.19;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.19_4;
- long unsigned int iftmp.19_8;
- long unsigned int iftmp.19_9;
- <bb 2> :
- _1 ={v} base_6(D)->CTRL1;
- _2 = _1 & 4294967231;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.19_9 = 0;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.19_8 = 64;
- <bb 5> :
- # iftmp.19_4 = PHI <iftmp.19_9(3), iftmp.19_8(4)>
- _3 = iftmp.19_4 | _2;
- base_6(D)->CTRL1 ={v} _3;
- return;
- }
- FlexCAN_SetRemoteReqStore (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.20;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.20_4;
- long unsigned int iftmp.20_8;
- long unsigned int iftmp.20_9;
- <bb 2> :
- _1 ={v} base_6(D)->CTRL2;
- _2 = _1 & 4294836223;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.20_9 = 131072;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.20_8 = 0;
- <bb 5> :
- # iftmp.20_4 = PHI <iftmp.20_9(3), iftmp.20_8(4)>
- _3 = iftmp.20_4 | _2;
- base_6(D)->CTRL2 ={v} _3;
- return;
- }
- FlexCAN_SetProtocolException (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.17;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.17_4;
- long unsigned int iftmp.17_8;
- long unsigned int iftmp.17_9;
- <bb 2> :
- _1 ={v} base_6(D)->CTRL2;
- _2 = _1 & 4294950911;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.17_9 = 16384;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.17_8 = 0;
- <bb 5> :
- # iftmp.17_4 = PHI <iftmp.17_9(3), iftmp.17_8(4)>
- _3 = iftmp.17_4 | _2;
- base_6(D)->CTRL2 ={v} _3;
- return;
- }
- FlexCAN_SetEntireFrameArbitrationFieldComparison (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.16;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.16_4;
- long unsigned int iftmp.16_8;
- long unsigned int iftmp.16_9;
- <bb 2> :
- _1 ={v} base_6(D)->CTRL2;
- _2 = _1 & 4294901759;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.16_9 = 65536;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.16_8 = 0;
- <bb 5> :
- # iftmp.16_4 = PHI <iftmp.16_9(3), iftmp.16_8(4)>
- _3 = iftmp.16_4 | _2;
- base_6(D)->CTRL2 ={v} _3;
- return;
- }
- FlexCAN_SetIsoCan (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.15;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.15_4;
- long unsigned int iftmp.15_8;
- long unsigned int iftmp.15_9;
- <bb 2> :
- _1 ={v} base_6(D)->CTRL2;
- _2 = _1 & 4294963199;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.15_9 = 4096;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.15_8 = 0;
- <bb 5> :
- # iftmp.15_4 = PHI <iftmp.15_9(3), iftmp.15_8(4)>
- _3 = iftmp.15_4 | _2;
- base_6(D)->CTRL2 ={v} _3;
- return;
- }
- FlexCAN_IsFDEnabled (const struct FLEXCAN_Type * base)
- {
- boolean D.7487;
- long unsigned int _1;
- long unsigned int _2;
- boolean _5;
- <bb 2> :
- _1 ={v} base_4(D)->MCR;
- _2 = _1 & 2048;
- _5 = _2 != 0;
- <bb 3> :
- <L0>:
- return _5;
- }
- FlexCAN_SetSelfReception (struct FLEXCAN_Type * base, boolean enable)
- {
- long unsigned int iftmp.11;
- long unsigned int _1;
- long unsigned int _2;
- long unsigned int _3;
- long unsigned int iftmp.11_4;
- long unsigned int iftmp.11_8;
- long unsigned int iftmp.11_9;
- <bb 2> :
- _1 ={v} base_6(D)->MCR;
- _2 = _1 & 4294836223;
- if (enable_7(D) != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- iftmp.11_9 = 0;
- goto <bb 5>; [INV]
- <bb 4> :
- iftmp.11_8 = 131072;
- <bb 5> :
- # iftmp.11_4 = PHI <iftmp.11_9(3), iftmp.11_8(4)>
- _3 = iftmp.11_4 | _2;
- base_6(D)->MCR ={v} _3;
- return;
- }
- DevAssert (volatile boolean x)
- {
- _Bool x.4_1;
- <bb 2> :
- x.4_1 ={v} x;
- if (x.4_1 != 0)
- goto <bb 4>; [INV]
- else
- goto <bb 3>; [INV]
- <bb 3> :
- goto <bb 3>; [INV]
- <bb 4> :
- return;
- }
|