123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771 |
-
- SD_CARD_SPI.elf: file format elf32-littlearm
-
- Sections:
- Idx Name Size VMA LMA File off Algn
- 0 .isr_vector 0000013c 08000000 08000000 00010000 2**0
- CONTENTS, ALLOC, LOAD, READONLY, DATA
- 1 .text 00007870 0800013c 0800013c 0001013c 2**2
- CONTENTS, ALLOC, LOAD, READONLY, CODE
- 2 .rodata 00000610 080079ac 080079ac 000179ac 2**2
- CONTENTS, ALLOC, LOAD, READONLY, DATA
- 3 .ARM.extab 00000000 08007fbc 08007fbc 00020088 2**0
- CONTENTS
- 4 .ARM 00000008 08007fbc 08007fbc 00017fbc 2**2
- CONTENTS, ALLOC, LOAD, READONLY, DATA
- 5 .preinit_array 00000000 08007fc4 08007fc4 00020088 2**0
- CONTENTS, ALLOC, LOAD, DATA
- 6 .init_array 00000004 08007fc4 08007fc4 00017fc4 2**2
- CONTENTS, ALLOC, LOAD, DATA
- 7 .fini_array 00000004 08007fc8 08007fc8 00017fc8 2**2
- CONTENTS, ALLOC, LOAD, DATA
- 8 .data 00000088 20000000 08007fcc 00020000 2**2
- CONTENTS, ALLOC, LOAD, DATA
- 9 .bss 00004454 20000088 08008054 00020088 2**2
- ALLOC
- 10 ._user_heap_stack 00000604 200044dc 08008054 000244dc 2**0
- ALLOC
- 11 .ARM.attributes 00000029 00000000 00000000 00020088 2**0
- CONTENTS, READONLY
- 12 .debug_info 0000fe66 00000000 00000000 000200b1 2**0
- CONTENTS, READONLY, DEBUGGING
- 13 .debug_abbrev 00002526 00000000 00000000 0002ff17 2**0
- CONTENTS, READONLY, DEBUGGING
- 14 .debug_aranges 00000bd0 00000000 00000000 00032440 2**3
- CONTENTS, READONLY, DEBUGGING
- 15 .debug_ranges 00000aa8 00000000 00000000 00033010 2**3
- CONTENTS, READONLY, DEBUGGING
- 16 .debug_macro 0001755b 00000000 00000000 00033ab8 2**0
- CONTENTS, READONLY, DEBUGGING
- 17 .debug_line 0000bd02 00000000 00000000 0004b013 2**0
- CONTENTS, READONLY, DEBUGGING
- 18 .debug_str 00087c91 00000000 00000000 00056d15 2**0
- CONTENTS, READONLY, DEBUGGING
- 19 .comment 0000007b 00000000 00000000 000de9a6 2**0
- CONTENTS, READONLY
- 20 .debug_frame 000033fc 00000000 00000000 000dea24 2**2
- CONTENTS, READONLY, DEBUGGING
-
- Disassembly of section .text:
-
- 0800013c <__do_global_dtors_aux>:
- 800013c: b510 push {r4, lr}
- 800013e: 4c05 ldr r4, [pc, #20] ; (8000154 <__do_global_dtors_aux+0x18>)
- 8000140: 7823 ldrb r3, [r4, #0]
- 8000142: b933 cbnz r3, 8000152 <__do_global_dtors_aux+0x16>
- 8000144: 4b04 ldr r3, [pc, #16] ; (8000158 <__do_global_dtors_aux+0x1c>)
- 8000146: b113 cbz r3, 800014e <__do_global_dtors_aux+0x12>
- 8000148: 4804 ldr r0, [pc, #16] ; (800015c <__do_global_dtors_aux+0x20>)
- 800014a: f3af 8000 nop.w
- 800014e: 2301 movs r3, #1
- 8000150: 7023 strb r3, [r4, #0]
- 8000152: bd10 pop {r4, pc}
- 8000154: 20000088 .word 0x20000088
- 8000158: 00000000 .word 0x00000000
- 800015c: 08007994 .word 0x08007994
-
- 08000160 <frame_dummy>:
- 8000160: b508 push {r3, lr}
- 8000162: 4b03 ldr r3, [pc, #12] ; (8000170 <frame_dummy+0x10>)
- 8000164: b11b cbz r3, 800016e <frame_dummy+0xe>
- 8000166: 4903 ldr r1, [pc, #12] ; (8000174 <frame_dummy+0x14>)
- 8000168: 4803 ldr r0, [pc, #12] ; (8000178 <frame_dummy+0x18>)
- 800016a: f3af 8000 nop.w
- 800016e: bd08 pop {r3, pc}
- 8000170: 00000000 .word 0x00000000
- 8000174: 2000008c .word 0x2000008c
- 8000178: 08007994 .word 0x08007994
-
- 0800017c <strlen>:
- 800017c: 4603 mov r3, r0
- 800017e: f813 2b01 ldrb.w r2, [r3], #1
- 8000182: 2a00 cmp r2, #0
- 8000184: d1fb bne.n 800017e <strlen+0x2>
- 8000186: 1a18 subs r0, r3, r0
- 8000188: 3801 subs r0, #1
- 800018a: 4770 bx lr
-
- 0800018c <__aeabi_drsub>:
- 800018c: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
- 8000190: e002 b.n 8000198 <__adddf3>
- 8000192: bf00 nop
-
- 08000194 <__aeabi_dsub>:
- 8000194: f083 4300 eor.w r3, r3, #2147483648 ; 0x80000000
-
- 08000198 <__adddf3>:
- 8000198: b530 push {r4, r5, lr}
- 800019a: ea4f 0441 mov.w r4, r1, lsl #1
- 800019e: ea4f 0543 mov.w r5, r3, lsl #1
- 80001a2: ea94 0f05 teq r4, r5
- 80001a6: bf08 it eq
- 80001a8: ea90 0f02 teqeq r0, r2
- 80001ac: bf1f itttt ne
- 80001ae: ea54 0c00 orrsne.w ip, r4, r0
- 80001b2: ea55 0c02 orrsne.w ip, r5, r2
- 80001b6: ea7f 5c64 mvnsne.w ip, r4, asr #21
- 80001ba: ea7f 5c65 mvnsne.w ip, r5, asr #21
- 80001be: f000 80e2 beq.w 8000386 <__adddf3+0x1ee>
- 80001c2: ea4f 5454 mov.w r4, r4, lsr #21
- 80001c6: ebd4 5555 rsbs r5, r4, r5, lsr #21
- 80001ca: bfb8 it lt
- 80001cc: 426d neglt r5, r5
- 80001ce: dd0c ble.n 80001ea <__adddf3+0x52>
- 80001d0: 442c add r4, r5
- 80001d2: ea80 0202 eor.w r2, r0, r2
- 80001d6: ea81 0303 eor.w r3, r1, r3
- 80001da: ea82 0000 eor.w r0, r2, r0
- 80001de: ea83 0101 eor.w r1, r3, r1
- 80001e2: ea80 0202 eor.w r2, r0, r2
- 80001e6: ea81 0303 eor.w r3, r1, r3
- 80001ea: 2d36 cmp r5, #54 ; 0x36
- 80001ec: bf88 it hi
- 80001ee: bd30 pophi {r4, r5, pc}
- 80001f0: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
- 80001f4: ea4f 3101 mov.w r1, r1, lsl #12
- 80001f8: f44f 1c80 mov.w ip, #1048576 ; 0x100000
- 80001fc: ea4c 3111 orr.w r1, ip, r1, lsr #12
- 8000200: d002 beq.n 8000208 <__adddf3+0x70>
- 8000202: 4240 negs r0, r0
- 8000204: eb61 0141 sbc.w r1, r1, r1, lsl #1
- 8000208: f013 4f00 tst.w r3, #2147483648 ; 0x80000000
- 800020c: ea4f 3303 mov.w r3, r3, lsl #12
- 8000210: ea4c 3313 orr.w r3, ip, r3, lsr #12
- 8000214: d002 beq.n 800021c <__adddf3+0x84>
- 8000216: 4252 negs r2, r2
- 8000218: eb63 0343 sbc.w r3, r3, r3, lsl #1
- 800021c: ea94 0f05 teq r4, r5
- 8000220: f000 80a7 beq.w 8000372 <__adddf3+0x1da>
- 8000224: f1a4 0401 sub.w r4, r4, #1
- 8000228: f1d5 0e20 rsbs lr, r5, #32
- 800022c: db0d blt.n 800024a <__adddf3+0xb2>
- 800022e: fa02 fc0e lsl.w ip, r2, lr
- 8000232: fa22 f205 lsr.w r2, r2, r5
- 8000236: 1880 adds r0, r0, r2
- 8000238: f141 0100 adc.w r1, r1, #0
- 800023c: fa03 f20e lsl.w r2, r3, lr
- 8000240: 1880 adds r0, r0, r2
- 8000242: fa43 f305 asr.w r3, r3, r5
- 8000246: 4159 adcs r1, r3
- 8000248: e00e b.n 8000268 <__adddf3+0xd0>
- 800024a: f1a5 0520 sub.w r5, r5, #32
- 800024e: f10e 0e20 add.w lr, lr, #32
- 8000252: 2a01 cmp r2, #1
- 8000254: fa03 fc0e lsl.w ip, r3, lr
- 8000258: bf28 it cs
- 800025a: f04c 0c02 orrcs.w ip, ip, #2
- 800025e: fa43 f305 asr.w r3, r3, r5
- 8000262: 18c0 adds r0, r0, r3
- 8000264: eb51 71e3 adcs.w r1, r1, r3, asr #31
- 8000268: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
- 800026c: d507 bpl.n 800027e <__adddf3+0xe6>
- 800026e: f04f 0e00 mov.w lr, #0
- 8000272: f1dc 0c00 rsbs ip, ip, #0
- 8000276: eb7e 0000 sbcs.w r0, lr, r0
- 800027a: eb6e 0101 sbc.w r1, lr, r1
- 800027e: f5b1 1f80 cmp.w r1, #1048576 ; 0x100000
- 8000282: d31b bcc.n 80002bc <__adddf3+0x124>
- 8000284: f5b1 1f00 cmp.w r1, #2097152 ; 0x200000
- 8000288: d30c bcc.n 80002a4 <__adddf3+0x10c>
- 800028a: 0849 lsrs r1, r1, #1
- 800028c: ea5f 0030 movs.w r0, r0, rrx
- 8000290: ea4f 0c3c mov.w ip, ip, rrx
- 8000294: f104 0401 add.w r4, r4, #1
- 8000298: ea4f 5244 mov.w r2, r4, lsl #21
- 800029c: f512 0f80 cmn.w r2, #4194304 ; 0x400000
- 80002a0: f080 809a bcs.w 80003d8 <__adddf3+0x240>
- 80002a4: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000
- 80002a8: bf08 it eq
- 80002aa: ea5f 0c50 movseq.w ip, r0, lsr #1
- 80002ae: f150 0000 adcs.w r0, r0, #0
- 80002b2: eb41 5104 adc.w r1, r1, r4, lsl #20
- 80002b6: ea41 0105 orr.w r1, r1, r5
- 80002ba: bd30 pop {r4, r5, pc}
- 80002bc: ea5f 0c4c movs.w ip, ip, lsl #1
- 80002c0: 4140 adcs r0, r0
- 80002c2: eb41 0101 adc.w r1, r1, r1
- 80002c6: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 80002ca: f1a4 0401 sub.w r4, r4, #1
- 80002ce: d1e9 bne.n 80002a4 <__adddf3+0x10c>
- 80002d0: f091 0f00 teq r1, #0
- 80002d4: bf04 itt eq
- 80002d6: 4601 moveq r1, r0
- 80002d8: 2000 moveq r0, #0
- 80002da: fab1 f381 clz r3, r1
- 80002de: bf08 it eq
- 80002e0: 3320 addeq r3, #32
- 80002e2: f1a3 030b sub.w r3, r3, #11
- 80002e6: f1b3 0220 subs.w r2, r3, #32
- 80002ea: da0c bge.n 8000306 <__adddf3+0x16e>
- 80002ec: 320c adds r2, #12
- 80002ee: dd08 ble.n 8000302 <__adddf3+0x16a>
- 80002f0: f102 0c14 add.w ip, r2, #20
- 80002f4: f1c2 020c rsb r2, r2, #12
- 80002f8: fa01 f00c lsl.w r0, r1, ip
- 80002fc: fa21 f102 lsr.w r1, r1, r2
- 8000300: e00c b.n 800031c <__adddf3+0x184>
- 8000302: f102 0214 add.w r2, r2, #20
- 8000306: bfd8 it le
- 8000308: f1c2 0c20 rsble ip, r2, #32
- 800030c: fa01 f102 lsl.w r1, r1, r2
- 8000310: fa20 fc0c lsr.w ip, r0, ip
- 8000314: bfdc itt le
- 8000316: ea41 010c orrle.w r1, r1, ip
- 800031a: 4090 lslle r0, r2
- 800031c: 1ae4 subs r4, r4, r3
- 800031e: bfa2 ittt ge
- 8000320: eb01 5104 addge.w r1, r1, r4, lsl #20
- 8000324: 4329 orrge r1, r5
- 8000326: bd30 popge {r4, r5, pc}
- 8000328: ea6f 0404 mvn.w r4, r4
- 800032c: 3c1f subs r4, #31
- 800032e: da1c bge.n 800036a <__adddf3+0x1d2>
- 8000330: 340c adds r4, #12
- 8000332: dc0e bgt.n 8000352 <__adddf3+0x1ba>
- 8000334: f104 0414 add.w r4, r4, #20
- 8000338: f1c4 0220 rsb r2, r4, #32
- 800033c: fa20 f004 lsr.w r0, r0, r4
- 8000340: fa01 f302 lsl.w r3, r1, r2
- 8000344: ea40 0003 orr.w r0, r0, r3
- 8000348: fa21 f304 lsr.w r3, r1, r4
- 800034c: ea45 0103 orr.w r1, r5, r3
- 8000350: bd30 pop {r4, r5, pc}
- 8000352: f1c4 040c rsb r4, r4, #12
- 8000356: f1c4 0220 rsb r2, r4, #32
- 800035a: fa20 f002 lsr.w r0, r0, r2
- 800035e: fa01 f304 lsl.w r3, r1, r4
- 8000362: ea40 0003 orr.w r0, r0, r3
- 8000366: 4629 mov r1, r5
- 8000368: bd30 pop {r4, r5, pc}
- 800036a: fa21 f004 lsr.w r0, r1, r4
- 800036e: 4629 mov r1, r5
- 8000370: bd30 pop {r4, r5, pc}
- 8000372: f094 0f00 teq r4, #0
- 8000376: f483 1380 eor.w r3, r3, #1048576 ; 0x100000
- 800037a: bf06 itte eq
- 800037c: f481 1180 eoreq.w r1, r1, #1048576 ; 0x100000
- 8000380: 3401 addeq r4, #1
- 8000382: 3d01 subne r5, #1
- 8000384: e74e b.n 8000224 <__adddf3+0x8c>
- 8000386: ea7f 5c64 mvns.w ip, r4, asr #21
- 800038a: bf18 it ne
- 800038c: ea7f 5c65 mvnsne.w ip, r5, asr #21
- 8000390: d029 beq.n 80003e6 <__adddf3+0x24e>
- 8000392: ea94 0f05 teq r4, r5
- 8000396: bf08 it eq
- 8000398: ea90 0f02 teqeq r0, r2
- 800039c: d005 beq.n 80003aa <__adddf3+0x212>
- 800039e: ea54 0c00 orrs.w ip, r4, r0
- 80003a2: bf04 itt eq
- 80003a4: 4619 moveq r1, r3
- 80003a6: 4610 moveq r0, r2
- 80003a8: bd30 pop {r4, r5, pc}
- 80003aa: ea91 0f03 teq r1, r3
- 80003ae: bf1e ittt ne
- 80003b0: 2100 movne r1, #0
- 80003b2: 2000 movne r0, #0
- 80003b4: bd30 popne {r4, r5, pc}
- 80003b6: ea5f 5c54 movs.w ip, r4, lsr #21
- 80003ba: d105 bne.n 80003c8 <__adddf3+0x230>
- 80003bc: 0040 lsls r0, r0, #1
- 80003be: 4149 adcs r1, r1
- 80003c0: bf28 it cs
- 80003c2: f041 4100 orrcs.w r1, r1, #2147483648 ; 0x80000000
- 80003c6: bd30 pop {r4, r5, pc}
- 80003c8: f514 0480 adds.w r4, r4, #4194304 ; 0x400000
- 80003cc: bf3c itt cc
- 80003ce: f501 1180 addcc.w r1, r1, #1048576 ; 0x100000
- 80003d2: bd30 popcc {r4, r5, pc}
- 80003d4: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
- 80003d8: f045 41fe orr.w r1, r5, #2130706432 ; 0x7f000000
- 80003dc: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
- 80003e0: f04f 0000 mov.w r0, #0
- 80003e4: bd30 pop {r4, r5, pc}
- 80003e6: ea7f 5c64 mvns.w ip, r4, asr #21
- 80003ea: bf1a itte ne
- 80003ec: 4619 movne r1, r3
- 80003ee: 4610 movne r0, r2
- 80003f0: ea7f 5c65 mvnseq.w ip, r5, asr #21
- 80003f4: bf1c itt ne
- 80003f6: 460b movne r3, r1
- 80003f8: 4602 movne r2, r0
- 80003fa: ea50 3401 orrs.w r4, r0, r1, lsl #12
- 80003fe: bf06 itte eq
- 8000400: ea52 3503 orrseq.w r5, r2, r3, lsl #12
- 8000404: ea91 0f03 teqeq r1, r3
- 8000408: f441 2100 orrne.w r1, r1, #524288 ; 0x80000
- 800040c: bd30 pop {r4, r5, pc}
- 800040e: bf00 nop
-
- 08000410 <__aeabi_ui2d>:
- 8000410: f090 0f00 teq r0, #0
- 8000414: bf04 itt eq
- 8000416: 2100 moveq r1, #0
- 8000418: 4770 bxeq lr
- 800041a: b530 push {r4, r5, lr}
- 800041c: f44f 6480 mov.w r4, #1024 ; 0x400
- 8000420: f104 0432 add.w r4, r4, #50 ; 0x32
- 8000424: f04f 0500 mov.w r5, #0
- 8000428: f04f 0100 mov.w r1, #0
- 800042c: e750 b.n 80002d0 <__adddf3+0x138>
- 800042e: bf00 nop
-
- 08000430 <__aeabi_i2d>:
- 8000430: f090 0f00 teq r0, #0
- 8000434: bf04 itt eq
- 8000436: 2100 moveq r1, #0
- 8000438: 4770 bxeq lr
- 800043a: b530 push {r4, r5, lr}
- 800043c: f44f 6480 mov.w r4, #1024 ; 0x400
- 8000440: f104 0432 add.w r4, r4, #50 ; 0x32
- 8000444: f010 4500 ands.w r5, r0, #2147483648 ; 0x80000000
- 8000448: bf48 it mi
- 800044a: 4240 negmi r0, r0
- 800044c: f04f 0100 mov.w r1, #0
- 8000450: e73e b.n 80002d0 <__adddf3+0x138>
- 8000452: bf00 nop
-
- 08000454 <__aeabi_f2d>:
- 8000454: 0042 lsls r2, r0, #1
- 8000456: ea4f 01e2 mov.w r1, r2, asr #3
- 800045a: ea4f 0131 mov.w r1, r1, rrx
- 800045e: ea4f 7002 mov.w r0, r2, lsl #28
- 8000462: bf1f itttt ne
- 8000464: f012 437f andsne.w r3, r2, #4278190080 ; 0xff000000
- 8000468: f093 4f7f teqne r3, #4278190080 ; 0xff000000
- 800046c: f081 5160 eorne.w r1, r1, #939524096 ; 0x38000000
- 8000470: 4770 bxne lr
- 8000472: f032 427f bics.w r2, r2, #4278190080 ; 0xff000000
- 8000476: bf08 it eq
- 8000478: 4770 bxeq lr
- 800047a: f093 4f7f teq r3, #4278190080 ; 0xff000000
- 800047e: bf04 itt eq
- 8000480: f441 2100 orreq.w r1, r1, #524288 ; 0x80000
- 8000484: 4770 bxeq lr
- 8000486: b530 push {r4, r5, lr}
- 8000488: f44f 7460 mov.w r4, #896 ; 0x380
- 800048c: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
- 8000490: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
- 8000494: e71c b.n 80002d0 <__adddf3+0x138>
- 8000496: bf00 nop
-
- 08000498 <__aeabi_ul2d>:
- 8000498: ea50 0201 orrs.w r2, r0, r1
- 800049c: bf08 it eq
- 800049e: 4770 bxeq lr
- 80004a0: b530 push {r4, r5, lr}
- 80004a2: f04f 0500 mov.w r5, #0
- 80004a6: e00a b.n 80004be <__aeabi_l2d+0x16>
-
- 080004a8 <__aeabi_l2d>:
- 80004a8: ea50 0201 orrs.w r2, r0, r1
- 80004ac: bf08 it eq
- 80004ae: 4770 bxeq lr
- 80004b0: b530 push {r4, r5, lr}
- 80004b2: f011 4500 ands.w r5, r1, #2147483648 ; 0x80000000
- 80004b6: d502 bpl.n 80004be <__aeabi_l2d+0x16>
- 80004b8: 4240 negs r0, r0
- 80004ba: eb61 0141 sbc.w r1, r1, r1, lsl #1
- 80004be: f44f 6480 mov.w r4, #1024 ; 0x400
- 80004c2: f104 0432 add.w r4, r4, #50 ; 0x32
- 80004c6: ea5f 5c91 movs.w ip, r1, lsr #22
- 80004ca: f43f aed8 beq.w 800027e <__adddf3+0xe6>
- 80004ce: f04f 0203 mov.w r2, #3
- 80004d2: ea5f 0cdc movs.w ip, ip, lsr #3
- 80004d6: bf18 it ne
- 80004d8: 3203 addne r2, #3
- 80004da: ea5f 0cdc movs.w ip, ip, lsr #3
- 80004de: bf18 it ne
- 80004e0: 3203 addne r2, #3
- 80004e2: eb02 02dc add.w r2, r2, ip, lsr #3
- 80004e6: f1c2 0320 rsb r3, r2, #32
- 80004ea: fa00 fc03 lsl.w ip, r0, r3
- 80004ee: fa20 f002 lsr.w r0, r0, r2
- 80004f2: fa01 fe03 lsl.w lr, r1, r3
- 80004f6: ea40 000e orr.w r0, r0, lr
- 80004fa: fa21 f102 lsr.w r1, r1, r2
- 80004fe: 4414 add r4, r2
- 8000500: e6bd b.n 800027e <__adddf3+0xe6>
- 8000502: bf00 nop
-
- 08000504 <__aeabi_dmul>:
- 8000504: b570 push {r4, r5, r6, lr}
- 8000506: f04f 0cff mov.w ip, #255 ; 0xff
- 800050a: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
- 800050e: ea1c 5411 ands.w r4, ip, r1, lsr #20
- 8000512: bf1d ittte ne
- 8000514: ea1c 5513 andsne.w r5, ip, r3, lsr #20
- 8000518: ea94 0f0c teqne r4, ip
- 800051c: ea95 0f0c teqne r5, ip
- 8000520: f000 f8de bleq 80006e0 <__aeabi_dmul+0x1dc>
- 8000524: 442c add r4, r5
- 8000526: ea81 0603 eor.w r6, r1, r3
- 800052a: ea21 514c bic.w r1, r1, ip, lsl #21
- 800052e: ea23 534c bic.w r3, r3, ip, lsl #21
- 8000532: ea50 3501 orrs.w r5, r0, r1, lsl #12
- 8000536: bf18 it ne
- 8000538: ea52 3503 orrsne.w r5, r2, r3, lsl #12
- 800053c: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
- 8000540: f443 1380 orr.w r3, r3, #1048576 ; 0x100000
- 8000544: d038 beq.n 80005b8 <__aeabi_dmul+0xb4>
- 8000546: fba0 ce02 umull ip, lr, r0, r2
- 800054a: f04f 0500 mov.w r5, #0
- 800054e: fbe1 e502 umlal lr, r5, r1, r2
- 8000552: f006 4200 and.w r2, r6, #2147483648 ; 0x80000000
- 8000556: fbe0 e503 umlal lr, r5, r0, r3
- 800055a: f04f 0600 mov.w r6, #0
- 800055e: fbe1 5603 umlal r5, r6, r1, r3
- 8000562: f09c 0f00 teq ip, #0
- 8000566: bf18 it ne
- 8000568: f04e 0e01 orrne.w lr, lr, #1
- 800056c: f1a4 04ff sub.w r4, r4, #255 ; 0xff
- 8000570: f5b6 7f00 cmp.w r6, #512 ; 0x200
- 8000574: f564 7440 sbc.w r4, r4, #768 ; 0x300
- 8000578: d204 bcs.n 8000584 <__aeabi_dmul+0x80>
- 800057a: ea5f 0e4e movs.w lr, lr, lsl #1
- 800057e: 416d adcs r5, r5
- 8000580: eb46 0606 adc.w r6, r6, r6
- 8000584: ea42 21c6 orr.w r1, r2, r6, lsl #11
- 8000588: ea41 5155 orr.w r1, r1, r5, lsr #21
- 800058c: ea4f 20c5 mov.w r0, r5, lsl #11
- 8000590: ea40 505e orr.w r0, r0, lr, lsr #21
- 8000594: ea4f 2ece mov.w lr, lr, lsl #11
- 8000598: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
- 800059c: bf88 it hi
- 800059e: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
- 80005a2: d81e bhi.n 80005e2 <__aeabi_dmul+0xde>
- 80005a4: f1be 4f00 cmp.w lr, #2147483648 ; 0x80000000
- 80005a8: bf08 it eq
- 80005aa: ea5f 0e50 movseq.w lr, r0, lsr #1
- 80005ae: f150 0000 adcs.w r0, r0, #0
- 80005b2: eb41 5104 adc.w r1, r1, r4, lsl #20
- 80005b6: bd70 pop {r4, r5, r6, pc}
- 80005b8: f006 4600 and.w r6, r6, #2147483648 ; 0x80000000
- 80005bc: ea46 0101 orr.w r1, r6, r1
- 80005c0: ea40 0002 orr.w r0, r0, r2
- 80005c4: ea81 0103 eor.w r1, r1, r3
- 80005c8: ebb4 045c subs.w r4, r4, ip, lsr #1
- 80005cc: bfc2 ittt gt
- 80005ce: ebd4 050c rsbsgt r5, r4, ip
- 80005d2: ea41 5104 orrgt.w r1, r1, r4, lsl #20
- 80005d6: bd70 popgt {r4, r5, r6, pc}
- 80005d8: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
- 80005dc: f04f 0e00 mov.w lr, #0
- 80005e0: 3c01 subs r4, #1
- 80005e2: f300 80ab bgt.w 800073c <__aeabi_dmul+0x238>
- 80005e6: f114 0f36 cmn.w r4, #54 ; 0x36
- 80005ea: bfde ittt le
- 80005ec: 2000 movle r0, #0
- 80005ee: f001 4100 andle.w r1, r1, #2147483648 ; 0x80000000
- 80005f2: bd70 pople {r4, r5, r6, pc}
- 80005f4: f1c4 0400 rsb r4, r4, #0
- 80005f8: 3c20 subs r4, #32
- 80005fa: da35 bge.n 8000668 <__aeabi_dmul+0x164>
- 80005fc: 340c adds r4, #12
- 80005fe: dc1b bgt.n 8000638 <__aeabi_dmul+0x134>
- 8000600: f104 0414 add.w r4, r4, #20
- 8000604: f1c4 0520 rsb r5, r4, #32
- 8000608: fa00 f305 lsl.w r3, r0, r5
- 800060c: fa20 f004 lsr.w r0, r0, r4
- 8000610: fa01 f205 lsl.w r2, r1, r5
- 8000614: ea40 0002 orr.w r0, r0, r2
- 8000618: f001 4200 and.w r2, r1, #2147483648 ; 0x80000000
- 800061c: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
- 8000620: eb10 70d3 adds.w r0, r0, r3, lsr #31
- 8000624: fa21 f604 lsr.w r6, r1, r4
- 8000628: eb42 0106 adc.w r1, r2, r6
- 800062c: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
- 8000630: bf08 it eq
- 8000632: ea20 70d3 biceq.w r0, r0, r3, lsr #31
- 8000636: bd70 pop {r4, r5, r6, pc}
- 8000638: f1c4 040c rsb r4, r4, #12
- 800063c: f1c4 0520 rsb r5, r4, #32
- 8000640: fa00 f304 lsl.w r3, r0, r4
- 8000644: fa20 f005 lsr.w r0, r0, r5
- 8000648: fa01 f204 lsl.w r2, r1, r4
- 800064c: ea40 0002 orr.w r0, r0, r2
- 8000650: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 8000654: eb10 70d3 adds.w r0, r0, r3, lsr #31
- 8000658: f141 0100 adc.w r1, r1, #0
- 800065c: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
- 8000660: bf08 it eq
- 8000662: ea20 70d3 biceq.w r0, r0, r3, lsr #31
- 8000666: bd70 pop {r4, r5, r6, pc}
- 8000668: f1c4 0520 rsb r5, r4, #32
- 800066c: fa00 f205 lsl.w r2, r0, r5
- 8000670: ea4e 0e02 orr.w lr, lr, r2
- 8000674: fa20 f304 lsr.w r3, r0, r4
- 8000678: fa01 f205 lsl.w r2, r1, r5
- 800067c: ea43 0302 orr.w r3, r3, r2
- 8000680: fa21 f004 lsr.w r0, r1, r4
- 8000684: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 8000688: fa21 f204 lsr.w r2, r1, r4
- 800068c: ea20 0002 bic.w r0, r0, r2
- 8000690: eb00 70d3 add.w r0, r0, r3, lsr #31
- 8000694: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
- 8000698: bf08 it eq
- 800069a: ea20 70d3 biceq.w r0, r0, r3, lsr #31
- 800069e: bd70 pop {r4, r5, r6, pc}
- 80006a0: f094 0f00 teq r4, #0
- 80006a4: d10f bne.n 80006c6 <__aeabi_dmul+0x1c2>
- 80006a6: f001 4600 and.w r6, r1, #2147483648 ; 0x80000000
- 80006aa: 0040 lsls r0, r0, #1
- 80006ac: eb41 0101 adc.w r1, r1, r1
- 80006b0: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 80006b4: bf08 it eq
- 80006b6: 3c01 subeq r4, #1
- 80006b8: d0f7 beq.n 80006aa <__aeabi_dmul+0x1a6>
- 80006ba: ea41 0106 orr.w r1, r1, r6
- 80006be: f095 0f00 teq r5, #0
- 80006c2: bf18 it ne
- 80006c4: 4770 bxne lr
- 80006c6: f003 4600 and.w r6, r3, #2147483648 ; 0x80000000
- 80006ca: 0052 lsls r2, r2, #1
- 80006cc: eb43 0303 adc.w r3, r3, r3
- 80006d0: f413 1f80 tst.w r3, #1048576 ; 0x100000
- 80006d4: bf08 it eq
- 80006d6: 3d01 subeq r5, #1
- 80006d8: d0f7 beq.n 80006ca <__aeabi_dmul+0x1c6>
- 80006da: ea43 0306 orr.w r3, r3, r6
- 80006de: 4770 bx lr
- 80006e0: ea94 0f0c teq r4, ip
- 80006e4: ea0c 5513 and.w r5, ip, r3, lsr #20
- 80006e8: bf18 it ne
- 80006ea: ea95 0f0c teqne r5, ip
- 80006ee: d00c beq.n 800070a <__aeabi_dmul+0x206>
- 80006f0: ea50 0641 orrs.w r6, r0, r1, lsl #1
- 80006f4: bf18 it ne
- 80006f6: ea52 0643 orrsne.w r6, r2, r3, lsl #1
- 80006fa: d1d1 bne.n 80006a0 <__aeabi_dmul+0x19c>
- 80006fc: ea81 0103 eor.w r1, r1, r3
- 8000700: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 8000704: f04f 0000 mov.w r0, #0
- 8000708: bd70 pop {r4, r5, r6, pc}
- 800070a: ea50 0641 orrs.w r6, r0, r1, lsl #1
- 800070e: bf06 itte eq
- 8000710: 4610 moveq r0, r2
- 8000712: 4619 moveq r1, r3
- 8000714: ea52 0643 orrsne.w r6, r2, r3, lsl #1
- 8000718: d019 beq.n 800074e <__aeabi_dmul+0x24a>
- 800071a: ea94 0f0c teq r4, ip
- 800071e: d102 bne.n 8000726 <__aeabi_dmul+0x222>
- 8000720: ea50 3601 orrs.w r6, r0, r1, lsl #12
- 8000724: d113 bne.n 800074e <__aeabi_dmul+0x24a>
- 8000726: ea95 0f0c teq r5, ip
- 800072a: d105 bne.n 8000738 <__aeabi_dmul+0x234>
- 800072c: ea52 3603 orrs.w r6, r2, r3, lsl #12
- 8000730: bf1c itt ne
- 8000732: 4610 movne r0, r2
- 8000734: 4619 movne r1, r3
- 8000736: d10a bne.n 800074e <__aeabi_dmul+0x24a>
- 8000738: ea81 0103 eor.w r1, r1, r3
- 800073c: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 8000740: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
- 8000744: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
- 8000748: f04f 0000 mov.w r0, #0
- 800074c: bd70 pop {r4, r5, r6, pc}
- 800074e: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
- 8000752: f441 0178 orr.w r1, r1, #16252928 ; 0xf80000
- 8000756: bd70 pop {r4, r5, r6, pc}
-
- 08000758 <__aeabi_ddiv>:
- 8000758: b570 push {r4, r5, r6, lr}
- 800075a: f04f 0cff mov.w ip, #255 ; 0xff
- 800075e: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
- 8000762: ea1c 5411 ands.w r4, ip, r1, lsr #20
- 8000766: bf1d ittte ne
- 8000768: ea1c 5513 andsne.w r5, ip, r3, lsr #20
- 800076c: ea94 0f0c teqne r4, ip
- 8000770: ea95 0f0c teqne r5, ip
- 8000774: f000 f8a7 bleq 80008c6 <__aeabi_ddiv+0x16e>
- 8000778: eba4 0405 sub.w r4, r4, r5
- 800077c: ea81 0e03 eor.w lr, r1, r3
- 8000780: ea52 3503 orrs.w r5, r2, r3, lsl #12
- 8000784: ea4f 3101 mov.w r1, r1, lsl #12
- 8000788: f000 8088 beq.w 800089c <__aeabi_ddiv+0x144>
- 800078c: ea4f 3303 mov.w r3, r3, lsl #12
- 8000790: f04f 5580 mov.w r5, #268435456 ; 0x10000000
- 8000794: ea45 1313 orr.w r3, r5, r3, lsr #4
- 8000798: ea43 6312 orr.w r3, r3, r2, lsr #24
- 800079c: ea4f 2202 mov.w r2, r2, lsl #8
- 80007a0: ea45 1511 orr.w r5, r5, r1, lsr #4
- 80007a4: ea45 6510 orr.w r5, r5, r0, lsr #24
- 80007a8: ea4f 2600 mov.w r6, r0, lsl #8
- 80007ac: f00e 4100 and.w r1, lr, #2147483648 ; 0x80000000
- 80007b0: 429d cmp r5, r3
- 80007b2: bf08 it eq
- 80007b4: 4296 cmpeq r6, r2
- 80007b6: f144 04fd adc.w r4, r4, #253 ; 0xfd
- 80007ba: f504 7440 add.w r4, r4, #768 ; 0x300
- 80007be: d202 bcs.n 80007c6 <__aeabi_ddiv+0x6e>
- 80007c0: 085b lsrs r3, r3, #1
- 80007c2: ea4f 0232 mov.w r2, r2, rrx
- 80007c6: 1ab6 subs r6, r6, r2
- 80007c8: eb65 0503 sbc.w r5, r5, r3
- 80007cc: 085b lsrs r3, r3, #1
- 80007ce: ea4f 0232 mov.w r2, r2, rrx
- 80007d2: f44f 1080 mov.w r0, #1048576 ; 0x100000
- 80007d6: f44f 2c00 mov.w ip, #524288 ; 0x80000
- 80007da: ebb6 0e02 subs.w lr, r6, r2
- 80007de: eb75 0e03 sbcs.w lr, r5, r3
- 80007e2: bf22 ittt cs
- 80007e4: 1ab6 subcs r6, r6, r2
- 80007e6: 4675 movcs r5, lr
- 80007e8: ea40 000c orrcs.w r0, r0, ip
- 80007ec: 085b lsrs r3, r3, #1
- 80007ee: ea4f 0232 mov.w r2, r2, rrx
- 80007f2: ebb6 0e02 subs.w lr, r6, r2
- 80007f6: eb75 0e03 sbcs.w lr, r5, r3
- 80007fa: bf22 ittt cs
- 80007fc: 1ab6 subcs r6, r6, r2
- 80007fe: 4675 movcs r5, lr
- 8000800: ea40 005c orrcs.w r0, r0, ip, lsr #1
- 8000804: 085b lsrs r3, r3, #1
- 8000806: ea4f 0232 mov.w r2, r2, rrx
- 800080a: ebb6 0e02 subs.w lr, r6, r2
- 800080e: eb75 0e03 sbcs.w lr, r5, r3
- 8000812: bf22 ittt cs
- 8000814: 1ab6 subcs r6, r6, r2
- 8000816: 4675 movcs r5, lr
- 8000818: ea40 009c orrcs.w r0, r0, ip, lsr #2
- 800081c: 085b lsrs r3, r3, #1
- 800081e: ea4f 0232 mov.w r2, r2, rrx
- 8000822: ebb6 0e02 subs.w lr, r6, r2
- 8000826: eb75 0e03 sbcs.w lr, r5, r3
- 800082a: bf22 ittt cs
- 800082c: 1ab6 subcs r6, r6, r2
- 800082e: 4675 movcs r5, lr
- 8000830: ea40 00dc orrcs.w r0, r0, ip, lsr #3
- 8000834: ea55 0e06 orrs.w lr, r5, r6
- 8000838: d018 beq.n 800086c <__aeabi_ddiv+0x114>
- 800083a: ea4f 1505 mov.w r5, r5, lsl #4
- 800083e: ea45 7516 orr.w r5, r5, r6, lsr #28
- 8000842: ea4f 1606 mov.w r6, r6, lsl #4
- 8000846: ea4f 03c3 mov.w r3, r3, lsl #3
- 800084a: ea43 7352 orr.w r3, r3, r2, lsr #29
- 800084e: ea4f 02c2 mov.w r2, r2, lsl #3
- 8000852: ea5f 1c1c movs.w ip, ip, lsr #4
- 8000856: d1c0 bne.n 80007da <__aeabi_ddiv+0x82>
- 8000858: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 800085c: d10b bne.n 8000876 <__aeabi_ddiv+0x11e>
- 800085e: ea41 0100 orr.w r1, r1, r0
- 8000862: f04f 0000 mov.w r0, #0
- 8000866: f04f 4c00 mov.w ip, #2147483648 ; 0x80000000
- 800086a: e7b6 b.n 80007da <__aeabi_ddiv+0x82>
- 800086c: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 8000870: bf04 itt eq
- 8000872: 4301 orreq r1, r0
- 8000874: 2000 moveq r0, #0
- 8000876: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
- 800087a: bf88 it hi
- 800087c: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
- 8000880: f63f aeaf bhi.w 80005e2 <__aeabi_dmul+0xde>
- 8000884: ebb5 0c03 subs.w ip, r5, r3
- 8000888: bf04 itt eq
- 800088a: ebb6 0c02 subseq.w ip, r6, r2
- 800088e: ea5f 0c50 movseq.w ip, r0, lsr #1
- 8000892: f150 0000 adcs.w r0, r0, #0
- 8000896: eb41 5104 adc.w r1, r1, r4, lsl #20
- 800089a: bd70 pop {r4, r5, r6, pc}
- 800089c: f00e 4e00 and.w lr, lr, #2147483648 ; 0x80000000
- 80008a0: ea4e 3111 orr.w r1, lr, r1, lsr #12
- 80008a4: eb14 045c adds.w r4, r4, ip, lsr #1
- 80008a8: bfc2 ittt gt
- 80008aa: ebd4 050c rsbsgt r5, r4, ip
- 80008ae: ea41 5104 orrgt.w r1, r1, r4, lsl #20
- 80008b2: bd70 popgt {r4, r5, r6, pc}
- 80008b4: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
- 80008b8: f04f 0e00 mov.w lr, #0
- 80008bc: 3c01 subs r4, #1
- 80008be: e690 b.n 80005e2 <__aeabi_dmul+0xde>
- 80008c0: ea45 0e06 orr.w lr, r5, r6
- 80008c4: e68d b.n 80005e2 <__aeabi_dmul+0xde>
- 80008c6: ea0c 5513 and.w r5, ip, r3, lsr #20
- 80008ca: ea94 0f0c teq r4, ip
- 80008ce: bf08 it eq
- 80008d0: ea95 0f0c teqeq r5, ip
- 80008d4: f43f af3b beq.w 800074e <__aeabi_dmul+0x24a>
- 80008d8: ea94 0f0c teq r4, ip
- 80008dc: d10a bne.n 80008f4 <__aeabi_ddiv+0x19c>
- 80008de: ea50 3401 orrs.w r4, r0, r1, lsl #12
- 80008e2: f47f af34 bne.w 800074e <__aeabi_dmul+0x24a>
- 80008e6: ea95 0f0c teq r5, ip
- 80008ea: f47f af25 bne.w 8000738 <__aeabi_dmul+0x234>
- 80008ee: 4610 mov r0, r2
- 80008f0: 4619 mov r1, r3
- 80008f2: e72c b.n 800074e <__aeabi_dmul+0x24a>
- 80008f4: ea95 0f0c teq r5, ip
- 80008f8: d106 bne.n 8000908 <__aeabi_ddiv+0x1b0>
- 80008fa: ea52 3503 orrs.w r5, r2, r3, lsl #12
- 80008fe: f43f aefd beq.w 80006fc <__aeabi_dmul+0x1f8>
- 8000902: 4610 mov r0, r2
- 8000904: 4619 mov r1, r3
- 8000906: e722 b.n 800074e <__aeabi_dmul+0x24a>
- 8000908: ea50 0641 orrs.w r6, r0, r1, lsl #1
- 800090c: bf18 it ne
- 800090e: ea52 0643 orrsne.w r6, r2, r3, lsl #1
- 8000912: f47f aec5 bne.w 80006a0 <__aeabi_dmul+0x19c>
- 8000916: ea50 0441 orrs.w r4, r0, r1, lsl #1
- 800091a: f47f af0d bne.w 8000738 <__aeabi_dmul+0x234>
- 800091e: ea52 0543 orrs.w r5, r2, r3, lsl #1
- 8000922: f47f aeeb bne.w 80006fc <__aeabi_dmul+0x1f8>
- 8000926: e712 b.n 800074e <__aeabi_dmul+0x24a>
-
- 08000928 <__aeabi_d2uiz>:
- 8000928: 004a lsls r2, r1, #1
- 800092a: d211 bcs.n 8000950 <__aeabi_d2uiz+0x28>
- 800092c: f512 1200 adds.w r2, r2, #2097152 ; 0x200000
- 8000930: d211 bcs.n 8000956 <__aeabi_d2uiz+0x2e>
- 8000932: d50d bpl.n 8000950 <__aeabi_d2uiz+0x28>
- 8000934: f46f 7378 mvn.w r3, #992 ; 0x3e0
- 8000938: ebb3 5262 subs.w r2, r3, r2, asr #21
- 800093c: d40e bmi.n 800095c <__aeabi_d2uiz+0x34>
- 800093e: ea4f 23c1 mov.w r3, r1, lsl #11
- 8000942: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
- 8000946: ea43 5350 orr.w r3, r3, r0, lsr #21
- 800094a: fa23 f002 lsr.w r0, r3, r2
- 800094e: 4770 bx lr
- 8000950: f04f 0000 mov.w r0, #0
- 8000954: 4770 bx lr
- 8000956: ea50 3001 orrs.w r0, r0, r1, lsl #12
- 800095a: d102 bne.n 8000962 <__aeabi_d2uiz+0x3a>
- 800095c: f04f 30ff mov.w r0, #4294967295
- 8000960: 4770 bx lr
- 8000962: f04f 0000 mov.w r0, #0
- 8000966: 4770 bx lr
-
- 08000968 <__aeabi_uldivmod>:
- 8000968: b953 cbnz r3, 8000980 <__aeabi_uldivmod+0x18>
- 800096a: b94a cbnz r2, 8000980 <__aeabi_uldivmod+0x18>
- 800096c: 2900 cmp r1, #0
- 800096e: bf08 it eq
- 8000970: 2800 cmpeq r0, #0
- 8000972: bf1c itt ne
- 8000974: f04f 31ff movne.w r1, #4294967295
- 8000978: f04f 30ff movne.w r0, #4294967295
- 800097c: f000 b974 b.w 8000c68 <__aeabi_idiv0>
- 8000980: f1ad 0c08 sub.w ip, sp, #8
- 8000984: e96d ce04 strd ip, lr, [sp, #-16]!
- 8000988: f000 f806 bl 8000998 <__udivmoddi4>
- 800098c: f8dd e004 ldr.w lr, [sp, #4]
- 8000990: e9dd 2302 ldrd r2, r3, [sp, #8]
- 8000994: b004 add sp, #16
- 8000996: 4770 bx lr
-
- 08000998 <__udivmoddi4>:
- 8000998: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- 800099c: 468c mov ip, r1
- 800099e: 4604 mov r4, r0
- 80009a0: 9e08 ldr r6, [sp, #32]
- 80009a2: 2b00 cmp r3, #0
- 80009a4: d14b bne.n 8000a3e <__udivmoddi4+0xa6>
- 80009a6: 428a cmp r2, r1
- 80009a8: 4615 mov r5, r2
- 80009aa: d967 bls.n 8000a7c <__udivmoddi4+0xe4>
- 80009ac: fab2 f282 clz r2, r2
- 80009b0: b14a cbz r2, 80009c6 <__udivmoddi4+0x2e>
- 80009b2: f1c2 0720 rsb r7, r2, #32
- 80009b6: fa01 f302 lsl.w r3, r1, r2
- 80009ba: fa20 f707 lsr.w r7, r0, r7
- 80009be: 4095 lsls r5, r2
- 80009c0: ea47 0c03 orr.w ip, r7, r3
- 80009c4: 4094 lsls r4, r2
- 80009c6: ea4f 4e15 mov.w lr, r5, lsr #16
- 80009ca: fbbc f7fe udiv r7, ip, lr
- 80009ce: fa1f f885 uxth.w r8, r5
- 80009d2: fb0e c317 mls r3, lr, r7, ip
- 80009d6: fb07 f908 mul.w r9, r7, r8
- 80009da: 0c21 lsrs r1, r4, #16
- 80009dc: ea41 4303 orr.w r3, r1, r3, lsl #16
- 80009e0: 4599 cmp r9, r3
- 80009e2: d909 bls.n 80009f8 <__udivmoddi4+0x60>
- 80009e4: 18eb adds r3, r5, r3
- 80009e6: f107 31ff add.w r1, r7, #4294967295
- 80009ea: f080 811c bcs.w 8000c26 <__udivmoddi4+0x28e>
- 80009ee: 4599 cmp r9, r3
- 80009f0: f240 8119 bls.w 8000c26 <__udivmoddi4+0x28e>
- 80009f4: 3f02 subs r7, #2
- 80009f6: 442b add r3, r5
- 80009f8: eba3 0309 sub.w r3, r3, r9
- 80009fc: fbb3 f0fe udiv r0, r3, lr
- 8000a00: fb0e 3310 mls r3, lr, r0, r3
- 8000a04: fb00 f108 mul.w r1, r0, r8
- 8000a08: b2a4 uxth r4, r4
- 8000a0a: ea44 4403 orr.w r4, r4, r3, lsl #16
- 8000a0e: 42a1 cmp r1, r4
- 8000a10: d909 bls.n 8000a26 <__udivmoddi4+0x8e>
- 8000a12: 192c adds r4, r5, r4
- 8000a14: f100 33ff add.w r3, r0, #4294967295
- 8000a18: f080 8107 bcs.w 8000c2a <__udivmoddi4+0x292>
- 8000a1c: 42a1 cmp r1, r4
- 8000a1e: f240 8104 bls.w 8000c2a <__udivmoddi4+0x292>
- 8000a22: 3802 subs r0, #2
- 8000a24: 442c add r4, r5
- 8000a26: ea40 4007 orr.w r0, r0, r7, lsl #16
- 8000a2a: 2700 movs r7, #0
- 8000a2c: 1a64 subs r4, r4, r1
- 8000a2e: b11e cbz r6, 8000a38 <__udivmoddi4+0xa0>
- 8000a30: 2300 movs r3, #0
- 8000a32: 40d4 lsrs r4, r2
- 8000a34: e9c6 4300 strd r4, r3, [r6]
- 8000a38: 4639 mov r1, r7
- 8000a3a: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 8000a3e: 428b cmp r3, r1
- 8000a40: d909 bls.n 8000a56 <__udivmoddi4+0xbe>
- 8000a42: 2e00 cmp r6, #0
- 8000a44: f000 80ec beq.w 8000c20 <__udivmoddi4+0x288>
- 8000a48: 2700 movs r7, #0
- 8000a4a: e9c6 0100 strd r0, r1, [r6]
- 8000a4e: 4638 mov r0, r7
- 8000a50: 4639 mov r1, r7
- 8000a52: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 8000a56: fab3 f783 clz r7, r3
- 8000a5a: 2f00 cmp r7, #0
- 8000a5c: d148 bne.n 8000af0 <__udivmoddi4+0x158>
- 8000a5e: 428b cmp r3, r1
- 8000a60: d302 bcc.n 8000a68 <__udivmoddi4+0xd0>
- 8000a62: 4282 cmp r2, r0
- 8000a64: f200 80fb bhi.w 8000c5e <__udivmoddi4+0x2c6>
- 8000a68: 1a84 subs r4, r0, r2
- 8000a6a: eb61 0303 sbc.w r3, r1, r3
- 8000a6e: 2001 movs r0, #1
- 8000a70: 469c mov ip, r3
- 8000a72: 2e00 cmp r6, #0
- 8000a74: d0e0 beq.n 8000a38 <__udivmoddi4+0xa0>
- 8000a76: e9c6 4c00 strd r4, ip, [r6]
- 8000a7a: e7dd b.n 8000a38 <__udivmoddi4+0xa0>
- 8000a7c: b902 cbnz r2, 8000a80 <__udivmoddi4+0xe8>
- 8000a7e: deff udf #255 ; 0xff
- 8000a80: fab2 f282 clz r2, r2
- 8000a84: 2a00 cmp r2, #0
- 8000a86: f040 808f bne.w 8000ba8 <__udivmoddi4+0x210>
- 8000a8a: 2701 movs r7, #1
- 8000a8c: 1b49 subs r1, r1, r5
- 8000a8e: ea4f 4815 mov.w r8, r5, lsr #16
- 8000a92: fa1f f985 uxth.w r9, r5
- 8000a96: fbb1 fef8 udiv lr, r1, r8
- 8000a9a: fb08 111e mls r1, r8, lr, r1
- 8000a9e: fb09 f00e mul.w r0, r9, lr
- 8000aa2: ea4f 4c14 mov.w ip, r4, lsr #16
- 8000aa6: ea4c 4301 orr.w r3, ip, r1, lsl #16
- 8000aaa: 4298 cmp r0, r3
- 8000aac: d907 bls.n 8000abe <__udivmoddi4+0x126>
- 8000aae: 18eb adds r3, r5, r3
- 8000ab0: f10e 31ff add.w r1, lr, #4294967295
- 8000ab4: d202 bcs.n 8000abc <__udivmoddi4+0x124>
- 8000ab6: 4298 cmp r0, r3
- 8000ab8: f200 80cd bhi.w 8000c56 <__udivmoddi4+0x2be>
- 8000abc: 468e mov lr, r1
- 8000abe: 1a1b subs r3, r3, r0
- 8000ac0: fbb3 f0f8 udiv r0, r3, r8
- 8000ac4: fb08 3310 mls r3, r8, r0, r3
- 8000ac8: fb09 f900 mul.w r9, r9, r0
- 8000acc: b2a4 uxth r4, r4
- 8000ace: ea44 4403 orr.w r4, r4, r3, lsl #16
- 8000ad2: 45a1 cmp r9, r4
- 8000ad4: d907 bls.n 8000ae6 <__udivmoddi4+0x14e>
- 8000ad6: 192c adds r4, r5, r4
- 8000ad8: f100 33ff add.w r3, r0, #4294967295
- 8000adc: d202 bcs.n 8000ae4 <__udivmoddi4+0x14c>
- 8000ade: 45a1 cmp r9, r4
- 8000ae0: f200 80b6 bhi.w 8000c50 <__udivmoddi4+0x2b8>
- 8000ae4: 4618 mov r0, r3
- 8000ae6: eba4 0409 sub.w r4, r4, r9
- 8000aea: ea40 400e orr.w r0, r0, lr, lsl #16
- 8000aee: e79e b.n 8000a2e <__udivmoddi4+0x96>
- 8000af0: f1c7 0520 rsb r5, r7, #32
- 8000af4: 40bb lsls r3, r7
- 8000af6: fa22 fc05 lsr.w ip, r2, r5
- 8000afa: ea4c 0c03 orr.w ip, ip, r3
- 8000afe: fa21 f405 lsr.w r4, r1, r5
- 8000b02: ea4f 4e1c mov.w lr, ip, lsr #16
- 8000b06: fbb4 f9fe udiv r9, r4, lr
- 8000b0a: fa1f f88c uxth.w r8, ip
- 8000b0e: fb0e 4419 mls r4, lr, r9, r4
- 8000b12: fa20 f305 lsr.w r3, r0, r5
- 8000b16: 40b9 lsls r1, r7
- 8000b18: fb09 fa08 mul.w sl, r9, r8
- 8000b1c: 4319 orrs r1, r3
- 8000b1e: 0c0b lsrs r3, r1, #16
- 8000b20: ea43 4404 orr.w r4, r3, r4, lsl #16
- 8000b24: 45a2 cmp sl, r4
- 8000b26: fa02 f207 lsl.w r2, r2, r7
- 8000b2a: fa00 f307 lsl.w r3, r0, r7
- 8000b2e: d90b bls.n 8000b48 <__udivmoddi4+0x1b0>
- 8000b30: eb1c 0404 adds.w r4, ip, r4
- 8000b34: f109 30ff add.w r0, r9, #4294967295
- 8000b38: f080 8088 bcs.w 8000c4c <__udivmoddi4+0x2b4>
- 8000b3c: 45a2 cmp sl, r4
- 8000b3e: f240 8085 bls.w 8000c4c <__udivmoddi4+0x2b4>
- 8000b42: f1a9 0902 sub.w r9, r9, #2
- 8000b46: 4464 add r4, ip
- 8000b48: eba4 040a sub.w r4, r4, sl
- 8000b4c: fbb4 f0fe udiv r0, r4, lr
- 8000b50: fb0e 4410 mls r4, lr, r0, r4
- 8000b54: fb00 fa08 mul.w sl, r0, r8
- 8000b58: b289 uxth r1, r1
- 8000b5a: ea41 4404 orr.w r4, r1, r4, lsl #16
- 8000b5e: 45a2 cmp sl, r4
- 8000b60: d908 bls.n 8000b74 <__udivmoddi4+0x1dc>
- 8000b62: eb1c 0404 adds.w r4, ip, r4
- 8000b66: f100 31ff add.w r1, r0, #4294967295
- 8000b6a: d26b bcs.n 8000c44 <__udivmoddi4+0x2ac>
- 8000b6c: 45a2 cmp sl, r4
- 8000b6e: d969 bls.n 8000c44 <__udivmoddi4+0x2ac>
- 8000b70: 3802 subs r0, #2
- 8000b72: 4464 add r4, ip
- 8000b74: ea40 4009 orr.w r0, r0, r9, lsl #16
- 8000b78: fba0 8902 umull r8, r9, r0, r2
- 8000b7c: eba4 040a sub.w r4, r4, sl
- 8000b80: 454c cmp r4, r9
- 8000b82: 4641 mov r1, r8
- 8000b84: 46ce mov lr, r9
- 8000b86: d354 bcc.n 8000c32 <__udivmoddi4+0x29a>
- 8000b88: d051 beq.n 8000c2e <__udivmoddi4+0x296>
- 8000b8a: 2e00 cmp r6, #0
- 8000b8c: d069 beq.n 8000c62 <__udivmoddi4+0x2ca>
- 8000b8e: 1a5a subs r2, r3, r1
- 8000b90: eb64 040e sbc.w r4, r4, lr
- 8000b94: fa04 f505 lsl.w r5, r4, r5
- 8000b98: fa22 f307 lsr.w r3, r2, r7
- 8000b9c: 40fc lsrs r4, r7
- 8000b9e: 431d orrs r5, r3
- 8000ba0: e9c6 5400 strd r5, r4, [r6]
- 8000ba4: 2700 movs r7, #0
- 8000ba6: e747 b.n 8000a38 <__udivmoddi4+0xa0>
- 8000ba8: 4095 lsls r5, r2
- 8000baa: f1c2 0320 rsb r3, r2, #32
- 8000bae: fa21 f003 lsr.w r0, r1, r3
- 8000bb2: ea4f 4815 mov.w r8, r5, lsr #16
- 8000bb6: fbb0 f7f8 udiv r7, r0, r8
- 8000bba: fa1f f985 uxth.w r9, r5
- 8000bbe: fb08 0017 mls r0, r8, r7, r0
- 8000bc2: fa24 f303 lsr.w r3, r4, r3
- 8000bc6: 4091 lsls r1, r2
- 8000bc8: fb07 fc09 mul.w ip, r7, r9
- 8000bcc: 430b orrs r3, r1
- 8000bce: 0c19 lsrs r1, r3, #16
- 8000bd0: ea41 4100 orr.w r1, r1, r0, lsl #16
- 8000bd4: 458c cmp ip, r1
- 8000bd6: fa04 f402 lsl.w r4, r4, r2
- 8000bda: d907 bls.n 8000bec <__udivmoddi4+0x254>
- 8000bdc: 1869 adds r1, r5, r1
- 8000bde: f107 30ff add.w r0, r7, #4294967295
- 8000be2: d231 bcs.n 8000c48 <__udivmoddi4+0x2b0>
- 8000be4: 458c cmp ip, r1
- 8000be6: d92f bls.n 8000c48 <__udivmoddi4+0x2b0>
- 8000be8: 3f02 subs r7, #2
- 8000bea: 4429 add r1, r5
- 8000bec: eba1 010c sub.w r1, r1, ip
- 8000bf0: fbb1 f0f8 udiv r0, r1, r8
- 8000bf4: fb08 1c10 mls ip, r8, r0, r1
- 8000bf8: fb00 fe09 mul.w lr, r0, r9
- 8000bfc: b299 uxth r1, r3
- 8000bfe: ea41 410c orr.w r1, r1, ip, lsl #16
- 8000c02: 458e cmp lr, r1
- 8000c04: d907 bls.n 8000c16 <__udivmoddi4+0x27e>
- 8000c06: 1869 adds r1, r5, r1
- 8000c08: f100 33ff add.w r3, r0, #4294967295
- 8000c0c: d218 bcs.n 8000c40 <__udivmoddi4+0x2a8>
- 8000c0e: 458e cmp lr, r1
- 8000c10: d916 bls.n 8000c40 <__udivmoddi4+0x2a8>
- 8000c12: 3802 subs r0, #2
- 8000c14: 4429 add r1, r5
- 8000c16: eba1 010e sub.w r1, r1, lr
- 8000c1a: ea40 4707 orr.w r7, r0, r7, lsl #16
- 8000c1e: e73a b.n 8000a96 <__udivmoddi4+0xfe>
- 8000c20: 4637 mov r7, r6
- 8000c22: 4630 mov r0, r6
- 8000c24: e708 b.n 8000a38 <__udivmoddi4+0xa0>
- 8000c26: 460f mov r7, r1
- 8000c28: e6e6 b.n 80009f8 <__udivmoddi4+0x60>
- 8000c2a: 4618 mov r0, r3
- 8000c2c: e6fb b.n 8000a26 <__udivmoddi4+0x8e>
- 8000c2e: 4543 cmp r3, r8
- 8000c30: d2ab bcs.n 8000b8a <__udivmoddi4+0x1f2>
- 8000c32: ebb8 0102 subs.w r1, r8, r2
- 8000c36: eb69 020c sbc.w r2, r9, ip
- 8000c3a: 3801 subs r0, #1
- 8000c3c: 4696 mov lr, r2
- 8000c3e: e7a4 b.n 8000b8a <__udivmoddi4+0x1f2>
- 8000c40: 4618 mov r0, r3
- 8000c42: e7e8 b.n 8000c16 <__udivmoddi4+0x27e>
- 8000c44: 4608 mov r0, r1
- 8000c46: e795 b.n 8000b74 <__udivmoddi4+0x1dc>
- 8000c48: 4607 mov r7, r0
- 8000c4a: e7cf b.n 8000bec <__udivmoddi4+0x254>
- 8000c4c: 4681 mov r9, r0
- 8000c4e: e77b b.n 8000b48 <__udivmoddi4+0x1b0>
- 8000c50: 3802 subs r0, #2
- 8000c52: 442c add r4, r5
- 8000c54: e747 b.n 8000ae6 <__udivmoddi4+0x14e>
- 8000c56: f1ae 0e02 sub.w lr, lr, #2
- 8000c5a: 442b add r3, r5
- 8000c5c: e72f b.n 8000abe <__udivmoddi4+0x126>
- 8000c5e: 4638 mov r0, r7
- 8000c60: e707 b.n 8000a72 <__udivmoddi4+0xda>
- 8000c62: 4637 mov r7, r6
- 8000c64: e6e8 b.n 8000a38 <__udivmoddi4+0xa0>
- 8000c66: bf00 nop
-
- 08000c68 <__aeabi_idiv0>:
- 8000c68: 4770 bx lr
- 8000c6a: bf00 nop
-
- 08000c6c <SELECT>:
- * SPI functions
- **************************************/
-
- /* slave select */
- static void SELECT(void)
- {
- 8000c6c: b580 push {r7, lr}
- 8000c6e: af00 add r7, sp, #0
- HAL_GPIO_WritePin(SD_CS_PORT, SD_CS_PIN, GPIO_PIN_RESET);
- 8000c70: 2200 movs r2, #0
- 8000c72: 2140 movs r1, #64 ; 0x40
- 8000c74: 4803 ldr r0, [pc, #12] ; (8000c84 <SELECT+0x18>)
- 8000c76: f001 fb9f bl 80023b8 <HAL_GPIO_WritePin>
- HAL_Delay(1);
- 8000c7a: 2001 movs r0, #1
- 8000c7c: f001 f8fc bl 8001e78 <HAL_Delay>
- }
- 8000c80: bf00 nop
- 8000c82: bd80 pop {r7, pc}
- 8000c84: 40020400 .word 0x40020400
-
- 08000c88 <DESELECT>:
-
- /* slave deselect */
- static void DESELECT(void)
- {
- 8000c88: b580 push {r7, lr}
- 8000c8a: af00 add r7, sp, #0
- HAL_GPIO_WritePin(SD_CS_PORT, SD_CS_PIN, GPIO_PIN_SET);
- 8000c8c: 2201 movs r2, #1
- 8000c8e: 2140 movs r1, #64 ; 0x40
- 8000c90: 4803 ldr r0, [pc, #12] ; (8000ca0 <DESELECT+0x18>)
- 8000c92: f001 fb91 bl 80023b8 <HAL_GPIO_WritePin>
- HAL_Delay(1);
- 8000c96: 2001 movs r0, #1
- 8000c98: f001 f8ee bl 8001e78 <HAL_Delay>
- }
- 8000c9c: bf00 nop
- 8000c9e: bd80 pop {r7, pc}
- 8000ca0: 40020400 .word 0x40020400
-
- 08000ca4 <SPI_TxByte>:
-
- /* SPI transmit a byte */
- static void SPI_TxByte(uint8_t data)
- {
- 8000ca4: b580 push {r7, lr}
- 8000ca6: b082 sub sp, #8
- 8000ca8: af00 add r7, sp, #0
- 8000caa: 4603 mov r3, r0
- 8000cac: 71fb strb r3, [r7, #7]
- while(!__HAL_SPI_GET_FLAG(HSPI_SDCARD, SPI_FLAG_TXE));
- 8000cae: bf00 nop
- 8000cb0: 4b08 ldr r3, [pc, #32] ; (8000cd4 <SPI_TxByte+0x30>)
- 8000cb2: 681b ldr r3, [r3, #0]
- 8000cb4: 689b ldr r3, [r3, #8]
- 8000cb6: f003 0302 and.w r3, r3, #2
- 8000cba: 2b02 cmp r3, #2
- 8000cbc: d1f8 bne.n 8000cb0 <SPI_TxByte+0xc>
- HAL_SPI_Transmit(HSPI_SDCARD, &data, 1, SPI_TIMEOUT);
- 8000cbe: 1df9 adds r1, r7, #7
- 8000cc0: 2364 movs r3, #100 ; 0x64
- 8000cc2: 2201 movs r2, #1
- 8000cc4: 4803 ldr r0, [pc, #12] ; (8000cd4 <SPI_TxByte+0x30>)
- 8000cc6: f002 f9d8 bl 800307a <HAL_SPI_Transmit>
- }
- 8000cca: bf00 nop
- 8000ccc: 3708 adds r7, #8
- 8000cce: 46bd mov sp, r7
- 8000cd0: bd80 pop {r7, pc}
- 8000cd2: bf00 nop
- 8000cd4: 20001398 .word 0x20001398
-
- 08000cd8 <SPI_TxBuffer>:
-
- /* SPI transmit buffer */
- static void SPI_TxBuffer(uint8_t *buffer, uint16_t len)
- {
- 8000cd8: b580 push {r7, lr}
- 8000cda: b082 sub sp, #8
- 8000cdc: af00 add r7, sp, #0
- 8000cde: 6078 str r0, [r7, #4]
- 8000ce0: 460b mov r3, r1
- 8000ce2: 807b strh r3, [r7, #2]
- while(!__HAL_SPI_GET_FLAG(HSPI_SDCARD, SPI_FLAG_TXE));
- 8000ce4: bf00 nop
- 8000ce6: 4b08 ldr r3, [pc, #32] ; (8000d08 <SPI_TxBuffer+0x30>)
- 8000ce8: 681b ldr r3, [r3, #0]
- 8000cea: 689b ldr r3, [r3, #8]
- 8000cec: f003 0302 and.w r3, r3, #2
- 8000cf0: 2b02 cmp r3, #2
- 8000cf2: d1f8 bne.n 8000ce6 <SPI_TxBuffer+0xe>
- HAL_SPI_Transmit(HSPI_SDCARD, buffer, len, SPI_TIMEOUT);
- 8000cf4: 887a ldrh r2, [r7, #2]
- 8000cf6: 2364 movs r3, #100 ; 0x64
- 8000cf8: 6879 ldr r1, [r7, #4]
- 8000cfa: 4803 ldr r0, [pc, #12] ; (8000d08 <SPI_TxBuffer+0x30>)
- 8000cfc: f002 f9bd bl 800307a <HAL_SPI_Transmit>
- }
- 8000d00: bf00 nop
- 8000d02: 3708 adds r7, #8
- 8000d04: 46bd mov sp, r7
- 8000d06: bd80 pop {r7, pc}
- 8000d08: 20001398 .word 0x20001398
-
- 08000d0c <SPI_RxByte>:
-
- /* SPI receive a byte */
- static uint8_t SPI_RxByte(void)
- {
- 8000d0c: b580 push {r7, lr}
- 8000d0e: b084 sub sp, #16
- 8000d10: af02 add r7, sp, #8
- uint8_t dummy, data;
- dummy = 0xFF;
- 8000d12: 23ff movs r3, #255 ; 0xff
- 8000d14: 71fb strb r3, [r7, #7]
-
- while(!__HAL_SPI_GET_FLAG(HSPI_SDCARD, SPI_FLAG_TXE));
- 8000d16: bf00 nop
- 8000d18: 4b09 ldr r3, [pc, #36] ; (8000d40 <SPI_RxByte+0x34>)
- 8000d1a: 681b ldr r3, [r3, #0]
- 8000d1c: 689b ldr r3, [r3, #8]
- 8000d1e: f003 0302 and.w r3, r3, #2
- 8000d22: 2b02 cmp r3, #2
- 8000d24: d1f8 bne.n 8000d18 <SPI_RxByte+0xc>
- HAL_SPI_TransmitReceive(HSPI_SDCARD, &dummy, &data, 1, SPI_TIMEOUT);
- 8000d26: 1dba adds r2, r7, #6
- 8000d28: 1df9 adds r1, r7, #7
- 8000d2a: 2364 movs r3, #100 ; 0x64
- 8000d2c: 9300 str r3, [sp, #0]
- 8000d2e: 2301 movs r3, #1
- 8000d30: 4803 ldr r0, [pc, #12] ; (8000d40 <SPI_RxByte+0x34>)
- 8000d32: f002 fade bl 80032f2 <HAL_SPI_TransmitReceive>
-
- return data;
- 8000d36: 79bb ldrb r3, [r7, #6]
- }
- 8000d38: 4618 mov r0, r3
- 8000d3a: 3708 adds r7, #8
- 8000d3c: 46bd mov sp, r7
- 8000d3e: bd80 pop {r7, pc}
- 8000d40: 20001398 .word 0x20001398
-
- 08000d44 <SPI_RxBytePtr>:
-
- /* SPI receive a byte via pointer */
- static void SPI_RxBytePtr(uint8_t *buff)
- {
- 8000d44: b580 push {r7, lr}
- 8000d46: b082 sub sp, #8
- 8000d48: af00 add r7, sp, #0
- 8000d4a: 6078 str r0, [r7, #4]
- *buff = SPI_RxByte();
- 8000d4c: f7ff ffde bl 8000d0c <SPI_RxByte>
- 8000d50: 4603 mov r3, r0
- 8000d52: 461a mov r2, r3
- 8000d54: 687b ldr r3, [r7, #4]
- 8000d56: 701a strb r2, [r3, #0]
- }
- 8000d58: bf00 nop
- 8000d5a: 3708 adds r7, #8
- 8000d5c: 46bd mov sp, r7
- 8000d5e: bd80 pop {r7, pc}
-
- 08000d60 <SD_ReadyWait>:
- * SD functions
- **************************************/
-
- /* wait SD ready */
- static uint8_t SD_ReadyWait(void)
- {
- 8000d60: b580 push {r7, lr}
- 8000d62: b082 sub sp, #8
- 8000d64: af00 add r7, sp, #0
- uint8_t res;
-
- /* timeout 500ms */
- Timer2 = 500;
- 8000d66: 4b0a ldr r3, [pc, #40] ; (8000d90 <SD_ReadyWait+0x30>)
- 8000d68: f44f 72fa mov.w r2, #500 ; 0x1f4
- 8000d6c: 801a strh r2, [r3, #0]
-
- /* if SD goes ready, receives 0xFF */
- do {
- res = SPI_RxByte();
- 8000d6e: f7ff ffcd bl 8000d0c <SPI_RxByte>
- 8000d72: 4603 mov r3, r0
- 8000d74: 71fb strb r3, [r7, #7]
- } while ((res != 0xFF) && Timer2);
- 8000d76: 79fb ldrb r3, [r7, #7]
- 8000d78: 2bff cmp r3, #255 ; 0xff
- 8000d7a: d003 beq.n 8000d84 <SD_ReadyWait+0x24>
- 8000d7c: 4b04 ldr r3, [pc, #16] ; (8000d90 <SD_ReadyWait+0x30>)
- 8000d7e: 881b ldrh r3, [r3, #0]
- 8000d80: 2b00 cmp r3, #0
- 8000d82: d1f4 bne.n 8000d6e <SD_ReadyWait+0xe>
-
- return res;
- 8000d84: 79fb ldrb r3, [r7, #7]
- }
- 8000d86: 4618 mov r0, r3
- 8000d88: 3708 adds r7, #8
- 8000d8a: 46bd mov sp, r7
- 8000d8c: bd80 pop {r7, pc}
- 8000d8e: bf00 nop
- 8000d90: 200002e8 .word 0x200002e8
-
- 08000d94 <SD_PowerOn>:
-
- /* power on */
- static void SD_PowerOn(void)
- {
- 8000d94: b580 push {r7, lr}
- 8000d96: b084 sub sp, #16
- 8000d98: af00 add r7, sp, #0
- uint8_t args[6];
- uint32_t cnt = 0x1FFF;
- 8000d9a: f641 73ff movw r3, #8191 ; 0x1fff
- 8000d9e: 60fb str r3, [r7, #12]
-
- /* transmit bytes to wake up */
- DESELECT();
- 8000da0: f7ff ff72 bl 8000c88 <DESELECT>
- for(int i = 0; i < 10; i++)
- 8000da4: 2300 movs r3, #0
- 8000da6: 60bb str r3, [r7, #8]
- 8000da8: e005 b.n 8000db6 <SD_PowerOn+0x22>
- {
- SPI_TxByte(0xFF);
- 8000daa: 20ff movs r0, #255 ; 0xff
- 8000dac: f7ff ff7a bl 8000ca4 <SPI_TxByte>
- for(int i = 0; i < 10; i++)
- 8000db0: 68bb ldr r3, [r7, #8]
- 8000db2: 3301 adds r3, #1
- 8000db4: 60bb str r3, [r7, #8]
- 8000db6: 68bb ldr r3, [r7, #8]
- 8000db8: 2b09 cmp r3, #9
- 8000dba: ddf6 ble.n 8000daa <SD_PowerOn+0x16>
- }
-
- /* slave select */
- SELECT();
- 8000dbc: f7ff ff56 bl 8000c6c <SELECT>
-
- /* make idle state */
- args[0] = CMD0; /* CMD0:GO_IDLE_STATE */
- 8000dc0: 2340 movs r3, #64 ; 0x40
- 8000dc2: 703b strb r3, [r7, #0]
- args[1] = 0;
- 8000dc4: 2300 movs r3, #0
- 8000dc6: 707b strb r3, [r7, #1]
- args[2] = 0;
- 8000dc8: 2300 movs r3, #0
- 8000dca: 70bb strb r3, [r7, #2]
- args[3] = 0;
- 8000dcc: 2300 movs r3, #0
- 8000dce: 70fb strb r3, [r7, #3]
- args[4] = 0;
- 8000dd0: 2300 movs r3, #0
- 8000dd2: 713b strb r3, [r7, #4]
- args[5] = 0x95; /* CRC */
- 8000dd4: 2395 movs r3, #149 ; 0x95
- 8000dd6: 717b strb r3, [r7, #5]
-
- SPI_TxBuffer(args, sizeof(args));
- 8000dd8: 463b mov r3, r7
- 8000dda: 2106 movs r1, #6
- 8000ddc: 4618 mov r0, r3
- 8000dde: f7ff ff7b bl 8000cd8 <SPI_TxBuffer>
-
- /* wait response */
- while ((SPI_RxByte() != 0x01) && cnt)
- 8000de2: e002 b.n 8000dea <SD_PowerOn+0x56>
- {
- cnt--;
- 8000de4: 68fb ldr r3, [r7, #12]
- 8000de6: 3b01 subs r3, #1
- 8000de8: 60fb str r3, [r7, #12]
- while ((SPI_RxByte() != 0x01) && cnt)
- 8000dea: f7ff ff8f bl 8000d0c <SPI_RxByte>
- 8000dee: 4603 mov r3, r0
- 8000df0: 2b01 cmp r3, #1
- 8000df2: d002 beq.n 8000dfa <SD_PowerOn+0x66>
- 8000df4: 68fb ldr r3, [r7, #12]
- 8000df6: 2b00 cmp r3, #0
- 8000df8: d1f4 bne.n 8000de4 <SD_PowerOn+0x50>
- }
-
- DESELECT();
- 8000dfa: f7ff ff45 bl 8000c88 <DESELECT>
- SPI_TxByte(0XFF);
- 8000dfe: 20ff movs r0, #255 ; 0xff
- 8000e00: f7ff ff50 bl 8000ca4 <SPI_TxByte>
-
- PowerFlag = 1;
- 8000e04: 4b03 ldr r3, [pc, #12] ; (8000e14 <SD_PowerOn+0x80>)
- 8000e06: 2201 movs r2, #1
- 8000e08: 701a strb r2, [r3, #0]
- }
- 8000e0a: bf00 nop
- 8000e0c: 3710 adds r7, #16
- 8000e0e: 46bd mov sp, r7
- 8000e10: bd80 pop {r7, pc}
- 8000e12: bf00 nop
- 8000e14: 200000a5 .word 0x200000a5
-
- 08000e18 <SD_PowerOff>:
-
- /* power off */
- static void SD_PowerOff(void)
- {
- 8000e18: b480 push {r7}
- 8000e1a: af00 add r7, sp, #0
- PowerFlag = 0;
- 8000e1c: 4b03 ldr r3, [pc, #12] ; (8000e2c <SD_PowerOff+0x14>)
- 8000e1e: 2200 movs r2, #0
- 8000e20: 701a strb r2, [r3, #0]
- }
- 8000e22: bf00 nop
- 8000e24: 46bd mov sp, r7
- 8000e26: bc80 pop {r7}
- 8000e28: 4770 bx lr
- 8000e2a: bf00 nop
- 8000e2c: 200000a5 .word 0x200000a5
-
- 08000e30 <SD_CheckPower>:
-
- /* check power flag */
- static uint8_t SD_CheckPower(void)
- {
- 8000e30: b480 push {r7}
- 8000e32: af00 add r7, sp, #0
- return PowerFlag;
- 8000e34: 4b02 ldr r3, [pc, #8] ; (8000e40 <SD_CheckPower+0x10>)
- 8000e36: 781b ldrb r3, [r3, #0]
- }
- 8000e38: 4618 mov r0, r3
- 8000e3a: 46bd mov sp, r7
- 8000e3c: bc80 pop {r7}
- 8000e3e: 4770 bx lr
- 8000e40: 200000a5 .word 0x200000a5
-
- 08000e44 <SD_RxDataBlock>:
-
- /* receive data block */
- static bool SD_RxDataBlock(BYTE *buff, UINT len)
- {
- 8000e44: b580 push {r7, lr}
- 8000e46: b084 sub sp, #16
- 8000e48: af00 add r7, sp, #0
- 8000e4a: 6078 str r0, [r7, #4]
- 8000e4c: 6039 str r1, [r7, #0]
- uint8_t token;
-
- /* timeout 200ms */
- Timer1 = 200;
- 8000e4e: 4b13 ldr r3, [pc, #76] ; (8000e9c <SD_RxDataBlock+0x58>)
- 8000e50: 22c8 movs r2, #200 ; 0xc8
- 8000e52: 801a strh r2, [r3, #0]
-
- /* loop until receive a response or timeout */
- do {
- token = SPI_RxByte();
- 8000e54: f7ff ff5a bl 8000d0c <SPI_RxByte>
- 8000e58: 4603 mov r3, r0
- 8000e5a: 73fb strb r3, [r7, #15]
- } while((token == 0xFF) && Timer1);
- 8000e5c: 7bfb ldrb r3, [r7, #15]
- 8000e5e: 2bff cmp r3, #255 ; 0xff
- 8000e60: d103 bne.n 8000e6a <SD_RxDataBlock+0x26>
- 8000e62: 4b0e ldr r3, [pc, #56] ; (8000e9c <SD_RxDataBlock+0x58>)
- 8000e64: 881b ldrh r3, [r3, #0]
- 8000e66: 2b00 cmp r3, #0
- 8000e68: d1f4 bne.n 8000e54 <SD_RxDataBlock+0x10>
-
- /* invalid response */
- if(token != 0xFE) return FALSE;
- 8000e6a: 7bfb ldrb r3, [r7, #15]
- 8000e6c: 2bfe cmp r3, #254 ; 0xfe
- 8000e6e: d001 beq.n 8000e74 <SD_RxDataBlock+0x30>
- 8000e70: 2300 movs r3, #0
- 8000e72: e00f b.n 8000e94 <SD_RxDataBlock+0x50>
-
- /* receive data */
- do {
- SPI_RxBytePtr(buff++);
- 8000e74: 687b ldr r3, [r7, #4]
- 8000e76: 1c5a adds r2, r3, #1
- 8000e78: 607a str r2, [r7, #4]
- 8000e7a: 4618 mov r0, r3
- 8000e7c: f7ff ff62 bl 8000d44 <SPI_RxBytePtr>
- } while(len--);
- 8000e80: 683b ldr r3, [r7, #0]
- 8000e82: 1e5a subs r2, r3, #1
- 8000e84: 603a str r2, [r7, #0]
- 8000e86: 2b00 cmp r3, #0
- 8000e88: d1f4 bne.n 8000e74 <SD_RxDataBlock+0x30>
-
- /* discard CRC */
- SPI_RxByte();
- 8000e8a: f7ff ff3f bl 8000d0c <SPI_RxByte>
- SPI_RxByte();
- 8000e8e: f7ff ff3d bl 8000d0c <SPI_RxByte>
-
- return TRUE;
- 8000e92: 2301 movs r3, #1
- }
- 8000e94: 4618 mov r0, r3
- 8000e96: 3710 adds r7, #16
- 8000e98: 46bd mov sp, r7
- 8000e9a: bd80 pop {r7, pc}
- 8000e9c: 200002ea .word 0x200002ea
-
- 08000ea0 <SD_TxDataBlock>:
-
- /* transmit data block */
- #if _USE_WRITE == 1
- static bool SD_TxDataBlock(const uint8_t *buff, BYTE token)
- {
- 8000ea0: b580 push {r7, lr}
- 8000ea2: b084 sub sp, #16
- 8000ea4: af00 add r7, sp, #0
- 8000ea6: 6078 str r0, [r7, #4]
- 8000ea8: 460b mov r3, r1
- 8000eaa: 70fb strb r3, [r7, #3]
- uint8_t resp;
- uint8_t i = 0;
- 8000eac: 2300 movs r3, #0
- 8000eae: 73bb strb r3, [r7, #14]
-
- /* wait SD ready */
- if (SD_ReadyWait() != 0xFF) return FALSE;
- 8000eb0: f7ff ff56 bl 8000d60 <SD_ReadyWait>
- 8000eb4: 4603 mov r3, r0
- 8000eb6: 2bff cmp r3, #255 ; 0xff
- 8000eb8: d001 beq.n 8000ebe <SD_TxDataBlock+0x1e>
- 8000eba: 2300 movs r3, #0
- 8000ebc: e02f b.n 8000f1e <SD_TxDataBlock+0x7e>
-
- /* transmit token */
- SPI_TxByte(token);
- 8000ebe: 78fb ldrb r3, [r7, #3]
- 8000ec0: 4618 mov r0, r3
- 8000ec2: f7ff feef bl 8000ca4 <SPI_TxByte>
-
- /* if it's not STOP token, transmit data */
- if (token != 0xFD)
- 8000ec6: 78fb ldrb r3, [r7, #3]
- 8000ec8: 2bfd cmp r3, #253 ; 0xfd
- 8000eca: d020 beq.n 8000f0e <SD_TxDataBlock+0x6e>
- {
- SPI_TxBuffer((uint8_t*)buff, 512);
- 8000ecc: f44f 7100 mov.w r1, #512 ; 0x200
- 8000ed0: 6878 ldr r0, [r7, #4]
- 8000ed2: f7ff ff01 bl 8000cd8 <SPI_TxBuffer>
-
- /* discard CRC */
- SPI_RxByte();
- 8000ed6: f7ff ff19 bl 8000d0c <SPI_RxByte>
- SPI_RxByte();
- 8000eda: f7ff ff17 bl 8000d0c <SPI_RxByte>
-
- /* receive response */
- while (i <= 64)
- 8000ede: e00b b.n 8000ef8 <SD_TxDataBlock+0x58>
- {
- resp = SPI_RxByte();
- 8000ee0: f7ff ff14 bl 8000d0c <SPI_RxByte>
- 8000ee4: 4603 mov r3, r0
- 8000ee6: 73fb strb r3, [r7, #15]
-
- /* transmit 0x05 accepted */
- if ((resp & 0x1F) == 0x05) break;
- 8000ee8: 7bfb ldrb r3, [r7, #15]
- 8000eea: f003 031f and.w r3, r3, #31
- 8000eee: 2b05 cmp r3, #5
- 8000ef0: d006 beq.n 8000f00 <SD_TxDataBlock+0x60>
- i++;
- 8000ef2: 7bbb ldrb r3, [r7, #14]
- 8000ef4: 3301 adds r3, #1
- 8000ef6: 73bb strb r3, [r7, #14]
- while (i <= 64)
- 8000ef8: 7bbb ldrb r3, [r7, #14]
- 8000efa: 2b40 cmp r3, #64 ; 0x40
- 8000efc: d9f0 bls.n 8000ee0 <SD_TxDataBlock+0x40>
- 8000efe: e000 b.n 8000f02 <SD_TxDataBlock+0x62>
- if ((resp & 0x1F) == 0x05) break;
- 8000f00: bf00 nop
- }
-
- /* recv buffer clear */
- while (SPI_RxByte() == 0);
- 8000f02: bf00 nop
- 8000f04: f7ff ff02 bl 8000d0c <SPI_RxByte>
- 8000f08: 4603 mov r3, r0
- 8000f0a: 2b00 cmp r3, #0
- 8000f0c: d0fa beq.n 8000f04 <SD_TxDataBlock+0x64>
- }
-
- /* transmit 0x05 accepted */
- if ((resp & 0x1F) == 0x05) return TRUE;
- 8000f0e: 7bfb ldrb r3, [r7, #15]
- 8000f10: f003 031f and.w r3, r3, #31
- 8000f14: 2b05 cmp r3, #5
- 8000f16: d101 bne.n 8000f1c <SD_TxDataBlock+0x7c>
- 8000f18: 2301 movs r3, #1
- 8000f1a: e000 b.n 8000f1e <SD_TxDataBlock+0x7e>
-
- return FALSE;
- 8000f1c: 2300 movs r3, #0
- }
- 8000f1e: 4618 mov r0, r3
- 8000f20: 3710 adds r7, #16
- 8000f22: 46bd mov sp, r7
- 8000f24: bd80 pop {r7, pc}
-
- 08000f26 <SD_SendCmd>:
- #endif /* _USE_WRITE */
-
- /* transmit command */
- static BYTE SD_SendCmd(BYTE cmd, uint32_t arg)
- {
- 8000f26: b580 push {r7, lr}
- 8000f28: b084 sub sp, #16
- 8000f2a: af00 add r7, sp, #0
- 8000f2c: 4603 mov r3, r0
- 8000f2e: 6039 str r1, [r7, #0]
- 8000f30: 71fb strb r3, [r7, #7]
- uint8_t crc, res;
-
- /* wait SD ready */
- if (SD_ReadyWait() != 0xFF) return 0xFF;
- 8000f32: f7ff ff15 bl 8000d60 <SD_ReadyWait>
- 8000f36: 4603 mov r3, r0
- 8000f38: 2bff cmp r3, #255 ; 0xff
- 8000f3a: d001 beq.n 8000f40 <SD_SendCmd+0x1a>
- 8000f3c: 23ff movs r3, #255 ; 0xff
- 8000f3e: e042 b.n 8000fc6 <SD_SendCmd+0xa0>
-
- /* transmit command */
- SPI_TxByte(cmd); /* Command */
- 8000f40: 79fb ldrb r3, [r7, #7]
- 8000f42: 4618 mov r0, r3
- 8000f44: f7ff feae bl 8000ca4 <SPI_TxByte>
- SPI_TxByte((uint8_t)(arg >> 24)); /* Argument[31..24] */
- 8000f48: 683b ldr r3, [r7, #0]
- 8000f4a: 0e1b lsrs r3, r3, #24
- 8000f4c: b2db uxtb r3, r3
- 8000f4e: 4618 mov r0, r3
- 8000f50: f7ff fea8 bl 8000ca4 <SPI_TxByte>
- SPI_TxByte((uint8_t)(arg >> 16)); /* Argument[23..16] */
- 8000f54: 683b ldr r3, [r7, #0]
- 8000f56: 0c1b lsrs r3, r3, #16
- 8000f58: b2db uxtb r3, r3
- 8000f5a: 4618 mov r0, r3
- 8000f5c: f7ff fea2 bl 8000ca4 <SPI_TxByte>
- SPI_TxByte((uint8_t)(arg >> 8)); /* Argument[15..8] */
- 8000f60: 683b ldr r3, [r7, #0]
- 8000f62: 0a1b lsrs r3, r3, #8
- 8000f64: b2db uxtb r3, r3
- 8000f66: 4618 mov r0, r3
- 8000f68: f7ff fe9c bl 8000ca4 <SPI_TxByte>
- SPI_TxByte((uint8_t)arg); /* Argument[7..0] */
- 8000f6c: 683b ldr r3, [r7, #0]
- 8000f6e: b2db uxtb r3, r3
- 8000f70: 4618 mov r0, r3
- 8000f72: f7ff fe97 bl 8000ca4 <SPI_TxByte>
-
- /* prepare CRC */
- if(cmd == CMD0) crc = 0x95; /* CRC for CMD0(0) */
- 8000f76: 79fb ldrb r3, [r7, #7]
- 8000f78: 2b40 cmp r3, #64 ; 0x40
- 8000f7a: d102 bne.n 8000f82 <SD_SendCmd+0x5c>
- 8000f7c: 2395 movs r3, #149 ; 0x95
- 8000f7e: 73fb strb r3, [r7, #15]
- 8000f80: e007 b.n 8000f92 <SD_SendCmd+0x6c>
- else if(cmd == CMD8) crc = 0x87; /* CRC for CMD8(0x1AA) */
- 8000f82: 79fb ldrb r3, [r7, #7]
- 8000f84: 2b48 cmp r3, #72 ; 0x48
- 8000f86: d102 bne.n 8000f8e <SD_SendCmd+0x68>
- 8000f88: 2387 movs r3, #135 ; 0x87
- 8000f8a: 73fb strb r3, [r7, #15]
- 8000f8c: e001 b.n 8000f92 <SD_SendCmd+0x6c>
- else crc = 1;
- 8000f8e: 2301 movs r3, #1
- 8000f90: 73fb strb r3, [r7, #15]
-
- /* transmit CRC */
- SPI_TxByte(crc);
- 8000f92: 7bfb ldrb r3, [r7, #15]
- 8000f94: 4618 mov r0, r3
- 8000f96: f7ff fe85 bl 8000ca4 <SPI_TxByte>
-
- /* Skip a stuff byte when STOP_TRANSMISSION */
- if (cmd == CMD12) SPI_RxByte();
- 8000f9a: 79fb ldrb r3, [r7, #7]
- 8000f9c: 2b4c cmp r3, #76 ; 0x4c
- 8000f9e: d101 bne.n 8000fa4 <SD_SendCmd+0x7e>
- 8000fa0: f7ff feb4 bl 8000d0c <SPI_RxByte>
-
- /* receive response */
- uint8_t n = 10;
- 8000fa4: 230a movs r3, #10
- 8000fa6: 73bb strb r3, [r7, #14]
- do {
- res = SPI_RxByte();
- 8000fa8: f7ff feb0 bl 8000d0c <SPI_RxByte>
- 8000fac: 4603 mov r3, r0
- 8000fae: 737b strb r3, [r7, #13]
- } while ((res & 0x80) && --n);
- 8000fb0: f997 300d ldrsb.w r3, [r7, #13]
- 8000fb4: 2b00 cmp r3, #0
- 8000fb6: da05 bge.n 8000fc4 <SD_SendCmd+0x9e>
- 8000fb8: 7bbb ldrb r3, [r7, #14]
- 8000fba: 3b01 subs r3, #1
- 8000fbc: 73bb strb r3, [r7, #14]
- 8000fbe: 7bbb ldrb r3, [r7, #14]
- 8000fc0: 2b00 cmp r3, #0
- 8000fc2: d1f1 bne.n 8000fa8 <SD_SendCmd+0x82>
-
- return res;
- 8000fc4: 7b7b ldrb r3, [r7, #13]
- }
- 8000fc6: 4618 mov r0, r3
- 8000fc8: 3710 adds r7, #16
- 8000fca: 46bd mov sp, r7
- 8000fcc: bd80 pop {r7, pc}
- ...
-
- 08000fd0 <SD_disk_initialize>:
- * user_diskio.c functions
- **************************************/
-
- /* initialize SD */
- DSTATUS SD_disk_initialize(BYTE drv)
- {
- 8000fd0: b590 push {r4, r7, lr}
- 8000fd2: b085 sub sp, #20
- 8000fd4: af00 add r7, sp, #0
- 8000fd6: 4603 mov r3, r0
- 8000fd8: 71fb strb r3, [r7, #7]
- uint8_t n, type, ocr[4];
-
- /* single drive, drv should be 0 */
- if(drv) return STA_NOINIT;
- 8000fda: 79fb ldrb r3, [r7, #7]
- 8000fdc: 2b00 cmp r3, #0
- 8000fde: d001 beq.n 8000fe4 <SD_disk_initialize+0x14>
- 8000fe0: 2301 movs r3, #1
- 8000fe2: e0d1 b.n 8001188 <SD_disk_initialize+0x1b8>
-
- /* no disk */
- if(Stat & STA_NODISK) return Stat;
- 8000fe4: 4b6a ldr r3, [pc, #424] ; (8001190 <SD_disk_initialize+0x1c0>)
- 8000fe6: 781b ldrb r3, [r3, #0]
- 8000fe8: b2db uxtb r3, r3
- 8000fea: f003 0302 and.w r3, r3, #2
- 8000fee: 2b00 cmp r3, #0
- 8000ff0: d003 beq.n 8000ffa <SD_disk_initialize+0x2a>
- 8000ff2: 4b67 ldr r3, [pc, #412] ; (8001190 <SD_disk_initialize+0x1c0>)
- 8000ff4: 781b ldrb r3, [r3, #0]
- 8000ff6: b2db uxtb r3, r3
- 8000ff8: e0c6 b.n 8001188 <SD_disk_initialize+0x1b8>
-
- /* power on */
- SD_PowerOn();
- 8000ffa: f7ff fecb bl 8000d94 <SD_PowerOn>
-
- /* slave select */
- SELECT();
- 8000ffe: f7ff fe35 bl 8000c6c <SELECT>
-
- /* check disk type */
- type = 0;
- 8001002: 2300 movs r3, #0
- 8001004: 73bb strb r3, [r7, #14]
-
- /* send GO_IDLE_STATE command */
- if (SD_SendCmd(CMD0, 0) == 1)
- 8001006: 2100 movs r1, #0
- 8001008: 2040 movs r0, #64 ; 0x40
- 800100a: f7ff ff8c bl 8000f26 <SD_SendCmd>
- 800100e: 4603 mov r3, r0
- 8001010: 2b01 cmp r3, #1
- 8001012: f040 80a1 bne.w 8001158 <SD_disk_initialize+0x188>
- {
- /* timeout 1 sec */
- Timer1 = 1000;
- 8001016: 4b5f ldr r3, [pc, #380] ; (8001194 <SD_disk_initialize+0x1c4>)
- 8001018: f44f 727a mov.w r2, #1000 ; 0x3e8
- 800101c: 801a strh r2, [r3, #0]
-
- /* SDC V2+ accept CMD8 command, http://elm-chan.org/docs/mmc/mmc_e.html */
- if (SD_SendCmd(CMD8, 0x1AA) == 1)
- 800101e: f44f 71d5 mov.w r1, #426 ; 0x1aa
- 8001022: 2048 movs r0, #72 ; 0x48
- 8001024: f7ff ff7f bl 8000f26 <SD_SendCmd>
- 8001028: 4603 mov r3, r0
- 800102a: 2b01 cmp r3, #1
- 800102c: d155 bne.n 80010da <SD_disk_initialize+0x10a>
- {
- /* operation condition register */
- for (n = 0; n < 4; n++)
- 800102e: 2300 movs r3, #0
- 8001030: 73fb strb r3, [r7, #15]
- 8001032: e00c b.n 800104e <SD_disk_initialize+0x7e>
- {
- ocr[n] = SPI_RxByte();
- 8001034: 7bfc ldrb r4, [r7, #15]
- 8001036: f7ff fe69 bl 8000d0c <SPI_RxByte>
- 800103a: 4603 mov r3, r0
- 800103c: 461a mov r2, r3
- 800103e: f107 0310 add.w r3, r7, #16
- 8001042: 4423 add r3, r4
- 8001044: f803 2c08 strb.w r2, [r3, #-8]
- for (n = 0; n < 4; n++)
- 8001048: 7bfb ldrb r3, [r7, #15]
- 800104a: 3301 adds r3, #1
- 800104c: 73fb strb r3, [r7, #15]
- 800104e: 7bfb ldrb r3, [r7, #15]
- 8001050: 2b03 cmp r3, #3
- 8001052: d9ef bls.n 8001034 <SD_disk_initialize+0x64>
- }
-
- /* voltage range 2.7-3.6V */
- if (ocr[2] == 0x01 && ocr[3] == 0xAA)
- 8001054: 7abb ldrb r3, [r7, #10]
- 8001056: 2b01 cmp r3, #1
- 8001058: d17e bne.n 8001158 <SD_disk_initialize+0x188>
- 800105a: 7afb ldrb r3, [r7, #11]
- 800105c: 2baa cmp r3, #170 ; 0xaa
- 800105e: d17b bne.n 8001158 <SD_disk_initialize+0x188>
- {
- /* ACMD41 with HCS bit */
- do {
- if (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 1UL << 30) == 0) break;
- 8001060: 2100 movs r1, #0
- 8001062: 2077 movs r0, #119 ; 0x77
- 8001064: f7ff ff5f bl 8000f26 <SD_SendCmd>
- 8001068: 4603 mov r3, r0
- 800106a: 2b01 cmp r3, #1
- 800106c: d807 bhi.n 800107e <SD_disk_initialize+0xae>
- 800106e: f04f 4180 mov.w r1, #1073741824 ; 0x40000000
- 8001072: 2069 movs r0, #105 ; 0x69
- 8001074: f7ff ff57 bl 8000f26 <SD_SendCmd>
- 8001078: 4603 mov r3, r0
- 800107a: 2b00 cmp r3, #0
- 800107c: d004 beq.n 8001088 <SD_disk_initialize+0xb8>
- } while (Timer1);
- 800107e: 4b45 ldr r3, [pc, #276] ; (8001194 <SD_disk_initialize+0x1c4>)
- 8001080: 881b ldrh r3, [r3, #0]
- 8001082: 2b00 cmp r3, #0
- 8001084: d1ec bne.n 8001060 <SD_disk_initialize+0x90>
- 8001086: e000 b.n 800108a <SD_disk_initialize+0xba>
- if (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 1UL << 30) == 0) break;
- 8001088: bf00 nop
-
- /* READ_OCR */
- if (Timer1 && SD_SendCmd(CMD58, 0) == 0)
- 800108a: 4b42 ldr r3, [pc, #264] ; (8001194 <SD_disk_initialize+0x1c4>)
- 800108c: 881b ldrh r3, [r3, #0]
- 800108e: 2b00 cmp r3, #0
- 8001090: d062 beq.n 8001158 <SD_disk_initialize+0x188>
- 8001092: 2100 movs r1, #0
- 8001094: 207a movs r0, #122 ; 0x7a
- 8001096: f7ff ff46 bl 8000f26 <SD_SendCmd>
- 800109a: 4603 mov r3, r0
- 800109c: 2b00 cmp r3, #0
- 800109e: d15b bne.n 8001158 <SD_disk_initialize+0x188>
- {
- /* Check CCS bit */
- for (n = 0; n < 4; n++)
- 80010a0: 2300 movs r3, #0
- 80010a2: 73fb strb r3, [r7, #15]
- 80010a4: e00c b.n 80010c0 <SD_disk_initialize+0xf0>
- {
- ocr[n] = SPI_RxByte();
- 80010a6: 7bfc ldrb r4, [r7, #15]
- 80010a8: f7ff fe30 bl 8000d0c <SPI_RxByte>
- 80010ac: 4603 mov r3, r0
- 80010ae: 461a mov r2, r3
- 80010b0: f107 0310 add.w r3, r7, #16
- 80010b4: 4423 add r3, r4
- 80010b6: f803 2c08 strb.w r2, [r3, #-8]
- for (n = 0; n < 4; n++)
- 80010ba: 7bfb ldrb r3, [r7, #15]
- 80010bc: 3301 adds r3, #1
- 80010be: 73fb strb r3, [r7, #15]
- 80010c0: 7bfb ldrb r3, [r7, #15]
- 80010c2: 2b03 cmp r3, #3
- 80010c4: d9ef bls.n 80010a6 <SD_disk_initialize+0xd6>
- }
-
- /* SDv2 (HC or SC) */
- type = (ocr[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2;
- 80010c6: 7a3b ldrb r3, [r7, #8]
- 80010c8: f003 0340 and.w r3, r3, #64 ; 0x40
- 80010cc: 2b00 cmp r3, #0
- 80010ce: d001 beq.n 80010d4 <SD_disk_initialize+0x104>
- 80010d0: 230c movs r3, #12
- 80010d2: e000 b.n 80010d6 <SD_disk_initialize+0x106>
- 80010d4: 2304 movs r3, #4
- 80010d6: 73bb strb r3, [r7, #14]
- 80010d8: e03e b.n 8001158 <SD_disk_initialize+0x188>
- }
- }
- else
- {
- /* SDC V1 or MMC */
- type = (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 0) <= 1) ? CT_SD1 : CT_MMC;
- 80010da: 2100 movs r1, #0
- 80010dc: 2077 movs r0, #119 ; 0x77
- 80010de: f7ff ff22 bl 8000f26 <SD_SendCmd>
- 80010e2: 4603 mov r3, r0
- 80010e4: 2b01 cmp r3, #1
- 80010e6: d808 bhi.n 80010fa <SD_disk_initialize+0x12a>
- 80010e8: 2100 movs r1, #0
- 80010ea: 2069 movs r0, #105 ; 0x69
- 80010ec: f7ff ff1b bl 8000f26 <SD_SendCmd>
- 80010f0: 4603 mov r3, r0
- 80010f2: 2b01 cmp r3, #1
- 80010f4: d801 bhi.n 80010fa <SD_disk_initialize+0x12a>
- 80010f6: 2302 movs r3, #2
- 80010f8: e000 b.n 80010fc <SD_disk_initialize+0x12c>
- 80010fa: 2301 movs r3, #1
- 80010fc: 73bb strb r3, [r7, #14]
-
- do
- {
- if (type == CT_SD1)
- 80010fe: 7bbb ldrb r3, [r7, #14]
- 8001100: 2b02 cmp r3, #2
- 8001102: d10e bne.n 8001122 <SD_disk_initialize+0x152>
- {
- if (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 0) == 0) break; /* ACMD41 */
- 8001104: 2100 movs r1, #0
- 8001106: 2077 movs r0, #119 ; 0x77
- 8001108: f7ff ff0d bl 8000f26 <SD_SendCmd>
- 800110c: 4603 mov r3, r0
- 800110e: 2b01 cmp r3, #1
- 8001110: d80e bhi.n 8001130 <SD_disk_initialize+0x160>
- 8001112: 2100 movs r1, #0
- 8001114: 2069 movs r0, #105 ; 0x69
- 8001116: f7ff ff06 bl 8000f26 <SD_SendCmd>
- 800111a: 4603 mov r3, r0
- 800111c: 2b00 cmp r3, #0
- 800111e: d107 bne.n 8001130 <SD_disk_initialize+0x160>
- 8001120: e00c b.n 800113c <SD_disk_initialize+0x16c>
- }
- else
- {
- if (SD_SendCmd(CMD1, 0) == 0) break; /* CMD1 */
- 8001122: 2100 movs r1, #0
- 8001124: 2041 movs r0, #65 ; 0x41
- 8001126: f7ff fefe bl 8000f26 <SD_SendCmd>
- 800112a: 4603 mov r3, r0
- 800112c: 2b00 cmp r3, #0
- 800112e: d004 beq.n 800113a <SD_disk_initialize+0x16a>
- }
-
- } while (Timer1);
- 8001130: 4b18 ldr r3, [pc, #96] ; (8001194 <SD_disk_initialize+0x1c4>)
- 8001132: 881b ldrh r3, [r3, #0]
- 8001134: 2b00 cmp r3, #0
- 8001136: d1e2 bne.n 80010fe <SD_disk_initialize+0x12e>
- 8001138: e000 b.n 800113c <SD_disk_initialize+0x16c>
- if (SD_SendCmd(CMD1, 0) == 0) break; /* CMD1 */
- 800113a: bf00 nop
-
- /* SET_BLOCKLEN */
- if (!Timer1 || SD_SendCmd(CMD16, 512) != 0) type = 0;
- 800113c: 4b15 ldr r3, [pc, #84] ; (8001194 <SD_disk_initialize+0x1c4>)
- 800113e: 881b ldrh r3, [r3, #0]
- 8001140: 2b00 cmp r3, #0
- 8001142: d007 beq.n 8001154 <SD_disk_initialize+0x184>
- 8001144: f44f 7100 mov.w r1, #512 ; 0x200
- 8001148: 2050 movs r0, #80 ; 0x50
- 800114a: f7ff feec bl 8000f26 <SD_SendCmd>
- 800114e: 4603 mov r3, r0
- 8001150: 2b00 cmp r3, #0
- 8001152: d001 beq.n 8001158 <SD_disk_initialize+0x188>
- 8001154: 2300 movs r3, #0
- 8001156: 73bb strb r3, [r7, #14]
- }
- }
-
- CardType = type;
- 8001158: 4a0f ldr r2, [pc, #60] ; (8001198 <SD_disk_initialize+0x1c8>)
- 800115a: 7bbb ldrb r3, [r7, #14]
- 800115c: 7013 strb r3, [r2, #0]
-
- /* Idle */
- DESELECT();
- 800115e: f7ff fd93 bl 8000c88 <DESELECT>
- SPI_RxByte();
- 8001162: f7ff fdd3 bl 8000d0c <SPI_RxByte>
-
- /* Clear STA_NOINIT */
- if (type)
- 8001166: 7bbb ldrb r3, [r7, #14]
- 8001168: 2b00 cmp r3, #0
- 800116a: d008 beq.n 800117e <SD_disk_initialize+0x1ae>
- {
- Stat &= ~STA_NOINIT;
- 800116c: 4b08 ldr r3, [pc, #32] ; (8001190 <SD_disk_initialize+0x1c0>)
- 800116e: 781b ldrb r3, [r3, #0]
- 8001170: b2db uxtb r3, r3
- 8001172: f023 0301 bic.w r3, r3, #1
- 8001176: b2da uxtb r2, r3
- 8001178: 4b05 ldr r3, [pc, #20] ; (8001190 <SD_disk_initialize+0x1c0>)
- 800117a: 701a strb r2, [r3, #0]
- 800117c: e001 b.n 8001182 <SD_disk_initialize+0x1b2>
- }
- else
- {
- /* Initialization failed */
- SD_PowerOff();
- 800117e: f7ff fe4b bl 8000e18 <SD_PowerOff>
- }
-
- return Stat;
- 8001182: 4b03 ldr r3, [pc, #12] ; (8001190 <SD_disk_initialize+0x1c0>)
- 8001184: 781b ldrb r3, [r3, #0]
- 8001186: b2db uxtb r3, r3
- }
- 8001188: 4618 mov r0, r3
- 800118a: 3714 adds r7, #20
- 800118c: 46bd mov sp, r7
- 800118e: bd90 pop {r4, r7, pc}
- 8001190: 20000000 .word 0x20000000
- 8001194: 200002ea .word 0x200002ea
- 8001198: 200000a4 .word 0x200000a4
-
- 0800119c <SD_disk_status>:
-
- /* return disk status */
- DSTATUS SD_disk_status(BYTE drv)
- {
- 800119c: b480 push {r7}
- 800119e: b083 sub sp, #12
- 80011a0: af00 add r7, sp, #0
- 80011a2: 4603 mov r3, r0
- 80011a4: 71fb strb r3, [r7, #7]
- if (drv) return STA_NOINIT;
- 80011a6: 79fb ldrb r3, [r7, #7]
- 80011a8: 2b00 cmp r3, #0
- 80011aa: d001 beq.n 80011b0 <SD_disk_status+0x14>
- 80011ac: 2301 movs r3, #1
- 80011ae: e002 b.n 80011b6 <SD_disk_status+0x1a>
- return Stat;
- 80011b0: 4b03 ldr r3, [pc, #12] ; (80011c0 <SD_disk_status+0x24>)
- 80011b2: 781b ldrb r3, [r3, #0]
- 80011b4: b2db uxtb r3, r3
- }
- 80011b6: 4618 mov r0, r3
- 80011b8: 370c adds r7, #12
- 80011ba: 46bd mov sp, r7
- 80011bc: bc80 pop {r7}
- 80011be: 4770 bx lr
- 80011c0: 20000000 .word 0x20000000
-
- 080011c4 <SD_disk_read>:
-
- /* read sector */
- DRESULT SD_disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count)
- {
- 80011c4: b580 push {r7, lr}
- 80011c6: b084 sub sp, #16
- 80011c8: af00 add r7, sp, #0
- 80011ca: 60b9 str r1, [r7, #8]
- 80011cc: 607a str r2, [r7, #4]
- 80011ce: 603b str r3, [r7, #0]
- 80011d0: 4603 mov r3, r0
- 80011d2: 73fb strb r3, [r7, #15]
- /* pdrv should be 0 */
- if (pdrv || !count) return RES_PARERR;
- 80011d4: 7bfb ldrb r3, [r7, #15]
- 80011d6: 2b00 cmp r3, #0
- 80011d8: d102 bne.n 80011e0 <SD_disk_read+0x1c>
- 80011da: 683b ldr r3, [r7, #0]
- 80011dc: 2b00 cmp r3, #0
- 80011de: d101 bne.n 80011e4 <SD_disk_read+0x20>
- 80011e0: 2304 movs r3, #4
- 80011e2: e051 b.n 8001288 <SD_disk_read+0xc4>
-
- /* no disk */
- if (Stat & STA_NOINIT) return RES_NOTRDY;
- 80011e4: 4b2a ldr r3, [pc, #168] ; (8001290 <SD_disk_read+0xcc>)
- 80011e6: 781b ldrb r3, [r3, #0]
- 80011e8: b2db uxtb r3, r3
- 80011ea: f003 0301 and.w r3, r3, #1
- 80011ee: 2b00 cmp r3, #0
- 80011f0: d001 beq.n 80011f6 <SD_disk_read+0x32>
- 80011f2: 2303 movs r3, #3
- 80011f4: e048 b.n 8001288 <SD_disk_read+0xc4>
-
- /* convert to byte address */
- if (!(CardType & CT_SD2)) sector *= 512;
- 80011f6: 4b27 ldr r3, [pc, #156] ; (8001294 <SD_disk_read+0xd0>)
- 80011f8: 781b ldrb r3, [r3, #0]
- 80011fa: f003 0304 and.w r3, r3, #4
- 80011fe: 2b00 cmp r3, #0
- 8001200: d102 bne.n 8001208 <SD_disk_read+0x44>
- 8001202: 687b ldr r3, [r7, #4]
- 8001204: 025b lsls r3, r3, #9
- 8001206: 607b str r3, [r7, #4]
-
- SELECT();
- 8001208: f7ff fd30 bl 8000c6c <SELECT>
-
- if (count == 1)
- 800120c: 683b ldr r3, [r7, #0]
- 800120e: 2b01 cmp r3, #1
- 8001210: d111 bne.n 8001236 <SD_disk_read+0x72>
- {
- /* READ_SINGLE_BLOCK */
- if ((SD_SendCmd(CMD17, sector) == 0) && SD_RxDataBlock(buff, 512)) count = 0;
- 8001212: 6879 ldr r1, [r7, #4]
- 8001214: 2051 movs r0, #81 ; 0x51
- 8001216: f7ff fe86 bl 8000f26 <SD_SendCmd>
- 800121a: 4603 mov r3, r0
- 800121c: 2b00 cmp r3, #0
- 800121e: d129 bne.n 8001274 <SD_disk_read+0xb0>
- 8001220: f44f 7100 mov.w r1, #512 ; 0x200
- 8001224: 68b8 ldr r0, [r7, #8]
- 8001226: f7ff fe0d bl 8000e44 <SD_RxDataBlock>
- 800122a: 4603 mov r3, r0
- 800122c: 2b00 cmp r3, #0
- 800122e: d021 beq.n 8001274 <SD_disk_read+0xb0>
- 8001230: 2300 movs r3, #0
- 8001232: 603b str r3, [r7, #0]
- 8001234: e01e b.n 8001274 <SD_disk_read+0xb0>
- }
- else
- {
- /* READ_MULTIPLE_BLOCK */
- if (SD_SendCmd(CMD18, sector) == 0)
- 8001236: 6879 ldr r1, [r7, #4]
- 8001238: 2052 movs r0, #82 ; 0x52
- 800123a: f7ff fe74 bl 8000f26 <SD_SendCmd>
- 800123e: 4603 mov r3, r0
- 8001240: 2b00 cmp r3, #0
- 8001242: d117 bne.n 8001274 <SD_disk_read+0xb0>
- {
- do {
- if (!SD_RxDataBlock(buff, 512)) break;
- 8001244: f44f 7100 mov.w r1, #512 ; 0x200
- 8001248: 68b8 ldr r0, [r7, #8]
- 800124a: f7ff fdfb bl 8000e44 <SD_RxDataBlock>
- 800124e: 4603 mov r3, r0
- 8001250: 2b00 cmp r3, #0
- 8001252: d00a beq.n 800126a <SD_disk_read+0xa6>
- buff += 512;
- 8001254: 68bb ldr r3, [r7, #8]
- 8001256: f503 7300 add.w r3, r3, #512 ; 0x200
- 800125a: 60bb str r3, [r7, #8]
- } while (--count);
- 800125c: 683b ldr r3, [r7, #0]
- 800125e: 3b01 subs r3, #1
- 8001260: 603b str r3, [r7, #0]
- 8001262: 683b ldr r3, [r7, #0]
- 8001264: 2b00 cmp r3, #0
- 8001266: d1ed bne.n 8001244 <SD_disk_read+0x80>
- 8001268: e000 b.n 800126c <SD_disk_read+0xa8>
- if (!SD_RxDataBlock(buff, 512)) break;
- 800126a: bf00 nop
-
- /* STOP_TRANSMISSION */
- SD_SendCmd(CMD12, 0);
- 800126c: 2100 movs r1, #0
- 800126e: 204c movs r0, #76 ; 0x4c
- 8001270: f7ff fe59 bl 8000f26 <SD_SendCmd>
- }
- }
-
- /* Idle */
- DESELECT();
- 8001274: f7ff fd08 bl 8000c88 <DESELECT>
- SPI_RxByte();
- 8001278: f7ff fd48 bl 8000d0c <SPI_RxByte>
-
- return count ? RES_ERROR : RES_OK;
- 800127c: 683b ldr r3, [r7, #0]
- 800127e: 2b00 cmp r3, #0
- 8001280: bf14 ite ne
- 8001282: 2301 movne r3, #1
- 8001284: 2300 moveq r3, #0
- 8001286: b2db uxtb r3, r3
- }
- 8001288: 4618 mov r0, r3
- 800128a: 3710 adds r7, #16
- 800128c: 46bd mov sp, r7
- 800128e: bd80 pop {r7, pc}
- 8001290: 20000000 .word 0x20000000
- 8001294: 200000a4 .word 0x200000a4
-
- 08001298 <SD_disk_write>:
-
- /* write sector */
- #if _USE_WRITE == 1
- DRESULT SD_disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count)
- {
- 8001298: b580 push {r7, lr}
- 800129a: b084 sub sp, #16
- 800129c: af00 add r7, sp, #0
- 800129e: 60b9 str r1, [r7, #8]
- 80012a0: 607a str r2, [r7, #4]
- 80012a2: 603b str r3, [r7, #0]
- 80012a4: 4603 mov r3, r0
- 80012a6: 73fb strb r3, [r7, #15]
- /* pdrv should be 0 */
- if (pdrv || !count) return RES_PARERR;
- 80012a8: 7bfb ldrb r3, [r7, #15]
- 80012aa: 2b00 cmp r3, #0
- 80012ac: d102 bne.n 80012b4 <SD_disk_write+0x1c>
- 80012ae: 683b ldr r3, [r7, #0]
- 80012b0: 2b00 cmp r3, #0
- 80012b2: d101 bne.n 80012b8 <SD_disk_write+0x20>
- 80012b4: 2304 movs r3, #4
- 80012b6: e06b b.n 8001390 <SD_disk_write+0xf8>
-
- /* no disk */
- if (Stat & STA_NOINIT) return RES_NOTRDY;
- 80012b8: 4b37 ldr r3, [pc, #220] ; (8001398 <SD_disk_write+0x100>)
- 80012ba: 781b ldrb r3, [r3, #0]
- 80012bc: b2db uxtb r3, r3
- 80012be: f003 0301 and.w r3, r3, #1
- 80012c2: 2b00 cmp r3, #0
- 80012c4: d001 beq.n 80012ca <SD_disk_write+0x32>
- 80012c6: 2303 movs r3, #3
- 80012c8: e062 b.n 8001390 <SD_disk_write+0xf8>
-
- /* write protection */
- if (Stat & STA_PROTECT) return RES_WRPRT;
- 80012ca: 4b33 ldr r3, [pc, #204] ; (8001398 <SD_disk_write+0x100>)
- 80012cc: 781b ldrb r3, [r3, #0]
- 80012ce: b2db uxtb r3, r3
- 80012d0: f003 0304 and.w r3, r3, #4
- 80012d4: 2b00 cmp r3, #0
- 80012d6: d001 beq.n 80012dc <SD_disk_write+0x44>
- 80012d8: 2302 movs r3, #2
- 80012da: e059 b.n 8001390 <SD_disk_write+0xf8>
-
- /* convert to byte address */
- if (!(CardType & CT_SD2)) sector *= 512;
- 80012dc: 4b2f ldr r3, [pc, #188] ; (800139c <SD_disk_write+0x104>)
- 80012de: 781b ldrb r3, [r3, #0]
- 80012e0: f003 0304 and.w r3, r3, #4
- 80012e4: 2b00 cmp r3, #0
- 80012e6: d102 bne.n 80012ee <SD_disk_write+0x56>
- 80012e8: 687b ldr r3, [r7, #4]
- 80012ea: 025b lsls r3, r3, #9
- 80012ec: 607b str r3, [r7, #4]
-
- SELECT();
- 80012ee: f7ff fcbd bl 8000c6c <SELECT>
-
- if (count == 1)
- 80012f2: 683b ldr r3, [r7, #0]
- 80012f4: 2b01 cmp r3, #1
- 80012f6: d110 bne.n 800131a <SD_disk_write+0x82>
- {
- /* WRITE_BLOCK */
- if ((SD_SendCmd(CMD24, sector) == 0) && SD_TxDataBlock(buff, 0xFE))
- 80012f8: 6879 ldr r1, [r7, #4]
- 80012fa: 2058 movs r0, #88 ; 0x58
- 80012fc: f7ff fe13 bl 8000f26 <SD_SendCmd>
- 8001300: 4603 mov r3, r0
- 8001302: 2b00 cmp r3, #0
- 8001304: d13a bne.n 800137c <SD_disk_write+0xe4>
- 8001306: 21fe movs r1, #254 ; 0xfe
- 8001308: 68b8 ldr r0, [r7, #8]
- 800130a: f7ff fdc9 bl 8000ea0 <SD_TxDataBlock>
- 800130e: 4603 mov r3, r0
- 8001310: 2b00 cmp r3, #0
- 8001312: d033 beq.n 800137c <SD_disk_write+0xe4>
- count = 0;
- 8001314: 2300 movs r3, #0
- 8001316: 603b str r3, [r7, #0]
- 8001318: e030 b.n 800137c <SD_disk_write+0xe4>
- }
- else
- {
- /* WRITE_MULTIPLE_BLOCK */
- if (CardType & CT_SD1)
- 800131a: 4b20 ldr r3, [pc, #128] ; (800139c <SD_disk_write+0x104>)
- 800131c: 781b ldrb r3, [r3, #0]
- 800131e: f003 0302 and.w r3, r3, #2
- 8001322: 2b00 cmp r3, #0
- 8001324: d007 beq.n 8001336 <SD_disk_write+0x9e>
- {
- SD_SendCmd(CMD55, 0);
- 8001326: 2100 movs r1, #0
- 8001328: 2077 movs r0, #119 ; 0x77
- 800132a: f7ff fdfc bl 8000f26 <SD_SendCmd>
- SD_SendCmd(CMD23, count); /* ACMD23 */
- 800132e: 6839 ldr r1, [r7, #0]
- 8001330: 2057 movs r0, #87 ; 0x57
- 8001332: f7ff fdf8 bl 8000f26 <SD_SendCmd>
- }
-
- if (SD_SendCmd(CMD25, sector) == 0)
- 8001336: 6879 ldr r1, [r7, #4]
- 8001338: 2059 movs r0, #89 ; 0x59
- 800133a: f7ff fdf4 bl 8000f26 <SD_SendCmd>
- 800133e: 4603 mov r3, r0
- 8001340: 2b00 cmp r3, #0
- 8001342: d11b bne.n 800137c <SD_disk_write+0xe4>
- {
- do {
- if(!SD_TxDataBlock(buff, 0xFC)) break;
- 8001344: 21fc movs r1, #252 ; 0xfc
- 8001346: 68b8 ldr r0, [r7, #8]
- 8001348: f7ff fdaa bl 8000ea0 <SD_TxDataBlock>
- 800134c: 4603 mov r3, r0
- 800134e: 2b00 cmp r3, #0
- 8001350: d00a beq.n 8001368 <SD_disk_write+0xd0>
- buff += 512;
- 8001352: 68bb ldr r3, [r7, #8]
- 8001354: f503 7300 add.w r3, r3, #512 ; 0x200
- 8001358: 60bb str r3, [r7, #8]
- } while (--count);
- 800135a: 683b ldr r3, [r7, #0]
- 800135c: 3b01 subs r3, #1
- 800135e: 603b str r3, [r7, #0]
- 8001360: 683b ldr r3, [r7, #0]
- 8001362: 2b00 cmp r3, #0
- 8001364: d1ee bne.n 8001344 <SD_disk_write+0xac>
- 8001366: e000 b.n 800136a <SD_disk_write+0xd2>
- if(!SD_TxDataBlock(buff, 0xFC)) break;
- 8001368: bf00 nop
-
- /* STOP_TRAN token */
- if(!SD_TxDataBlock(0, 0xFD))
- 800136a: 21fd movs r1, #253 ; 0xfd
- 800136c: 2000 movs r0, #0
- 800136e: f7ff fd97 bl 8000ea0 <SD_TxDataBlock>
- 8001372: 4603 mov r3, r0
- 8001374: 2b00 cmp r3, #0
- 8001376: d101 bne.n 800137c <SD_disk_write+0xe4>
- {
- count = 1;
- 8001378: 2301 movs r3, #1
- 800137a: 603b str r3, [r7, #0]
- }
- }
- }
-
- /* Idle */
- DESELECT();
- 800137c: f7ff fc84 bl 8000c88 <DESELECT>
- SPI_RxByte();
- 8001380: f7ff fcc4 bl 8000d0c <SPI_RxByte>
-
- return count ? RES_ERROR : RES_OK;
- 8001384: 683b ldr r3, [r7, #0]
- 8001386: 2b00 cmp r3, #0
- 8001388: bf14 ite ne
- 800138a: 2301 movne r3, #1
- 800138c: 2300 moveq r3, #0
- 800138e: b2db uxtb r3, r3
- }
- 8001390: 4618 mov r0, r3
- 8001392: 3710 adds r7, #16
- 8001394: 46bd mov sp, r7
- 8001396: bd80 pop {r7, pc}
- 8001398: 20000000 .word 0x20000000
- 800139c: 200000a4 .word 0x200000a4
-
- 080013a0 <SD_disk_ioctl>:
- #endif /* _USE_WRITE */
-
- /* ioctl */
- DRESULT SD_disk_ioctl(BYTE drv, BYTE ctrl, void *buff)
- {
- 80013a0: b590 push {r4, r7, lr}
- 80013a2: b08b sub sp, #44 ; 0x2c
- 80013a4: af00 add r7, sp, #0
- 80013a6: 4603 mov r3, r0
- 80013a8: 603a str r2, [r7, #0]
- 80013aa: 71fb strb r3, [r7, #7]
- 80013ac: 460b mov r3, r1
- 80013ae: 71bb strb r3, [r7, #6]
- DRESULT res;
- uint8_t n, csd[16], *ptr = buff;
- 80013b0: 683b ldr r3, [r7, #0]
- 80013b2: 623b str r3, [r7, #32]
- WORD csize;
-
- /* pdrv should be 0 */
- if (drv) return RES_PARERR;
- 80013b4: 79fb ldrb r3, [r7, #7]
- 80013b6: 2b00 cmp r3, #0
- 80013b8: d001 beq.n 80013be <SD_disk_ioctl+0x1e>
- 80013ba: 2304 movs r3, #4
- 80013bc: e113 b.n 80015e6 <SD_disk_ioctl+0x246>
- res = RES_ERROR;
- 80013be: 2301 movs r3, #1
- 80013c0: f887 3027 strb.w r3, [r7, #39] ; 0x27
-
- if (ctrl == CTRL_POWER)
- 80013c4: 79bb ldrb r3, [r7, #6]
- 80013c6: 2b05 cmp r3, #5
- 80013c8: d121 bne.n 800140e <SD_disk_ioctl+0x6e>
- {
- switch (*ptr)
- 80013ca: 6a3b ldr r3, [r7, #32]
- 80013cc: 781b ldrb r3, [r3, #0]
- 80013ce: 2b01 cmp r3, #1
- 80013d0: d009 beq.n 80013e6 <SD_disk_ioctl+0x46>
- 80013d2: 2b02 cmp r3, #2
- 80013d4: d00d beq.n 80013f2 <SD_disk_ioctl+0x52>
- 80013d6: 2b00 cmp r3, #0
- 80013d8: d115 bne.n 8001406 <SD_disk_ioctl+0x66>
- {
- case 0:
- SD_PowerOff(); /* Power Off */
- 80013da: f7ff fd1d bl 8000e18 <SD_PowerOff>
- res = RES_OK;
- 80013de: 2300 movs r3, #0
- 80013e0: f887 3027 strb.w r3, [r7, #39] ; 0x27
- break;
- 80013e4: e0fd b.n 80015e2 <SD_disk_ioctl+0x242>
- case 1:
- SD_PowerOn(); /* Power On */
- 80013e6: f7ff fcd5 bl 8000d94 <SD_PowerOn>
- res = RES_OK;
- 80013ea: 2300 movs r3, #0
- 80013ec: f887 3027 strb.w r3, [r7, #39] ; 0x27
- break;
- 80013f0: e0f7 b.n 80015e2 <SD_disk_ioctl+0x242>
- case 2:
- *(ptr + 1) = SD_CheckPower();
- 80013f2: 6a3b ldr r3, [r7, #32]
- 80013f4: 1c5c adds r4, r3, #1
- 80013f6: f7ff fd1b bl 8000e30 <SD_CheckPower>
- 80013fa: 4603 mov r3, r0
- 80013fc: 7023 strb r3, [r4, #0]
- res = RES_OK; /* Power Check */
- 80013fe: 2300 movs r3, #0
- 8001400: f887 3027 strb.w r3, [r7, #39] ; 0x27
- break;
- 8001404: e0ed b.n 80015e2 <SD_disk_ioctl+0x242>
- default:
- res = RES_PARERR;
- 8001406: 2304 movs r3, #4
- 8001408: f887 3027 strb.w r3, [r7, #39] ; 0x27
- 800140c: e0e9 b.n 80015e2 <SD_disk_ioctl+0x242>
- }
- }
- else
- {
- /* no disk */
- if (Stat & STA_NOINIT) return RES_NOTRDY;
- 800140e: 4b78 ldr r3, [pc, #480] ; (80015f0 <SD_disk_ioctl+0x250>)
- 8001410: 781b ldrb r3, [r3, #0]
- 8001412: b2db uxtb r3, r3
- 8001414: f003 0301 and.w r3, r3, #1
- 8001418: 2b00 cmp r3, #0
- 800141a: d001 beq.n 8001420 <SD_disk_ioctl+0x80>
- 800141c: 2303 movs r3, #3
- 800141e: e0e2 b.n 80015e6 <SD_disk_ioctl+0x246>
-
- SELECT();
- 8001420: f7ff fc24 bl 8000c6c <SELECT>
-
- switch (ctrl)
- 8001424: 79bb ldrb r3, [r7, #6]
- 8001426: 2b0d cmp r3, #13
- 8001428: f200 80cc bhi.w 80015c4 <SD_disk_ioctl+0x224>
- 800142c: a201 add r2, pc, #4 ; (adr r2, 8001434 <SD_disk_ioctl+0x94>)
- 800142e: f852 f023 ldr.w pc, [r2, r3, lsl #2]
- 8001432: bf00 nop
- 8001434: 0800152f .word 0x0800152f
- 8001438: 0800146d .word 0x0800146d
- 800143c: 0800151f .word 0x0800151f
- 8001440: 080015c5 .word 0x080015c5
- 8001444: 080015c5 .word 0x080015c5
- 8001448: 080015c5 .word 0x080015c5
- 800144c: 080015c5 .word 0x080015c5
- 8001450: 080015c5 .word 0x080015c5
- 8001454: 080015c5 .word 0x080015c5
- 8001458: 080015c5 .word 0x080015c5
- 800145c: 080015c5 .word 0x080015c5
- 8001460: 08001541 .word 0x08001541
- 8001464: 08001565 .word 0x08001565
- 8001468: 08001589 .word 0x08001589
- {
- case GET_SECTOR_COUNT:
- /* SEND_CSD */
- if ((SD_SendCmd(CMD9, 0) == 0) && SD_RxDataBlock(csd, 16))
- 800146c: 2100 movs r1, #0
- 800146e: 2049 movs r0, #73 ; 0x49
- 8001470: f7ff fd59 bl 8000f26 <SD_SendCmd>
- 8001474: 4603 mov r3, r0
- 8001476: 2b00 cmp r3, #0
- 8001478: f040 80a8 bne.w 80015cc <SD_disk_ioctl+0x22c>
- 800147c: f107 030c add.w r3, r7, #12
- 8001480: 2110 movs r1, #16
- 8001482: 4618 mov r0, r3
- 8001484: f7ff fcde bl 8000e44 <SD_RxDataBlock>
- 8001488: 4603 mov r3, r0
- 800148a: 2b00 cmp r3, #0
- 800148c: f000 809e beq.w 80015cc <SD_disk_ioctl+0x22c>
- {
- if ((csd[0] >> 6) == 1)
- 8001490: 7b3b ldrb r3, [r7, #12]
- 8001492: 099b lsrs r3, r3, #6
- 8001494: b2db uxtb r3, r3
- 8001496: 2b01 cmp r3, #1
- 8001498: d10e bne.n 80014b8 <SD_disk_ioctl+0x118>
- {
- /* SDC V2 */
- csize = csd[9] + ((WORD) csd[8] << 8) + 1;
- 800149a: 7d7b ldrb r3, [r7, #21]
- 800149c: b29a uxth r2, r3
- 800149e: 7d3b ldrb r3, [r7, #20]
- 80014a0: b29b uxth r3, r3
- 80014a2: 021b lsls r3, r3, #8
- 80014a4: b29b uxth r3, r3
- 80014a6: 4413 add r3, r2
- 80014a8: b29b uxth r3, r3
- 80014aa: 3301 adds r3, #1
- 80014ac: 83fb strh r3, [r7, #30]
- *(DWORD*) buff = (DWORD) csize << 10;
- 80014ae: 8bfb ldrh r3, [r7, #30]
- 80014b0: 029a lsls r2, r3, #10
- 80014b2: 683b ldr r3, [r7, #0]
- 80014b4: 601a str r2, [r3, #0]
- 80014b6: e02e b.n 8001516 <SD_disk_ioctl+0x176>
- }
- else
- {
- /* MMC or SDC V1 */
- n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2;
- 80014b8: 7c7b ldrb r3, [r7, #17]
- 80014ba: f003 030f and.w r3, r3, #15
- 80014be: b2da uxtb r2, r3
- 80014c0: 7dbb ldrb r3, [r7, #22]
- 80014c2: 09db lsrs r3, r3, #7
- 80014c4: b2db uxtb r3, r3
- 80014c6: 4413 add r3, r2
- 80014c8: b2da uxtb r2, r3
- 80014ca: 7d7b ldrb r3, [r7, #21]
- 80014cc: 005b lsls r3, r3, #1
- 80014ce: b2db uxtb r3, r3
- 80014d0: f003 0306 and.w r3, r3, #6
- 80014d4: b2db uxtb r3, r3
- 80014d6: 4413 add r3, r2
- 80014d8: b2db uxtb r3, r3
- 80014da: 3302 adds r3, #2
- 80014dc: f887 3026 strb.w r3, [r7, #38] ; 0x26
- csize = (csd[8] >> 6) + ((WORD) csd[7] << 2) + ((WORD) (csd[6] & 3) << 10) + 1;
- 80014e0: 7d3b ldrb r3, [r7, #20]
- 80014e2: 099b lsrs r3, r3, #6
- 80014e4: b2db uxtb r3, r3
- 80014e6: b29a uxth r2, r3
- 80014e8: 7cfb ldrb r3, [r7, #19]
- 80014ea: b29b uxth r3, r3
- 80014ec: 009b lsls r3, r3, #2
- 80014ee: b29b uxth r3, r3
- 80014f0: 4413 add r3, r2
- 80014f2: b29a uxth r2, r3
- 80014f4: 7cbb ldrb r3, [r7, #18]
- 80014f6: 029b lsls r3, r3, #10
- 80014f8: b29b uxth r3, r3
- 80014fa: f403 6340 and.w r3, r3, #3072 ; 0xc00
- 80014fe: b29b uxth r3, r3
- 8001500: 4413 add r3, r2
- 8001502: b29b uxth r3, r3
- 8001504: 3301 adds r3, #1
- 8001506: 83fb strh r3, [r7, #30]
- *(DWORD*) buff = (DWORD) csize << (n - 9);
- 8001508: 8bfa ldrh r2, [r7, #30]
- 800150a: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 800150e: 3b09 subs r3, #9
- 8001510: 409a lsls r2, r3
- 8001512: 683b ldr r3, [r7, #0]
- 8001514: 601a str r2, [r3, #0]
- }
- res = RES_OK;
- 8001516: 2300 movs r3, #0
- 8001518: f887 3027 strb.w r3, [r7, #39] ; 0x27
- }
- break;
- 800151c: e056 b.n 80015cc <SD_disk_ioctl+0x22c>
- case GET_SECTOR_SIZE:
- *(WORD*) buff = 512;
- 800151e: 683b ldr r3, [r7, #0]
- 8001520: f44f 7200 mov.w r2, #512 ; 0x200
- 8001524: 801a strh r2, [r3, #0]
- res = RES_OK;
- 8001526: 2300 movs r3, #0
- 8001528: f887 3027 strb.w r3, [r7, #39] ; 0x27
- break;
- 800152c: e055 b.n 80015da <SD_disk_ioctl+0x23a>
- case CTRL_SYNC:
- if (SD_ReadyWait() == 0xFF) res = RES_OK;
- 800152e: f7ff fc17 bl 8000d60 <SD_ReadyWait>
- 8001532: 4603 mov r3, r0
- 8001534: 2bff cmp r3, #255 ; 0xff
- 8001536: d14b bne.n 80015d0 <SD_disk_ioctl+0x230>
- 8001538: 2300 movs r3, #0
- 800153a: f887 3027 strb.w r3, [r7, #39] ; 0x27
- break;
- 800153e: e047 b.n 80015d0 <SD_disk_ioctl+0x230>
- case MMC_GET_CSD:
- /* SEND_CSD */
- if (SD_SendCmd(CMD9, 0) == 0 && SD_RxDataBlock(ptr, 16)) res = RES_OK;
- 8001540: 2100 movs r1, #0
- 8001542: 2049 movs r0, #73 ; 0x49
- 8001544: f7ff fcef bl 8000f26 <SD_SendCmd>
- 8001548: 4603 mov r3, r0
- 800154a: 2b00 cmp r3, #0
- 800154c: d142 bne.n 80015d4 <SD_disk_ioctl+0x234>
- 800154e: 2110 movs r1, #16
- 8001550: 6a38 ldr r0, [r7, #32]
- 8001552: f7ff fc77 bl 8000e44 <SD_RxDataBlock>
- 8001556: 4603 mov r3, r0
- 8001558: 2b00 cmp r3, #0
- 800155a: d03b beq.n 80015d4 <SD_disk_ioctl+0x234>
- 800155c: 2300 movs r3, #0
- 800155e: f887 3027 strb.w r3, [r7, #39] ; 0x27
- break;
- 8001562: e037 b.n 80015d4 <SD_disk_ioctl+0x234>
- case MMC_GET_CID:
- /* SEND_CID */
- if (SD_SendCmd(CMD10, 0) == 0 && SD_RxDataBlock(ptr, 16)) res = RES_OK;
- 8001564: 2100 movs r1, #0
- 8001566: 204a movs r0, #74 ; 0x4a
- 8001568: f7ff fcdd bl 8000f26 <SD_SendCmd>
- 800156c: 4603 mov r3, r0
- 800156e: 2b00 cmp r3, #0
- 8001570: d132 bne.n 80015d8 <SD_disk_ioctl+0x238>
- 8001572: 2110 movs r1, #16
- 8001574: 6a38 ldr r0, [r7, #32]
- 8001576: f7ff fc65 bl 8000e44 <SD_RxDataBlock>
- 800157a: 4603 mov r3, r0
- 800157c: 2b00 cmp r3, #0
- 800157e: d02b beq.n 80015d8 <SD_disk_ioctl+0x238>
- 8001580: 2300 movs r3, #0
- 8001582: f887 3027 strb.w r3, [r7, #39] ; 0x27
- break;
- 8001586: e027 b.n 80015d8 <SD_disk_ioctl+0x238>
- case MMC_GET_OCR:
- /* READ_OCR */
- if (SD_SendCmd(CMD58, 0) == 0)
- 8001588: 2100 movs r1, #0
- 800158a: 207a movs r0, #122 ; 0x7a
- 800158c: f7ff fccb bl 8000f26 <SD_SendCmd>
- 8001590: 4603 mov r3, r0
- 8001592: 2b00 cmp r3, #0
- 8001594: d116 bne.n 80015c4 <SD_disk_ioctl+0x224>
- {
- for (n = 0; n < 4; n++)
- 8001596: 2300 movs r3, #0
- 8001598: f887 3026 strb.w r3, [r7, #38] ; 0x26
- 800159c: e00b b.n 80015b6 <SD_disk_ioctl+0x216>
- {
- *ptr++ = SPI_RxByte();
- 800159e: 6a3c ldr r4, [r7, #32]
- 80015a0: 1c63 adds r3, r4, #1
- 80015a2: 623b str r3, [r7, #32]
- 80015a4: f7ff fbb2 bl 8000d0c <SPI_RxByte>
- 80015a8: 4603 mov r3, r0
- 80015aa: 7023 strb r3, [r4, #0]
- for (n = 0; n < 4; n++)
- 80015ac: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 80015b0: 3301 adds r3, #1
- 80015b2: f887 3026 strb.w r3, [r7, #38] ; 0x26
- 80015b6: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 80015ba: 2b03 cmp r3, #3
- 80015bc: d9ef bls.n 800159e <SD_disk_ioctl+0x1fe>
- }
- res = RES_OK;
- 80015be: 2300 movs r3, #0
- 80015c0: f887 3027 strb.w r3, [r7, #39] ; 0x27
- }
- default:
- res = RES_PARERR;
- 80015c4: 2304 movs r3, #4
- 80015c6: f887 3027 strb.w r3, [r7, #39] ; 0x27
- 80015ca: e006 b.n 80015da <SD_disk_ioctl+0x23a>
- break;
- 80015cc: bf00 nop
- 80015ce: e004 b.n 80015da <SD_disk_ioctl+0x23a>
- break;
- 80015d0: bf00 nop
- 80015d2: e002 b.n 80015da <SD_disk_ioctl+0x23a>
- break;
- 80015d4: bf00 nop
- 80015d6: e000 b.n 80015da <SD_disk_ioctl+0x23a>
- break;
- 80015d8: bf00 nop
- }
-
- DESELECT();
- 80015da: f7ff fb55 bl 8000c88 <DESELECT>
- SPI_RxByte();
- 80015de: f7ff fb95 bl 8000d0c <SPI_RxByte>
- }
-
- return res;
- 80015e2: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- }
- 80015e6: 4618 mov r0, r3
- 80015e8: 372c adds r7, #44 ; 0x2c
- 80015ea: 46bd mov sp, r7
- 80015ec: bd90 pop {r4, r7, pc}
- 80015ee: bf00 nop
- 80015f0: 20000000 .word 0x20000000
-
- 080015f4 <transmit_uart>:
-
- /* Private user code ---------------------------------------------------------*/
- /* USER CODE BEGIN 0 */
-
- // sending to UART
- void transmit_uart(char *string){
- 80015f4: b580 push {r7, lr}
- 80015f6: b084 sub sp, #16
- 80015f8: af00 add r7, sp, #0
- 80015fa: 6078 str r0, [r7, #4]
- uint8_t len = strlen(string);
- 80015fc: 6878 ldr r0, [r7, #4]
- 80015fe: f7fe fdbd bl 800017c <strlen>
- 8001602: 4603 mov r3, r0
- 8001604: 73fb strb r3, [r7, #15]
- HAL_UART_Transmit(&huart2, (uint8_t*) string, len, 200);
- 8001606: 7bfb ldrb r3, [r7, #15]
- 8001608: b29a uxth r2, r3
- 800160a: 23c8 movs r3, #200 ; 0xc8
- 800160c: 6879 ldr r1, [r7, #4]
- 800160e: 4803 ldr r0, [pc, #12] ; (800161c <transmit_uart+0x28>)
- 8001610: f002 f929 bl 8003866 <HAL_UART_Transmit>
- }
- 8001614: bf00 nop
- 8001616: 3710 adds r7, #16
- 8001618: 46bd mov sp, r7
- 800161a: bd80 pop {r7, pc}
- 800161c: 200013f0 .word 0x200013f0
-
- 08001620 <main>:
- /**
- * @brief The application entry point.
- * @retval int
- */
- int main(void)
- {
- 8001620: b590 push {r4, r7, lr}
- 8001622: b09d sub sp, #116 ; 0x74
- 8001624: af00 add r7, sp, #0
- /* USER CODE END 1 */
-
- /* MCU Configuration--------------------------------------------------------*/
-
- /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
- HAL_Init();
- 8001626: f000 fbb8 bl 8001d9a <HAL_Init>
- /* USER CODE BEGIN Init */
-
- /* USER CODE END Init */
-
- /* Configure the system clock */
- SystemClock_Config();
- 800162a: f000 f937 bl 800189c <SystemClock_Config>
- /* USER CODE BEGIN SysInit */
-
- /* USER CODE END SysInit */
-
- /* Initialize all configured peripherals */
- MX_GPIO_Init();
- 800162e: f000 f9e3 bl 80019f8 <MX_GPIO_Init>
- MX_USART2_UART_Init();
- 8001632: f000 f9b7 bl 80019a4 <MX_USART2_UART_Init>
- MX_SPI1_Init();
- 8001636: f000 f97f bl 8001938 <MX_SPI1_Init>
- MX_FATFS_Init();
- 800163a: f002 fadb bl 8003bf4 <MX_FATFS_Init>
- /* USER CODE BEGIN 2 */
-
- /* Waiting for the Micro SD module to initialize */
- HAL_Delay(500);
- 800163e: f44f 70fa mov.w r0, #500 ; 0x1f4
- 8001642: f000 fc19 bl 8001e78 <HAL_Delay>
-
- fres = f_mount(&fs, "", 0);
- 8001646: 2200 movs r2, #0
- 8001648: 497c ldr r1, [pc, #496] ; (800183c <main+0x21c>)
- 800164a: 487d ldr r0, [pc, #500] ; (8001840 <main+0x220>)
- 800164c: f004 fd00 bl 8006050 <f_mount>
- 8001650: 4603 mov r3, r0
- 8001652: 461a mov r2, r3
- 8001654: 4b7b ldr r3, [pc, #492] ; (8001844 <main+0x224>)
- 8001656: 701a strb r2, [r3, #0]
- if (fres == FR_OK) {
- 8001658: 4b7a ldr r3, [pc, #488] ; (8001844 <main+0x224>)
- 800165a: 781b ldrb r3, [r3, #0]
- 800165c: 2b00 cmp r3, #0
- 800165e: d103 bne.n 8001668 <main+0x48>
- transmit_uart("SD card is mounted successfully!\r\n");
- 8001660: 4879 ldr r0, [pc, #484] ; (8001848 <main+0x228>)
- 8001662: f7ff ffc7 bl 80015f4 <transmit_uart>
- 8001666: e006 b.n 8001676 <main+0x56>
- } else if (fres != FR_OK) {
- 8001668: 4b76 ldr r3, [pc, #472] ; (8001844 <main+0x224>)
- 800166a: 781b ldrb r3, [r3, #0]
- 800166c: 2b00 cmp r3, #0
- 800166e: d002 beq.n 8001676 <main+0x56>
- transmit_uart("SD card is not mounted!\r\n");
- 8001670: 4876 ldr r0, [pc, #472] ; (800184c <main+0x22c>)
- 8001672: f7ff ffbf bl 80015f4 <transmit_uart>
- }
-
- // FA_OPEN_APPEND opens file if it exists and if not then creates it,
- // the pointer is set at the end of the file for appending
- fres = f_open(&fil, "log-file.txt", FA_OPEN_APPEND | FA_WRITE | FA_READ);
- 8001676: 2233 movs r2, #51 ; 0x33
- 8001678: 4975 ldr r1, [pc, #468] ; (8001850 <main+0x230>)
- 800167a: 4876 ldr r0, [pc, #472] ; (8001854 <main+0x234>)
- 800167c: f004 fd2e bl 80060dc <f_open>
- 8001680: 4603 mov r3, r0
- 8001682: 461a mov r2, r3
- 8001684: 4b6f ldr r3, [pc, #444] ; (8001844 <main+0x224>)
- 8001686: 701a strb r2, [r3, #0]
- if (fres == FR_OK) {
- 8001688: 4b6e ldr r3, [pc, #440] ; (8001844 <main+0x224>)
- 800168a: 781b ldrb r3, [r3, #0]
- 800168c: 2b00 cmp r3, #0
- 800168e: d103 bne.n 8001698 <main+0x78>
- transmit_uart("File opened.\r\n");
- 8001690: 4871 ldr r0, [pc, #452] ; (8001858 <main+0x238>)
- 8001692: f7ff ffaf bl 80015f4 <transmit_uart>
- 8001696: e006 b.n 80016a6 <main+0x86>
- } else if (fres != FR_OK) {
- 8001698: 4b6a ldr r3, [pc, #424] ; (8001844 <main+0x224>)
- 800169a: 781b ldrb r3, [r3, #0]
- 800169c: 2b00 cmp r3, #0
- 800169e: d002 beq.n 80016a6 <main+0x86>
- transmit_uart("File was not opened!\r\n");
- 80016a0: 486e ldr r0, [pc, #440] ; (800185c <main+0x23c>)
- 80016a2: f7ff ffa7 bl 80015f4 <transmit_uart>
- }
-
- fres = f_getfree("", &fre_clust, &pfs);
- 80016a6: 4a6e ldr r2, [pc, #440] ; (8001860 <main+0x240>)
- 80016a8: 496e ldr r1, [pc, #440] ; (8001864 <main+0x244>)
- 80016aa: 4864 ldr r0, [pc, #400] ; (800183c <main+0x21c>)
- 80016ac: f005 fa7d bl 8006baa <f_getfree>
- 80016b0: 4603 mov r3, r0
- 80016b2: 461a mov r2, r3
- 80016b4: 4b63 ldr r3, [pc, #396] ; (8001844 <main+0x224>)
- 80016b6: 701a strb r2, [r3, #0]
- totalSpace = (uint32_t) ((pfs->n_fatent - 2) * pfs->csize * 0.5);
- 80016b8: 4b69 ldr r3, [pc, #420] ; (8001860 <main+0x240>)
- 80016ba: 681b ldr r3, [r3, #0]
- 80016bc: 69db ldr r3, [r3, #28]
- 80016be: 3b02 subs r3, #2
- 80016c0: 4a67 ldr r2, [pc, #412] ; (8001860 <main+0x240>)
- 80016c2: 6812 ldr r2, [r2, #0]
- 80016c4: 8952 ldrh r2, [r2, #10]
- 80016c6: fb02 f303 mul.w r3, r2, r3
- 80016ca: 4618 mov r0, r3
- 80016cc: f7fe fea0 bl 8000410 <__aeabi_ui2d>
- 80016d0: f04f 0200 mov.w r2, #0
- 80016d4: 4b64 ldr r3, [pc, #400] ; (8001868 <main+0x248>)
- 80016d6: f7fe ff15 bl 8000504 <__aeabi_dmul>
- 80016da: 4603 mov r3, r0
- 80016dc: 460c mov r4, r1
- 80016de: 4618 mov r0, r3
- 80016e0: 4621 mov r1, r4
- 80016e2: f7ff f921 bl 8000928 <__aeabi_d2uiz>
- 80016e6: 4602 mov r2, r0
- 80016e8: 4b60 ldr r3, [pc, #384] ; (800186c <main+0x24c>)
- 80016ea: 601a str r2, [r3, #0]
- freeSpace = (uint32_t) (fre_clust * pfs->csize * 0.5);
- 80016ec: 4b5c ldr r3, [pc, #368] ; (8001860 <main+0x240>)
- 80016ee: 681b ldr r3, [r3, #0]
- 80016f0: 895b ldrh r3, [r3, #10]
- 80016f2: 461a mov r2, r3
- 80016f4: 4b5b ldr r3, [pc, #364] ; (8001864 <main+0x244>)
- 80016f6: 681b ldr r3, [r3, #0]
- 80016f8: fb03 f302 mul.w r3, r3, r2
- 80016fc: 4618 mov r0, r3
- 80016fe: f7fe fe87 bl 8000410 <__aeabi_ui2d>
- 8001702: f04f 0200 mov.w r2, #0
- 8001706: 4b58 ldr r3, [pc, #352] ; (8001868 <main+0x248>)
- 8001708: f7fe fefc bl 8000504 <__aeabi_dmul>
- 800170c: 4603 mov r3, r0
- 800170e: 460c mov r4, r1
- 8001710: 4618 mov r0, r3
- 8001712: 4621 mov r1, r4
- 8001714: f7ff f908 bl 8000928 <__aeabi_d2uiz>
- 8001718: 4602 mov r2, r0
- 800171a: 4b55 ldr r3, [pc, #340] ; (8001870 <main+0x250>)
- 800171c: 601a str r2, [r3, #0]
- char mSz[12];
- sprintf(mSz, "%lu", freeSpace);
- 800171e: 4b54 ldr r3, [pc, #336] ; (8001870 <main+0x250>)
- 8001720: 681a ldr r2, [r3, #0]
- 8001722: f107 0364 add.w r3, r7, #100 ; 0x64
- 8001726: 4953 ldr r1, [pc, #332] ; (8001874 <main+0x254>)
- 8001728: 4618 mov r0, r3
- 800172a: f005 fd19 bl 8007160 <siprintf>
- if (fres == FR_OK) {
- 800172e: 4b45 ldr r3, [pc, #276] ; (8001844 <main+0x224>)
- 8001730: 781b ldrb r3, [r3, #0]
- 8001732: 2b00 cmp r3, #0
- 8001734: d10b bne.n 800174e <main+0x12e>
- transmit_uart("Free space: \r");
- 8001736: 4850 ldr r0, [pc, #320] ; (8001878 <main+0x258>)
- 8001738: f7ff ff5c bl 80015f4 <transmit_uart>
- transmit_uart(mSz);
- 800173c: f107 0364 add.w r3, r7, #100 ; 0x64
- 8001740: 4618 mov r0, r3
- 8001742: f7ff ff57 bl 80015f4 <transmit_uart>
- transmit_uart("\r\n");
- 8001746: 484d ldr r0, [pc, #308] ; (800187c <main+0x25c>)
- 8001748: f7ff ff54 bl 80015f4 <transmit_uart>
- 800174c: e006 b.n 800175c <main+0x13c>
- } else if (fres != FR_OK) {
- 800174e: 4b3d ldr r3, [pc, #244] ; (8001844 <main+0x224>)
- 8001750: 781b ldrb r3, [r3, #0]
- 8001752: 2b00 cmp r3, #0
- 8001754: d002 beq.n 800175c <main+0x13c>
- transmit_uart("Free space could not be determined!\r\n");
- 8001756: 484a ldr r0, [pc, #296] ; (8001880 <main+0x260>)
- 8001758: f7ff ff4c bl 80015f4 <transmit_uart>
- }
-
-
- f_puts("Example Text\n", &fil);
- 800175c: 493d ldr r1, [pc, #244] ; (8001854 <main+0x234>)
- 800175e: 4849 ldr r0, [pc, #292] ; (8001884 <main+0x264>)
- 8001760: f005 fb8c bl 8006e7c <f_puts>
-
-
- fres = f_close(&fil);
- 8001764: 483b ldr r0, [pc, #236] ; (8001854 <main+0x234>)
- 8001766: f005 f9f6 bl 8006b56 <f_close>
- 800176a: 4603 mov r3, r0
- 800176c: 461a mov r2, r3
- 800176e: 4b35 ldr r3, [pc, #212] ; (8001844 <main+0x224>)
- 8001770: 701a strb r2, [r3, #0]
- if (fres == FR_OK) {
- 8001772: 4b34 ldr r3, [pc, #208] ; (8001844 <main+0x224>)
- 8001774: 781b ldrb r3, [r3, #0]
- 8001776: 2b00 cmp r3, #0
- 8001778: d103 bne.n 8001782 <main+0x162>
- transmit_uart("File is closed.\r\n");
- 800177a: 4843 ldr r0, [pc, #268] ; (8001888 <main+0x268>)
- 800177c: f7ff ff3a bl 80015f4 <transmit_uart>
- 8001780: e006 b.n 8001790 <main+0x170>
- } else if (fres != FR_OK) {
- 8001782: 4b30 ldr r3, [pc, #192] ; (8001844 <main+0x224>)
- 8001784: 781b ldrb r3, [r3, #0]
- 8001786: 2b00 cmp r3, #0
- 8001788: d002 beq.n 8001790 <main+0x170>
- transmit_uart("File was not closed.\r\n");
- 800178a: 4840 ldr r0, [pc, #256] ; (800188c <main+0x26c>)
- 800178c: f7ff ff32 bl 80015f4 <transmit_uart>
- }
-
- /* Open file to read */
- fres = f_open(&fil, "log-file.txt", FA_READ);
- 8001790: 2201 movs r2, #1
- 8001792: 492f ldr r1, [pc, #188] ; (8001850 <main+0x230>)
- 8001794: 482f ldr r0, [pc, #188] ; (8001854 <main+0x234>)
- 8001796: f004 fca1 bl 80060dc <f_open>
- 800179a: 4603 mov r3, r0
- 800179c: 461a mov r2, r3
- 800179e: 4b29 ldr r3, [pc, #164] ; (8001844 <main+0x224>)
- 80017a0: 701a strb r2, [r3, #0]
- if (fres == FR_OK) {
- 80017a2: 4b28 ldr r3, [pc, #160] ; (8001844 <main+0x224>)
- 80017a4: 781b ldrb r3, [r3, #0]
- 80017a6: 2b00 cmp r3, #0
- 80017a8: d103 bne.n 80017b2 <main+0x192>
- transmit_uart("File opened.\r\n");
- 80017aa: 482b ldr r0, [pc, #172] ; (8001858 <main+0x238>)
- 80017ac: f7ff ff22 bl 80015f4 <transmit_uart>
- 80017b0: e010 b.n 80017d4 <main+0x1b4>
- } else if (fres != FR_OK) {
- 80017b2: 4b24 ldr r3, [pc, #144] ; (8001844 <main+0x224>)
- 80017b4: 781b ldrb r3, [r3, #0]
- 80017b6: 2b00 cmp r3, #0
- 80017b8: d00c beq.n 80017d4 <main+0x1b4>
- transmit_uart("File was not opened!\r\n");
- 80017ba: 4828 ldr r0, [pc, #160] ; (800185c <main+0x23c>)
- 80017bc: f7ff ff1a bl 80015f4 <transmit_uart>
- }
-
- while (f_gets(buffer, sizeof(buffer), &fil)) {
- 80017c0: e008 b.n 80017d4 <main+0x1b4>
- char mRd[100];
- sprintf(mRd, "%s", buffer);
- 80017c2: 463b mov r3, r7
- 80017c4: 4932 ldr r1, [pc, #200] ; (8001890 <main+0x270>)
- 80017c6: 4618 mov r0, r3
- 80017c8: f005 fcea bl 80071a0 <strcpy>
- transmit_uart(mRd);
- 80017cc: 463b mov r3, r7
- 80017ce: 4618 mov r0, r3
- 80017d0: f7ff ff10 bl 80015f4 <transmit_uart>
- while (f_gets(buffer, sizeof(buffer), &fil)) {
- 80017d4: 4a1f ldr r2, [pc, #124] ; (8001854 <main+0x234>)
- 80017d6: 2164 movs r1, #100 ; 0x64
- 80017d8: 482d ldr r0, [pc, #180] ; (8001890 <main+0x270>)
- 80017da: f005 fa9b bl 8006d14 <f_gets>
- 80017de: 4603 mov r3, r0
- 80017e0: 2b00 cmp r3, #0
- 80017e2: d1ee bne.n 80017c2 <main+0x1a2>
-
- }
-
- /* Close file */
- fres = f_close(&fil);
- 80017e4: 481b ldr r0, [pc, #108] ; (8001854 <main+0x234>)
- 80017e6: f005 f9b6 bl 8006b56 <f_close>
- 80017ea: 4603 mov r3, r0
- 80017ec: 461a mov r2, r3
- 80017ee: 4b15 ldr r3, [pc, #84] ; (8001844 <main+0x224>)
- 80017f0: 701a strb r2, [r3, #0]
- if (fres == FR_OK) {
- 80017f2: 4b14 ldr r3, [pc, #80] ; (8001844 <main+0x224>)
- 80017f4: 781b ldrb r3, [r3, #0]
- 80017f6: 2b00 cmp r3, #0
- 80017f8: d103 bne.n 8001802 <main+0x1e2>
- transmit_uart("File is closed.\r\n");
- 80017fa: 4823 ldr r0, [pc, #140] ; (8001888 <main+0x268>)
- 80017fc: f7ff fefa bl 80015f4 <transmit_uart>
- 8001800: e006 b.n 8001810 <main+0x1f0>
- } else if (fres != FR_OK) {
- 8001802: 4b10 ldr r3, [pc, #64] ; (8001844 <main+0x224>)
- 8001804: 781b ldrb r3, [r3, #0]
- 8001806: 2b00 cmp r3, #0
- 8001808: d002 beq.n 8001810 <main+0x1f0>
- transmit_uart("File was not closed.\r\n");
- 800180a: 4820 ldr r0, [pc, #128] ; (800188c <main+0x26c>)
- 800180c: f7ff fef2 bl 80015f4 <transmit_uart>
- }
-
- f_mount(NULL, "", 1);
- 8001810: 2201 movs r2, #1
- 8001812: 490a ldr r1, [pc, #40] ; (800183c <main+0x21c>)
- 8001814: 2000 movs r0, #0
- 8001816: f004 fc1b bl 8006050 <f_mount>
- if (fres == FR_OK) {
- 800181a: 4b0a ldr r3, [pc, #40] ; (8001844 <main+0x224>)
- 800181c: 781b ldrb r3, [r3, #0]
- 800181e: 2b00 cmp r3, #0
- 8001820: d103 bne.n 800182a <main+0x20a>
- transmit_uart("SD card is unmounted!\r\n");
- 8001822: 481c ldr r0, [pc, #112] ; (8001894 <main+0x274>)
- 8001824: f7ff fee6 bl 80015f4 <transmit_uart>
- 8001828: e006 b.n 8001838 <main+0x218>
- } else if (fres != FR_OK) {
- 800182a: 4b06 ldr r3, [pc, #24] ; (8001844 <main+0x224>)
- 800182c: 781b ldrb r3, [r3, #0]
- 800182e: 2b00 cmp r3, #0
- 8001830: d002 beq.n 8001838 <main+0x218>
- transmit_uart("SD card was not unmounted!\r\n");
- 8001832: 4819 ldr r0, [pc, #100] ; (8001898 <main+0x278>)
- 8001834: f7ff fede bl 80015f4 <transmit_uart>
-
- /* USER CODE END 2 */
-
- /* Infinite loop */
- /* USER CODE BEGIN WHILE */
- while (1)
- 8001838: e7fe b.n 8001838 <main+0x218>
- 800183a: bf00 nop
- 800183c: 080079ac .word 0x080079ac
- 8001840: 200002f0 .word 0x200002f0
- 8001844: 20001430 .word 0x20001430
- 8001848: 080079b0 .word 0x080079b0
- 800184c: 080079d4 .word 0x080079d4
- 8001850: 080079f0 .word 0x080079f0
- 8001854: 20001434 .word 0x20001434
- 8001858: 08007a00 .word 0x08007a00
- 800185c: 08007a10 .word 0x08007a10
- 8001860: 20001394 .word 0x20001394
- 8001864: 200002ec .word 0x200002ec
- 8001868: 3fe00000 .word 0x3fe00000
- 800186c: 20001328 .word 0x20001328
- 8001870: 20001390 .word 0x20001390
- 8001874: 08007a28 .word 0x08007a28
- 8001878: 08007a2c .word 0x08007a2c
- 800187c: 08007a3c .word 0x08007a3c
- 8001880: 08007a40 .word 0x08007a40
- 8001884: 08007a68 .word 0x08007a68
- 8001888: 08007a78 .word 0x08007a78
- 800188c: 08007a8c .word 0x08007a8c
- 8001890: 2000132c .word 0x2000132c
- 8001894: 08007aa4 .word 0x08007aa4
- 8001898: 08007abc .word 0x08007abc
-
- 0800189c <SystemClock_Config>:
- /**
- * @brief System Clock Configuration
- * @retval None
- */
- void SystemClock_Config(void)
- {
- 800189c: b580 push {r7, lr}
- 800189e: b092 sub sp, #72 ; 0x48
- 80018a0: af00 add r7, sp, #0
- RCC_OscInitTypeDef RCC_OscInitStruct = {0};
- 80018a2: f107 0314 add.w r3, r7, #20
- 80018a6: 2234 movs r2, #52 ; 0x34
- 80018a8: 2100 movs r1, #0
- 80018aa: 4618 mov r0, r3
- 80018ac: f005 fc50 bl 8007150 <memset>
- RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
- 80018b0: 463b mov r3, r7
- 80018b2: 2200 movs r2, #0
- 80018b4: 601a str r2, [r3, #0]
- 80018b6: 605a str r2, [r3, #4]
- 80018b8: 609a str r2, [r3, #8]
- 80018ba: 60da str r2, [r3, #12]
- 80018bc: 611a str r2, [r3, #16]
-
- /** Configure the main internal regulator output voltage
- */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
- 80018be: 4b1d ldr r3, [pc, #116] ; (8001934 <SystemClock_Config+0x98>)
- 80018c0: 681b ldr r3, [r3, #0]
- 80018c2: f423 53c0 bic.w r3, r3, #6144 ; 0x1800
- 80018c6: 4a1b ldr r2, [pc, #108] ; (8001934 <SystemClock_Config+0x98>)
- 80018c8: f443 6300 orr.w r3, r3, #2048 ; 0x800
- 80018cc: 6013 str r3, [r2, #0]
- /** Initializes the RCC Oscillators according to the specified parameters
- * in the RCC_OscInitTypeDef structure.
- */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
- 80018ce: 2302 movs r3, #2
- 80018d0: 617b str r3, [r7, #20]
- RCC_OscInitStruct.HSIState = RCC_HSI_ON;
- 80018d2: 2301 movs r3, #1
- 80018d4: 623b str r3, [r7, #32]
- RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- 80018d6: 2310 movs r3, #16
- 80018d8: 627b str r3, [r7, #36] ; 0x24
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- 80018da: 2302 movs r3, #2
- 80018dc: 63bb str r3, [r7, #56] ; 0x38
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
- 80018de: 2300 movs r3, #0
- 80018e0: 63fb str r3, [r7, #60] ; 0x3c
- RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
- 80018e2: f44f 2300 mov.w r3, #524288 ; 0x80000
- 80018e6: 643b str r3, [r7, #64] ; 0x40
- RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3;
- 80018e8: f44f 0300 mov.w r3, #8388608 ; 0x800000
- 80018ec: 647b str r3, [r7, #68] ; 0x44
- if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
- 80018ee: f107 0314 add.w r3, r7, #20
- 80018f2: 4618 mov r0, r3
- 80018f4: f000 fd78 bl 80023e8 <HAL_RCC_OscConfig>
- 80018f8: 4603 mov r3, r0
- 80018fa: 2b00 cmp r3, #0
- 80018fc: d001 beq.n 8001902 <SystemClock_Config+0x66>
- {
- Error_Handler();
- 80018fe: f000 f8e3 bl 8001ac8 <Error_Handler>
- }
- /** Initializes the CPU, AHB and APB buses clocks
- */
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
- 8001902: 230f movs r3, #15
- 8001904: 603b str r3, [r7, #0]
- |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- 8001906: 2303 movs r3, #3
- 8001908: 607b str r3, [r7, #4]
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- 800190a: 2300 movs r3, #0
- 800190c: 60bb str r3, [r7, #8]
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- 800190e: 2300 movs r3, #0
- 8001910: 60fb str r3, [r7, #12]
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- 8001912: 2300 movs r3, #0
- 8001914: 613b str r3, [r7, #16]
-
- if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
- 8001916: 463b mov r3, r7
- 8001918: 2101 movs r1, #1
- 800191a: 4618 mov r0, r3
- 800191c: f001 f894 bl 8002a48 <HAL_RCC_ClockConfig>
- 8001920: 4603 mov r3, r0
- 8001922: 2b00 cmp r3, #0
- 8001924: d001 beq.n 800192a <SystemClock_Config+0x8e>
- {
- Error_Handler();
- 8001926: f000 f8cf bl 8001ac8 <Error_Handler>
- }
- }
- 800192a: bf00 nop
- 800192c: 3748 adds r7, #72 ; 0x48
- 800192e: 46bd mov sp, r7
- 8001930: bd80 pop {r7, pc}
- 8001932: bf00 nop
- 8001934: 40007000 .word 0x40007000
-
- 08001938 <MX_SPI1_Init>:
- * @brief SPI1 Initialization Function
- * @param None
- * @retval None
- */
- static void MX_SPI1_Init(void)
- {
- 8001938: b580 push {r7, lr}
- 800193a: af00 add r7, sp, #0
-
- /* USER CODE BEGIN SPI1_Init 1 */
-
- /* USER CODE END SPI1_Init 1 */
- /* SPI1 parameter configuration*/
- hspi1.Instance = SPI1;
- 800193c: 4b17 ldr r3, [pc, #92] ; (800199c <MX_SPI1_Init+0x64>)
- 800193e: 4a18 ldr r2, [pc, #96] ; (80019a0 <MX_SPI1_Init+0x68>)
- 8001940: 601a str r2, [r3, #0]
- hspi1.Init.Mode = SPI_MODE_MASTER;
- 8001942: 4b16 ldr r3, [pc, #88] ; (800199c <MX_SPI1_Init+0x64>)
- 8001944: f44f 7282 mov.w r2, #260 ; 0x104
- 8001948: 605a str r2, [r3, #4]
- hspi1.Init.Direction = SPI_DIRECTION_2LINES;
- 800194a: 4b14 ldr r3, [pc, #80] ; (800199c <MX_SPI1_Init+0x64>)
- 800194c: 2200 movs r2, #0
- 800194e: 609a str r2, [r3, #8]
- hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
- 8001950: 4b12 ldr r3, [pc, #72] ; (800199c <MX_SPI1_Init+0x64>)
- 8001952: 2200 movs r2, #0
- 8001954: 60da str r2, [r3, #12]
- hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
- 8001956: 4b11 ldr r3, [pc, #68] ; (800199c <MX_SPI1_Init+0x64>)
- 8001958: 2200 movs r2, #0
- 800195a: 611a str r2, [r3, #16]
- hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
- 800195c: 4b0f ldr r3, [pc, #60] ; (800199c <MX_SPI1_Init+0x64>)
- 800195e: 2200 movs r2, #0
- 8001960: 615a str r2, [r3, #20]
- hspi1.Init.NSS = SPI_NSS_SOFT;
- 8001962: 4b0e ldr r3, [pc, #56] ; (800199c <MX_SPI1_Init+0x64>)
- 8001964: f44f 7200 mov.w r2, #512 ; 0x200
- 8001968: 619a str r2, [r3, #24]
- hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;
- 800196a: 4b0c ldr r3, [pc, #48] ; (800199c <MX_SPI1_Init+0x64>)
- 800196c: 2208 movs r2, #8
- 800196e: 61da str r2, [r3, #28]
- hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
- 8001970: 4b0a ldr r3, [pc, #40] ; (800199c <MX_SPI1_Init+0x64>)
- 8001972: 2200 movs r2, #0
- 8001974: 621a str r2, [r3, #32]
- hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
- 8001976: 4b09 ldr r3, [pc, #36] ; (800199c <MX_SPI1_Init+0x64>)
- 8001978: 2200 movs r2, #0
- 800197a: 625a str r2, [r3, #36] ; 0x24
- hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
- 800197c: 4b07 ldr r3, [pc, #28] ; (800199c <MX_SPI1_Init+0x64>)
- 800197e: 2200 movs r2, #0
- 8001980: 629a str r2, [r3, #40] ; 0x28
- hspi1.Init.CRCPolynomial = 10;
- 8001982: 4b06 ldr r3, [pc, #24] ; (800199c <MX_SPI1_Init+0x64>)
- 8001984: 220a movs r2, #10
- 8001986: 62da str r2, [r3, #44] ; 0x2c
- if (HAL_SPI_Init(&hspi1) != HAL_OK)
- 8001988: 4804 ldr r0, [pc, #16] ; (800199c <MX_SPI1_Init+0x64>)
- 800198a: f001 faed bl 8002f68 <HAL_SPI_Init>
- 800198e: 4603 mov r3, r0
- 8001990: 2b00 cmp r3, #0
- 8001992: d001 beq.n 8001998 <MX_SPI1_Init+0x60>
- {
- Error_Handler();
- 8001994: f000 f898 bl 8001ac8 <Error_Handler>
- }
- /* USER CODE BEGIN SPI1_Init 2 */
-
- /* USER CODE END SPI1_Init 2 */
-
- }
- 8001998: bf00 nop
- 800199a: bd80 pop {r7, pc}
- 800199c: 20001398 .word 0x20001398
- 80019a0: 40013000 .word 0x40013000
-
- 080019a4 <MX_USART2_UART_Init>:
- * @brief USART2 Initialization Function
- * @param None
- * @retval None
- */
- static void MX_USART2_UART_Init(void)
- {
- 80019a4: b580 push {r7, lr}
- 80019a6: af00 add r7, sp, #0
- /* USER CODE END USART2_Init 0 */
-
- /* USER CODE BEGIN USART2_Init 1 */
-
- /* USER CODE END USART2_Init 1 */
- huart2.Instance = USART2;
- 80019a8: 4b11 ldr r3, [pc, #68] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019aa: 4a12 ldr r2, [pc, #72] ; (80019f4 <MX_USART2_UART_Init+0x50>)
- 80019ac: 601a str r2, [r3, #0]
- huart2.Init.BaudRate = 115200;
- 80019ae: 4b10 ldr r3, [pc, #64] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019b0: f44f 32e1 mov.w r2, #115200 ; 0x1c200
- 80019b4: 605a str r2, [r3, #4]
- huart2.Init.WordLength = UART_WORDLENGTH_8B;
- 80019b6: 4b0e ldr r3, [pc, #56] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019b8: 2200 movs r2, #0
- 80019ba: 609a str r2, [r3, #8]
- huart2.Init.StopBits = UART_STOPBITS_1;
- 80019bc: 4b0c ldr r3, [pc, #48] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019be: 2200 movs r2, #0
- 80019c0: 60da str r2, [r3, #12]
- huart2.Init.Parity = UART_PARITY_NONE;
- 80019c2: 4b0b ldr r3, [pc, #44] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019c4: 2200 movs r2, #0
- 80019c6: 611a str r2, [r3, #16]
- huart2.Init.Mode = UART_MODE_TX_RX;
- 80019c8: 4b09 ldr r3, [pc, #36] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019ca: 220c movs r2, #12
- 80019cc: 615a str r2, [r3, #20]
- huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
- 80019ce: 4b08 ldr r3, [pc, #32] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019d0: 2200 movs r2, #0
- 80019d2: 619a str r2, [r3, #24]
- huart2.Init.OverSampling = UART_OVERSAMPLING_16;
- 80019d4: 4b06 ldr r3, [pc, #24] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019d6: 2200 movs r2, #0
- 80019d8: 61da str r2, [r3, #28]
- if (HAL_UART_Init(&huart2) != HAL_OK)
- 80019da: 4805 ldr r0, [pc, #20] ; (80019f0 <MX_USART2_UART_Init+0x4c>)
- 80019dc: f001 fef6 bl 80037cc <HAL_UART_Init>
- 80019e0: 4603 mov r3, r0
- 80019e2: 2b00 cmp r3, #0
- 80019e4: d001 beq.n 80019ea <MX_USART2_UART_Init+0x46>
- {
- Error_Handler();
- 80019e6: f000 f86f bl 8001ac8 <Error_Handler>
- }
- /* USER CODE BEGIN USART2_Init 2 */
-
- /* USER CODE END USART2_Init 2 */
-
- }
- 80019ea: bf00 nop
- 80019ec: bd80 pop {r7, pc}
- 80019ee: bf00 nop
- 80019f0: 200013f0 .word 0x200013f0
- 80019f4: 40004400 .word 0x40004400
-
- 080019f8 <MX_GPIO_Init>:
- * @brief GPIO Initialization Function
- * @param None
- * @retval None
- */
- static void MX_GPIO_Init(void)
- {
- 80019f8: b580 push {r7, lr}
- 80019fa: b08a sub sp, #40 ; 0x28
- 80019fc: af00 add r7, sp, #0
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- 80019fe: f107 0314 add.w r3, r7, #20
- 8001a02: 2200 movs r2, #0
- 8001a04: 601a str r2, [r3, #0]
- 8001a06: 605a str r2, [r3, #4]
- 8001a08: 609a str r2, [r3, #8]
- 8001a0a: 60da str r2, [r3, #12]
- 8001a0c: 611a str r2, [r3, #16]
-
- /* GPIO Ports Clock Enable */
- __HAL_RCC_GPIOC_CLK_ENABLE();
- 8001a0e: 4b2a ldr r3, [pc, #168] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a10: 69db ldr r3, [r3, #28]
- 8001a12: 4a29 ldr r2, [pc, #164] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a14: f043 0304 orr.w r3, r3, #4
- 8001a18: 61d3 str r3, [r2, #28]
- 8001a1a: 4b27 ldr r3, [pc, #156] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a1c: 69db ldr r3, [r3, #28]
- 8001a1e: f003 0304 and.w r3, r3, #4
- 8001a22: 613b str r3, [r7, #16]
- 8001a24: 693b ldr r3, [r7, #16]
- __HAL_RCC_GPIOH_CLK_ENABLE();
- 8001a26: 4b24 ldr r3, [pc, #144] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a28: 69db ldr r3, [r3, #28]
- 8001a2a: 4a23 ldr r2, [pc, #140] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a2c: f043 0320 orr.w r3, r3, #32
- 8001a30: 61d3 str r3, [r2, #28]
- 8001a32: 4b21 ldr r3, [pc, #132] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a34: 69db ldr r3, [r3, #28]
- 8001a36: f003 0320 and.w r3, r3, #32
- 8001a3a: 60fb str r3, [r7, #12]
- 8001a3c: 68fb ldr r3, [r7, #12]
- __HAL_RCC_GPIOA_CLK_ENABLE();
- 8001a3e: 4b1e ldr r3, [pc, #120] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a40: 69db ldr r3, [r3, #28]
- 8001a42: 4a1d ldr r2, [pc, #116] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a44: f043 0301 orr.w r3, r3, #1
- 8001a48: 61d3 str r3, [r2, #28]
- 8001a4a: 4b1b ldr r3, [pc, #108] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a4c: 69db ldr r3, [r3, #28]
- 8001a4e: f003 0301 and.w r3, r3, #1
- 8001a52: 60bb str r3, [r7, #8]
- 8001a54: 68bb ldr r3, [r7, #8]
- __HAL_RCC_GPIOB_CLK_ENABLE();
- 8001a56: 4b18 ldr r3, [pc, #96] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a58: 69db ldr r3, [r3, #28]
- 8001a5a: 4a17 ldr r2, [pc, #92] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a5c: f043 0302 orr.w r3, r3, #2
- 8001a60: 61d3 str r3, [r2, #28]
- 8001a62: 4b15 ldr r3, [pc, #84] ; (8001ab8 <MX_GPIO_Init+0xc0>)
- 8001a64: 69db ldr r3, [r3, #28]
- 8001a66: f003 0302 and.w r3, r3, #2
- 8001a6a: 607b str r3, [r7, #4]
- 8001a6c: 687b ldr r3, [r7, #4]
-
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET);
- 8001a6e: 2201 movs r2, #1
- 8001a70: 2140 movs r1, #64 ; 0x40
- 8001a72: 4812 ldr r0, [pc, #72] ; (8001abc <MX_GPIO_Init+0xc4>)
- 8001a74: f000 fca0 bl 80023b8 <HAL_GPIO_WritePin>
-
- /*Configure GPIO pin : B1_Pin */
- GPIO_InitStruct.Pin = B1_Pin;
- 8001a78: f44f 5300 mov.w r3, #8192 ; 0x2000
- 8001a7c: 617b str r3, [r7, #20]
- GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
- 8001a7e: 4b10 ldr r3, [pc, #64] ; (8001ac0 <MX_GPIO_Init+0xc8>)
- 8001a80: 61bb str r3, [r7, #24]
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- 8001a82: 2300 movs r3, #0
- 8001a84: 61fb str r3, [r7, #28]
- HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
- 8001a86: f107 0314 add.w r3, r7, #20
- 8001a8a: 4619 mov r1, r3
- 8001a8c: 480d ldr r0, [pc, #52] ; (8001ac4 <MX_GPIO_Init+0xcc>)
- 8001a8e: f000 fb05 bl 800209c <HAL_GPIO_Init>
-
- /*Configure GPIO pin : PB6 */
- GPIO_InitStruct.Pin = GPIO_PIN_6;
- 8001a92: 2340 movs r3, #64 ; 0x40
- 8001a94: 617b str r3, [r7, #20]
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- 8001a96: 2301 movs r3, #1
- 8001a98: 61bb str r3, [r7, #24]
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- 8001a9a: 2300 movs r3, #0
- 8001a9c: 61fb str r3, [r7, #28]
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- 8001a9e: 2302 movs r3, #2
- 8001aa0: 623b str r3, [r7, #32]
- HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
- 8001aa2: f107 0314 add.w r3, r7, #20
- 8001aa6: 4619 mov r1, r3
- 8001aa8: 4804 ldr r0, [pc, #16] ; (8001abc <MX_GPIO_Init+0xc4>)
- 8001aaa: f000 faf7 bl 800209c <HAL_GPIO_Init>
-
- }
- 8001aae: bf00 nop
- 8001ab0: 3728 adds r7, #40 ; 0x28
- 8001ab2: 46bd mov sp, r7
- 8001ab4: bd80 pop {r7, pc}
- 8001ab6: bf00 nop
- 8001ab8: 40023800 .word 0x40023800
- 8001abc: 40020400 .word 0x40020400
- 8001ac0: 10110000 .word 0x10110000
- 8001ac4: 40020800 .word 0x40020800
-
- 08001ac8 <Error_Handler>:
- /**
- * @brief This function is executed in case of error occurrence.
- * @retval None
- */
- void Error_Handler(void)
- {
- 8001ac8: b480 push {r7}
- 8001aca: af00 add r7, sp, #0
- /* USER CODE BEGIN Error_Handler_Debug */
- /* User can add his own implementation to report the HAL error return state */
-
- /* USER CODE END Error_Handler_Debug */
- }
- 8001acc: bf00 nop
- 8001ace: 46bd mov sp, r7
- 8001ad0: bc80 pop {r7}
- 8001ad2: 4770 bx lr
-
- 08001ad4 <HAL_MspInit>:
- /* USER CODE END 0 */
- /**
- * Initializes the Global MSP.
- */
- void HAL_MspInit(void)
- {
- 8001ad4: b580 push {r7, lr}
- 8001ad6: b084 sub sp, #16
- 8001ad8: af00 add r7, sp, #0
- /* USER CODE BEGIN MspInit 0 */
-
- /* USER CODE END MspInit 0 */
-
- __HAL_RCC_COMP_CLK_ENABLE();
- 8001ada: 4b15 ldr r3, [pc, #84] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001adc: 6a5b ldr r3, [r3, #36] ; 0x24
- 8001ade: 4a14 ldr r2, [pc, #80] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001ae0: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
- 8001ae4: 6253 str r3, [r2, #36] ; 0x24
- 8001ae6: 4b12 ldr r3, [pc, #72] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001ae8: 6a5b ldr r3, [r3, #36] ; 0x24
- 8001aea: f003 4300 and.w r3, r3, #2147483648 ; 0x80000000
- 8001aee: 60fb str r3, [r7, #12]
- 8001af0: 68fb ldr r3, [r7, #12]
- __HAL_RCC_SYSCFG_CLK_ENABLE();
- 8001af2: 4b0f ldr r3, [pc, #60] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001af4: 6a1b ldr r3, [r3, #32]
- 8001af6: 4a0e ldr r2, [pc, #56] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001af8: f043 0301 orr.w r3, r3, #1
- 8001afc: 6213 str r3, [r2, #32]
- 8001afe: 4b0c ldr r3, [pc, #48] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001b00: 6a1b ldr r3, [r3, #32]
- 8001b02: f003 0301 and.w r3, r3, #1
- 8001b06: 60bb str r3, [r7, #8]
- 8001b08: 68bb ldr r3, [r7, #8]
- __HAL_RCC_PWR_CLK_ENABLE();
- 8001b0a: 4b09 ldr r3, [pc, #36] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001b0c: 6a5b ldr r3, [r3, #36] ; 0x24
- 8001b0e: 4a08 ldr r2, [pc, #32] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001b10: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
- 8001b14: 6253 str r3, [r2, #36] ; 0x24
- 8001b16: 4b06 ldr r3, [pc, #24] ; (8001b30 <HAL_MspInit+0x5c>)
- 8001b18: 6a5b ldr r3, [r3, #36] ; 0x24
- 8001b1a: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
- 8001b1e: 607b str r3, [r7, #4]
- 8001b20: 687b ldr r3, [r7, #4]
-
- HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
- 8001b22: 2007 movs r0, #7
- 8001b24: f000 fa7a bl 800201c <HAL_NVIC_SetPriorityGrouping>
- /* System interrupt init*/
-
- /* USER CODE BEGIN MspInit 1 */
-
- /* USER CODE END MspInit 1 */
- }
- 8001b28: bf00 nop
- 8001b2a: 3710 adds r7, #16
- 8001b2c: 46bd mov sp, r7
- 8001b2e: bd80 pop {r7, pc}
- 8001b30: 40023800 .word 0x40023800
-
- 08001b34 <HAL_SPI_MspInit>:
- * This function configures the hardware resources used in this example
- * @param hspi: SPI handle pointer
- * @retval None
- */
- void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
- {
- 8001b34: b580 push {r7, lr}
- 8001b36: b08a sub sp, #40 ; 0x28
- 8001b38: af00 add r7, sp, #0
- 8001b3a: 6078 str r0, [r7, #4]
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- 8001b3c: f107 0314 add.w r3, r7, #20
- 8001b40: 2200 movs r2, #0
- 8001b42: 601a str r2, [r3, #0]
- 8001b44: 605a str r2, [r3, #4]
- 8001b46: 609a str r2, [r3, #8]
- 8001b48: 60da str r2, [r3, #12]
- 8001b4a: 611a str r2, [r3, #16]
- if(hspi->Instance==SPI1)
- 8001b4c: 687b ldr r3, [r7, #4]
- 8001b4e: 681b ldr r3, [r3, #0]
- 8001b50: 4a17 ldr r2, [pc, #92] ; (8001bb0 <HAL_SPI_MspInit+0x7c>)
- 8001b52: 4293 cmp r3, r2
- 8001b54: d127 bne.n 8001ba6 <HAL_SPI_MspInit+0x72>
- {
- /* USER CODE BEGIN SPI1_MspInit 0 */
-
- /* USER CODE END SPI1_MspInit 0 */
- /* Peripheral clock enable */
- __HAL_RCC_SPI1_CLK_ENABLE();
- 8001b56: 4b17 ldr r3, [pc, #92] ; (8001bb4 <HAL_SPI_MspInit+0x80>)
- 8001b58: 6a1b ldr r3, [r3, #32]
- 8001b5a: 4a16 ldr r2, [pc, #88] ; (8001bb4 <HAL_SPI_MspInit+0x80>)
- 8001b5c: f443 5380 orr.w r3, r3, #4096 ; 0x1000
- 8001b60: 6213 str r3, [r2, #32]
- 8001b62: 4b14 ldr r3, [pc, #80] ; (8001bb4 <HAL_SPI_MspInit+0x80>)
- 8001b64: 6a1b ldr r3, [r3, #32]
- 8001b66: f403 5380 and.w r3, r3, #4096 ; 0x1000
- 8001b6a: 613b str r3, [r7, #16]
- 8001b6c: 693b ldr r3, [r7, #16]
-
- __HAL_RCC_GPIOA_CLK_ENABLE();
- 8001b6e: 4b11 ldr r3, [pc, #68] ; (8001bb4 <HAL_SPI_MspInit+0x80>)
- 8001b70: 69db ldr r3, [r3, #28]
- 8001b72: 4a10 ldr r2, [pc, #64] ; (8001bb4 <HAL_SPI_MspInit+0x80>)
- 8001b74: f043 0301 orr.w r3, r3, #1
- 8001b78: 61d3 str r3, [r2, #28]
- 8001b7a: 4b0e ldr r3, [pc, #56] ; (8001bb4 <HAL_SPI_MspInit+0x80>)
- 8001b7c: 69db ldr r3, [r3, #28]
- 8001b7e: f003 0301 and.w r3, r3, #1
- 8001b82: 60fb str r3, [r7, #12]
- 8001b84: 68fb ldr r3, [r7, #12]
- /**SPI1 GPIO Configuration
- PA5 ------> SPI1_SCK
- PA6 ------> SPI1_MISO
- PA7 ------> SPI1_MOSI
- */
- GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
- 8001b86: 23e0 movs r3, #224 ; 0xe0
- 8001b88: 617b str r3, [r7, #20]
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- 8001b8a: 2302 movs r3, #2
- 8001b8c: 61bb str r3, [r7, #24]
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- 8001b8e: 2300 movs r3, #0
- 8001b90: 61fb str r3, [r7, #28]
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- 8001b92: 2303 movs r3, #3
- 8001b94: 623b str r3, [r7, #32]
- GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
- 8001b96: 2305 movs r3, #5
- 8001b98: 627b str r3, [r7, #36] ; 0x24
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- 8001b9a: f107 0314 add.w r3, r7, #20
- 8001b9e: 4619 mov r1, r3
- 8001ba0: 4805 ldr r0, [pc, #20] ; (8001bb8 <HAL_SPI_MspInit+0x84>)
- 8001ba2: f000 fa7b bl 800209c <HAL_GPIO_Init>
- /* USER CODE BEGIN SPI1_MspInit 1 */
-
- /* USER CODE END SPI1_MspInit 1 */
- }
-
- }
- 8001ba6: bf00 nop
- 8001ba8: 3728 adds r7, #40 ; 0x28
- 8001baa: 46bd mov sp, r7
- 8001bac: bd80 pop {r7, pc}
- 8001bae: bf00 nop
- 8001bb0: 40013000 .word 0x40013000
- 8001bb4: 40023800 .word 0x40023800
- 8001bb8: 40020000 .word 0x40020000
-
- 08001bbc <HAL_UART_MspInit>:
- * This function configures the hardware resources used in this example
- * @param huart: UART handle pointer
- * @retval None
- */
- void HAL_UART_MspInit(UART_HandleTypeDef* huart)
- {
- 8001bbc: b580 push {r7, lr}
- 8001bbe: b08a sub sp, #40 ; 0x28
- 8001bc0: af00 add r7, sp, #0
- 8001bc2: 6078 str r0, [r7, #4]
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- 8001bc4: f107 0314 add.w r3, r7, #20
- 8001bc8: 2200 movs r2, #0
- 8001bca: 601a str r2, [r3, #0]
- 8001bcc: 605a str r2, [r3, #4]
- 8001bce: 609a str r2, [r3, #8]
- 8001bd0: 60da str r2, [r3, #12]
- 8001bd2: 611a str r2, [r3, #16]
- if(huart->Instance==USART2)
- 8001bd4: 687b ldr r3, [r7, #4]
- 8001bd6: 681b ldr r3, [r3, #0]
- 8001bd8: 4a17 ldr r2, [pc, #92] ; (8001c38 <HAL_UART_MspInit+0x7c>)
- 8001bda: 4293 cmp r3, r2
- 8001bdc: d127 bne.n 8001c2e <HAL_UART_MspInit+0x72>
- {
- /* USER CODE BEGIN USART2_MspInit 0 */
-
- /* USER CODE END USART2_MspInit 0 */
- /* Peripheral clock enable */
- __HAL_RCC_USART2_CLK_ENABLE();
- 8001bde: 4b17 ldr r3, [pc, #92] ; (8001c3c <HAL_UART_MspInit+0x80>)
- 8001be0: 6a5b ldr r3, [r3, #36] ; 0x24
- 8001be2: 4a16 ldr r2, [pc, #88] ; (8001c3c <HAL_UART_MspInit+0x80>)
- 8001be4: f443 3300 orr.w r3, r3, #131072 ; 0x20000
- 8001be8: 6253 str r3, [r2, #36] ; 0x24
- 8001bea: 4b14 ldr r3, [pc, #80] ; (8001c3c <HAL_UART_MspInit+0x80>)
- 8001bec: 6a5b ldr r3, [r3, #36] ; 0x24
- 8001bee: f403 3300 and.w r3, r3, #131072 ; 0x20000
- 8001bf2: 613b str r3, [r7, #16]
- 8001bf4: 693b ldr r3, [r7, #16]
-
- __HAL_RCC_GPIOA_CLK_ENABLE();
- 8001bf6: 4b11 ldr r3, [pc, #68] ; (8001c3c <HAL_UART_MspInit+0x80>)
- 8001bf8: 69db ldr r3, [r3, #28]
- 8001bfa: 4a10 ldr r2, [pc, #64] ; (8001c3c <HAL_UART_MspInit+0x80>)
- 8001bfc: f043 0301 orr.w r3, r3, #1
- 8001c00: 61d3 str r3, [r2, #28]
- 8001c02: 4b0e ldr r3, [pc, #56] ; (8001c3c <HAL_UART_MspInit+0x80>)
- 8001c04: 69db ldr r3, [r3, #28]
- 8001c06: f003 0301 and.w r3, r3, #1
- 8001c0a: 60fb str r3, [r7, #12]
- 8001c0c: 68fb ldr r3, [r7, #12]
- /**USART2 GPIO Configuration
- PA2 ------> USART2_TX
- PA3 ------> USART2_RX
- */
- GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin;
- 8001c0e: 230c movs r3, #12
- 8001c10: 617b str r3, [r7, #20]
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- 8001c12: 2302 movs r3, #2
- 8001c14: 61bb str r3, [r7, #24]
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- 8001c16: 2300 movs r3, #0
- 8001c18: 61fb str r3, [r7, #28]
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- 8001c1a: 2303 movs r3, #3
- 8001c1c: 623b str r3, [r7, #32]
- GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
- 8001c1e: 2307 movs r3, #7
- 8001c20: 627b str r3, [r7, #36] ; 0x24
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- 8001c22: f107 0314 add.w r3, r7, #20
- 8001c26: 4619 mov r1, r3
- 8001c28: 4805 ldr r0, [pc, #20] ; (8001c40 <HAL_UART_MspInit+0x84>)
- 8001c2a: f000 fa37 bl 800209c <HAL_GPIO_Init>
- /* USER CODE BEGIN USART2_MspInit 1 */
-
- /* USER CODE END USART2_MspInit 1 */
- }
-
- }
- 8001c2e: bf00 nop
- 8001c30: 3728 adds r7, #40 ; 0x28
- 8001c32: 46bd mov sp, r7
- 8001c34: bd80 pop {r7, pc}
- 8001c36: bf00 nop
- 8001c38: 40004400 .word 0x40004400
- 8001c3c: 40023800 .word 0x40023800
- 8001c40: 40020000 .word 0x40020000
-
- 08001c44 <NMI_Handler>:
- /******************************************************************************/
- /**
- * @brief This function handles Non maskable interrupt.
- */
- void NMI_Handler(void)
- {
- 8001c44: b480 push {r7}
- 8001c46: af00 add r7, sp, #0
-
- /* USER CODE END NonMaskableInt_IRQn 0 */
- /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
-
- /* USER CODE END NonMaskableInt_IRQn 1 */
- }
- 8001c48: bf00 nop
- 8001c4a: 46bd mov sp, r7
- 8001c4c: bc80 pop {r7}
- 8001c4e: 4770 bx lr
-
- 08001c50 <HardFault_Handler>:
-
- /**
- * @brief This function handles Hard fault interrupt.
- */
- void HardFault_Handler(void)
- {
- 8001c50: b480 push {r7}
- 8001c52: af00 add r7, sp, #0
- /* USER CODE BEGIN HardFault_IRQn 0 */
-
- /* USER CODE END HardFault_IRQn 0 */
- while (1)
- 8001c54: e7fe b.n 8001c54 <HardFault_Handler+0x4>
-
- 08001c56 <MemManage_Handler>:
-
- /**
- * @brief This function handles Memory management fault.
- */
- void MemManage_Handler(void)
- {
- 8001c56: b480 push {r7}
- 8001c58: af00 add r7, sp, #0
- /* USER CODE BEGIN MemoryManagement_IRQn 0 */
-
- /* USER CODE END MemoryManagement_IRQn 0 */
- while (1)
- 8001c5a: e7fe b.n 8001c5a <MemManage_Handler+0x4>
-
- 08001c5c <BusFault_Handler>:
-
- /**
- * @brief This function handles Pre-fetch fault, memory access fault.
- */
- void BusFault_Handler(void)
- {
- 8001c5c: b480 push {r7}
- 8001c5e: af00 add r7, sp, #0
- /* USER CODE BEGIN BusFault_IRQn 0 */
-
- /* USER CODE END BusFault_IRQn 0 */
- while (1)
- 8001c60: e7fe b.n 8001c60 <BusFault_Handler+0x4>
-
- 08001c62 <UsageFault_Handler>:
-
- /**
- * @brief This function handles Undefined instruction or illegal state.
- */
- void UsageFault_Handler(void)
- {
- 8001c62: b480 push {r7}
- 8001c64: af00 add r7, sp, #0
- /* USER CODE BEGIN UsageFault_IRQn 0 */
-
- /* USER CODE END UsageFault_IRQn 0 */
- while (1)
- 8001c66: e7fe b.n 8001c66 <UsageFault_Handler+0x4>
-
- 08001c68 <SVC_Handler>:
-
- /**
- * @brief This function handles System service call via SWI instruction.
- */
- void SVC_Handler(void)
- {
- 8001c68: b480 push {r7}
- 8001c6a: af00 add r7, sp, #0
-
- /* USER CODE END SVC_IRQn 0 */
- /* USER CODE BEGIN SVC_IRQn 1 */
-
- /* USER CODE END SVC_IRQn 1 */
- }
- 8001c6c: bf00 nop
- 8001c6e: 46bd mov sp, r7
- 8001c70: bc80 pop {r7}
- 8001c72: 4770 bx lr
-
- 08001c74 <DebugMon_Handler>:
-
- /**
- * @brief This function handles Debug monitor.
- */
- void DebugMon_Handler(void)
- {
- 8001c74: b480 push {r7}
- 8001c76: af00 add r7, sp, #0
-
- /* USER CODE END DebugMonitor_IRQn 0 */
- /* USER CODE BEGIN DebugMonitor_IRQn 1 */
-
- /* USER CODE END DebugMonitor_IRQn 1 */
- }
- 8001c78: bf00 nop
- 8001c7a: 46bd mov sp, r7
- 8001c7c: bc80 pop {r7}
- 8001c7e: 4770 bx lr
-
- 08001c80 <PendSV_Handler>:
-
- /**
- * @brief This function handles Pendable request for system service.
- */
- void PendSV_Handler(void)
- {
- 8001c80: b480 push {r7}
- 8001c82: af00 add r7, sp, #0
-
- /* USER CODE END PendSV_IRQn 0 */
- /* USER CODE BEGIN PendSV_IRQn 1 */
-
- /* USER CODE END PendSV_IRQn 1 */
- }
- 8001c84: bf00 nop
- 8001c86: 46bd mov sp, r7
- 8001c88: bc80 pop {r7}
- 8001c8a: 4770 bx lr
-
- 08001c8c <SysTick_Handler>:
-
- /**
- * @brief This function handles System tick timer.
- */
- void SysTick_Handler(void)
- {
- 8001c8c: b580 push {r7, lr}
- 8001c8e: af00 add r7, sp, #0
- /* USER CODE BEGIN SysTick_IRQn 0 */
-
- if (Timer1 > 0){
- 8001c90: 4b0c ldr r3, [pc, #48] ; (8001cc4 <SysTick_Handler+0x38>)
- 8001c92: 881b ldrh r3, [r3, #0]
- 8001c94: 2b00 cmp r3, #0
- 8001c96: d005 beq.n 8001ca4 <SysTick_Handler+0x18>
- Timer1--;
- 8001c98: 4b0a ldr r3, [pc, #40] ; (8001cc4 <SysTick_Handler+0x38>)
- 8001c9a: 881b ldrh r3, [r3, #0]
- 8001c9c: 3b01 subs r3, #1
- 8001c9e: b29a uxth r2, r3
- 8001ca0: 4b08 ldr r3, [pc, #32] ; (8001cc4 <SysTick_Handler+0x38>)
- 8001ca2: 801a strh r2, [r3, #0]
- }
-
- if (Timer2 > 0){
- 8001ca4: 4b08 ldr r3, [pc, #32] ; (8001cc8 <SysTick_Handler+0x3c>)
- 8001ca6: 881b ldrh r3, [r3, #0]
- 8001ca8: 2b00 cmp r3, #0
- 8001caa: d005 beq.n 8001cb8 <SysTick_Handler+0x2c>
- Timer2--;
- 8001cac: 4b06 ldr r3, [pc, #24] ; (8001cc8 <SysTick_Handler+0x3c>)
- 8001cae: 881b ldrh r3, [r3, #0]
- 8001cb0: 3b01 subs r3, #1
- 8001cb2: b29a uxth r2, r3
- 8001cb4: 4b04 ldr r3, [pc, #16] ; (8001cc8 <SysTick_Handler+0x3c>)
- 8001cb6: 801a strh r2, [r3, #0]
- }
-
- /* USER CODE END SysTick_IRQn 0 */
- HAL_IncTick();
- 8001cb8: f000 f8c2 bl 8001e40 <HAL_IncTick>
- /* USER CODE BEGIN SysTick_IRQn 1 */
-
- HAL_SYSTICK_IRQHandler();
- 8001cbc: f000 f9e1 bl 8002082 <HAL_SYSTICK_IRQHandler>
-
- /* USER CODE END SysTick_IRQn 1 */
- }
- 8001cc0: bf00 nop
- 8001cc2: bd80 pop {r7, pc}
- 8001cc4: 200002ea .word 0x200002ea
- 8001cc8: 200002e8 .word 0x200002e8
-
- 08001ccc <_sbrk>:
- *
- * @param incr Memory size
- * @return Pointer to allocated memory
- */
- void *_sbrk(ptrdiff_t incr)
- {
- 8001ccc: b580 push {r7, lr}
- 8001cce: b086 sub sp, #24
- 8001cd0: af00 add r7, sp, #0
- 8001cd2: 6078 str r0, [r7, #4]
- extern uint8_t _end; /* Symbol defined in the linker script */
- extern uint8_t _estack; /* Symbol defined in the linker script */
- extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
- const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
- 8001cd4: 4a14 ldr r2, [pc, #80] ; (8001d28 <_sbrk+0x5c>)
- 8001cd6: 4b15 ldr r3, [pc, #84] ; (8001d2c <_sbrk+0x60>)
- 8001cd8: 1ad3 subs r3, r2, r3
- 8001cda: 617b str r3, [r7, #20]
- const uint8_t *max_heap = (uint8_t *)stack_limit;
- 8001cdc: 697b ldr r3, [r7, #20]
- 8001cde: 613b str r3, [r7, #16]
- uint8_t *prev_heap_end;
-
- /* Initalize heap end at first call */
- if (NULL == __sbrk_heap_end)
- 8001ce0: 4b13 ldr r3, [pc, #76] ; (8001d30 <_sbrk+0x64>)
- 8001ce2: 681b ldr r3, [r3, #0]
- 8001ce4: 2b00 cmp r3, #0
- 8001ce6: d102 bne.n 8001cee <_sbrk+0x22>
- {
- __sbrk_heap_end = &_end;
- 8001ce8: 4b11 ldr r3, [pc, #68] ; (8001d30 <_sbrk+0x64>)
- 8001cea: 4a12 ldr r2, [pc, #72] ; (8001d34 <_sbrk+0x68>)
- 8001cec: 601a str r2, [r3, #0]
- }
-
- /* Protect heap from growing into the reserved MSP stack */
- if (__sbrk_heap_end + incr > max_heap)
- 8001cee: 4b10 ldr r3, [pc, #64] ; (8001d30 <_sbrk+0x64>)
- 8001cf0: 681a ldr r2, [r3, #0]
- 8001cf2: 687b ldr r3, [r7, #4]
- 8001cf4: 4413 add r3, r2
- 8001cf6: 693a ldr r2, [r7, #16]
- 8001cf8: 429a cmp r2, r3
- 8001cfa: d207 bcs.n 8001d0c <_sbrk+0x40>
- {
- errno = ENOMEM;
- 8001cfc: f005 f9fe bl 80070fc <__errno>
- 8001d00: 4602 mov r2, r0
- 8001d02: 230c movs r3, #12
- 8001d04: 6013 str r3, [r2, #0]
- return (void *)-1;
- 8001d06: f04f 33ff mov.w r3, #4294967295
- 8001d0a: e009 b.n 8001d20 <_sbrk+0x54>
- }
-
- prev_heap_end = __sbrk_heap_end;
- 8001d0c: 4b08 ldr r3, [pc, #32] ; (8001d30 <_sbrk+0x64>)
- 8001d0e: 681b ldr r3, [r3, #0]
- 8001d10: 60fb str r3, [r7, #12]
- __sbrk_heap_end += incr;
- 8001d12: 4b07 ldr r3, [pc, #28] ; (8001d30 <_sbrk+0x64>)
- 8001d14: 681a ldr r2, [r3, #0]
- 8001d16: 687b ldr r3, [r7, #4]
- 8001d18: 4413 add r3, r2
- 8001d1a: 4a05 ldr r2, [pc, #20] ; (8001d30 <_sbrk+0x64>)
- 8001d1c: 6013 str r3, [r2, #0]
-
- return (void *)prev_heap_end;
- 8001d1e: 68fb ldr r3, [r7, #12]
- }
- 8001d20: 4618 mov r0, r3
- 8001d22: 3718 adds r7, #24
- 8001d24: 46bd mov sp, r7
- 8001d26: bd80 pop {r7, pc}
- 8001d28: 20014000 .word 0x20014000
- 8001d2c: 00000400 .word 0x00000400
- 8001d30: 200000a8 .word 0x200000a8
- 8001d34: 200044e0 .word 0x200044e0
-
- 08001d38 <SystemInit>:
- * SystemCoreClock variable.
- * @param None
- * @retval None
- */
- void SystemInit (void)
- {
- 8001d38: b480 push {r7}
- 8001d3a: af00 add r7, sp, #0
- #endif /* DATA_IN_ExtSRAM */
-
- #ifdef VECT_TAB_SRAM
- SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
- #else
- SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */
- 8001d3c: 4b03 ldr r3, [pc, #12] ; (8001d4c <SystemInit+0x14>)
- 8001d3e: f04f 6200 mov.w r2, #134217728 ; 0x8000000
- 8001d42: 609a str r2, [r3, #8]
- #endif
- }
- 8001d44: bf00 nop
- 8001d46: 46bd mov sp, r7
- 8001d48: bc80 pop {r7}
- 8001d4a: 4770 bx lr
- 8001d4c: e000ed00 .word 0xe000ed00
-
- 08001d50 <Reset_Handler>:
- .weak Reset_Handler
- .type Reset_Handler, %function
- Reset_Handler:
-
- /* Copy the data segment initializers from flash to SRAM */
- movs r1, #0
- 8001d50: 2100 movs r1, #0
- b LoopCopyDataInit
- 8001d52: e003 b.n 8001d5c <LoopCopyDataInit>
-
- 08001d54 <CopyDataInit>:
-
- CopyDataInit:
- ldr r3, =_sidata
- 8001d54: 4b0b ldr r3, [pc, #44] ; (8001d84 <LoopFillZerobss+0x14>)
- ldr r3, [r3, r1]
- 8001d56: 585b ldr r3, [r3, r1]
- str r3, [r0, r1]
- 8001d58: 5043 str r3, [r0, r1]
- adds r1, r1, #4
- 8001d5a: 3104 adds r1, #4
-
- 08001d5c <LoopCopyDataInit>:
-
- LoopCopyDataInit:
- ldr r0, =_sdata
- 8001d5c: 480a ldr r0, [pc, #40] ; (8001d88 <LoopFillZerobss+0x18>)
- ldr r3, =_edata
- 8001d5e: 4b0b ldr r3, [pc, #44] ; (8001d8c <LoopFillZerobss+0x1c>)
- adds r2, r0, r1
- 8001d60: 1842 adds r2, r0, r1
- cmp r2, r3
- 8001d62: 429a cmp r2, r3
- bcc CopyDataInit
- 8001d64: d3f6 bcc.n 8001d54 <CopyDataInit>
- ldr r2, =_sbss
- 8001d66: 4a0a ldr r2, [pc, #40] ; (8001d90 <LoopFillZerobss+0x20>)
- b LoopFillZerobss
- 8001d68: e002 b.n 8001d70 <LoopFillZerobss>
-
- 08001d6a <FillZerobss>:
- /* Zero fill the bss segment. */
- FillZerobss:
- movs r3, #0
- 8001d6a: 2300 movs r3, #0
- str r3, [r2], #4
- 8001d6c: f842 3b04 str.w r3, [r2], #4
-
- 08001d70 <LoopFillZerobss>:
-
- LoopFillZerobss:
- ldr r3, = _ebss
- 8001d70: 4b08 ldr r3, [pc, #32] ; (8001d94 <LoopFillZerobss+0x24>)
- cmp r2, r3
- 8001d72: 429a cmp r2, r3
- bcc FillZerobss
- 8001d74: d3f9 bcc.n 8001d6a <FillZerobss>
-
- /* Call the clock system intitialization function.*/
- bl SystemInit
- 8001d76: f7ff ffdf bl 8001d38 <SystemInit>
- /* Call static constructors */
- bl __libc_init_array
- 8001d7a: f005 f9c5 bl 8007108 <__libc_init_array>
- /* Call the application's entry point.*/
- bl main
- 8001d7e: f7ff fc4f bl 8001620 <main>
- bx lr
- 8001d82: 4770 bx lr
- ldr r3, =_sidata
- 8001d84: 08007fcc .word 0x08007fcc
- ldr r0, =_sdata
- 8001d88: 20000000 .word 0x20000000
- ldr r3, =_edata
- 8001d8c: 20000088 .word 0x20000088
- ldr r2, =_sbss
- 8001d90: 20000088 .word 0x20000088
- ldr r3, = _ebss
- 8001d94: 200044dc .word 0x200044dc
-
- 08001d98 <ADC1_IRQHandler>:
- * @retval : None
- */
- .section .text.Default_Handler,"ax",%progbits
- Default_Handler:
- Infinite_Loop:
- b Infinite_Loop
- 8001d98: e7fe b.n 8001d98 <ADC1_IRQHandler>
-
- 08001d9a <HAL_Init>:
- * In the default implementation,Systick is used as source of time base.
- * the tick variable is incremented each 1ms in its ISR.
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_Init(void)
- {
- 8001d9a: b580 push {r7, lr}
- 8001d9c: b082 sub sp, #8
- 8001d9e: af00 add r7, sp, #0
- HAL_StatusTypeDef status = HAL_OK;
- 8001da0: 2300 movs r3, #0
- 8001da2: 71fb strb r3, [r7, #7]
- #if (PREFETCH_ENABLE != 0)
- __HAL_FLASH_PREFETCH_BUFFER_ENABLE();
- #endif /* PREFETCH_ENABLE */
-
- /* Set Interrupt Group Priority */
- HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
- 8001da4: 2003 movs r0, #3
- 8001da6: f000 f939 bl 800201c <HAL_NVIC_SetPriorityGrouping>
-
- /* Use systick as time base source and configure 1ms tick (default clock after Reset is MSI) */
- if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
- 8001daa: 2000 movs r0, #0
- 8001dac: f000 f80e bl 8001dcc <HAL_InitTick>
- 8001db0: 4603 mov r3, r0
- 8001db2: 2b00 cmp r3, #0
- 8001db4: d002 beq.n 8001dbc <HAL_Init+0x22>
- {
- status = HAL_ERROR;
- 8001db6: 2301 movs r3, #1
- 8001db8: 71fb strb r3, [r7, #7]
- 8001dba: e001 b.n 8001dc0 <HAL_Init+0x26>
- }
- else
- {
- /* Init the low level hardware */
- HAL_MspInit();
- 8001dbc: f7ff fe8a bl 8001ad4 <HAL_MspInit>
- }
-
- /* Return function status */
- return status;
- 8001dc0: 79fb ldrb r3, [r7, #7]
- }
- 8001dc2: 4618 mov r0, r3
- 8001dc4: 3708 adds r7, #8
- 8001dc6: 46bd mov sp, r7
- 8001dc8: bd80 pop {r7, pc}
- ...
-
- 08001dcc <HAL_InitTick>:
- * implementation in user file.
- * @param TickPriority Tick interrupt priority.
- * @retval HAL status
- */
- __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
- {
- 8001dcc: b580 push {r7, lr}
- 8001dce: b084 sub sp, #16
- 8001dd0: af00 add r7, sp, #0
- 8001dd2: 6078 str r0, [r7, #4]
- HAL_StatusTypeDef status = HAL_OK;
- 8001dd4: 2300 movs r3, #0
- 8001dd6: 73fb strb r3, [r7, #15]
-
- if (uwTickFreq != 0U)
- 8001dd8: 4b16 ldr r3, [pc, #88] ; (8001e34 <HAL_InitTick+0x68>)
- 8001dda: 681b ldr r3, [r3, #0]
- 8001ddc: 2b00 cmp r3, #0
- 8001dde: d022 beq.n 8001e26 <HAL_InitTick+0x5a>
- {
- /*Configure the SysTick to have interrupt in 1ms time basis*/
- if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) == 0U)
- 8001de0: 4b15 ldr r3, [pc, #84] ; (8001e38 <HAL_InitTick+0x6c>)
- 8001de2: 681a ldr r2, [r3, #0]
- 8001de4: 4b13 ldr r3, [pc, #76] ; (8001e34 <HAL_InitTick+0x68>)
- 8001de6: 681b ldr r3, [r3, #0]
- 8001de8: f44f 717a mov.w r1, #1000 ; 0x3e8
- 8001dec: fbb1 f3f3 udiv r3, r1, r3
- 8001df0: fbb2 f3f3 udiv r3, r2, r3
- 8001df4: 4618 mov r0, r3
- 8001df6: f000 f938 bl 800206a <HAL_SYSTICK_Config>
- 8001dfa: 4603 mov r3, r0
- 8001dfc: 2b00 cmp r3, #0
- 8001dfe: d10f bne.n 8001e20 <HAL_InitTick+0x54>
- {
- /* Configure the SysTick IRQ priority */
- if (TickPriority < (1UL << __NVIC_PRIO_BITS))
- 8001e00: 687b ldr r3, [r7, #4]
- 8001e02: 2b0f cmp r3, #15
- 8001e04: d809 bhi.n 8001e1a <HAL_InitTick+0x4e>
- {
- HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U);
- 8001e06: 2200 movs r2, #0
- 8001e08: 6879 ldr r1, [r7, #4]
- 8001e0a: f04f 30ff mov.w r0, #4294967295
- 8001e0e: f000 f910 bl 8002032 <HAL_NVIC_SetPriority>
- uwTickPrio = TickPriority;
- 8001e12: 4a0a ldr r2, [pc, #40] ; (8001e3c <HAL_InitTick+0x70>)
- 8001e14: 687b ldr r3, [r7, #4]
- 8001e16: 6013 str r3, [r2, #0]
- 8001e18: e007 b.n 8001e2a <HAL_InitTick+0x5e>
- }
- else
- {
- status = HAL_ERROR;
- 8001e1a: 2301 movs r3, #1
- 8001e1c: 73fb strb r3, [r7, #15]
- 8001e1e: e004 b.n 8001e2a <HAL_InitTick+0x5e>
- }
- }
- else
- {
- status = HAL_ERROR;
- 8001e20: 2301 movs r3, #1
- 8001e22: 73fb strb r3, [r7, #15]
- 8001e24: e001 b.n 8001e2a <HAL_InitTick+0x5e>
- }
- }
- else
- {
- status = HAL_ERROR;
- 8001e26: 2301 movs r3, #1
- 8001e28: 73fb strb r3, [r7, #15]
- }
-
- /* Return function status */
- return status;
- 8001e2a: 7bfb ldrb r3, [r7, #15]
- }
- 8001e2c: 4618 mov r0, r3
- 8001e2e: 3710 adds r7, #16
- 8001e30: 46bd mov sp, r7
- 8001e32: bd80 pop {r7, pc}
- 8001e34: 2000000c .word 0x2000000c
- 8001e38: 20000004 .word 0x20000004
- 8001e3c: 20000008 .word 0x20000008
-
- 08001e40 <HAL_IncTick>:
- * @note This function is declared as __weak to be overwritten in case of other
- * implementations in user file.
- * @retval None
- */
- __weak void HAL_IncTick(void)
- {
- 8001e40: b480 push {r7}
- 8001e42: af00 add r7, sp, #0
- uwTick += uwTickFreq;
- 8001e44: 4b05 ldr r3, [pc, #20] ; (8001e5c <HAL_IncTick+0x1c>)
- 8001e46: 681a ldr r2, [r3, #0]
- 8001e48: 4b05 ldr r3, [pc, #20] ; (8001e60 <HAL_IncTick+0x20>)
- 8001e4a: 681b ldr r3, [r3, #0]
- 8001e4c: 4413 add r3, r2
- 8001e4e: 4a03 ldr r2, [pc, #12] ; (8001e5c <HAL_IncTick+0x1c>)
- 8001e50: 6013 str r3, [r2, #0]
- }
- 8001e52: bf00 nop
- 8001e54: 46bd mov sp, r7
- 8001e56: bc80 pop {r7}
- 8001e58: 4770 bx lr
- 8001e5a: bf00 nop
- 8001e5c: 20002464 .word 0x20002464
- 8001e60: 2000000c .word 0x2000000c
-
- 08001e64 <HAL_GetTick>:
- * @note This function is declared as __weak to be overwritten in case of other
- * implementations in user file.
- * @retval tick value
- */
- __weak uint32_t HAL_GetTick(void)
- {
- 8001e64: b480 push {r7}
- 8001e66: af00 add r7, sp, #0
- return uwTick;
- 8001e68: 4b02 ldr r3, [pc, #8] ; (8001e74 <HAL_GetTick+0x10>)
- 8001e6a: 681b ldr r3, [r3, #0]
- }
- 8001e6c: 4618 mov r0, r3
- 8001e6e: 46bd mov sp, r7
- 8001e70: bc80 pop {r7}
- 8001e72: 4770 bx lr
- 8001e74: 20002464 .word 0x20002464
-
- 08001e78 <HAL_Delay>:
- * implementations in user file.
- * @param Delay specifies the delay time length, in milliseconds.
- * @retval None
- */
- __weak void HAL_Delay(uint32_t Delay)
- {
- 8001e78: b580 push {r7, lr}
- 8001e7a: b084 sub sp, #16
- 8001e7c: af00 add r7, sp, #0
- 8001e7e: 6078 str r0, [r7, #4]
- uint32_t tickstart = HAL_GetTick();
- 8001e80: f7ff fff0 bl 8001e64 <HAL_GetTick>
- 8001e84: 60b8 str r0, [r7, #8]
- uint32_t wait = Delay;
- 8001e86: 687b ldr r3, [r7, #4]
- 8001e88: 60fb str r3, [r7, #12]
-
- /* Add a period to guaranty minimum wait */
- if (wait < HAL_MAX_DELAY)
- 8001e8a: 68fb ldr r3, [r7, #12]
- 8001e8c: f1b3 3fff cmp.w r3, #4294967295
- 8001e90: d004 beq.n 8001e9c <HAL_Delay+0x24>
- {
- wait += (uint32_t)(uwTickFreq);
- 8001e92: 4b09 ldr r3, [pc, #36] ; (8001eb8 <HAL_Delay+0x40>)
- 8001e94: 681b ldr r3, [r3, #0]
- 8001e96: 68fa ldr r2, [r7, #12]
- 8001e98: 4413 add r3, r2
- 8001e9a: 60fb str r3, [r7, #12]
- }
-
- while((HAL_GetTick() - tickstart) < wait)
- 8001e9c: bf00 nop
- 8001e9e: f7ff ffe1 bl 8001e64 <HAL_GetTick>
- 8001ea2: 4602 mov r2, r0
- 8001ea4: 68bb ldr r3, [r7, #8]
- 8001ea6: 1ad3 subs r3, r2, r3
- 8001ea8: 68fa ldr r2, [r7, #12]
- 8001eaa: 429a cmp r2, r3
- 8001eac: d8f7 bhi.n 8001e9e <HAL_Delay+0x26>
- {
- }
- }
- 8001eae: bf00 nop
- 8001eb0: 3710 adds r7, #16
- 8001eb2: 46bd mov sp, r7
- 8001eb4: bd80 pop {r7, pc}
- 8001eb6: bf00 nop
- 8001eb8: 2000000c .word 0x2000000c
-
- 08001ebc <__NVIC_SetPriorityGrouping>:
- In case of a conflict between priority grouping and available
- priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
- \param [in] PriorityGroup Priority grouping field.
- */
- __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
- {
- 8001ebc: b480 push {r7}
- 8001ebe: b085 sub sp, #20
- 8001ec0: af00 add r7, sp, #0
- 8001ec2: 6078 str r0, [r7, #4]
- uint32_t reg_value;
- uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
- 8001ec4: 687b ldr r3, [r7, #4]
- 8001ec6: f003 0307 and.w r3, r3, #7
- 8001eca: 60fb str r3, [r7, #12]
-
- reg_value = SCB->AIRCR; /* read old register configuration */
- 8001ecc: 4b0c ldr r3, [pc, #48] ; (8001f00 <__NVIC_SetPriorityGrouping+0x44>)
- 8001ece: 68db ldr r3, [r3, #12]
- 8001ed0: 60bb str r3, [r7, #8]
- reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */
- 8001ed2: 68ba ldr r2, [r7, #8]
- 8001ed4: f64f 03ff movw r3, #63743 ; 0xf8ff
- 8001ed8: 4013 ands r3, r2
- 8001eda: 60bb str r3, [r7, #8]
- reg_value = (reg_value |
- ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
- (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */
- 8001edc: 68fb ldr r3, [r7, #12]
- 8001ede: 021a lsls r2, r3, #8
- ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
- 8001ee0: 68bb ldr r3, [r7, #8]
- 8001ee2: 4313 orrs r3, r2
- reg_value = (reg_value |
- 8001ee4: f043 63bf orr.w r3, r3, #100139008 ; 0x5f80000
- 8001ee8: f443 3300 orr.w r3, r3, #131072 ; 0x20000
- 8001eec: 60bb str r3, [r7, #8]
- SCB->AIRCR = reg_value;
- 8001eee: 4a04 ldr r2, [pc, #16] ; (8001f00 <__NVIC_SetPriorityGrouping+0x44>)
- 8001ef0: 68bb ldr r3, [r7, #8]
- 8001ef2: 60d3 str r3, [r2, #12]
- }
- 8001ef4: bf00 nop
- 8001ef6: 3714 adds r7, #20
- 8001ef8: 46bd mov sp, r7
- 8001efa: bc80 pop {r7}
- 8001efc: 4770 bx lr
- 8001efe: bf00 nop
- 8001f00: e000ed00 .word 0xe000ed00
-
- 08001f04 <__NVIC_GetPriorityGrouping>:
- \brief Get Priority Grouping
- \details Reads the priority grouping field from the NVIC Interrupt Controller.
- \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
- */
- __STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)
- {
- 8001f04: b480 push {r7}
- 8001f06: af00 add r7, sp, #0
- return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
- 8001f08: 4b04 ldr r3, [pc, #16] ; (8001f1c <__NVIC_GetPriorityGrouping+0x18>)
- 8001f0a: 68db ldr r3, [r3, #12]
- 8001f0c: 0a1b lsrs r3, r3, #8
- 8001f0e: f003 0307 and.w r3, r3, #7
- }
- 8001f12: 4618 mov r0, r3
- 8001f14: 46bd mov sp, r7
- 8001f16: bc80 pop {r7}
- 8001f18: 4770 bx lr
- 8001f1a: bf00 nop
- 8001f1c: e000ed00 .word 0xe000ed00
-
- 08001f20 <__NVIC_SetPriority>:
- \param [in] IRQn Interrupt number.
- \param [in] priority Priority to set.
- \note The priority cannot be set for every processor exception.
- */
- __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
- {
- 8001f20: b480 push {r7}
- 8001f22: b083 sub sp, #12
- 8001f24: af00 add r7, sp, #0
- 8001f26: 4603 mov r3, r0
- 8001f28: 6039 str r1, [r7, #0]
- 8001f2a: 71fb strb r3, [r7, #7]
- if ((int32_t)(IRQn) >= 0)
- 8001f2c: f997 3007 ldrsb.w r3, [r7, #7]
- 8001f30: 2b00 cmp r3, #0
- 8001f32: db0a blt.n 8001f4a <__NVIC_SetPriority+0x2a>
- {
- NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
- 8001f34: 683b ldr r3, [r7, #0]
- 8001f36: b2da uxtb r2, r3
- 8001f38: 490c ldr r1, [pc, #48] ; (8001f6c <__NVIC_SetPriority+0x4c>)
- 8001f3a: f997 3007 ldrsb.w r3, [r7, #7]
- 8001f3e: 0112 lsls r2, r2, #4
- 8001f40: b2d2 uxtb r2, r2
- 8001f42: 440b add r3, r1
- 8001f44: f883 2300 strb.w r2, [r3, #768] ; 0x300
- }
- else
- {
- SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
- }
- }
- 8001f48: e00a b.n 8001f60 <__NVIC_SetPriority+0x40>
- SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
- 8001f4a: 683b ldr r3, [r7, #0]
- 8001f4c: b2da uxtb r2, r3
- 8001f4e: 4908 ldr r1, [pc, #32] ; (8001f70 <__NVIC_SetPriority+0x50>)
- 8001f50: 79fb ldrb r3, [r7, #7]
- 8001f52: f003 030f and.w r3, r3, #15
- 8001f56: 3b04 subs r3, #4
- 8001f58: 0112 lsls r2, r2, #4
- 8001f5a: b2d2 uxtb r2, r2
- 8001f5c: 440b add r3, r1
- 8001f5e: 761a strb r2, [r3, #24]
- }
- 8001f60: bf00 nop
- 8001f62: 370c adds r7, #12
- 8001f64: 46bd mov sp, r7
- 8001f66: bc80 pop {r7}
- 8001f68: 4770 bx lr
- 8001f6a: bf00 nop
- 8001f6c: e000e100 .word 0xe000e100
- 8001f70: e000ed00 .word 0xe000ed00
-
- 08001f74 <NVIC_EncodePriority>:
- \param [in] PreemptPriority Preemptive priority value (starting from 0).
- \param [in] SubPriority Subpriority value (starting from 0).
- \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
- */
- __STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
- {
- 8001f74: b480 push {r7}
- 8001f76: b089 sub sp, #36 ; 0x24
- 8001f78: af00 add r7, sp, #0
- 8001f7a: 60f8 str r0, [r7, #12]
- 8001f7c: 60b9 str r1, [r7, #8]
- 8001f7e: 607a str r2, [r7, #4]
- uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
- 8001f80: 68fb ldr r3, [r7, #12]
- 8001f82: f003 0307 and.w r3, r3, #7
- 8001f86: 61fb str r3, [r7, #28]
- uint32_t PreemptPriorityBits;
- uint32_t SubPriorityBits;
-
- PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
- 8001f88: 69fb ldr r3, [r7, #28]
- 8001f8a: f1c3 0307 rsb r3, r3, #7
- 8001f8e: 2b04 cmp r3, #4
- 8001f90: bf28 it cs
- 8001f92: 2304 movcs r3, #4
- 8001f94: 61bb str r3, [r7, #24]
- SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
- 8001f96: 69fb ldr r3, [r7, #28]
- 8001f98: 3304 adds r3, #4
- 8001f9a: 2b06 cmp r3, #6
- 8001f9c: d902 bls.n 8001fa4 <NVIC_EncodePriority+0x30>
- 8001f9e: 69fb ldr r3, [r7, #28]
- 8001fa0: 3b03 subs r3, #3
- 8001fa2: e000 b.n 8001fa6 <NVIC_EncodePriority+0x32>
- 8001fa4: 2300 movs r3, #0
- 8001fa6: 617b str r3, [r7, #20]
-
- return (
- ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
- 8001fa8: f04f 32ff mov.w r2, #4294967295
- 8001fac: 69bb ldr r3, [r7, #24]
- 8001fae: fa02 f303 lsl.w r3, r2, r3
- 8001fb2: 43da mvns r2, r3
- 8001fb4: 68bb ldr r3, [r7, #8]
- 8001fb6: 401a ands r2, r3
- 8001fb8: 697b ldr r3, [r7, #20]
- 8001fba: 409a lsls r2, r3
- ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
- 8001fbc: f04f 31ff mov.w r1, #4294967295
- 8001fc0: 697b ldr r3, [r7, #20]
- 8001fc2: fa01 f303 lsl.w r3, r1, r3
- 8001fc6: 43d9 mvns r1, r3
- 8001fc8: 687b ldr r3, [r7, #4]
- 8001fca: 400b ands r3, r1
- ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
- 8001fcc: 4313 orrs r3, r2
- );
- }
- 8001fce: 4618 mov r0, r3
- 8001fd0: 3724 adds r7, #36 ; 0x24
- 8001fd2: 46bd mov sp, r7
- 8001fd4: bc80 pop {r7}
- 8001fd6: 4770 bx lr
-
- 08001fd8 <SysTick_Config>:
- \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
- function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
- must contain a vendor-specific implementation of this function.
- */
- __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
- {
- 8001fd8: b580 push {r7, lr}
- 8001fda: b082 sub sp, #8
- 8001fdc: af00 add r7, sp, #0
- 8001fde: 6078 str r0, [r7, #4]
- if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
- 8001fe0: 687b ldr r3, [r7, #4]
- 8001fe2: 3b01 subs r3, #1
- 8001fe4: f1b3 7f80 cmp.w r3, #16777216 ; 0x1000000
- 8001fe8: d301 bcc.n 8001fee <SysTick_Config+0x16>
- {
- return (1UL); /* Reload value impossible */
- 8001fea: 2301 movs r3, #1
- 8001fec: e00f b.n 800200e <SysTick_Config+0x36>
- }
-
- SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
- 8001fee: 4a0a ldr r2, [pc, #40] ; (8002018 <SysTick_Config+0x40>)
- 8001ff0: 687b ldr r3, [r7, #4]
- 8001ff2: 3b01 subs r3, #1
- 8001ff4: 6053 str r3, [r2, #4]
- NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
- 8001ff6: 210f movs r1, #15
- 8001ff8: f04f 30ff mov.w r0, #4294967295
- 8001ffc: f7ff ff90 bl 8001f20 <__NVIC_SetPriority>
- SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
- 8002000: 4b05 ldr r3, [pc, #20] ; (8002018 <SysTick_Config+0x40>)
- 8002002: 2200 movs r2, #0
- 8002004: 609a str r2, [r3, #8]
- SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
- 8002006: 4b04 ldr r3, [pc, #16] ; (8002018 <SysTick_Config+0x40>)
- 8002008: 2207 movs r2, #7
- 800200a: 601a str r2, [r3, #0]
- SysTick_CTRL_TICKINT_Msk |
- SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
- return (0UL); /* Function successful */
- 800200c: 2300 movs r3, #0
- }
- 800200e: 4618 mov r0, r3
- 8002010: 3708 adds r7, #8
- 8002012: 46bd mov sp, r7
- 8002014: bd80 pop {r7, pc}
- 8002016: bf00 nop
- 8002018: e000e010 .word 0xe000e010
-
- 0800201c <HAL_NVIC_SetPriorityGrouping>:
- * @note When the NVIC_PriorityGroup_0 is selected, IRQ pre-emption is no more possible.
- * The pending IRQ priority will be managed only by the subpriority.
- * @retval None
- */
- void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
- {
- 800201c: b580 push {r7, lr}
- 800201e: b082 sub sp, #8
- 8002020: af00 add r7, sp, #0
- 8002022: 6078 str r0, [r7, #4]
- /* Check the parameters */
- assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup));
-
- /* Set the PRIGROUP[10:8] bits according to the PriorityGroup parameter value */
- NVIC_SetPriorityGrouping(PriorityGroup);
- 8002024: 6878 ldr r0, [r7, #4]
- 8002026: f7ff ff49 bl 8001ebc <__NVIC_SetPriorityGrouping>
- }
- 800202a: bf00 nop
- 800202c: 3708 adds r7, #8
- 800202e: 46bd mov sp, r7
- 8002030: bd80 pop {r7, pc}
-
- 08002032 <HAL_NVIC_SetPriority>:
- * This parameter can be a value between 0 and 15
- * A lower priority value indicates a higher priority.
- * @retval None
- */
- void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
- {
- 8002032: b580 push {r7, lr}
- 8002034: b086 sub sp, #24
- 8002036: af00 add r7, sp, #0
- 8002038: 4603 mov r3, r0
- 800203a: 60b9 str r1, [r7, #8]
- 800203c: 607a str r2, [r7, #4]
- 800203e: 73fb strb r3, [r7, #15]
- uint32_t prioritygroup = 0x00;
- 8002040: 2300 movs r3, #0
- 8002042: 617b str r3, [r7, #20]
-
- /* Check the parameters */
- assert_param(IS_NVIC_SUB_PRIORITY(SubPriority));
- assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority));
-
- prioritygroup = NVIC_GetPriorityGrouping();
- 8002044: f7ff ff5e bl 8001f04 <__NVIC_GetPriorityGrouping>
- 8002048: 6178 str r0, [r7, #20]
-
- NVIC_SetPriority(IRQn, NVIC_EncodePriority(prioritygroup, PreemptPriority, SubPriority));
- 800204a: 687a ldr r2, [r7, #4]
- 800204c: 68b9 ldr r1, [r7, #8]
- 800204e: 6978 ldr r0, [r7, #20]
- 8002050: f7ff ff90 bl 8001f74 <NVIC_EncodePriority>
- 8002054: 4602 mov r2, r0
- 8002056: f997 300f ldrsb.w r3, [r7, #15]
- 800205a: 4611 mov r1, r2
- 800205c: 4618 mov r0, r3
- 800205e: f7ff ff5f bl 8001f20 <__NVIC_SetPriority>
- }
- 8002062: bf00 nop
- 8002064: 3718 adds r7, #24
- 8002066: 46bd mov sp, r7
- 8002068: bd80 pop {r7, pc}
-
- 0800206a <HAL_SYSTICK_Config>:
- * @param TicksNumb Specifies the ticks Number of ticks between two interrupts.
- * @retval status: - 0 Function succeeded.
- * - 1 Function failed.
- */
- uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb)
- {
- 800206a: b580 push {r7, lr}
- 800206c: b082 sub sp, #8
- 800206e: af00 add r7, sp, #0
- 8002070: 6078 str r0, [r7, #4]
- return SysTick_Config(TicksNumb);
- 8002072: 6878 ldr r0, [r7, #4]
- 8002074: f7ff ffb0 bl 8001fd8 <SysTick_Config>
- 8002078: 4603 mov r3, r0
- }
- 800207a: 4618 mov r0, r3
- 800207c: 3708 adds r7, #8
- 800207e: 46bd mov sp, r7
- 8002080: bd80 pop {r7, pc}
-
- 08002082 <HAL_SYSTICK_IRQHandler>:
- /**
- * @brief This function handles SYSTICK interrupt request.
- * @retval None
- */
- void HAL_SYSTICK_IRQHandler(void)
- {
- 8002082: b580 push {r7, lr}
- 8002084: af00 add r7, sp, #0
- HAL_SYSTICK_Callback();
- 8002086: f000 f802 bl 800208e <HAL_SYSTICK_Callback>
- }
- 800208a: bf00 nop
- 800208c: bd80 pop {r7, pc}
-
- 0800208e <HAL_SYSTICK_Callback>:
- /**
- * @brief SYSTICK callback.
- * @retval None
- */
- __weak void HAL_SYSTICK_Callback(void)
- {
- 800208e: b480 push {r7}
- 8002090: af00 add r7, sp, #0
- /* NOTE : This function Should not be modified, when the callback is needed,
- the HAL_SYSTICK_Callback could be implemented in the user file
- */
- }
- 8002092: bf00 nop
- 8002094: 46bd mov sp, r7
- 8002096: bc80 pop {r7}
- 8002098: 4770 bx lr
- ...
-
- 0800209c <HAL_GPIO_Init>:
- * @param GPIO_Init pointer to a GPIO_InitTypeDef structure that contains
- * the configuration information for the specified GPIO peripheral.
- * @retval None
- */
- void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
- {
- 800209c: b480 push {r7}
- 800209e: b087 sub sp, #28
- 80020a0: af00 add r7, sp, #0
- 80020a2: 6078 str r0, [r7, #4]
- 80020a4: 6039 str r1, [r7, #0]
- uint32_t position = 0x00;
- 80020a6: 2300 movs r3, #0
- 80020a8: 617b str r3, [r7, #20]
- uint32_t iocurrent = 0x00;
- 80020aa: 2300 movs r3, #0
- 80020ac: 60fb str r3, [r7, #12]
- uint32_t temp = 0x00;
- 80020ae: 2300 movs r3, #0
- 80020b0: 613b str r3, [r7, #16]
- assert_param(IS_GPIO_PIN(GPIO_Init->Pin));
- assert_param(IS_GPIO_MODE(GPIO_Init->Mode));
- assert_param(IS_GPIO_PULL(GPIO_Init->Pull));
-
- /* Configure the port pins */
- while (((GPIO_Init->Pin) >> position) != 0)
- 80020b2: e160 b.n 8002376 <HAL_GPIO_Init+0x2da>
- {
- /* Get current io position */
- iocurrent = (GPIO_Init->Pin) & (1U << position);
- 80020b4: 683b ldr r3, [r7, #0]
- 80020b6: 681a ldr r2, [r3, #0]
- 80020b8: 2101 movs r1, #1
- 80020ba: 697b ldr r3, [r7, #20]
- 80020bc: fa01 f303 lsl.w r3, r1, r3
- 80020c0: 4013 ands r3, r2
- 80020c2: 60fb str r3, [r7, #12]
-
- if (iocurrent)
- 80020c4: 68fb ldr r3, [r7, #12]
- 80020c6: 2b00 cmp r3, #0
- 80020c8: f000 8152 beq.w 8002370 <HAL_GPIO_Init+0x2d4>
- {
- /*--------------------- GPIO Mode Configuration ------------------------*/
- /* In case of Output or Alternate function mode selection */
- if ((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
- 80020cc: 683b ldr r3, [r7, #0]
- 80020ce: 685b ldr r3, [r3, #4]
- 80020d0: 2b01 cmp r3, #1
- 80020d2: d00b beq.n 80020ec <HAL_GPIO_Init+0x50>
- 80020d4: 683b ldr r3, [r7, #0]
- 80020d6: 685b ldr r3, [r3, #4]
- 80020d8: 2b02 cmp r3, #2
- 80020da: d007 beq.n 80020ec <HAL_GPIO_Init+0x50>
- (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
- 80020dc: 683b ldr r3, [r7, #0]
- 80020de: 685b ldr r3, [r3, #4]
- if ((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
- 80020e0: 2b11 cmp r3, #17
- 80020e2: d003 beq.n 80020ec <HAL_GPIO_Init+0x50>
- (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
- 80020e4: 683b ldr r3, [r7, #0]
- 80020e6: 685b ldr r3, [r3, #4]
- 80020e8: 2b12 cmp r3, #18
- 80020ea: d130 bne.n 800214e <HAL_GPIO_Init+0xb2>
- {
- /* Check the Speed parameter */
- assert_param(IS_GPIO_SPEED(GPIO_Init->Speed));
- /* Configure the IO Speed */
- temp = GPIOx->OSPEEDR;
- 80020ec: 687b ldr r3, [r7, #4]
- 80020ee: 689b ldr r3, [r3, #8]
- 80020f0: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, GPIO_OSPEEDER_OSPEEDR0 << (position * 2));
- 80020f2: 697b ldr r3, [r7, #20]
- 80020f4: 005b lsls r3, r3, #1
- 80020f6: 2203 movs r2, #3
- 80020f8: fa02 f303 lsl.w r3, r2, r3
- 80020fc: 43db mvns r3, r3
- 80020fe: 693a ldr r2, [r7, #16]
- 8002100: 4013 ands r3, r2
- 8002102: 613b str r3, [r7, #16]
- SET_BIT(temp, GPIO_Init->Speed << (position * 2));
- 8002104: 683b ldr r3, [r7, #0]
- 8002106: 68da ldr r2, [r3, #12]
- 8002108: 697b ldr r3, [r7, #20]
- 800210a: 005b lsls r3, r3, #1
- 800210c: fa02 f303 lsl.w r3, r2, r3
- 8002110: 693a ldr r2, [r7, #16]
- 8002112: 4313 orrs r3, r2
- 8002114: 613b str r3, [r7, #16]
- GPIOx->OSPEEDR = temp;
- 8002116: 687b ldr r3, [r7, #4]
- 8002118: 693a ldr r2, [r7, #16]
- 800211a: 609a str r2, [r3, #8]
-
- /* Configure the IO Output Type */
- temp = GPIOx->OTYPER;
- 800211c: 687b ldr r3, [r7, #4]
- 800211e: 685b ldr r3, [r3, #4]
- 8002120: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, GPIO_OTYPER_OT_0 << position) ;
- 8002122: 2201 movs r2, #1
- 8002124: 697b ldr r3, [r7, #20]
- 8002126: fa02 f303 lsl.w r3, r2, r3
- 800212a: 43db mvns r3, r3
- 800212c: 693a ldr r2, [r7, #16]
- 800212e: 4013 ands r3, r2
- 8002130: 613b str r3, [r7, #16]
- SET_BIT(temp, ((GPIO_Init->Mode & GPIO_OUTPUT_TYPE) >> 4) << position);
- 8002132: 683b ldr r3, [r7, #0]
- 8002134: 685b ldr r3, [r3, #4]
- 8002136: 091b lsrs r3, r3, #4
- 8002138: f003 0201 and.w r2, r3, #1
- 800213c: 697b ldr r3, [r7, #20]
- 800213e: fa02 f303 lsl.w r3, r2, r3
- 8002142: 693a ldr r2, [r7, #16]
- 8002144: 4313 orrs r3, r2
- 8002146: 613b str r3, [r7, #16]
- GPIOx->OTYPER = temp;
- 8002148: 687b ldr r3, [r7, #4]
- 800214a: 693a ldr r2, [r7, #16]
- 800214c: 605a str r2, [r3, #4]
- }
-
- /* Activate the Pull-up or Pull down resistor for the current IO */
- temp = GPIOx->PUPDR;
- 800214e: 687b ldr r3, [r7, #4]
- 8002150: 68db ldr r3, [r3, #12]
- 8002152: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, GPIO_PUPDR_PUPDR0 << (position * 2));
- 8002154: 697b ldr r3, [r7, #20]
- 8002156: 005b lsls r3, r3, #1
- 8002158: 2203 movs r2, #3
- 800215a: fa02 f303 lsl.w r3, r2, r3
- 800215e: 43db mvns r3, r3
- 8002160: 693a ldr r2, [r7, #16]
- 8002162: 4013 ands r3, r2
- 8002164: 613b str r3, [r7, #16]
- SET_BIT(temp, (GPIO_Init->Pull) << (position * 2));
- 8002166: 683b ldr r3, [r7, #0]
- 8002168: 689a ldr r2, [r3, #8]
- 800216a: 697b ldr r3, [r7, #20]
- 800216c: 005b lsls r3, r3, #1
- 800216e: fa02 f303 lsl.w r3, r2, r3
- 8002172: 693a ldr r2, [r7, #16]
- 8002174: 4313 orrs r3, r2
- 8002176: 613b str r3, [r7, #16]
- GPIOx->PUPDR = temp;
- 8002178: 687b ldr r3, [r7, #4]
- 800217a: 693a ldr r2, [r7, #16]
- 800217c: 60da str r2, [r3, #12]
-
- /* In case of Alternate function mode selection */
- if ((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
- 800217e: 683b ldr r3, [r7, #0]
- 8002180: 685b ldr r3, [r3, #4]
- 8002182: 2b02 cmp r3, #2
- 8002184: d003 beq.n 800218e <HAL_GPIO_Init+0xf2>
- 8002186: 683b ldr r3, [r7, #0]
- 8002188: 685b ldr r3, [r3, #4]
- 800218a: 2b12 cmp r3, #18
- 800218c: d123 bne.n 80021d6 <HAL_GPIO_Init+0x13a>
- assert_param(IS_GPIO_AF_INSTANCE(GPIOx));
- assert_param(IS_GPIO_AF(GPIO_Init->Alternate));
-
- /* Configure Alternate function mapped with the current IO */
- /* Identify AFRL or AFRH register based on IO position*/
- temp = GPIOx->AFR[position >> 3];
- 800218e: 697b ldr r3, [r7, #20]
- 8002190: 08da lsrs r2, r3, #3
- 8002192: 687b ldr r3, [r7, #4]
- 8002194: 3208 adds r2, #8
- 8002196: f853 3022 ldr.w r3, [r3, r2, lsl #2]
- 800219a: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, 0xFU << ((uint32_t)(position & 0x07U) * 4));
- 800219c: 697b ldr r3, [r7, #20]
- 800219e: f003 0307 and.w r3, r3, #7
- 80021a2: 009b lsls r3, r3, #2
- 80021a4: 220f movs r2, #15
- 80021a6: fa02 f303 lsl.w r3, r2, r3
- 80021aa: 43db mvns r3, r3
- 80021ac: 693a ldr r2, [r7, #16]
- 80021ae: 4013 ands r3, r2
- 80021b0: 613b str r3, [r7, #16]
- SET_BIT(temp, (uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & 0x07U) * 4));
- 80021b2: 683b ldr r3, [r7, #0]
- 80021b4: 691a ldr r2, [r3, #16]
- 80021b6: 697b ldr r3, [r7, #20]
- 80021b8: f003 0307 and.w r3, r3, #7
- 80021bc: 009b lsls r3, r3, #2
- 80021be: fa02 f303 lsl.w r3, r2, r3
- 80021c2: 693a ldr r2, [r7, #16]
- 80021c4: 4313 orrs r3, r2
- 80021c6: 613b str r3, [r7, #16]
- GPIOx->AFR[position >> 3] = temp;
- 80021c8: 697b ldr r3, [r7, #20]
- 80021ca: 08da lsrs r2, r3, #3
- 80021cc: 687b ldr r3, [r7, #4]
- 80021ce: 3208 adds r2, #8
- 80021d0: 6939 ldr r1, [r7, #16]
- 80021d2: f843 1022 str.w r1, [r3, r2, lsl #2]
- }
-
- /* Configure IO Direction mode (Input, Output, Alternate or Analog) */
- temp = GPIOx->MODER;
- 80021d6: 687b ldr r3, [r7, #4]
- 80021d8: 681b ldr r3, [r3, #0]
- 80021da: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, GPIO_MODER_MODER0 << (position * 2));
- 80021dc: 697b ldr r3, [r7, #20]
- 80021de: 005b lsls r3, r3, #1
- 80021e0: 2203 movs r2, #3
- 80021e2: fa02 f303 lsl.w r3, r2, r3
- 80021e6: 43db mvns r3, r3
- 80021e8: 693a ldr r2, [r7, #16]
- 80021ea: 4013 ands r3, r2
- 80021ec: 613b str r3, [r7, #16]
- SET_BIT(temp, (GPIO_Init->Mode & GPIO_MODE) << (position * 2));
- 80021ee: 683b ldr r3, [r7, #0]
- 80021f0: 685b ldr r3, [r3, #4]
- 80021f2: f003 0203 and.w r2, r3, #3
- 80021f6: 697b ldr r3, [r7, #20]
- 80021f8: 005b lsls r3, r3, #1
- 80021fa: fa02 f303 lsl.w r3, r2, r3
- 80021fe: 693a ldr r2, [r7, #16]
- 8002200: 4313 orrs r3, r2
- 8002202: 613b str r3, [r7, #16]
- GPIOx->MODER = temp;
- 8002204: 687b ldr r3, [r7, #4]
- 8002206: 693a ldr r2, [r7, #16]
- 8002208: 601a str r2, [r3, #0]
-
- /*--------------------- EXTI Mode Configuration ------------------------*/
- /* Configure the External Interrupt or event for the current IO */
- if ((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE)
- 800220a: 683b ldr r3, [r7, #0]
- 800220c: 685b ldr r3, [r3, #4]
- 800220e: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
- 8002212: 2b00 cmp r3, #0
- 8002214: f000 80ac beq.w 8002370 <HAL_GPIO_Init+0x2d4>
- {
- /* Enable SYSCFG Clock */
- __HAL_RCC_SYSCFG_CLK_ENABLE();
- 8002218: 4b5d ldr r3, [pc, #372] ; (8002390 <HAL_GPIO_Init+0x2f4>)
- 800221a: 6a1b ldr r3, [r3, #32]
- 800221c: 4a5c ldr r2, [pc, #368] ; (8002390 <HAL_GPIO_Init+0x2f4>)
- 800221e: f043 0301 orr.w r3, r3, #1
- 8002222: 6213 str r3, [r2, #32]
- 8002224: 4b5a ldr r3, [pc, #360] ; (8002390 <HAL_GPIO_Init+0x2f4>)
- 8002226: 6a1b ldr r3, [r3, #32]
- 8002228: f003 0301 and.w r3, r3, #1
- 800222c: 60bb str r3, [r7, #8]
- 800222e: 68bb ldr r3, [r7, #8]
-
- temp = SYSCFG->EXTICR[position >> 2];
- 8002230: 4a58 ldr r2, [pc, #352] ; (8002394 <HAL_GPIO_Init+0x2f8>)
- 8002232: 697b ldr r3, [r7, #20]
- 8002234: 089b lsrs r3, r3, #2
- 8002236: 3302 adds r3, #2
- 8002238: f852 3023 ldr.w r3, [r2, r3, lsl #2]
- 800223c: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, (0x0FU) << (4 * (position & 0x03)));
- 800223e: 697b ldr r3, [r7, #20]
- 8002240: f003 0303 and.w r3, r3, #3
- 8002244: 009b lsls r3, r3, #2
- 8002246: 220f movs r2, #15
- 8002248: fa02 f303 lsl.w r3, r2, r3
- 800224c: 43db mvns r3, r3
- 800224e: 693a ldr r2, [r7, #16]
- 8002250: 4013 ands r3, r2
- 8002252: 613b str r3, [r7, #16]
- SET_BIT(temp, (GPIO_GET_INDEX(GPIOx)) << (4 * (position & 0x03)));
- 8002254: 687b ldr r3, [r7, #4]
- 8002256: 4a50 ldr r2, [pc, #320] ; (8002398 <HAL_GPIO_Init+0x2fc>)
- 8002258: 4293 cmp r3, r2
- 800225a: d025 beq.n 80022a8 <HAL_GPIO_Init+0x20c>
- 800225c: 687b ldr r3, [r7, #4]
- 800225e: 4a4f ldr r2, [pc, #316] ; (800239c <HAL_GPIO_Init+0x300>)
- 8002260: 4293 cmp r3, r2
- 8002262: d01f beq.n 80022a4 <HAL_GPIO_Init+0x208>
- 8002264: 687b ldr r3, [r7, #4]
- 8002266: 4a4e ldr r2, [pc, #312] ; (80023a0 <HAL_GPIO_Init+0x304>)
- 8002268: 4293 cmp r3, r2
- 800226a: d019 beq.n 80022a0 <HAL_GPIO_Init+0x204>
- 800226c: 687b ldr r3, [r7, #4]
- 800226e: 4a4d ldr r2, [pc, #308] ; (80023a4 <HAL_GPIO_Init+0x308>)
- 8002270: 4293 cmp r3, r2
- 8002272: d013 beq.n 800229c <HAL_GPIO_Init+0x200>
- 8002274: 687b ldr r3, [r7, #4]
- 8002276: 4a4c ldr r2, [pc, #304] ; (80023a8 <HAL_GPIO_Init+0x30c>)
- 8002278: 4293 cmp r3, r2
- 800227a: d00d beq.n 8002298 <HAL_GPIO_Init+0x1fc>
- 800227c: 687b ldr r3, [r7, #4]
- 800227e: 4a4b ldr r2, [pc, #300] ; (80023ac <HAL_GPIO_Init+0x310>)
- 8002280: 4293 cmp r3, r2
- 8002282: d007 beq.n 8002294 <HAL_GPIO_Init+0x1f8>
- 8002284: 687b ldr r3, [r7, #4]
- 8002286: 4a4a ldr r2, [pc, #296] ; (80023b0 <HAL_GPIO_Init+0x314>)
- 8002288: 4293 cmp r3, r2
- 800228a: d101 bne.n 8002290 <HAL_GPIO_Init+0x1f4>
- 800228c: 2306 movs r3, #6
- 800228e: e00c b.n 80022aa <HAL_GPIO_Init+0x20e>
- 8002290: 2307 movs r3, #7
- 8002292: e00a b.n 80022aa <HAL_GPIO_Init+0x20e>
- 8002294: 2305 movs r3, #5
- 8002296: e008 b.n 80022aa <HAL_GPIO_Init+0x20e>
- 8002298: 2304 movs r3, #4
- 800229a: e006 b.n 80022aa <HAL_GPIO_Init+0x20e>
- 800229c: 2303 movs r3, #3
- 800229e: e004 b.n 80022aa <HAL_GPIO_Init+0x20e>
- 80022a0: 2302 movs r3, #2
- 80022a2: e002 b.n 80022aa <HAL_GPIO_Init+0x20e>
- 80022a4: 2301 movs r3, #1
- 80022a6: e000 b.n 80022aa <HAL_GPIO_Init+0x20e>
- 80022a8: 2300 movs r3, #0
- 80022aa: 697a ldr r2, [r7, #20]
- 80022ac: f002 0203 and.w r2, r2, #3
- 80022b0: 0092 lsls r2, r2, #2
- 80022b2: 4093 lsls r3, r2
- 80022b4: 693a ldr r2, [r7, #16]
- 80022b6: 4313 orrs r3, r2
- 80022b8: 613b str r3, [r7, #16]
- SYSCFG->EXTICR[position >> 2] = temp;
- 80022ba: 4936 ldr r1, [pc, #216] ; (8002394 <HAL_GPIO_Init+0x2f8>)
- 80022bc: 697b ldr r3, [r7, #20]
- 80022be: 089b lsrs r3, r3, #2
- 80022c0: 3302 adds r3, #2
- 80022c2: 693a ldr r2, [r7, #16]
- 80022c4: f841 2023 str.w r2, [r1, r3, lsl #2]
-
- /* Clear EXTI line configuration */
- temp = EXTI->IMR;
- 80022c8: 4b3a ldr r3, [pc, #232] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 80022ca: 681b ldr r3, [r3, #0]
- 80022cc: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, (uint32_t)iocurrent);
- 80022ce: 68fb ldr r3, [r7, #12]
- 80022d0: 43db mvns r3, r3
- 80022d2: 693a ldr r2, [r7, #16]
- 80022d4: 4013 ands r3, r2
- 80022d6: 613b str r3, [r7, #16]
- if ((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT)
- 80022d8: 683b ldr r3, [r7, #0]
- 80022da: 685b ldr r3, [r3, #4]
- 80022dc: f403 3380 and.w r3, r3, #65536 ; 0x10000
- 80022e0: 2b00 cmp r3, #0
- 80022e2: d003 beq.n 80022ec <HAL_GPIO_Init+0x250>
- {
- SET_BIT(temp, iocurrent);
- 80022e4: 693a ldr r2, [r7, #16]
- 80022e6: 68fb ldr r3, [r7, #12]
- 80022e8: 4313 orrs r3, r2
- 80022ea: 613b str r3, [r7, #16]
- }
- EXTI->IMR = temp;
- 80022ec: 4a31 ldr r2, [pc, #196] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 80022ee: 693b ldr r3, [r7, #16]
- 80022f0: 6013 str r3, [r2, #0]
-
- temp = EXTI->EMR;
- 80022f2: 4b30 ldr r3, [pc, #192] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 80022f4: 685b ldr r3, [r3, #4]
- 80022f6: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, (uint32_t)iocurrent);
- 80022f8: 68fb ldr r3, [r7, #12]
- 80022fa: 43db mvns r3, r3
- 80022fc: 693a ldr r2, [r7, #16]
- 80022fe: 4013 ands r3, r2
- 8002300: 613b str r3, [r7, #16]
- if ((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT)
- 8002302: 683b ldr r3, [r7, #0]
- 8002304: 685b ldr r3, [r3, #4]
- 8002306: f403 3300 and.w r3, r3, #131072 ; 0x20000
- 800230a: 2b00 cmp r3, #0
- 800230c: d003 beq.n 8002316 <HAL_GPIO_Init+0x27a>
- {
- SET_BIT(temp, iocurrent);
- 800230e: 693a ldr r2, [r7, #16]
- 8002310: 68fb ldr r3, [r7, #12]
- 8002312: 4313 orrs r3, r2
- 8002314: 613b str r3, [r7, #16]
- }
- EXTI->EMR = temp;
- 8002316: 4a27 ldr r2, [pc, #156] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 8002318: 693b ldr r3, [r7, #16]
- 800231a: 6053 str r3, [r2, #4]
-
- /* Clear Rising Falling edge configuration */
- temp = EXTI->RTSR;
- 800231c: 4b25 ldr r3, [pc, #148] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 800231e: 689b ldr r3, [r3, #8]
- 8002320: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, (uint32_t)iocurrent);
- 8002322: 68fb ldr r3, [r7, #12]
- 8002324: 43db mvns r3, r3
- 8002326: 693a ldr r2, [r7, #16]
- 8002328: 4013 ands r3, r2
- 800232a: 613b str r3, [r7, #16]
- if ((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE)
- 800232c: 683b ldr r3, [r7, #0]
- 800232e: 685b ldr r3, [r3, #4]
- 8002330: f403 1380 and.w r3, r3, #1048576 ; 0x100000
- 8002334: 2b00 cmp r3, #0
- 8002336: d003 beq.n 8002340 <HAL_GPIO_Init+0x2a4>
- {
- SET_BIT(temp, iocurrent);
- 8002338: 693a ldr r2, [r7, #16]
- 800233a: 68fb ldr r3, [r7, #12]
- 800233c: 4313 orrs r3, r2
- 800233e: 613b str r3, [r7, #16]
- }
- EXTI->RTSR = temp;
- 8002340: 4a1c ldr r2, [pc, #112] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 8002342: 693b ldr r3, [r7, #16]
- 8002344: 6093 str r3, [r2, #8]
-
- temp = EXTI->FTSR;
- 8002346: 4b1b ldr r3, [pc, #108] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 8002348: 68db ldr r3, [r3, #12]
- 800234a: 613b str r3, [r7, #16]
- CLEAR_BIT(temp, (uint32_t)iocurrent);
- 800234c: 68fb ldr r3, [r7, #12]
- 800234e: 43db mvns r3, r3
- 8002350: 693a ldr r2, [r7, #16]
- 8002352: 4013 ands r3, r2
- 8002354: 613b str r3, [r7, #16]
- if ((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE)
- 8002356: 683b ldr r3, [r7, #0]
- 8002358: 685b ldr r3, [r3, #4]
- 800235a: f403 1300 and.w r3, r3, #2097152 ; 0x200000
- 800235e: 2b00 cmp r3, #0
- 8002360: d003 beq.n 800236a <HAL_GPIO_Init+0x2ce>
- {
- SET_BIT(temp, iocurrent);
- 8002362: 693a ldr r2, [r7, #16]
- 8002364: 68fb ldr r3, [r7, #12]
- 8002366: 4313 orrs r3, r2
- 8002368: 613b str r3, [r7, #16]
- }
- EXTI->FTSR = temp;
- 800236a: 4a12 ldr r2, [pc, #72] ; (80023b4 <HAL_GPIO_Init+0x318>)
- 800236c: 693b ldr r3, [r7, #16]
- 800236e: 60d3 str r3, [r2, #12]
- }
- }
-
- position++;
- 8002370: 697b ldr r3, [r7, #20]
- 8002372: 3301 adds r3, #1
- 8002374: 617b str r3, [r7, #20]
- while (((GPIO_Init->Pin) >> position) != 0)
- 8002376: 683b ldr r3, [r7, #0]
- 8002378: 681a ldr r2, [r3, #0]
- 800237a: 697b ldr r3, [r7, #20]
- 800237c: fa22 f303 lsr.w r3, r2, r3
- 8002380: 2b00 cmp r3, #0
- 8002382: f47f ae97 bne.w 80020b4 <HAL_GPIO_Init+0x18>
- }
- }
- 8002386: bf00 nop
- 8002388: 371c adds r7, #28
- 800238a: 46bd mov sp, r7
- 800238c: bc80 pop {r7}
- 800238e: 4770 bx lr
- 8002390: 40023800 .word 0x40023800
- 8002394: 40010000 .word 0x40010000
- 8002398: 40020000 .word 0x40020000
- 800239c: 40020400 .word 0x40020400
- 80023a0: 40020800 .word 0x40020800
- 80023a4: 40020c00 .word 0x40020c00
- 80023a8: 40021000 .word 0x40021000
- 80023ac: 40021400 .word 0x40021400
- 80023b0: 40021800 .word 0x40021800
- 80023b4: 40010400 .word 0x40010400
-
- 080023b8 <HAL_GPIO_WritePin>:
- * @arg GPIO_PIN_RESET: to clear the port pin
- * @arg GPIO_PIN_SET: to set the port pin
- * @retval None
- */
- void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
- {
- 80023b8: b480 push {r7}
- 80023ba: b083 sub sp, #12
- 80023bc: af00 add r7, sp, #0
- 80023be: 6078 str r0, [r7, #4]
- 80023c0: 460b mov r3, r1
- 80023c2: 807b strh r3, [r7, #2]
- 80023c4: 4613 mov r3, r2
- 80023c6: 707b strb r3, [r7, #1]
- /* Check the parameters */
- assert_param(IS_GPIO_PIN(GPIO_Pin));
- assert_param(IS_GPIO_PIN_ACTION(PinState));
-
- if (PinState != GPIO_PIN_RESET)
- 80023c8: 787b ldrb r3, [r7, #1]
- 80023ca: 2b00 cmp r3, #0
- 80023cc: d003 beq.n 80023d6 <HAL_GPIO_WritePin+0x1e>
- {
- GPIOx->BSRR = (uint32_t)GPIO_Pin;
- 80023ce: 887a ldrh r2, [r7, #2]
- 80023d0: 687b ldr r3, [r7, #4]
- 80023d2: 619a str r2, [r3, #24]
- }
- else
- {
- GPIOx->BSRR = (uint32_t)GPIO_Pin << 16 ;
- }
- }
- 80023d4: e003 b.n 80023de <HAL_GPIO_WritePin+0x26>
- GPIOx->BSRR = (uint32_t)GPIO_Pin << 16 ;
- 80023d6: 887b ldrh r3, [r7, #2]
- 80023d8: 041a lsls r2, r3, #16
- 80023da: 687b ldr r3, [r7, #4]
- 80023dc: 619a str r2, [r3, #24]
- }
- 80023de: bf00 nop
- 80023e0: 370c adds r7, #12
- 80023e2: 46bd mov sp, r7
- 80023e4: bc80 pop {r7}
- 80023e6: 4770 bx lr
-
- 080023e8 <HAL_RCC_OscConfig>:
- * supported by this macro. User should request a transition to HSE Off
- * first and then HSE On or HSE Bypass.
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
- {
- 80023e8: b580 push {r7, lr}
- 80023ea: b088 sub sp, #32
- 80023ec: af00 add r7, sp, #0
- 80023ee: 6078 str r0, [r7, #4]
- uint32_t tickstart;
- HAL_StatusTypeDef status;
- uint32_t sysclk_source, pll_config;
-
- /* Check the parameters */
- if(RCC_OscInitStruct == NULL)
- 80023f0: 687b ldr r3, [r7, #4]
- 80023f2: 2b00 cmp r3, #0
- 80023f4: d101 bne.n 80023fa <HAL_RCC_OscConfig+0x12>
- {
- return HAL_ERROR;
- 80023f6: 2301 movs r3, #1
- 80023f8: e31d b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- }
-
- assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType));
-
- sysclk_source = __HAL_RCC_GET_SYSCLK_SOURCE();
- 80023fa: 4b94 ldr r3, [pc, #592] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80023fc: 689b ldr r3, [r3, #8]
- 80023fe: f003 030c and.w r3, r3, #12
- 8002402: 61bb str r3, [r7, #24]
- pll_config = __HAL_RCC_GET_PLL_OSCSOURCE();
- 8002404: 4b91 ldr r3, [pc, #580] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002406: 689b ldr r3, [r3, #8]
- 8002408: f403 3380 and.w r3, r3, #65536 ; 0x10000
- 800240c: 617b str r3, [r7, #20]
-
- /*------------------------------- HSE Configuration ------------------------*/
- if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE)
- 800240e: 687b ldr r3, [r7, #4]
- 8002410: 681b ldr r3, [r3, #0]
- 8002412: f003 0301 and.w r3, r3, #1
- 8002416: 2b00 cmp r3, #0
- 8002418: d07b beq.n 8002512 <HAL_RCC_OscConfig+0x12a>
- {
- /* Check the parameters */
- assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState));
-
- /* When the HSE is used as system clock or clock source for PLL in these cases it is not allowed to be disabled */
- if((sysclk_source == RCC_SYSCLKSOURCE_STATUS_HSE)
- 800241a: 69bb ldr r3, [r7, #24]
- 800241c: 2b08 cmp r3, #8
- 800241e: d006 beq.n 800242e <HAL_RCC_OscConfig+0x46>
- || ((sysclk_source == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (pll_config == RCC_PLLSOURCE_HSE)))
- 8002420: 69bb ldr r3, [r7, #24]
- 8002422: 2b0c cmp r3, #12
- 8002424: d10f bne.n 8002446 <HAL_RCC_OscConfig+0x5e>
- 8002426: 697b ldr r3, [r7, #20]
- 8002428: f5b3 3f80 cmp.w r3, #65536 ; 0x10000
- 800242c: d10b bne.n 8002446 <HAL_RCC_OscConfig+0x5e>
- {
- if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF))
- 800242e: 4b87 ldr r3, [pc, #540] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002430: 681b ldr r3, [r3, #0]
- 8002432: f403 3300 and.w r3, r3, #131072 ; 0x20000
- 8002436: 2b00 cmp r3, #0
- 8002438: d06a beq.n 8002510 <HAL_RCC_OscConfig+0x128>
- 800243a: 687b ldr r3, [r7, #4]
- 800243c: 685b ldr r3, [r3, #4]
- 800243e: 2b00 cmp r3, #0
- 8002440: d166 bne.n 8002510 <HAL_RCC_OscConfig+0x128>
- {
- return HAL_ERROR;
- 8002442: 2301 movs r3, #1
- 8002444: e2f7 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- }
- }
- else
- {
- /* Set the new HSE configuration ---------------------------------------*/
- __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState);
- 8002446: 687b ldr r3, [r7, #4]
- 8002448: 685b ldr r3, [r3, #4]
- 800244a: 2b01 cmp r3, #1
- 800244c: d106 bne.n 800245c <HAL_RCC_OscConfig+0x74>
- 800244e: 4b7f ldr r3, [pc, #508] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002450: 681b ldr r3, [r3, #0]
- 8002452: 4a7e ldr r2, [pc, #504] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002454: f443 3380 orr.w r3, r3, #65536 ; 0x10000
- 8002458: 6013 str r3, [r2, #0]
- 800245a: e02d b.n 80024b8 <HAL_RCC_OscConfig+0xd0>
- 800245c: 687b ldr r3, [r7, #4]
- 800245e: 685b ldr r3, [r3, #4]
- 8002460: 2b00 cmp r3, #0
- 8002462: d10c bne.n 800247e <HAL_RCC_OscConfig+0x96>
- 8002464: 4b79 ldr r3, [pc, #484] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002466: 681b ldr r3, [r3, #0]
- 8002468: 4a78 ldr r2, [pc, #480] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 800246a: f423 3380 bic.w r3, r3, #65536 ; 0x10000
- 800246e: 6013 str r3, [r2, #0]
- 8002470: 4b76 ldr r3, [pc, #472] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002472: 681b ldr r3, [r3, #0]
- 8002474: 4a75 ldr r2, [pc, #468] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002476: f423 2380 bic.w r3, r3, #262144 ; 0x40000
- 800247a: 6013 str r3, [r2, #0]
- 800247c: e01c b.n 80024b8 <HAL_RCC_OscConfig+0xd0>
- 800247e: 687b ldr r3, [r7, #4]
- 8002480: 685b ldr r3, [r3, #4]
- 8002482: 2b05 cmp r3, #5
- 8002484: d10c bne.n 80024a0 <HAL_RCC_OscConfig+0xb8>
- 8002486: 4b71 ldr r3, [pc, #452] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002488: 681b ldr r3, [r3, #0]
- 800248a: 4a70 ldr r2, [pc, #448] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 800248c: f443 2380 orr.w r3, r3, #262144 ; 0x40000
- 8002490: 6013 str r3, [r2, #0]
- 8002492: 4b6e ldr r3, [pc, #440] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002494: 681b ldr r3, [r3, #0]
- 8002496: 4a6d ldr r2, [pc, #436] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002498: f443 3380 orr.w r3, r3, #65536 ; 0x10000
- 800249c: 6013 str r3, [r2, #0]
- 800249e: e00b b.n 80024b8 <HAL_RCC_OscConfig+0xd0>
- 80024a0: 4b6a ldr r3, [pc, #424] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80024a2: 681b ldr r3, [r3, #0]
- 80024a4: 4a69 ldr r2, [pc, #420] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80024a6: f423 3380 bic.w r3, r3, #65536 ; 0x10000
- 80024aa: 6013 str r3, [r2, #0]
- 80024ac: 4b67 ldr r3, [pc, #412] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80024ae: 681b ldr r3, [r3, #0]
- 80024b0: 4a66 ldr r2, [pc, #408] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80024b2: f423 2380 bic.w r3, r3, #262144 ; 0x40000
- 80024b6: 6013 str r3, [r2, #0]
-
- /* Check the HSE State */
- if(RCC_OscInitStruct->HSEState != RCC_HSE_OFF)
- 80024b8: 687b ldr r3, [r7, #4]
- 80024ba: 685b ldr r3, [r3, #4]
- 80024bc: 2b00 cmp r3, #0
- 80024be: d013 beq.n 80024e8 <HAL_RCC_OscConfig+0x100>
- {
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 80024c0: f7ff fcd0 bl 8001e64 <HAL_GetTick>
- 80024c4: 6138 str r0, [r7, #16]
-
- /* Wait till HSE is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == 0U)
- 80024c6: e008 b.n 80024da <HAL_RCC_OscConfig+0xf2>
- {
- if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE)
- 80024c8: f7ff fccc bl 8001e64 <HAL_GetTick>
- 80024cc: 4602 mov r2, r0
- 80024ce: 693b ldr r3, [r7, #16]
- 80024d0: 1ad3 subs r3, r2, r3
- 80024d2: 2b64 cmp r3, #100 ; 0x64
- 80024d4: d901 bls.n 80024da <HAL_RCC_OscConfig+0xf2>
- {
- return HAL_TIMEOUT;
- 80024d6: 2303 movs r3, #3
- 80024d8: e2ad b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == 0U)
- 80024da: 4b5c ldr r3, [pc, #368] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80024dc: 681b ldr r3, [r3, #0]
- 80024de: f403 3300 and.w r3, r3, #131072 ; 0x20000
- 80024e2: 2b00 cmp r3, #0
- 80024e4: d0f0 beq.n 80024c8 <HAL_RCC_OscConfig+0xe0>
- 80024e6: e014 b.n 8002512 <HAL_RCC_OscConfig+0x12a>
- }
- }
- else
- {
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 80024e8: f7ff fcbc bl 8001e64 <HAL_GetTick>
- 80024ec: 6138 str r0, [r7, #16]
-
- /* Wait till HSE is disabled */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U)
- 80024ee: e008 b.n 8002502 <HAL_RCC_OscConfig+0x11a>
- {
- if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE)
- 80024f0: f7ff fcb8 bl 8001e64 <HAL_GetTick>
- 80024f4: 4602 mov r2, r0
- 80024f6: 693b ldr r3, [r7, #16]
- 80024f8: 1ad3 subs r3, r2, r3
- 80024fa: 2b64 cmp r3, #100 ; 0x64
- 80024fc: d901 bls.n 8002502 <HAL_RCC_OscConfig+0x11a>
- {
- return HAL_TIMEOUT;
- 80024fe: 2303 movs r3, #3
- 8002500: e299 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U)
- 8002502: 4b52 ldr r3, [pc, #328] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002504: 681b ldr r3, [r3, #0]
- 8002506: f403 3300 and.w r3, r3, #131072 ; 0x20000
- 800250a: 2b00 cmp r3, #0
- 800250c: d1f0 bne.n 80024f0 <HAL_RCC_OscConfig+0x108>
- 800250e: e000 b.n 8002512 <HAL_RCC_OscConfig+0x12a>
- if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF))
- 8002510: bf00 nop
- }
- }
- }
- }
- /*----------------------------- HSI Configuration --------------------------*/
- if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI)
- 8002512: 687b ldr r3, [r7, #4]
- 8002514: 681b ldr r3, [r3, #0]
- 8002516: f003 0302 and.w r3, r3, #2
- 800251a: 2b00 cmp r3, #0
- 800251c: d05a beq.n 80025d4 <HAL_RCC_OscConfig+0x1ec>
- /* Check the parameters */
- assert_param(IS_RCC_HSI(RCC_OscInitStruct->HSIState));
- assert_param(IS_RCC_CALIBRATION_VALUE(RCC_OscInitStruct->HSICalibrationValue));
-
- /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */
- if((sysclk_source == RCC_SYSCLKSOURCE_STATUS_HSI)
- 800251e: 69bb ldr r3, [r7, #24]
- 8002520: 2b04 cmp r3, #4
- 8002522: d005 beq.n 8002530 <HAL_RCC_OscConfig+0x148>
- || ((sysclk_source == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (pll_config == RCC_PLLSOURCE_HSI)))
- 8002524: 69bb ldr r3, [r7, #24]
- 8002526: 2b0c cmp r3, #12
- 8002528: d119 bne.n 800255e <HAL_RCC_OscConfig+0x176>
- 800252a: 697b ldr r3, [r7, #20]
- 800252c: 2b00 cmp r3, #0
- 800252e: d116 bne.n 800255e <HAL_RCC_OscConfig+0x176>
- {
- /* When HSI is used as system clock it will not disabled */
- if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON))
- 8002530: 4b46 ldr r3, [pc, #280] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002532: 681b ldr r3, [r3, #0]
- 8002534: f003 0302 and.w r3, r3, #2
- 8002538: 2b00 cmp r3, #0
- 800253a: d005 beq.n 8002548 <HAL_RCC_OscConfig+0x160>
- 800253c: 687b ldr r3, [r7, #4]
- 800253e: 68db ldr r3, [r3, #12]
- 8002540: 2b01 cmp r3, #1
- 8002542: d001 beq.n 8002548 <HAL_RCC_OscConfig+0x160>
- {
- return HAL_ERROR;
- 8002544: 2301 movs r3, #1
- 8002546: e276 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- }
- /* Otherwise, just the calibration is allowed */
- else
- {
- /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/
- __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue);
- 8002548: 4b40 ldr r3, [pc, #256] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 800254a: 685b ldr r3, [r3, #4]
- 800254c: f423 52f8 bic.w r2, r3, #7936 ; 0x1f00
- 8002550: 687b ldr r3, [r7, #4]
- 8002552: 691b ldr r3, [r3, #16]
- 8002554: 021b lsls r3, r3, #8
- 8002556: 493d ldr r1, [pc, #244] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002558: 4313 orrs r3, r2
- 800255a: 604b str r3, [r1, #4]
- if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON))
- 800255c: e03a b.n 80025d4 <HAL_RCC_OscConfig+0x1ec>
- }
- }
- else
- {
- /* Check the HSI State */
- if(RCC_OscInitStruct->HSIState != RCC_HSI_OFF)
- 800255e: 687b ldr r3, [r7, #4]
- 8002560: 68db ldr r3, [r3, #12]
- 8002562: 2b00 cmp r3, #0
- 8002564: d020 beq.n 80025a8 <HAL_RCC_OscConfig+0x1c0>
- {
- /* Enable the Internal High Speed oscillator (HSI). */
- __HAL_RCC_HSI_ENABLE();
- 8002566: 4b3a ldr r3, [pc, #232] ; (8002650 <HAL_RCC_OscConfig+0x268>)
- 8002568: 2201 movs r2, #1
- 800256a: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 800256c: f7ff fc7a bl 8001e64 <HAL_GetTick>
- 8002570: 6138 str r0, [r7, #16]
-
- /* Wait till HSI is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == 0U)
- 8002572: e008 b.n 8002586 <HAL_RCC_OscConfig+0x19e>
- {
- if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE)
- 8002574: f7ff fc76 bl 8001e64 <HAL_GetTick>
- 8002578: 4602 mov r2, r0
- 800257a: 693b ldr r3, [r7, #16]
- 800257c: 1ad3 subs r3, r2, r3
- 800257e: 2b02 cmp r3, #2
- 8002580: d901 bls.n 8002586 <HAL_RCC_OscConfig+0x19e>
- {
- return HAL_TIMEOUT;
- 8002582: 2303 movs r3, #3
- 8002584: e257 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == 0U)
- 8002586: 4b31 ldr r3, [pc, #196] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002588: 681b ldr r3, [r3, #0]
- 800258a: f003 0302 and.w r3, r3, #2
- 800258e: 2b00 cmp r3, #0
- 8002590: d0f0 beq.n 8002574 <HAL_RCC_OscConfig+0x18c>
- }
- }
-
- /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/
- __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue);
- 8002592: 4b2e ldr r3, [pc, #184] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002594: 685b ldr r3, [r3, #4]
- 8002596: f423 52f8 bic.w r2, r3, #7936 ; 0x1f00
- 800259a: 687b ldr r3, [r7, #4]
- 800259c: 691b ldr r3, [r3, #16]
- 800259e: 021b lsls r3, r3, #8
- 80025a0: 492a ldr r1, [pc, #168] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80025a2: 4313 orrs r3, r2
- 80025a4: 604b str r3, [r1, #4]
- 80025a6: e015 b.n 80025d4 <HAL_RCC_OscConfig+0x1ec>
- }
- else
- {
- /* Disable the Internal High Speed oscillator (HSI). */
- __HAL_RCC_HSI_DISABLE();
- 80025a8: 4b29 ldr r3, [pc, #164] ; (8002650 <HAL_RCC_OscConfig+0x268>)
- 80025aa: 2200 movs r2, #0
- 80025ac: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 80025ae: f7ff fc59 bl 8001e64 <HAL_GetTick>
- 80025b2: 6138 str r0, [r7, #16]
-
- /* Wait till HSI is disabled */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U)
- 80025b4: e008 b.n 80025c8 <HAL_RCC_OscConfig+0x1e0>
- {
- if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE)
- 80025b6: f7ff fc55 bl 8001e64 <HAL_GetTick>
- 80025ba: 4602 mov r2, r0
- 80025bc: 693b ldr r3, [r7, #16]
- 80025be: 1ad3 subs r3, r2, r3
- 80025c0: 2b02 cmp r3, #2
- 80025c2: d901 bls.n 80025c8 <HAL_RCC_OscConfig+0x1e0>
- {
- return HAL_TIMEOUT;
- 80025c4: 2303 movs r3, #3
- 80025c6: e236 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U)
- 80025c8: 4b20 ldr r3, [pc, #128] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80025ca: 681b ldr r3, [r3, #0]
- 80025cc: f003 0302 and.w r3, r3, #2
- 80025d0: 2b00 cmp r3, #0
- 80025d2: d1f0 bne.n 80025b6 <HAL_RCC_OscConfig+0x1ce>
- }
- }
- }
- }
- /*----------------------------- MSI Configuration --------------------------*/
- if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_MSI) == RCC_OSCILLATORTYPE_MSI)
- 80025d4: 687b ldr r3, [r7, #4]
- 80025d6: 681b ldr r3, [r3, #0]
- 80025d8: f003 0310 and.w r3, r3, #16
- 80025dc: 2b00 cmp r3, #0
- 80025de: f000 80b8 beq.w 8002752 <HAL_RCC_OscConfig+0x36a>
- {
- /* When the MSI is used as system clock it will not be disabled */
- if(sysclk_source == RCC_CFGR_SWS_MSI)
- 80025e2: 69bb ldr r3, [r7, #24]
- 80025e4: 2b00 cmp r3, #0
- 80025e6: d170 bne.n 80026ca <HAL_RCC_OscConfig+0x2e2>
- {
- if((__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) != 0U) && (RCC_OscInitStruct->MSIState == RCC_MSI_OFF))
- 80025e8: 4b18 ldr r3, [pc, #96] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 80025ea: 681b ldr r3, [r3, #0]
- 80025ec: f403 7300 and.w r3, r3, #512 ; 0x200
- 80025f0: 2b00 cmp r3, #0
- 80025f2: d005 beq.n 8002600 <HAL_RCC_OscConfig+0x218>
- 80025f4: 687b ldr r3, [r7, #4]
- 80025f6: 699b ldr r3, [r3, #24]
- 80025f8: 2b00 cmp r3, #0
- 80025fa: d101 bne.n 8002600 <HAL_RCC_OscConfig+0x218>
- {
- return HAL_ERROR;
- 80025fc: 2301 movs r3, #1
- 80025fe: e21a b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- assert_param(IS_RCC_MSI_CLOCK_RANGE(RCC_OscInitStruct->MSIClockRange));
-
- /* To correctly read data from FLASH memory, the number of wait states (LATENCY)
- must be correctly programmed according to the frequency of the CPU clock
- (HCLK) and the supply voltage of the device. */
- if(RCC_OscInitStruct->MSIClockRange > __HAL_RCC_GET_MSI_RANGE())
- 8002600: 687b ldr r3, [r7, #4]
- 8002602: 6a1a ldr r2, [r3, #32]
- 8002604: 4b11 ldr r3, [pc, #68] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002606: 685b ldr r3, [r3, #4]
- 8002608: f403 4360 and.w r3, r3, #57344 ; 0xe000
- 800260c: 429a cmp r2, r3
- 800260e: d921 bls.n 8002654 <HAL_RCC_OscConfig+0x26c>
- {
- /* First increase number of wait states update if necessary */
- if(RCC_SetFlashLatencyFromMSIRange(RCC_OscInitStruct->MSIClockRange) != HAL_OK)
- 8002610: 687b ldr r3, [r7, #4]
- 8002612: 6a1b ldr r3, [r3, #32]
- 8002614: 4618 mov r0, r3
- 8002616: f000 fc47 bl 8002ea8 <RCC_SetFlashLatencyFromMSIRange>
- 800261a: 4603 mov r3, r0
- 800261c: 2b00 cmp r3, #0
- 800261e: d001 beq.n 8002624 <HAL_RCC_OscConfig+0x23c>
- {
- return HAL_ERROR;
- 8002620: 2301 movs r3, #1
- 8002622: e208 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- }
-
- /* Selects the Multiple Speed oscillator (MSI) clock range .*/
- __HAL_RCC_MSI_RANGE_CONFIG(RCC_OscInitStruct->MSIClockRange);
- 8002624: 4b09 ldr r3, [pc, #36] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002626: 685b ldr r3, [r3, #4]
- 8002628: f423 4260 bic.w r2, r3, #57344 ; 0xe000
- 800262c: 687b ldr r3, [r7, #4]
- 800262e: 6a1b ldr r3, [r3, #32]
- 8002630: 4906 ldr r1, [pc, #24] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002632: 4313 orrs r3, r2
- 8002634: 604b str r3, [r1, #4]
- /* Adjusts the Multiple Speed oscillator (MSI) calibration value.*/
- __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->MSICalibrationValue);
- 8002636: 4b05 ldr r3, [pc, #20] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002638: 685b ldr r3, [r3, #4]
- 800263a: f023 427f bic.w r2, r3, #4278190080 ; 0xff000000
- 800263e: 687b ldr r3, [r7, #4]
- 8002640: 69db ldr r3, [r3, #28]
- 8002642: 061b lsls r3, r3, #24
- 8002644: 4901 ldr r1, [pc, #4] ; (800264c <HAL_RCC_OscConfig+0x264>)
- 8002646: 4313 orrs r3, r2
- 8002648: 604b str r3, [r1, #4]
- 800264a: e020 b.n 800268e <HAL_RCC_OscConfig+0x2a6>
- 800264c: 40023800 .word 0x40023800
- 8002650: 42470000 .word 0x42470000
- }
- else
- {
- /* Else, keep current flash latency while decreasing applies */
- /* Selects the Multiple Speed oscillator (MSI) clock range .*/
- __HAL_RCC_MSI_RANGE_CONFIG(RCC_OscInitStruct->MSIClockRange);
- 8002654: 4ba4 ldr r3, [pc, #656] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002656: 685b ldr r3, [r3, #4]
- 8002658: f423 4260 bic.w r2, r3, #57344 ; 0xe000
- 800265c: 687b ldr r3, [r7, #4]
- 800265e: 6a1b ldr r3, [r3, #32]
- 8002660: 49a1 ldr r1, [pc, #644] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002662: 4313 orrs r3, r2
- 8002664: 604b str r3, [r1, #4]
- /* Adjusts the Multiple Speed oscillator (MSI) calibration value.*/
- __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->MSICalibrationValue);
- 8002666: 4ba0 ldr r3, [pc, #640] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002668: 685b ldr r3, [r3, #4]
- 800266a: f023 427f bic.w r2, r3, #4278190080 ; 0xff000000
- 800266e: 687b ldr r3, [r7, #4]
- 8002670: 69db ldr r3, [r3, #28]
- 8002672: 061b lsls r3, r3, #24
- 8002674: 499c ldr r1, [pc, #624] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002676: 4313 orrs r3, r2
- 8002678: 604b str r3, [r1, #4]
-
- /* Decrease number of wait states update if necessary */
- if(RCC_SetFlashLatencyFromMSIRange(RCC_OscInitStruct->MSIClockRange) != HAL_OK)
- 800267a: 687b ldr r3, [r7, #4]
- 800267c: 6a1b ldr r3, [r3, #32]
- 800267e: 4618 mov r0, r3
- 8002680: f000 fc12 bl 8002ea8 <RCC_SetFlashLatencyFromMSIRange>
- 8002684: 4603 mov r3, r0
- 8002686: 2b00 cmp r3, #0
- 8002688: d001 beq.n 800268e <HAL_RCC_OscConfig+0x2a6>
- {
- return HAL_ERROR;
- 800268a: 2301 movs r3, #1
- 800268c: e1d3 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- }
- }
-
- /* Update the SystemCoreClock global variable */
- SystemCoreClock = (32768U * (1UL << ((RCC_OscInitStruct->MSIClockRange >> RCC_ICSCR_MSIRANGE_Pos) + 1U)))
- 800268e: 687b ldr r3, [r7, #4]
- 8002690: 6a1b ldr r3, [r3, #32]
- 8002692: 0b5b lsrs r3, r3, #13
- 8002694: 3301 adds r3, #1
- 8002696: f44f 4200 mov.w r2, #32768 ; 0x8000
- 800269a: fa02 f303 lsl.w r3, r2, r3
- >> AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
- 800269e: 4a92 ldr r2, [pc, #584] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80026a0: 6892 ldr r2, [r2, #8]
- 80026a2: 0912 lsrs r2, r2, #4
- 80026a4: f002 020f and.w r2, r2, #15
- 80026a8: 4990 ldr r1, [pc, #576] ; (80028ec <HAL_RCC_OscConfig+0x504>)
- 80026aa: 5c8a ldrb r2, [r1, r2]
- 80026ac: 40d3 lsrs r3, r2
- SystemCoreClock = (32768U * (1UL << ((RCC_OscInitStruct->MSIClockRange >> RCC_ICSCR_MSIRANGE_Pos) + 1U)))
- 80026ae: 4a90 ldr r2, [pc, #576] ; (80028f0 <HAL_RCC_OscConfig+0x508>)
- 80026b0: 6013 str r3, [r2, #0]
-
- /* Configure the source of time base considering new system clocks settings*/
- status = HAL_InitTick(uwTickPrio);
- 80026b2: 4b90 ldr r3, [pc, #576] ; (80028f4 <HAL_RCC_OscConfig+0x50c>)
- 80026b4: 681b ldr r3, [r3, #0]
- 80026b6: 4618 mov r0, r3
- 80026b8: f7ff fb88 bl 8001dcc <HAL_InitTick>
- 80026bc: 4603 mov r3, r0
- 80026be: 73fb strb r3, [r7, #15]
- if(status != HAL_OK)
- 80026c0: 7bfb ldrb r3, [r7, #15]
- 80026c2: 2b00 cmp r3, #0
- 80026c4: d045 beq.n 8002752 <HAL_RCC_OscConfig+0x36a>
- {
- return status;
- 80026c6: 7bfb ldrb r3, [r7, #15]
- 80026c8: e1b5 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- {
- /* Check MSI State */
- assert_param(IS_RCC_MSI(RCC_OscInitStruct->MSIState));
-
- /* Check the MSI State */
- if(RCC_OscInitStruct->MSIState != RCC_MSI_OFF)
- 80026ca: 687b ldr r3, [r7, #4]
- 80026cc: 699b ldr r3, [r3, #24]
- 80026ce: 2b00 cmp r3, #0
- 80026d0: d029 beq.n 8002726 <HAL_RCC_OscConfig+0x33e>
- {
- /* Enable the Multi Speed oscillator (MSI). */
- __HAL_RCC_MSI_ENABLE();
- 80026d2: 4b89 ldr r3, [pc, #548] ; (80028f8 <HAL_RCC_OscConfig+0x510>)
- 80026d4: 2201 movs r2, #1
- 80026d6: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 80026d8: f7ff fbc4 bl 8001e64 <HAL_GetTick>
- 80026dc: 6138 str r0, [r7, #16]
-
- /* Wait till MSI is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) == 0U)
- 80026de: e008 b.n 80026f2 <HAL_RCC_OscConfig+0x30a>
- {
- if((HAL_GetTick() - tickstart) > MSI_TIMEOUT_VALUE)
- 80026e0: f7ff fbc0 bl 8001e64 <HAL_GetTick>
- 80026e4: 4602 mov r2, r0
- 80026e6: 693b ldr r3, [r7, #16]
- 80026e8: 1ad3 subs r3, r2, r3
- 80026ea: 2b02 cmp r3, #2
- 80026ec: d901 bls.n 80026f2 <HAL_RCC_OscConfig+0x30a>
- {
- return HAL_TIMEOUT;
- 80026ee: 2303 movs r3, #3
- 80026f0: e1a1 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) == 0U)
- 80026f2: 4b7d ldr r3, [pc, #500] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80026f4: 681b ldr r3, [r3, #0]
- 80026f6: f403 7300 and.w r3, r3, #512 ; 0x200
- 80026fa: 2b00 cmp r3, #0
- 80026fc: d0f0 beq.n 80026e0 <HAL_RCC_OscConfig+0x2f8>
- /* Check MSICalibrationValue and MSIClockRange input parameters */
- assert_param(IS_RCC_MSICALIBRATION_VALUE(RCC_OscInitStruct->MSICalibrationValue));
- assert_param(IS_RCC_MSI_CLOCK_RANGE(RCC_OscInitStruct->MSIClockRange));
-
- /* Selects the Multiple Speed oscillator (MSI) clock range .*/
- __HAL_RCC_MSI_RANGE_CONFIG(RCC_OscInitStruct->MSIClockRange);
- 80026fe: 4b7a ldr r3, [pc, #488] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002700: 685b ldr r3, [r3, #4]
- 8002702: f423 4260 bic.w r2, r3, #57344 ; 0xe000
- 8002706: 687b ldr r3, [r7, #4]
- 8002708: 6a1b ldr r3, [r3, #32]
- 800270a: 4977 ldr r1, [pc, #476] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 800270c: 4313 orrs r3, r2
- 800270e: 604b str r3, [r1, #4]
- /* Adjusts the Multiple Speed oscillator (MSI) calibration value.*/
- __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->MSICalibrationValue);
- 8002710: 4b75 ldr r3, [pc, #468] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002712: 685b ldr r3, [r3, #4]
- 8002714: f023 427f bic.w r2, r3, #4278190080 ; 0xff000000
- 8002718: 687b ldr r3, [r7, #4]
- 800271a: 69db ldr r3, [r3, #28]
- 800271c: 061b lsls r3, r3, #24
- 800271e: 4972 ldr r1, [pc, #456] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002720: 4313 orrs r3, r2
- 8002722: 604b str r3, [r1, #4]
- 8002724: e015 b.n 8002752 <HAL_RCC_OscConfig+0x36a>
-
- }
- else
- {
- /* Disable the Multi Speed oscillator (MSI). */
- __HAL_RCC_MSI_DISABLE();
- 8002726: 4b74 ldr r3, [pc, #464] ; (80028f8 <HAL_RCC_OscConfig+0x510>)
- 8002728: 2200 movs r2, #0
- 800272a: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 800272c: f7ff fb9a bl 8001e64 <HAL_GetTick>
- 8002730: 6138 str r0, [r7, #16]
-
- /* Wait till MSI is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) != 0U)
- 8002732: e008 b.n 8002746 <HAL_RCC_OscConfig+0x35e>
- {
- if((HAL_GetTick() - tickstart) > MSI_TIMEOUT_VALUE)
- 8002734: f7ff fb96 bl 8001e64 <HAL_GetTick>
- 8002738: 4602 mov r2, r0
- 800273a: 693b ldr r3, [r7, #16]
- 800273c: 1ad3 subs r3, r2, r3
- 800273e: 2b02 cmp r3, #2
- 8002740: d901 bls.n 8002746 <HAL_RCC_OscConfig+0x35e>
- {
- return HAL_TIMEOUT;
- 8002742: 2303 movs r3, #3
- 8002744: e177 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) != 0U)
- 8002746: 4b68 ldr r3, [pc, #416] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002748: 681b ldr r3, [r3, #0]
- 800274a: f403 7300 and.w r3, r3, #512 ; 0x200
- 800274e: 2b00 cmp r3, #0
- 8002750: d1f0 bne.n 8002734 <HAL_RCC_OscConfig+0x34c>
- }
- }
- }
- }
- /*------------------------------ LSI Configuration -------------------------*/
- if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI)
- 8002752: 687b ldr r3, [r7, #4]
- 8002754: 681b ldr r3, [r3, #0]
- 8002756: f003 0308 and.w r3, r3, #8
- 800275a: 2b00 cmp r3, #0
- 800275c: d030 beq.n 80027c0 <HAL_RCC_OscConfig+0x3d8>
- {
- /* Check the parameters */
- assert_param(IS_RCC_LSI(RCC_OscInitStruct->LSIState));
-
- /* Check the LSI State */
- if(RCC_OscInitStruct->LSIState != RCC_LSI_OFF)
- 800275e: 687b ldr r3, [r7, #4]
- 8002760: 695b ldr r3, [r3, #20]
- 8002762: 2b00 cmp r3, #0
- 8002764: d016 beq.n 8002794 <HAL_RCC_OscConfig+0x3ac>
- {
- /* Enable the Internal Low Speed oscillator (LSI). */
- __HAL_RCC_LSI_ENABLE();
- 8002766: 4b65 ldr r3, [pc, #404] ; (80028fc <HAL_RCC_OscConfig+0x514>)
- 8002768: 2201 movs r2, #1
- 800276a: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 800276c: f7ff fb7a bl 8001e64 <HAL_GetTick>
- 8002770: 6138 str r0, [r7, #16]
-
- /* Wait till LSI is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == 0U)
- 8002772: e008 b.n 8002786 <HAL_RCC_OscConfig+0x39e>
- {
- if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE)
- 8002774: f7ff fb76 bl 8001e64 <HAL_GetTick>
- 8002778: 4602 mov r2, r0
- 800277a: 693b ldr r3, [r7, #16]
- 800277c: 1ad3 subs r3, r2, r3
- 800277e: 2b02 cmp r3, #2
- 8002780: d901 bls.n 8002786 <HAL_RCC_OscConfig+0x39e>
- {
- return HAL_TIMEOUT;
- 8002782: 2303 movs r3, #3
- 8002784: e157 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == 0U)
- 8002786: 4b58 ldr r3, [pc, #352] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002788: 6b5b ldr r3, [r3, #52] ; 0x34
- 800278a: f003 0302 and.w r3, r3, #2
- 800278e: 2b00 cmp r3, #0
- 8002790: d0f0 beq.n 8002774 <HAL_RCC_OscConfig+0x38c>
- 8002792: e015 b.n 80027c0 <HAL_RCC_OscConfig+0x3d8>
- }
- }
- else
- {
- /* Disable the Internal Low Speed oscillator (LSI). */
- __HAL_RCC_LSI_DISABLE();
- 8002794: 4b59 ldr r3, [pc, #356] ; (80028fc <HAL_RCC_OscConfig+0x514>)
- 8002796: 2200 movs r2, #0
- 8002798: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 800279a: f7ff fb63 bl 8001e64 <HAL_GetTick>
- 800279e: 6138 str r0, [r7, #16]
-
- /* Wait till LSI is disabled */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != 0U)
- 80027a0: e008 b.n 80027b4 <HAL_RCC_OscConfig+0x3cc>
- {
- if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE)
- 80027a2: f7ff fb5f bl 8001e64 <HAL_GetTick>
- 80027a6: 4602 mov r2, r0
- 80027a8: 693b ldr r3, [r7, #16]
- 80027aa: 1ad3 subs r3, r2, r3
- 80027ac: 2b02 cmp r3, #2
- 80027ae: d901 bls.n 80027b4 <HAL_RCC_OscConfig+0x3cc>
- {
- return HAL_TIMEOUT;
- 80027b0: 2303 movs r3, #3
- 80027b2: e140 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != 0U)
- 80027b4: 4b4c ldr r3, [pc, #304] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80027b6: 6b5b ldr r3, [r3, #52] ; 0x34
- 80027b8: f003 0302 and.w r3, r3, #2
- 80027bc: 2b00 cmp r3, #0
- 80027be: d1f0 bne.n 80027a2 <HAL_RCC_OscConfig+0x3ba>
- }
- }
- }
- }
- /*------------------------------ LSE Configuration -------------------------*/
- if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE)
- 80027c0: 687b ldr r3, [r7, #4]
- 80027c2: 681b ldr r3, [r3, #0]
- 80027c4: f003 0304 and.w r3, r3, #4
- 80027c8: 2b00 cmp r3, #0
- 80027ca: f000 80b5 beq.w 8002938 <HAL_RCC_OscConfig+0x550>
- {
- FlagStatus pwrclkchanged = RESET;
- 80027ce: 2300 movs r3, #0
- 80027d0: 77fb strb r3, [r7, #31]
- /* Check the parameters */
- assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState));
-
- /* Update LSE configuration in Backup Domain control register */
- /* Requires to enable write access to Backup Domain of necessary */
- if(__HAL_RCC_PWR_IS_CLK_DISABLED())
- 80027d2: 4b45 ldr r3, [pc, #276] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80027d4: 6a5b ldr r3, [r3, #36] ; 0x24
- 80027d6: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
- 80027da: 2b00 cmp r3, #0
- 80027dc: d10d bne.n 80027fa <HAL_RCC_OscConfig+0x412>
- {
- __HAL_RCC_PWR_CLK_ENABLE();
- 80027de: 4b42 ldr r3, [pc, #264] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80027e0: 6a5b ldr r3, [r3, #36] ; 0x24
- 80027e2: 4a41 ldr r2, [pc, #260] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80027e4: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
- 80027e8: 6253 str r3, [r2, #36] ; 0x24
- 80027ea: 4b3f ldr r3, [pc, #252] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80027ec: 6a5b ldr r3, [r3, #36] ; 0x24
- 80027ee: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
- 80027f2: 60bb str r3, [r7, #8]
- 80027f4: 68bb ldr r3, [r7, #8]
- pwrclkchanged = SET;
- 80027f6: 2301 movs r3, #1
- 80027f8: 77fb strb r3, [r7, #31]
- }
-
- if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
- 80027fa: 4b41 ldr r3, [pc, #260] ; (8002900 <HAL_RCC_OscConfig+0x518>)
- 80027fc: 681b ldr r3, [r3, #0]
- 80027fe: f403 7380 and.w r3, r3, #256 ; 0x100
- 8002802: 2b00 cmp r3, #0
- 8002804: d118 bne.n 8002838 <HAL_RCC_OscConfig+0x450>
- {
- /* Enable write access to Backup domain */
- SET_BIT(PWR->CR, PWR_CR_DBP);
- 8002806: 4b3e ldr r3, [pc, #248] ; (8002900 <HAL_RCC_OscConfig+0x518>)
- 8002808: 681b ldr r3, [r3, #0]
- 800280a: 4a3d ldr r2, [pc, #244] ; (8002900 <HAL_RCC_OscConfig+0x518>)
- 800280c: f443 7380 orr.w r3, r3, #256 ; 0x100
- 8002810: 6013 str r3, [r2, #0]
-
- /* Wait for Backup domain Write protection disable */
- tickstart = HAL_GetTick();
- 8002812: f7ff fb27 bl 8001e64 <HAL_GetTick>
- 8002816: 6138 str r0, [r7, #16]
-
- while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
- 8002818: e008 b.n 800282c <HAL_RCC_OscConfig+0x444>
- {
- if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE)
- 800281a: f7ff fb23 bl 8001e64 <HAL_GetTick>
- 800281e: 4602 mov r2, r0
- 8002820: 693b ldr r3, [r7, #16]
- 8002822: 1ad3 subs r3, r2, r3
- 8002824: 2b64 cmp r3, #100 ; 0x64
- 8002826: d901 bls.n 800282c <HAL_RCC_OscConfig+0x444>
- {
- return HAL_TIMEOUT;
- 8002828: 2303 movs r3, #3
- 800282a: e104 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
- 800282c: 4b34 ldr r3, [pc, #208] ; (8002900 <HAL_RCC_OscConfig+0x518>)
- 800282e: 681b ldr r3, [r3, #0]
- 8002830: f403 7380 and.w r3, r3, #256 ; 0x100
- 8002834: 2b00 cmp r3, #0
- 8002836: d0f0 beq.n 800281a <HAL_RCC_OscConfig+0x432>
- }
- }
- }
-
- /* Set the new LSE configuration -----------------------------------------*/
- __HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState);
- 8002838: 687b ldr r3, [r7, #4]
- 800283a: 689b ldr r3, [r3, #8]
- 800283c: 2b01 cmp r3, #1
- 800283e: d106 bne.n 800284e <HAL_RCC_OscConfig+0x466>
- 8002840: 4b29 ldr r3, [pc, #164] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002842: 6b5b ldr r3, [r3, #52] ; 0x34
- 8002844: 4a28 ldr r2, [pc, #160] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002846: f443 7380 orr.w r3, r3, #256 ; 0x100
- 800284a: 6353 str r3, [r2, #52] ; 0x34
- 800284c: e02d b.n 80028aa <HAL_RCC_OscConfig+0x4c2>
- 800284e: 687b ldr r3, [r7, #4]
- 8002850: 689b ldr r3, [r3, #8]
- 8002852: 2b00 cmp r3, #0
- 8002854: d10c bne.n 8002870 <HAL_RCC_OscConfig+0x488>
- 8002856: 4b24 ldr r3, [pc, #144] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002858: 6b5b ldr r3, [r3, #52] ; 0x34
- 800285a: 4a23 ldr r2, [pc, #140] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 800285c: f423 7380 bic.w r3, r3, #256 ; 0x100
- 8002860: 6353 str r3, [r2, #52] ; 0x34
- 8002862: 4b21 ldr r3, [pc, #132] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002864: 6b5b ldr r3, [r3, #52] ; 0x34
- 8002866: 4a20 ldr r2, [pc, #128] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002868: f423 6380 bic.w r3, r3, #1024 ; 0x400
- 800286c: 6353 str r3, [r2, #52] ; 0x34
- 800286e: e01c b.n 80028aa <HAL_RCC_OscConfig+0x4c2>
- 8002870: 687b ldr r3, [r7, #4]
- 8002872: 689b ldr r3, [r3, #8]
- 8002874: 2b05 cmp r3, #5
- 8002876: d10c bne.n 8002892 <HAL_RCC_OscConfig+0x4aa>
- 8002878: 4b1b ldr r3, [pc, #108] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 800287a: 6b5b ldr r3, [r3, #52] ; 0x34
- 800287c: 4a1a ldr r2, [pc, #104] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 800287e: f443 6380 orr.w r3, r3, #1024 ; 0x400
- 8002882: 6353 str r3, [r2, #52] ; 0x34
- 8002884: 4b18 ldr r3, [pc, #96] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002886: 6b5b ldr r3, [r3, #52] ; 0x34
- 8002888: 4a17 ldr r2, [pc, #92] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 800288a: f443 7380 orr.w r3, r3, #256 ; 0x100
- 800288e: 6353 str r3, [r2, #52] ; 0x34
- 8002890: e00b b.n 80028aa <HAL_RCC_OscConfig+0x4c2>
- 8002892: 4b15 ldr r3, [pc, #84] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002894: 6b5b ldr r3, [r3, #52] ; 0x34
- 8002896: 4a14 ldr r2, [pc, #80] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 8002898: f423 7380 bic.w r3, r3, #256 ; 0x100
- 800289c: 6353 str r3, [r2, #52] ; 0x34
- 800289e: 4b12 ldr r3, [pc, #72] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80028a0: 6b5b ldr r3, [r3, #52] ; 0x34
- 80028a2: 4a11 ldr r2, [pc, #68] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80028a4: f423 6380 bic.w r3, r3, #1024 ; 0x400
- 80028a8: 6353 str r3, [r2, #52] ; 0x34
- /* Check the LSE State */
- if(RCC_OscInitStruct->LSEState != RCC_LSE_OFF)
- 80028aa: 687b ldr r3, [r7, #4]
- 80028ac: 689b ldr r3, [r3, #8]
- 80028ae: 2b00 cmp r3, #0
- 80028b0: d015 beq.n 80028de <HAL_RCC_OscConfig+0x4f6>
- {
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 80028b2: f7ff fad7 bl 8001e64 <HAL_GetTick>
- 80028b6: 6138 str r0, [r7, #16]
-
- /* Wait till LSE is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == 0U)
- 80028b8: e00a b.n 80028d0 <HAL_RCC_OscConfig+0x4e8>
- {
- if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE)
- 80028ba: f7ff fad3 bl 8001e64 <HAL_GetTick>
- 80028be: 4602 mov r2, r0
- 80028c0: 693b ldr r3, [r7, #16]
- 80028c2: 1ad3 subs r3, r2, r3
- 80028c4: f241 3288 movw r2, #5000 ; 0x1388
- 80028c8: 4293 cmp r3, r2
- 80028ca: d901 bls.n 80028d0 <HAL_RCC_OscConfig+0x4e8>
- {
- return HAL_TIMEOUT;
- 80028cc: 2303 movs r3, #3
- 80028ce: e0b2 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == 0U)
- 80028d0: 4b05 ldr r3, [pc, #20] ; (80028e8 <HAL_RCC_OscConfig+0x500>)
- 80028d2: 6b5b ldr r3, [r3, #52] ; 0x34
- 80028d4: f403 7300 and.w r3, r3, #512 ; 0x200
- 80028d8: 2b00 cmp r3, #0
- 80028da: d0ee beq.n 80028ba <HAL_RCC_OscConfig+0x4d2>
- 80028dc: e023 b.n 8002926 <HAL_RCC_OscConfig+0x53e>
- }
- }
- else
- {
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 80028de: f7ff fac1 bl 8001e64 <HAL_GetTick>
- 80028e2: 6138 str r0, [r7, #16]
-
- /* Wait till LSE is disabled */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != 0U)
- 80028e4: e019 b.n 800291a <HAL_RCC_OscConfig+0x532>
- 80028e6: bf00 nop
- 80028e8: 40023800 .word 0x40023800
- 80028ec: 08007b30 .word 0x08007b30
- 80028f0: 20000004 .word 0x20000004
- 80028f4: 20000008 .word 0x20000008
- 80028f8: 42470020 .word 0x42470020
- 80028fc: 42470680 .word 0x42470680
- 8002900: 40007000 .word 0x40007000
- {
- if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE)
- 8002904: f7ff faae bl 8001e64 <HAL_GetTick>
- 8002908: 4602 mov r2, r0
- 800290a: 693b ldr r3, [r7, #16]
- 800290c: 1ad3 subs r3, r2, r3
- 800290e: f241 3288 movw r2, #5000 ; 0x1388
- 8002912: 4293 cmp r3, r2
- 8002914: d901 bls.n 800291a <HAL_RCC_OscConfig+0x532>
- {
- return HAL_TIMEOUT;
- 8002916: 2303 movs r3, #3
- 8002918: e08d b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != 0U)
- 800291a: 4b49 ldr r3, [pc, #292] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 800291c: 6b5b ldr r3, [r3, #52] ; 0x34
- 800291e: f403 7300 and.w r3, r3, #512 ; 0x200
- 8002922: 2b00 cmp r3, #0
- 8002924: d1ee bne.n 8002904 <HAL_RCC_OscConfig+0x51c>
- }
- }
- }
-
- /* Require to disable power clock if necessary */
- if(pwrclkchanged == SET)
- 8002926: 7ffb ldrb r3, [r7, #31]
- 8002928: 2b01 cmp r3, #1
- 800292a: d105 bne.n 8002938 <HAL_RCC_OscConfig+0x550>
- {
- __HAL_RCC_PWR_CLK_DISABLE();
- 800292c: 4b44 ldr r3, [pc, #272] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 800292e: 6a5b ldr r3, [r3, #36] ; 0x24
- 8002930: 4a43 ldr r2, [pc, #268] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 8002932: f023 5380 bic.w r3, r3, #268435456 ; 0x10000000
- 8002936: 6253 str r3, [r2, #36] ; 0x24
- }
-
- /*-------------------------------- PLL Configuration -----------------------*/
- /* Check the parameters */
- assert_param(IS_RCC_PLL(RCC_OscInitStruct->PLL.PLLState));
- if ((RCC_OscInitStruct->PLL.PLLState) != RCC_PLL_NONE)
- 8002938: 687b ldr r3, [r7, #4]
- 800293a: 6a5b ldr r3, [r3, #36] ; 0x24
- 800293c: 2b00 cmp r3, #0
- 800293e: d079 beq.n 8002a34 <HAL_RCC_OscConfig+0x64c>
- {
- /* Check if the PLL is used as system clock or not */
- if(sysclk_source != RCC_SYSCLKSOURCE_STATUS_PLLCLK)
- 8002940: 69bb ldr r3, [r7, #24]
- 8002942: 2b0c cmp r3, #12
- 8002944: d056 beq.n 80029f4 <HAL_RCC_OscConfig+0x60c>
- {
- if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_ON)
- 8002946: 687b ldr r3, [r7, #4]
- 8002948: 6a5b ldr r3, [r3, #36] ; 0x24
- 800294a: 2b02 cmp r3, #2
- 800294c: d13b bne.n 80029c6 <HAL_RCC_OscConfig+0x5de>
- assert_param(IS_RCC_PLLSOURCE(RCC_OscInitStruct->PLL.PLLSource));
- assert_param(IS_RCC_PLL_MUL(RCC_OscInitStruct->PLL.PLLMUL));
- assert_param(IS_RCC_PLL_DIV(RCC_OscInitStruct->PLL.PLLDIV));
-
- /* Disable the main PLL. */
- __HAL_RCC_PLL_DISABLE();
- 800294e: 4b3d ldr r3, [pc, #244] ; (8002a44 <HAL_RCC_OscConfig+0x65c>)
- 8002950: 2200 movs r2, #0
- 8002952: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 8002954: f7ff fa86 bl 8001e64 <HAL_GetTick>
- 8002958: 6138 str r0, [r7, #16]
-
- /* Wait till PLL is disabled */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U)
- 800295a: e008 b.n 800296e <HAL_RCC_OscConfig+0x586>
- {
- if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE)
- 800295c: f7ff fa82 bl 8001e64 <HAL_GetTick>
- 8002960: 4602 mov r2, r0
- 8002962: 693b ldr r3, [r7, #16]
- 8002964: 1ad3 subs r3, r2, r3
- 8002966: 2b02 cmp r3, #2
- 8002968: d901 bls.n 800296e <HAL_RCC_OscConfig+0x586>
- {
- return HAL_TIMEOUT;
- 800296a: 2303 movs r3, #3
- 800296c: e063 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U)
- 800296e: 4b34 ldr r3, [pc, #208] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 8002970: 681b ldr r3, [r3, #0]
- 8002972: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
- 8002976: 2b00 cmp r3, #0
- 8002978: d1f0 bne.n 800295c <HAL_RCC_OscConfig+0x574>
- }
- }
-
- /* Configure the main PLL clock source, multiplication and division factors. */
- __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource,
- 800297a: 4b31 ldr r3, [pc, #196] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 800297c: 689b ldr r3, [r3, #8]
- 800297e: f423 027d bic.w r2, r3, #16580608 ; 0xfd0000
- 8002982: 687b ldr r3, [r7, #4]
- 8002984: 6a99 ldr r1, [r3, #40] ; 0x28
- 8002986: 687b ldr r3, [r7, #4]
- 8002988: 6adb ldr r3, [r3, #44] ; 0x2c
- 800298a: 4319 orrs r1, r3
- 800298c: 687b ldr r3, [r7, #4]
- 800298e: 6b1b ldr r3, [r3, #48] ; 0x30
- 8002990: 430b orrs r3, r1
- 8002992: 492b ldr r1, [pc, #172] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 8002994: 4313 orrs r3, r2
- 8002996: 608b str r3, [r1, #8]
- RCC_OscInitStruct->PLL.PLLMUL,
- RCC_OscInitStruct->PLL.PLLDIV);
- /* Enable the main PLL. */
- __HAL_RCC_PLL_ENABLE();
- 8002998: 4b2a ldr r3, [pc, #168] ; (8002a44 <HAL_RCC_OscConfig+0x65c>)
- 800299a: 2201 movs r2, #1
- 800299c: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 800299e: f7ff fa61 bl 8001e64 <HAL_GetTick>
- 80029a2: 6138 str r0, [r7, #16]
-
- /* Wait till PLL is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == 0U)
- 80029a4: e008 b.n 80029b8 <HAL_RCC_OscConfig+0x5d0>
- {
- if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE)
- 80029a6: f7ff fa5d bl 8001e64 <HAL_GetTick>
- 80029aa: 4602 mov r2, r0
- 80029ac: 693b ldr r3, [r7, #16]
- 80029ae: 1ad3 subs r3, r2, r3
- 80029b0: 2b02 cmp r3, #2
- 80029b2: d901 bls.n 80029b8 <HAL_RCC_OscConfig+0x5d0>
- {
- return HAL_TIMEOUT;
- 80029b4: 2303 movs r3, #3
- 80029b6: e03e b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == 0U)
- 80029b8: 4b21 ldr r3, [pc, #132] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 80029ba: 681b ldr r3, [r3, #0]
- 80029bc: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
- 80029c0: 2b00 cmp r3, #0
- 80029c2: d0f0 beq.n 80029a6 <HAL_RCC_OscConfig+0x5be>
- 80029c4: e036 b.n 8002a34 <HAL_RCC_OscConfig+0x64c>
- }
- }
- else
- {
- /* Disable the main PLL. */
- __HAL_RCC_PLL_DISABLE();
- 80029c6: 4b1f ldr r3, [pc, #124] ; (8002a44 <HAL_RCC_OscConfig+0x65c>)
- 80029c8: 2200 movs r2, #0
- 80029ca: 601a str r2, [r3, #0]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 80029cc: f7ff fa4a bl 8001e64 <HAL_GetTick>
- 80029d0: 6138 str r0, [r7, #16]
-
- /* Wait till PLL is disabled */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U)
- 80029d2: e008 b.n 80029e6 <HAL_RCC_OscConfig+0x5fe>
- {
- if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE)
- 80029d4: f7ff fa46 bl 8001e64 <HAL_GetTick>
- 80029d8: 4602 mov r2, r0
- 80029da: 693b ldr r3, [r7, #16]
- 80029dc: 1ad3 subs r3, r2, r3
- 80029de: 2b02 cmp r3, #2
- 80029e0: d901 bls.n 80029e6 <HAL_RCC_OscConfig+0x5fe>
- {
- return HAL_TIMEOUT;
- 80029e2: 2303 movs r3, #3
- 80029e4: e027 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U)
- 80029e6: 4b16 ldr r3, [pc, #88] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 80029e8: 681b ldr r3, [r3, #0]
- 80029ea: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
- 80029ee: 2b00 cmp r3, #0
- 80029f0: d1f0 bne.n 80029d4 <HAL_RCC_OscConfig+0x5ec>
- 80029f2: e01f b.n 8002a34 <HAL_RCC_OscConfig+0x64c>
- }
- }
- else
- {
- /* Check if there is a request to disable the PLL used as System clock source */
- if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF)
- 80029f4: 687b ldr r3, [r7, #4]
- 80029f6: 6a5b ldr r3, [r3, #36] ; 0x24
- 80029f8: 2b01 cmp r3, #1
- 80029fa: d101 bne.n 8002a00 <HAL_RCC_OscConfig+0x618>
- {
- return HAL_ERROR;
- 80029fc: 2301 movs r3, #1
- 80029fe: e01a b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- }
- else
- {
- /* Do not return HAL_ERROR if request repeats the current configuration */
- pll_config = RCC->CFGR;
- 8002a00: 4b0f ldr r3, [pc, #60] ; (8002a40 <HAL_RCC_OscConfig+0x658>)
- 8002a02: 689b ldr r3, [r3, #8]
- 8002a04: 617b str r3, [r7, #20]
- if((READ_BIT(pll_config, RCC_CFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) ||
- 8002a06: 697b ldr r3, [r7, #20]
- 8002a08: f403 3280 and.w r2, r3, #65536 ; 0x10000
- 8002a0c: 687b ldr r3, [r7, #4]
- 8002a0e: 6a9b ldr r3, [r3, #40] ; 0x28
- 8002a10: 429a cmp r2, r3
- 8002a12: d10d bne.n 8002a30 <HAL_RCC_OscConfig+0x648>
- (READ_BIT(pll_config, RCC_CFGR_PLLMUL) != RCC_OscInitStruct->PLL.PLLMUL) ||
- 8002a14: 697b ldr r3, [r7, #20]
- 8002a16: f403 1270 and.w r2, r3, #3932160 ; 0x3c0000
- 8002a1a: 687b ldr r3, [r7, #4]
- 8002a1c: 6adb ldr r3, [r3, #44] ; 0x2c
- if((READ_BIT(pll_config, RCC_CFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) ||
- 8002a1e: 429a cmp r2, r3
- 8002a20: d106 bne.n 8002a30 <HAL_RCC_OscConfig+0x648>
- (READ_BIT(pll_config, RCC_CFGR_PLLDIV) != RCC_OscInitStruct->PLL.PLLDIV))
- 8002a22: 697b ldr r3, [r7, #20]
- 8002a24: f403 0240 and.w r2, r3, #12582912 ; 0xc00000
- 8002a28: 687b ldr r3, [r7, #4]
- 8002a2a: 6b1b ldr r3, [r3, #48] ; 0x30
- (READ_BIT(pll_config, RCC_CFGR_PLLMUL) != RCC_OscInitStruct->PLL.PLLMUL) ||
- 8002a2c: 429a cmp r2, r3
- 8002a2e: d001 beq.n 8002a34 <HAL_RCC_OscConfig+0x64c>
- {
- return HAL_ERROR;
- 8002a30: 2301 movs r3, #1
- 8002a32: e000 b.n 8002a36 <HAL_RCC_OscConfig+0x64e>
- }
- }
- }
- }
-
- return HAL_OK;
- 8002a34: 2300 movs r3, #0
- }
- 8002a36: 4618 mov r0, r3
- 8002a38: 3720 adds r7, #32
- 8002a3a: 46bd mov sp, r7
- 8002a3c: bd80 pop {r7, pc}
- 8002a3e: bf00 nop
- 8002a40: 40023800 .word 0x40023800
- 8002a44: 42470060 .word 0x42470060
-
- 08002a48 <HAL_RCC_ClockConfig>:
- * HPRE[3:0] bits to ensure that HCLK not exceed the maximum allowed frequency
- * (for more details refer to section above "Initialization/de-initialization functions")
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
- {
- 8002a48: b580 push {r7, lr}
- 8002a4a: b084 sub sp, #16
- 8002a4c: af00 add r7, sp, #0
- 8002a4e: 6078 str r0, [r7, #4]
- 8002a50: 6039 str r1, [r7, #0]
- uint32_t tickstart;
- HAL_StatusTypeDef status;
-
- /* Check the parameters */
- if(RCC_ClkInitStruct == NULL)
- 8002a52: 687b ldr r3, [r7, #4]
- 8002a54: 2b00 cmp r3, #0
- 8002a56: d101 bne.n 8002a5c <HAL_RCC_ClockConfig+0x14>
- {
- return HAL_ERROR;
- 8002a58: 2301 movs r3, #1
- 8002a5a: e11a b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- /* To correctly read data from FLASH memory, the number of wait states (LATENCY)
- must be correctly programmed according to the frequency of the CPU clock
- (HCLK) and the supply voltage of the device. */
-
- /* Increasing the number of wait states because of higher CPU frequency */
- if(FLatency > __HAL_FLASH_GET_LATENCY())
- 8002a5c: 4b8f ldr r3, [pc, #572] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002a5e: 681b ldr r3, [r3, #0]
- 8002a60: f003 0301 and.w r3, r3, #1
- 8002a64: 683a ldr r2, [r7, #0]
- 8002a66: 429a cmp r2, r3
- 8002a68: d919 bls.n 8002a9e <HAL_RCC_ClockConfig+0x56>
- {
- /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
- __HAL_FLASH_SET_LATENCY(FLatency);
- 8002a6a: 683b ldr r3, [r7, #0]
- 8002a6c: 2b01 cmp r3, #1
- 8002a6e: d105 bne.n 8002a7c <HAL_RCC_ClockConfig+0x34>
- 8002a70: 4b8a ldr r3, [pc, #552] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002a72: 681b ldr r3, [r3, #0]
- 8002a74: 4a89 ldr r2, [pc, #548] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002a76: f043 0304 orr.w r3, r3, #4
- 8002a7a: 6013 str r3, [r2, #0]
- 8002a7c: 4b87 ldr r3, [pc, #540] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002a7e: 681b ldr r3, [r3, #0]
- 8002a80: f023 0201 bic.w r2, r3, #1
- 8002a84: 4985 ldr r1, [pc, #532] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002a86: 683b ldr r3, [r7, #0]
- 8002a88: 4313 orrs r3, r2
- 8002a8a: 600b str r3, [r1, #0]
-
- /* Check that the new number of wait states is taken into account to access the Flash
- memory by reading the FLASH_ACR register */
- if(__HAL_FLASH_GET_LATENCY() != FLatency)
- 8002a8c: 4b83 ldr r3, [pc, #524] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002a8e: 681b ldr r3, [r3, #0]
- 8002a90: f003 0301 and.w r3, r3, #1
- 8002a94: 683a ldr r2, [r7, #0]
- 8002a96: 429a cmp r2, r3
- 8002a98: d001 beq.n 8002a9e <HAL_RCC_ClockConfig+0x56>
- {
- return HAL_ERROR;
- 8002a9a: 2301 movs r3, #1
- 8002a9c: e0f9 b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- }
- }
-
- /*-------------------------- HCLK Configuration --------------------------*/
- if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK)
- 8002a9e: 687b ldr r3, [r7, #4]
- 8002aa0: 681b ldr r3, [r3, #0]
- 8002aa2: f003 0302 and.w r3, r3, #2
- 8002aa6: 2b00 cmp r3, #0
- 8002aa8: d008 beq.n 8002abc <HAL_RCC_ClockConfig+0x74>
- {
- assert_param(IS_RCC_HCLK(RCC_ClkInitStruct->AHBCLKDivider));
- MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, RCC_ClkInitStruct->AHBCLKDivider);
- 8002aaa: 4b7d ldr r3, [pc, #500] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002aac: 689b ldr r3, [r3, #8]
- 8002aae: f023 02f0 bic.w r2, r3, #240 ; 0xf0
- 8002ab2: 687b ldr r3, [r7, #4]
- 8002ab4: 689b ldr r3, [r3, #8]
- 8002ab6: 497a ldr r1, [pc, #488] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002ab8: 4313 orrs r3, r2
- 8002aba: 608b str r3, [r1, #8]
- }
-
- /*------------------------- SYSCLK Configuration ---------------------------*/
- if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_SYSCLK) == RCC_CLOCKTYPE_SYSCLK)
- 8002abc: 687b ldr r3, [r7, #4]
- 8002abe: 681b ldr r3, [r3, #0]
- 8002ac0: f003 0301 and.w r3, r3, #1
- 8002ac4: 2b00 cmp r3, #0
- 8002ac6: f000 808e beq.w 8002be6 <HAL_RCC_ClockConfig+0x19e>
- {
- assert_param(IS_RCC_SYSCLKSOURCE(RCC_ClkInitStruct->SYSCLKSource));
-
- /* HSE is selected as System Clock Source */
- if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE)
- 8002aca: 687b ldr r3, [r7, #4]
- 8002acc: 685b ldr r3, [r3, #4]
- 8002ace: 2b02 cmp r3, #2
- 8002ad0: d107 bne.n 8002ae2 <HAL_RCC_ClockConfig+0x9a>
- {
- /* Check the HSE ready flag */
- if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == 0U)
- 8002ad2: 4b73 ldr r3, [pc, #460] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002ad4: 681b ldr r3, [r3, #0]
- 8002ad6: f403 3300 and.w r3, r3, #131072 ; 0x20000
- 8002ada: 2b00 cmp r3, #0
- 8002adc: d121 bne.n 8002b22 <HAL_RCC_ClockConfig+0xda>
- {
- return HAL_ERROR;
- 8002ade: 2301 movs r3, #1
- 8002ae0: e0d7 b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- }
- }
- /* PLL is selected as System Clock Source */
- else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK)
- 8002ae2: 687b ldr r3, [r7, #4]
- 8002ae4: 685b ldr r3, [r3, #4]
- 8002ae6: 2b03 cmp r3, #3
- 8002ae8: d107 bne.n 8002afa <HAL_RCC_ClockConfig+0xb2>
- {
- /* Check the PLL ready flag */
- if(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == 0U)
- 8002aea: 4b6d ldr r3, [pc, #436] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002aec: 681b ldr r3, [r3, #0]
- 8002aee: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
- 8002af2: 2b00 cmp r3, #0
- 8002af4: d115 bne.n 8002b22 <HAL_RCC_ClockConfig+0xda>
- {
- return HAL_ERROR;
- 8002af6: 2301 movs r3, #1
- 8002af8: e0cb b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- }
- }
- /* HSI is selected as System Clock Source */
- else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSI)
- 8002afa: 687b ldr r3, [r7, #4]
- 8002afc: 685b ldr r3, [r3, #4]
- 8002afe: 2b01 cmp r3, #1
- 8002b00: d107 bne.n 8002b12 <HAL_RCC_ClockConfig+0xca>
- {
- /* Check the HSI ready flag */
- if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == 0U)
- 8002b02: 4b67 ldr r3, [pc, #412] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002b04: 681b ldr r3, [r3, #0]
- 8002b06: f003 0302 and.w r3, r3, #2
- 8002b0a: 2b00 cmp r3, #0
- 8002b0c: d109 bne.n 8002b22 <HAL_RCC_ClockConfig+0xda>
- {
- return HAL_ERROR;
- 8002b0e: 2301 movs r3, #1
- 8002b10: e0bf b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- }
- /* MSI is selected as System Clock Source */
- else
- {
- /* Check the MSI ready flag */
- if(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) == 0U)
- 8002b12: 4b63 ldr r3, [pc, #396] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002b14: 681b ldr r3, [r3, #0]
- 8002b16: f403 7300 and.w r3, r3, #512 ; 0x200
- 8002b1a: 2b00 cmp r3, #0
- 8002b1c: d101 bne.n 8002b22 <HAL_RCC_ClockConfig+0xda>
- {
- return HAL_ERROR;
- 8002b1e: 2301 movs r3, #1
- 8002b20: e0b7 b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- }
- }
- __HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource);
- 8002b22: 4b5f ldr r3, [pc, #380] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002b24: 689b ldr r3, [r3, #8]
- 8002b26: f023 0203 bic.w r2, r3, #3
- 8002b2a: 687b ldr r3, [r7, #4]
- 8002b2c: 685b ldr r3, [r3, #4]
- 8002b2e: 495c ldr r1, [pc, #368] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002b30: 4313 orrs r3, r2
- 8002b32: 608b str r3, [r1, #8]
-
- /* Get Start Tick */
- tickstart = HAL_GetTick();
- 8002b34: f7ff f996 bl 8001e64 <HAL_GetTick>
- 8002b38: 60f8 str r0, [r7, #12]
-
- if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE)
- 8002b3a: 687b ldr r3, [r7, #4]
- 8002b3c: 685b ldr r3, [r3, #4]
- 8002b3e: 2b02 cmp r3, #2
- 8002b40: d112 bne.n 8002b68 <HAL_RCC_ClockConfig+0x120>
- {
- while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSE)
- 8002b42: e00a b.n 8002b5a <HAL_RCC_ClockConfig+0x112>
- {
- if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE)
- 8002b44: f7ff f98e bl 8001e64 <HAL_GetTick>
- 8002b48: 4602 mov r2, r0
- 8002b4a: 68fb ldr r3, [r7, #12]
- 8002b4c: 1ad3 subs r3, r2, r3
- 8002b4e: f241 3288 movw r2, #5000 ; 0x1388
- 8002b52: 4293 cmp r3, r2
- 8002b54: d901 bls.n 8002b5a <HAL_RCC_ClockConfig+0x112>
- {
- return HAL_TIMEOUT;
- 8002b56: 2303 movs r3, #3
- 8002b58: e09b b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSE)
- 8002b5a: 4b51 ldr r3, [pc, #324] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002b5c: 689b ldr r3, [r3, #8]
- 8002b5e: f003 030c and.w r3, r3, #12
- 8002b62: 2b08 cmp r3, #8
- 8002b64: d1ee bne.n 8002b44 <HAL_RCC_ClockConfig+0xfc>
- 8002b66: e03e b.n 8002be6 <HAL_RCC_ClockConfig+0x19e>
- }
- }
- }
- else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK)
- 8002b68: 687b ldr r3, [r7, #4]
- 8002b6a: 685b ldr r3, [r3, #4]
- 8002b6c: 2b03 cmp r3, #3
- 8002b6e: d112 bne.n 8002b96 <HAL_RCC_ClockConfig+0x14e>
- {
- while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK)
- 8002b70: e00a b.n 8002b88 <HAL_RCC_ClockConfig+0x140>
- {
- if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE)
- 8002b72: f7ff f977 bl 8001e64 <HAL_GetTick>
- 8002b76: 4602 mov r2, r0
- 8002b78: 68fb ldr r3, [r7, #12]
- 8002b7a: 1ad3 subs r3, r2, r3
- 8002b7c: f241 3288 movw r2, #5000 ; 0x1388
- 8002b80: 4293 cmp r3, r2
- 8002b82: d901 bls.n 8002b88 <HAL_RCC_ClockConfig+0x140>
- {
- return HAL_TIMEOUT;
- 8002b84: 2303 movs r3, #3
- 8002b86: e084 b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK)
- 8002b88: 4b45 ldr r3, [pc, #276] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002b8a: 689b ldr r3, [r3, #8]
- 8002b8c: f003 030c and.w r3, r3, #12
- 8002b90: 2b0c cmp r3, #12
- 8002b92: d1ee bne.n 8002b72 <HAL_RCC_ClockConfig+0x12a>
- 8002b94: e027 b.n 8002be6 <HAL_RCC_ClockConfig+0x19e>
- }
- }
- }
- else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSI)
- 8002b96: 687b ldr r3, [r7, #4]
- 8002b98: 685b ldr r3, [r3, #4]
- 8002b9a: 2b01 cmp r3, #1
- 8002b9c: d11d bne.n 8002bda <HAL_RCC_ClockConfig+0x192>
- {
- while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSI)
- 8002b9e: e00a b.n 8002bb6 <HAL_RCC_ClockConfig+0x16e>
- {
- if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE)
- 8002ba0: f7ff f960 bl 8001e64 <HAL_GetTick>
- 8002ba4: 4602 mov r2, r0
- 8002ba6: 68fb ldr r3, [r7, #12]
- 8002ba8: 1ad3 subs r3, r2, r3
- 8002baa: f241 3288 movw r2, #5000 ; 0x1388
- 8002bae: 4293 cmp r3, r2
- 8002bb0: d901 bls.n 8002bb6 <HAL_RCC_ClockConfig+0x16e>
- {
- return HAL_TIMEOUT;
- 8002bb2: 2303 movs r3, #3
- 8002bb4: e06d b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSI)
- 8002bb6: 4b3a ldr r3, [pc, #232] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002bb8: 689b ldr r3, [r3, #8]
- 8002bba: f003 030c and.w r3, r3, #12
- 8002bbe: 2b04 cmp r3, #4
- 8002bc0: d1ee bne.n 8002ba0 <HAL_RCC_ClockConfig+0x158>
- 8002bc2: e010 b.n 8002be6 <HAL_RCC_ClockConfig+0x19e>
- }
- else
- {
- while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_MSI)
- {
- if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE)
- 8002bc4: f7ff f94e bl 8001e64 <HAL_GetTick>
- 8002bc8: 4602 mov r2, r0
- 8002bca: 68fb ldr r3, [r7, #12]
- 8002bcc: 1ad3 subs r3, r2, r3
- 8002bce: f241 3288 movw r2, #5000 ; 0x1388
- 8002bd2: 4293 cmp r3, r2
- 8002bd4: d901 bls.n 8002bda <HAL_RCC_ClockConfig+0x192>
- {
- return HAL_TIMEOUT;
- 8002bd6: 2303 movs r3, #3
- 8002bd8: e05b b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_MSI)
- 8002bda: 4b31 ldr r3, [pc, #196] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002bdc: 689b ldr r3, [r3, #8]
- 8002bde: f003 030c and.w r3, r3, #12
- 8002be2: 2b00 cmp r3, #0
- 8002be4: d1ee bne.n 8002bc4 <HAL_RCC_ClockConfig+0x17c>
- }
- }
- }
- }
- /* Decreasing the number of wait states because of lower CPU frequency */
- if(FLatency < __HAL_FLASH_GET_LATENCY())
- 8002be6: 4b2d ldr r3, [pc, #180] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002be8: 681b ldr r3, [r3, #0]
- 8002bea: f003 0301 and.w r3, r3, #1
- 8002bee: 683a ldr r2, [r7, #0]
- 8002bf0: 429a cmp r2, r3
- 8002bf2: d219 bcs.n 8002c28 <HAL_RCC_ClockConfig+0x1e0>
- {
- /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
- __HAL_FLASH_SET_LATENCY(FLatency);
- 8002bf4: 683b ldr r3, [r7, #0]
- 8002bf6: 2b01 cmp r3, #1
- 8002bf8: d105 bne.n 8002c06 <HAL_RCC_ClockConfig+0x1be>
- 8002bfa: 4b28 ldr r3, [pc, #160] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002bfc: 681b ldr r3, [r3, #0]
- 8002bfe: 4a27 ldr r2, [pc, #156] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002c00: f043 0304 orr.w r3, r3, #4
- 8002c04: 6013 str r3, [r2, #0]
- 8002c06: 4b25 ldr r3, [pc, #148] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002c08: 681b ldr r3, [r3, #0]
- 8002c0a: f023 0201 bic.w r2, r3, #1
- 8002c0e: 4923 ldr r1, [pc, #140] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002c10: 683b ldr r3, [r7, #0]
- 8002c12: 4313 orrs r3, r2
- 8002c14: 600b str r3, [r1, #0]
-
- /* Check that the new number of wait states is taken into account to access the Flash
- memory by reading the FLASH_ACR register */
- if(__HAL_FLASH_GET_LATENCY() != FLatency)
- 8002c16: 4b21 ldr r3, [pc, #132] ; (8002c9c <HAL_RCC_ClockConfig+0x254>)
- 8002c18: 681b ldr r3, [r3, #0]
- 8002c1a: f003 0301 and.w r3, r3, #1
- 8002c1e: 683a ldr r2, [r7, #0]
- 8002c20: 429a cmp r2, r3
- 8002c22: d001 beq.n 8002c28 <HAL_RCC_ClockConfig+0x1e0>
- {
- return HAL_ERROR;
- 8002c24: 2301 movs r3, #1
- 8002c26: e034 b.n 8002c92 <HAL_RCC_ClockConfig+0x24a>
- }
- }
-
- /*-------------------------- PCLK1 Configuration ---------------------------*/
- if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1)
- 8002c28: 687b ldr r3, [r7, #4]
- 8002c2a: 681b ldr r3, [r3, #0]
- 8002c2c: f003 0304 and.w r3, r3, #4
- 8002c30: 2b00 cmp r3, #0
- 8002c32: d008 beq.n 8002c46 <HAL_RCC_ClockConfig+0x1fe>
- {
- assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB1CLKDivider));
- MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_ClkInitStruct->APB1CLKDivider);
- 8002c34: 4b1a ldr r3, [pc, #104] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002c36: 689b ldr r3, [r3, #8]
- 8002c38: f423 62e0 bic.w r2, r3, #1792 ; 0x700
- 8002c3c: 687b ldr r3, [r7, #4]
- 8002c3e: 68db ldr r3, [r3, #12]
- 8002c40: 4917 ldr r1, [pc, #92] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002c42: 4313 orrs r3, r2
- 8002c44: 608b str r3, [r1, #8]
- }
-
- /*-------------------------- PCLK2 Configuration ---------------------------*/
- if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2)
- 8002c46: 687b ldr r3, [r7, #4]
- 8002c48: 681b ldr r3, [r3, #0]
- 8002c4a: f003 0308 and.w r3, r3, #8
- 8002c4e: 2b00 cmp r3, #0
- 8002c50: d009 beq.n 8002c66 <HAL_RCC_ClockConfig+0x21e>
- {
- assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB2CLKDivider));
- MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, ((RCC_ClkInitStruct->APB2CLKDivider) << 3U));
- 8002c52: 4b13 ldr r3, [pc, #76] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002c54: 689b ldr r3, [r3, #8]
- 8002c56: f423 5260 bic.w r2, r3, #14336 ; 0x3800
- 8002c5a: 687b ldr r3, [r7, #4]
- 8002c5c: 691b ldr r3, [r3, #16]
- 8002c5e: 00db lsls r3, r3, #3
- 8002c60: 490f ldr r1, [pc, #60] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002c62: 4313 orrs r3, r2
- 8002c64: 608b str r3, [r1, #8]
- }
-
- /* Update the SystemCoreClock global variable */
- SystemCoreClock = HAL_RCC_GetSysClockFreq() >> AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE)>> RCC_CFGR_HPRE_Pos];
- 8002c66: f000 f823 bl 8002cb0 <HAL_RCC_GetSysClockFreq>
- 8002c6a: 4601 mov r1, r0
- 8002c6c: 4b0c ldr r3, [pc, #48] ; (8002ca0 <HAL_RCC_ClockConfig+0x258>)
- 8002c6e: 689b ldr r3, [r3, #8]
- 8002c70: 091b lsrs r3, r3, #4
- 8002c72: f003 030f and.w r3, r3, #15
- 8002c76: 4a0b ldr r2, [pc, #44] ; (8002ca4 <HAL_RCC_ClockConfig+0x25c>)
- 8002c78: 5cd3 ldrb r3, [r2, r3]
- 8002c7a: fa21 f303 lsr.w r3, r1, r3
- 8002c7e: 4a0a ldr r2, [pc, #40] ; (8002ca8 <HAL_RCC_ClockConfig+0x260>)
- 8002c80: 6013 str r3, [r2, #0]
-
- /* Configure the source of time base considering new system clocks settings*/
- status = HAL_InitTick(uwTickPrio);
- 8002c82: 4b0a ldr r3, [pc, #40] ; (8002cac <HAL_RCC_ClockConfig+0x264>)
- 8002c84: 681b ldr r3, [r3, #0]
- 8002c86: 4618 mov r0, r3
- 8002c88: f7ff f8a0 bl 8001dcc <HAL_InitTick>
- 8002c8c: 4603 mov r3, r0
- 8002c8e: 72fb strb r3, [r7, #11]
-
- return status;
- 8002c90: 7afb ldrb r3, [r7, #11]
- }
- 8002c92: 4618 mov r0, r3
- 8002c94: 3710 adds r7, #16
- 8002c96: 46bd mov sp, r7
- 8002c98: bd80 pop {r7, pc}
- 8002c9a: bf00 nop
- 8002c9c: 40023c00 .word 0x40023c00
- 8002ca0: 40023800 .word 0x40023800
- 8002ca4: 08007b30 .word 0x08007b30
- 8002ca8: 20000004 .word 0x20000004
- 8002cac: 20000008 .word 0x20000008
-
- 08002cb0 <HAL_RCC_GetSysClockFreq>:
- * right SYSCLK value. Otherwise, any configuration based on this function will be incorrect.
- *
- * @retval SYSCLK frequency
- */
- uint32_t HAL_RCC_GetSysClockFreq(void)
- {
- 8002cb0: b5f0 push {r4, r5, r6, r7, lr}
- 8002cb2: b087 sub sp, #28
- 8002cb4: af00 add r7, sp, #0
- uint32_t tmpreg, pllm, plld, pllvco, msiclkrange, sysclockfreq;
-
- tmpreg = RCC->CFGR;
- 8002cb6: 4b5f ldr r3, [pc, #380] ; (8002e34 <HAL_RCC_GetSysClockFreq+0x184>)
- 8002cb8: 689b ldr r3, [r3, #8]
- 8002cba: 60fb str r3, [r7, #12]
-
- /* Get SYSCLK source -------------------------------------------------------*/
- switch (tmpreg & RCC_CFGR_SWS)
- 8002cbc: 68fb ldr r3, [r7, #12]
- 8002cbe: f003 030c and.w r3, r3, #12
- 8002cc2: 2b08 cmp r3, #8
- 8002cc4: d007 beq.n 8002cd6 <HAL_RCC_GetSysClockFreq+0x26>
- 8002cc6: 2b0c cmp r3, #12
- 8002cc8: d008 beq.n 8002cdc <HAL_RCC_GetSysClockFreq+0x2c>
- 8002cca: 2b04 cmp r3, #4
- 8002ccc: f040 809f bne.w 8002e0e <HAL_RCC_GetSysClockFreq+0x15e>
- {
- case RCC_SYSCLKSOURCE_STATUS_HSI: /* HSI used as system clock source */
- {
- sysclockfreq = HSI_VALUE;
- 8002cd0: 4b59 ldr r3, [pc, #356] ; (8002e38 <HAL_RCC_GetSysClockFreq+0x188>)
- 8002cd2: 613b str r3, [r7, #16]
- break;
- 8002cd4: e0a9 b.n 8002e2a <HAL_RCC_GetSysClockFreq+0x17a>
- }
- case RCC_SYSCLKSOURCE_STATUS_HSE: /* HSE used as system clock */
- {
- sysclockfreq = HSE_VALUE;
- 8002cd6: 4b59 ldr r3, [pc, #356] ; (8002e3c <HAL_RCC_GetSysClockFreq+0x18c>)
- 8002cd8: 613b str r3, [r7, #16]
- break;
- 8002cda: e0a6 b.n 8002e2a <HAL_RCC_GetSysClockFreq+0x17a>
- }
- case RCC_SYSCLKSOURCE_STATUS_PLLCLK: /* PLL used as system clock */
- {
- pllm = PLLMulTable[(uint32_t)(tmpreg & RCC_CFGR_PLLMUL) >> RCC_CFGR_PLLMUL_Pos];
- 8002cdc: 68fb ldr r3, [r7, #12]
- 8002cde: 0c9b lsrs r3, r3, #18
- 8002ce0: f003 030f and.w r3, r3, #15
- 8002ce4: 4a56 ldr r2, [pc, #344] ; (8002e40 <HAL_RCC_GetSysClockFreq+0x190>)
- 8002ce6: 5cd3 ldrb r3, [r2, r3]
- 8002ce8: 60bb str r3, [r7, #8]
- plld = ((uint32_t)(tmpreg & RCC_CFGR_PLLDIV) >> RCC_CFGR_PLLDIV_Pos) + 1U;
- 8002cea: 68fb ldr r3, [r7, #12]
- 8002cec: 0d9b lsrs r3, r3, #22
- 8002cee: f003 0303 and.w r3, r3, #3
- 8002cf2: 3301 adds r3, #1
- 8002cf4: 607b str r3, [r7, #4]
- if (__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLSOURCE_HSI)
- 8002cf6: 4b4f ldr r3, [pc, #316] ; (8002e34 <HAL_RCC_GetSysClockFreq+0x184>)
- 8002cf8: 689b ldr r3, [r3, #8]
- 8002cfa: f403 3380 and.w r3, r3, #65536 ; 0x10000
- 8002cfe: 2b00 cmp r3, #0
- 8002d00: d041 beq.n 8002d86 <HAL_RCC_GetSysClockFreq+0xd6>
- {
- /* HSE used as PLL clock source */
- pllvco = (uint32_t)(((uint64_t)HSE_VALUE * (uint64_t)pllm) / (uint64_t)plld);
- 8002d02: 68bb ldr r3, [r7, #8]
- 8002d04: 461d mov r5, r3
- 8002d06: f04f 0600 mov.w r6, #0
- 8002d0a: 4629 mov r1, r5
- 8002d0c: 4632 mov r2, r6
- 8002d0e: f04f 0300 mov.w r3, #0
- 8002d12: f04f 0400 mov.w r4, #0
- 8002d16: 0154 lsls r4, r2, #5
- 8002d18: ea44 64d1 orr.w r4, r4, r1, lsr #27
- 8002d1c: 014b lsls r3, r1, #5
- 8002d1e: 4619 mov r1, r3
- 8002d20: 4622 mov r2, r4
- 8002d22: 1b49 subs r1, r1, r5
- 8002d24: eb62 0206 sbc.w r2, r2, r6
- 8002d28: f04f 0300 mov.w r3, #0
- 8002d2c: f04f 0400 mov.w r4, #0
- 8002d30: 0194 lsls r4, r2, #6
- 8002d32: ea44 6491 orr.w r4, r4, r1, lsr #26
- 8002d36: 018b lsls r3, r1, #6
- 8002d38: 1a5b subs r3, r3, r1
- 8002d3a: eb64 0402 sbc.w r4, r4, r2
- 8002d3e: f04f 0100 mov.w r1, #0
- 8002d42: f04f 0200 mov.w r2, #0
- 8002d46: 00e2 lsls r2, r4, #3
- 8002d48: ea42 7253 orr.w r2, r2, r3, lsr #29
- 8002d4c: 00d9 lsls r1, r3, #3
- 8002d4e: 460b mov r3, r1
- 8002d50: 4614 mov r4, r2
- 8002d52: 195b adds r3, r3, r5
- 8002d54: eb44 0406 adc.w r4, r4, r6
- 8002d58: f04f 0100 mov.w r1, #0
- 8002d5c: f04f 0200 mov.w r2, #0
- 8002d60: 0262 lsls r2, r4, #9
- 8002d62: ea42 52d3 orr.w r2, r2, r3, lsr #23
- 8002d66: 0259 lsls r1, r3, #9
- 8002d68: 460b mov r3, r1
- 8002d6a: 4614 mov r4, r2
- 8002d6c: 4618 mov r0, r3
- 8002d6e: 4621 mov r1, r4
- 8002d70: 687b ldr r3, [r7, #4]
- 8002d72: f04f 0400 mov.w r4, #0
- 8002d76: 461a mov r2, r3
- 8002d78: 4623 mov r3, r4
- 8002d7a: f7fd fdf5 bl 8000968 <__aeabi_uldivmod>
- 8002d7e: 4603 mov r3, r0
- 8002d80: 460c mov r4, r1
- 8002d82: 617b str r3, [r7, #20]
- 8002d84: e040 b.n 8002e08 <HAL_RCC_GetSysClockFreq+0x158>
- }
- else
- {
- /* HSI used as PLL clock source */
- pllvco = (uint32_t)(((uint64_t)HSI_VALUE * (uint64_t)pllm) / (uint64_t)plld);
- 8002d86: 68bb ldr r3, [r7, #8]
- 8002d88: 461d mov r5, r3
- 8002d8a: f04f 0600 mov.w r6, #0
- 8002d8e: 4629 mov r1, r5
- 8002d90: 4632 mov r2, r6
- 8002d92: f04f 0300 mov.w r3, #0
- 8002d96: f04f 0400 mov.w r4, #0
- 8002d9a: 0154 lsls r4, r2, #5
- 8002d9c: ea44 64d1 orr.w r4, r4, r1, lsr #27
- 8002da0: 014b lsls r3, r1, #5
- 8002da2: 4619 mov r1, r3
- 8002da4: 4622 mov r2, r4
- 8002da6: 1b49 subs r1, r1, r5
- 8002da8: eb62 0206 sbc.w r2, r2, r6
- 8002dac: f04f 0300 mov.w r3, #0
- 8002db0: f04f 0400 mov.w r4, #0
- 8002db4: 0194 lsls r4, r2, #6
- 8002db6: ea44 6491 orr.w r4, r4, r1, lsr #26
- 8002dba: 018b lsls r3, r1, #6
- 8002dbc: 1a5b subs r3, r3, r1
- 8002dbe: eb64 0402 sbc.w r4, r4, r2
- 8002dc2: f04f 0100 mov.w r1, #0
- 8002dc6: f04f 0200 mov.w r2, #0
- 8002dca: 00e2 lsls r2, r4, #3
- 8002dcc: ea42 7253 orr.w r2, r2, r3, lsr #29
- 8002dd0: 00d9 lsls r1, r3, #3
- 8002dd2: 460b mov r3, r1
- 8002dd4: 4614 mov r4, r2
- 8002dd6: 195b adds r3, r3, r5
- 8002dd8: eb44 0406 adc.w r4, r4, r6
- 8002ddc: f04f 0100 mov.w r1, #0
- 8002de0: f04f 0200 mov.w r2, #0
- 8002de4: 02a2 lsls r2, r4, #10
- 8002de6: ea42 5293 orr.w r2, r2, r3, lsr #22
- 8002dea: 0299 lsls r1, r3, #10
- 8002dec: 460b mov r3, r1
- 8002dee: 4614 mov r4, r2
- 8002df0: 4618 mov r0, r3
- 8002df2: 4621 mov r1, r4
- 8002df4: 687b ldr r3, [r7, #4]
- 8002df6: f04f 0400 mov.w r4, #0
- 8002dfa: 461a mov r2, r3
- 8002dfc: 4623 mov r3, r4
- 8002dfe: f7fd fdb3 bl 8000968 <__aeabi_uldivmod>
- 8002e02: 4603 mov r3, r0
- 8002e04: 460c mov r4, r1
- 8002e06: 617b str r3, [r7, #20]
- }
- sysclockfreq = pllvco;
- 8002e08: 697b ldr r3, [r7, #20]
- 8002e0a: 613b str r3, [r7, #16]
- break;
- 8002e0c: e00d b.n 8002e2a <HAL_RCC_GetSysClockFreq+0x17a>
- }
- case RCC_SYSCLKSOURCE_STATUS_MSI: /* MSI used as system clock source */
- default: /* MSI used as system clock */
- {
- msiclkrange = (RCC->ICSCR & RCC_ICSCR_MSIRANGE ) >> RCC_ICSCR_MSIRANGE_Pos;
- 8002e0e: 4b09 ldr r3, [pc, #36] ; (8002e34 <HAL_RCC_GetSysClockFreq+0x184>)
- 8002e10: 685b ldr r3, [r3, #4]
- 8002e12: 0b5b lsrs r3, r3, #13
- 8002e14: f003 0307 and.w r3, r3, #7
- 8002e18: 603b str r3, [r7, #0]
- sysclockfreq = (32768U * (1UL << (msiclkrange + 1U)));
- 8002e1a: 683b ldr r3, [r7, #0]
- 8002e1c: 3301 adds r3, #1
- 8002e1e: f44f 4200 mov.w r2, #32768 ; 0x8000
- 8002e22: fa02 f303 lsl.w r3, r2, r3
- 8002e26: 613b str r3, [r7, #16]
- break;
- 8002e28: bf00 nop
- }
- }
- return sysclockfreq;
- 8002e2a: 693b ldr r3, [r7, #16]
- }
- 8002e2c: 4618 mov r0, r3
- 8002e2e: 371c adds r7, #28
- 8002e30: 46bd mov sp, r7
- 8002e32: bdf0 pop {r4, r5, r6, r7, pc}
- 8002e34: 40023800 .word 0x40023800
- 8002e38: 00f42400 .word 0x00f42400
- 8002e3c: 007a1200 .word 0x007a1200
- 8002e40: 08007b24 .word 0x08007b24
-
- 08002e44 <HAL_RCC_GetHCLKFreq>:
- * @note The SystemCoreClock CMSIS variable is used to store System Clock Frequency
- * and updated within this function
- * @retval HCLK frequency
- */
- uint32_t HAL_RCC_GetHCLKFreq(void)
- {
- 8002e44: b480 push {r7}
- 8002e46: af00 add r7, sp, #0
- return SystemCoreClock;
- 8002e48: 4b02 ldr r3, [pc, #8] ; (8002e54 <HAL_RCC_GetHCLKFreq+0x10>)
- 8002e4a: 681b ldr r3, [r3, #0]
- }
- 8002e4c: 4618 mov r0, r3
- 8002e4e: 46bd mov sp, r7
- 8002e50: bc80 pop {r7}
- 8002e52: 4770 bx lr
- 8002e54: 20000004 .word 0x20000004
-
- 08002e58 <HAL_RCC_GetPCLK1Freq>:
- * @note Each time PCLK1 changes, this function must be called to update the
- * right PCLK1 value. Otherwise, any configuration based on this function will be incorrect.
- * @retval PCLK1 frequency
- */
- uint32_t HAL_RCC_GetPCLK1Freq(void)
- {
- 8002e58: b580 push {r7, lr}
- 8002e5a: af00 add r7, sp, #0
- /* Get HCLK source and Compute PCLK1 frequency ---------------------------*/
- return (HAL_RCC_GetHCLKFreq() >> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1) >> RCC_CFGR_PPRE1_Pos]);
- 8002e5c: f7ff fff2 bl 8002e44 <HAL_RCC_GetHCLKFreq>
- 8002e60: 4601 mov r1, r0
- 8002e62: 4b05 ldr r3, [pc, #20] ; (8002e78 <HAL_RCC_GetPCLK1Freq+0x20>)
- 8002e64: 689b ldr r3, [r3, #8]
- 8002e66: 0a1b lsrs r3, r3, #8
- 8002e68: f003 0307 and.w r3, r3, #7
- 8002e6c: 4a03 ldr r2, [pc, #12] ; (8002e7c <HAL_RCC_GetPCLK1Freq+0x24>)
- 8002e6e: 5cd3 ldrb r3, [r2, r3]
- 8002e70: fa21 f303 lsr.w r3, r1, r3
- }
- 8002e74: 4618 mov r0, r3
- 8002e76: bd80 pop {r7, pc}
- 8002e78: 40023800 .word 0x40023800
- 8002e7c: 08007b40 .word 0x08007b40
-
- 08002e80 <HAL_RCC_GetPCLK2Freq>:
- * @note Each time PCLK2 changes, this function must be called to update the
- * right PCLK2 value. Otherwise, any configuration based on this function will be incorrect.
- * @retval PCLK2 frequency
- */
- uint32_t HAL_RCC_GetPCLK2Freq(void)
- {
- 8002e80: b580 push {r7, lr}
- 8002e82: af00 add r7, sp, #0
- /* Get HCLK source and Compute PCLK2 frequency ---------------------------*/
- return (HAL_RCC_GetHCLKFreq()>> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2) >> RCC_CFGR_PPRE2_Pos]);
- 8002e84: f7ff ffde bl 8002e44 <HAL_RCC_GetHCLKFreq>
- 8002e88: 4601 mov r1, r0
- 8002e8a: 4b05 ldr r3, [pc, #20] ; (8002ea0 <HAL_RCC_GetPCLK2Freq+0x20>)
- 8002e8c: 689b ldr r3, [r3, #8]
- 8002e8e: 0adb lsrs r3, r3, #11
- 8002e90: f003 0307 and.w r3, r3, #7
- 8002e94: 4a03 ldr r2, [pc, #12] ; (8002ea4 <HAL_RCC_GetPCLK2Freq+0x24>)
- 8002e96: 5cd3 ldrb r3, [r2, r3]
- 8002e98: fa21 f303 lsr.w r3, r1, r3
- }
- 8002e9c: 4618 mov r0, r3
- 8002e9e: bd80 pop {r7, pc}
- 8002ea0: 40023800 .word 0x40023800
- 8002ea4: 08007b40 .word 0x08007b40
-
- 08002ea8 <RCC_SetFlashLatencyFromMSIRange>:
- voltage range
- * @param MSIrange MSI range value from RCC_MSIRANGE_0 to RCC_MSIRANGE_6
- * @retval HAL status
- */
- static HAL_StatusTypeDef RCC_SetFlashLatencyFromMSIRange(uint32_t MSIrange)
- {
- 8002ea8: b480 push {r7}
- 8002eaa: b087 sub sp, #28
- 8002eac: af00 add r7, sp, #0
- 8002eae: 6078 str r0, [r7, #4]
- uint32_t vos;
- uint32_t latency = FLASH_LATENCY_0; /* default value 0WS */
- 8002eb0: 2300 movs r3, #0
- 8002eb2: 613b str r3, [r7, #16]
-
- /* HCLK can reach 4 MHz only if AHB prescaler = 1 */
- if (READ_BIT(RCC->CFGR, RCC_CFGR_HPRE) == RCC_SYSCLK_DIV1)
- 8002eb4: 4b29 ldr r3, [pc, #164] ; (8002f5c <RCC_SetFlashLatencyFromMSIRange+0xb4>)
- 8002eb6: 689b ldr r3, [r3, #8]
- 8002eb8: f003 03f0 and.w r3, r3, #240 ; 0xf0
- 8002ebc: 2b00 cmp r3, #0
- 8002ebe: d12c bne.n 8002f1a <RCC_SetFlashLatencyFromMSIRange+0x72>
- {
- if(__HAL_RCC_PWR_IS_CLK_ENABLED())
- 8002ec0: 4b26 ldr r3, [pc, #152] ; (8002f5c <RCC_SetFlashLatencyFromMSIRange+0xb4>)
- 8002ec2: 6a5b ldr r3, [r3, #36] ; 0x24
- 8002ec4: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
- 8002ec8: 2b00 cmp r3, #0
- 8002eca: d005 beq.n 8002ed8 <RCC_SetFlashLatencyFromMSIRange+0x30>
- {
- vos = READ_BIT(PWR->CR, PWR_CR_VOS);
- 8002ecc: 4b24 ldr r3, [pc, #144] ; (8002f60 <RCC_SetFlashLatencyFromMSIRange+0xb8>)
- 8002ece: 681b ldr r3, [r3, #0]
- 8002ed0: f403 53c0 and.w r3, r3, #6144 ; 0x1800
- 8002ed4: 617b str r3, [r7, #20]
- 8002ed6: e016 b.n 8002f06 <RCC_SetFlashLatencyFromMSIRange+0x5e>
- }
- else
- {
- __HAL_RCC_PWR_CLK_ENABLE();
- 8002ed8: 4b20 ldr r3, [pc, #128] ; (8002f5c <RCC_SetFlashLatencyFromMSIRange+0xb4>)
- 8002eda: 6a5b ldr r3, [r3, #36] ; 0x24
- 8002edc: 4a1f ldr r2, [pc, #124] ; (8002f5c <RCC_SetFlashLatencyFromMSIRange+0xb4>)
- 8002ede: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
- 8002ee2: 6253 str r3, [r2, #36] ; 0x24
- 8002ee4: 4b1d ldr r3, [pc, #116] ; (8002f5c <RCC_SetFlashLatencyFromMSIRange+0xb4>)
- 8002ee6: 6a5b ldr r3, [r3, #36] ; 0x24
- 8002ee8: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
- 8002eec: 60fb str r3, [r7, #12]
- 8002eee: 68fb ldr r3, [r7, #12]
- vos = READ_BIT(PWR->CR, PWR_CR_VOS);
- 8002ef0: 4b1b ldr r3, [pc, #108] ; (8002f60 <RCC_SetFlashLatencyFromMSIRange+0xb8>)
- 8002ef2: 681b ldr r3, [r3, #0]
- 8002ef4: f403 53c0 and.w r3, r3, #6144 ; 0x1800
- 8002ef8: 617b str r3, [r7, #20]
- __HAL_RCC_PWR_CLK_DISABLE();
- 8002efa: 4b18 ldr r3, [pc, #96] ; (8002f5c <RCC_SetFlashLatencyFromMSIRange+0xb4>)
- 8002efc: 6a5b ldr r3, [r3, #36] ; 0x24
- 8002efe: 4a17 ldr r2, [pc, #92] ; (8002f5c <RCC_SetFlashLatencyFromMSIRange+0xb4>)
- 8002f00: f023 5380 bic.w r3, r3, #268435456 ; 0x10000000
- 8002f04: 6253 str r3, [r2, #36] ; 0x24
- }
-
- /* Check if need to set latency 1 only for Range 3 & HCLK = 4MHz */
- if((vos == PWR_REGULATOR_VOLTAGE_SCALE3) && (MSIrange == RCC_MSIRANGE_6))
- 8002f06: 697b ldr r3, [r7, #20]
- 8002f08: f5b3 5fc0 cmp.w r3, #6144 ; 0x1800
- 8002f0c: d105 bne.n 8002f1a <RCC_SetFlashLatencyFromMSIRange+0x72>
- 8002f0e: 687b ldr r3, [r7, #4]
- 8002f10: f5b3 4f40 cmp.w r3, #49152 ; 0xc000
- 8002f14: d101 bne.n 8002f1a <RCC_SetFlashLatencyFromMSIRange+0x72>
- {
- latency = FLASH_LATENCY_1; /* 1WS */
- 8002f16: 2301 movs r3, #1
- 8002f18: 613b str r3, [r7, #16]
- }
- }
-
- __HAL_FLASH_SET_LATENCY(latency);
- 8002f1a: 693b ldr r3, [r7, #16]
- 8002f1c: 2b01 cmp r3, #1
- 8002f1e: d105 bne.n 8002f2c <RCC_SetFlashLatencyFromMSIRange+0x84>
- 8002f20: 4b10 ldr r3, [pc, #64] ; (8002f64 <RCC_SetFlashLatencyFromMSIRange+0xbc>)
- 8002f22: 681b ldr r3, [r3, #0]
- 8002f24: 4a0f ldr r2, [pc, #60] ; (8002f64 <RCC_SetFlashLatencyFromMSIRange+0xbc>)
- 8002f26: f043 0304 orr.w r3, r3, #4
- 8002f2a: 6013 str r3, [r2, #0]
- 8002f2c: 4b0d ldr r3, [pc, #52] ; (8002f64 <RCC_SetFlashLatencyFromMSIRange+0xbc>)
- 8002f2e: 681b ldr r3, [r3, #0]
- 8002f30: f023 0201 bic.w r2, r3, #1
- 8002f34: 490b ldr r1, [pc, #44] ; (8002f64 <RCC_SetFlashLatencyFromMSIRange+0xbc>)
- 8002f36: 693b ldr r3, [r7, #16]
- 8002f38: 4313 orrs r3, r2
- 8002f3a: 600b str r3, [r1, #0]
-
- /* Check that the new number of wait states is taken into account to access the Flash
- memory by reading the FLASH_ACR register */
- if(__HAL_FLASH_GET_LATENCY() != latency)
- 8002f3c: 4b09 ldr r3, [pc, #36] ; (8002f64 <RCC_SetFlashLatencyFromMSIRange+0xbc>)
- 8002f3e: 681b ldr r3, [r3, #0]
- 8002f40: f003 0301 and.w r3, r3, #1
- 8002f44: 693a ldr r2, [r7, #16]
- 8002f46: 429a cmp r2, r3
- 8002f48: d001 beq.n 8002f4e <RCC_SetFlashLatencyFromMSIRange+0xa6>
- {
- return HAL_ERROR;
- 8002f4a: 2301 movs r3, #1
- 8002f4c: e000 b.n 8002f50 <RCC_SetFlashLatencyFromMSIRange+0xa8>
- }
-
- return HAL_OK;
- 8002f4e: 2300 movs r3, #0
- }
- 8002f50: 4618 mov r0, r3
- 8002f52: 371c adds r7, #28
- 8002f54: 46bd mov sp, r7
- 8002f56: bc80 pop {r7}
- 8002f58: 4770 bx lr
- 8002f5a: bf00 nop
- 8002f5c: 40023800 .word 0x40023800
- 8002f60: 40007000 .word 0x40007000
- 8002f64: 40023c00 .word 0x40023c00
-
- 08002f68 <HAL_SPI_Init>:
- * @param hspi pointer to a SPI_HandleTypeDef structure that contains
- * the configuration information for SPI module.
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)
- {
- 8002f68: b580 push {r7, lr}
- 8002f6a: b082 sub sp, #8
- 8002f6c: af00 add r7, sp, #0
- 8002f6e: 6078 str r0, [r7, #4]
- /* Check the SPI handle allocation */
- if (hspi == NULL)
- 8002f70: 687b ldr r3, [r7, #4]
- 8002f72: 2b00 cmp r3, #0
- 8002f74: d101 bne.n 8002f7a <HAL_SPI_Init+0x12>
- {
- return HAL_ERROR;
- 8002f76: 2301 movs r3, #1
- 8002f78: e07b b.n 8003072 <HAL_SPI_Init+0x10a>
- assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler));
- assert_param(IS_SPI_FIRST_BIT(hspi->Init.FirstBit));
- /* TI mode is not supported on all devices in stm32l1xx serie.
- TIMode parameter is mandatory equal to SPI_TIMODE_DISABLE if TI mode is not supported */
- assert_param(IS_SPI_TIMODE(hspi->Init.TIMode));
- if (hspi->Init.TIMode == SPI_TIMODE_DISABLE)
- 8002f7a: 687b ldr r3, [r7, #4]
- 8002f7c: 6a5b ldr r3, [r3, #36] ; 0x24
- 8002f7e: 2b00 cmp r3, #0
- 8002f80: d108 bne.n 8002f94 <HAL_SPI_Init+0x2c>
- {
- assert_param(IS_SPI_CPOL(hspi->Init.CLKPolarity));
- assert_param(IS_SPI_CPHA(hspi->Init.CLKPhase));
-
- if (hspi->Init.Mode == SPI_MODE_MASTER)
- 8002f82: 687b ldr r3, [r7, #4]
- 8002f84: 685b ldr r3, [r3, #4]
- 8002f86: f5b3 7f82 cmp.w r3, #260 ; 0x104
- 8002f8a: d009 beq.n 8002fa0 <HAL_SPI_Init+0x38>
- assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler));
- }
- else
- {
- /* Baudrate prescaler not use in Motoraola Slave mode. force to default value */
- hspi->Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
- 8002f8c: 687b ldr r3, [r7, #4]
- 8002f8e: 2200 movs r2, #0
- 8002f90: 61da str r2, [r3, #28]
- 8002f92: e005 b.n 8002fa0 <HAL_SPI_Init+0x38>
- else
- {
- assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler));
-
- /* Force polarity and phase to TI protocaol requirements */
- hspi->Init.CLKPolarity = SPI_POLARITY_LOW;
- 8002f94: 687b ldr r3, [r7, #4]
- 8002f96: 2200 movs r2, #0
- 8002f98: 611a str r2, [r3, #16]
- hspi->Init.CLKPhase = SPI_PHASE_1EDGE;
- 8002f9a: 687b ldr r3, [r7, #4]
- 8002f9c: 2200 movs r2, #0
- 8002f9e: 615a str r2, [r3, #20]
- if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
- {
- assert_param(IS_SPI_CRC_POLYNOMIAL(hspi->Init.CRCPolynomial));
- }
- #else
- hspi->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
- 8002fa0: 687b ldr r3, [r7, #4]
- 8002fa2: 2200 movs r2, #0
- 8002fa4: 629a str r2, [r3, #40] ; 0x28
- #endif /* USE_SPI_CRC */
-
- if (hspi->State == HAL_SPI_STATE_RESET)
- 8002fa6: 687b ldr r3, [r7, #4]
- 8002fa8: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
- 8002fac: b2db uxtb r3, r3
- 8002fae: 2b00 cmp r3, #0
- 8002fb0: d106 bne.n 8002fc0 <HAL_SPI_Init+0x58>
- {
- /* Allocate lock resource and initialize it */
- hspi->Lock = HAL_UNLOCKED;
- 8002fb2: 687b ldr r3, [r7, #4]
- 8002fb4: 2200 movs r2, #0
- 8002fb6: f883 2050 strb.w r2, [r3, #80] ; 0x50
-
- /* Init the low level hardware : GPIO, CLOCK, NVIC... */
- hspi->MspInitCallback(hspi);
- #else
- /* Init the low level hardware : GPIO, CLOCK, NVIC... */
- HAL_SPI_MspInit(hspi);
- 8002fba: 6878 ldr r0, [r7, #4]
- 8002fbc: f7fe fdba bl 8001b34 <HAL_SPI_MspInit>
- #endif /* USE_HAL_SPI_REGISTER_CALLBACKS */
- }
-
- hspi->State = HAL_SPI_STATE_BUSY;
- 8002fc0: 687b ldr r3, [r7, #4]
- 8002fc2: 2202 movs r2, #2
- 8002fc4: f883 2051 strb.w r2, [r3, #81] ; 0x51
-
- /* Disable the selected SPI peripheral */
- __HAL_SPI_DISABLE(hspi);
- 8002fc8: 687b ldr r3, [r7, #4]
- 8002fca: 681b ldr r3, [r3, #0]
- 8002fcc: 681a ldr r2, [r3, #0]
- 8002fce: 687b ldr r3, [r7, #4]
- 8002fd0: 681b ldr r3, [r3, #0]
- 8002fd2: f022 0240 bic.w r2, r2, #64 ; 0x40
- 8002fd6: 601a str r2, [r3, #0]
-
- /*----------------------- SPIx CR1 & CR2 Configuration ---------------------*/
- /* Configure : SPI Mode, Communication Mode, Data size, Clock polarity and phase, NSS management,
- Communication speed, First bit and CRC calculation state */
- WRITE_REG(hspi->Instance->CR1, ((hspi->Init.Mode & (SPI_CR1_MSTR | SPI_CR1_SSI)) |
- 8002fd8: 687b ldr r3, [r7, #4]
- 8002fda: 685b ldr r3, [r3, #4]
- 8002fdc: f403 7282 and.w r2, r3, #260 ; 0x104
- 8002fe0: 687b ldr r3, [r7, #4]
- 8002fe2: 689b ldr r3, [r3, #8]
- 8002fe4: f403 4304 and.w r3, r3, #33792 ; 0x8400
- 8002fe8: 431a orrs r2, r3
- 8002fea: 687b ldr r3, [r7, #4]
- 8002fec: 68db ldr r3, [r3, #12]
- 8002fee: f403 6300 and.w r3, r3, #2048 ; 0x800
- 8002ff2: 431a orrs r2, r3
- 8002ff4: 687b ldr r3, [r7, #4]
- 8002ff6: 691b ldr r3, [r3, #16]
- 8002ff8: f003 0302 and.w r3, r3, #2
- 8002ffc: 431a orrs r2, r3
- 8002ffe: 687b ldr r3, [r7, #4]
- 8003000: 695b ldr r3, [r3, #20]
- 8003002: f003 0301 and.w r3, r3, #1
- 8003006: 431a orrs r2, r3
- 8003008: 687b ldr r3, [r7, #4]
- 800300a: 699b ldr r3, [r3, #24]
- 800300c: f403 7300 and.w r3, r3, #512 ; 0x200
- 8003010: 431a orrs r2, r3
- 8003012: 687b ldr r3, [r7, #4]
- 8003014: 69db ldr r3, [r3, #28]
- 8003016: f003 0338 and.w r3, r3, #56 ; 0x38
- 800301a: 431a orrs r2, r3
- 800301c: 687b ldr r3, [r7, #4]
- 800301e: 6a1b ldr r3, [r3, #32]
- 8003020: f003 0380 and.w r3, r3, #128 ; 0x80
- 8003024: ea42 0103 orr.w r1, r2, r3
- 8003028: 687b ldr r3, [r7, #4]
- 800302a: 6a9b ldr r3, [r3, #40] ; 0x28
- 800302c: f403 5200 and.w r2, r3, #8192 ; 0x2000
- 8003030: 687b ldr r3, [r7, #4]
- 8003032: 681b ldr r3, [r3, #0]
- 8003034: 430a orrs r2, r1
- 8003036: 601a str r2, [r3, #0]
- (hspi->Init.FirstBit & SPI_CR1_LSBFIRST) |
- (hspi->Init.CRCCalculation & SPI_CR1_CRCEN)));
-
- #if defined(SPI_CR2_FRF)
- /* Configure : NSS management, TI Mode */
- WRITE_REG(hspi->Instance->CR2, (((hspi->Init.NSS >> 16U) & SPI_CR2_SSOE) | (hspi->Init.TIMode & SPI_CR2_FRF)));
- 8003038: 687b ldr r3, [r7, #4]
- 800303a: 699b ldr r3, [r3, #24]
- 800303c: 0c1b lsrs r3, r3, #16
- 800303e: f003 0104 and.w r1, r3, #4
- 8003042: 687b ldr r3, [r7, #4]
- 8003044: 6a5b ldr r3, [r3, #36] ; 0x24
- 8003046: f003 0210 and.w r2, r3, #16
- 800304a: 687b ldr r3, [r7, #4]
- 800304c: 681b ldr r3, [r3, #0]
- 800304e: 430a orrs r2, r1
- 8003050: 605a str r2, [r3, #4]
- }
- #endif /* USE_SPI_CRC */
-
- #if defined(SPI_I2SCFGR_I2SMOD)
- /* Activate the SPI mode (Make sure that I2SMOD bit in I2SCFGR register is reset) */
- CLEAR_BIT(hspi->Instance->I2SCFGR, SPI_I2SCFGR_I2SMOD);
- 8003052: 687b ldr r3, [r7, #4]
- 8003054: 681b ldr r3, [r3, #0]
- 8003056: 69da ldr r2, [r3, #28]
- 8003058: 687b ldr r3, [r7, #4]
- 800305a: 681b ldr r3, [r3, #0]
- 800305c: f422 6200 bic.w r2, r2, #2048 ; 0x800
- 8003060: 61da str r2, [r3, #28]
- #endif /* SPI_I2SCFGR_I2SMOD */
-
- hspi->ErrorCode = HAL_SPI_ERROR_NONE;
- 8003062: 687b ldr r3, [r7, #4]
- 8003064: 2200 movs r2, #0
- 8003066: 655a str r2, [r3, #84] ; 0x54
- hspi->State = HAL_SPI_STATE_READY;
- 8003068: 687b ldr r3, [r7, #4]
- 800306a: 2201 movs r2, #1
- 800306c: f883 2051 strb.w r2, [r3, #81] ; 0x51
-
- return HAL_OK;
- 8003070: 2300 movs r3, #0
- }
- 8003072: 4618 mov r0, r3
- 8003074: 3708 adds r7, #8
- 8003076: 46bd mov sp, r7
- 8003078: bd80 pop {r7, pc}
-
- 0800307a <HAL_SPI_Transmit>:
- * @param Size amount of data to be sent
- * @param Timeout Timeout duration
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)
- {
- 800307a: b580 push {r7, lr}
- 800307c: b088 sub sp, #32
- 800307e: af00 add r7, sp, #0
- 8003080: 60f8 str r0, [r7, #12]
- 8003082: 60b9 str r1, [r7, #8]
- 8003084: 603b str r3, [r7, #0]
- 8003086: 4613 mov r3, r2
- 8003088: 80fb strh r3, [r7, #6]
- uint32_t tickstart;
- HAL_StatusTypeDef errorcode = HAL_OK;
- 800308a: 2300 movs r3, #0
- 800308c: 77fb strb r3, [r7, #31]
-
- /* Check Direction parameter */
- assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction));
-
- /* Process Locked */
- __HAL_LOCK(hspi);
- 800308e: 68fb ldr r3, [r7, #12]
- 8003090: f893 3050 ldrb.w r3, [r3, #80] ; 0x50
- 8003094: 2b01 cmp r3, #1
- 8003096: d101 bne.n 800309c <HAL_SPI_Transmit+0x22>
- 8003098: 2302 movs r3, #2
- 800309a: e126 b.n 80032ea <HAL_SPI_Transmit+0x270>
- 800309c: 68fb ldr r3, [r7, #12]
- 800309e: 2201 movs r2, #1
- 80030a0: f883 2050 strb.w r2, [r3, #80] ; 0x50
-
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- 80030a4: f7fe fede bl 8001e64 <HAL_GetTick>
- 80030a8: 61b8 str r0, [r7, #24]
- initial_TxXferCount = Size;
- 80030aa: 88fb ldrh r3, [r7, #6]
- 80030ac: 82fb strh r3, [r7, #22]
-
- if (hspi->State != HAL_SPI_STATE_READY)
- 80030ae: 68fb ldr r3, [r7, #12]
- 80030b0: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
- 80030b4: b2db uxtb r3, r3
- 80030b6: 2b01 cmp r3, #1
- 80030b8: d002 beq.n 80030c0 <HAL_SPI_Transmit+0x46>
- {
- errorcode = HAL_BUSY;
- 80030ba: 2302 movs r3, #2
- 80030bc: 77fb strb r3, [r7, #31]
- goto error;
- 80030be: e10b b.n 80032d8 <HAL_SPI_Transmit+0x25e>
- }
-
- if ((pData == NULL) || (Size == 0U))
- 80030c0: 68bb ldr r3, [r7, #8]
- 80030c2: 2b00 cmp r3, #0
- 80030c4: d002 beq.n 80030cc <HAL_SPI_Transmit+0x52>
- 80030c6: 88fb ldrh r3, [r7, #6]
- 80030c8: 2b00 cmp r3, #0
- 80030ca: d102 bne.n 80030d2 <HAL_SPI_Transmit+0x58>
- {
- errorcode = HAL_ERROR;
- 80030cc: 2301 movs r3, #1
- 80030ce: 77fb strb r3, [r7, #31]
- goto error;
- 80030d0: e102 b.n 80032d8 <HAL_SPI_Transmit+0x25e>
- }
-
- /* Set the transaction information */
- hspi->State = HAL_SPI_STATE_BUSY_TX;
- 80030d2: 68fb ldr r3, [r7, #12]
- 80030d4: 2203 movs r2, #3
- 80030d6: f883 2051 strb.w r2, [r3, #81] ; 0x51
- hspi->ErrorCode = HAL_SPI_ERROR_NONE;
- 80030da: 68fb ldr r3, [r7, #12]
- 80030dc: 2200 movs r2, #0
- 80030de: 655a str r2, [r3, #84] ; 0x54
- hspi->pTxBuffPtr = (uint8_t *)pData;
- 80030e0: 68fb ldr r3, [r7, #12]
- 80030e2: 68ba ldr r2, [r7, #8]
- 80030e4: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferSize = Size;
- 80030e6: 68fb ldr r3, [r7, #12]
- 80030e8: 88fa ldrh r2, [r7, #6]
- 80030ea: 869a strh r2, [r3, #52] ; 0x34
- hspi->TxXferCount = Size;
- 80030ec: 68fb ldr r3, [r7, #12]
- 80030ee: 88fa ldrh r2, [r7, #6]
- 80030f0: 86da strh r2, [r3, #54] ; 0x36
-
- /*Init field not used in handle to zero */
- hspi->pRxBuffPtr = (uint8_t *)NULL;
- 80030f2: 68fb ldr r3, [r7, #12]
- 80030f4: 2200 movs r2, #0
- 80030f6: 639a str r2, [r3, #56] ; 0x38
- hspi->RxXferSize = 0U;
- 80030f8: 68fb ldr r3, [r7, #12]
- 80030fa: 2200 movs r2, #0
- 80030fc: 879a strh r2, [r3, #60] ; 0x3c
- hspi->RxXferCount = 0U;
- 80030fe: 68fb ldr r3, [r7, #12]
- 8003100: 2200 movs r2, #0
- 8003102: 87da strh r2, [r3, #62] ; 0x3e
- hspi->TxISR = NULL;
- 8003104: 68fb ldr r3, [r7, #12]
- 8003106: 2200 movs r2, #0
- 8003108: 645a str r2, [r3, #68] ; 0x44
- hspi->RxISR = NULL;
- 800310a: 68fb ldr r3, [r7, #12]
- 800310c: 2200 movs r2, #0
- 800310e: 641a str r2, [r3, #64] ; 0x40
-
- /* Configure communication direction : 1Line */
- if (hspi->Init.Direction == SPI_DIRECTION_1LINE)
- 8003110: 68fb ldr r3, [r7, #12]
- 8003112: 689b ldr r3, [r3, #8]
- 8003114: f5b3 4f00 cmp.w r3, #32768 ; 0x8000
- 8003118: d10f bne.n 800313a <HAL_SPI_Transmit+0xc0>
- {
- /* Disable SPI Peripheral before set 1Line direction (BIDIOE bit) */
- __HAL_SPI_DISABLE(hspi);
- 800311a: 68fb ldr r3, [r7, #12]
- 800311c: 681b ldr r3, [r3, #0]
- 800311e: 681a ldr r2, [r3, #0]
- 8003120: 68fb ldr r3, [r7, #12]
- 8003122: 681b ldr r3, [r3, #0]
- 8003124: f022 0240 bic.w r2, r2, #64 ; 0x40
- 8003128: 601a str r2, [r3, #0]
- SPI_1LINE_TX(hspi);
- 800312a: 68fb ldr r3, [r7, #12]
- 800312c: 681b ldr r3, [r3, #0]
- 800312e: 681a ldr r2, [r3, #0]
- 8003130: 68fb ldr r3, [r7, #12]
- 8003132: 681b ldr r3, [r3, #0]
- 8003134: f442 4280 orr.w r2, r2, #16384 ; 0x4000
- 8003138: 601a str r2, [r3, #0]
- SPI_RESET_CRC(hspi);
- }
- #endif /* USE_SPI_CRC */
-
- /* Check if the SPI is already enabled */
- if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
- 800313a: 68fb ldr r3, [r7, #12]
- 800313c: 681b ldr r3, [r3, #0]
- 800313e: 681b ldr r3, [r3, #0]
- 8003140: f003 0340 and.w r3, r3, #64 ; 0x40
- 8003144: 2b40 cmp r3, #64 ; 0x40
- 8003146: d007 beq.n 8003158 <HAL_SPI_Transmit+0xde>
- {
- /* Enable SPI peripheral */
- __HAL_SPI_ENABLE(hspi);
- 8003148: 68fb ldr r3, [r7, #12]
- 800314a: 681b ldr r3, [r3, #0]
- 800314c: 681a ldr r2, [r3, #0]
- 800314e: 68fb ldr r3, [r7, #12]
- 8003150: 681b ldr r3, [r3, #0]
- 8003152: f042 0240 orr.w r2, r2, #64 ; 0x40
- 8003156: 601a str r2, [r3, #0]
- }
-
- /* Transmit data in 16 Bit mode */
- if (hspi->Init.DataSize == SPI_DATASIZE_16BIT)
- 8003158: 68fb ldr r3, [r7, #12]
- 800315a: 68db ldr r3, [r3, #12]
- 800315c: f5b3 6f00 cmp.w r3, #2048 ; 0x800
- 8003160: d14b bne.n 80031fa <HAL_SPI_Transmit+0x180>
- {
- if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
- 8003162: 68fb ldr r3, [r7, #12]
- 8003164: 685b ldr r3, [r3, #4]
- 8003166: 2b00 cmp r3, #0
- 8003168: d002 beq.n 8003170 <HAL_SPI_Transmit+0xf6>
- 800316a: 8afb ldrh r3, [r7, #22]
- 800316c: 2b01 cmp r3, #1
- 800316e: d13e bne.n 80031ee <HAL_SPI_Transmit+0x174>
- {
- hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
- 8003170: 68fb ldr r3, [r7, #12]
- 8003172: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003174: 881a ldrh r2, [r3, #0]
- 8003176: 68fb ldr r3, [r7, #12]
- 8003178: 681b ldr r3, [r3, #0]
- 800317a: 60da str r2, [r3, #12]
- hspi->pTxBuffPtr += sizeof(uint16_t);
- 800317c: 68fb ldr r3, [r7, #12]
- 800317e: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003180: 1c9a adds r2, r3, #2
- 8003182: 68fb ldr r3, [r7, #12]
- 8003184: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 8003186: 68fb ldr r3, [r7, #12]
- 8003188: 8edb ldrh r3, [r3, #54] ; 0x36
- 800318a: b29b uxth r3, r3
- 800318c: 3b01 subs r3, #1
- 800318e: b29a uxth r2, r3
- 8003190: 68fb ldr r3, [r7, #12]
- 8003192: 86da strh r2, [r3, #54] ; 0x36
- }
- /* Transmit data in 16 Bit mode */
- while (hspi->TxXferCount > 0U)
- 8003194: e02b b.n 80031ee <HAL_SPI_Transmit+0x174>
- {
- /* Wait until TXE flag is set to send data */
- if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE))
- 8003196: 68fb ldr r3, [r7, #12]
- 8003198: 681b ldr r3, [r3, #0]
- 800319a: 689b ldr r3, [r3, #8]
- 800319c: f003 0302 and.w r3, r3, #2
- 80031a0: 2b02 cmp r3, #2
- 80031a2: d112 bne.n 80031ca <HAL_SPI_Transmit+0x150>
- {
- hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
- 80031a4: 68fb ldr r3, [r7, #12]
- 80031a6: 6b1b ldr r3, [r3, #48] ; 0x30
- 80031a8: 881a ldrh r2, [r3, #0]
- 80031aa: 68fb ldr r3, [r7, #12]
- 80031ac: 681b ldr r3, [r3, #0]
- 80031ae: 60da str r2, [r3, #12]
- hspi->pTxBuffPtr += sizeof(uint16_t);
- 80031b0: 68fb ldr r3, [r7, #12]
- 80031b2: 6b1b ldr r3, [r3, #48] ; 0x30
- 80031b4: 1c9a adds r2, r3, #2
- 80031b6: 68fb ldr r3, [r7, #12]
- 80031b8: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 80031ba: 68fb ldr r3, [r7, #12]
- 80031bc: 8edb ldrh r3, [r3, #54] ; 0x36
- 80031be: b29b uxth r3, r3
- 80031c0: 3b01 subs r3, #1
- 80031c2: b29a uxth r2, r3
- 80031c4: 68fb ldr r3, [r7, #12]
- 80031c6: 86da strh r2, [r3, #54] ; 0x36
- 80031c8: e011 b.n 80031ee <HAL_SPI_Transmit+0x174>
- }
- else
- {
- /* Timeout management */
- if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U))
- 80031ca: f7fe fe4b bl 8001e64 <HAL_GetTick>
- 80031ce: 4602 mov r2, r0
- 80031d0: 69bb ldr r3, [r7, #24]
- 80031d2: 1ad3 subs r3, r2, r3
- 80031d4: 683a ldr r2, [r7, #0]
- 80031d6: 429a cmp r2, r3
- 80031d8: d803 bhi.n 80031e2 <HAL_SPI_Transmit+0x168>
- 80031da: 683b ldr r3, [r7, #0]
- 80031dc: f1b3 3fff cmp.w r3, #4294967295
- 80031e0: d102 bne.n 80031e8 <HAL_SPI_Transmit+0x16e>
- 80031e2: 683b ldr r3, [r7, #0]
- 80031e4: 2b00 cmp r3, #0
- 80031e6: d102 bne.n 80031ee <HAL_SPI_Transmit+0x174>
- {
- errorcode = HAL_TIMEOUT;
- 80031e8: 2303 movs r3, #3
- 80031ea: 77fb strb r3, [r7, #31]
- goto error;
- 80031ec: e074 b.n 80032d8 <HAL_SPI_Transmit+0x25e>
- while (hspi->TxXferCount > 0U)
- 80031ee: 68fb ldr r3, [r7, #12]
- 80031f0: 8edb ldrh r3, [r3, #54] ; 0x36
- 80031f2: b29b uxth r3, r3
- 80031f4: 2b00 cmp r3, #0
- 80031f6: d1ce bne.n 8003196 <HAL_SPI_Transmit+0x11c>
- 80031f8: e04c b.n 8003294 <HAL_SPI_Transmit+0x21a>
- }
- }
- /* Transmit data in 8 Bit mode */
- else
- {
- if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
- 80031fa: 68fb ldr r3, [r7, #12]
- 80031fc: 685b ldr r3, [r3, #4]
- 80031fe: 2b00 cmp r3, #0
- 8003200: d002 beq.n 8003208 <HAL_SPI_Transmit+0x18e>
- 8003202: 8afb ldrh r3, [r7, #22]
- 8003204: 2b01 cmp r3, #1
- 8003206: d140 bne.n 800328a <HAL_SPI_Transmit+0x210>
- {
- *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr);
- 8003208: 68fb ldr r3, [r7, #12]
- 800320a: 6b1a ldr r2, [r3, #48] ; 0x30
- 800320c: 68fb ldr r3, [r7, #12]
- 800320e: 681b ldr r3, [r3, #0]
- 8003210: 330c adds r3, #12
- 8003212: 7812 ldrb r2, [r2, #0]
- 8003214: 701a strb r2, [r3, #0]
- hspi->pTxBuffPtr += sizeof(uint8_t);
- 8003216: 68fb ldr r3, [r7, #12]
- 8003218: 6b1b ldr r3, [r3, #48] ; 0x30
- 800321a: 1c5a adds r2, r3, #1
- 800321c: 68fb ldr r3, [r7, #12]
- 800321e: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 8003220: 68fb ldr r3, [r7, #12]
- 8003222: 8edb ldrh r3, [r3, #54] ; 0x36
- 8003224: b29b uxth r3, r3
- 8003226: 3b01 subs r3, #1
- 8003228: b29a uxth r2, r3
- 800322a: 68fb ldr r3, [r7, #12]
- 800322c: 86da strh r2, [r3, #54] ; 0x36
- }
- while (hspi->TxXferCount > 0U)
- 800322e: e02c b.n 800328a <HAL_SPI_Transmit+0x210>
- {
- /* Wait until TXE flag is set to send data */
- if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE))
- 8003230: 68fb ldr r3, [r7, #12]
- 8003232: 681b ldr r3, [r3, #0]
- 8003234: 689b ldr r3, [r3, #8]
- 8003236: f003 0302 and.w r3, r3, #2
- 800323a: 2b02 cmp r3, #2
- 800323c: d113 bne.n 8003266 <HAL_SPI_Transmit+0x1ec>
- {
- *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr);
- 800323e: 68fb ldr r3, [r7, #12]
- 8003240: 6b1a ldr r2, [r3, #48] ; 0x30
- 8003242: 68fb ldr r3, [r7, #12]
- 8003244: 681b ldr r3, [r3, #0]
- 8003246: 330c adds r3, #12
- 8003248: 7812 ldrb r2, [r2, #0]
- 800324a: 701a strb r2, [r3, #0]
- hspi->pTxBuffPtr += sizeof(uint8_t);
- 800324c: 68fb ldr r3, [r7, #12]
- 800324e: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003250: 1c5a adds r2, r3, #1
- 8003252: 68fb ldr r3, [r7, #12]
- 8003254: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 8003256: 68fb ldr r3, [r7, #12]
- 8003258: 8edb ldrh r3, [r3, #54] ; 0x36
- 800325a: b29b uxth r3, r3
- 800325c: 3b01 subs r3, #1
- 800325e: b29a uxth r2, r3
- 8003260: 68fb ldr r3, [r7, #12]
- 8003262: 86da strh r2, [r3, #54] ; 0x36
- 8003264: e011 b.n 800328a <HAL_SPI_Transmit+0x210>
- }
- else
- {
- /* Timeout management */
- if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U))
- 8003266: f7fe fdfd bl 8001e64 <HAL_GetTick>
- 800326a: 4602 mov r2, r0
- 800326c: 69bb ldr r3, [r7, #24]
- 800326e: 1ad3 subs r3, r2, r3
- 8003270: 683a ldr r2, [r7, #0]
- 8003272: 429a cmp r2, r3
- 8003274: d803 bhi.n 800327e <HAL_SPI_Transmit+0x204>
- 8003276: 683b ldr r3, [r7, #0]
- 8003278: f1b3 3fff cmp.w r3, #4294967295
- 800327c: d102 bne.n 8003284 <HAL_SPI_Transmit+0x20a>
- 800327e: 683b ldr r3, [r7, #0]
- 8003280: 2b00 cmp r3, #0
- 8003282: d102 bne.n 800328a <HAL_SPI_Transmit+0x210>
- {
- errorcode = HAL_TIMEOUT;
- 8003284: 2303 movs r3, #3
- 8003286: 77fb strb r3, [r7, #31]
- goto error;
- 8003288: e026 b.n 80032d8 <HAL_SPI_Transmit+0x25e>
- while (hspi->TxXferCount > 0U)
- 800328a: 68fb ldr r3, [r7, #12]
- 800328c: 8edb ldrh r3, [r3, #54] ; 0x36
- 800328e: b29b uxth r3, r3
- 8003290: 2b00 cmp r3, #0
- 8003292: d1cd bne.n 8003230 <HAL_SPI_Transmit+0x1b6>
- SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
- }
- #endif /* USE_SPI_CRC */
-
- /* Check the end of the transaction */
- if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK)
- 8003294: 69ba ldr r2, [r7, #24]
- 8003296: 6839 ldr r1, [r7, #0]
- 8003298: 68f8 ldr r0, [r7, #12]
- 800329a: f000 fa55 bl 8003748 <SPI_EndRxTxTransaction>
- 800329e: 4603 mov r3, r0
- 80032a0: 2b00 cmp r3, #0
- 80032a2: d002 beq.n 80032aa <HAL_SPI_Transmit+0x230>
- {
- hspi->ErrorCode = HAL_SPI_ERROR_FLAG;
- 80032a4: 68fb ldr r3, [r7, #12]
- 80032a6: 2220 movs r2, #32
- 80032a8: 655a str r2, [r3, #84] ; 0x54
- }
-
- /* Clear overrun flag in 2 Lines communication mode because received is not read */
- if (hspi->Init.Direction == SPI_DIRECTION_2LINES)
- 80032aa: 68fb ldr r3, [r7, #12]
- 80032ac: 689b ldr r3, [r3, #8]
- 80032ae: 2b00 cmp r3, #0
- 80032b0: d10a bne.n 80032c8 <HAL_SPI_Transmit+0x24e>
- {
- __HAL_SPI_CLEAR_OVRFLAG(hspi);
- 80032b2: 2300 movs r3, #0
- 80032b4: 613b str r3, [r7, #16]
- 80032b6: 68fb ldr r3, [r7, #12]
- 80032b8: 681b ldr r3, [r3, #0]
- 80032ba: 68db ldr r3, [r3, #12]
- 80032bc: 613b str r3, [r7, #16]
- 80032be: 68fb ldr r3, [r7, #12]
- 80032c0: 681b ldr r3, [r3, #0]
- 80032c2: 689b ldr r3, [r3, #8]
- 80032c4: 613b str r3, [r7, #16]
- 80032c6: 693b ldr r3, [r7, #16]
- }
-
- if (hspi->ErrorCode != HAL_SPI_ERROR_NONE)
- 80032c8: 68fb ldr r3, [r7, #12]
- 80032ca: 6d5b ldr r3, [r3, #84] ; 0x54
- 80032cc: 2b00 cmp r3, #0
- 80032ce: d002 beq.n 80032d6 <HAL_SPI_Transmit+0x25c>
- {
- errorcode = HAL_ERROR;
- 80032d0: 2301 movs r3, #1
- 80032d2: 77fb strb r3, [r7, #31]
- 80032d4: e000 b.n 80032d8 <HAL_SPI_Transmit+0x25e>
- }
-
- error:
- 80032d6: bf00 nop
- hspi->State = HAL_SPI_STATE_READY;
- 80032d8: 68fb ldr r3, [r7, #12]
- 80032da: 2201 movs r2, #1
- 80032dc: f883 2051 strb.w r2, [r3, #81] ; 0x51
- /* Process Unlocked */
- __HAL_UNLOCK(hspi);
- 80032e0: 68fb ldr r3, [r7, #12]
- 80032e2: 2200 movs r2, #0
- 80032e4: f883 2050 strb.w r2, [r3, #80] ; 0x50
- return errorcode;
- 80032e8: 7ffb ldrb r3, [r7, #31]
- }
- 80032ea: 4618 mov r0, r3
- 80032ec: 3720 adds r7, #32
- 80032ee: 46bd mov sp, r7
- 80032f0: bd80 pop {r7, pc}
-
- 080032f2 <HAL_SPI_TransmitReceive>:
- * @param Timeout Timeout duration
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size,
- uint32_t Timeout)
- {
- 80032f2: b580 push {r7, lr}
- 80032f4: b08c sub sp, #48 ; 0x30
- 80032f6: af00 add r7, sp, #0
- 80032f8: 60f8 str r0, [r7, #12]
- 80032fa: 60b9 str r1, [r7, #8]
- 80032fc: 607a str r2, [r7, #4]
- 80032fe: 807b strh r3, [r7, #2]
- uint32_t tmp_mode;
- HAL_SPI_StateTypeDef tmp_state;
- uint32_t tickstart;
-
- /* Variable used to alternate Rx and Tx during transfer */
- uint32_t txallowed = 1U;
- 8003300: 2301 movs r3, #1
- 8003302: 62fb str r3, [r7, #44] ; 0x2c
- HAL_StatusTypeDef errorcode = HAL_OK;
- 8003304: 2300 movs r3, #0
- 8003306: f887 302b strb.w r3, [r7, #43] ; 0x2b
-
- /* Check Direction parameter */
- assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction));
-
- /* Process Locked */
- __HAL_LOCK(hspi);
- 800330a: 68fb ldr r3, [r7, #12]
- 800330c: f893 3050 ldrb.w r3, [r3, #80] ; 0x50
- 8003310: 2b01 cmp r3, #1
- 8003312: d101 bne.n 8003318 <HAL_SPI_TransmitReceive+0x26>
- 8003314: 2302 movs r3, #2
- 8003316: e18a b.n 800362e <HAL_SPI_TransmitReceive+0x33c>
- 8003318: 68fb ldr r3, [r7, #12]
- 800331a: 2201 movs r2, #1
- 800331c: f883 2050 strb.w r2, [r3, #80] ; 0x50
-
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- 8003320: f7fe fda0 bl 8001e64 <HAL_GetTick>
- 8003324: 6278 str r0, [r7, #36] ; 0x24
-
- /* Init temporary variables */
- tmp_state = hspi->State;
- 8003326: 68fb ldr r3, [r7, #12]
- 8003328: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
- 800332c: f887 3023 strb.w r3, [r7, #35] ; 0x23
- tmp_mode = hspi->Init.Mode;
- 8003330: 68fb ldr r3, [r7, #12]
- 8003332: 685b ldr r3, [r3, #4]
- 8003334: 61fb str r3, [r7, #28]
- initial_TxXferCount = Size;
- 8003336: 887b ldrh r3, [r7, #2]
- 8003338: 837b strh r3, [r7, #26]
-
- if (!((tmp_state == HAL_SPI_STATE_READY) || \
- 800333a: f897 3023 ldrb.w r3, [r7, #35] ; 0x23
- 800333e: 2b01 cmp r3, #1
- 8003340: d00f beq.n 8003362 <HAL_SPI_TransmitReceive+0x70>
- 8003342: 69fb ldr r3, [r7, #28]
- 8003344: f5b3 7f82 cmp.w r3, #260 ; 0x104
- 8003348: d107 bne.n 800335a <HAL_SPI_TransmitReceive+0x68>
- ((tmp_mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES) && (tmp_state == HAL_SPI_STATE_BUSY_RX))))
- 800334a: 68fb ldr r3, [r7, #12]
- 800334c: 689b ldr r3, [r3, #8]
- 800334e: 2b00 cmp r3, #0
- 8003350: d103 bne.n 800335a <HAL_SPI_TransmitReceive+0x68>
- 8003352: f897 3023 ldrb.w r3, [r7, #35] ; 0x23
- 8003356: 2b04 cmp r3, #4
- 8003358: d003 beq.n 8003362 <HAL_SPI_TransmitReceive+0x70>
- {
- errorcode = HAL_BUSY;
- 800335a: 2302 movs r3, #2
- 800335c: f887 302b strb.w r3, [r7, #43] ; 0x2b
- goto error;
- 8003360: e15b b.n 800361a <HAL_SPI_TransmitReceive+0x328>
- }
-
- if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
- 8003362: 68bb ldr r3, [r7, #8]
- 8003364: 2b00 cmp r3, #0
- 8003366: d005 beq.n 8003374 <HAL_SPI_TransmitReceive+0x82>
- 8003368: 687b ldr r3, [r7, #4]
- 800336a: 2b00 cmp r3, #0
- 800336c: d002 beq.n 8003374 <HAL_SPI_TransmitReceive+0x82>
- 800336e: 887b ldrh r3, [r7, #2]
- 8003370: 2b00 cmp r3, #0
- 8003372: d103 bne.n 800337c <HAL_SPI_TransmitReceive+0x8a>
- {
- errorcode = HAL_ERROR;
- 8003374: 2301 movs r3, #1
- 8003376: f887 302b strb.w r3, [r7, #43] ; 0x2b
- goto error;
- 800337a: e14e b.n 800361a <HAL_SPI_TransmitReceive+0x328>
- }
-
- /* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */
- if (hspi->State != HAL_SPI_STATE_BUSY_RX)
- 800337c: 68fb ldr r3, [r7, #12]
- 800337e: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
- 8003382: b2db uxtb r3, r3
- 8003384: 2b04 cmp r3, #4
- 8003386: d003 beq.n 8003390 <HAL_SPI_TransmitReceive+0x9e>
- {
- hspi->State = HAL_SPI_STATE_BUSY_TX_RX;
- 8003388: 68fb ldr r3, [r7, #12]
- 800338a: 2205 movs r2, #5
- 800338c: f883 2051 strb.w r2, [r3, #81] ; 0x51
- }
-
- /* Set the transaction information */
- hspi->ErrorCode = HAL_SPI_ERROR_NONE;
- 8003390: 68fb ldr r3, [r7, #12]
- 8003392: 2200 movs r2, #0
- 8003394: 655a str r2, [r3, #84] ; 0x54
- hspi->pRxBuffPtr = (uint8_t *)pRxData;
- 8003396: 68fb ldr r3, [r7, #12]
- 8003398: 687a ldr r2, [r7, #4]
- 800339a: 639a str r2, [r3, #56] ; 0x38
- hspi->RxXferCount = Size;
- 800339c: 68fb ldr r3, [r7, #12]
- 800339e: 887a ldrh r2, [r7, #2]
- 80033a0: 87da strh r2, [r3, #62] ; 0x3e
- hspi->RxXferSize = Size;
- 80033a2: 68fb ldr r3, [r7, #12]
- 80033a4: 887a ldrh r2, [r7, #2]
- 80033a6: 879a strh r2, [r3, #60] ; 0x3c
- hspi->pTxBuffPtr = (uint8_t *)pTxData;
- 80033a8: 68fb ldr r3, [r7, #12]
- 80033aa: 68ba ldr r2, [r7, #8]
- 80033ac: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount = Size;
- 80033ae: 68fb ldr r3, [r7, #12]
- 80033b0: 887a ldrh r2, [r7, #2]
- 80033b2: 86da strh r2, [r3, #54] ; 0x36
- hspi->TxXferSize = Size;
- 80033b4: 68fb ldr r3, [r7, #12]
- 80033b6: 887a ldrh r2, [r7, #2]
- 80033b8: 869a strh r2, [r3, #52] ; 0x34
-
- /*Init field not used in handle to zero */
- hspi->RxISR = NULL;
- 80033ba: 68fb ldr r3, [r7, #12]
- 80033bc: 2200 movs r2, #0
- 80033be: 641a str r2, [r3, #64] ; 0x40
- hspi->TxISR = NULL;
- 80033c0: 68fb ldr r3, [r7, #12]
- 80033c2: 2200 movs r2, #0
- 80033c4: 645a str r2, [r3, #68] ; 0x44
- SPI_RESET_CRC(hspi);
- }
- #endif /* USE_SPI_CRC */
-
- /* Check if the SPI is already enabled */
- if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
- 80033c6: 68fb ldr r3, [r7, #12]
- 80033c8: 681b ldr r3, [r3, #0]
- 80033ca: 681b ldr r3, [r3, #0]
- 80033cc: f003 0340 and.w r3, r3, #64 ; 0x40
- 80033d0: 2b40 cmp r3, #64 ; 0x40
- 80033d2: d007 beq.n 80033e4 <HAL_SPI_TransmitReceive+0xf2>
- {
- /* Enable SPI peripheral */
- __HAL_SPI_ENABLE(hspi);
- 80033d4: 68fb ldr r3, [r7, #12]
- 80033d6: 681b ldr r3, [r3, #0]
- 80033d8: 681a ldr r2, [r3, #0]
- 80033da: 68fb ldr r3, [r7, #12]
- 80033dc: 681b ldr r3, [r3, #0]
- 80033de: f042 0240 orr.w r2, r2, #64 ; 0x40
- 80033e2: 601a str r2, [r3, #0]
- }
-
- /* Transmit and Receive data in 16 Bit mode */
- if (hspi->Init.DataSize == SPI_DATASIZE_16BIT)
- 80033e4: 68fb ldr r3, [r7, #12]
- 80033e6: 68db ldr r3, [r3, #12]
- 80033e8: f5b3 6f00 cmp.w r3, #2048 ; 0x800
- 80033ec: d178 bne.n 80034e0 <HAL_SPI_TransmitReceive+0x1ee>
- {
- if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
- 80033ee: 68fb ldr r3, [r7, #12]
- 80033f0: 685b ldr r3, [r3, #4]
- 80033f2: 2b00 cmp r3, #0
- 80033f4: d002 beq.n 80033fc <HAL_SPI_TransmitReceive+0x10a>
- 80033f6: 8b7b ldrh r3, [r7, #26]
- 80033f8: 2b01 cmp r3, #1
- 80033fa: d166 bne.n 80034ca <HAL_SPI_TransmitReceive+0x1d8>
- {
- hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
- 80033fc: 68fb ldr r3, [r7, #12]
- 80033fe: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003400: 881a ldrh r2, [r3, #0]
- 8003402: 68fb ldr r3, [r7, #12]
- 8003404: 681b ldr r3, [r3, #0]
- 8003406: 60da str r2, [r3, #12]
- hspi->pTxBuffPtr += sizeof(uint16_t);
- 8003408: 68fb ldr r3, [r7, #12]
- 800340a: 6b1b ldr r3, [r3, #48] ; 0x30
- 800340c: 1c9a adds r2, r3, #2
- 800340e: 68fb ldr r3, [r7, #12]
- 8003410: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 8003412: 68fb ldr r3, [r7, #12]
- 8003414: 8edb ldrh r3, [r3, #54] ; 0x36
- 8003416: b29b uxth r3, r3
- 8003418: 3b01 subs r3, #1
- 800341a: b29a uxth r2, r3
- 800341c: 68fb ldr r3, [r7, #12]
- 800341e: 86da strh r2, [r3, #54] ; 0x36
- }
- while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
- 8003420: e053 b.n 80034ca <HAL_SPI_TransmitReceive+0x1d8>
- {
- /* Check TXE flag */
- if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) && (hspi->TxXferCount > 0U) && (txallowed == 1U))
- 8003422: 68fb ldr r3, [r7, #12]
- 8003424: 681b ldr r3, [r3, #0]
- 8003426: 689b ldr r3, [r3, #8]
- 8003428: f003 0302 and.w r3, r3, #2
- 800342c: 2b02 cmp r3, #2
- 800342e: d11b bne.n 8003468 <HAL_SPI_TransmitReceive+0x176>
- 8003430: 68fb ldr r3, [r7, #12]
- 8003432: 8edb ldrh r3, [r3, #54] ; 0x36
- 8003434: b29b uxth r3, r3
- 8003436: 2b00 cmp r3, #0
- 8003438: d016 beq.n 8003468 <HAL_SPI_TransmitReceive+0x176>
- 800343a: 6afb ldr r3, [r7, #44] ; 0x2c
- 800343c: 2b01 cmp r3, #1
- 800343e: d113 bne.n 8003468 <HAL_SPI_TransmitReceive+0x176>
- {
- hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
- 8003440: 68fb ldr r3, [r7, #12]
- 8003442: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003444: 881a ldrh r2, [r3, #0]
- 8003446: 68fb ldr r3, [r7, #12]
- 8003448: 681b ldr r3, [r3, #0]
- 800344a: 60da str r2, [r3, #12]
- hspi->pTxBuffPtr += sizeof(uint16_t);
- 800344c: 68fb ldr r3, [r7, #12]
- 800344e: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003450: 1c9a adds r2, r3, #2
- 8003452: 68fb ldr r3, [r7, #12]
- 8003454: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 8003456: 68fb ldr r3, [r7, #12]
- 8003458: 8edb ldrh r3, [r3, #54] ; 0x36
- 800345a: b29b uxth r3, r3
- 800345c: 3b01 subs r3, #1
- 800345e: b29a uxth r2, r3
- 8003460: 68fb ldr r3, [r7, #12]
- 8003462: 86da strh r2, [r3, #54] ; 0x36
- /* Next Data is a reception (Rx). Tx not allowed */
- txallowed = 0U;
- 8003464: 2300 movs r3, #0
- 8003466: 62fb str r3, [r7, #44] ; 0x2c
- }
- #endif /* USE_SPI_CRC */
- }
-
- /* Check RXNE flag */
- if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_RXNE)) && (hspi->RxXferCount > 0U))
- 8003468: 68fb ldr r3, [r7, #12]
- 800346a: 681b ldr r3, [r3, #0]
- 800346c: 689b ldr r3, [r3, #8]
- 800346e: f003 0301 and.w r3, r3, #1
- 8003472: 2b01 cmp r3, #1
- 8003474: d119 bne.n 80034aa <HAL_SPI_TransmitReceive+0x1b8>
- 8003476: 68fb ldr r3, [r7, #12]
- 8003478: 8fdb ldrh r3, [r3, #62] ; 0x3e
- 800347a: b29b uxth r3, r3
- 800347c: 2b00 cmp r3, #0
- 800347e: d014 beq.n 80034aa <HAL_SPI_TransmitReceive+0x1b8>
- {
- *((uint16_t *)hspi->pRxBuffPtr) = (uint16_t)hspi->Instance->DR;
- 8003480: 68fb ldr r3, [r7, #12]
- 8003482: 681b ldr r3, [r3, #0]
- 8003484: 68da ldr r2, [r3, #12]
- 8003486: 68fb ldr r3, [r7, #12]
- 8003488: 6b9b ldr r3, [r3, #56] ; 0x38
- 800348a: b292 uxth r2, r2
- 800348c: 801a strh r2, [r3, #0]
- hspi->pRxBuffPtr += sizeof(uint16_t);
- 800348e: 68fb ldr r3, [r7, #12]
- 8003490: 6b9b ldr r3, [r3, #56] ; 0x38
- 8003492: 1c9a adds r2, r3, #2
- 8003494: 68fb ldr r3, [r7, #12]
- 8003496: 639a str r2, [r3, #56] ; 0x38
- hspi->RxXferCount--;
- 8003498: 68fb ldr r3, [r7, #12]
- 800349a: 8fdb ldrh r3, [r3, #62] ; 0x3e
- 800349c: b29b uxth r3, r3
- 800349e: 3b01 subs r3, #1
- 80034a0: b29a uxth r2, r3
- 80034a2: 68fb ldr r3, [r7, #12]
- 80034a4: 87da strh r2, [r3, #62] ; 0x3e
- /* Next Data is a Transmission (Tx). Tx is allowed */
- txallowed = 1U;
- 80034a6: 2301 movs r3, #1
- 80034a8: 62fb str r3, [r7, #44] ; 0x2c
- }
- if (((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY))
- 80034aa: f7fe fcdb bl 8001e64 <HAL_GetTick>
- 80034ae: 4602 mov r2, r0
- 80034b0: 6a7b ldr r3, [r7, #36] ; 0x24
- 80034b2: 1ad3 subs r3, r2, r3
- 80034b4: 6bba ldr r2, [r7, #56] ; 0x38
- 80034b6: 429a cmp r2, r3
- 80034b8: d807 bhi.n 80034ca <HAL_SPI_TransmitReceive+0x1d8>
- 80034ba: 6bbb ldr r3, [r7, #56] ; 0x38
- 80034bc: f1b3 3fff cmp.w r3, #4294967295
- 80034c0: d003 beq.n 80034ca <HAL_SPI_TransmitReceive+0x1d8>
- {
- errorcode = HAL_TIMEOUT;
- 80034c2: 2303 movs r3, #3
- 80034c4: f887 302b strb.w r3, [r7, #43] ; 0x2b
- goto error;
- 80034c8: e0a7 b.n 800361a <HAL_SPI_TransmitReceive+0x328>
- while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
- 80034ca: 68fb ldr r3, [r7, #12]
- 80034cc: 8edb ldrh r3, [r3, #54] ; 0x36
- 80034ce: b29b uxth r3, r3
- 80034d0: 2b00 cmp r3, #0
- 80034d2: d1a6 bne.n 8003422 <HAL_SPI_TransmitReceive+0x130>
- 80034d4: 68fb ldr r3, [r7, #12]
- 80034d6: 8fdb ldrh r3, [r3, #62] ; 0x3e
- 80034d8: b29b uxth r3, r3
- 80034da: 2b00 cmp r3, #0
- 80034dc: d1a1 bne.n 8003422 <HAL_SPI_TransmitReceive+0x130>
- 80034de: e07c b.n 80035da <HAL_SPI_TransmitReceive+0x2e8>
- }
- }
- /* Transmit and Receive data in 8 Bit mode */
- else
- {
- if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
- 80034e0: 68fb ldr r3, [r7, #12]
- 80034e2: 685b ldr r3, [r3, #4]
- 80034e4: 2b00 cmp r3, #0
- 80034e6: d002 beq.n 80034ee <HAL_SPI_TransmitReceive+0x1fc>
- 80034e8: 8b7b ldrh r3, [r7, #26]
- 80034ea: 2b01 cmp r3, #1
- 80034ec: d16b bne.n 80035c6 <HAL_SPI_TransmitReceive+0x2d4>
- {
- *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr);
- 80034ee: 68fb ldr r3, [r7, #12]
- 80034f0: 6b1a ldr r2, [r3, #48] ; 0x30
- 80034f2: 68fb ldr r3, [r7, #12]
- 80034f4: 681b ldr r3, [r3, #0]
- 80034f6: 330c adds r3, #12
- 80034f8: 7812 ldrb r2, [r2, #0]
- 80034fa: 701a strb r2, [r3, #0]
- hspi->pTxBuffPtr += sizeof(uint8_t);
- 80034fc: 68fb ldr r3, [r7, #12]
- 80034fe: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003500: 1c5a adds r2, r3, #1
- 8003502: 68fb ldr r3, [r7, #12]
- 8003504: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 8003506: 68fb ldr r3, [r7, #12]
- 8003508: 8edb ldrh r3, [r3, #54] ; 0x36
- 800350a: b29b uxth r3, r3
- 800350c: 3b01 subs r3, #1
- 800350e: b29a uxth r2, r3
- 8003510: 68fb ldr r3, [r7, #12]
- 8003512: 86da strh r2, [r3, #54] ; 0x36
- }
- while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
- 8003514: e057 b.n 80035c6 <HAL_SPI_TransmitReceive+0x2d4>
- {
- /* Check TXE flag */
- if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) && (hspi->TxXferCount > 0U) && (txallowed == 1U))
- 8003516: 68fb ldr r3, [r7, #12]
- 8003518: 681b ldr r3, [r3, #0]
- 800351a: 689b ldr r3, [r3, #8]
- 800351c: f003 0302 and.w r3, r3, #2
- 8003520: 2b02 cmp r3, #2
- 8003522: d11c bne.n 800355e <HAL_SPI_TransmitReceive+0x26c>
- 8003524: 68fb ldr r3, [r7, #12]
- 8003526: 8edb ldrh r3, [r3, #54] ; 0x36
- 8003528: b29b uxth r3, r3
- 800352a: 2b00 cmp r3, #0
- 800352c: d017 beq.n 800355e <HAL_SPI_TransmitReceive+0x26c>
- 800352e: 6afb ldr r3, [r7, #44] ; 0x2c
- 8003530: 2b01 cmp r3, #1
- 8003532: d114 bne.n 800355e <HAL_SPI_TransmitReceive+0x26c>
- {
- *(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr);
- 8003534: 68fb ldr r3, [r7, #12]
- 8003536: 6b1a ldr r2, [r3, #48] ; 0x30
- 8003538: 68fb ldr r3, [r7, #12]
- 800353a: 681b ldr r3, [r3, #0]
- 800353c: 330c adds r3, #12
- 800353e: 7812 ldrb r2, [r2, #0]
- 8003540: 701a strb r2, [r3, #0]
- hspi->pTxBuffPtr++;
- 8003542: 68fb ldr r3, [r7, #12]
- 8003544: 6b1b ldr r3, [r3, #48] ; 0x30
- 8003546: 1c5a adds r2, r3, #1
- 8003548: 68fb ldr r3, [r7, #12]
- 800354a: 631a str r2, [r3, #48] ; 0x30
- hspi->TxXferCount--;
- 800354c: 68fb ldr r3, [r7, #12]
- 800354e: 8edb ldrh r3, [r3, #54] ; 0x36
- 8003550: b29b uxth r3, r3
- 8003552: 3b01 subs r3, #1
- 8003554: b29a uxth r2, r3
- 8003556: 68fb ldr r3, [r7, #12]
- 8003558: 86da strh r2, [r3, #54] ; 0x36
- /* Next Data is a reception (Rx). Tx not allowed */
- txallowed = 0U;
- 800355a: 2300 movs r3, #0
- 800355c: 62fb str r3, [r7, #44] ; 0x2c
- }
- #endif /* USE_SPI_CRC */
- }
-
- /* Wait until RXNE flag is reset */
- if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_RXNE)) && (hspi->RxXferCount > 0U))
- 800355e: 68fb ldr r3, [r7, #12]
- 8003560: 681b ldr r3, [r3, #0]
- 8003562: 689b ldr r3, [r3, #8]
- 8003564: f003 0301 and.w r3, r3, #1
- 8003568: 2b01 cmp r3, #1
- 800356a: d119 bne.n 80035a0 <HAL_SPI_TransmitReceive+0x2ae>
- 800356c: 68fb ldr r3, [r7, #12]
- 800356e: 8fdb ldrh r3, [r3, #62] ; 0x3e
- 8003570: b29b uxth r3, r3
- 8003572: 2b00 cmp r3, #0
- 8003574: d014 beq.n 80035a0 <HAL_SPI_TransmitReceive+0x2ae>
- {
- (*(uint8_t *)hspi->pRxBuffPtr) = hspi->Instance->DR;
- 8003576: 68fb ldr r3, [r7, #12]
- 8003578: 681b ldr r3, [r3, #0]
- 800357a: 68da ldr r2, [r3, #12]
- 800357c: 68fb ldr r3, [r7, #12]
- 800357e: 6b9b ldr r3, [r3, #56] ; 0x38
- 8003580: b2d2 uxtb r2, r2
- 8003582: 701a strb r2, [r3, #0]
- hspi->pRxBuffPtr++;
- 8003584: 68fb ldr r3, [r7, #12]
- 8003586: 6b9b ldr r3, [r3, #56] ; 0x38
- 8003588: 1c5a adds r2, r3, #1
- 800358a: 68fb ldr r3, [r7, #12]
- 800358c: 639a str r2, [r3, #56] ; 0x38
- hspi->RxXferCount--;
- 800358e: 68fb ldr r3, [r7, #12]
- 8003590: 8fdb ldrh r3, [r3, #62] ; 0x3e
- 8003592: b29b uxth r3, r3
- 8003594: 3b01 subs r3, #1
- 8003596: b29a uxth r2, r3
- 8003598: 68fb ldr r3, [r7, #12]
- 800359a: 87da strh r2, [r3, #62] ; 0x3e
- /* Next Data is a Transmission (Tx). Tx is allowed */
- txallowed = 1U;
- 800359c: 2301 movs r3, #1
- 800359e: 62fb str r3, [r7, #44] ; 0x2c
- }
- if ((((HAL_GetTick() - tickstart) >= Timeout) && ((Timeout != HAL_MAX_DELAY))) || (Timeout == 0U))
- 80035a0: f7fe fc60 bl 8001e64 <HAL_GetTick>
- 80035a4: 4602 mov r2, r0
- 80035a6: 6a7b ldr r3, [r7, #36] ; 0x24
- 80035a8: 1ad3 subs r3, r2, r3
- 80035aa: 6bba ldr r2, [r7, #56] ; 0x38
- 80035ac: 429a cmp r2, r3
- 80035ae: d803 bhi.n 80035b8 <HAL_SPI_TransmitReceive+0x2c6>
- 80035b0: 6bbb ldr r3, [r7, #56] ; 0x38
- 80035b2: f1b3 3fff cmp.w r3, #4294967295
- 80035b6: d102 bne.n 80035be <HAL_SPI_TransmitReceive+0x2cc>
- 80035b8: 6bbb ldr r3, [r7, #56] ; 0x38
- 80035ba: 2b00 cmp r3, #0
- 80035bc: d103 bne.n 80035c6 <HAL_SPI_TransmitReceive+0x2d4>
- {
- errorcode = HAL_TIMEOUT;
- 80035be: 2303 movs r3, #3
- 80035c0: f887 302b strb.w r3, [r7, #43] ; 0x2b
- goto error;
- 80035c4: e029 b.n 800361a <HAL_SPI_TransmitReceive+0x328>
- while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
- 80035c6: 68fb ldr r3, [r7, #12]
- 80035c8: 8edb ldrh r3, [r3, #54] ; 0x36
- 80035ca: b29b uxth r3, r3
- 80035cc: 2b00 cmp r3, #0
- 80035ce: d1a2 bne.n 8003516 <HAL_SPI_TransmitReceive+0x224>
- 80035d0: 68fb ldr r3, [r7, #12]
- 80035d2: 8fdb ldrh r3, [r3, #62] ; 0x3e
- 80035d4: b29b uxth r3, r3
- 80035d6: 2b00 cmp r3, #0
- 80035d8: d19d bne.n 8003516 <HAL_SPI_TransmitReceive+0x224>
- errorcode = HAL_ERROR;
- }
- #endif /* USE_SPI_CRC */
-
- /* Check the end of the transaction */
- if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK)
- 80035da: 6a7a ldr r2, [r7, #36] ; 0x24
- 80035dc: 6bb9 ldr r1, [r7, #56] ; 0x38
- 80035de: 68f8 ldr r0, [r7, #12]
- 80035e0: f000 f8b2 bl 8003748 <SPI_EndRxTxTransaction>
- 80035e4: 4603 mov r3, r0
- 80035e6: 2b00 cmp r3, #0
- 80035e8: d006 beq.n 80035f8 <HAL_SPI_TransmitReceive+0x306>
- {
- errorcode = HAL_ERROR;
- 80035ea: 2301 movs r3, #1
- 80035ec: f887 302b strb.w r3, [r7, #43] ; 0x2b
- hspi->ErrorCode = HAL_SPI_ERROR_FLAG;
- 80035f0: 68fb ldr r3, [r7, #12]
- 80035f2: 2220 movs r2, #32
- 80035f4: 655a str r2, [r3, #84] ; 0x54
- goto error;
- 80035f6: e010 b.n 800361a <HAL_SPI_TransmitReceive+0x328>
- }
-
- /* Clear overrun flag in 2 Lines communication mode because received is not read */
- if (hspi->Init.Direction == SPI_DIRECTION_2LINES)
- 80035f8: 68fb ldr r3, [r7, #12]
- 80035fa: 689b ldr r3, [r3, #8]
- 80035fc: 2b00 cmp r3, #0
- 80035fe: d10b bne.n 8003618 <HAL_SPI_TransmitReceive+0x326>
- {
- __HAL_SPI_CLEAR_OVRFLAG(hspi);
- 8003600: 2300 movs r3, #0
- 8003602: 617b str r3, [r7, #20]
- 8003604: 68fb ldr r3, [r7, #12]
- 8003606: 681b ldr r3, [r3, #0]
- 8003608: 68db ldr r3, [r3, #12]
- 800360a: 617b str r3, [r7, #20]
- 800360c: 68fb ldr r3, [r7, #12]
- 800360e: 681b ldr r3, [r3, #0]
- 8003610: 689b ldr r3, [r3, #8]
- 8003612: 617b str r3, [r7, #20]
- 8003614: 697b ldr r3, [r7, #20]
- 8003616: e000 b.n 800361a <HAL_SPI_TransmitReceive+0x328>
- }
-
- error :
- 8003618: bf00 nop
- hspi->State = HAL_SPI_STATE_READY;
- 800361a: 68fb ldr r3, [r7, #12]
- 800361c: 2201 movs r2, #1
- 800361e: f883 2051 strb.w r2, [r3, #81] ; 0x51
- __HAL_UNLOCK(hspi);
- 8003622: 68fb ldr r3, [r7, #12]
- 8003624: 2200 movs r2, #0
- 8003626: f883 2050 strb.w r2, [r3, #80] ; 0x50
- return errorcode;
- 800362a: f897 302b ldrb.w r3, [r7, #43] ; 0x2b
- }
- 800362e: 4618 mov r0, r3
- 8003630: 3730 adds r7, #48 ; 0x30
- 8003632: 46bd mov sp, r7
- 8003634: bd80 pop {r7, pc}
- ...
-
- 08003638 <SPI_WaitFlagStateUntilTimeout>:
- * @param Tickstart tick start value
- * @retval HAL status
- */
- static HAL_StatusTypeDef SPI_WaitFlagStateUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus State,
- uint32_t Timeout, uint32_t Tickstart)
- {
- 8003638: b580 push {r7, lr}
- 800363a: b088 sub sp, #32
- 800363c: af00 add r7, sp, #0
- 800363e: 60f8 str r0, [r7, #12]
- 8003640: 60b9 str r1, [r7, #8]
- 8003642: 603b str r3, [r7, #0]
- 8003644: 4613 mov r3, r2
- 8003646: 71fb strb r3, [r7, #7]
- __IO uint32_t count;
- uint32_t tmp_timeout;
- uint32_t tmp_tickstart;
-
- /* Adjust Timeout value in case of end of transfer */
- tmp_timeout = Timeout - (HAL_GetTick() - Tickstart);
- 8003648: f7fe fc0c bl 8001e64 <HAL_GetTick>
- 800364c: 4602 mov r2, r0
- 800364e: 6abb ldr r3, [r7, #40] ; 0x28
- 8003650: 1a9b subs r3, r3, r2
- 8003652: 683a ldr r2, [r7, #0]
- 8003654: 4413 add r3, r2
- 8003656: 61fb str r3, [r7, #28]
- tmp_tickstart = HAL_GetTick();
- 8003658: f7fe fc04 bl 8001e64 <HAL_GetTick>
- 800365c: 61b8 str r0, [r7, #24]
-
- /* Calculate Timeout based on a software loop to avoid blocking issue if Systick is disabled */
- count = tmp_timeout * ((SystemCoreClock * 32U) >> 20U);
- 800365e: 4b39 ldr r3, [pc, #228] ; (8003744 <SPI_WaitFlagStateUntilTimeout+0x10c>)
- 8003660: 681b ldr r3, [r3, #0]
- 8003662: 015b lsls r3, r3, #5
- 8003664: 0d1b lsrs r3, r3, #20
- 8003666: 69fa ldr r2, [r7, #28]
- 8003668: fb02 f303 mul.w r3, r2, r3
- 800366c: 617b str r3, [r7, #20]
-
- while ((__HAL_SPI_GET_FLAG(hspi, Flag) ? SET : RESET) != State)
- 800366e: e054 b.n 800371a <SPI_WaitFlagStateUntilTimeout+0xe2>
- {
- if (Timeout != HAL_MAX_DELAY)
- 8003670: 683b ldr r3, [r7, #0]
- 8003672: f1b3 3fff cmp.w r3, #4294967295
- 8003676: d050 beq.n 800371a <SPI_WaitFlagStateUntilTimeout+0xe2>
- {
- if (((HAL_GetTick() - tmp_tickstart) >= tmp_timeout) || (tmp_timeout == 0U))
- 8003678: f7fe fbf4 bl 8001e64 <HAL_GetTick>
- 800367c: 4602 mov r2, r0
- 800367e: 69bb ldr r3, [r7, #24]
- 8003680: 1ad3 subs r3, r2, r3
- 8003682: 69fa ldr r2, [r7, #28]
- 8003684: 429a cmp r2, r3
- 8003686: d902 bls.n 800368e <SPI_WaitFlagStateUntilTimeout+0x56>
- 8003688: 69fb ldr r3, [r7, #28]
- 800368a: 2b00 cmp r3, #0
- 800368c: d13d bne.n 800370a <SPI_WaitFlagStateUntilTimeout+0xd2>
- /* Disable the SPI and reset the CRC: the CRC value should be cleared
- on both master and slave sides in order to resynchronize the master
- and slave for their respective CRC calculation */
-
- /* Disable TXE, RXNE and ERR interrupts for the interrupt process */
- __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR));
- 800368e: 68fb ldr r3, [r7, #12]
- 8003690: 681b ldr r3, [r3, #0]
- 8003692: 685a ldr r2, [r3, #4]
- 8003694: 68fb ldr r3, [r7, #12]
- 8003696: 681b ldr r3, [r3, #0]
- 8003698: f022 02e0 bic.w r2, r2, #224 ; 0xe0
- 800369c: 605a str r2, [r3, #4]
-
- if ((hspi->Init.Mode == SPI_MODE_MASTER) && ((hspi->Init.Direction == SPI_DIRECTION_1LINE)
- 800369e: 68fb ldr r3, [r7, #12]
- 80036a0: 685b ldr r3, [r3, #4]
- 80036a2: f5b3 7f82 cmp.w r3, #260 ; 0x104
- 80036a6: d111 bne.n 80036cc <SPI_WaitFlagStateUntilTimeout+0x94>
- 80036a8: 68fb ldr r3, [r7, #12]
- 80036aa: 689b ldr r3, [r3, #8]
- 80036ac: f5b3 4f00 cmp.w r3, #32768 ; 0x8000
- 80036b0: d004 beq.n 80036bc <SPI_WaitFlagStateUntilTimeout+0x84>
- || (hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY)))
- 80036b2: 68fb ldr r3, [r7, #12]
- 80036b4: 689b ldr r3, [r3, #8]
- 80036b6: f5b3 6f80 cmp.w r3, #1024 ; 0x400
- 80036ba: d107 bne.n 80036cc <SPI_WaitFlagStateUntilTimeout+0x94>
- {
- /* Disable SPI peripheral */
- __HAL_SPI_DISABLE(hspi);
- 80036bc: 68fb ldr r3, [r7, #12]
- 80036be: 681b ldr r3, [r3, #0]
- 80036c0: 681a ldr r2, [r3, #0]
- 80036c2: 68fb ldr r3, [r7, #12]
- 80036c4: 681b ldr r3, [r3, #0]
- 80036c6: f022 0240 bic.w r2, r2, #64 ; 0x40
- 80036ca: 601a str r2, [r3, #0]
- }
-
- /* Reset CRC Calculation */
- if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
- 80036cc: 68fb ldr r3, [r7, #12]
- 80036ce: 6a9b ldr r3, [r3, #40] ; 0x28
- 80036d0: f5b3 5f00 cmp.w r3, #8192 ; 0x2000
- 80036d4: d10f bne.n 80036f6 <SPI_WaitFlagStateUntilTimeout+0xbe>
- {
- SPI_RESET_CRC(hspi);
- 80036d6: 68fb ldr r3, [r7, #12]
- 80036d8: 681b ldr r3, [r3, #0]
- 80036da: 681a ldr r2, [r3, #0]
- 80036dc: 68fb ldr r3, [r7, #12]
- 80036de: 681b ldr r3, [r3, #0]
- 80036e0: f422 5200 bic.w r2, r2, #8192 ; 0x2000
- 80036e4: 601a str r2, [r3, #0]
- 80036e6: 68fb ldr r3, [r7, #12]
- 80036e8: 681b ldr r3, [r3, #0]
- 80036ea: 681a ldr r2, [r3, #0]
- 80036ec: 68fb ldr r3, [r7, #12]
- 80036ee: 681b ldr r3, [r3, #0]
- 80036f0: f442 5200 orr.w r2, r2, #8192 ; 0x2000
- 80036f4: 601a str r2, [r3, #0]
- }
-
- hspi->State = HAL_SPI_STATE_READY;
- 80036f6: 68fb ldr r3, [r7, #12]
- 80036f8: 2201 movs r2, #1
- 80036fa: f883 2051 strb.w r2, [r3, #81] ; 0x51
-
- /* Process Unlocked */
- __HAL_UNLOCK(hspi);
- 80036fe: 68fb ldr r3, [r7, #12]
- 8003700: 2200 movs r2, #0
- 8003702: f883 2050 strb.w r2, [r3, #80] ; 0x50
-
- return HAL_TIMEOUT;
- 8003706: 2303 movs r3, #3
- 8003708: e017 b.n 800373a <SPI_WaitFlagStateUntilTimeout+0x102>
- }
- /* If Systick is disabled or not incremented, deactivate timeout to go in disable loop procedure */
- if(count == 0U)
- 800370a: 697b ldr r3, [r7, #20]
- 800370c: 2b00 cmp r3, #0
- 800370e: d101 bne.n 8003714 <SPI_WaitFlagStateUntilTimeout+0xdc>
- {
- tmp_timeout = 0U;
- 8003710: 2300 movs r3, #0
- 8003712: 61fb str r3, [r7, #28]
- }
- count--;
- 8003714: 697b ldr r3, [r7, #20]
- 8003716: 3b01 subs r3, #1
- 8003718: 617b str r3, [r7, #20]
- while ((__HAL_SPI_GET_FLAG(hspi, Flag) ? SET : RESET) != State)
- 800371a: 68fb ldr r3, [r7, #12]
- 800371c: 681b ldr r3, [r3, #0]
- 800371e: 689a ldr r2, [r3, #8]
- 8003720: 68bb ldr r3, [r7, #8]
- 8003722: 4013 ands r3, r2
- 8003724: 68ba ldr r2, [r7, #8]
- 8003726: 429a cmp r2, r3
- 8003728: bf0c ite eq
- 800372a: 2301 moveq r3, #1
- 800372c: 2300 movne r3, #0
- 800372e: b2db uxtb r3, r3
- 8003730: 461a mov r2, r3
- 8003732: 79fb ldrb r3, [r7, #7]
- 8003734: 429a cmp r2, r3
- 8003736: d19b bne.n 8003670 <SPI_WaitFlagStateUntilTimeout+0x38>
- }
- }
-
- return HAL_OK;
- 8003738: 2300 movs r3, #0
- }
- 800373a: 4618 mov r0, r3
- 800373c: 3720 adds r7, #32
- 800373e: 46bd mov sp, r7
- 8003740: bd80 pop {r7, pc}
- 8003742: bf00 nop
- 8003744: 20000004 .word 0x20000004
-
- 08003748 <SPI_EndRxTxTransaction>:
- * @param Timeout Timeout duration
- * @param Tickstart tick start value
- * @retval HAL status
- */
- static HAL_StatusTypeDef SPI_EndRxTxTransaction(SPI_HandleTypeDef *hspi, uint32_t Timeout, uint32_t Tickstart)
- {
- 8003748: b580 push {r7, lr}
- 800374a: b088 sub sp, #32
- 800374c: af02 add r7, sp, #8
- 800374e: 60f8 str r0, [r7, #12]
- 8003750: 60b9 str r1, [r7, #8]
- 8003752: 607a str r2, [r7, #4]
- /* Timeout in µs */
- __IO uint32_t count = SPI_BSY_FLAG_WORKAROUND_TIMEOUT * (SystemCoreClock / 24U / 1000000U);
- 8003754: 4b1b ldr r3, [pc, #108] ; (80037c4 <SPI_EndRxTxTransaction+0x7c>)
- 8003756: 681b ldr r3, [r3, #0]
- 8003758: 4a1b ldr r2, [pc, #108] ; (80037c8 <SPI_EndRxTxTransaction+0x80>)
- 800375a: fba2 2303 umull r2, r3, r2, r3
- 800375e: 0d5b lsrs r3, r3, #21
- 8003760: f44f 727a mov.w r2, #1000 ; 0x3e8
- 8003764: fb02 f303 mul.w r3, r2, r3
- 8003768: 617b str r3, [r7, #20]
- /* Erratasheet: BSY bit may stay high at the end of a data transfer in Slave mode */
- if (hspi->Init.Mode == SPI_MODE_MASTER)
- 800376a: 68fb ldr r3, [r7, #12]
- 800376c: 685b ldr r3, [r3, #4]
- 800376e: f5b3 7f82 cmp.w r3, #260 ; 0x104
- 8003772: d112 bne.n 800379a <SPI_EndRxTxTransaction+0x52>
- {
- /* Control the BSY flag */
- if (SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_BSY, RESET, Timeout, Tickstart) != HAL_OK)
- 8003774: 687b ldr r3, [r7, #4]
- 8003776: 9300 str r3, [sp, #0]
- 8003778: 68bb ldr r3, [r7, #8]
- 800377a: 2200 movs r2, #0
- 800377c: 2180 movs r1, #128 ; 0x80
- 800377e: 68f8 ldr r0, [r7, #12]
- 8003780: f7ff ff5a bl 8003638 <SPI_WaitFlagStateUntilTimeout>
- 8003784: 4603 mov r3, r0
- 8003786: 2b00 cmp r3, #0
- 8003788: d016 beq.n 80037b8 <SPI_EndRxTxTransaction+0x70>
- {
- SET_BIT(hspi->ErrorCode, HAL_SPI_ERROR_FLAG);
- 800378a: 68fb ldr r3, [r7, #12]
- 800378c: 6d5b ldr r3, [r3, #84] ; 0x54
- 800378e: f043 0220 orr.w r2, r3, #32
- 8003792: 68fb ldr r3, [r7, #12]
- 8003794: 655a str r2, [r3, #84] ; 0x54
- return HAL_TIMEOUT;
- 8003796: 2303 movs r3, #3
- 8003798: e00f b.n 80037ba <SPI_EndRxTxTransaction+0x72>
- * User have to calculate the timeout value to fit with the time of 1 byte transfer.
- * This time is directly link with the SPI clock from Master device.
- */
- do
- {
- if (count == 0U)
- 800379a: 697b ldr r3, [r7, #20]
- 800379c: 2b00 cmp r3, #0
- 800379e: d00a beq.n 80037b6 <SPI_EndRxTxTransaction+0x6e>
- {
- break;
- }
- count--;
- 80037a0: 697b ldr r3, [r7, #20]
- 80037a2: 3b01 subs r3, #1
- 80037a4: 617b str r3, [r7, #20]
- } while (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_BSY) != RESET);
- 80037a6: 68fb ldr r3, [r7, #12]
- 80037a8: 681b ldr r3, [r3, #0]
- 80037aa: 689b ldr r3, [r3, #8]
- 80037ac: f003 0380 and.w r3, r3, #128 ; 0x80
- 80037b0: 2b80 cmp r3, #128 ; 0x80
- 80037b2: d0f2 beq.n 800379a <SPI_EndRxTxTransaction+0x52>
- 80037b4: e000 b.n 80037b8 <SPI_EndRxTxTransaction+0x70>
- break;
- 80037b6: bf00 nop
- }
-
- return HAL_OK;
- 80037b8: 2300 movs r3, #0
- }
- 80037ba: 4618 mov r0, r3
- 80037bc: 3718 adds r7, #24
- 80037be: 46bd mov sp, r7
- 80037c0: bd80 pop {r7, pc}
- 80037c2: bf00 nop
- 80037c4: 20000004 .word 0x20000004
- 80037c8: 165e9f81 .word 0x165e9f81
-
- 080037cc <HAL_UART_Init>:
- * @param huart Pointer to a UART_HandleTypeDef structure that contains
- * the configuration information for the specified UART module.
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
- {
- 80037cc: b580 push {r7, lr}
- 80037ce: b082 sub sp, #8
- 80037d0: af00 add r7, sp, #0
- 80037d2: 6078 str r0, [r7, #4]
- /* Check the UART handle allocation */
- if (huart == NULL)
- 80037d4: 687b ldr r3, [r7, #4]
- 80037d6: 2b00 cmp r3, #0
- 80037d8: d101 bne.n 80037de <HAL_UART_Init+0x12>
- {
- return HAL_ERROR;
- 80037da: 2301 movs r3, #1
- 80037dc: e03f b.n 800385e <HAL_UART_Init+0x92>
- assert_param(IS_UART_INSTANCE(huart->Instance));
- }
- assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength));
- assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling));
-
- if (huart->gState == HAL_UART_STATE_RESET)
- 80037de: 687b ldr r3, [r7, #4]
- 80037e0: f893 3039 ldrb.w r3, [r3, #57] ; 0x39
- 80037e4: b2db uxtb r3, r3
- 80037e6: 2b00 cmp r3, #0
- 80037e8: d106 bne.n 80037f8 <HAL_UART_Init+0x2c>
- {
- /* Allocate lock resource and initialize it */
- huart->Lock = HAL_UNLOCKED;
- 80037ea: 687b ldr r3, [r7, #4]
- 80037ec: 2200 movs r2, #0
- 80037ee: f883 2038 strb.w r2, [r3, #56] ; 0x38
-
- /* Init the low level hardware */
- huart->MspInitCallback(huart);
- #else
- /* Init the low level hardware : GPIO, CLOCK */
- HAL_UART_MspInit(huart);
- 80037f2: 6878 ldr r0, [r7, #4]
- 80037f4: f7fe f9e2 bl 8001bbc <HAL_UART_MspInit>
- #endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */
- }
-
- huart->gState = HAL_UART_STATE_BUSY;
- 80037f8: 687b ldr r3, [r7, #4]
- 80037fa: 2224 movs r2, #36 ; 0x24
- 80037fc: f883 2039 strb.w r2, [r3, #57] ; 0x39
-
- /* Disable the peripheral */
- __HAL_UART_DISABLE(huart);
- 8003800: 687b ldr r3, [r7, #4]
- 8003802: 681b ldr r3, [r3, #0]
- 8003804: 68da ldr r2, [r3, #12]
- 8003806: 687b ldr r3, [r7, #4]
- 8003808: 681b ldr r3, [r3, #0]
- 800380a: f422 5200 bic.w r2, r2, #8192 ; 0x2000
- 800380e: 60da str r2, [r3, #12]
-
- /* Set the UART Communication parameters */
- UART_SetConfig(huart);
- 8003810: 6878 ldr r0, [r7, #4]
- 8003812: f000 f90b bl 8003a2c <UART_SetConfig>
-
- /* In asynchronous mode, the following bits must be kept cleared:
- - LINEN and CLKEN bits in the USART_CR2 register,
- - SCEN, HDSEL and IREN bits in the USART_CR3 register.*/
- CLEAR_BIT(huart->Instance->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));
- 8003816: 687b ldr r3, [r7, #4]
- 8003818: 681b ldr r3, [r3, #0]
- 800381a: 691a ldr r2, [r3, #16]
- 800381c: 687b ldr r3, [r7, #4]
- 800381e: 681b ldr r3, [r3, #0]
- 8003820: f422 4290 bic.w r2, r2, #18432 ; 0x4800
- 8003824: 611a str r2, [r3, #16]
- CLEAR_BIT(huart->Instance->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN));
- 8003826: 687b ldr r3, [r7, #4]
- 8003828: 681b ldr r3, [r3, #0]
- 800382a: 695a ldr r2, [r3, #20]
- 800382c: 687b ldr r3, [r7, #4]
- 800382e: 681b ldr r3, [r3, #0]
- 8003830: f022 022a bic.w r2, r2, #42 ; 0x2a
- 8003834: 615a str r2, [r3, #20]
-
- /* Enable the peripheral */
- __HAL_UART_ENABLE(huart);
- 8003836: 687b ldr r3, [r7, #4]
- 8003838: 681b ldr r3, [r3, #0]
- 800383a: 68da ldr r2, [r3, #12]
- 800383c: 687b ldr r3, [r7, #4]
- 800383e: 681b ldr r3, [r3, #0]
- 8003840: f442 5200 orr.w r2, r2, #8192 ; 0x2000
- 8003844: 60da str r2, [r3, #12]
-
- /* Initialize the UART state */
- huart->ErrorCode = HAL_UART_ERROR_NONE;
- 8003846: 687b ldr r3, [r7, #4]
- 8003848: 2200 movs r2, #0
- 800384a: 63da str r2, [r3, #60] ; 0x3c
- huart->gState = HAL_UART_STATE_READY;
- 800384c: 687b ldr r3, [r7, #4]
- 800384e: 2220 movs r2, #32
- 8003850: f883 2039 strb.w r2, [r3, #57] ; 0x39
- huart->RxState = HAL_UART_STATE_READY;
- 8003854: 687b ldr r3, [r7, #4]
- 8003856: 2220 movs r2, #32
- 8003858: f883 203a strb.w r2, [r3, #58] ; 0x3a
-
- return HAL_OK;
- 800385c: 2300 movs r3, #0
- }
- 800385e: 4618 mov r0, r3
- 8003860: 3708 adds r7, #8
- 8003862: 46bd mov sp, r7
- 8003864: bd80 pop {r7, pc}
-
- 08003866 <HAL_UART_Transmit>:
- * @param Size Amount of data elements (u8 or u16) to be sent
- * @param Timeout Timeout duration
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
- {
- 8003866: b580 push {r7, lr}
- 8003868: b088 sub sp, #32
- 800386a: af02 add r7, sp, #8
- 800386c: 60f8 str r0, [r7, #12]
- 800386e: 60b9 str r1, [r7, #8]
- 8003870: 603b str r3, [r7, #0]
- 8003872: 4613 mov r3, r2
- 8003874: 80fb strh r3, [r7, #6]
- uint16_t *tmp;
- uint32_t tickstart = 0U;
- 8003876: 2300 movs r3, #0
- 8003878: 617b str r3, [r7, #20]
-
- /* Check that a Tx process is not already ongoing */
- if (huart->gState == HAL_UART_STATE_READY)
- 800387a: 68fb ldr r3, [r7, #12]
- 800387c: f893 3039 ldrb.w r3, [r3, #57] ; 0x39
- 8003880: b2db uxtb r3, r3
- 8003882: 2b20 cmp r3, #32
- 8003884: f040 8083 bne.w 800398e <HAL_UART_Transmit+0x128>
- {
- if ((pData == NULL) || (Size == 0U))
- 8003888: 68bb ldr r3, [r7, #8]
- 800388a: 2b00 cmp r3, #0
- 800388c: d002 beq.n 8003894 <HAL_UART_Transmit+0x2e>
- 800388e: 88fb ldrh r3, [r7, #6]
- 8003890: 2b00 cmp r3, #0
- 8003892: d101 bne.n 8003898 <HAL_UART_Transmit+0x32>
- {
- return HAL_ERROR;
- 8003894: 2301 movs r3, #1
- 8003896: e07b b.n 8003990 <HAL_UART_Transmit+0x12a>
- }
-
- /* Process Locked */
- __HAL_LOCK(huart);
- 8003898: 68fb ldr r3, [r7, #12]
- 800389a: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
- 800389e: 2b01 cmp r3, #1
- 80038a0: d101 bne.n 80038a6 <HAL_UART_Transmit+0x40>
- 80038a2: 2302 movs r3, #2
- 80038a4: e074 b.n 8003990 <HAL_UART_Transmit+0x12a>
- 80038a6: 68fb ldr r3, [r7, #12]
- 80038a8: 2201 movs r2, #1
- 80038aa: f883 2038 strb.w r2, [r3, #56] ; 0x38
-
- huart->ErrorCode = HAL_UART_ERROR_NONE;
- 80038ae: 68fb ldr r3, [r7, #12]
- 80038b0: 2200 movs r2, #0
- 80038b2: 63da str r2, [r3, #60] ; 0x3c
- huart->gState = HAL_UART_STATE_BUSY_TX;
- 80038b4: 68fb ldr r3, [r7, #12]
- 80038b6: 2221 movs r2, #33 ; 0x21
- 80038b8: f883 2039 strb.w r2, [r3, #57] ; 0x39
-
- /* Init tickstart for timeout managment */
- tickstart = HAL_GetTick();
- 80038bc: f7fe fad2 bl 8001e64 <HAL_GetTick>
- 80038c0: 6178 str r0, [r7, #20]
-
- huart->TxXferSize = Size;
- 80038c2: 68fb ldr r3, [r7, #12]
- 80038c4: 88fa ldrh r2, [r7, #6]
- 80038c6: 849a strh r2, [r3, #36] ; 0x24
- huart->TxXferCount = Size;
- 80038c8: 68fb ldr r3, [r7, #12]
- 80038ca: 88fa ldrh r2, [r7, #6]
- 80038cc: 84da strh r2, [r3, #38] ; 0x26
-
- /* Process Unlocked */
- __HAL_UNLOCK(huart);
- 80038ce: 68fb ldr r3, [r7, #12]
- 80038d0: 2200 movs r2, #0
- 80038d2: f883 2038 strb.w r2, [r3, #56] ; 0x38
-
- while (huart->TxXferCount > 0U)
- 80038d6: e042 b.n 800395e <HAL_UART_Transmit+0xf8>
- {
- huart->TxXferCount--;
- 80038d8: 68fb ldr r3, [r7, #12]
- 80038da: 8cdb ldrh r3, [r3, #38] ; 0x26
- 80038dc: b29b uxth r3, r3
- 80038de: 3b01 subs r3, #1
- 80038e0: b29a uxth r2, r3
- 80038e2: 68fb ldr r3, [r7, #12]
- 80038e4: 84da strh r2, [r3, #38] ; 0x26
- if (huart->Init.WordLength == UART_WORDLENGTH_9B)
- 80038e6: 68fb ldr r3, [r7, #12]
- 80038e8: 689b ldr r3, [r3, #8]
- 80038ea: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
- 80038ee: d122 bne.n 8003936 <HAL_UART_Transmit+0xd0>
- {
- if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK)
- 80038f0: 683b ldr r3, [r7, #0]
- 80038f2: 9300 str r3, [sp, #0]
- 80038f4: 697b ldr r3, [r7, #20]
- 80038f6: 2200 movs r2, #0
- 80038f8: 2180 movs r1, #128 ; 0x80
- 80038fa: 68f8 ldr r0, [r7, #12]
- 80038fc: f000 f84c bl 8003998 <UART_WaitOnFlagUntilTimeout>
- 8003900: 4603 mov r3, r0
- 8003902: 2b00 cmp r3, #0
- 8003904: d001 beq.n 800390a <HAL_UART_Transmit+0xa4>
- {
- return HAL_TIMEOUT;
- 8003906: 2303 movs r3, #3
- 8003908: e042 b.n 8003990 <HAL_UART_Transmit+0x12a>
- }
- tmp = (uint16_t *) pData;
- 800390a: 68bb ldr r3, [r7, #8]
- 800390c: 613b str r3, [r7, #16]
- huart->Instance->DR = (*tmp & (uint16_t)0x01FF);
- 800390e: 693b ldr r3, [r7, #16]
- 8003910: 881b ldrh r3, [r3, #0]
- 8003912: 461a mov r2, r3
- 8003914: 68fb ldr r3, [r7, #12]
- 8003916: 681b ldr r3, [r3, #0]
- 8003918: f3c2 0208 ubfx r2, r2, #0, #9
- 800391c: 605a str r2, [r3, #4]
- if (huart->Init.Parity == UART_PARITY_NONE)
- 800391e: 68fb ldr r3, [r7, #12]
- 8003920: 691b ldr r3, [r3, #16]
- 8003922: 2b00 cmp r3, #0
- 8003924: d103 bne.n 800392e <HAL_UART_Transmit+0xc8>
- {
- pData += 2U;
- 8003926: 68bb ldr r3, [r7, #8]
- 8003928: 3302 adds r3, #2
- 800392a: 60bb str r3, [r7, #8]
- 800392c: e017 b.n 800395e <HAL_UART_Transmit+0xf8>
- }
- else
- {
- pData += 1U;
- 800392e: 68bb ldr r3, [r7, #8]
- 8003930: 3301 adds r3, #1
- 8003932: 60bb str r3, [r7, #8]
- 8003934: e013 b.n 800395e <HAL_UART_Transmit+0xf8>
- }
- }
- else
- {
- if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK)
- 8003936: 683b ldr r3, [r7, #0]
- 8003938: 9300 str r3, [sp, #0]
- 800393a: 697b ldr r3, [r7, #20]
- 800393c: 2200 movs r2, #0
- 800393e: 2180 movs r1, #128 ; 0x80
- 8003940: 68f8 ldr r0, [r7, #12]
- 8003942: f000 f829 bl 8003998 <UART_WaitOnFlagUntilTimeout>
- 8003946: 4603 mov r3, r0
- 8003948: 2b00 cmp r3, #0
- 800394a: d001 beq.n 8003950 <HAL_UART_Transmit+0xea>
- {
- return HAL_TIMEOUT;
- 800394c: 2303 movs r3, #3
- 800394e: e01f b.n 8003990 <HAL_UART_Transmit+0x12a>
- }
- huart->Instance->DR = (*pData++ & (uint8_t)0xFF);
- 8003950: 68bb ldr r3, [r7, #8]
- 8003952: 1c5a adds r2, r3, #1
- 8003954: 60ba str r2, [r7, #8]
- 8003956: 781a ldrb r2, [r3, #0]
- 8003958: 68fb ldr r3, [r7, #12]
- 800395a: 681b ldr r3, [r3, #0]
- 800395c: 605a str r2, [r3, #4]
- while (huart->TxXferCount > 0U)
- 800395e: 68fb ldr r3, [r7, #12]
- 8003960: 8cdb ldrh r3, [r3, #38] ; 0x26
- 8003962: b29b uxth r3, r3
- 8003964: 2b00 cmp r3, #0
- 8003966: d1b7 bne.n 80038d8 <HAL_UART_Transmit+0x72>
- }
- }
-
- if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TC, RESET, tickstart, Timeout) != HAL_OK)
- 8003968: 683b ldr r3, [r7, #0]
- 800396a: 9300 str r3, [sp, #0]
- 800396c: 697b ldr r3, [r7, #20]
- 800396e: 2200 movs r2, #0
- 8003970: 2140 movs r1, #64 ; 0x40
- 8003972: 68f8 ldr r0, [r7, #12]
- 8003974: f000 f810 bl 8003998 <UART_WaitOnFlagUntilTimeout>
- 8003978: 4603 mov r3, r0
- 800397a: 2b00 cmp r3, #0
- 800397c: d001 beq.n 8003982 <HAL_UART_Transmit+0x11c>
- {
- return HAL_TIMEOUT;
- 800397e: 2303 movs r3, #3
- 8003980: e006 b.n 8003990 <HAL_UART_Transmit+0x12a>
- }
-
- /* At end of Tx process, restore huart->gState to Ready */
- huart->gState = HAL_UART_STATE_READY;
- 8003982: 68fb ldr r3, [r7, #12]
- 8003984: 2220 movs r2, #32
- 8003986: f883 2039 strb.w r2, [r3, #57] ; 0x39
-
- return HAL_OK;
- 800398a: 2300 movs r3, #0
- 800398c: e000 b.n 8003990 <HAL_UART_Transmit+0x12a>
- }
- else
- {
- return HAL_BUSY;
- 800398e: 2302 movs r3, #2
- }
- }
- 8003990: 4618 mov r0, r3
- 8003992: 3718 adds r7, #24
- 8003994: 46bd mov sp, r7
- 8003996: bd80 pop {r7, pc}
-
- 08003998 <UART_WaitOnFlagUntilTimeout>:
- * @param Tickstart Tick start value
- * @param Timeout Timeout duration
- * @retval HAL status
- */
- static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout)
- {
- 8003998: b580 push {r7, lr}
- 800399a: b084 sub sp, #16
- 800399c: af00 add r7, sp, #0
- 800399e: 60f8 str r0, [r7, #12]
- 80039a0: 60b9 str r1, [r7, #8]
- 80039a2: 603b str r3, [r7, #0]
- 80039a4: 4613 mov r3, r2
- 80039a6: 71fb strb r3, [r7, #7]
- /* Wait until flag is set */
- while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status)
- 80039a8: e02c b.n 8003a04 <UART_WaitOnFlagUntilTimeout+0x6c>
- {
- /* Check for the Timeout */
- if (Timeout != HAL_MAX_DELAY)
- 80039aa: 69bb ldr r3, [r7, #24]
- 80039ac: f1b3 3fff cmp.w r3, #4294967295
- 80039b0: d028 beq.n 8003a04 <UART_WaitOnFlagUntilTimeout+0x6c>
- {
- if ((Timeout == 0U) || ((HAL_GetTick() - Tickstart) > Timeout))
- 80039b2: 69bb ldr r3, [r7, #24]
- 80039b4: 2b00 cmp r3, #0
- 80039b6: d007 beq.n 80039c8 <UART_WaitOnFlagUntilTimeout+0x30>
- 80039b8: f7fe fa54 bl 8001e64 <HAL_GetTick>
- 80039bc: 4602 mov r2, r0
- 80039be: 683b ldr r3, [r7, #0]
- 80039c0: 1ad3 subs r3, r2, r3
- 80039c2: 69ba ldr r2, [r7, #24]
- 80039c4: 429a cmp r2, r3
- 80039c6: d21d bcs.n 8003a04 <UART_WaitOnFlagUntilTimeout+0x6c>
- {
- /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */
- CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE));
- 80039c8: 68fb ldr r3, [r7, #12]
- 80039ca: 681b ldr r3, [r3, #0]
- 80039cc: 68da ldr r2, [r3, #12]
- 80039ce: 68fb ldr r3, [r7, #12]
- 80039d0: 681b ldr r3, [r3, #0]
- 80039d2: f422 72d0 bic.w r2, r2, #416 ; 0x1a0
- 80039d6: 60da str r2, [r3, #12]
- CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE);
- 80039d8: 68fb ldr r3, [r7, #12]
- 80039da: 681b ldr r3, [r3, #0]
- 80039dc: 695a ldr r2, [r3, #20]
- 80039de: 68fb ldr r3, [r7, #12]
- 80039e0: 681b ldr r3, [r3, #0]
- 80039e2: f022 0201 bic.w r2, r2, #1
- 80039e6: 615a str r2, [r3, #20]
-
- huart->gState = HAL_UART_STATE_READY;
- 80039e8: 68fb ldr r3, [r7, #12]
- 80039ea: 2220 movs r2, #32
- 80039ec: f883 2039 strb.w r2, [r3, #57] ; 0x39
- huart->RxState = HAL_UART_STATE_READY;
- 80039f0: 68fb ldr r3, [r7, #12]
- 80039f2: 2220 movs r2, #32
- 80039f4: f883 203a strb.w r2, [r3, #58] ; 0x3a
-
- /* Process Unlocked */
- __HAL_UNLOCK(huart);
- 80039f8: 68fb ldr r3, [r7, #12]
- 80039fa: 2200 movs r2, #0
- 80039fc: f883 2038 strb.w r2, [r3, #56] ; 0x38
-
- return HAL_TIMEOUT;
- 8003a00: 2303 movs r3, #3
- 8003a02: e00f b.n 8003a24 <UART_WaitOnFlagUntilTimeout+0x8c>
- while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status)
- 8003a04: 68fb ldr r3, [r7, #12]
- 8003a06: 681b ldr r3, [r3, #0]
- 8003a08: 681a ldr r2, [r3, #0]
- 8003a0a: 68bb ldr r3, [r7, #8]
- 8003a0c: 4013 ands r3, r2
- 8003a0e: 68ba ldr r2, [r7, #8]
- 8003a10: 429a cmp r2, r3
- 8003a12: bf0c ite eq
- 8003a14: 2301 moveq r3, #1
- 8003a16: 2300 movne r3, #0
- 8003a18: b2db uxtb r3, r3
- 8003a1a: 461a mov r2, r3
- 8003a1c: 79fb ldrb r3, [r7, #7]
- 8003a1e: 429a cmp r2, r3
- 8003a20: d0c3 beq.n 80039aa <UART_WaitOnFlagUntilTimeout+0x12>
- }
- }
- }
- return HAL_OK;
- 8003a22: 2300 movs r3, #0
- }
- 8003a24: 4618 mov r0, r3
- 8003a26: 3710 adds r7, #16
- 8003a28: 46bd mov sp, r7
- 8003a2a: bd80 pop {r7, pc}
-
- 08003a2c <UART_SetConfig>:
- * @param huart Pointer to a UART_HandleTypeDef structure that contains
- * the configuration information for the specified UART module.
- * @retval None
- */
- static void UART_SetConfig(UART_HandleTypeDef *huart)
- {
- 8003a2c: b580 push {r7, lr}
- 8003a2e: b084 sub sp, #16
- 8003a30: af00 add r7, sp, #0
- 8003a32: 6078 str r0, [r7, #4]
- assert_param(IS_UART_MODE(huart->Init.Mode));
-
- /*-------------------------- USART CR2 Configuration -----------------------*/
- /* Configure the UART Stop Bits: Set STOP[13:12] bits
- according to huart->Init.StopBits value */
- MODIFY_REG(huart->Instance->CR2, USART_CR2_STOP, huart->Init.StopBits);
- 8003a34: 687b ldr r3, [r7, #4]
- 8003a36: 681b ldr r3, [r3, #0]
- 8003a38: 691b ldr r3, [r3, #16]
- 8003a3a: f423 5140 bic.w r1, r3, #12288 ; 0x3000
- 8003a3e: 687b ldr r3, [r7, #4]
- 8003a40: 68da ldr r2, [r3, #12]
- 8003a42: 687b ldr r3, [r7, #4]
- 8003a44: 681b ldr r3, [r3, #0]
- 8003a46: 430a orrs r2, r1
- 8003a48: 611a str r2, [r3, #16]
- Set the M bits according to huart->Init.WordLength value
- Set PCE and PS bits according to huart->Init.Parity value
- Set TE and RE bits according to huart->Init.Mode value
- Set OVER8 bit according to huart->Init.OverSampling value */
-
- tmpreg = (uint32_t)huart->Init.WordLength | huart->Init.Parity | huart->Init.Mode | huart->Init.OverSampling;
- 8003a4a: 687b ldr r3, [r7, #4]
- 8003a4c: 689a ldr r2, [r3, #8]
- 8003a4e: 687b ldr r3, [r7, #4]
- 8003a50: 691b ldr r3, [r3, #16]
- 8003a52: 431a orrs r2, r3
- 8003a54: 687b ldr r3, [r7, #4]
- 8003a56: 695b ldr r3, [r3, #20]
- 8003a58: 431a orrs r2, r3
- 8003a5a: 687b ldr r3, [r7, #4]
- 8003a5c: 69db ldr r3, [r3, #28]
- 8003a5e: 4313 orrs r3, r2
- 8003a60: 60bb str r3, [r7, #8]
- MODIFY_REG(huart->Instance->CR1,
- 8003a62: 687b ldr r3, [r7, #4]
- 8003a64: 681b ldr r3, [r3, #0]
- 8003a66: 68db ldr r3, [r3, #12]
- 8003a68: f423 4316 bic.w r3, r3, #38400 ; 0x9600
- 8003a6c: f023 030c bic.w r3, r3, #12
- 8003a70: 687a ldr r2, [r7, #4]
- 8003a72: 6812 ldr r2, [r2, #0]
- 8003a74: 68b9 ldr r1, [r7, #8]
- 8003a76: 430b orrs r3, r1
- 8003a78: 60d3 str r3, [r2, #12]
- (uint32_t)(USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | USART_CR1_TE | USART_CR1_RE | USART_CR1_OVER8),
- tmpreg);
-
- /*-------------------------- USART CR3 Configuration -----------------------*/
- /* Configure the UART HFC: Set CTSE and RTSE bits according to huart->Init.HwFlowCtl value */
- MODIFY_REG(huart->Instance->CR3, (USART_CR3_RTSE | USART_CR3_CTSE), huart->Init.HwFlowCtl);
- 8003a7a: 687b ldr r3, [r7, #4]
- 8003a7c: 681b ldr r3, [r3, #0]
- 8003a7e: 695b ldr r3, [r3, #20]
- 8003a80: f423 7140 bic.w r1, r3, #768 ; 0x300
- 8003a84: 687b ldr r3, [r7, #4]
- 8003a86: 699a ldr r2, [r3, #24]
- 8003a88: 687b ldr r3, [r7, #4]
- 8003a8a: 681b ldr r3, [r3, #0]
- 8003a8c: 430a orrs r2, r1
- 8003a8e: 615a str r2, [r3, #20]
-
-
- if((huart->Instance == USART1))
- 8003a90: 687b ldr r3, [r7, #4]
- 8003a92: 681b ldr r3, [r3, #0]
- 8003a94: 4a55 ldr r2, [pc, #340] ; (8003bec <UART_SetConfig+0x1c0>)
- 8003a96: 4293 cmp r3, r2
- 8003a98: d103 bne.n 8003aa2 <UART_SetConfig+0x76>
- {
- pclk = HAL_RCC_GetPCLK2Freq();
- 8003a9a: f7ff f9f1 bl 8002e80 <HAL_RCC_GetPCLK2Freq>
- 8003a9e: 60f8 str r0, [r7, #12]
- 8003aa0: e002 b.n 8003aa8 <UART_SetConfig+0x7c>
- }
- else
- {
- pclk = HAL_RCC_GetPCLK1Freq();
- 8003aa2: f7ff f9d9 bl 8002e58 <HAL_RCC_GetPCLK1Freq>
- 8003aa6: 60f8 str r0, [r7, #12]
- }
-
- /*-------------------------- USART BRR Configuration ---------------------*/
- if (huart->Init.OverSampling == UART_OVERSAMPLING_8)
- 8003aa8: 687b ldr r3, [r7, #4]
- 8003aaa: 69db ldr r3, [r3, #28]
- 8003aac: f5b3 4f00 cmp.w r3, #32768 ; 0x8000
- 8003ab0: d14c bne.n 8003b4c <UART_SetConfig+0x120>
- {
- huart->Instance->BRR = UART_BRR_SAMPLING8(pclk, huart->Init.BaudRate);
- 8003ab2: 68fa ldr r2, [r7, #12]
- 8003ab4: 4613 mov r3, r2
- 8003ab6: 009b lsls r3, r3, #2
- 8003ab8: 4413 add r3, r2
- 8003aba: 009a lsls r2, r3, #2
- 8003abc: 441a add r2, r3
- 8003abe: 687b ldr r3, [r7, #4]
- 8003ac0: 685b ldr r3, [r3, #4]
- 8003ac2: 005b lsls r3, r3, #1
- 8003ac4: fbb2 f3f3 udiv r3, r2, r3
- 8003ac8: 4a49 ldr r2, [pc, #292] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003aca: fba2 2303 umull r2, r3, r2, r3
- 8003ace: 095b lsrs r3, r3, #5
- 8003ad0: 0119 lsls r1, r3, #4
- 8003ad2: 68fa ldr r2, [r7, #12]
- 8003ad4: 4613 mov r3, r2
- 8003ad6: 009b lsls r3, r3, #2
- 8003ad8: 4413 add r3, r2
- 8003ada: 009a lsls r2, r3, #2
- 8003adc: 441a add r2, r3
- 8003ade: 687b ldr r3, [r7, #4]
- 8003ae0: 685b ldr r3, [r3, #4]
- 8003ae2: 005b lsls r3, r3, #1
- 8003ae4: fbb2 f2f3 udiv r2, r2, r3
- 8003ae8: 4b41 ldr r3, [pc, #260] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003aea: fba3 0302 umull r0, r3, r3, r2
- 8003aee: 095b lsrs r3, r3, #5
- 8003af0: 2064 movs r0, #100 ; 0x64
- 8003af2: fb00 f303 mul.w r3, r0, r3
- 8003af6: 1ad3 subs r3, r2, r3
- 8003af8: 00db lsls r3, r3, #3
- 8003afa: 3332 adds r3, #50 ; 0x32
- 8003afc: 4a3c ldr r2, [pc, #240] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003afe: fba2 2303 umull r2, r3, r2, r3
- 8003b02: 095b lsrs r3, r3, #5
- 8003b04: 005b lsls r3, r3, #1
- 8003b06: f403 73f8 and.w r3, r3, #496 ; 0x1f0
- 8003b0a: 4419 add r1, r3
- 8003b0c: 68fa ldr r2, [r7, #12]
- 8003b0e: 4613 mov r3, r2
- 8003b10: 009b lsls r3, r3, #2
- 8003b12: 4413 add r3, r2
- 8003b14: 009a lsls r2, r3, #2
- 8003b16: 441a add r2, r3
- 8003b18: 687b ldr r3, [r7, #4]
- 8003b1a: 685b ldr r3, [r3, #4]
- 8003b1c: 005b lsls r3, r3, #1
- 8003b1e: fbb2 f2f3 udiv r2, r2, r3
- 8003b22: 4b33 ldr r3, [pc, #204] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003b24: fba3 0302 umull r0, r3, r3, r2
- 8003b28: 095b lsrs r3, r3, #5
- 8003b2a: 2064 movs r0, #100 ; 0x64
- 8003b2c: fb00 f303 mul.w r3, r0, r3
- 8003b30: 1ad3 subs r3, r2, r3
- 8003b32: 00db lsls r3, r3, #3
- 8003b34: 3332 adds r3, #50 ; 0x32
- 8003b36: 4a2e ldr r2, [pc, #184] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003b38: fba2 2303 umull r2, r3, r2, r3
- 8003b3c: 095b lsrs r3, r3, #5
- 8003b3e: f003 0207 and.w r2, r3, #7
- 8003b42: 687b ldr r3, [r7, #4]
- 8003b44: 681b ldr r3, [r3, #0]
- 8003b46: 440a add r2, r1
- 8003b48: 609a str r2, [r3, #8]
- }
- else
- {
- huart->Instance->BRR = UART_BRR_SAMPLING16(pclk, huart->Init.BaudRate);
- }
- }
- 8003b4a: e04a b.n 8003be2 <UART_SetConfig+0x1b6>
- huart->Instance->BRR = UART_BRR_SAMPLING16(pclk, huart->Init.BaudRate);
- 8003b4c: 68fa ldr r2, [r7, #12]
- 8003b4e: 4613 mov r3, r2
- 8003b50: 009b lsls r3, r3, #2
- 8003b52: 4413 add r3, r2
- 8003b54: 009a lsls r2, r3, #2
- 8003b56: 441a add r2, r3
- 8003b58: 687b ldr r3, [r7, #4]
- 8003b5a: 685b ldr r3, [r3, #4]
- 8003b5c: 009b lsls r3, r3, #2
- 8003b5e: fbb2 f3f3 udiv r3, r2, r3
- 8003b62: 4a23 ldr r2, [pc, #140] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003b64: fba2 2303 umull r2, r3, r2, r3
- 8003b68: 095b lsrs r3, r3, #5
- 8003b6a: 0119 lsls r1, r3, #4
- 8003b6c: 68fa ldr r2, [r7, #12]
- 8003b6e: 4613 mov r3, r2
- 8003b70: 009b lsls r3, r3, #2
- 8003b72: 4413 add r3, r2
- 8003b74: 009a lsls r2, r3, #2
- 8003b76: 441a add r2, r3
- 8003b78: 687b ldr r3, [r7, #4]
- 8003b7a: 685b ldr r3, [r3, #4]
- 8003b7c: 009b lsls r3, r3, #2
- 8003b7e: fbb2 f2f3 udiv r2, r2, r3
- 8003b82: 4b1b ldr r3, [pc, #108] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003b84: fba3 0302 umull r0, r3, r3, r2
- 8003b88: 095b lsrs r3, r3, #5
- 8003b8a: 2064 movs r0, #100 ; 0x64
- 8003b8c: fb00 f303 mul.w r3, r0, r3
- 8003b90: 1ad3 subs r3, r2, r3
- 8003b92: 011b lsls r3, r3, #4
- 8003b94: 3332 adds r3, #50 ; 0x32
- 8003b96: 4a16 ldr r2, [pc, #88] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003b98: fba2 2303 umull r2, r3, r2, r3
- 8003b9c: 095b lsrs r3, r3, #5
- 8003b9e: f003 03f0 and.w r3, r3, #240 ; 0xf0
- 8003ba2: 4419 add r1, r3
- 8003ba4: 68fa ldr r2, [r7, #12]
- 8003ba6: 4613 mov r3, r2
- 8003ba8: 009b lsls r3, r3, #2
- 8003baa: 4413 add r3, r2
- 8003bac: 009a lsls r2, r3, #2
- 8003bae: 441a add r2, r3
- 8003bb0: 687b ldr r3, [r7, #4]
- 8003bb2: 685b ldr r3, [r3, #4]
- 8003bb4: 009b lsls r3, r3, #2
- 8003bb6: fbb2 f2f3 udiv r2, r2, r3
- 8003bba: 4b0d ldr r3, [pc, #52] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003bbc: fba3 0302 umull r0, r3, r3, r2
- 8003bc0: 095b lsrs r3, r3, #5
- 8003bc2: 2064 movs r0, #100 ; 0x64
- 8003bc4: fb00 f303 mul.w r3, r0, r3
- 8003bc8: 1ad3 subs r3, r2, r3
- 8003bca: 011b lsls r3, r3, #4
- 8003bcc: 3332 adds r3, #50 ; 0x32
- 8003bce: 4a08 ldr r2, [pc, #32] ; (8003bf0 <UART_SetConfig+0x1c4>)
- 8003bd0: fba2 2303 umull r2, r3, r2, r3
- 8003bd4: 095b lsrs r3, r3, #5
- 8003bd6: f003 020f and.w r2, r3, #15
- 8003bda: 687b ldr r3, [r7, #4]
- 8003bdc: 681b ldr r3, [r3, #0]
- 8003bde: 440a add r2, r1
- 8003be0: 609a str r2, [r3, #8]
- }
- 8003be2: bf00 nop
- 8003be4: 3710 adds r7, #16
- 8003be6: 46bd mov sp, r7
- 8003be8: bd80 pop {r7, pc}
- 8003bea: bf00 nop
- 8003bec: 40013800 .word 0x40013800
- 8003bf0: 51eb851f .word 0x51eb851f
-
- 08003bf4 <MX_FATFS_Init>:
- /* USER CODE BEGIN Variables */
-
- /* USER CODE END Variables */
-
- void MX_FATFS_Init(void)
- {
- 8003bf4: b580 push {r7, lr}
- 8003bf6: af00 add r7, sp, #0
- /*## FatFS: Link the USER driver ###########################*/
- retUSER = FATFS_LinkDriver(&USER_Driver, USERPath);
- 8003bf8: 4904 ldr r1, [pc, #16] ; (8003c0c <MX_FATFS_Init+0x18>)
- 8003bfa: 4805 ldr r0, [pc, #20] ; (8003c10 <MX_FATFS_Init+0x1c>)
- 8003bfc: f003 f9ac bl 8006f58 <FATFS_LinkDriver>
- 8003c00: 4603 mov r3, r0
- 8003c02: 461a mov r2, r3
- 8003c04: 4b03 ldr r3, [pc, #12] ; (8003c14 <MX_FATFS_Init+0x20>)
- 8003c06: 701a strb r2, [r3, #0]
-
- /* USER CODE BEGIN Init */
- /* additional user code for init */
- /* USER CODE END Init */
- }
- 8003c08: bf00 nop
- 8003c0a: bd80 pop {r7, pc}
- 8003c0c: 20002468 .word 0x20002468
- 8003c10: 20000010 .word 0x20000010
- 8003c14: 2000246c .word 0x2000246c
-
- 08003c18 <get_fattime>:
- * @brief Gets Time from RTC
- * @param None
- * @retval Time in DWORD
- */
- DWORD get_fattime(void)
- {
- 8003c18: b480 push {r7}
- 8003c1a: af00 add r7, sp, #0
- /* USER CODE BEGIN get_fattime */
- return 0;
- 8003c1c: 2300 movs r3, #0
- /* USER CODE END get_fattime */
- }
- 8003c1e: 4618 mov r0, r3
- 8003c20: 46bd mov sp, r7
- 8003c22: bc80 pop {r7}
- 8003c24: 4770 bx lr
-
- 08003c26 <USER_initialize>:
- * @retval DSTATUS: Operation status
- */
- DSTATUS USER_initialize (
- BYTE pdrv /* Physical drive nmuber to identify the drive */
- )
- {
- 8003c26: b580 push {r7, lr}
- 8003c28: b082 sub sp, #8
- 8003c2a: af00 add r7, sp, #0
- 8003c2c: 4603 mov r3, r0
- 8003c2e: 71fb strb r3, [r7, #7]
- /* USER CODE BEGIN INIT */
- //Stat = STA_NOINIT;
- //return Stat;
- SD_disk_initialize (pdrv);
- 8003c30: 79fb ldrb r3, [r7, #7]
- 8003c32: 4618 mov r0, r3
- 8003c34: f7fd f9cc bl 8000fd0 <SD_disk_initialize>
- /* USER CODE END INIT */
- }
- 8003c38: bf00 nop
- 8003c3a: 4618 mov r0, r3
- 8003c3c: 3708 adds r7, #8
- 8003c3e: 46bd mov sp, r7
- 8003c40: bd80 pop {r7, pc}
-
- 08003c42 <USER_status>:
- * @retval DSTATUS: Operation status
- */
- DSTATUS USER_status (
- BYTE pdrv /* Physical drive number to identify the drive */
- )
- {
- 8003c42: b580 push {r7, lr}
- 8003c44: b082 sub sp, #8
- 8003c46: af00 add r7, sp, #0
- 8003c48: 4603 mov r3, r0
- 8003c4a: 71fb strb r3, [r7, #7]
- /* USER CODE BEGIN STATUS */
- //Stat = STA_NOINIT;
- //return Stat;
- SD_disk_status (pdrv);
- 8003c4c: 79fb ldrb r3, [r7, #7]
- 8003c4e: 4618 mov r0, r3
- 8003c50: f7fd faa4 bl 800119c <SD_disk_status>
- /* USER CODE END STATUS */
- }
- 8003c54: bf00 nop
- 8003c56: 4618 mov r0, r3
- 8003c58: 3708 adds r7, #8
- 8003c5a: 46bd mov sp, r7
- 8003c5c: bd80 pop {r7, pc}
-
- 08003c5e <USER_read>:
- BYTE pdrv, /* Physical drive nmuber to identify the drive */
- BYTE *buff, /* Data buffer to store read data */
- DWORD sector, /* Sector address in LBA */
- UINT count /* Number of sectors to read */
- )
- {
- 8003c5e: b580 push {r7, lr}
- 8003c60: b084 sub sp, #16
- 8003c62: af00 add r7, sp, #0
- 8003c64: 60b9 str r1, [r7, #8]
- 8003c66: 607a str r2, [r7, #4]
- 8003c68: 603b str r3, [r7, #0]
- 8003c6a: 4603 mov r3, r0
- 8003c6c: 73fb strb r3, [r7, #15]
- /* USER CODE BEGIN READ */
- //return RES_OK;
- SD_disk_read (pdrv, buff, sector, count);
- 8003c6e: 7bf8 ldrb r0, [r7, #15]
- 8003c70: 683b ldr r3, [r7, #0]
- 8003c72: 687a ldr r2, [r7, #4]
- 8003c74: 68b9 ldr r1, [r7, #8]
- 8003c76: f7fd faa5 bl 80011c4 <SD_disk_read>
- /* USER CODE END READ */
- }
- 8003c7a: bf00 nop
- 8003c7c: 4618 mov r0, r3
- 8003c7e: 3710 adds r7, #16
- 8003c80: 46bd mov sp, r7
- 8003c82: bd80 pop {r7, pc}
-
- 08003c84 <USER_write>:
- BYTE pdrv, /* Physical drive nmuber to identify the drive */
- const BYTE *buff, /* Data to be written */
- DWORD sector, /* Sector address in LBA */
- UINT count /* Number of sectors to write */
- )
- {
- 8003c84: b580 push {r7, lr}
- 8003c86: b084 sub sp, #16
- 8003c88: af00 add r7, sp, #0
- 8003c8a: 60b9 str r1, [r7, #8]
- 8003c8c: 607a str r2, [r7, #4]
- 8003c8e: 603b str r3, [r7, #0]
- 8003c90: 4603 mov r3, r0
- 8003c92: 73fb strb r3, [r7, #15]
- /* USER CODE BEGIN WRITE */
- /* USER CODE HERE */
- //return RES_OK;
- SD_disk_write (pdrv, buff, sector, count);
- 8003c94: 7bf8 ldrb r0, [r7, #15]
- 8003c96: 683b ldr r3, [r7, #0]
- 8003c98: 687a ldr r2, [r7, #4]
- 8003c9a: 68b9 ldr r1, [r7, #8]
- 8003c9c: f7fd fafc bl 8001298 <SD_disk_write>
- /* USER CODE END WRITE */
- }
- 8003ca0: bf00 nop
- 8003ca2: 4618 mov r0, r3
- 8003ca4: 3710 adds r7, #16
- 8003ca6: 46bd mov sp, r7
- 8003ca8: bd80 pop {r7, pc}
-
- 08003caa <USER_ioctl>:
- DRESULT USER_ioctl (
- BYTE pdrv, /* Physical drive nmuber (0..) */
- BYTE cmd, /* Control code */
- void *buff /* Buffer to send/receive control data */
- )
- {
- 8003caa: b580 push {r7, lr}
- 8003cac: b082 sub sp, #8
- 8003cae: af00 add r7, sp, #0
- 8003cb0: 4603 mov r3, r0
- 8003cb2: 603a str r2, [r7, #0]
- 8003cb4: 71fb strb r3, [r7, #7]
- 8003cb6: 460b mov r3, r1
- 8003cb8: 71bb strb r3, [r7, #6]
- /* USER CODE BEGIN IOCTL */
- //DRESULT res = RES_ERROR;
- //return res;
- SD_disk_ioctl (pdrv, cmd, buff);
- 8003cba: 79fb ldrb r3, [r7, #7]
- 8003cbc: 79b9 ldrb r1, [r7, #6]
- 8003cbe: 683a ldr r2, [r7, #0]
- 8003cc0: 4618 mov r0, r3
- 8003cc2: f7fd fb6d bl 80013a0 <SD_disk_ioctl>
- /* USER CODE END IOCTL */
- }
- 8003cc6: bf00 nop
- 8003cc8: 4618 mov r0, r3
- 8003cca: 3708 adds r7, #8
- 8003ccc: 46bd mov sp, r7
- 8003cce: bd80 pop {r7, pc}
-
- 08003cd0 <disk_status>:
- * @retval DSTATUS: Operation status
- */
- DSTATUS disk_status (
- BYTE pdrv /* Physical drive number to identify the drive */
- )
- {
- 8003cd0: b580 push {r7, lr}
- 8003cd2: b084 sub sp, #16
- 8003cd4: af00 add r7, sp, #0
- 8003cd6: 4603 mov r3, r0
- 8003cd8: 71fb strb r3, [r7, #7]
- DSTATUS stat;
-
- stat = disk.drv[pdrv]->disk_status(disk.lun[pdrv]);
- 8003cda: 79fb ldrb r3, [r7, #7]
- 8003cdc: 4a08 ldr r2, [pc, #32] ; (8003d00 <disk_status+0x30>)
- 8003cde: 009b lsls r3, r3, #2
- 8003ce0: 4413 add r3, r2
- 8003ce2: 685b ldr r3, [r3, #4]
- 8003ce4: 685b ldr r3, [r3, #4]
- 8003ce6: 79fa ldrb r2, [r7, #7]
- 8003ce8: 4905 ldr r1, [pc, #20] ; (8003d00 <disk_status+0x30>)
- 8003cea: 440a add r2, r1
- 8003cec: 7a12 ldrb r2, [r2, #8]
- 8003cee: 4610 mov r0, r2
- 8003cf0: 4798 blx r3
- 8003cf2: 4603 mov r3, r0
- 8003cf4: 73fb strb r3, [r7, #15]
- return stat;
- 8003cf6: 7bfb ldrb r3, [r7, #15]
- }
- 8003cf8: 4618 mov r0, r3
- 8003cfa: 3710 adds r7, #16
- 8003cfc: 46bd mov sp, r7
- 8003cfe: bd80 pop {r7, pc}
- 8003d00: 200002d4 .word 0x200002d4
-
- 08003d04 <disk_initialize>:
- * @retval DSTATUS: Operation status
- */
- DSTATUS disk_initialize (
- BYTE pdrv /* Physical drive nmuber to identify the drive */
- )
- {
- 8003d04: b580 push {r7, lr}
- 8003d06: b084 sub sp, #16
- 8003d08: af00 add r7, sp, #0
- 8003d0a: 4603 mov r3, r0
- 8003d0c: 71fb strb r3, [r7, #7]
- DSTATUS stat = RES_OK;
- 8003d0e: 2300 movs r3, #0
- 8003d10: 73fb strb r3, [r7, #15]
-
- if(disk.is_initialized[pdrv] == 0)
- 8003d12: 79fb ldrb r3, [r7, #7]
- 8003d14: 4a0d ldr r2, [pc, #52] ; (8003d4c <disk_initialize+0x48>)
- 8003d16: 5cd3 ldrb r3, [r2, r3]
- 8003d18: 2b00 cmp r3, #0
- 8003d1a: d111 bne.n 8003d40 <disk_initialize+0x3c>
- {
- disk.is_initialized[pdrv] = 1;
- 8003d1c: 79fb ldrb r3, [r7, #7]
- 8003d1e: 4a0b ldr r2, [pc, #44] ; (8003d4c <disk_initialize+0x48>)
- 8003d20: 2101 movs r1, #1
- 8003d22: 54d1 strb r1, [r2, r3]
- stat = disk.drv[pdrv]->disk_initialize(disk.lun[pdrv]);
- 8003d24: 79fb ldrb r3, [r7, #7]
- 8003d26: 4a09 ldr r2, [pc, #36] ; (8003d4c <disk_initialize+0x48>)
- 8003d28: 009b lsls r3, r3, #2
- 8003d2a: 4413 add r3, r2
- 8003d2c: 685b ldr r3, [r3, #4]
- 8003d2e: 681b ldr r3, [r3, #0]
- 8003d30: 79fa ldrb r2, [r7, #7]
- 8003d32: 4906 ldr r1, [pc, #24] ; (8003d4c <disk_initialize+0x48>)
- 8003d34: 440a add r2, r1
- 8003d36: 7a12 ldrb r2, [r2, #8]
- 8003d38: 4610 mov r0, r2
- 8003d3a: 4798 blx r3
- 8003d3c: 4603 mov r3, r0
- 8003d3e: 73fb strb r3, [r7, #15]
- }
- return stat;
- 8003d40: 7bfb ldrb r3, [r7, #15]
- }
- 8003d42: 4618 mov r0, r3
- 8003d44: 3710 adds r7, #16
- 8003d46: 46bd mov sp, r7
- 8003d48: bd80 pop {r7, pc}
- 8003d4a: bf00 nop
- 8003d4c: 200002d4 .word 0x200002d4
-
- 08003d50 <disk_read>:
- BYTE pdrv, /* Physical drive nmuber to identify the drive */
- BYTE *buff, /* Data buffer to store read data */
- DWORD sector, /* Sector address in LBA */
- UINT count /* Number of sectors to read */
- )
- {
- 8003d50: b590 push {r4, r7, lr}
- 8003d52: b087 sub sp, #28
- 8003d54: af00 add r7, sp, #0
- 8003d56: 60b9 str r1, [r7, #8]
- 8003d58: 607a str r2, [r7, #4]
- 8003d5a: 603b str r3, [r7, #0]
- 8003d5c: 4603 mov r3, r0
- 8003d5e: 73fb strb r3, [r7, #15]
- DRESULT res;
-
- res = disk.drv[pdrv]->disk_read(disk.lun[pdrv], buff, sector, count);
- 8003d60: 7bfb ldrb r3, [r7, #15]
- 8003d62: 4a0a ldr r2, [pc, #40] ; (8003d8c <disk_read+0x3c>)
- 8003d64: 009b lsls r3, r3, #2
- 8003d66: 4413 add r3, r2
- 8003d68: 685b ldr r3, [r3, #4]
- 8003d6a: 689c ldr r4, [r3, #8]
- 8003d6c: 7bfb ldrb r3, [r7, #15]
- 8003d6e: 4a07 ldr r2, [pc, #28] ; (8003d8c <disk_read+0x3c>)
- 8003d70: 4413 add r3, r2
- 8003d72: 7a18 ldrb r0, [r3, #8]
- 8003d74: 683b ldr r3, [r7, #0]
- 8003d76: 687a ldr r2, [r7, #4]
- 8003d78: 68b9 ldr r1, [r7, #8]
- 8003d7a: 47a0 blx r4
- 8003d7c: 4603 mov r3, r0
- 8003d7e: 75fb strb r3, [r7, #23]
- return res;
- 8003d80: 7dfb ldrb r3, [r7, #23]
- }
- 8003d82: 4618 mov r0, r3
- 8003d84: 371c adds r7, #28
- 8003d86: 46bd mov sp, r7
- 8003d88: bd90 pop {r4, r7, pc}
- 8003d8a: bf00 nop
- 8003d8c: 200002d4 .word 0x200002d4
-
- 08003d90 <disk_write>:
- BYTE pdrv, /* Physical drive nmuber to identify the drive */
- const BYTE *buff, /* Data to be written */
- DWORD sector, /* Sector address in LBA */
- UINT count /* Number of sectors to write */
- )
- {
- 8003d90: b590 push {r4, r7, lr}
- 8003d92: b087 sub sp, #28
- 8003d94: af00 add r7, sp, #0
- 8003d96: 60b9 str r1, [r7, #8]
- 8003d98: 607a str r2, [r7, #4]
- 8003d9a: 603b str r3, [r7, #0]
- 8003d9c: 4603 mov r3, r0
- 8003d9e: 73fb strb r3, [r7, #15]
- DRESULT res;
-
- res = disk.drv[pdrv]->disk_write(disk.lun[pdrv], buff, sector, count);
- 8003da0: 7bfb ldrb r3, [r7, #15]
- 8003da2: 4a0a ldr r2, [pc, #40] ; (8003dcc <disk_write+0x3c>)
- 8003da4: 009b lsls r3, r3, #2
- 8003da6: 4413 add r3, r2
- 8003da8: 685b ldr r3, [r3, #4]
- 8003daa: 68dc ldr r4, [r3, #12]
- 8003dac: 7bfb ldrb r3, [r7, #15]
- 8003dae: 4a07 ldr r2, [pc, #28] ; (8003dcc <disk_write+0x3c>)
- 8003db0: 4413 add r3, r2
- 8003db2: 7a18 ldrb r0, [r3, #8]
- 8003db4: 683b ldr r3, [r7, #0]
- 8003db6: 687a ldr r2, [r7, #4]
- 8003db8: 68b9 ldr r1, [r7, #8]
- 8003dba: 47a0 blx r4
- 8003dbc: 4603 mov r3, r0
- 8003dbe: 75fb strb r3, [r7, #23]
- return res;
- 8003dc0: 7dfb ldrb r3, [r7, #23]
- }
- 8003dc2: 4618 mov r0, r3
- 8003dc4: 371c adds r7, #28
- 8003dc6: 46bd mov sp, r7
- 8003dc8: bd90 pop {r4, r7, pc}
- 8003dca: bf00 nop
- 8003dcc: 200002d4 .word 0x200002d4
-
- 08003dd0 <disk_ioctl>:
- DRESULT disk_ioctl (
- BYTE pdrv, /* Physical drive nmuber (0..) */
- BYTE cmd, /* Control code */
- void *buff /* Buffer to send/receive control data */
- )
- {
- 8003dd0: b580 push {r7, lr}
- 8003dd2: b084 sub sp, #16
- 8003dd4: af00 add r7, sp, #0
- 8003dd6: 4603 mov r3, r0
- 8003dd8: 603a str r2, [r7, #0]
- 8003dda: 71fb strb r3, [r7, #7]
- 8003ddc: 460b mov r3, r1
- 8003dde: 71bb strb r3, [r7, #6]
- DRESULT res;
-
- res = disk.drv[pdrv]->disk_ioctl(disk.lun[pdrv], cmd, buff);
- 8003de0: 79fb ldrb r3, [r7, #7]
- 8003de2: 4a09 ldr r2, [pc, #36] ; (8003e08 <disk_ioctl+0x38>)
- 8003de4: 009b lsls r3, r3, #2
- 8003de6: 4413 add r3, r2
- 8003de8: 685b ldr r3, [r3, #4]
- 8003dea: 691b ldr r3, [r3, #16]
- 8003dec: 79fa ldrb r2, [r7, #7]
- 8003dee: 4906 ldr r1, [pc, #24] ; (8003e08 <disk_ioctl+0x38>)
- 8003df0: 440a add r2, r1
- 8003df2: 7a10 ldrb r0, [r2, #8]
- 8003df4: 79b9 ldrb r1, [r7, #6]
- 8003df6: 683a ldr r2, [r7, #0]
- 8003df8: 4798 blx r3
- 8003dfa: 4603 mov r3, r0
- 8003dfc: 73fb strb r3, [r7, #15]
- return res;
- 8003dfe: 7bfb ldrb r3, [r7, #15]
- }
- 8003e00: 4618 mov r0, r3
- 8003e02: 3710 adds r7, #16
- 8003e04: 46bd mov sp, r7
- 8003e06: bd80 pop {r7, pc}
- 8003e08: 200002d4 .word 0x200002d4
-
- 08003e0c <ld_word>:
- /* Load/Store multi-byte word in the FAT structure */
- /*-----------------------------------------------------------------------*/
-
- static
- WORD ld_word (const BYTE* ptr) /* Load a 2-byte little-endian word */
- {
- 8003e0c: b480 push {r7}
- 8003e0e: b085 sub sp, #20
- 8003e10: af00 add r7, sp, #0
- 8003e12: 6078 str r0, [r7, #4]
- WORD rv;
-
- rv = ptr[1];
- 8003e14: 687b ldr r3, [r7, #4]
- 8003e16: 3301 adds r3, #1
- 8003e18: 781b ldrb r3, [r3, #0]
- 8003e1a: 81fb strh r3, [r7, #14]
- rv = rv << 8 | ptr[0];
- 8003e1c: 89fb ldrh r3, [r7, #14]
- 8003e1e: 021b lsls r3, r3, #8
- 8003e20: b21a sxth r2, r3
- 8003e22: 687b ldr r3, [r7, #4]
- 8003e24: 781b ldrb r3, [r3, #0]
- 8003e26: b21b sxth r3, r3
- 8003e28: 4313 orrs r3, r2
- 8003e2a: b21b sxth r3, r3
- 8003e2c: 81fb strh r3, [r7, #14]
- return rv;
- 8003e2e: 89fb ldrh r3, [r7, #14]
- }
- 8003e30: 4618 mov r0, r3
- 8003e32: 3714 adds r7, #20
- 8003e34: 46bd mov sp, r7
- 8003e36: bc80 pop {r7}
- 8003e38: 4770 bx lr
-
- 08003e3a <ld_dword>:
-
- static
- DWORD ld_dword (const BYTE* ptr) /* Load a 4-byte little-endian word */
- {
- 8003e3a: b480 push {r7}
- 8003e3c: b085 sub sp, #20
- 8003e3e: af00 add r7, sp, #0
- 8003e40: 6078 str r0, [r7, #4]
- DWORD rv;
-
- rv = ptr[3];
- 8003e42: 687b ldr r3, [r7, #4]
- 8003e44: 3303 adds r3, #3
- 8003e46: 781b ldrb r3, [r3, #0]
- 8003e48: 60fb str r3, [r7, #12]
- rv = rv << 8 | ptr[2];
- 8003e4a: 68fb ldr r3, [r7, #12]
- 8003e4c: 021b lsls r3, r3, #8
- 8003e4e: 687a ldr r2, [r7, #4]
- 8003e50: 3202 adds r2, #2
- 8003e52: 7812 ldrb r2, [r2, #0]
- 8003e54: 4313 orrs r3, r2
- 8003e56: 60fb str r3, [r7, #12]
- rv = rv << 8 | ptr[1];
- 8003e58: 68fb ldr r3, [r7, #12]
- 8003e5a: 021b lsls r3, r3, #8
- 8003e5c: 687a ldr r2, [r7, #4]
- 8003e5e: 3201 adds r2, #1
- 8003e60: 7812 ldrb r2, [r2, #0]
- 8003e62: 4313 orrs r3, r2
- 8003e64: 60fb str r3, [r7, #12]
- rv = rv << 8 | ptr[0];
- 8003e66: 68fb ldr r3, [r7, #12]
- 8003e68: 021b lsls r3, r3, #8
- 8003e6a: 687a ldr r2, [r7, #4]
- 8003e6c: 7812 ldrb r2, [r2, #0]
- 8003e6e: 4313 orrs r3, r2
- 8003e70: 60fb str r3, [r7, #12]
- return rv;
- 8003e72: 68fb ldr r3, [r7, #12]
- }
- 8003e74: 4618 mov r0, r3
- 8003e76: 3714 adds r7, #20
- 8003e78: 46bd mov sp, r7
- 8003e7a: bc80 pop {r7}
- 8003e7c: 4770 bx lr
-
- 08003e7e <st_word>:
- #endif
-
- #if !_FS_READONLY
- static
- void st_word (BYTE* ptr, WORD val) /* Store a 2-byte word in little-endian */
- {
- 8003e7e: b480 push {r7}
- 8003e80: b083 sub sp, #12
- 8003e82: af00 add r7, sp, #0
- 8003e84: 6078 str r0, [r7, #4]
- 8003e86: 460b mov r3, r1
- 8003e88: 807b strh r3, [r7, #2]
- *ptr++ = (BYTE)val; val >>= 8;
- 8003e8a: 687b ldr r3, [r7, #4]
- 8003e8c: 1c5a adds r2, r3, #1
- 8003e8e: 607a str r2, [r7, #4]
- 8003e90: 887a ldrh r2, [r7, #2]
- 8003e92: b2d2 uxtb r2, r2
- 8003e94: 701a strb r2, [r3, #0]
- 8003e96: 887b ldrh r3, [r7, #2]
- 8003e98: 0a1b lsrs r3, r3, #8
- 8003e9a: 807b strh r3, [r7, #2]
- *ptr++ = (BYTE)val;
- 8003e9c: 687b ldr r3, [r7, #4]
- 8003e9e: 1c5a adds r2, r3, #1
- 8003ea0: 607a str r2, [r7, #4]
- 8003ea2: 887a ldrh r2, [r7, #2]
- 8003ea4: b2d2 uxtb r2, r2
- 8003ea6: 701a strb r2, [r3, #0]
- }
- 8003ea8: bf00 nop
- 8003eaa: 370c adds r7, #12
- 8003eac: 46bd mov sp, r7
- 8003eae: bc80 pop {r7}
- 8003eb0: 4770 bx lr
-
- 08003eb2 <st_dword>:
-
- static
- void st_dword (BYTE* ptr, DWORD val) /* Store a 4-byte word in little-endian */
- {
- 8003eb2: b480 push {r7}
- 8003eb4: b083 sub sp, #12
- 8003eb6: af00 add r7, sp, #0
- 8003eb8: 6078 str r0, [r7, #4]
- 8003eba: 6039 str r1, [r7, #0]
- *ptr++ = (BYTE)val; val >>= 8;
- 8003ebc: 687b ldr r3, [r7, #4]
- 8003ebe: 1c5a adds r2, r3, #1
- 8003ec0: 607a str r2, [r7, #4]
- 8003ec2: 683a ldr r2, [r7, #0]
- 8003ec4: b2d2 uxtb r2, r2
- 8003ec6: 701a strb r2, [r3, #0]
- 8003ec8: 683b ldr r3, [r7, #0]
- 8003eca: 0a1b lsrs r3, r3, #8
- 8003ecc: 603b str r3, [r7, #0]
- *ptr++ = (BYTE)val; val >>= 8;
- 8003ece: 687b ldr r3, [r7, #4]
- 8003ed0: 1c5a adds r2, r3, #1
- 8003ed2: 607a str r2, [r7, #4]
- 8003ed4: 683a ldr r2, [r7, #0]
- 8003ed6: b2d2 uxtb r2, r2
- 8003ed8: 701a strb r2, [r3, #0]
- 8003eda: 683b ldr r3, [r7, #0]
- 8003edc: 0a1b lsrs r3, r3, #8
- 8003ede: 603b str r3, [r7, #0]
- *ptr++ = (BYTE)val; val >>= 8;
- 8003ee0: 687b ldr r3, [r7, #4]
- 8003ee2: 1c5a adds r2, r3, #1
- 8003ee4: 607a str r2, [r7, #4]
- 8003ee6: 683a ldr r2, [r7, #0]
- 8003ee8: b2d2 uxtb r2, r2
- 8003eea: 701a strb r2, [r3, #0]
- 8003eec: 683b ldr r3, [r7, #0]
- 8003eee: 0a1b lsrs r3, r3, #8
- 8003ef0: 603b str r3, [r7, #0]
- *ptr++ = (BYTE)val;
- 8003ef2: 687b ldr r3, [r7, #4]
- 8003ef4: 1c5a adds r2, r3, #1
- 8003ef6: 607a str r2, [r7, #4]
- 8003ef8: 683a ldr r2, [r7, #0]
- 8003efa: b2d2 uxtb r2, r2
- 8003efc: 701a strb r2, [r3, #0]
- }
- 8003efe: bf00 nop
- 8003f00: 370c adds r7, #12
- 8003f02: 46bd mov sp, r7
- 8003f04: bc80 pop {r7}
- 8003f06: 4770 bx lr
-
- 08003f08 <mem_cpy>:
- /* String functions */
- /*-----------------------------------------------------------------------*/
-
- /* Copy memory to memory */
- static
- void mem_cpy (void* dst, const void* src, UINT cnt) {
- 8003f08: b480 push {r7}
- 8003f0a: b087 sub sp, #28
- 8003f0c: af00 add r7, sp, #0
- 8003f0e: 60f8 str r0, [r7, #12]
- 8003f10: 60b9 str r1, [r7, #8]
- 8003f12: 607a str r2, [r7, #4]
- BYTE *d = (BYTE*)dst;
- 8003f14: 68fb ldr r3, [r7, #12]
- 8003f16: 617b str r3, [r7, #20]
- const BYTE *s = (const BYTE*)src;
- 8003f18: 68bb ldr r3, [r7, #8]
- 8003f1a: 613b str r3, [r7, #16]
-
- if (cnt) {
- 8003f1c: 687b ldr r3, [r7, #4]
- 8003f1e: 2b00 cmp r3, #0
- 8003f20: d00d beq.n 8003f3e <mem_cpy+0x36>
- do {
- *d++ = *s++;
- 8003f22: 693a ldr r2, [r7, #16]
- 8003f24: 1c53 adds r3, r2, #1
- 8003f26: 613b str r3, [r7, #16]
- 8003f28: 697b ldr r3, [r7, #20]
- 8003f2a: 1c59 adds r1, r3, #1
- 8003f2c: 6179 str r1, [r7, #20]
- 8003f2e: 7812 ldrb r2, [r2, #0]
- 8003f30: 701a strb r2, [r3, #0]
- } while (--cnt);
- 8003f32: 687b ldr r3, [r7, #4]
- 8003f34: 3b01 subs r3, #1
- 8003f36: 607b str r3, [r7, #4]
- 8003f38: 687b ldr r3, [r7, #4]
- 8003f3a: 2b00 cmp r3, #0
- 8003f3c: d1f1 bne.n 8003f22 <mem_cpy+0x1a>
- }
- }
- 8003f3e: bf00 nop
- 8003f40: 371c adds r7, #28
- 8003f42: 46bd mov sp, r7
- 8003f44: bc80 pop {r7}
- 8003f46: 4770 bx lr
-
- 08003f48 <mem_set>:
-
- /* Fill memory block */
- static
- void mem_set (void* dst, int val, UINT cnt) {
- 8003f48: b480 push {r7}
- 8003f4a: b087 sub sp, #28
- 8003f4c: af00 add r7, sp, #0
- 8003f4e: 60f8 str r0, [r7, #12]
- 8003f50: 60b9 str r1, [r7, #8]
- 8003f52: 607a str r2, [r7, #4]
- BYTE *d = (BYTE*)dst;
- 8003f54: 68fb ldr r3, [r7, #12]
- 8003f56: 617b str r3, [r7, #20]
-
- do {
- *d++ = (BYTE)val;
- 8003f58: 697b ldr r3, [r7, #20]
- 8003f5a: 1c5a adds r2, r3, #1
- 8003f5c: 617a str r2, [r7, #20]
- 8003f5e: 68ba ldr r2, [r7, #8]
- 8003f60: b2d2 uxtb r2, r2
- 8003f62: 701a strb r2, [r3, #0]
- } while (--cnt);
- 8003f64: 687b ldr r3, [r7, #4]
- 8003f66: 3b01 subs r3, #1
- 8003f68: 607b str r3, [r7, #4]
- 8003f6a: 687b ldr r3, [r7, #4]
- 8003f6c: 2b00 cmp r3, #0
- 8003f6e: d1f3 bne.n 8003f58 <mem_set+0x10>
- }
- 8003f70: bf00 nop
- 8003f72: 371c adds r7, #28
- 8003f74: 46bd mov sp, r7
- 8003f76: bc80 pop {r7}
- 8003f78: 4770 bx lr
-
- 08003f7a <mem_cmp>:
-
- /* Compare memory block */
- static
- int mem_cmp (const void* dst, const void* src, UINT cnt) { /* ZR:same, NZ:different */
- 8003f7a: b480 push {r7}
- 8003f7c: b089 sub sp, #36 ; 0x24
- 8003f7e: af00 add r7, sp, #0
- 8003f80: 60f8 str r0, [r7, #12]
- 8003f82: 60b9 str r1, [r7, #8]
- 8003f84: 607a str r2, [r7, #4]
- const BYTE *d = (const BYTE *)dst, *s = (const BYTE *)src;
- 8003f86: 68fb ldr r3, [r7, #12]
- 8003f88: 61fb str r3, [r7, #28]
- 8003f8a: 68bb ldr r3, [r7, #8]
- 8003f8c: 61bb str r3, [r7, #24]
- int r = 0;
- 8003f8e: 2300 movs r3, #0
- 8003f90: 617b str r3, [r7, #20]
-
- do {
- r = *d++ - *s++;
- 8003f92: 69fb ldr r3, [r7, #28]
- 8003f94: 1c5a adds r2, r3, #1
- 8003f96: 61fa str r2, [r7, #28]
- 8003f98: 781b ldrb r3, [r3, #0]
- 8003f9a: 4619 mov r1, r3
- 8003f9c: 69bb ldr r3, [r7, #24]
- 8003f9e: 1c5a adds r2, r3, #1
- 8003fa0: 61ba str r2, [r7, #24]
- 8003fa2: 781b ldrb r3, [r3, #0]
- 8003fa4: 1acb subs r3, r1, r3
- 8003fa6: 617b str r3, [r7, #20]
- } while (--cnt && r == 0);
- 8003fa8: 687b ldr r3, [r7, #4]
- 8003faa: 3b01 subs r3, #1
- 8003fac: 607b str r3, [r7, #4]
- 8003fae: 687b ldr r3, [r7, #4]
- 8003fb0: 2b00 cmp r3, #0
- 8003fb2: d002 beq.n 8003fba <mem_cmp+0x40>
- 8003fb4: 697b ldr r3, [r7, #20]
- 8003fb6: 2b00 cmp r3, #0
- 8003fb8: d0eb beq.n 8003f92 <mem_cmp+0x18>
-
- return r;
- 8003fba: 697b ldr r3, [r7, #20]
- }
- 8003fbc: 4618 mov r0, r3
- 8003fbe: 3724 adds r7, #36 ; 0x24
- 8003fc0: 46bd mov sp, r7
- 8003fc2: bc80 pop {r7}
- 8003fc4: 4770 bx lr
-
- 08003fc6 <chk_chr>:
-
- /* Check if chr is contained in the string */
- static
- int chk_chr (const char* str, int chr) { /* NZ:contained, ZR:not contained */
- 8003fc6: b480 push {r7}
- 8003fc8: b083 sub sp, #12
- 8003fca: af00 add r7, sp, #0
- 8003fcc: 6078 str r0, [r7, #4]
- 8003fce: 6039 str r1, [r7, #0]
- while (*str && *str != chr) str++;
- 8003fd0: e002 b.n 8003fd8 <chk_chr+0x12>
- 8003fd2: 687b ldr r3, [r7, #4]
- 8003fd4: 3301 adds r3, #1
- 8003fd6: 607b str r3, [r7, #4]
- 8003fd8: 687b ldr r3, [r7, #4]
- 8003fda: 781b ldrb r3, [r3, #0]
- 8003fdc: 2b00 cmp r3, #0
- 8003fde: d005 beq.n 8003fec <chk_chr+0x26>
- 8003fe0: 687b ldr r3, [r7, #4]
- 8003fe2: 781b ldrb r3, [r3, #0]
- 8003fe4: 461a mov r2, r3
- 8003fe6: 683b ldr r3, [r7, #0]
- 8003fe8: 4293 cmp r3, r2
- 8003fea: d1f2 bne.n 8003fd2 <chk_chr+0xc>
- return *str;
- 8003fec: 687b ldr r3, [r7, #4]
- 8003fee: 781b ldrb r3, [r3, #0]
- }
- 8003ff0: 4618 mov r0, r3
- 8003ff2: 370c adds r7, #12
- 8003ff4: 46bd mov sp, r7
- 8003ff6: bc80 pop {r7}
- 8003ff8: 4770 bx lr
- ...
-
- 08003ffc <chk_lock>:
- static
- FRESULT chk_lock ( /* Check if the file can be accessed */
- DIR* dp, /* Directory object pointing the file to be checked */
- int acc /* Desired access type (0:Read, 1:Write, 2:Delete/Rename) */
- )
- {
- 8003ffc: b480 push {r7}
- 8003ffe: b085 sub sp, #20
- 8004000: af00 add r7, sp, #0
- 8004002: 6078 str r0, [r7, #4]
- 8004004: 6039 str r1, [r7, #0]
- UINT i, be;
-
- /* Search file semaphore table */
- for (i = be = 0; i < _FS_LOCK; i++) {
- 8004006: 2300 movs r3, #0
- 8004008: 60bb str r3, [r7, #8]
- 800400a: 68bb ldr r3, [r7, #8]
- 800400c: 60fb str r3, [r7, #12]
- 800400e: e029 b.n 8004064 <chk_lock+0x68>
- if (Files[i].fs) { /* Existing entry */
- 8004010: 4a26 ldr r2, [pc, #152] ; (80040ac <chk_lock+0xb0>)
- 8004012: 68fb ldr r3, [r7, #12]
- 8004014: 011b lsls r3, r3, #4
- 8004016: 4413 add r3, r2
- 8004018: 681b ldr r3, [r3, #0]
- 800401a: 2b00 cmp r3, #0
- 800401c: d01d beq.n 800405a <chk_lock+0x5e>
- if (Files[i].fs == dp->obj.fs && /* Check if the object matched with an open object */
- 800401e: 4a23 ldr r2, [pc, #140] ; (80040ac <chk_lock+0xb0>)
- 8004020: 68fb ldr r3, [r7, #12]
- 8004022: 011b lsls r3, r3, #4
- 8004024: 4413 add r3, r2
- 8004026: 681a ldr r2, [r3, #0]
- 8004028: 687b ldr r3, [r7, #4]
- 800402a: 681b ldr r3, [r3, #0]
- 800402c: 429a cmp r2, r3
- 800402e: d116 bne.n 800405e <chk_lock+0x62>
- Files[i].clu == dp->obj.sclust &&
- 8004030: 4a1e ldr r2, [pc, #120] ; (80040ac <chk_lock+0xb0>)
- 8004032: 68fb ldr r3, [r7, #12]
- 8004034: 011b lsls r3, r3, #4
- 8004036: 4413 add r3, r2
- 8004038: 3304 adds r3, #4
- 800403a: 681a ldr r2, [r3, #0]
- 800403c: 687b ldr r3, [r7, #4]
- 800403e: 689b ldr r3, [r3, #8]
- if (Files[i].fs == dp->obj.fs && /* Check if the object matched with an open object */
- 8004040: 429a cmp r2, r3
- 8004042: d10c bne.n 800405e <chk_lock+0x62>
- Files[i].ofs == dp->dptr) break;
- 8004044: 4a19 ldr r2, [pc, #100] ; (80040ac <chk_lock+0xb0>)
- 8004046: 68fb ldr r3, [r7, #12]
- 8004048: 011b lsls r3, r3, #4
- 800404a: 4413 add r3, r2
- 800404c: 3308 adds r3, #8
- 800404e: 681a ldr r2, [r3, #0]
- 8004050: 687b ldr r3, [r7, #4]
- 8004052: 695b ldr r3, [r3, #20]
- Files[i].clu == dp->obj.sclust &&
- 8004054: 429a cmp r2, r3
- 8004056: d102 bne.n 800405e <chk_lock+0x62>
- Files[i].ofs == dp->dptr) break;
- 8004058: e007 b.n 800406a <chk_lock+0x6e>
- } else { /* Blank entry */
- be = 1;
- 800405a: 2301 movs r3, #1
- 800405c: 60bb str r3, [r7, #8]
- for (i = be = 0; i < _FS_LOCK; i++) {
- 800405e: 68fb ldr r3, [r7, #12]
- 8004060: 3301 adds r3, #1
- 8004062: 60fb str r3, [r7, #12]
- 8004064: 68fb ldr r3, [r7, #12]
- 8004066: 2b01 cmp r3, #1
- 8004068: d9d2 bls.n 8004010 <chk_lock+0x14>
- }
- }
- if (i == _FS_LOCK) { /* The object is not opened */
- 800406a: 68fb ldr r3, [r7, #12]
- 800406c: 2b02 cmp r3, #2
- 800406e: d109 bne.n 8004084 <chk_lock+0x88>
- return (be || acc == 2) ? FR_OK : FR_TOO_MANY_OPEN_FILES; /* Is there a blank entry for new object? */
- 8004070: 68bb ldr r3, [r7, #8]
- 8004072: 2b00 cmp r3, #0
- 8004074: d102 bne.n 800407c <chk_lock+0x80>
- 8004076: 683b ldr r3, [r7, #0]
- 8004078: 2b02 cmp r3, #2
- 800407a: d101 bne.n 8004080 <chk_lock+0x84>
- 800407c: 2300 movs r3, #0
- 800407e: e010 b.n 80040a2 <chk_lock+0xa6>
- 8004080: 2312 movs r3, #18
- 8004082: e00e b.n 80040a2 <chk_lock+0xa6>
- }
-
- /* The object has been opened. Reject any open against writing file and all write mode open */
- return (acc || Files[i].ctr == 0x100) ? FR_LOCKED : FR_OK;
- 8004084: 683b ldr r3, [r7, #0]
- 8004086: 2b00 cmp r3, #0
- 8004088: d108 bne.n 800409c <chk_lock+0xa0>
- 800408a: 4a08 ldr r2, [pc, #32] ; (80040ac <chk_lock+0xb0>)
- 800408c: 68fb ldr r3, [r7, #12]
- 800408e: 011b lsls r3, r3, #4
- 8004090: 4413 add r3, r2
- 8004092: 330c adds r3, #12
- 8004094: 881b ldrh r3, [r3, #0]
- 8004096: f5b3 7f80 cmp.w r3, #256 ; 0x100
- 800409a: d101 bne.n 80040a0 <chk_lock+0xa4>
- 800409c: 2310 movs r3, #16
- 800409e: e000 b.n 80040a2 <chk_lock+0xa6>
- 80040a0: 2300 movs r3, #0
- }
- 80040a2: 4618 mov r0, r3
- 80040a4: 3714 adds r7, #20
- 80040a6: 46bd mov sp, r7
- 80040a8: bc80 pop {r7}
- 80040aa: 4770 bx lr
- 80040ac: 200000b4 .word 0x200000b4
-
- 080040b0 <enq_lock>:
-
-
- static
- int enq_lock (void) /* Check if an entry is available for a new object */
- {
- 80040b0: b480 push {r7}
- 80040b2: b083 sub sp, #12
- 80040b4: af00 add r7, sp, #0
- UINT i;
-
- for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
- 80040b6: 2300 movs r3, #0
- 80040b8: 607b str r3, [r7, #4]
- 80040ba: e002 b.n 80040c2 <enq_lock+0x12>
- 80040bc: 687b ldr r3, [r7, #4]
- 80040be: 3301 adds r3, #1
- 80040c0: 607b str r3, [r7, #4]
- 80040c2: 687b ldr r3, [r7, #4]
- 80040c4: 2b01 cmp r3, #1
- 80040c6: d806 bhi.n 80040d6 <enq_lock+0x26>
- 80040c8: 4a08 ldr r2, [pc, #32] ; (80040ec <enq_lock+0x3c>)
- 80040ca: 687b ldr r3, [r7, #4]
- 80040cc: 011b lsls r3, r3, #4
- 80040ce: 4413 add r3, r2
- 80040d0: 681b ldr r3, [r3, #0]
- 80040d2: 2b00 cmp r3, #0
- 80040d4: d1f2 bne.n 80040bc <enq_lock+0xc>
- return (i == _FS_LOCK) ? 0 : 1;
- 80040d6: 687b ldr r3, [r7, #4]
- 80040d8: 2b02 cmp r3, #2
- 80040da: bf14 ite ne
- 80040dc: 2301 movne r3, #1
- 80040de: 2300 moveq r3, #0
- 80040e0: b2db uxtb r3, r3
- }
- 80040e2: 4618 mov r0, r3
- 80040e4: 370c adds r7, #12
- 80040e6: 46bd mov sp, r7
- 80040e8: bc80 pop {r7}
- 80040ea: 4770 bx lr
- 80040ec: 200000b4 .word 0x200000b4
-
- 080040f0 <inc_lock>:
- static
- UINT inc_lock ( /* Increment object open counter and returns its index (0:Internal error) */
- DIR* dp, /* Directory object pointing the file to register or increment */
- int acc /* Desired access (0:Read, 1:Write, 2:Delete/Rename) */
- )
- {
- 80040f0: b480 push {r7}
- 80040f2: b085 sub sp, #20
- 80040f4: af00 add r7, sp, #0
- 80040f6: 6078 str r0, [r7, #4]
- 80040f8: 6039 str r1, [r7, #0]
- UINT i;
-
-
- for (i = 0; i < _FS_LOCK; i++) { /* Find the object */
- 80040fa: 2300 movs r3, #0
- 80040fc: 60fb str r3, [r7, #12]
- 80040fe: e01f b.n 8004140 <inc_lock+0x50>
- if (Files[i].fs == dp->obj.fs &&
- 8004100: 4a41 ldr r2, [pc, #260] ; (8004208 <inc_lock+0x118>)
- 8004102: 68fb ldr r3, [r7, #12]
- 8004104: 011b lsls r3, r3, #4
- 8004106: 4413 add r3, r2
- 8004108: 681a ldr r2, [r3, #0]
- 800410a: 687b ldr r3, [r7, #4]
- 800410c: 681b ldr r3, [r3, #0]
- 800410e: 429a cmp r2, r3
- 8004110: d113 bne.n 800413a <inc_lock+0x4a>
- Files[i].clu == dp->obj.sclust &&
- 8004112: 4a3d ldr r2, [pc, #244] ; (8004208 <inc_lock+0x118>)
- 8004114: 68fb ldr r3, [r7, #12]
- 8004116: 011b lsls r3, r3, #4
- 8004118: 4413 add r3, r2
- 800411a: 3304 adds r3, #4
- 800411c: 681a ldr r2, [r3, #0]
- 800411e: 687b ldr r3, [r7, #4]
- 8004120: 689b ldr r3, [r3, #8]
- if (Files[i].fs == dp->obj.fs &&
- 8004122: 429a cmp r2, r3
- 8004124: d109 bne.n 800413a <inc_lock+0x4a>
- Files[i].ofs == dp->dptr) break;
- 8004126: 4a38 ldr r2, [pc, #224] ; (8004208 <inc_lock+0x118>)
- 8004128: 68fb ldr r3, [r7, #12]
- 800412a: 011b lsls r3, r3, #4
- 800412c: 4413 add r3, r2
- 800412e: 3308 adds r3, #8
- 8004130: 681a ldr r2, [r3, #0]
- 8004132: 687b ldr r3, [r7, #4]
- 8004134: 695b ldr r3, [r3, #20]
- Files[i].clu == dp->obj.sclust &&
- 8004136: 429a cmp r2, r3
- 8004138: d006 beq.n 8004148 <inc_lock+0x58>
- for (i = 0; i < _FS_LOCK; i++) { /* Find the object */
- 800413a: 68fb ldr r3, [r7, #12]
- 800413c: 3301 adds r3, #1
- 800413e: 60fb str r3, [r7, #12]
- 8004140: 68fb ldr r3, [r7, #12]
- 8004142: 2b01 cmp r3, #1
- 8004144: d9dc bls.n 8004100 <inc_lock+0x10>
- 8004146: e000 b.n 800414a <inc_lock+0x5a>
- Files[i].ofs == dp->dptr) break;
- 8004148: bf00 nop
- }
-
- if (i == _FS_LOCK) { /* Not opened. Register it as new. */
- 800414a: 68fb ldr r3, [r7, #12]
- 800414c: 2b02 cmp r3, #2
- 800414e: d132 bne.n 80041b6 <inc_lock+0xc6>
- for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
- 8004150: 2300 movs r3, #0
- 8004152: 60fb str r3, [r7, #12]
- 8004154: e002 b.n 800415c <inc_lock+0x6c>
- 8004156: 68fb ldr r3, [r7, #12]
- 8004158: 3301 adds r3, #1
- 800415a: 60fb str r3, [r7, #12]
- 800415c: 68fb ldr r3, [r7, #12]
- 800415e: 2b01 cmp r3, #1
- 8004160: d806 bhi.n 8004170 <inc_lock+0x80>
- 8004162: 4a29 ldr r2, [pc, #164] ; (8004208 <inc_lock+0x118>)
- 8004164: 68fb ldr r3, [r7, #12]
- 8004166: 011b lsls r3, r3, #4
- 8004168: 4413 add r3, r2
- 800416a: 681b ldr r3, [r3, #0]
- 800416c: 2b00 cmp r3, #0
- 800416e: d1f2 bne.n 8004156 <inc_lock+0x66>
- if (i == _FS_LOCK) return 0; /* No free entry to register (int err) */
- 8004170: 68fb ldr r3, [r7, #12]
- 8004172: 2b02 cmp r3, #2
- 8004174: d101 bne.n 800417a <inc_lock+0x8a>
- 8004176: 2300 movs r3, #0
- 8004178: e040 b.n 80041fc <inc_lock+0x10c>
- Files[i].fs = dp->obj.fs;
- 800417a: 687b ldr r3, [r7, #4]
- 800417c: 681a ldr r2, [r3, #0]
- 800417e: 4922 ldr r1, [pc, #136] ; (8004208 <inc_lock+0x118>)
- 8004180: 68fb ldr r3, [r7, #12]
- 8004182: 011b lsls r3, r3, #4
- 8004184: 440b add r3, r1
- 8004186: 601a str r2, [r3, #0]
- Files[i].clu = dp->obj.sclust;
- 8004188: 687b ldr r3, [r7, #4]
- 800418a: 689a ldr r2, [r3, #8]
- 800418c: 491e ldr r1, [pc, #120] ; (8004208 <inc_lock+0x118>)
- 800418e: 68fb ldr r3, [r7, #12]
- 8004190: 011b lsls r3, r3, #4
- 8004192: 440b add r3, r1
- 8004194: 3304 adds r3, #4
- 8004196: 601a str r2, [r3, #0]
- Files[i].ofs = dp->dptr;
- 8004198: 687b ldr r3, [r7, #4]
- 800419a: 695a ldr r2, [r3, #20]
- 800419c: 491a ldr r1, [pc, #104] ; (8004208 <inc_lock+0x118>)
- 800419e: 68fb ldr r3, [r7, #12]
- 80041a0: 011b lsls r3, r3, #4
- 80041a2: 440b add r3, r1
- 80041a4: 3308 adds r3, #8
- 80041a6: 601a str r2, [r3, #0]
- Files[i].ctr = 0;
- 80041a8: 4a17 ldr r2, [pc, #92] ; (8004208 <inc_lock+0x118>)
- 80041aa: 68fb ldr r3, [r7, #12]
- 80041ac: 011b lsls r3, r3, #4
- 80041ae: 4413 add r3, r2
- 80041b0: 330c adds r3, #12
- 80041b2: 2200 movs r2, #0
- 80041b4: 801a strh r2, [r3, #0]
- }
-
- if (acc && Files[i].ctr) return 0; /* Access violation (int err) */
- 80041b6: 683b ldr r3, [r7, #0]
- 80041b8: 2b00 cmp r3, #0
- 80041ba: d009 beq.n 80041d0 <inc_lock+0xe0>
- 80041bc: 4a12 ldr r2, [pc, #72] ; (8004208 <inc_lock+0x118>)
- 80041be: 68fb ldr r3, [r7, #12]
- 80041c0: 011b lsls r3, r3, #4
- 80041c2: 4413 add r3, r2
- 80041c4: 330c adds r3, #12
- 80041c6: 881b ldrh r3, [r3, #0]
- 80041c8: 2b00 cmp r3, #0
- 80041ca: d001 beq.n 80041d0 <inc_lock+0xe0>
- 80041cc: 2300 movs r3, #0
- 80041ce: e015 b.n 80041fc <inc_lock+0x10c>
-
- Files[i].ctr = acc ? 0x100 : Files[i].ctr + 1; /* Set semaphore value */
- 80041d0: 683b ldr r3, [r7, #0]
- 80041d2: 2b00 cmp r3, #0
- 80041d4: d108 bne.n 80041e8 <inc_lock+0xf8>
- 80041d6: 4a0c ldr r2, [pc, #48] ; (8004208 <inc_lock+0x118>)
- 80041d8: 68fb ldr r3, [r7, #12]
- 80041da: 011b lsls r3, r3, #4
- 80041dc: 4413 add r3, r2
- 80041de: 330c adds r3, #12
- 80041e0: 881b ldrh r3, [r3, #0]
- 80041e2: 3301 adds r3, #1
- 80041e4: b29a uxth r2, r3
- 80041e6: e001 b.n 80041ec <inc_lock+0xfc>
- 80041e8: f44f 7280 mov.w r2, #256 ; 0x100
- 80041ec: 4906 ldr r1, [pc, #24] ; (8004208 <inc_lock+0x118>)
- 80041ee: 68fb ldr r3, [r7, #12]
- 80041f0: 011b lsls r3, r3, #4
- 80041f2: 440b add r3, r1
- 80041f4: 330c adds r3, #12
- 80041f6: 801a strh r2, [r3, #0]
-
- return i + 1;
- 80041f8: 68fb ldr r3, [r7, #12]
- 80041fa: 3301 adds r3, #1
- }
- 80041fc: 4618 mov r0, r3
- 80041fe: 3714 adds r7, #20
- 8004200: 46bd mov sp, r7
- 8004202: bc80 pop {r7}
- 8004204: 4770 bx lr
- 8004206: bf00 nop
- 8004208: 200000b4 .word 0x200000b4
-
- 0800420c <dec_lock>:
-
- static
- FRESULT dec_lock ( /* Decrement object open counter */
- UINT i /* Semaphore index (1..) */
- )
- {
- 800420c: b480 push {r7}
- 800420e: b085 sub sp, #20
- 8004210: af00 add r7, sp, #0
- 8004212: 6078 str r0, [r7, #4]
- WORD n;
- FRESULT res;
-
-
- if (--i < _FS_LOCK) { /* Shift index number origin from 0 */
- 8004214: 687b ldr r3, [r7, #4]
- 8004216: 3b01 subs r3, #1
- 8004218: 607b str r3, [r7, #4]
- 800421a: 687b ldr r3, [r7, #4]
- 800421c: 2b01 cmp r3, #1
- 800421e: d825 bhi.n 800426c <dec_lock+0x60>
- n = Files[i].ctr;
- 8004220: 4a16 ldr r2, [pc, #88] ; (800427c <dec_lock+0x70>)
- 8004222: 687b ldr r3, [r7, #4]
- 8004224: 011b lsls r3, r3, #4
- 8004226: 4413 add r3, r2
- 8004228: 330c adds r3, #12
- 800422a: 881b ldrh r3, [r3, #0]
- 800422c: 81fb strh r3, [r7, #14]
- if (n == 0x100) n = 0; /* If write mode open, delete the entry */
- 800422e: 89fb ldrh r3, [r7, #14]
- 8004230: f5b3 7f80 cmp.w r3, #256 ; 0x100
- 8004234: d101 bne.n 800423a <dec_lock+0x2e>
- 8004236: 2300 movs r3, #0
- 8004238: 81fb strh r3, [r7, #14]
- if (n > 0) n--; /* Decrement read mode open count */
- 800423a: 89fb ldrh r3, [r7, #14]
- 800423c: 2b00 cmp r3, #0
- 800423e: d002 beq.n 8004246 <dec_lock+0x3a>
- 8004240: 89fb ldrh r3, [r7, #14]
- 8004242: 3b01 subs r3, #1
- 8004244: 81fb strh r3, [r7, #14]
- Files[i].ctr = n;
- 8004246: 4a0d ldr r2, [pc, #52] ; (800427c <dec_lock+0x70>)
- 8004248: 687b ldr r3, [r7, #4]
- 800424a: 011b lsls r3, r3, #4
- 800424c: 4413 add r3, r2
- 800424e: 330c adds r3, #12
- 8004250: 89fa ldrh r2, [r7, #14]
- 8004252: 801a strh r2, [r3, #0]
- if (n == 0) Files[i].fs = 0; /* Delete the entry if open count gets zero */
- 8004254: 89fb ldrh r3, [r7, #14]
- 8004256: 2b00 cmp r3, #0
- 8004258: d105 bne.n 8004266 <dec_lock+0x5a>
- 800425a: 4a08 ldr r2, [pc, #32] ; (800427c <dec_lock+0x70>)
- 800425c: 687b ldr r3, [r7, #4]
- 800425e: 011b lsls r3, r3, #4
- 8004260: 4413 add r3, r2
- 8004262: 2200 movs r2, #0
- 8004264: 601a str r2, [r3, #0]
- res = FR_OK;
- 8004266: 2300 movs r3, #0
- 8004268: 737b strb r3, [r7, #13]
- 800426a: e001 b.n 8004270 <dec_lock+0x64>
- } else {
- res = FR_INT_ERR; /* Invalid index nunber */
- 800426c: 2302 movs r3, #2
- 800426e: 737b strb r3, [r7, #13]
- }
- return res;
- 8004270: 7b7b ldrb r3, [r7, #13]
- }
- 8004272: 4618 mov r0, r3
- 8004274: 3714 adds r7, #20
- 8004276: 46bd mov sp, r7
- 8004278: bc80 pop {r7}
- 800427a: 4770 bx lr
- 800427c: 200000b4 .word 0x200000b4
-
- 08004280 <clear_lock>:
-
- static
- void clear_lock ( /* Clear lock entries of the volume */
- FATFS *fs
- )
- {
- 8004280: b480 push {r7}
- 8004282: b085 sub sp, #20
- 8004284: af00 add r7, sp, #0
- 8004286: 6078 str r0, [r7, #4]
- UINT i;
-
- for (i = 0; i < _FS_LOCK; i++) {
- 8004288: 2300 movs r3, #0
- 800428a: 60fb str r3, [r7, #12]
- 800428c: e010 b.n 80042b0 <clear_lock+0x30>
- if (Files[i].fs == fs) Files[i].fs = 0;
- 800428e: 4a0c ldr r2, [pc, #48] ; (80042c0 <clear_lock+0x40>)
- 8004290: 68fb ldr r3, [r7, #12]
- 8004292: 011b lsls r3, r3, #4
- 8004294: 4413 add r3, r2
- 8004296: 681b ldr r3, [r3, #0]
- 8004298: 687a ldr r2, [r7, #4]
- 800429a: 429a cmp r2, r3
- 800429c: d105 bne.n 80042aa <clear_lock+0x2a>
- 800429e: 4a08 ldr r2, [pc, #32] ; (80042c0 <clear_lock+0x40>)
- 80042a0: 68fb ldr r3, [r7, #12]
- 80042a2: 011b lsls r3, r3, #4
- 80042a4: 4413 add r3, r2
- 80042a6: 2200 movs r2, #0
- 80042a8: 601a str r2, [r3, #0]
- for (i = 0; i < _FS_LOCK; i++) {
- 80042aa: 68fb ldr r3, [r7, #12]
- 80042ac: 3301 adds r3, #1
- 80042ae: 60fb str r3, [r7, #12]
- 80042b0: 68fb ldr r3, [r7, #12]
- 80042b2: 2b01 cmp r3, #1
- 80042b4: d9eb bls.n 800428e <clear_lock+0xe>
- }
- }
- 80042b6: bf00 nop
- 80042b8: 3714 adds r7, #20
- 80042ba: 46bd mov sp, r7
- 80042bc: bc80 pop {r7}
- 80042be: 4770 bx lr
- 80042c0: 200000b4 .word 0x200000b4
-
- 080042c4 <sync_window>:
- #if !_FS_READONLY
- static
- FRESULT sync_window ( /* Returns FR_OK or FR_DISK_ERROR */
- FATFS* fs /* File system object */
- )
- {
- 80042c4: b580 push {r7, lr}
- 80042c6: b086 sub sp, #24
- 80042c8: af00 add r7, sp, #0
- 80042ca: 6078 str r0, [r7, #4]
- DWORD wsect;
- UINT nf;
- FRESULT res = FR_OK;
- 80042cc: 2300 movs r3, #0
- 80042ce: 73fb strb r3, [r7, #15]
-
-
- if (fs->wflag) { /* Write back the sector if it is dirty */
- 80042d0: 687b ldr r3, [r7, #4]
- 80042d2: 78db ldrb r3, [r3, #3]
- 80042d4: 2b00 cmp r3, #0
- 80042d6: d034 beq.n 8004342 <sync_window+0x7e>
- wsect = fs->winsect; /* Current sector number */
- 80042d8: 687b ldr r3, [r7, #4]
- 80042da: 6b5b ldr r3, [r3, #52] ; 0x34
- 80042dc: 617b str r3, [r7, #20]
- if (disk_write(fs->drv, fs->win, wsect, 1) != RES_OK) {
- 80042de: 687b ldr r3, [r7, #4]
- 80042e0: 7858 ldrb r0, [r3, #1]
- 80042e2: 687b ldr r3, [r7, #4]
- 80042e4: f103 0138 add.w r1, r3, #56 ; 0x38
- 80042e8: 2301 movs r3, #1
- 80042ea: 697a ldr r2, [r7, #20]
- 80042ec: f7ff fd50 bl 8003d90 <disk_write>
- 80042f0: 4603 mov r3, r0
- 80042f2: 2b00 cmp r3, #0
- 80042f4: d002 beq.n 80042fc <sync_window+0x38>
- res = FR_DISK_ERR;
- 80042f6: 2301 movs r3, #1
- 80042f8: 73fb strb r3, [r7, #15]
- 80042fa: e022 b.n 8004342 <sync_window+0x7e>
- } else {
- fs->wflag = 0;
- 80042fc: 687b ldr r3, [r7, #4]
- 80042fe: 2200 movs r2, #0
- 8004300: 70da strb r2, [r3, #3]
- if (wsect - fs->fatbase < fs->fsize) { /* Is it in the FAT area? */
- 8004302: 687b ldr r3, [r7, #4]
- 8004304: 6a9b ldr r3, [r3, #40] ; 0x28
- 8004306: 697a ldr r2, [r7, #20]
- 8004308: 1ad2 subs r2, r2, r3
- 800430a: 687b ldr r3, [r7, #4]
- 800430c: 6a1b ldr r3, [r3, #32]
- 800430e: 429a cmp r2, r3
- 8004310: d217 bcs.n 8004342 <sync_window+0x7e>
- for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
- 8004312: 687b ldr r3, [r7, #4]
- 8004314: 789b ldrb r3, [r3, #2]
- 8004316: 613b str r3, [r7, #16]
- 8004318: e010 b.n 800433c <sync_window+0x78>
- wsect += fs->fsize;
- 800431a: 687b ldr r3, [r7, #4]
- 800431c: 6a1b ldr r3, [r3, #32]
- 800431e: 697a ldr r2, [r7, #20]
- 8004320: 4413 add r3, r2
- 8004322: 617b str r3, [r7, #20]
- disk_write(fs->drv, fs->win, wsect, 1);
- 8004324: 687b ldr r3, [r7, #4]
- 8004326: 7858 ldrb r0, [r3, #1]
- 8004328: 687b ldr r3, [r7, #4]
- 800432a: f103 0138 add.w r1, r3, #56 ; 0x38
- 800432e: 2301 movs r3, #1
- 8004330: 697a ldr r2, [r7, #20]
- 8004332: f7ff fd2d bl 8003d90 <disk_write>
- for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
- 8004336: 693b ldr r3, [r7, #16]
- 8004338: 3b01 subs r3, #1
- 800433a: 613b str r3, [r7, #16]
- 800433c: 693b ldr r3, [r7, #16]
- 800433e: 2b01 cmp r3, #1
- 8004340: d8eb bhi.n 800431a <sync_window+0x56>
- }
- }
- }
- }
- return res;
- 8004342: 7bfb ldrb r3, [r7, #15]
- }
- 8004344: 4618 mov r0, r3
- 8004346: 3718 adds r7, #24
- 8004348: 46bd mov sp, r7
- 800434a: bd80 pop {r7, pc}
-
- 0800434c <move_window>:
- static
- FRESULT move_window ( /* Returns FR_OK or FR_DISK_ERROR */
- FATFS* fs, /* File system object */
- DWORD sector /* Sector number to make appearance in the fs->win[] */
- )
- {
- 800434c: b580 push {r7, lr}
- 800434e: b084 sub sp, #16
- 8004350: af00 add r7, sp, #0
- 8004352: 6078 str r0, [r7, #4]
- 8004354: 6039 str r1, [r7, #0]
- FRESULT res = FR_OK;
- 8004356: 2300 movs r3, #0
- 8004358: 73fb strb r3, [r7, #15]
-
-
- if (sector != fs->winsect) { /* Window offset changed? */
- 800435a: 687b ldr r3, [r7, #4]
- 800435c: 6b5b ldr r3, [r3, #52] ; 0x34
- 800435e: 683a ldr r2, [r7, #0]
- 8004360: 429a cmp r2, r3
- 8004362: d01b beq.n 800439c <move_window+0x50>
- #if !_FS_READONLY
- res = sync_window(fs); /* Write-back changes */
- 8004364: 6878 ldr r0, [r7, #4]
- 8004366: f7ff ffad bl 80042c4 <sync_window>
- 800436a: 4603 mov r3, r0
- 800436c: 73fb strb r3, [r7, #15]
- #endif
- if (res == FR_OK) { /* Fill sector window with new data */
- 800436e: 7bfb ldrb r3, [r7, #15]
- 8004370: 2b00 cmp r3, #0
- 8004372: d113 bne.n 800439c <move_window+0x50>
- if (disk_read(fs->drv, fs->win, sector, 1) != RES_OK) {
- 8004374: 687b ldr r3, [r7, #4]
- 8004376: 7858 ldrb r0, [r3, #1]
- 8004378: 687b ldr r3, [r7, #4]
- 800437a: f103 0138 add.w r1, r3, #56 ; 0x38
- 800437e: 2301 movs r3, #1
- 8004380: 683a ldr r2, [r7, #0]
- 8004382: f7ff fce5 bl 8003d50 <disk_read>
- 8004386: 4603 mov r3, r0
- 8004388: 2b00 cmp r3, #0
- 800438a: d004 beq.n 8004396 <move_window+0x4a>
- sector = 0xFFFFFFFF; /* Invalidate window if data is not reliable */
- 800438c: f04f 33ff mov.w r3, #4294967295
- 8004390: 603b str r3, [r7, #0]
- res = FR_DISK_ERR;
- 8004392: 2301 movs r3, #1
- 8004394: 73fb strb r3, [r7, #15]
- }
- fs->winsect = sector;
- 8004396: 687b ldr r3, [r7, #4]
- 8004398: 683a ldr r2, [r7, #0]
- 800439a: 635a str r2, [r3, #52] ; 0x34
- }
- }
- return res;
- 800439c: 7bfb ldrb r3, [r7, #15]
- }
- 800439e: 4618 mov r0, r3
- 80043a0: 3710 adds r7, #16
- 80043a2: 46bd mov sp, r7
- 80043a4: bd80 pop {r7, pc}
- ...
-
- 080043a8 <sync_fs>:
-
- static
- FRESULT sync_fs ( /* FR_OK:succeeded, !=0:error */
- FATFS* fs /* File system object */
- )
- {
- 80043a8: b580 push {r7, lr}
- 80043aa: b084 sub sp, #16
- 80043ac: af00 add r7, sp, #0
- 80043ae: 6078 str r0, [r7, #4]
- FRESULT res;
-
-
- res = sync_window(fs);
- 80043b0: 6878 ldr r0, [r7, #4]
- 80043b2: f7ff ff87 bl 80042c4 <sync_window>
- 80043b6: 4603 mov r3, r0
- 80043b8: 73fb strb r3, [r7, #15]
- if (res == FR_OK) {
- 80043ba: 7bfb ldrb r3, [r7, #15]
- 80043bc: 2b00 cmp r3, #0
- 80043be: d159 bne.n 8004474 <sync_fs+0xcc>
- /* Update FSInfo sector if needed */
- if (fs->fs_type == FS_FAT32 && fs->fsi_flag == 1) {
- 80043c0: 687b ldr r3, [r7, #4]
- 80043c2: 781b ldrb r3, [r3, #0]
- 80043c4: 2b03 cmp r3, #3
- 80043c6: d149 bne.n 800445c <sync_fs+0xb4>
- 80043c8: 687b ldr r3, [r7, #4]
- 80043ca: 791b ldrb r3, [r3, #4]
- 80043cc: 2b01 cmp r3, #1
- 80043ce: d145 bne.n 800445c <sync_fs+0xb4>
- /* Create FSInfo structure */
- mem_set(fs->win, 0, SS(fs));
- 80043d0: 687b ldr r3, [r7, #4]
- 80043d2: f103 0038 add.w r0, r3, #56 ; 0x38
- 80043d6: 687b ldr r3, [r7, #4]
- 80043d8: 899b ldrh r3, [r3, #12]
- 80043da: 461a mov r2, r3
- 80043dc: 2100 movs r1, #0
- 80043de: f7ff fdb3 bl 8003f48 <mem_set>
- st_word(fs->win + BS_55AA, 0xAA55);
- 80043e2: 687b ldr r3, [r7, #4]
- 80043e4: 3338 adds r3, #56 ; 0x38
- 80043e6: f503 73ff add.w r3, r3, #510 ; 0x1fe
- 80043ea: f64a 2155 movw r1, #43605 ; 0xaa55
- 80043ee: 4618 mov r0, r3
- 80043f0: f7ff fd45 bl 8003e7e <st_word>
- st_dword(fs->win + FSI_LeadSig, 0x41615252);
- 80043f4: 687b ldr r3, [r7, #4]
- 80043f6: 3338 adds r3, #56 ; 0x38
- 80043f8: 4921 ldr r1, [pc, #132] ; (8004480 <sync_fs+0xd8>)
- 80043fa: 4618 mov r0, r3
- 80043fc: f7ff fd59 bl 8003eb2 <st_dword>
- st_dword(fs->win + FSI_StrucSig, 0x61417272);
- 8004400: 687b ldr r3, [r7, #4]
- 8004402: 3338 adds r3, #56 ; 0x38
- 8004404: f503 73f2 add.w r3, r3, #484 ; 0x1e4
- 8004408: 491e ldr r1, [pc, #120] ; (8004484 <sync_fs+0xdc>)
- 800440a: 4618 mov r0, r3
- 800440c: f7ff fd51 bl 8003eb2 <st_dword>
- st_dword(fs->win + FSI_Free_Count, fs->free_clst);
- 8004410: 687b ldr r3, [r7, #4]
- 8004412: 3338 adds r3, #56 ; 0x38
- 8004414: f503 72f4 add.w r2, r3, #488 ; 0x1e8
- 8004418: 687b ldr r3, [r7, #4]
- 800441a: 699b ldr r3, [r3, #24]
- 800441c: 4619 mov r1, r3
- 800441e: 4610 mov r0, r2
- 8004420: f7ff fd47 bl 8003eb2 <st_dword>
- st_dword(fs->win + FSI_Nxt_Free, fs->last_clst);
- 8004424: 687b ldr r3, [r7, #4]
- 8004426: 3338 adds r3, #56 ; 0x38
- 8004428: f503 72f6 add.w r2, r3, #492 ; 0x1ec
- 800442c: 687b ldr r3, [r7, #4]
- 800442e: 695b ldr r3, [r3, #20]
- 8004430: 4619 mov r1, r3
- 8004432: 4610 mov r0, r2
- 8004434: f7ff fd3d bl 8003eb2 <st_dword>
- /* Write it into the FSInfo sector */
- fs->winsect = fs->volbase + 1;
- 8004438: 687b ldr r3, [r7, #4]
- 800443a: 6a5b ldr r3, [r3, #36] ; 0x24
- 800443c: 1c5a adds r2, r3, #1
- 800443e: 687b ldr r3, [r7, #4]
- 8004440: 635a str r2, [r3, #52] ; 0x34
- disk_write(fs->drv, fs->win, fs->winsect, 1);
- 8004442: 687b ldr r3, [r7, #4]
- 8004444: 7858 ldrb r0, [r3, #1]
- 8004446: 687b ldr r3, [r7, #4]
- 8004448: f103 0138 add.w r1, r3, #56 ; 0x38
- 800444c: 687b ldr r3, [r7, #4]
- 800444e: 6b5a ldr r2, [r3, #52] ; 0x34
- 8004450: 2301 movs r3, #1
- 8004452: f7ff fc9d bl 8003d90 <disk_write>
- fs->fsi_flag = 0;
- 8004456: 687b ldr r3, [r7, #4]
- 8004458: 2200 movs r2, #0
- 800445a: 711a strb r2, [r3, #4]
- }
- /* Make sure that no pending write process in the physical drive */
- if (disk_ioctl(fs->drv, CTRL_SYNC, 0) != RES_OK) res = FR_DISK_ERR;
- 800445c: 687b ldr r3, [r7, #4]
- 800445e: 785b ldrb r3, [r3, #1]
- 8004460: 2200 movs r2, #0
- 8004462: 2100 movs r1, #0
- 8004464: 4618 mov r0, r3
- 8004466: f7ff fcb3 bl 8003dd0 <disk_ioctl>
- 800446a: 4603 mov r3, r0
- 800446c: 2b00 cmp r3, #0
- 800446e: d001 beq.n 8004474 <sync_fs+0xcc>
- 8004470: 2301 movs r3, #1
- 8004472: 73fb strb r3, [r7, #15]
- }
-
- return res;
- 8004474: 7bfb ldrb r3, [r7, #15]
- }
- 8004476: 4618 mov r0, r3
- 8004478: 3710 adds r7, #16
- 800447a: 46bd mov sp, r7
- 800447c: bd80 pop {r7, pc}
- 800447e: bf00 nop
- 8004480: 41615252 .word 0x41615252
- 8004484: 61417272 .word 0x61417272
-
- 08004488 <clust2sect>:
- static
- DWORD clust2sect ( /* !=0:Sector number, 0:Failed (invalid cluster#) */
- FATFS* fs, /* File system object */
- DWORD clst /* Cluster# to be converted */
- )
- {
- 8004488: b480 push {r7}
- 800448a: b083 sub sp, #12
- 800448c: af00 add r7, sp, #0
- 800448e: 6078 str r0, [r7, #4]
- 8004490: 6039 str r1, [r7, #0]
- clst -= 2;
- 8004492: 683b ldr r3, [r7, #0]
- 8004494: 3b02 subs r3, #2
- 8004496: 603b str r3, [r7, #0]
- if (clst >= fs->n_fatent - 2) return 0; /* Invalid cluster# */
- 8004498: 687b ldr r3, [r7, #4]
- 800449a: 69db ldr r3, [r3, #28]
- 800449c: 3b02 subs r3, #2
- 800449e: 683a ldr r2, [r7, #0]
- 80044a0: 429a cmp r2, r3
- 80044a2: d301 bcc.n 80044a8 <clust2sect+0x20>
- 80044a4: 2300 movs r3, #0
- 80044a6: e008 b.n 80044ba <clust2sect+0x32>
- return clst * fs->csize + fs->database;
- 80044a8: 687b ldr r3, [r7, #4]
- 80044aa: 895b ldrh r3, [r3, #10]
- 80044ac: 461a mov r2, r3
- 80044ae: 683b ldr r3, [r7, #0]
- 80044b0: fb03 f202 mul.w r2, r3, r2
- 80044b4: 687b ldr r3, [r7, #4]
- 80044b6: 6b1b ldr r3, [r3, #48] ; 0x30
- 80044b8: 4413 add r3, r2
- }
- 80044ba: 4618 mov r0, r3
- 80044bc: 370c adds r7, #12
- 80044be: 46bd mov sp, r7
- 80044c0: bc80 pop {r7}
- 80044c2: 4770 bx lr
-
- 080044c4 <get_fat>:
- static
- DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x7FFFFFFF:Cluster status */
- _FDID* obj, /* Corresponding object */
- DWORD clst /* Cluster number to get the value */
- )
- {
- 80044c4: b580 push {r7, lr}
- 80044c6: b086 sub sp, #24
- 80044c8: af00 add r7, sp, #0
- 80044ca: 6078 str r0, [r7, #4]
- 80044cc: 6039 str r1, [r7, #0]
- UINT wc, bc;
- DWORD val;
- FATFS *fs = obj->fs;
- 80044ce: 687b ldr r3, [r7, #4]
- 80044d0: 681b ldr r3, [r3, #0]
- 80044d2: 613b str r3, [r7, #16]
-
-
- if (clst < 2 || clst >= fs->n_fatent) { /* Check if in valid range */
- 80044d4: 683b ldr r3, [r7, #0]
- 80044d6: 2b01 cmp r3, #1
- 80044d8: d904 bls.n 80044e4 <get_fat+0x20>
- 80044da: 693b ldr r3, [r7, #16]
- 80044dc: 69db ldr r3, [r3, #28]
- 80044de: 683a ldr r2, [r7, #0]
- 80044e0: 429a cmp r2, r3
- 80044e2: d302 bcc.n 80044ea <get_fat+0x26>
- val = 1; /* Internal error */
- 80044e4: 2301 movs r3, #1
- 80044e6: 617b str r3, [r7, #20]
- 80044e8: e0b7 b.n 800465a <get_fat+0x196>
-
- } else {
- val = 0xFFFFFFFF; /* Default value falls on disk error */
- 80044ea: f04f 33ff mov.w r3, #4294967295
- 80044ee: 617b str r3, [r7, #20]
-
- switch (fs->fs_type) {
- 80044f0: 693b ldr r3, [r7, #16]
- 80044f2: 781b ldrb r3, [r3, #0]
- 80044f4: 2b02 cmp r3, #2
- 80044f6: d05a beq.n 80045ae <get_fat+0xea>
- 80044f8: 2b03 cmp r3, #3
- 80044fa: d07d beq.n 80045f8 <get_fat+0x134>
- 80044fc: 2b01 cmp r3, #1
- 80044fe: f040 80a2 bne.w 8004646 <get_fat+0x182>
- case FS_FAT12 :
- bc = (UINT)clst; bc += bc / 2;
- 8004502: 683b ldr r3, [r7, #0]
- 8004504: 60fb str r3, [r7, #12]
- 8004506: 68fb ldr r3, [r7, #12]
- 8004508: 085b lsrs r3, r3, #1
- 800450a: 68fa ldr r2, [r7, #12]
- 800450c: 4413 add r3, r2
- 800450e: 60fb str r3, [r7, #12]
- if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
- 8004510: 693b ldr r3, [r7, #16]
- 8004512: 6a9a ldr r2, [r3, #40] ; 0x28
- 8004514: 693b ldr r3, [r7, #16]
- 8004516: 899b ldrh r3, [r3, #12]
- 8004518: 4619 mov r1, r3
- 800451a: 68fb ldr r3, [r7, #12]
- 800451c: fbb3 f3f1 udiv r3, r3, r1
- 8004520: 4413 add r3, r2
- 8004522: 4619 mov r1, r3
- 8004524: 6938 ldr r0, [r7, #16]
- 8004526: f7ff ff11 bl 800434c <move_window>
- 800452a: 4603 mov r3, r0
- 800452c: 2b00 cmp r3, #0
- 800452e: f040 808d bne.w 800464c <get_fat+0x188>
- wc = fs->win[bc++ % SS(fs)];
- 8004532: 68fb ldr r3, [r7, #12]
- 8004534: 1c5a adds r2, r3, #1
- 8004536: 60fa str r2, [r7, #12]
- 8004538: 693a ldr r2, [r7, #16]
- 800453a: 8992 ldrh r2, [r2, #12]
- 800453c: fbb3 f1f2 udiv r1, r3, r2
- 8004540: fb02 f201 mul.w r2, r2, r1
- 8004544: 1a9b subs r3, r3, r2
- 8004546: 693a ldr r2, [r7, #16]
- 8004548: 4413 add r3, r2
- 800454a: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
- 800454e: 60bb str r3, [r7, #8]
- if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
- 8004550: 693b ldr r3, [r7, #16]
- 8004552: 6a9a ldr r2, [r3, #40] ; 0x28
- 8004554: 693b ldr r3, [r7, #16]
- 8004556: 899b ldrh r3, [r3, #12]
- 8004558: 4619 mov r1, r3
- 800455a: 68fb ldr r3, [r7, #12]
- 800455c: fbb3 f3f1 udiv r3, r3, r1
- 8004560: 4413 add r3, r2
- 8004562: 4619 mov r1, r3
- 8004564: 6938 ldr r0, [r7, #16]
- 8004566: f7ff fef1 bl 800434c <move_window>
- 800456a: 4603 mov r3, r0
- 800456c: 2b00 cmp r3, #0
- 800456e: d16f bne.n 8004650 <get_fat+0x18c>
- wc |= fs->win[bc % SS(fs)] << 8;
- 8004570: 693b ldr r3, [r7, #16]
- 8004572: 899b ldrh r3, [r3, #12]
- 8004574: 461a mov r2, r3
- 8004576: 68fb ldr r3, [r7, #12]
- 8004578: fbb3 f1f2 udiv r1, r3, r2
- 800457c: fb02 f201 mul.w r2, r2, r1
- 8004580: 1a9b subs r3, r3, r2
- 8004582: 693a ldr r2, [r7, #16]
- 8004584: 4413 add r3, r2
- 8004586: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
- 800458a: 021b lsls r3, r3, #8
- 800458c: 461a mov r2, r3
- 800458e: 68bb ldr r3, [r7, #8]
- 8004590: 4313 orrs r3, r2
- 8004592: 60bb str r3, [r7, #8]
- val = (clst & 1) ? (wc >> 4) : (wc & 0xFFF);
- 8004594: 683b ldr r3, [r7, #0]
- 8004596: f003 0301 and.w r3, r3, #1
- 800459a: 2b00 cmp r3, #0
- 800459c: d002 beq.n 80045a4 <get_fat+0xe0>
- 800459e: 68bb ldr r3, [r7, #8]
- 80045a0: 091b lsrs r3, r3, #4
- 80045a2: e002 b.n 80045aa <get_fat+0xe6>
- 80045a4: 68bb ldr r3, [r7, #8]
- 80045a6: f3c3 030b ubfx r3, r3, #0, #12
- 80045aa: 617b str r3, [r7, #20]
- break;
- 80045ac: e055 b.n 800465a <get_fat+0x196>
-
- case FS_FAT16 :
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break;
- 80045ae: 693b ldr r3, [r7, #16]
- 80045b0: 6a9a ldr r2, [r3, #40] ; 0x28
- 80045b2: 693b ldr r3, [r7, #16]
- 80045b4: 899b ldrh r3, [r3, #12]
- 80045b6: 085b lsrs r3, r3, #1
- 80045b8: b29b uxth r3, r3
- 80045ba: 4619 mov r1, r3
- 80045bc: 683b ldr r3, [r7, #0]
- 80045be: fbb3 f3f1 udiv r3, r3, r1
- 80045c2: 4413 add r3, r2
- 80045c4: 4619 mov r1, r3
- 80045c6: 6938 ldr r0, [r7, #16]
- 80045c8: f7ff fec0 bl 800434c <move_window>
- 80045cc: 4603 mov r3, r0
- 80045ce: 2b00 cmp r3, #0
- 80045d0: d140 bne.n 8004654 <get_fat+0x190>
- val = ld_word(fs->win + clst * 2 % SS(fs));
- 80045d2: 693b ldr r3, [r7, #16]
- 80045d4: f103 0138 add.w r1, r3, #56 ; 0x38
- 80045d8: 683b ldr r3, [r7, #0]
- 80045da: 005b lsls r3, r3, #1
- 80045dc: 693a ldr r2, [r7, #16]
- 80045de: 8992 ldrh r2, [r2, #12]
- 80045e0: fbb3 f0f2 udiv r0, r3, r2
- 80045e4: fb02 f200 mul.w r2, r2, r0
- 80045e8: 1a9b subs r3, r3, r2
- 80045ea: 440b add r3, r1
- 80045ec: 4618 mov r0, r3
- 80045ee: f7ff fc0d bl 8003e0c <ld_word>
- 80045f2: 4603 mov r3, r0
- 80045f4: 617b str r3, [r7, #20]
- break;
- 80045f6: e030 b.n 800465a <get_fat+0x196>
-
- case FS_FAT32 :
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break;
- 80045f8: 693b ldr r3, [r7, #16]
- 80045fa: 6a9a ldr r2, [r3, #40] ; 0x28
- 80045fc: 693b ldr r3, [r7, #16]
- 80045fe: 899b ldrh r3, [r3, #12]
- 8004600: 089b lsrs r3, r3, #2
- 8004602: b29b uxth r3, r3
- 8004604: 4619 mov r1, r3
- 8004606: 683b ldr r3, [r7, #0]
- 8004608: fbb3 f3f1 udiv r3, r3, r1
- 800460c: 4413 add r3, r2
- 800460e: 4619 mov r1, r3
- 8004610: 6938 ldr r0, [r7, #16]
- 8004612: f7ff fe9b bl 800434c <move_window>
- 8004616: 4603 mov r3, r0
- 8004618: 2b00 cmp r3, #0
- 800461a: d11d bne.n 8004658 <get_fat+0x194>
- val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x0FFFFFFF;
- 800461c: 693b ldr r3, [r7, #16]
- 800461e: f103 0138 add.w r1, r3, #56 ; 0x38
- 8004622: 683b ldr r3, [r7, #0]
- 8004624: 009b lsls r3, r3, #2
- 8004626: 693a ldr r2, [r7, #16]
- 8004628: 8992 ldrh r2, [r2, #12]
- 800462a: fbb3 f0f2 udiv r0, r3, r2
- 800462e: fb02 f200 mul.w r2, r2, r0
- 8004632: 1a9b subs r3, r3, r2
- 8004634: 440b add r3, r1
- 8004636: 4618 mov r0, r3
- 8004638: f7ff fbff bl 8003e3a <ld_dword>
- 800463c: 4603 mov r3, r0
- 800463e: f023 4370 bic.w r3, r3, #4026531840 ; 0xf0000000
- 8004642: 617b str r3, [r7, #20]
- break;
- 8004644: e009 b.n 800465a <get_fat+0x196>
- }
- }
- /* go to default */
- #endif
- default:
- val = 1; /* Internal error */
- 8004646: 2301 movs r3, #1
- 8004648: 617b str r3, [r7, #20]
- 800464a: e006 b.n 800465a <get_fat+0x196>
- if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
- 800464c: bf00 nop
- 800464e: e004 b.n 800465a <get_fat+0x196>
- if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
- 8004650: bf00 nop
- 8004652: e002 b.n 800465a <get_fat+0x196>
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break;
- 8004654: bf00 nop
- 8004656: e000 b.n 800465a <get_fat+0x196>
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break;
- 8004658: bf00 nop
- }
- }
-
- return val;
- 800465a: 697b ldr r3, [r7, #20]
- }
- 800465c: 4618 mov r0, r3
- 800465e: 3718 adds r7, #24
- 8004660: 46bd mov sp, r7
- 8004662: bd80 pop {r7, pc}
-
- 08004664 <put_fat>:
- FRESULT put_fat ( /* FR_OK(0):succeeded, !=0:error */
- FATFS* fs, /* Corresponding file system object */
- DWORD clst, /* FAT index number (cluster number) to be changed */
- DWORD val /* New value to be set to the entry */
- )
- {
- 8004664: b590 push {r4, r7, lr}
- 8004666: b089 sub sp, #36 ; 0x24
- 8004668: af00 add r7, sp, #0
- 800466a: 60f8 str r0, [r7, #12]
- 800466c: 60b9 str r1, [r7, #8]
- 800466e: 607a str r2, [r7, #4]
- UINT bc;
- BYTE *p;
- FRESULT res = FR_INT_ERR;
- 8004670: 2302 movs r3, #2
- 8004672: 77fb strb r3, [r7, #31]
-
- if (clst >= 2 && clst < fs->n_fatent) { /* Check if in valid range */
- 8004674: 68bb ldr r3, [r7, #8]
- 8004676: 2b01 cmp r3, #1
- 8004678: f240 8106 bls.w 8004888 <put_fat+0x224>
- 800467c: 68fb ldr r3, [r7, #12]
- 800467e: 69db ldr r3, [r3, #28]
- 8004680: 68ba ldr r2, [r7, #8]
- 8004682: 429a cmp r2, r3
- 8004684: f080 8100 bcs.w 8004888 <put_fat+0x224>
- switch (fs->fs_type) {
- 8004688: 68fb ldr r3, [r7, #12]
- 800468a: 781b ldrb r3, [r3, #0]
- 800468c: 2b02 cmp r3, #2
- 800468e: f000 8088 beq.w 80047a2 <put_fat+0x13e>
- 8004692: 2b03 cmp r3, #3
- 8004694: f000 80b0 beq.w 80047f8 <put_fat+0x194>
- 8004698: 2b01 cmp r3, #1
- 800469a: f040 80f5 bne.w 8004888 <put_fat+0x224>
- case FS_FAT12 : /* Bitfield items */
- bc = (UINT)clst; bc += bc / 2;
- 800469e: 68bb ldr r3, [r7, #8]
- 80046a0: 61bb str r3, [r7, #24]
- 80046a2: 69bb ldr r3, [r7, #24]
- 80046a4: 085b lsrs r3, r3, #1
- 80046a6: 69ba ldr r2, [r7, #24]
- 80046a8: 4413 add r3, r2
- 80046aa: 61bb str r3, [r7, #24]
- res = move_window(fs, fs->fatbase + (bc / SS(fs)));
- 80046ac: 68fb ldr r3, [r7, #12]
- 80046ae: 6a9a ldr r2, [r3, #40] ; 0x28
- 80046b0: 68fb ldr r3, [r7, #12]
- 80046b2: 899b ldrh r3, [r3, #12]
- 80046b4: 4619 mov r1, r3
- 80046b6: 69bb ldr r3, [r7, #24]
- 80046b8: fbb3 f3f1 udiv r3, r3, r1
- 80046bc: 4413 add r3, r2
- 80046be: 4619 mov r1, r3
- 80046c0: 68f8 ldr r0, [r7, #12]
- 80046c2: f7ff fe43 bl 800434c <move_window>
- 80046c6: 4603 mov r3, r0
- 80046c8: 77fb strb r3, [r7, #31]
- if (res != FR_OK) break;
- 80046ca: 7ffb ldrb r3, [r7, #31]
- 80046cc: 2b00 cmp r3, #0
- 80046ce: f040 80d4 bne.w 800487a <put_fat+0x216>
- p = fs->win + bc++ % SS(fs);
- 80046d2: 68fb ldr r3, [r7, #12]
- 80046d4: f103 0138 add.w r1, r3, #56 ; 0x38
- 80046d8: 69bb ldr r3, [r7, #24]
- 80046da: 1c5a adds r2, r3, #1
- 80046dc: 61ba str r2, [r7, #24]
- 80046de: 68fa ldr r2, [r7, #12]
- 80046e0: 8992 ldrh r2, [r2, #12]
- 80046e2: fbb3 f0f2 udiv r0, r3, r2
- 80046e6: fb02 f200 mul.w r2, r2, r0
- 80046ea: 1a9b subs r3, r3, r2
- 80046ec: 440b add r3, r1
- 80046ee: 617b str r3, [r7, #20]
- *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val;
- 80046f0: 68bb ldr r3, [r7, #8]
- 80046f2: f003 0301 and.w r3, r3, #1
- 80046f6: 2b00 cmp r3, #0
- 80046f8: d00d beq.n 8004716 <put_fat+0xb2>
- 80046fa: 697b ldr r3, [r7, #20]
- 80046fc: 781b ldrb r3, [r3, #0]
- 80046fe: b25b sxtb r3, r3
- 8004700: f003 030f and.w r3, r3, #15
- 8004704: b25a sxtb r2, r3
- 8004706: 687b ldr r3, [r7, #4]
- 8004708: b2db uxtb r3, r3
- 800470a: 011b lsls r3, r3, #4
- 800470c: b25b sxtb r3, r3
- 800470e: 4313 orrs r3, r2
- 8004710: b25b sxtb r3, r3
- 8004712: b2db uxtb r3, r3
- 8004714: e001 b.n 800471a <put_fat+0xb6>
- 8004716: 687b ldr r3, [r7, #4]
- 8004718: b2db uxtb r3, r3
- 800471a: 697a ldr r2, [r7, #20]
- 800471c: 7013 strb r3, [r2, #0]
- fs->wflag = 1;
- 800471e: 68fb ldr r3, [r7, #12]
- 8004720: 2201 movs r2, #1
- 8004722: 70da strb r2, [r3, #3]
- res = move_window(fs, fs->fatbase + (bc / SS(fs)));
- 8004724: 68fb ldr r3, [r7, #12]
- 8004726: 6a9a ldr r2, [r3, #40] ; 0x28
- 8004728: 68fb ldr r3, [r7, #12]
- 800472a: 899b ldrh r3, [r3, #12]
- 800472c: 4619 mov r1, r3
- 800472e: 69bb ldr r3, [r7, #24]
- 8004730: fbb3 f3f1 udiv r3, r3, r1
- 8004734: 4413 add r3, r2
- 8004736: 4619 mov r1, r3
- 8004738: 68f8 ldr r0, [r7, #12]
- 800473a: f7ff fe07 bl 800434c <move_window>
- 800473e: 4603 mov r3, r0
- 8004740: 77fb strb r3, [r7, #31]
- if (res != FR_OK) break;
- 8004742: 7ffb ldrb r3, [r7, #31]
- 8004744: 2b00 cmp r3, #0
- 8004746: f040 809a bne.w 800487e <put_fat+0x21a>
- p = fs->win + bc % SS(fs);
- 800474a: 68fb ldr r3, [r7, #12]
- 800474c: f103 0138 add.w r1, r3, #56 ; 0x38
- 8004750: 68fb ldr r3, [r7, #12]
- 8004752: 899b ldrh r3, [r3, #12]
- 8004754: 461a mov r2, r3
- 8004756: 69bb ldr r3, [r7, #24]
- 8004758: fbb3 f0f2 udiv r0, r3, r2
- 800475c: fb02 f200 mul.w r2, r2, r0
- 8004760: 1a9b subs r3, r3, r2
- 8004762: 440b add r3, r1
- 8004764: 617b str r3, [r7, #20]
- *p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F));
- 8004766: 68bb ldr r3, [r7, #8]
- 8004768: f003 0301 and.w r3, r3, #1
- 800476c: 2b00 cmp r3, #0
- 800476e: d003 beq.n 8004778 <put_fat+0x114>
- 8004770: 687b ldr r3, [r7, #4]
- 8004772: 091b lsrs r3, r3, #4
- 8004774: b2db uxtb r3, r3
- 8004776: e00e b.n 8004796 <put_fat+0x132>
- 8004778: 697b ldr r3, [r7, #20]
- 800477a: 781b ldrb r3, [r3, #0]
- 800477c: b25b sxtb r3, r3
- 800477e: f023 030f bic.w r3, r3, #15
- 8004782: b25a sxtb r2, r3
- 8004784: 687b ldr r3, [r7, #4]
- 8004786: 0a1b lsrs r3, r3, #8
- 8004788: b25b sxtb r3, r3
- 800478a: f003 030f and.w r3, r3, #15
- 800478e: b25b sxtb r3, r3
- 8004790: 4313 orrs r3, r2
- 8004792: b25b sxtb r3, r3
- 8004794: b2db uxtb r3, r3
- 8004796: 697a ldr r2, [r7, #20]
- 8004798: 7013 strb r3, [r2, #0]
- fs->wflag = 1;
- 800479a: 68fb ldr r3, [r7, #12]
- 800479c: 2201 movs r2, #1
- 800479e: 70da strb r2, [r3, #3]
- break;
- 80047a0: e072 b.n 8004888 <put_fat+0x224>
-
- case FS_FAT16 : /* WORD aligned items */
- res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 2)));
- 80047a2: 68fb ldr r3, [r7, #12]
- 80047a4: 6a9a ldr r2, [r3, #40] ; 0x28
- 80047a6: 68fb ldr r3, [r7, #12]
- 80047a8: 899b ldrh r3, [r3, #12]
- 80047aa: 085b lsrs r3, r3, #1
- 80047ac: b29b uxth r3, r3
- 80047ae: 4619 mov r1, r3
- 80047b0: 68bb ldr r3, [r7, #8]
- 80047b2: fbb3 f3f1 udiv r3, r3, r1
- 80047b6: 4413 add r3, r2
- 80047b8: 4619 mov r1, r3
- 80047ba: 68f8 ldr r0, [r7, #12]
- 80047bc: f7ff fdc6 bl 800434c <move_window>
- 80047c0: 4603 mov r3, r0
- 80047c2: 77fb strb r3, [r7, #31]
- if (res != FR_OK) break;
- 80047c4: 7ffb ldrb r3, [r7, #31]
- 80047c6: 2b00 cmp r3, #0
- 80047c8: d15b bne.n 8004882 <put_fat+0x21e>
- st_word(fs->win + clst * 2 % SS(fs), (WORD)val);
- 80047ca: 68fb ldr r3, [r7, #12]
- 80047cc: f103 0138 add.w r1, r3, #56 ; 0x38
- 80047d0: 68bb ldr r3, [r7, #8]
- 80047d2: 005b lsls r3, r3, #1
- 80047d4: 68fa ldr r2, [r7, #12]
- 80047d6: 8992 ldrh r2, [r2, #12]
- 80047d8: fbb3 f0f2 udiv r0, r3, r2
- 80047dc: fb02 f200 mul.w r2, r2, r0
- 80047e0: 1a9b subs r3, r3, r2
- 80047e2: 440b add r3, r1
- 80047e4: 687a ldr r2, [r7, #4]
- 80047e6: b292 uxth r2, r2
- 80047e8: 4611 mov r1, r2
- 80047ea: 4618 mov r0, r3
- 80047ec: f7ff fb47 bl 8003e7e <st_word>
- fs->wflag = 1;
- 80047f0: 68fb ldr r3, [r7, #12]
- 80047f2: 2201 movs r2, #1
- 80047f4: 70da strb r2, [r3, #3]
- break;
- 80047f6: e047 b.n 8004888 <put_fat+0x224>
-
- case FS_FAT32 : /* DWORD aligned items */
- #if _FS_EXFAT
- case FS_EXFAT :
- #endif
- res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 4)));
- 80047f8: 68fb ldr r3, [r7, #12]
- 80047fa: 6a9a ldr r2, [r3, #40] ; 0x28
- 80047fc: 68fb ldr r3, [r7, #12]
- 80047fe: 899b ldrh r3, [r3, #12]
- 8004800: 089b lsrs r3, r3, #2
- 8004802: b29b uxth r3, r3
- 8004804: 4619 mov r1, r3
- 8004806: 68bb ldr r3, [r7, #8]
- 8004808: fbb3 f3f1 udiv r3, r3, r1
- 800480c: 4413 add r3, r2
- 800480e: 4619 mov r1, r3
- 8004810: 68f8 ldr r0, [r7, #12]
- 8004812: f7ff fd9b bl 800434c <move_window>
- 8004816: 4603 mov r3, r0
- 8004818: 77fb strb r3, [r7, #31]
- if (res != FR_OK) break;
- 800481a: 7ffb ldrb r3, [r7, #31]
- 800481c: 2b00 cmp r3, #0
- 800481e: d132 bne.n 8004886 <put_fat+0x222>
- if (!_FS_EXFAT || fs->fs_type != FS_EXFAT) {
- val = (val & 0x0FFFFFFF) | (ld_dword(fs->win + clst * 4 % SS(fs)) & 0xF0000000);
- 8004820: 687b ldr r3, [r7, #4]
- 8004822: f023 4470 bic.w r4, r3, #4026531840 ; 0xf0000000
- 8004826: 68fb ldr r3, [r7, #12]
- 8004828: f103 0138 add.w r1, r3, #56 ; 0x38
- 800482c: 68bb ldr r3, [r7, #8]
- 800482e: 009b lsls r3, r3, #2
- 8004830: 68fa ldr r2, [r7, #12]
- 8004832: 8992 ldrh r2, [r2, #12]
- 8004834: fbb3 f0f2 udiv r0, r3, r2
- 8004838: fb02 f200 mul.w r2, r2, r0
- 800483c: 1a9b subs r3, r3, r2
- 800483e: 440b add r3, r1
- 8004840: 4618 mov r0, r3
- 8004842: f7ff fafa bl 8003e3a <ld_dword>
- 8004846: 4603 mov r3, r0
- 8004848: f003 4370 and.w r3, r3, #4026531840 ; 0xf0000000
- 800484c: 4323 orrs r3, r4
- 800484e: 607b str r3, [r7, #4]
- }
- st_dword(fs->win + clst * 4 % SS(fs), val);
- 8004850: 68fb ldr r3, [r7, #12]
- 8004852: f103 0138 add.w r1, r3, #56 ; 0x38
- 8004856: 68bb ldr r3, [r7, #8]
- 8004858: 009b lsls r3, r3, #2
- 800485a: 68fa ldr r2, [r7, #12]
- 800485c: 8992 ldrh r2, [r2, #12]
- 800485e: fbb3 f0f2 udiv r0, r3, r2
- 8004862: fb02 f200 mul.w r2, r2, r0
- 8004866: 1a9b subs r3, r3, r2
- 8004868: 440b add r3, r1
- 800486a: 6879 ldr r1, [r7, #4]
- 800486c: 4618 mov r0, r3
- 800486e: f7ff fb20 bl 8003eb2 <st_dword>
- fs->wflag = 1;
- 8004872: 68fb ldr r3, [r7, #12]
- 8004874: 2201 movs r2, #1
- 8004876: 70da strb r2, [r3, #3]
- break;
- 8004878: e006 b.n 8004888 <put_fat+0x224>
- if (res != FR_OK) break;
- 800487a: bf00 nop
- 800487c: e004 b.n 8004888 <put_fat+0x224>
- if (res != FR_OK) break;
- 800487e: bf00 nop
- 8004880: e002 b.n 8004888 <put_fat+0x224>
- if (res != FR_OK) break;
- 8004882: bf00 nop
- 8004884: e000 b.n 8004888 <put_fat+0x224>
- if (res != FR_OK) break;
- 8004886: bf00 nop
- }
- }
- return res;
- 8004888: 7ffb ldrb r3, [r7, #31]
- }
- 800488a: 4618 mov r0, r3
- 800488c: 3724 adds r7, #36 ; 0x24
- 800488e: 46bd mov sp, r7
- 8004890: bd90 pop {r4, r7, pc}
-
- 08004892 <remove_chain>:
- FRESULT remove_chain ( /* FR_OK(0):succeeded, !=0:error */
- _FDID* obj, /* Corresponding object */
- DWORD clst, /* Cluster to remove a chain from */
- DWORD pclst /* Previous cluster of clst (0:an entire chain) */
- )
- {
- 8004892: b580 push {r7, lr}
- 8004894: b088 sub sp, #32
- 8004896: af00 add r7, sp, #0
- 8004898: 60f8 str r0, [r7, #12]
- 800489a: 60b9 str r1, [r7, #8]
- 800489c: 607a str r2, [r7, #4]
- FRESULT res = FR_OK;
- 800489e: 2300 movs r3, #0
- 80048a0: 77fb strb r3, [r7, #31]
- DWORD nxt;
- FATFS *fs = obj->fs;
- 80048a2: 68fb ldr r3, [r7, #12]
- 80048a4: 681b ldr r3, [r3, #0]
- 80048a6: 61bb str r3, [r7, #24]
- #endif
- #if _USE_TRIM
- DWORD rt[2];
- #endif
-
- if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Check if in valid range */
- 80048a8: 68bb ldr r3, [r7, #8]
- 80048aa: 2b01 cmp r3, #1
- 80048ac: d904 bls.n 80048b8 <remove_chain+0x26>
- 80048ae: 69bb ldr r3, [r7, #24]
- 80048b0: 69db ldr r3, [r3, #28]
- 80048b2: 68ba ldr r2, [r7, #8]
- 80048b4: 429a cmp r2, r3
- 80048b6: d301 bcc.n 80048bc <remove_chain+0x2a>
- 80048b8: 2302 movs r3, #2
- 80048ba: e04b b.n 8004954 <remove_chain+0xc2>
-
- /* Mark the previous cluster 'EOC' on the FAT if it exists */
- if (pclst && (!_FS_EXFAT || fs->fs_type != FS_EXFAT || obj->stat != 2)) {
- 80048bc: 687b ldr r3, [r7, #4]
- 80048be: 2b00 cmp r3, #0
- 80048c0: d00c beq.n 80048dc <remove_chain+0x4a>
- res = put_fat(fs, pclst, 0xFFFFFFFF);
- 80048c2: f04f 32ff mov.w r2, #4294967295
- 80048c6: 6879 ldr r1, [r7, #4]
- 80048c8: 69b8 ldr r0, [r7, #24]
- 80048ca: f7ff fecb bl 8004664 <put_fat>
- 80048ce: 4603 mov r3, r0
- 80048d0: 77fb strb r3, [r7, #31]
- if (res != FR_OK) return res;
- 80048d2: 7ffb ldrb r3, [r7, #31]
- 80048d4: 2b00 cmp r3, #0
- 80048d6: d001 beq.n 80048dc <remove_chain+0x4a>
- 80048d8: 7ffb ldrb r3, [r7, #31]
- 80048da: e03b b.n 8004954 <remove_chain+0xc2>
- }
-
- /* Remove the chain */
- do {
- nxt = get_fat(obj, clst); /* Get cluster status */
- 80048dc: 68b9 ldr r1, [r7, #8]
- 80048de: 68f8 ldr r0, [r7, #12]
- 80048e0: f7ff fdf0 bl 80044c4 <get_fat>
- 80048e4: 6178 str r0, [r7, #20]
- if (nxt == 0) break; /* Empty cluster? */
- 80048e6: 697b ldr r3, [r7, #20]
- 80048e8: 2b00 cmp r3, #0
- 80048ea: d031 beq.n 8004950 <remove_chain+0xbe>
- if (nxt == 1) return FR_INT_ERR; /* Internal error? */
- 80048ec: 697b ldr r3, [r7, #20]
- 80048ee: 2b01 cmp r3, #1
- 80048f0: d101 bne.n 80048f6 <remove_chain+0x64>
- 80048f2: 2302 movs r3, #2
- 80048f4: e02e b.n 8004954 <remove_chain+0xc2>
- if (nxt == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error? */
- 80048f6: 697b ldr r3, [r7, #20]
- 80048f8: f1b3 3fff cmp.w r3, #4294967295
- 80048fc: d101 bne.n 8004902 <remove_chain+0x70>
- 80048fe: 2301 movs r3, #1
- 8004900: e028 b.n 8004954 <remove_chain+0xc2>
- if (!_FS_EXFAT || fs->fs_type != FS_EXFAT) {
- res = put_fat(fs, clst, 0); /* Mark the cluster 'free' on the FAT */
- 8004902: 2200 movs r2, #0
- 8004904: 68b9 ldr r1, [r7, #8]
- 8004906: 69b8 ldr r0, [r7, #24]
- 8004908: f7ff feac bl 8004664 <put_fat>
- 800490c: 4603 mov r3, r0
- 800490e: 77fb strb r3, [r7, #31]
- if (res != FR_OK) return res;
- 8004910: 7ffb ldrb r3, [r7, #31]
- 8004912: 2b00 cmp r3, #0
- 8004914: d001 beq.n 800491a <remove_chain+0x88>
- 8004916: 7ffb ldrb r3, [r7, #31]
- 8004918: e01c b.n 8004954 <remove_chain+0xc2>
- }
- if (fs->free_clst < fs->n_fatent - 2) { /* Update FSINFO */
- 800491a: 69bb ldr r3, [r7, #24]
- 800491c: 699a ldr r2, [r3, #24]
- 800491e: 69bb ldr r3, [r7, #24]
- 8004920: 69db ldr r3, [r3, #28]
- 8004922: 3b02 subs r3, #2
- 8004924: 429a cmp r2, r3
- 8004926: d20b bcs.n 8004940 <remove_chain+0xae>
- fs->free_clst++;
- 8004928: 69bb ldr r3, [r7, #24]
- 800492a: 699b ldr r3, [r3, #24]
- 800492c: 1c5a adds r2, r3, #1
- 800492e: 69bb ldr r3, [r7, #24]
- 8004930: 619a str r2, [r3, #24]
- fs->fsi_flag |= 1;
- 8004932: 69bb ldr r3, [r7, #24]
- 8004934: 791b ldrb r3, [r3, #4]
- 8004936: f043 0301 orr.w r3, r3, #1
- 800493a: b2da uxtb r2, r3
- 800493c: 69bb ldr r3, [r7, #24]
- 800493e: 711a strb r2, [r3, #4]
- disk_ioctl(fs->drv, CTRL_TRIM, rt); /* Inform device the block can be erased */
- #endif
- scl = ecl = nxt;
- }
- #endif
- clst = nxt; /* Next cluster */
- 8004940: 697b ldr r3, [r7, #20]
- 8004942: 60bb str r3, [r7, #8]
- } while (clst < fs->n_fatent); /* Repeat while not the last link */
- 8004944: 69bb ldr r3, [r7, #24]
- 8004946: 69db ldr r3, [r3, #28]
- 8004948: 68ba ldr r2, [r7, #8]
- 800494a: 429a cmp r2, r3
- 800494c: d3c6 bcc.n 80048dc <remove_chain+0x4a>
- 800494e: e000 b.n 8004952 <remove_chain+0xc0>
- if (nxt == 0) break; /* Empty cluster? */
- 8004950: bf00 nop
- obj->stat = 2; /* Change the object status 'contiguous' */
- }
- }
- }
- #endif
- return FR_OK;
- 8004952: 2300 movs r3, #0
- }
- 8004954: 4618 mov r0, r3
- 8004956: 3720 adds r7, #32
- 8004958: 46bd mov sp, r7
- 800495a: bd80 pop {r7, pc}
-
- 0800495c <create_chain>:
- static
- DWORD create_chain ( /* 0:No free cluster, 1:Internal error, 0xFFFFFFFF:Disk error, >=2:New cluster# */
- _FDID* obj, /* Corresponding object */
- DWORD clst /* Cluster# to stretch, 0:Create a new chain */
- )
- {
- 800495c: b580 push {r7, lr}
- 800495e: b088 sub sp, #32
- 8004960: af00 add r7, sp, #0
- 8004962: 6078 str r0, [r7, #4]
- 8004964: 6039 str r1, [r7, #0]
- DWORD cs, ncl, scl;
- FRESULT res;
- FATFS *fs = obj->fs;
- 8004966: 687b ldr r3, [r7, #4]
- 8004968: 681b ldr r3, [r3, #0]
- 800496a: 613b str r3, [r7, #16]
-
-
- if (clst == 0) { /* Create a new chain */
- 800496c: 683b ldr r3, [r7, #0]
- 800496e: 2b00 cmp r3, #0
- 8004970: d10d bne.n 800498e <create_chain+0x32>
- scl = fs->last_clst; /* Get suggested cluster to start from */
- 8004972: 693b ldr r3, [r7, #16]
- 8004974: 695b ldr r3, [r3, #20]
- 8004976: 61bb str r3, [r7, #24]
- if (scl == 0 || scl >= fs->n_fatent) scl = 1;
- 8004978: 69bb ldr r3, [r7, #24]
- 800497a: 2b00 cmp r3, #0
- 800497c: d004 beq.n 8004988 <create_chain+0x2c>
- 800497e: 693b ldr r3, [r7, #16]
- 8004980: 69db ldr r3, [r3, #28]
- 8004982: 69ba ldr r2, [r7, #24]
- 8004984: 429a cmp r2, r3
- 8004986: d31b bcc.n 80049c0 <create_chain+0x64>
- 8004988: 2301 movs r3, #1
- 800498a: 61bb str r3, [r7, #24]
- 800498c: e018 b.n 80049c0 <create_chain+0x64>
- }
- else { /* Stretch current chain */
- cs = get_fat(obj, clst); /* Check the cluster status */
- 800498e: 6839 ldr r1, [r7, #0]
- 8004990: 6878 ldr r0, [r7, #4]
- 8004992: f7ff fd97 bl 80044c4 <get_fat>
- 8004996: 60f8 str r0, [r7, #12]
- if (cs < 2) return 1; /* Invalid FAT value */
- 8004998: 68fb ldr r3, [r7, #12]
- 800499a: 2b01 cmp r3, #1
- 800499c: d801 bhi.n 80049a2 <create_chain+0x46>
- 800499e: 2301 movs r3, #1
- 80049a0: e070 b.n 8004a84 <create_chain+0x128>
- if (cs == 0xFFFFFFFF) return cs; /* A disk error occurred */
- 80049a2: 68fb ldr r3, [r7, #12]
- 80049a4: f1b3 3fff cmp.w r3, #4294967295
- 80049a8: d101 bne.n 80049ae <create_chain+0x52>
- 80049aa: 68fb ldr r3, [r7, #12]
- 80049ac: e06a b.n 8004a84 <create_chain+0x128>
- if (cs < fs->n_fatent) return cs; /* It is already followed by next cluster */
- 80049ae: 693b ldr r3, [r7, #16]
- 80049b0: 69db ldr r3, [r3, #28]
- 80049b2: 68fa ldr r2, [r7, #12]
- 80049b4: 429a cmp r2, r3
- 80049b6: d201 bcs.n 80049bc <create_chain+0x60>
- 80049b8: 68fb ldr r3, [r7, #12]
- 80049ba: e063 b.n 8004a84 <create_chain+0x128>
- scl = clst;
- 80049bc: 683b ldr r3, [r7, #0]
- 80049be: 61bb str r3, [r7, #24]
- }
- }
- } else
- #endif
- { /* On the FAT12/16/32 volume */
- ncl = scl; /* Start cluster */
- 80049c0: 69bb ldr r3, [r7, #24]
- 80049c2: 61fb str r3, [r7, #28]
- for (;;) {
- ncl++; /* Next cluster */
- 80049c4: 69fb ldr r3, [r7, #28]
- 80049c6: 3301 adds r3, #1
- 80049c8: 61fb str r3, [r7, #28]
- if (ncl >= fs->n_fatent) { /* Check wrap-around */
- 80049ca: 693b ldr r3, [r7, #16]
- 80049cc: 69db ldr r3, [r3, #28]
- 80049ce: 69fa ldr r2, [r7, #28]
- 80049d0: 429a cmp r2, r3
- 80049d2: d307 bcc.n 80049e4 <create_chain+0x88>
- ncl = 2;
- 80049d4: 2302 movs r3, #2
- 80049d6: 61fb str r3, [r7, #28]
- if (ncl > scl) return 0; /* No free cluster */
- 80049d8: 69fa ldr r2, [r7, #28]
- 80049da: 69bb ldr r3, [r7, #24]
- 80049dc: 429a cmp r2, r3
- 80049de: d901 bls.n 80049e4 <create_chain+0x88>
- 80049e0: 2300 movs r3, #0
- 80049e2: e04f b.n 8004a84 <create_chain+0x128>
- }
- cs = get_fat(obj, ncl); /* Get the cluster status */
- 80049e4: 69f9 ldr r1, [r7, #28]
- 80049e6: 6878 ldr r0, [r7, #4]
- 80049e8: f7ff fd6c bl 80044c4 <get_fat>
- 80049ec: 60f8 str r0, [r7, #12]
- if (cs == 0) break; /* Found a free cluster */
- 80049ee: 68fb ldr r3, [r7, #12]
- 80049f0: 2b00 cmp r3, #0
- 80049f2: d00e beq.n 8004a12 <create_chain+0xb6>
- if (cs == 1 || cs == 0xFFFFFFFF) return cs; /* An error occurred */
- 80049f4: 68fb ldr r3, [r7, #12]
- 80049f6: 2b01 cmp r3, #1
- 80049f8: d003 beq.n 8004a02 <create_chain+0xa6>
- 80049fa: 68fb ldr r3, [r7, #12]
- 80049fc: f1b3 3fff cmp.w r3, #4294967295
- 8004a00: d101 bne.n 8004a06 <create_chain+0xaa>
- 8004a02: 68fb ldr r3, [r7, #12]
- 8004a04: e03e b.n 8004a84 <create_chain+0x128>
- if (ncl == scl) return 0; /* No free cluster */
- 8004a06: 69fa ldr r2, [r7, #28]
- 8004a08: 69bb ldr r3, [r7, #24]
- 8004a0a: 429a cmp r2, r3
- 8004a0c: d1da bne.n 80049c4 <create_chain+0x68>
- 8004a0e: 2300 movs r3, #0
- 8004a10: e038 b.n 8004a84 <create_chain+0x128>
- if (cs == 0) break; /* Found a free cluster */
- 8004a12: bf00 nop
- }
- res = put_fat(fs, ncl, 0xFFFFFFFF); /* Mark the new cluster 'EOC' */
- 8004a14: f04f 32ff mov.w r2, #4294967295
- 8004a18: 69f9 ldr r1, [r7, #28]
- 8004a1a: 6938 ldr r0, [r7, #16]
- 8004a1c: f7ff fe22 bl 8004664 <put_fat>
- 8004a20: 4603 mov r3, r0
- 8004a22: 75fb strb r3, [r7, #23]
- if (res == FR_OK && clst != 0) {
- 8004a24: 7dfb ldrb r3, [r7, #23]
- 8004a26: 2b00 cmp r3, #0
- 8004a28: d109 bne.n 8004a3e <create_chain+0xe2>
- 8004a2a: 683b ldr r3, [r7, #0]
- 8004a2c: 2b00 cmp r3, #0
- 8004a2e: d006 beq.n 8004a3e <create_chain+0xe2>
- res = put_fat(fs, clst, ncl); /* Link it from the previous one if needed */
- 8004a30: 69fa ldr r2, [r7, #28]
- 8004a32: 6839 ldr r1, [r7, #0]
- 8004a34: 6938 ldr r0, [r7, #16]
- 8004a36: f7ff fe15 bl 8004664 <put_fat>
- 8004a3a: 4603 mov r3, r0
- 8004a3c: 75fb strb r3, [r7, #23]
- }
- }
-
- if (res == FR_OK) { /* Update FSINFO if function succeeded. */
- 8004a3e: 7dfb ldrb r3, [r7, #23]
- 8004a40: 2b00 cmp r3, #0
- 8004a42: d116 bne.n 8004a72 <create_chain+0x116>
- fs->last_clst = ncl;
- 8004a44: 693b ldr r3, [r7, #16]
- 8004a46: 69fa ldr r2, [r7, #28]
- 8004a48: 615a str r2, [r3, #20]
- if (fs->free_clst <= fs->n_fatent - 2) fs->free_clst--;
- 8004a4a: 693b ldr r3, [r7, #16]
- 8004a4c: 699a ldr r2, [r3, #24]
- 8004a4e: 693b ldr r3, [r7, #16]
- 8004a50: 69db ldr r3, [r3, #28]
- 8004a52: 3b02 subs r3, #2
- 8004a54: 429a cmp r2, r3
- 8004a56: d804 bhi.n 8004a62 <create_chain+0x106>
- 8004a58: 693b ldr r3, [r7, #16]
- 8004a5a: 699b ldr r3, [r3, #24]
- 8004a5c: 1e5a subs r2, r3, #1
- 8004a5e: 693b ldr r3, [r7, #16]
- 8004a60: 619a str r2, [r3, #24]
- fs->fsi_flag |= 1;
- 8004a62: 693b ldr r3, [r7, #16]
- 8004a64: 791b ldrb r3, [r3, #4]
- 8004a66: f043 0301 orr.w r3, r3, #1
- 8004a6a: b2da uxtb r2, r3
- 8004a6c: 693b ldr r3, [r7, #16]
- 8004a6e: 711a strb r2, [r3, #4]
- 8004a70: e007 b.n 8004a82 <create_chain+0x126>
- } else {
- ncl = (res == FR_DISK_ERR) ? 0xFFFFFFFF : 1; /* Failed. Generate error status */
- 8004a72: 7dfb ldrb r3, [r7, #23]
- 8004a74: 2b01 cmp r3, #1
- 8004a76: d102 bne.n 8004a7e <create_chain+0x122>
- 8004a78: f04f 33ff mov.w r3, #4294967295
- 8004a7c: e000 b.n 8004a80 <create_chain+0x124>
- 8004a7e: 2301 movs r3, #1
- 8004a80: 61fb str r3, [r7, #28]
- }
-
- return ncl; /* Return new cluster number or error status */
- 8004a82: 69fb ldr r3, [r7, #28]
- }
- 8004a84: 4618 mov r0, r3
- 8004a86: 3720 adds r7, #32
- 8004a88: 46bd mov sp, r7
- 8004a8a: bd80 pop {r7, pc}
-
- 08004a8c <clmt_clust>:
- static
- DWORD clmt_clust ( /* <2:Error, >=2:Cluster number */
- FIL* fp, /* Pointer to the file object */
- FSIZE_t ofs /* File offset to be converted to cluster# */
- )
- {
- 8004a8c: b480 push {r7}
- 8004a8e: b087 sub sp, #28
- 8004a90: af00 add r7, sp, #0
- 8004a92: 6078 str r0, [r7, #4]
- 8004a94: 6039 str r1, [r7, #0]
- DWORD cl, ncl, *tbl;
- FATFS *fs = fp->obj.fs;
- 8004a96: 687b ldr r3, [r7, #4]
- 8004a98: 681b ldr r3, [r3, #0]
- 8004a9a: 60fb str r3, [r7, #12]
-
-
- tbl = fp->cltbl + 1; /* Top of CLMT */
- 8004a9c: 687b ldr r3, [r7, #4]
- 8004a9e: 6adb ldr r3, [r3, #44] ; 0x2c
- 8004aa0: 3304 adds r3, #4
- 8004aa2: 613b str r3, [r7, #16]
- cl = (DWORD)(ofs / SS(fs) / fs->csize); /* Cluster order from top of the file */
- 8004aa4: 68fb ldr r3, [r7, #12]
- 8004aa6: 899b ldrh r3, [r3, #12]
- 8004aa8: 461a mov r2, r3
- 8004aaa: 683b ldr r3, [r7, #0]
- 8004aac: fbb3 f3f2 udiv r3, r3, r2
- 8004ab0: 68fa ldr r2, [r7, #12]
- 8004ab2: 8952 ldrh r2, [r2, #10]
- 8004ab4: fbb3 f3f2 udiv r3, r3, r2
- 8004ab8: 617b str r3, [r7, #20]
- for (;;) {
- ncl = *tbl++; /* Number of cluters in the fragment */
- 8004aba: 693b ldr r3, [r7, #16]
- 8004abc: 1d1a adds r2, r3, #4
- 8004abe: 613a str r2, [r7, #16]
- 8004ac0: 681b ldr r3, [r3, #0]
- 8004ac2: 60bb str r3, [r7, #8]
- if (ncl == 0) return 0; /* End of table? (error) */
- 8004ac4: 68bb ldr r3, [r7, #8]
- 8004ac6: 2b00 cmp r3, #0
- 8004ac8: d101 bne.n 8004ace <clmt_clust+0x42>
- 8004aca: 2300 movs r3, #0
- 8004acc: e010 b.n 8004af0 <clmt_clust+0x64>
- if (cl < ncl) break; /* In this fragment? */
- 8004ace: 697a ldr r2, [r7, #20]
- 8004ad0: 68bb ldr r3, [r7, #8]
- 8004ad2: 429a cmp r2, r3
- 8004ad4: d307 bcc.n 8004ae6 <clmt_clust+0x5a>
- cl -= ncl; tbl++; /* Next fragment */
- 8004ad6: 697a ldr r2, [r7, #20]
- 8004ad8: 68bb ldr r3, [r7, #8]
- 8004ada: 1ad3 subs r3, r2, r3
- 8004adc: 617b str r3, [r7, #20]
- 8004ade: 693b ldr r3, [r7, #16]
- 8004ae0: 3304 adds r3, #4
- 8004ae2: 613b str r3, [r7, #16]
- ncl = *tbl++; /* Number of cluters in the fragment */
- 8004ae4: e7e9 b.n 8004aba <clmt_clust+0x2e>
- if (cl < ncl) break; /* In this fragment? */
- 8004ae6: bf00 nop
- }
- return cl + *tbl; /* Return the cluster number */
- 8004ae8: 693b ldr r3, [r7, #16]
- 8004aea: 681a ldr r2, [r3, #0]
- 8004aec: 697b ldr r3, [r7, #20]
- 8004aee: 4413 add r3, r2
- }
- 8004af0: 4618 mov r0, r3
- 8004af2: 371c adds r7, #28
- 8004af4: 46bd mov sp, r7
- 8004af6: bc80 pop {r7}
- 8004af8: 4770 bx lr
-
- 08004afa <dir_sdi>:
- static
- FRESULT dir_sdi ( /* FR_OK(0):succeeded, !=0:error */
- DIR* dp, /* Pointer to directory object */
- DWORD ofs /* Offset of directory table */
- )
- {
- 8004afa: b580 push {r7, lr}
- 8004afc: b086 sub sp, #24
- 8004afe: af00 add r7, sp, #0
- 8004b00: 6078 str r0, [r7, #4]
- 8004b02: 6039 str r1, [r7, #0]
- DWORD csz, clst;
- FATFS *fs = dp->obj.fs;
- 8004b04: 687b ldr r3, [r7, #4]
- 8004b06: 681b ldr r3, [r3, #0]
- 8004b08: 613b str r3, [r7, #16]
-
-
- if (ofs >= (DWORD)((_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR) || ofs % SZDIRE) { /* Check range of offset and alignment */
- 8004b0a: 683b ldr r3, [r7, #0]
- 8004b0c: f5b3 1f00 cmp.w r3, #2097152 ; 0x200000
- 8004b10: d204 bcs.n 8004b1c <dir_sdi+0x22>
- 8004b12: 683b ldr r3, [r7, #0]
- 8004b14: f003 031f and.w r3, r3, #31
- 8004b18: 2b00 cmp r3, #0
- 8004b1a: d001 beq.n 8004b20 <dir_sdi+0x26>
- return FR_INT_ERR;
- 8004b1c: 2302 movs r3, #2
- 8004b1e: e071 b.n 8004c04 <dir_sdi+0x10a>
- }
- dp->dptr = ofs; /* Set current offset */
- 8004b20: 687b ldr r3, [r7, #4]
- 8004b22: 683a ldr r2, [r7, #0]
- 8004b24: 615a str r2, [r3, #20]
- clst = dp->obj.sclust; /* Table start cluster (0:root) */
- 8004b26: 687b ldr r3, [r7, #4]
- 8004b28: 689b ldr r3, [r3, #8]
- 8004b2a: 617b str r3, [r7, #20]
- if (clst == 0 && fs->fs_type >= FS_FAT32) { /* Replace cluster# 0 with root cluster# */
- 8004b2c: 697b ldr r3, [r7, #20]
- 8004b2e: 2b00 cmp r3, #0
- 8004b30: d106 bne.n 8004b40 <dir_sdi+0x46>
- 8004b32: 693b ldr r3, [r7, #16]
- 8004b34: 781b ldrb r3, [r3, #0]
- 8004b36: 2b02 cmp r3, #2
- 8004b38: d902 bls.n 8004b40 <dir_sdi+0x46>
- clst = fs->dirbase;
- 8004b3a: 693b ldr r3, [r7, #16]
- 8004b3c: 6adb ldr r3, [r3, #44] ; 0x2c
- 8004b3e: 617b str r3, [r7, #20]
- if (_FS_EXFAT) dp->obj.stat = 0; /* exFAT: Root dir has an FAT chain */
- }
-
- if (clst == 0) { /* Static table (root-directory in FAT12/16) */
- 8004b40: 697b ldr r3, [r7, #20]
- 8004b42: 2b00 cmp r3, #0
- 8004b44: d10c bne.n 8004b60 <dir_sdi+0x66>
- if (ofs / SZDIRE >= fs->n_rootdir) return FR_INT_ERR; /* Is index out of range? */
- 8004b46: 683b ldr r3, [r7, #0]
- 8004b48: 095b lsrs r3, r3, #5
- 8004b4a: 693a ldr r2, [r7, #16]
- 8004b4c: 8912 ldrh r2, [r2, #8]
- 8004b4e: 4293 cmp r3, r2
- 8004b50: d301 bcc.n 8004b56 <dir_sdi+0x5c>
- 8004b52: 2302 movs r3, #2
- 8004b54: e056 b.n 8004c04 <dir_sdi+0x10a>
- dp->sect = fs->dirbase;
- 8004b56: 693b ldr r3, [r7, #16]
- 8004b58: 6ada ldr r2, [r3, #44] ; 0x2c
- 8004b5a: 687b ldr r3, [r7, #4]
- 8004b5c: 61da str r2, [r3, #28]
- 8004b5e: e02d b.n 8004bbc <dir_sdi+0xc2>
-
- } else { /* Dynamic table (sub-directory or root-directory in FAT32+) */
- csz = (DWORD)fs->csize * SS(fs); /* Bytes per cluster */
- 8004b60: 693b ldr r3, [r7, #16]
- 8004b62: 895b ldrh r3, [r3, #10]
- 8004b64: 461a mov r2, r3
- 8004b66: 693b ldr r3, [r7, #16]
- 8004b68: 899b ldrh r3, [r3, #12]
- 8004b6a: fb03 f302 mul.w r3, r3, r2
- 8004b6e: 60fb str r3, [r7, #12]
- while (ofs >= csz) { /* Follow cluster chain */
- 8004b70: e019 b.n 8004ba6 <dir_sdi+0xac>
- clst = get_fat(&dp->obj, clst); /* Get next cluster */
- 8004b72: 687b ldr r3, [r7, #4]
- 8004b74: 6979 ldr r1, [r7, #20]
- 8004b76: 4618 mov r0, r3
- 8004b78: f7ff fca4 bl 80044c4 <get_fat>
- 8004b7c: 6178 str r0, [r7, #20]
- if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
- 8004b7e: 697b ldr r3, [r7, #20]
- 8004b80: f1b3 3fff cmp.w r3, #4294967295
- 8004b84: d101 bne.n 8004b8a <dir_sdi+0x90>
- 8004b86: 2301 movs r3, #1
- 8004b88: e03c b.n 8004c04 <dir_sdi+0x10a>
- if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Reached to end of table or internal error */
- 8004b8a: 697b ldr r3, [r7, #20]
- 8004b8c: 2b01 cmp r3, #1
- 8004b8e: d904 bls.n 8004b9a <dir_sdi+0xa0>
- 8004b90: 693b ldr r3, [r7, #16]
- 8004b92: 69db ldr r3, [r3, #28]
- 8004b94: 697a ldr r2, [r7, #20]
- 8004b96: 429a cmp r2, r3
- 8004b98: d301 bcc.n 8004b9e <dir_sdi+0xa4>
- 8004b9a: 2302 movs r3, #2
- 8004b9c: e032 b.n 8004c04 <dir_sdi+0x10a>
- ofs -= csz;
- 8004b9e: 683a ldr r2, [r7, #0]
- 8004ba0: 68fb ldr r3, [r7, #12]
- 8004ba2: 1ad3 subs r3, r2, r3
- 8004ba4: 603b str r3, [r7, #0]
- while (ofs >= csz) { /* Follow cluster chain */
- 8004ba6: 683a ldr r2, [r7, #0]
- 8004ba8: 68fb ldr r3, [r7, #12]
- 8004baa: 429a cmp r2, r3
- 8004bac: d2e1 bcs.n 8004b72 <dir_sdi+0x78>
- }
- dp->sect = clust2sect(fs, clst);
- 8004bae: 6979 ldr r1, [r7, #20]
- 8004bb0: 6938 ldr r0, [r7, #16]
- 8004bb2: f7ff fc69 bl 8004488 <clust2sect>
- 8004bb6: 4602 mov r2, r0
- 8004bb8: 687b ldr r3, [r7, #4]
- 8004bba: 61da str r2, [r3, #28]
- }
- dp->clust = clst; /* Current cluster# */
- 8004bbc: 687b ldr r3, [r7, #4]
- 8004bbe: 697a ldr r2, [r7, #20]
- 8004bc0: 619a str r2, [r3, #24]
- if (!dp->sect) return FR_INT_ERR;
- 8004bc2: 687b ldr r3, [r7, #4]
- 8004bc4: 69db ldr r3, [r3, #28]
- 8004bc6: 2b00 cmp r3, #0
- 8004bc8: d101 bne.n 8004bce <dir_sdi+0xd4>
- 8004bca: 2302 movs r3, #2
- 8004bcc: e01a b.n 8004c04 <dir_sdi+0x10a>
- dp->sect += ofs / SS(fs); /* Sector# of the directory entry */
- 8004bce: 687b ldr r3, [r7, #4]
- 8004bd0: 69da ldr r2, [r3, #28]
- 8004bd2: 693b ldr r3, [r7, #16]
- 8004bd4: 899b ldrh r3, [r3, #12]
- 8004bd6: 4619 mov r1, r3
- 8004bd8: 683b ldr r3, [r7, #0]
- 8004bda: fbb3 f3f1 udiv r3, r3, r1
- 8004bde: 441a add r2, r3
- 8004be0: 687b ldr r3, [r7, #4]
- 8004be2: 61da str r2, [r3, #28]
- dp->dir = fs->win + (ofs % SS(fs)); /* Pointer to the entry in the win[] */
- 8004be4: 693b ldr r3, [r7, #16]
- 8004be6: f103 0138 add.w r1, r3, #56 ; 0x38
- 8004bea: 693b ldr r3, [r7, #16]
- 8004bec: 899b ldrh r3, [r3, #12]
- 8004bee: 461a mov r2, r3
- 8004bf0: 683b ldr r3, [r7, #0]
- 8004bf2: fbb3 f0f2 udiv r0, r3, r2
- 8004bf6: fb02 f200 mul.w r2, r2, r0
- 8004bfa: 1a9b subs r3, r3, r2
- 8004bfc: 18ca adds r2, r1, r3
- 8004bfe: 687b ldr r3, [r7, #4]
- 8004c00: 621a str r2, [r3, #32]
-
- return FR_OK;
- 8004c02: 2300 movs r3, #0
- }
- 8004c04: 4618 mov r0, r3
- 8004c06: 3718 adds r7, #24
- 8004c08: 46bd mov sp, r7
- 8004c0a: bd80 pop {r7, pc}
-
- 08004c0c <dir_next>:
- static
- FRESULT dir_next ( /* FR_OK(0):succeeded, FR_NO_FILE:End of table, FR_DENIED:Could not stretch */
- DIR* dp, /* Pointer to the directory object */
- int stretch /* 0: Do not stretch table, 1: Stretch table if needed */
- )
- {
- 8004c0c: b580 push {r7, lr}
- 8004c0e: b086 sub sp, #24
- 8004c10: af00 add r7, sp, #0
- 8004c12: 6078 str r0, [r7, #4]
- 8004c14: 6039 str r1, [r7, #0]
- DWORD ofs, clst;
- FATFS *fs = dp->obj.fs;
- 8004c16: 687b ldr r3, [r7, #4]
- 8004c18: 681b ldr r3, [r3, #0]
- 8004c1a: 60fb str r3, [r7, #12]
- #if !_FS_READONLY
- UINT n;
- #endif
-
- ofs = dp->dptr + SZDIRE; /* Next entry */
- 8004c1c: 687b ldr r3, [r7, #4]
- 8004c1e: 695b ldr r3, [r3, #20]
- 8004c20: 3320 adds r3, #32
- 8004c22: 60bb str r3, [r7, #8]
- if (!dp->sect || ofs >= (DWORD)((_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) return FR_NO_FILE; /* Report EOT when offset has reached max value */
- 8004c24: 687b ldr r3, [r7, #4]
- 8004c26: 69db ldr r3, [r3, #28]
- 8004c28: 2b00 cmp r3, #0
- 8004c2a: d003 beq.n 8004c34 <dir_next+0x28>
- 8004c2c: 68bb ldr r3, [r7, #8]
- 8004c2e: f5b3 1f00 cmp.w r3, #2097152 ; 0x200000
- 8004c32: d301 bcc.n 8004c38 <dir_next+0x2c>
- 8004c34: 2304 movs r3, #4
- 8004c36: e0bb b.n 8004db0 <dir_next+0x1a4>
-
- if (ofs % SS(fs) == 0) { /* Sector changed? */
- 8004c38: 68fb ldr r3, [r7, #12]
- 8004c3a: 899b ldrh r3, [r3, #12]
- 8004c3c: 461a mov r2, r3
- 8004c3e: 68bb ldr r3, [r7, #8]
- 8004c40: fbb3 f1f2 udiv r1, r3, r2
- 8004c44: fb02 f201 mul.w r2, r2, r1
- 8004c48: 1a9b subs r3, r3, r2
- 8004c4a: 2b00 cmp r3, #0
- 8004c4c: f040 809d bne.w 8004d8a <dir_next+0x17e>
- dp->sect++; /* Next sector */
- 8004c50: 687b ldr r3, [r7, #4]
- 8004c52: 69db ldr r3, [r3, #28]
- 8004c54: 1c5a adds r2, r3, #1
- 8004c56: 687b ldr r3, [r7, #4]
- 8004c58: 61da str r2, [r3, #28]
-
- if (!dp->clust) { /* Static table */
- 8004c5a: 687b ldr r3, [r7, #4]
- 8004c5c: 699b ldr r3, [r3, #24]
- 8004c5e: 2b00 cmp r3, #0
- 8004c60: d10b bne.n 8004c7a <dir_next+0x6e>
- if (ofs / SZDIRE >= fs->n_rootdir) { /* Report EOT if it reached end of static table */
- 8004c62: 68bb ldr r3, [r7, #8]
- 8004c64: 095b lsrs r3, r3, #5
- 8004c66: 68fa ldr r2, [r7, #12]
- 8004c68: 8912 ldrh r2, [r2, #8]
- 8004c6a: 4293 cmp r3, r2
- 8004c6c: f0c0 808d bcc.w 8004d8a <dir_next+0x17e>
- dp->sect = 0; return FR_NO_FILE;
- 8004c70: 687b ldr r3, [r7, #4]
- 8004c72: 2200 movs r2, #0
- 8004c74: 61da str r2, [r3, #28]
- 8004c76: 2304 movs r3, #4
- 8004c78: e09a b.n 8004db0 <dir_next+0x1a4>
- }
- }
- else { /* Dynamic table */
- if ((ofs / SS(fs) & (fs->csize - 1)) == 0) { /* Cluster changed? */
- 8004c7a: 68fb ldr r3, [r7, #12]
- 8004c7c: 899b ldrh r3, [r3, #12]
- 8004c7e: 461a mov r2, r3
- 8004c80: 68bb ldr r3, [r7, #8]
- 8004c82: fbb3 f3f2 udiv r3, r3, r2
- 8004c86: 68fa ldr r2, [r7, #12]
- 8004c88: 8952 ldrh r2, [r2, #10]
- 8004c8a: 3a01 subs r2, #1
- 8004c8c: 4013 ands r3, r2
- 8004c8e: 2b00 cmp r3, #0
- 8004c90: d17b bne.n 8004d8a <dir_next+0x17e>
- clst = get_fat(&dp->obj, dp->clust); /* Get next cluster */
- 8004c92: 687a ldr r2, [r7, #4]
- 8004c94: 687b ldr r3, [r7, #4]
- 8004c96: 699b ldr r3, [r3, #24]
- 8004c98: 4619 mov r1, r3
- 8004c9a: 4610 mov r0, r2
- 8004c9c: f7ff fc12 bl 80044c4 <get_fat>
- 8004ca0: 6178 str r0, [r7, #20]
- if (clst <= 1) return FR_INT_ERR; /* Internal error */
- 8004ca2: 697b ldr r3, [r7, #20]
- 8004ca4: 2b01 cmp r3, #1
- 8004ca6: d801 bhi.n 8004cac <dir_next+0xa0>
- 8004ca8: 2302 movs r3, #2
- 8004caa: e081 b.n 8004db0 <dir_next+0x1a4>
- if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
- 8004cac: 697b ldr r3, [r7, #20]
- 8004cae: f1b3 3fff cmp.w r3, #4294967295
- 8004cb2: d101 bne.n 8004cb8 <dir_next+0xac>
- 8004cb4: 2301 movs r3, #1
- 8004cb6: e07b b.n 8004db0 <dir_next+0x1a4>
- if (clst >= fs->n_fatent) { /* Reached end of dynamic table */
- 8004cb8: 68fb ldr r3, [r7, #12]
- 8004cba: 69db ldr r3, [r3, #28]
- 8004cbc: 697a ldr r2, [r7, #20]
- 8004cbe: 429a cmp r2, r3
- 8004cc0: d359 bcc.n 8004d76 <dir_next+0x16a>
- #if !_FS_READONLY
- if (!stretch) { /* If no stretch, report EOT */
- 8004cc2: 683b ldr r3, [r7, #0]
- 8004cc4: 2b00 cmp r3, #0
- 8004cc6: d104 bne.n 8004cd2 <dir_next+0xc6>
- dp->sect = 0; return FR_NO_FILE;
- 8004cc8: 687b ldr r3, [r7, #4]
- 8004cca: 2200 movs r2, #0
- 8004ccc: 61da str r2, [r3, #28]
- 8004cce: 2304 movs r3, #4
- 8004cd0: e06e b.n 8004db0 <dir_next+0x1a4>
- }
- clst = create_chain(&dp->obj, dp->clust); /* Allocate a cluster */
- 8004cd2: 687a ldr r2, [r7, #4]
- 8004cd4: 687b ldr r3, [r7, #4]
- 8004cd6: 699b ldr r3, [r3, #24]
- 8004cd8: 4619 mov r1, r3
- 8004cda: 4610 mov r0, r2
- 8004cdc: f7ff fe3e bl 800495c <create_chain>
- 8004ce0: 6178 str r0, [r7, #20]
- if (clst == 0) return FR_DENIED; /* No free cluster */
- 8004ce2: 697b ldr r3, [r7, #20]
- 8004ce4: 2b00 cmp r3, #0
- 8004ce6: d101 bne.n 8004cec <dir_next+0xe0>
- 8004ce8: 2307 movs r3, #7
- 8004cea: e061 b.n 8004db0 <dir_next+0x1a4>
- if (clst == 1) return FR_INT_ERR; /* Internal error */
- 8004cec: 697b ldr r3, [r7, #20]
- 8004cee: 2b01 cmp r3, #1
- 8004cf0: d101 bne.n 8004cf6 <dir_next+0xea>
- 8004cf2: 2302 movs r3, #2
- 8004cf4: e05c b.n 8004db0 <dir_next+0x1a4>
- if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
- 8004cf6: 697b ldr r3, [r7, #20]
- 8004cf8: f1b3 3fff cmp.w r3, #4294967295
- 8004cfc: d101 bne.n 8004d02 <dir_next+0xf6>
- 8004cfe: 2301 movs r3, #1
- 8004d00: e056 b.n 8004db0 <dir_next+0x1a4>
- /* Clean-up the stretched table */
- if (_FS_EXFAT) dp->obj.stat |= 4; /* The directory needs to be updated */
- if (sync_window(fs) != FR_OK) return FR_DISK_ERR; /* Flush disk access window */
- 8004d02: 68f8 ldr r0, [r7, #12]
- 8004d04: f7ff fade bl 80042c4 <sync_window>
- 8004d08: 4603 mov r3, r0
- 8004d0a: 2b00 cmp r3, #0
- 8004d0c: d001 beq.n 8004d12 <dir_next+0x106>
- 8004d0e: 2301 movs r3, #1
- 8004d10: e04e b.n 8004db0 <dir_next+0x1a4>
- mem_set(fs->win, 0, SS(fs)); /* Clear window buffer */
- 8004d12: 68fb ldr r3, [r7, #12]
- 8004d14: f103 0038 add.w r0, r3, #56 ; 0x38
- 8004d18: 68fb ldr r3, [r7, #12]
- 8004d1a: 899b ldrh r3, [r3, #12]
- 8004d1c: 461a mov r2, r3
- 8004d1e: 2100 movs r1, #0
- 8004d20: f7ff f912 bl 8003f48 <mem_set>
- for (n = 0, fs->winsect = clust2sect(fs, clst); n < fs->csize; n++, fs->winsect++) { /* Fill the new cluster with 0 */
- 8004d24: 2300 movs r3, #0
- 8004d26: 613b str r3, [r7, #16]
- 8004d28: 6979 ldr r1, [r7, #20]
- 8004d2a: 68f8 ldr r0, [r7, #12]
- 8004d2c: f7ff fbac bl 8004488 <clust2sect>
- 8004d30: 4602 mov r2, r0
- 8004d32: 68fb ldr r3, [r7, #12]
- 8004d34: 635a str r2, [r3, #52] ; 0x34
- 8004d36: e012 b.n 8004d5e <dir_next+0x152>
- fs->wflag = 1;
- 8004d38: 68fb ldr r3, [r7, #12]
- 8004d3a: 2201 movs r2, #1
- 8004d3c: 70da strb r2, [r3, #3]
- if (sync_window(fs) != FR_OK) return FR_DISK_ERR;
- 8004d3e: 68f8 ldr r0, [r7, #12]
- 8004d40: f7ff fac0 bl 80042c4 <sync_window>
- 8004d44: 4603 mov r3, r0
- 8004d46: 2b00 cmp r3, #0
- 8004d48: d001 beq.n 8004d4e <dir_next+0x142>
- 8004d4a: 2301 movs r3, #1
- 8004d4c: e030 b.n 8004db0 <dir_next+0x1a4>
- for (n = 0, fs->winsect = clust2sect(fs, clst); n < fs->csize; n++, fs->winsect++) { /* Fill the new cluster with 0 */
- 8004d4e: 693b ldr r3, [r7, #16]
- 8004d50: 3301 adds r3, #1
- 8004d52: 613b str r3, [r7, #16]
- 8004d54: 68fb ldr r3, [r7, #12]
- 8004d56: 6b5b ldr r3, [r3, #52] ; 0x34
- 8004d58: 1c5a adds r2, r3, #1
- 8004d5a: 68fb ldr r3, [r7, #12]
- 8004d5c: 635a str r2, [r3, #52] ; 0x34
- 8004d5e: 68fb ldr r3, [r7, #12]
- 8004d60: 895b ldrh r3, [r3, #10]
- 8004d62: 461a mov r2, r3
- 8004d64: 693b ldr r3, [r7, #16]
- 8004d66: 4293 cmp r3, r2
- 8004d68: d3e6 bcc.n 8004d38 <dir_next+0x12c>
- }
- fs->winsect -= n; /* Restore window offset */
- 8004d6a: 68fb ldr r3, [r7, #12]
- 8004d6c: 6b5a ldr r2, [r3, #52] ; 0x34
- 8004d6e: 693b ldr r3, [r7, #16]
- 8004d70: 1ad2 subs r2, r2, r3
- 8004d72: 68fb ldr r3, [r7, #12]
- 8004d74: 635a str r2, [r3, #52] ; 0x34
- #else
- if (!stretch) dp->sect = 0; /* (this line is to suppress compiler warning) */
- dp->sect = 0; return FR_NO_FILE; /* Report EOT */
- #endif
- }
- dp->clust = clst; /* Initialize data for new cluster */
- 8004d76: 687b ldr r3, [r7, #4]
- 8004d78: 697a ldr r2, [r7, #20]
- 8004d7a: 619a str r2, [r3, #24]
- dp->sect = clust2sect(fs, clst);
- 8004d7c: 6979 ldr r1, [r7, #20]
- 8004d7e: 68f8 ldr r0, [r7, #12]
- 8004d80: f7ff fb82 bl 8004488 <clust2sect>
- 8004d84: 4602 mov r2, r0
- 8004d86: 687b ldr r3, [r7, #4]
- 8004d88: 61da str r2, [r3, #28]
- }
- }
- }
- dp->dptr = ofs; /* Current entry */
- 8004d8a: 687b ldr r3, [r7, #4]
- 8004d8c: 68ba ldr r2, [r7, #8]
- 8004d8e: 615a str r2, [r3, #20]
- dp->dir = fs->win + ofs % SS(fs); /* Pointer to the entry in the win[] */
- 8004d90: 68fb ldr r3, [r7, #12]
- 8004d92: f103 0138 add.w r1, r3, #56 ; 0x38
- 8004d96: 68fb ldr r3, [r7, #12]
- 8004d98: 899b ldrh r3, [r3, #12]
- 8004d9a: 461a mov r2, r3
- 8004d9c: 68bb ldr r3, [r7, #8]
- 8004d9e: fbb3 f0f2 udiv r0, r3, r2
- 8004da2: fb02 f200 mul.w r2, r2, r0
- 8004da6: 1a9b subs r3, r3, r2
- 8004da8: 18ca adds r2, r1, r3
- 8004daa: 687b ldr r3, [r7, #4]
- 8004dac: 621a str r2, [r3, #32]
-
- return FR_OK;
- 8004dae: 2300 movs r3, #0
- }
- 8004db0: 4618 mov r0, r3
- 8004db2: 3718 adds r7, #24
- 8004db4: 46bd mov sp, r7
- 8004db6: bd80 pop {r7, pc}
-
- 08004db8 <dir_alloc>:
- static
- FRESULT dir_alloc ( /* FR_OK(0):succeeded, !=0:error */
- DIR* dp, /* Pointer to the directory object */
- UINT nent /* Number of contiguous entries to allocate */
- )
- {
- 8004db8: b580 push {r7, lr}
- 8004dba: b086 sub sp, #24
- 8004dbc: af00 add r7, sp, #0
- 8004dbe: 6078 str r0, [r7, #4]
- 8004dc0: 6039 str r1, [r7, #0]
- FRESULT res;
- UINT n;
- FATFS *fs = dp->obj.fs;
- 8004dc2: 687b ldr r3, [r7, #4]
- 8004dc4: 681b ldr r3, [r3, #0]
- 8004dc6: 60fb str r3, [r7, #12]
-
-
- res = dir_sdi(dp, 0);
- 8004dc8: 2100 movs r1, #0
- 8004dca: 6878 ldr r0, [r7, #4]
- 8004dcc: f7ff fe95 bl 8004afa <dir_sdi>
- 8004dd0: 4603 mov r3, r0
- 8004dd2: 75fb strb r3, [r7, #23]
- if (res == FR_OK) {
- 8004dd4: 7dfb ldrb r3, [r7, #23]
- 8004dd6: 2b00 cmp r3, #0
- 8004dd8: d12b bne.n 8004e32 <dir_alloc+0x7a>
- n = 0;
- 8004dda: 2300 movs r3, #0
- 8004ddc: 613b str r3, [r7, #16]
- do {
- res = move_window(fs, dp->sect);
- 8004dde: 687b ldr r3, [r7, #4]
- 8004de0: 69db ldr r3, [r3, #28]
- 8004de2: 4619 mov r1, r3
- 8004de4: 68f8 ldr r0, [r7, #12]
- 8004de6: f7ff fab1 bl 800434c <move_window>
- 8004dea: 4603 mov r3, r0
- 8004dec: 75fb strb r3, [r7, #23]
- if (res != FR_OK) break;
- 8004dee: 7dfb ldrb r3, [r7, #23]
- 8004df0: 2b00 cmp r3, #0
- 8004df2: d11d bne.n 8004e30 <dir_alloc+0x78>
- #if _FS_EXFAT
- if ((fs->fs_type == FS_EXFAT) ? (int)((dp->dir[XDIR_Type] & 0x80) == 0) : (int)(dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0)) {
- #else
- if (dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0) {
- 8004df4: 687b ldr r3, [r7, #4]
- 8004df6: 6a1b ldr r3, [r3, #32]
- 8004df8: 781b ldrb r3, [r3, #0]
- 8004dfa: 2be5 cmp r3, #229 ; 0xe5
- 8004dfc: d004 beq.n 8004e08 <dir_alloc+0x50>
- 8004dfe: 687b ldr r3, [r7, #4]
- 8004e00: 6a1b ldr r3, [r3, #32]
- 8004e02: 781b ldrb r3, [r3, #0]
- 8004e04: 2b00 cmp r3, #0
- 8004e06: d107 bne.n 8004e18 <dir_alloc+0x60>
- #endif
- if (++n == nent) break; /* A block of contiguous free entries is found */
- 8004e08: 693b ldr r3, [r7, #16]
- 8004e0a: 3301 adds r3, #1
- 8004e0c: 613b str r3, [r7, #16]
- 8004e0e: 693a ldr r2, [r7, #16]
- 8004e10: 683b ldr r3, [r7, #0]
- 8004e12: 429a cmp r2, r3
- 8004e14: d102 bne.n 8004e1c <dir_alloc+0x64>
- 8004e16: e00c b.n 8004e32 <dir_alloc+0x7a>
- } else {
- n = 0; /* Not a blank entry. Restart to search */
- 8004e18: 2300 movs r3, #0
- 8004e1a: 613b str r3, [r7, #16]
- }
- res = dir_next(dp, 1);
- 8004e1c: 2101 movs r1, #1
- 8004e1e: 6878 ldr r0, [r7, #4]
- 8004e20: f7ff fef4 bl 8004c0c <dir_next>
- 8004e24: 4603 mov r3, r0
- 8004e26: 75fb strb r3, [r7, #23]
- } while (res == FR_OK); /* Next entry with table stretch enabled */
- 8004e28: 7dfb ldrb r3, [r7, #23]
- 8004e2a: 2b00 cmp r3, #0
- 8004e2c: d0d7 beq.n 8004dde <dir_alloc+0x26>
- 8004e2e: e000 b.n 8004e32 <dir_alloc+0x7a>
- if (res != FR_OK) break;
- 8004e30: bf00 nop
- }
-
- if (res == FR_NO_FILE) res = FR_DENIED; /* No directory entry to allocate */
- 8004e32: 7dfb ldrb r3, [r7, #23]
- 8004e34: 2b04 cmp r3, #4
- 8004e36: d101 bne.n 8004e3c <dir_alloc+0x84>
- 8004e38: 2307 movs r3, #7
- 8004e3a: 75fb strb r3, [r7, #23]
- return res;
- 8004e3c: 7dfb ldrb r3, [r7, #23]
- }
- 8004e3e: 4618 mov r0, r3
- 8004e40: 3718 adds r7, #24
- 8004e42: 46bd mov sp, r7
- 8004e44: bd80 pop {r7, pc}
-
- 08004e46 <ld_clust>:
- static
- DWORD ld_clust ( /* Returns the top cluster value of the SFN entry */
- FATFS* fs, /* Pointer to the fs object */
- const BYTE* dir /* Pointer to the key entry */
- )
- {
- 8004e46: b580 push {r7, lr}
- 8004e48: b084 sub sp, #16
- 8004e4a: af00 add r7, sp, #0
- 8004e4c: 6078 str r0, [r7, #4]
- 8004e4e: 6039 str r1, [r7, #0]
- DWORD cl;
-
- cl = ld_word(dir + DIR_FstClusLO);
- 8004e50: 683b ldr r3, [r7, #0]
- 8004e52: 331a adds r3, #26
- 8004e54: 4618 mov r0, r3
- 8004e56: f7fe ffd9 bl 8003e0c <ld_word>
- 8004e5a: 4603 mov r3, r0
- 8004e5c: 60fb str r3, [r7, #12]
- if (fs->fs_type == FS_FAT32) {
- 8004e5e: 687b ldr r3, [r7, #4]
- 8004e60: 781b ldrb r3, [r3, #0]
- 8004e62: 2b03 cmp r3, #3
- 8004e64: d109 bne.n 8004e7a <ld_clust+0x34>
- cl |= (DWORD)ld_word(dir + DIR_FstClusHI) << 16;
- 8004e66: 683b ldr r3, [r7, #0]
- 8004e68: 3314 adds r3, #20
- 8004e6a: 4618 mov r0, r3
- 8004e6c: f7fe ffce bl 8003e0c <ld_word>
- 8004e70: 4603 mov r3, r0
- 8004e72: 041b lsls r3, r3, #16
- 8004e74: 68fa ldr r2, [r7, #12]
- 8004e76: 4313 orrs r3, r2
- 8004e78: 60fb str r3, [r7, #12]
- }
-
- return cl;
- 8004e7a: 68fb ldr r3, [r7, #12]
- }
- 8004e7c: 4618 mov r0, r3
- 8004e7e: 3710 adds r7, #16
- 8004e80: 46bd mov sp, r7
- 8004e82: bd80 pop {r7, pc}
-
- 08004e84 <st_clust>:
- void st_clust (
- FATFS* fs, /* Pointer to the fs object */
- BYTE* dir, /* Pointer to the key entry */
- DWORD cl /* Value to be set */
- )
- {
- 8004e84: b580 push {r7, lr}
- 8004e86: b084 sub sp, #16
- 8004e88: af00 add r7, sp, #0
- 8004e8a: 60f8 str r0, [r7, #12]
- 8004e8c: 60b9 str r1, [r7, #8]
- 8004e8e: 607a str r2, [r7, #4]
- st_word(dir + DIR_FstClusLO, (WORD)cl);
- 8004e90: 68bb ldr r3, [r7, #8]
- 8004e92: 331a adds r3, #26
- 8004e94: 687a ldr r2, [r7, #4]
- 8004e96: b292 uxth r2, r2
- 8004e98: 4611 mov r1, r2
- 8004e9a: 4618 mov r0, r3
- 8004e9c: f7fe ffef bl 8003e7e <st_word>
- if (fs->fs_type == FS_FAT32) {
- 8004ea0: 68fb ldr r3, [r7, #12]
- 8004ea2: 781b ldrb r3, [r3, #0]
- 8004ea4: 2b03 cmp r3, #3
- 8004ea6: d109 bne.n 8004ebc <st_clust+0x38>
- st_word(dir + DIR_FstClusHI, (WORD)(cl >> 16));
- 8004ea8: 68bb ldr r3, [r7, #8]
- 8004eaa: f103 0214 add.w r2, r3, #20
- 8004eae: 687b ldr r3, [r7, #4]
- 8004eb0: 0c1b lsrs r3, r3, #16
- 8004eb2: b29b uxth r3, r3
- 8004eb4: 4619 mov r1, r3
- 8004eb6: 4610 mov r0, r2
- 8004eb8: f7fe ffe1 bl 8003e7e <st_word>
- }
- }
- 8004ebc: bf00 nop
- 8004ebe: 3710 adds r7, #16
- 8004ec0: 46bd mov sp, r7
- 8004ec2: bd80 pop {r7, pc}
-
- 08004ec4 <cmp_lfn>:
- static
- int cmp_lfn ( /* 1:matched, 0:not matched */
- const WCHAR* lfnbuf, /* Pointer to the LFN working buffer to be compared */
- BYTE* dir /* Pointer to the directory entry containing the part of LFN */
- )
- {
- 8004ec4: b590 push {r4, r7, lr}
- 8004ec6: b087 sub sp, #28
- 8004ec8: af00 add r7, sp, #0
- 8004eca: 6078 str r0, [r7, #4]
- 8004ecc: 6039 str r1, [r7, #0]
- UINT i, s;
- WCHAR wc, uc;
-
-
- if (ld_word(dir + LDIR_FstClusLO) != 0) return 0; /* Check LDIR_FstClusLO */
- 8004ece: 683b ldr r3, [r7, #0]
- 8004ed0: 331a adds r3, #26
- 8004ed2: 4618 mov r0, r3
- 8004ed4: f7fe ff9a bl 8003e0c <ld_word>
- 8004ed8: 4603 mov r3, r0
- 8004eda: 2b00 cmp r3, #0
- 8004edc: d001 beq.n 8004ee2 <cmp_lfn+0x1e>
- 8004ede: 2300 movs r3, #0
- 8004ee0: e059 b.n 8004f96 <cmp_lfn+0xd2>
-
- i = ((dir[LDIR_Ord] & 0x3F) - 1) * 13; /* Offset in the LFN buffer */
- 8004ee2: 683b ldr r3, [r7, #0]
- 8004ee4: 781b ldrb r3, [r3, #0]
- 8004ee6: f003 033f and.w r3, r3, #63 ; 0x3f
- 8004eea: 1e5a subs r2, r3, #1
- 8004eec: 4613 mov r3, r2
- 8004eee: 005b lsls r3, r3, #1
- 8004ef0: 4413 add r3, r2
- 8004ef2: 009b lsls r3, r3, #2
- 8004ef4: 4413 add r3, r2
- 8004ef6: 617b str r3, [r7, #20]
-
- for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */
- 8004ef8: 2301 movs r3, #1
- 8004efa: 81fb strh r3, [r7, #14]
- 8004efc: 2300 movs r3, #0
- 8004efe: 613b str r3, [r7, #16]
- 8004f00: e033 b.n 8004f6a <cmp_lfn+0xa6>
- uc = ld_word(dir + LfnOfs[s]); /* Pick an LFN character */
- 8004f02: 4a27 ldr r2, [pc, #156] ; (8004fa0 <cmp_lfn+0xdc>)
- 8004f04: 693b ldr r3, [r7, #16]
- 8004f06: 4413 add r3, r2
- 8004f08: 781b ldrb r3, [r3, #0]
- 8004f0a: 461a mov r2, r3
- 8004f0c: 683b ldr r3, [r7, #0]
- 8004f0e: 4413 add r3, r2
- 8004f10: 4618 mov r0, r3
- 8004f12: f7fe ff7b bl 8003e0c <ld_word>
- 8004f16: 4603 mov r3, r0
- 8004f18: 81bb strh r3, [r7, #12]
- if (wc) {
- 8004f1a: 89fb ldrh r3, [r7, #14]
- 8004f1c: 2b00 cmp r3, #0
- 8004f1e: d01a beq.n 8004f56 <cmp_lfn+0x92>
- if (i >= _MAX_LFN || ff_wtoupper(uc) != ff_wtoupper(lfnbuf[i++])) { /* Compare it */
- 8004f20: 697b ldr r3, [r7, #20]
- 8004f22: 2bfe cmp r3, #254 ; 0xfe
- 8004f24: d812 bhi.n 8004f4c <cmp_lfn+0x88>
- 8004f26: 89bb ldrh r3, [r7, #12]
- 8004f28: 4618 mov r0, r3
- 8004f2a: f002 f85f bl 8006fec <ff_wtoupper>
- 8004f2e: 4603 mov r3, r0
- 8004f30: 461c mov r4, r3
- 8004f32: 697b ldr r3, [r7, #20]
- 8004f34: 1c5a adds r2, r3, #1
- 8004f36: 617a str r2, [r7, #20]
- 8004f38: 005b lsls r3, r3, #1
- 8004f3a: 687a ldr r2, [r7, #4]
- 8004f3c: 4413 add r3, r2
- 8004f3e: 881b ldrh r3, [r3, #0]
- 8004f40: 4618 mov r0, r3
- 8004f42: f002 f853 bl 8006fec <ff_wtoupper>
- 8004f46: 4603 mov r3, r0
- 8004f48: 429c cmp r4, r3
- 8004f4a: d001 beq.n 8004f50 <cmp_lfn+0x8c>
- return 0; /* Not matched */
- 8004f4c: 2300 movs r3, #0
- 8004f4e: e022 b.n 8004f96 <cmp_lfn+0xd2>
- }
- wc = uc;
- 8004f50: 89bb ldrh r3, [r7, #12]
- 8004f52: 81fb strh r3, [r7, #14]
- 8004f54: e006 b.n 8004f64 <cmp_lfn+0xa0>
- } else {
- if (uc != 0xFFFF) return 0; /* Check filler */
- 8004f56: 89bb ldrh r3, [r7, #12]
- 8004f58: f64f 72ff movw r2, #65535 ; 0xffff
- 8004f5c: 4293 cmp r3, r2
- 8004f5e: d001 beq.n 8004f64 <cmp_lfn+0xa0>
- 8004f60: 2300 movs r3, #0
- 8004f62: e018 b.n 8004f96 <cmp_lfn+0xd2>
- for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */
- 8004f64: 693b ldr r3, [r7, #16]
- 8004f66: 3301 adds r3, #1
- 8004f68: 613b str r3, [r7, #16]
- 8004f6a: 693b ldr r3, [r7, #16]
- 8004f6c: 2b0c cmp r3, #12
- 8004f6e: d9c8 bls.n 8004f02 <cmp_lfn+0x3e>
- }
- }
-
- if ((dir[LDIR_Ord] & LLEF) && wc && lfnbuf[i]) return 0; /* Last segment matched but different length */
- 8004f70: 683b ldr r3, [r7, #0]
- 8004f72: 781b ldrb r3, [r3, #0]
- 8004f74: f003 0340 and.w r3, r3, #64 ; 0x40
- 8004f78: 2b00 cmp r3, #0
- 8004f7a: d00b beq.n 8004f94 <cmp_lfn+0xd0>
- 8004f7c: 89fb ldrh r3, [r7, #14]
- 8004f7e: 2b00 cmp r3, #0
- 8004f80: d008 beq.n 8004f94 <cmp_lfn+0xd0>
- 8004f82: 697b ldr r3, [r7, #20]
- 8004f84: 005b lsls r3, r3, #1
- 8004f86: 687a ldr r2, [r7, #4]
- 8004f88: 4413 add r3, r2
- 8004f8a: 881b ldrh r3, [r3, #0]
- 8004f8c: 2b00 cmp r3, #0
- 8004f8e: d001 beq.n 8004f94 <cmp_lfn+0xd0>
- 8004f90: 2300 movs r3, #0
- 8004f92: e000 b.n 8004f96 <cmp_lfn+0xd2>
-
- return 1; /* The part of LFN matched */
- 8004f94: 2301 movs r3, #1
- }
- 8004f96: 4618 mov r0, r3
- 8004f98: 371c adds r7, #28
- 8004f9a: 46bd mov sp, r7
- 8004f9c: bd90 pop {r4, r7, pc}
- 8004f9e: bf00 nop
- 8004fa0: 08007bc8 .word 0x08007bc8
-
- 08004fa4 <put_lfn>:
- const WCHAR* lfn, /* Pointer to the LFN */
- BYTE* dir, /* Pointer to the LFN entry to be created */
- BYTE ord, /* LFN order (1-20) */
- BYTE sum /* Checksum of the corresponding SFN */
- )
- {
- 8004fa4: b580 push {r7, lr}
- 8004fa6: b088 sub sp, #32
- 8004fa8: af00 add r7, sp, #0
- 8004faa: 60f8 str r0, [r7, #12]
- 8004fac: 60b9 str r1, [r7, #8]
- 8004fae: 4611 mov r1, r2
- 8004fb0: 461a mov r2, r3
- 8004fb2: 460b mov r3, r1
- 8004fb4: 71fb strb r3, [r7, #7]
- 8004fb6: 4613 mov r3, r2
- 8004fb8: 71bb strb r3, [r7, #6]
- UINT i, s;
- WCHAR wc;
-
-
- dir[LDIR_Chksum] = sum; /* Set checksum */
- 8004fba: 68bb ldr r3, [r7, #8]
- 8004fbc: 330d adds r3, #13
- 8004fbe: 79ba ldrb r2, [r7, #6]
- 8004fc0: 701a strb r2, [r3, #0]
- dir[LDIR_Attr] = AM_LFN; /* Set attribute. LFN entry */
- 8004fc2: 68bb ldr r3, [r7, #8]
- 8004fc4: 330b adds r3, #11
- 8004fc6: 220f movs r2, #15
- 8004fc8: 701a strb r2, [r3, #0]
- dir[LDIR_Type] = 0;
- 8004fca: 68bb ldr r3, [r7, #8]
- 8004fcc: 330c adds r3, #12
- 8004fce: 2200 movs r2, #0
- 8004fd0: 701a strb r2, [r3, #0]
- st_word(dir + LDIR_FstClusLO, 0);
- 8004fd2: 68bb ldr r3, [r7, #8]
- 8004fd4: 331a adds r3, #26
- 8004fd6: 2100 movs r1, #0
- 8004fd8: 4618 mov r0, r3
- 8004fda: f7fe ff50 bl 8003e7e <st_word>
-
- i = (ord - 1) * 13; /* Get offset in the LFN working buffer */
- 8004fde: 79fb ldrb r3, [r7, #7]
- 8004fe0: 1e5a subs r2, r3, #1
- 8004fe2: 4613 mov r3, r2
- 8004fe4: 005b lsls r3, r3, #1
- 8004fe6: 4413 add r3, r2
- 8004fe8: 009b lsls r3, r3, #2
- 8004fea: 4413 add r3, r2
- 8004fec: 61fb str r3, [r7, #28]
- s = wc = 0;
- 8004fee: 2300 movs r3, #0
- 8004ff0: 82fb strh r3, [r7, #22]
- 8004ff2: 2300 movs r3, #0
- 8004ff4: 61bb str r3, [r7, #24]
- do {
- if (wc != 0xFFFF) wc = lfn[i++]; /* Get an effective character */
- 8004ff6: 8afb ldrh r3, [r7, #22]
- 8004ff8: f64f 72ff movw r2, #65535 ; 0xffff
- 8004ffc: 4293 cmp r3, r2
- 8004ffe: d007 beq.n 8005010 <put_lfn+0x6c>
- 8005000: 69fb ldr r3, [r7, #28]
- 8005002: 1c5a adds r2, r3, #1
- 8005004: 61fa str r2, [r7, #28]
- 8005006: 005b lsls r3, r3, #1
- 8005008: 68fa ldr r2, [r7, #12]
- 800500a: 4413 add r3, r2
- 800500c: 881b ldrh r3, [r3, #0]
- 800500e: 82fb strh r3, [r7, #22]
- st_word(dir + LfnOfs[s], wc); /* Put it */
- 8005010: 4a17 ldr r2, [pc, #92] ; (8005070 <put_lfn+0xcc>)
- 8005012: 69bb ldr r3, [r7, #24]
- 8005014: 4413 add r3, r2
- 8005016: 781b ldrb r3, [r3, #0]
- 8005018: 461a mov r2, r3
- 800501a: 68bb ldr r3, [r7, #8]
- 800501c: 4413 add r3, r2
- 800501e: 8afa ldrh r2, [r7, #22]
- 8005020: 4611 mov r1, r2
- 8005022: 4618 mov r0, r3
- 8005024: f7fe ff2b bl 8003e7e <st_word>
- if (wc == 0) wc = 0xFFFF; /* Padding characters for left locations */
- 8005028: 8afb ldrh r3, [r7, #22]
- 800502a: 2b00 cmp r3, #0
- 800502c: d102 bne.n 8005034 <put_lfn+0x90>
- 800502e: f64f 73ff movw r3, #65535 ; 0xffff
- 8005032: 82fb strh r3, [r7, #22]
- } while (++s < 13);
- 8005034: 69bb ldr r3, [r7, #24]
- 8005036: 3301 adds r3, #1
- 8005038: 61bb str r3, [r7, #24]
- 800503a: 69bb ldr r3, [r7, #24]
- 800503c: 2b0c cmp r3, #12
- 800503e: d9da bls.n 8004ff6 <put_lfn+0x52>
- if (wc == 0xFFFF || !lfn[i]) ord |= LLEF; /* Last LFN part is the start of LFN sequence */
- 8005040: 8afb ldrh r3, [r7, #22]
- 8005042: f64f 72ff movw r2, #65535 ; 0xffff
- 8005046: 4293 cmp r3, r2
- 8005048: d006 beq.n 8005058 <put_lfn+0xb4>
- 800504a: 69fb ldr r3, [r7, #28]
- 800504c: 005b lsls r3, r3, #1
- 800504e: 68fa ldr r2, [r7, #12]
- 8005050: 4413 add r3, r2
- 8005052: 881b ldrh r3, [r3, #0]
- 8005054: 2b00 cmp r3, #0
- 8005056: d103 bne.n 8005060 <put_lfn+0xbc>
- 8005058: 79fb ldrb r3, [r7, #7]
- 800505a: f043 0340 orr.w r3, r3, #64 ; 0x40
- 800505e: 71fb strb r3, [r7, #7]
- dir[LDIR_Ord] = ord; /* Set the LFN order */
- 8005060: 68bb ldr r3, [r7, #8]
- 8005062: 79fa ldrb r2, [r7, #7]
- 8005064: 701a strb r2, [r3, #0]
- }
- 8005066: bf00 nop
- 8005068: 3720 adds r7, #32
- 800506a: 46bd mov sp, r7
- 800506c: bd80 pop {r7, pc}
- 800506e: bf00 nop
- 8005070: 08007bc8 .word 0x08007bc8
-
- 08005074 <gen_numname>:
- BYTE* dst, /* Pointer to the buffer to store numbered SFN */
- const BYTE* src, /* Pointer to SFN */
- const WCHAR* lfn, /* Pointer to LFN */
- UINT seq /* Sequence number */
- )
- {
- 8005074: b580 push {r7, lr}
- 8005076: b08c sub sp, #48 ; 0x30
- 8005078: af00 add r7, sp, #0
- 800507a: 60f8 str r0, [r7, #12]
- 800507c: 60b9 str r1, [r7, #8]
- 800507e: 607a str r2, [r7, #4]
- 8005080: 603b str r3, [r7, #0]
- UINT i, j;
- WCHAR wc;
- DWORD sr;
-
-
- mem_cpy(dst, src, 11);
- 8005082: 220b movs r2, #11
- 8005084: 68b9 ldr r1, [r7, #8]
- 8005086: 68f8 ldr r0, [r7, #12]
- 8005088: f7fe ff3e bl 8003f08 <mem_cpy>
-
- if (seq > 5) { /* In case of many collisions, generate a hash number instead of sequential number */
- 800508c: 683b ldr r3, [r7, #0]
- 800508e: 2b05 cmp r3, #5
- 8005090: d92b bls.n 80050ea <gen_numname+0x76>
- sr = seq;
- 8005092: 683b ldr r3, [r7, #0]
- 8005094: 61fb str r3, [r7, #28]
- while (*lfn) { /* Create a CRC */
- 8005096: e022 b.n 80050de <gen_numname+0x6a>
- wc = *lfn++;
- 8005098: 687b ldr r3, [r7, #4]
- 800509a: 1c9a adds r2, r3, #2
- 800509c: 607a str r2, [r7, #4]
- 800509e: 881b ldrh r3, [r3, #0]
- 80050a0: 847b strh r3, [r7, #34] ; 0x22
- for (i = 0; i < 16; i++) {
- 80050a2: 2300 movs r3, #0
- 80050a4: 62bb str r3, [r7, #40] ; 0x28
- 80050a6: e017 b.n 80050d8 <gen_numname+0x64>
- sr = (sr << 1) + (wc & 1);
- 80050a8: 69fb ldr r3, [r7, #28]
- 80050aa: 005a lsls r2, r3, #1
- 80050ac: 8c7b ldrh r3, [r7, #34] ; 0x22
- 80050ae: f003 0301 and.w r3, r3, #1
- 80050b2: 4413 add r3, r2
- 80050b4: 61fb str r3, [r7, #28]
- wc >>= 1;
- 80050b6: 8c7b ldrh r3, [r7, #34] ; 0x22
- 80050b8: 085b lsrs r3, r3, #1
- 80050ba: 847b strh r3, [r7, #34] ; 0x22
- if (sr & 0x10000) sr ^= 0x11021;
- 80050bc: 69fb ldr r3, [r7, #28]
- 80050be: f403 3380 and.w r3, r3, #65536 ; 0x10000
- 80050c2: 2b00 cmp r3, #0
- 80050c4: d005 beq.n 80050d2 <gen_numname+0x5e>
- 80050c6: 69fb ldr r3, [r7, #28]
- 80050c8: f483 3388 eor.w r3, r3, #69632 ; 0x11000
- 80050cc: f083 0321 eor.w r3, r3, #33 ; 0x21
- 80050d0: 61fb str r3, [r7, #28]
- for (i = 0; i < 16; i++) {
- 80050d2: 6abb ldr r3, [r7, #40] ; 0x28
- 80050d4: 3301 adds r3, #1
- 80050d6: 62bb str r3, [r7, #40] ; 0x28
- 80050d8: 6abb ldr r3, [r7, #40] ; 0x28
- 80050da: 2b0f cmp r3, #15
- 80050dc: d9e4 bls.n 80050a8 <gen_numname+0x34>
- while (*lfn) { /* Create a CRC */
- 80050de: 687b ldr r3, [r7, #4]
- 80050e0: 881b ldrh r3, [r3, #0]
- 80050e2: 2b00 cmp r3, #0
- 80050e4: d1d8 bne.n 8005098 <gen_numname+0x24>
- }
- }
- seq = (UINT)sr;
- 80050e6: 69fb ldr r3, [r7, #28]
- 80050e8: 603b str r3, [r7, #0]
- }
-
- /* itoa (hexdecimal) */
- i = 7;
- 80050ea: 2307 movs r3, #7
- 80050ec: 62bb str r3, [r7, #40] ; 0x28
- do {
- c = (BYTE)((seq % 16) + '0');
- 80050ee: 683b ldr r3, [r7, #0]
- 80050f0: b2db uxtb r3, r3
- 80050f2: f003 030f and.w r3, r3, #15
- 80050f6: b2db uxtb r3, r3
- 80050f8: 3330 adds r3, #48 ; 0x30
- 80050fa: f887 302f strb.w r3, [r7, #47] ; 0x2f
- if (c > '9') c += 7;
- 80050fe: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 8005102: 2b39 cmp r3, #57 ; 0x39
- 8005104: d904 bls.n 8005110 <gen_numname+0x9c>
- 8005106: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 800510a: 3307 adds r3, #7
- 800510c: f887 302f strb.w r3, [r7, #47] ; 0x2f
- ns[i--] = c;
- 8005110: 6abb ldr r3, [r7, #40] ; 0x28
- 8005112: 1e5a subs r2, r3, #1
- 8005114: 62ba str r2, [r7, #40] ; 0x28
- 8005116: f107 0230 add.w r2, r7, #48 ; 0x30
- 800511a: 4413 add r3, r2
- 800511c: f897 202f ldrb.w r2, [r7, #47] ; 0x2f
- 8005120: f803 2c1c strb.w r2, [r3, #-28]
- seq /= 16;
- 8005124: 683b ldr r3, [r7, #0]
- 8005126: 091b lsrs r3, r3, #4
- 8005128: 603b str r3, [r7, #0]
- } while (seq);
- 800512a: 683b ldr r3, [r7, #0]
- 800512c: 2b00 cmp r3, #0
- 800512e: d1de bne.n 80050ee <gen_numname+0x7a>
- ns[i] = '~';
- 8005130: f107 0214 add.w r2, r7, #20
- 8005134: 6abb ldr r3, [r7, #40] ; 0x28
- 8005136: 4413 add r3, r2
- 8005138: 227e movs r2, #126 ; 0x7e
- 800513a: 701a strb r2, [r3, #0]
-
- /* Append the number */
- for (j = 0; j < i && dst[j] != ' '; j++) {
- 800513c: 2300 movs r3, #0
- 800513e: 627b str r3, [r7, #36] ; 0x24
- 8005140: e002 b.n 8005148 <gen_numname+0xd4>
- 8005142: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005144: 3301 adds r3, #1
- 8005146: 627b str r3, [r7, #36] ; 0x24
- 8005148: 6a7a ldr r2, [r7, #36] ; 0x24
- 800514a: 6abb ldr r3, [r7, #40] ; 0x28
- 800514c: 429a cmp r2, r3
- 800514e: d205 bcs.n 800515c <gen_numname+0xe8>
- 8005150: 68fa ldr r2, [r7, #12]
- 8005152: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005154: 4413 add r3, r2
- 8005156: 781b ldrb r3, [r3, #0]
- 8005158: 2b20 cmp r3, #32
- 800515a: d1f2 bne.n 8005142 <gen_numname+0xce>
- if (j == i - 1) break;
- j++;
- }
- }
- do {
- dst[j++] = (i < 8) ? ns[i++] : ' ';
- 800515c: 6abb ldr r3, [r7, #40] ; 0x28
- 800515e: 2b07 cmp r3, #7
- 8005160: d808 bhi.n 8005174 <gen_numname+0x100>
- 8005162: 6abb ldr r3, [r7, #40] ; 0x28
- 8005164: 1c5a adds r2, r3, #1
- 8005166: 62ba str r2, [r7, #40] ; 0x28
- 8005168: f107 0230 add.w r2, r7, #48 ; 0x30
- 800516c: 4413 add r3, r2
- 800516e: f813 1c1c ldrb.w r1, [r3, #-28]
- 8005172: e000 b.n 8005176 <gen_numname+0x102>
- 8005174: 2120 movs r1, #32
- 8005176: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005178: 1c5a adds r2, r3, #1
- 800517a: 627a str r2, [r7, #36] ; 0x24
- 800517c: 68fa ldr r2, [r7, #12]
- 800517e: 4413 add r3, r2
- 8005180: 460a mov r2, r1
- 8005182: 701a strb r2, [r3, #0]
- } while (j < 8);
- 8005184: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005186: 2b07 cmp r3, #7
- 8005188: d9e8 bls.n 800515c <gen_numname+0xe8>
- }
- 800518a: bf00 nop
- 800518c: 3730 adds r7, #48 ; 0x30
- 800518e: 46bd mov sp, r7
- 8005190: bd80 pop {r7, pc}
-
- 08005192 <sum_sfn>:
-
- static
- BYTE sum_sfn (
- const BYTE* dir /* Pointer to the SFN entry */
- )
- {
- 8005192: b480 push {r7}
- 8005194: b085 sub sp, #20
- 8005196: af00 add r7, sp, #0
- 8005198: 6078 str r0, [r7, #4]
- BYTE sum = 0;
- 800519a: 2300 movs r3, #0
- 800519c: 73fb strb r3, [r7, #15]
- UINT n = 11;
- 800519e: 230b movs r3, #11
- 80051a0: 60bb str r3, [r7, #8]
-
- do {
- sum = (sum >> 1) + (sum << 7) + *dir++;
- 80051a2: 7bfb ldrb r3, [r7, #15]
- 80051a4: b2da uxtb r2, r3
- 80051a6: 0852 lsrs r2, r2, #1
- 80051a8: 01db lsls r3, r3, #7
- 80051aa: 4313 orrs r3, r2
- 80051ac: b2da uxtb r2, r3
- 80051ae: 687b ldr r3, [r7, #4]
- 80051b0: 1c59 adds r1, r3, #1
- 80051b2: 6079 str r1, [r7, #4]
- 80051b4: 781b ldrb r3, [r3, #0]
- 80051b6: 4413 add r3, r2
- 80051b8: 73fb strb r3, [r7, #15]
- } while (--n);
- 80051ba: 68bb ldr r3, [r7, #8]
- 80051bc: 3b01 subs r3, #1
- 80051be: 60bb str r3, [r7, #8]
- 80051c0: 68bb ldr r3, [r7, #8]
- 80051c2: 2b00 cmp r3, #0
- 80051c4: d1ed bne.n 80051a2 <sum_sfn+0x10>
- return sum;
- 80051c6: 7bfb ldrb r3, [r7, #15]
- }
- 80051c8: 4618 mov r0, r3
- 80051ca: 3714 adds r7, #20
- 80051cc: 46bd mov sp, r7
- 80051ce: bc80 pop {r7}
- 80051d0: 4770 bx lr
-
- 080051d2 <dir_find>:
-
- static
- FRESULT dir_find ( /* FR_OK(0):succeeded, !=0:error */
- DIR* dp /* Pointer to the directory object with the file name */
- )
- {
- 80051d2: b580 push {r7, lr}
- 80051d4: b086 sub sp, #24
- 80051d6: af00 add r7, sp, #0
- 80051d8: 6078 str r0, [r7, #4]
- FRESULT res;
- FATFS *fs = dp->obj.fs;
- 80051da: 687b ldr r3, [r7, #4]
- 80051dc: 681b ldr r3, [r3, #0]
- 80051de: 613b str r3, [r7, #16]
- BYTE c;
- #if _USE_LFN != 0
- BYTE a, ord, sum;
- #endif
-
- res = dir_sdi(dp, 0); /* Rewind directory object */
- 80051e0: 2100 movs r1, #0
- 80051e2: 6878 ldr r0, [r7, #4]
- 80051e4: f7ff fc89 bl 8004afa <dir_sdi>
- 80051e8: 4603 mov r3, r0
- 80051ea: 75fb strb r3, [r7, #23]
- if (res != FR_OK) return res;
- 80051ec: 7dfb ldrb r3, [r7, #23]
- 80051ee: 2b00 cmp r3, #0
- 80051f0: d001 beq.n 80051f6 <dir_find+0x24>
- 80051f2: 7dfb ldrb r3, [r7, #23]
- 80051f4: e0a9 b.n 800534a <dir_find+0x178>
- return res;
- }
- #endif
- /* On the FAT12/16/32 volume */
- #if _USE_LFN != 0
- ord = sum = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */
- 80051f6: 23ff movs r3, #255 ; 0xff
- 80051f8: 753b strb r3, [r7, #20]
- 80051fa: 7d3b ldrb r3, [r7, #20]
- 80051fc: 757b strb r3, [r7, #21]
- 80051fe: 687b ldr r3, [r7, #4]
- 8005200: f04f 32ff mov.w r2, #4294967295
- 8005204: 631a str r2, [r3, #48] ; 0x30
- #endif
- do {
- res = move_window(fs, dp->sect);
- 8005206: 687b ldr r3, [r7, #4]
- 8005208: 69db ldr r3, [r3, #28]
- 800520a: 4619 mov r1, r3
- 800520c: 6938 ldr r0, [r7, #16]
- 800520e: f7ff f89d bl 800434c <move_window>
- 8005212: 4603 mov r3, r0
- 8005214: 75fb strb r3, [r7, #23]
- if (res != FR_OK) break;
- 8005216: 7dfb ldrb r3, [r7, #23]
- 8005218: 2b00 cmp r3, #0
- 800521a: f040 8090 bne.w 800533e <dir_find+0x16c>
- c = dp->dir[DIR_Name];
- 800521e: 687b ldr r3, [r7, #4]
- 8005220: 6a1b ldr r3, [r3, #32]
- 8005222: 781b ldrb r3, [r3, #0]
- 8005224: 75bb strb r3, [r7, #22]
- if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
- 8005226: 7dbb ldrb r3, [r7, #22]
- 8005228: 2b00 cmp r3, #0
- 800522a: d102 bne.n 8005232 <dir_find+0x60>
- 800522c: 2304 movs r3, #4
- 800522e: 75fb strb r3, [r7, #23]
- 8005230: e08a b.n 8005348 <dir_find+0x176>
- #if _USE_LFN != 0 /* LFN configuration */
- dp->obj.attr = a = dp->dir[DIR_Attr] & AM_MASK;
- 8005232: 687b ldr r3, [r7, #4]
- 8005234: 6a1b ldr r3, [r3, #32]
- 8005236: 330b adds r3, #11
- 8005238: 781b ldrb r3, [r3, #0]
- 800523a: f003 033f and.w r3, r3, #63 ; 0x3f
- 800523e: 73fb strb r3, [r7, #15]
- 8005240: 687b ldr r3, [r7, #4]
- 8005242: 7bfa ldrb r2, [r7, #15]
- 8005244: 719a strb r2, [r3, #6]
- if (c == DDEM || ((a & AM_VOL) && a != AM_LFN)) { /* An entry without valid data */
- 8005246: 7dbb ldrb r3, [r7, #22]
- 8005248: 2be5 cmp r3, #229 ; 0xe5
- 800524a: d007 beq.n 800525c <dir_find+0x8a>
- 800524c: 7bfb ldrb r3, [r7, #15]
- 800524e: f003 0308 and.w r3, r3, #8
- 8005252: 2b00 cmp r3, #0
- 8005254: d009 beq.n 800526a <dir_find+0x98>
- 8005256: 7bfb ldrb r3, [r7, #15]
- 8005258: 2b0f cmp r3, #15
- 800525a: d006 beq.n 800526a <dir_find+0x98>
- ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */
- 800525c: 23ff movs r3, #255 ; 0xff
- 800525e: 757b strb r3, [r7, #21]
- 8005260: 687b ldr r3, [r7, #4]
- 8005262: f04f 32ff mov.w r2, #4294967295
- 8005266: 631a str r2, [r3, #48] ; 0x30
- 8005268: e05e b.n 8005328 <dir_find+0x156>
- } else {
- if (a == AM_LFN) { /* An LFN entry is found */
- 800526a: 7bfb ldrb r3, [r7, #15]
- 800526c: 2b0f cmp r3, #15
- 800526e: d136 bne.n 80052de <dir_find+0x10c>
- if (!(dp->fn[NSFLAG] & NS_NOLFN)) {
- 8005270: 687b ldr r3, [r7, #4]
- 8005272: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
- 8005276: f003 0340 and.w r3, r3, #64 ; 0x40
- 800527a: 2b00 cmp r3, #0
- 800527c: d154 bne.n 8005328 <dir_find+0x156>
- if (c & LLEF) { /* Is it start of LFN sequence? */
- 800527e: 7dbb ldrb r3, [r7, #22]
- 8005280: f003 0340 and.w r3, r3, #64 ; 0x40
- 8005284: 2b00 cmp r3, #0
- 8005286: d00d beq.n 80052a4 <dir_find+0xd2>
- sum = dp->dir[LDIR_Chksum];
- 8005288: 687b ldr r3, [r7, #4]
- 800528a: 6a1b ldr r3, [r3, #32]
- 800528c: 7b5b ldrb r3, [r3, #13]
- 800528e: 753b strb r3, [r7, #20]
- c &= (BYTE)~LLEF; ord = c; /* LFN start order */
- 8005290: 7dbb ldrb r3, [r7, #22]
- 8005292: f023 0340 bic.w r3, r3, #64 ; 0x40
- 8005296: 75bb strb r3, [r7, #22]
- 8005298: 7dbb ldrb r3, [r7, #22]
- 800529a: 757b strb r3, [r7, #21]
- dp->blk_ofs = dp->dptr; /* Start offset of LFN */
- 800529c: 687b ldr r3, [r7, #4]
- 800529e: 695a ldr r2, [r3, #20]
- 80052a0: 687b ldr r3, [r7, #4]
- 80052a2: 631a str r2, [r3, #48] ; 0x30
- }
- /* Check validity of the LFN entry and compare it with given name */
- ord = (c == ord && sum == dp->dir[LDIR_Chksum] && cmp_lfn(fs->lfnbuf, dp->dir)) ? ord - 1 : 0xFF;
- 80052a4: 7dba ldrb r2, [r7, #22]
- 80052a6: 7d7b ldrb r3, [r7, #21]
- 80052a8: 429a cmp r2, r3
- 80052aa: d115 bne.n 80052d8 <dir_find+0x106>
- 80052ac: 687b ldr r3, [r7, #4]
- 80052ae: 6a1b ldr r3, [r3, #32]
- 80052b0: 330d adds r3, #13
- 80052b2: 781b ldrb r3, [r3, #0]
- 80052b4: 7d3a ldrb r2, [r7, #20]
- 80052b6: 429a cmp r2, r3
- 80052b8: d10e bne.n 80052d8 <dir_find+0x106>
- 80052ba: 693b ldr r3, [r7, #16]
- 80052bc: 691a ldr r2, [r3, #16]
- 80052be: 687b ldr r3, [r7, #4]
- 80052c0: 6a1b ldr r3, [r3, #32]
- 80052c2: 4619 mov r1, r3
- 80052c4: 4610 mov r0, r2
- 80052c6: f7ff fdfd bl 8004ec4 <cmp_lfn>
- 80052ca: 4603 mov r3, r0
- 80052cc: 2b00 cmp r3, #0
- 80052ce: d003 beq.n 80052d8 <dir_find+0x106>
- 80052d0: 7d7b ldrb r3, [r7, #21]
- 80052d2: 3b01 subs r3, #1
- 80052d4: b2db uxtb r3, r3
- 80052d6: e000 b.n 80052da <dir_find+0x108>
- 80052d8: 23ff movs r3, #255 ; 0xff
- 80052da: 757b strb r3, [r7, #21]
- 80052dc: e024 b.n 8005328 <dir_find+0x156>
- }
- } else { /* An SFN entry is found */
- if (!ord && sum == sum_sfn(dp->dir)) break; /* LFN matched? */
- 80052de: 7d7b ldrb r3, [r7, #21]
- 80052e0: 2b00 cmp r3, #0
- 80052e2: d109 bne.n 80052f8 <dir_find+0x126>
- 80052e4: 687b ldr r3, [r7, #4]
- 80052e6: 6a1b ldr r3, [r3, #32]
- 80052e8: 4618 mov r0, r3
- 80052ea: f7ff ff52 bl 8005192 <sum_sfn>
- 80052ee: 4603 mov r3, r0
- 80052f0: 461a mov r2, r3
- 80052f2: 7d3b ldrb r3, [r7, #20]
- 80052f4: 4293 cmp r3, r2
- 80052f6: d024 beq.n 8005342 <dir_find+0x170>
- if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* SFN matched? */
- 80052f8: 687b ldr r3, [r7, #4]
- 80052fa: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
- 80052fe: f003 0301 and.w r3, r3, #1
- 8005302: 2b00 cmp r3, #0
- 8005304: d10a bne.n 800531c <dir_find+0x14a>
- 8005306: 687b ldr r3, [r7, #4]
- 8005308: 6a18 ldr r0, [r3, #32]
- 800530a: 687b ldr r3, [r7, #4]
- 800530c: 3324 adds r3, #36 ; 0x24
- 800530e: 220b movs r2, #11
- 8005310: 4619 mov r1, r3
- 8005312: f7fe fe32 bl 8003f7a <mem_cmp>
- 8005316: 4603 mov r3, r0
- 8005318: 2b00 cmp r3, #0
- 800531a: d014 beq.n 8005346 <dir_find+0x174>
- ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */
- 800531c: 23ff movs r3, #255 ; 0xff
- 800531e: 757b strb r3, [r7, #21]
- 8005320: 687b ldr r3, [r7, #4]
- 8005322: f04f 32ff mov.w r2, #4294967295
- 8005326: 631a str r2, [r3, #48] ; 0x30
- }
- #else /* Non LFN configuration */
- dp->obj.attr = dp->dir[DIR_Attr] & AM_MASK;
- if (!(dp->dir[DIR_Attr] & AM_VOL) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* Is it a valid entry? */
- #endif
- res = dir_next(dp, 0); /* Next entry */
- 8005328: 2100 movs r1, #0
- 800532a: 6878 ldr r0, [r7, #4]
- 800532c: f7ff fc6e bl 8004c0c <dir_next>
- 8005330: 4603 mov r3, r0
- 8005332: 75fb strb r3, [r7, #23]
- } while (res == FR_OK);
- 8005334: 7dfb ldrb r3, [r7, #23]
- 8005336: 2b00 cmp r3, #0
- 8005338: f43f af65 beq.w 8005206 <dir_find+0x34>
- 800533c: e004 b.n 8005348 <dir_find+0x176>
- if (res != FR_OK) break;
- 800533e: bf00 nop
- 8005340: e002 b.n 8005348 <dir_find+0x176>
- if (!ord && sum == sum_sfn(dp->dir)) break; /* LFN matched? */
- 8005342: bf00 nop
- 8005344: e000 b.n 8005348 <dir_find+0x176>
- if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* SFN matched? */
- 8005346: bf00 nop
-
- return res;
- 8005348: 7dfb ldrb r3, [r7, #23]
- }
- 800534a: 4618 mov r0, r3
- 800534c: 3718 adds r7, #24
- 800534e: 46bd mov sp, r7
- 8005350: bd80 pop {r7, pc}
- ...
-
- 08005354 <dir_register>:
-
- static
- FRESULT dir_register ( /* FR_OK:succeeded, FR_DENIED:no free entry or too many SFN collision, FR_DISK_ERR:disk error */
- DIR* dp /* Target directory with object name to be created */
- )
- {
- 8005354: b580 push {r7, lr}
- 8005356: b08c sub sp, #48 ; 0x30
- 8005358: af00 add r7, sp, #0
- 800535a: 6078 str r0, [r7, #4]
- FRESULT res;
- FATFS *fs = dp->obj.fs;
- 800535c: 687b ldr r3, [r7, #4]
- 800535e: 681b ldr r3, [r3, #0]
- 8005360: 61fb str r3, [r7, #28]
- #if _USE_LFN != 0 /* LFN configuration */
- UINT n, nlen, nent;
- BYTE sn[12], sum;
-
-
- if (dp->fn[NSFLAG] & (NS_DOT | NS_NONAME)) return FR_INVALID_NAME; /* Check name validity */
- 8005362: 687b ldr r3, [r7, #4]
- 8005364: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
- 8005368: f003 03a0 and.w r3, r3, #160 ; 0xa0
- 800536c: 2b00 cmp r3, #0
- 800536e: d001 beq.n 8005374 <dir_register+0x20>
- 8005370: 2306 movs r3, #6
- 8005372: e0e0 b.n 8005536 <dir_register+0x1e2>
- for (nlen = 0; fs->lfnbuf[nlen]; nlen++) ; /* Get lfn length */
- 8005374: 2300 movs r3, #0
- 8005376: 627b str r3, [r7, #36] ; 0x24
- 8005378: e002 b.n 8005380 <dir_register+0x2c>
- 800537a: 6a7b ldr r3, [r7, #36] ; 0x24
- 800537c: 3301 adds r3, #1
- 800537e: 627b str r3, [r7, #36] ; 0x24
- 8005380: 69fb ldr r3, [r7, #28]
- 8005382: 691a ldr r2, [r3, #16]
- 8005384: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005386: 005b lsls r3, r3, #1
- 8005388: 4413 add r3, r2
- 800538a: 881b ldrh r3, [r3, #0]
- 800538c: 2b00 cmp r3, #0
- 800538e: d1f4 bne.n 800537a <dir_register+0x26>
- create_xdir(fs->dirbuf, fs->lfnbuf); /* Create on-memory directory block to be written later */
- return FR_OK;
- }
- #endif
- /* On the FAT12/16/32 volume */
- mem_cpy(sn, dp->fn, 12);
- 8005390: 687b ldr r3, [r7, #4]
- 8005392: f103 0124 add.w r1, r3, #36 ; 0x24
- 8005396: f107 030c add.w r3, r7, #12
- 800539a: 220c movs r2, #12
- 800539c: 4618 mov r0, r3
- 800539e: f7fe fdb3 bl 8003f08 <mem_cpy>
- if (sn[NSFLAG] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */
- 80053a2: 7dfb ldrb r3, [r7, #23]
- 80053a4: f003 0301 and.w r3, r3, #1
- 80053a8: 2b00 cmp r3, #0
- 80053aa: d032 beq.n 8005412 <dir_register+0xbe>
- dp->fn[NSFLAG] = NS_NOLFN; /* Find only SFN */
- 80053ac: 687b ldr r3, [r7, #4]
- 80053ae: 2240 movs r2, #64 ; 0x40
- 80053b0: f883 202f strb.w r2, [r3, #47] ; 0x2f
- for (n = 1; n < 100; n++) {
- 80053b4: 2301 movs r3, #1
- 80053b6: 62bb str r3, [r7, #40] ; 0x28
- 80053b8: e016 b.n 80053e8 <dir_register+0x94>
- gen_numname(dp->fn, sn, fs->lfnbuf, n); /* Generate a numbered name */
- 80053ba: 687b ldr r3, [r7, #4]
- 80053bc: f103 0024 add.w r0, r3, #36 ; 0x24
- 80053c0: 69fb ldr r3, [r7, #28]
- 80053c2: 691a ldr r2, [r3, #16]
- 80053c4: f107 010c add.w r1, r7, #12
- 80053c8: 6abb ldr r3, [r7, #40] ; 0x28
- 80053ca: f7ff fe53 bl 8005074 <gen_numname>
- res = dir_find(dp); /* Check if the name collides with existing SFN */
- 80053ce: 6878 ldr r0, [r7, #4]
- 80053d0: f7ff feff bl 80051d2 <dir_find>
- 80053d4: 4603 mov r3, r0
- 80053d6: f887 302f strb.w r3, [r7, #47] ; 0x2f
- if (res != FR_OK) break;
- 80053da: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 80053de: 2b00 cmp r3, #0
- 80053e0: d106 bne.n 80053f0 <dir_register+0x9c>
- for (n = 1; n < 100; n++) {
- 80053e2: 6abb ldr r3, [r7, #40] ; 0x28
- 80053e4: 3301 adds r3, #1
- 80053e6: 62bb str r3, [r7, #40] ; 0x28
- 80053e8: 6abb ldr r3, [r7, #40] ; 0x28
- 80053ea: 2b63 cmp r3, #99 ; 0x63
- 80053ec: d9e5 bls.n 80053ba <dir_register+0x66>
- 80053ee: e000 b.n 80053f2 <dir_register+0x9e>
- if (res != FR_OK) break;
- 80053f0: bf00 nop
- }
- if (n == 100) return FR_DENIED; /* Abort if too many collisions */
- 80053f2: 6abb ldr r3, [r7, #40] ; 0x28
- 80053f4: 2b64 cmp r3, #100 ; 0x64
- 80053f6: d101 bne.n 80053fc <dir_register+0xa8>
- 80053f8: 2307 movs r3, #7
- 80053fa: e09c b.n 8005536 <dir_register+0x1e2>
- if (res != FR_NO_FILE) return res; /* Abort if the result is other than 'not collided' */
- 80053fc: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 8005400: 2b04 cmp r3, #4
- 8005402: d002 beq.n 800540a <dir_register+0xb6>
- 8005404: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 8005408: e095 b.n 8005536 <dir_register+0x1e2>
- dp->fn[NSFLAG] = sn[NSFLAG];
- 800540a: 7dfa ldrb r2, [r7, #23]
- 800540c: 687b ldr r3, [r7, #4]
- 800540e: f883 202f strb.w r2, [r3, #47] ; 0x2f
- }
-
- /* Create an SFN with/without LFNs. */
- nent = (sn[NSFLAG] & NS_LFN) ? (nlen + 12) / 13 + 1 : 1; /* Number of entries to allocate */
- 8005412: 7dfb ldrb r3, [r7, #23]
- 8005414: f003 0302 and.w r3, r3, #2
- 8005418: 2b00 cmp r3, #0
- 800541a: d007 beq.n 800542c <dir_register+0xd8>
- 800541c: 6a7b ldr r3, [r7, #36] ; 0x24
- 800541e: 330c adds r3, #12
- 8005420: 4a47 ldr r2, [pc, #284] ; (8005540 <dir_register+0x1ec>)
- 8005422: fba2 2303 umull r2, r3, r2, r3
- 8005426: 089b lsrs r3, r3, #2
- 8005428: 3301 adds r3, #1
- 800542a: e000 b.n 800542e <dir_register+0xda>
- 800542c: 2301 movs r3, #1
- 800542e: 623b str r3, [r7, #32]
- res = dir_alloc(dp, nent); /* Allocate entries */
- 8005430: 6a39 ldr r1, [r7, #32]
- 8005432: 6878 ldr r0, [r7, #4]
- 8005434: f7ff fcc0 bl 8004db8 <dir_alloc>
- 8005438: 4603 mov r3, r0
- 800543a: f887 302f strb.w r3, [r7, #47] ; 0x2f
- if (res == FR_OK && --nent) { /* Set LFN entry if needed */
- 800543e: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 8005442: 2b00 cmp r3, #0
- 8005444: d148 bne.n 80054d8 <dir_register+0x184>
- 8005446: 6a3b ldr r3, [r7, #32]
- 8005448: 3b01 subs r3, #1
- 800544a: 623b str r3, [r7, #32]
- 800544c: 6a3b ldr r3, [r7, #32]
- 800544e: 2b00 cmp r3, #0
- 8005450: d042 beq.n 80054d8 <dir_register+0x184>
- res = dir_sdi(dp, dp->dptr - nent * SZDIRE);
- 8005452: 687b ldr r3, [r7, #4]
- 8005454: 695a ldr r2, [r3, #20]
- 8005456: 6a3b ldr r3, [r7, #32]
- 8005458: 015b lsls r3, r3, #5
- 800545a: 1ad3 subs r3, r2, r3
- 800545c: 4619 mov r1, r3
- 800545e: 6878 ldr r0, [r7, #4]
- 8005460: f7ff fb4b bl 8004afa <dir_sdi>
- 8005464: 4603 mov r3, r0
- 8005466: f887 302f strb.w r3, [r7, #47] ; 0x2f
- if (res == FR_OK) {
- 800546a: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 800546e: 2b00 cmp r3, #0
- 8005470: d132 bne.n 80054d8 <dir_register+0x184>
- sum = sum_sfn(dp->fn); /* Checksum value of the SFN tied to the LFN */
- 8005472: 687b ldr r3, [r7, #4]
- 8005474: 3324 adds r3, #36 ; 0x24
- 8005476: 4618 mov r0, r3
- 8005478: f7ff fe8b bl 8005192 <sum_sfn>
- 800547c: 4603 mov r3, r0
- 800547e: 76fb strb r3, [r7, #27]
- do { /* Store LFN entries in bottom first */
- res = move_window(fs, dp->sect);
- 8005480: 687b ldr r3, [r7, #4]
- 8005482: 69db ldr r3, [r3, #28]
- 8005484: 4619 mov r1, r3
- 8005486: 69f8 ldr r0, [r7, #28]
- 8005488: f7fe ff60 bl 800434c <move_window>
- 800548c: 4603 mov r3, r0
- 800548e: f887 302f strb.w r3, [r7, #47] ; 0x2f
- if (res != FR_OK) break;
- 8005492: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 8005496: 2b00 cmp r3, #0
- 8005498: d11d bne.n 80054d6 <dir_register+0x182>
- put_lfn(fs->lfnbuf, dp->dir, (BYTE)nent, sum);
- 800549a: 69fb ldr r3, [r7, #28]
- 800549c: 6918 ldr r0, [r3, #16]
- 800549e: 687b ldr r3, [r7, #4]
- 80054a0: 6a19 ldr r1, [r3, #32]
- 80054a2: 6a3b ldr r3, [r7, #32]
- 80054a4: b2da uxtb r2, r3
- 80054a6: 7efb ldrb r3, [r7, #27]
- 80054a8: f7ff fd7c bl 8004fa4 <put_lfn>
- fs->wflag = 1;
- 80054ac: 69fb ldr r3, [r7, #28]
- 80054ae: 2201 movs r2, #1
- 80054b0: 70da strb r2, [r3, #3]
- res = dir_next(dp, 0); /* Next entry */
- 80054b2: 2100 movs r1, #0
- 80054b4: 6878 ldr r0, [r7, #4]
- 80054b6: f7ff fba9 bl 8004c0c <dir_next>
- 80054ba: 4603 mov r3, r0
- 80054bc: f887 302f strb.w r3, [r7, #47] ; 0x2f
- } while (res == FR_OK && --nent);
- 80054c0: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 80054c4: 2b00 cmp r3, #0
- 80054c6: d107 bne.n 80054d8 <dir_register+0x184>
- 80054c8: 6a3b ldr r3, [r7, #32]
- 80054ca: 3b01 subs r3, #1
- 80054cc: 623b str r3, [r7, #32]
- 80054ce: 6a3b ldr r3, [r7, #32]
- 80054d0: 2b00 cmp r3, #0
- 80054d2: d1d5 bne.n 8005480 <dir_register+0x12c>
- 80054d4: e000 b.n 80054d8 <dir_register+0x184>
- if (res != FR_OK) break;
- 80054d6: bf00 nop
- res = dir_alloc(dp, 1); /* Allocate an entry for SFN */
-
- #endif
-
- /* Set SFN entry */
- if (res == FR_OK) {
- 80054d8: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 80054dc: 2b00 cmp r3, #0
- 80054de: d128 bne.n 8005532 <dir_register+0x1de>
- res = move_window(fs, dp->sect);
- 80054e0: 687b ldr r3, [r7, #4]
- 80054e2: 69db ldr r3, [r3, #28]
- 80054e4: 4619 mov r1, r3
- 80054e6: 69f8 ldr r0, [r7, #28]
- 80054e8: f7fe ff30 bl 800434c <move_window>
- 80054ec: 4603 mov r3, r0
- 80054ee: f887 302f strb.w r3, [r7, #47] ; 0x2f
- if (res == FR_OK) {
- 80054f2: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 80054f6: 2b00 cmp r3, #0
- 80054f8: d11b bne.n 8005532 <dir_register+0x1de>
- mem_set(dp->dir, 0, SZDIRE); /* Clean the entry */
- 80054fa: 687b ldr r3, [r7, #4]
- 80054fc: 6a1b ldr r3, [r3, #32]
- 80054fe: 2220 movs r2, #32
- 8005500: 2100 movs r1, #0
- 8005502: 4618 mov r0, r3
- 8005504: f7fe fd20 bl 8003f48 <mem_set>
- mem_cpy(dp->dir + DIR_Name, dp->fn, 11); /* Put SFN */
- 8005508: 687b ldr r3, [r7, #4]
- 800550a: 6a18 ldr r0, [r3, #32]
- 800550c: 687b ldr r3, [r7, #4]
- 800550e: 3324 adds r3, #36 ; 0x24
- 8005510: 220b movs r2, #11
- 8005512: 4619 mov r1, r3
- 8005514: f7fe fcf8 bl 8003f08 <mem_cpy>
- #if _USE_LFN != 0
- dp->dir[DIR_NTres] = dp->fn[NSFLAG] & (NS_BODY | NS_EXT); /* Put NT flag */
- 8005518: 687b ldr r3, [r7, #4]
- 800551a: f893 202f ldrb.w r2, [r3, #47] ; 0x2f
- 800551e: 687b ldr r3, [r7, #4]
- 8005520: 6a1b ldr r3, [r3, #32]
- 8005522: 330c adds r3, #12
- 8005524: f002 0218 and.w r2, r2, #24
- 8005528: b2d2 uxtb r2, r2
- 800552a: 701a strb r2, [r3, #0]
- #endif
- fs->wflag = 1;
- 800552c: 69fb ldr r3, [r7, #28]
- 800552e: 2201 movs r2, #1
- 8005530: 70da strb r2, [r3, #3]
- }
- }
-
- return res;
- 8005532: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- }
- 8005536: 4618 mov r0, r3
- 8005538: 3730 adds r7, #48 ; 0x30
- 800553a: 46bd mov sp, r7
- 800553c: bd80 pop {r7, pc}
- 800553e: bf00 nop
- 8005540: 4ec4ec4f .word 0x4ec4ec4f
-
- 08005544 <create_name>:
- static
- FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not create */
- DIR* dp, /* Pointer to the directory object */
- const TCHAR** path /* Pointer to pointer to the segment in the path string */
- )
- {
- 8005544: b580 push {r7, lr}
- 8005546: b08a sub sp, #40 ; 0x28
- 8005548: af00 add r7, sp, #0
- 800554a: 6078 str r0, [r7, #4]
- 800554c: 6039 str r1, [r7, #0]
- WCHAR w, *lfn;
- UINT i, ni, si, di;
- const TCHAR *p;
-
- /* Create LFN in Unicode */
- p = *path; lfn = dp->obj.fs->lfnbuf; si = di = 0;
- 800554e: 683b ldr r3, [r7, #0]
- 8005550: 681b ldr r3, [r3, #0]
- 8005552: 613b str r3, [r7, #16]
- 8005554: 687b ldr r3, [r7, #4]
- 8005556: 681b ldr r3, [r3, #0]
- 8005558: 691b ldr r3, [r3, #16]
- 800555a: 60fb str r3, [r7, #12]
- 800555c: 2300 movs r3, #0
- 800555e: 617b str r3, [r7, #20]
- 8005560: 697b ldr r3, [r7, #20]
- 8005562: 61bb str r3, [r7, #24]
- for (;;) {
- w = p[si++]; /* Get a character */
- 8005564: 69bb ldr r3, [r7, #24]
- 8005566: 1c5a adds r2, r3, #1
- 8005568: 61ba str r2, [r7, #24]
- 800556a: 693a ldr r2, [r7, #16]
- 800556c: 4413 add r3, r2
- 800556e: 781b ldrb r3, [r3, #0]
- 8005570: 84bb strh r3, [r7, #36] ; 0x24
- if (w < ' ') break; /* Break if end of the path name */
- 8005572: 8cbb ldrh r3, [r7, #36] ; 0x24
- 8005574: 2b1f cmp r3, #31
- 8005576: d940 bls.n 80055fa <create_name+0xb6>
- if (w == '/' || w == '\\') { /* Break if a separator is found */
- 8005578: 8cbb ldrh r3, [r7, #36] ; 0x24
- 800557a: 2b2f cmp r3, #47 ; 0x2f
- 800557c: d006 beq.n 800558c <create_name+0x48>
- 800557e: 8cbb ldrh r3, [r7, #36] ; 0x24
- 8005580: 2b5c cmp r3, #92 ; 0x5c
- 8005582: d110 bne.n 80055a6 <create_name+0x62>
- while (p[si] == '/' || p[si] == '\\') si++; /* Skip duplicated separator if exist */
- 8005584: e002 b.n 800558c <create_name+0x48>
- 8005586: 69bb ldr r3, [r7, #24]
- 8005588: 3301 adds r3, #1
- 800558a: 61bb str r3, [r7, #24]
- 800558c: 693a ldr r2, [r7, #16]
- 800558e: 69bb ldr r3, [r7, #24]
- 8005590: 4413 add r3, r2
- 8005592: 781b ldrb r3, [r3, #0]
- 8005594: 2b2f cmp r3, #47 ; 0x2f
- 8005596: d0f6 beq.n 8005586 <create_name+0x42>
- 8005598: 693a ldr r2, [r7, #16]
- 800559a: 69bb ldr r3, [r7, #24]
- 800559c: 4413 add r3, r2
- 800559e: 781b ldrb r3, [r3, #0]
- 80055a0: 2b5c cmp r3, #92 ; 0x5c
- 80055a2: d0f0 beq.n 8005586 <create_name+0x42>
- break;
- 80055a4: e02a b.n 80055fc <create_name+0xb8>
- }
- if (di >= _MAX_LFN) return FR_INVALID_NAME; /* Reject too long name */
- 80055a6: 697b ldr r3, [r7, #20]
- 80055a8: 2bfe cmp r3, #254 ; 0xfe
- 80055aa: d901 bls.n 80055b0 <create_name+0x6c>
- 80055ac: 2306 movs r3, #6
- 80055ae: e177 b.n 80058a0 <create_name+0x35c>
- #if !_LFN_UNICODE
- w &= 0xFF;
- 80055b0: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80055b2: b2db uxtb r3, r3
- 80055b4: 84bb strh r3, [r7, #36] ; 0x24
- if (IsDBCS1(w)) { /* Check if it is a DBC 1st byte (always false on SBCS cfg) */
- b = (BYTE)p[si++]; /* Get 2nd byte */
- w = (w << 8) + b; /* Create a DBC */
- if (!IsDBCS2(b)) return FR_INVALID_NAME; /* Reject invalid sequence */
- }
- w = ff_convert(w, 1); /* Convert ANSI/OEM to Unicode */
- 80055b6: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80055b8: 2101 movs r1, #1
- 80055ba: 4618 mov r0, r3
- 80055bc: f001 fcdc bl 8006f78 <ff_convert>
- 80055c0: 4603 mov r3, r0
- 80055c2: 84bb strh r3, [r7, #36] ; 0x24
- if (!w) return FR_INVALID_NAME; /* Reject invalid code */
- 80055c4: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80055c6: 2b00 cmp r3, #0
- 80055c8: d101 bne.n 80055ce <create_name+0x8a>
- 80055ca: 2306 movs r3, #6
- 80055cc: e168 b.n 80058a0 <create_name+0x35c>
- #endif
- if (w < 0x80 && chk_chr("\"*:<>\?|\x7F", w)) return FR_INVALID_NAME; /* Reject illegal characters for LFN */
- 80055ce: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80055d0: 2b7f cmp r3, #127 ; 0x7f
- 80055d2: d809 bhi.n 80055e8 <create_name+0xa4>
- 80055d4: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80055d6: 4619 mov r1, r3
- 80055d8: 48b3 ldr r0, [pc, #716] ; (80058a8 <create_name+0x364>)
- 80055da: f7fe fcf4 bl 8003fc6 <chk_chr>
- 80055de: 4603 mov r3, r0
- 80055e0: 2b00 cmp r3, #0
- 80055e2: d001 beq.n 80055e8 <create_name+0xa4>
- 80055e4: 2306 movs r3, #6
- 80055e6: e15b b.n 80058a0 <create_name+0x35c>
- lfn[di++] = w; /* Store the Unicode character */
- 80055e8: 697b ldr r3, [r7, #20]
- 80055ea: 1c5a adds r2, r3, #1
- 80055ec: 617a str r2, [r7, #20]
- 80055ee: 005b lsls r3, r3, #1
- 80055f0: 68fa ldr r2, [r7, #12]
- 80055f2: 4413 add r3, r2
- 80055f4: 8cba ldrh r2, [r7, #36] ; 0x24
- 80055f6: 801a strh r2, [r3, #0]
- w = p[si++]; /* Get a character */
- 80055f8: e7b4 b.n 8005564 <create_name+0x20>
- if (w < ' ') break; /* Break if end of the path name */
- 80055fa: bf00 nop
- }
- *path = &p[si]; /* Return pointer to the next segment */
- 80055fc: 693a ldr r2, [r7, #16]
- 80055fe: 69bb ldr r3, [r7, #24]
- 8005600: 441a add r2, r3
- 8005602: 683b ldr r3, [r7, #0]
- 8005604: 601a str r2, [r3, #0]
- cf = (w < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */
- 8005606: 8cbb ldrh r3, [r7, #36] ; 0x24
- 8005608: 2b1f cmp r3, #31
- 800560a: d801 bhi.n 8005610 <create_name+0xcc>
- 800560c: 2304 movs r3, #4
- 800560e: e000 b.n 8005612 <create_name+0xce>
- 8005610: 2300 movs r3, #0
- 8005612: f887 3027 strb.w r3, [r7, #39] ; 0x27
- dp->fn[i] = (i < di) ? '.' : ' ';
- dp->fn[i] = cf | NS_DOT; /* This is a dot entry */
- return FR_OK;
- }
- #endif
- while (di) { /* Snip off trailing spaces and dots if exist */
- 8005616: e011 b.n 800563c <create_name+0xf8>
- w = lfn[di - 1];
- 8005618: 697b ldr r3, [r7, #20]
- 800561a: f103 4300 add.w r3, r3, #2147483648 ; 0x80000000
- 800561e: 3b01 subs r3, #1
- 8005620: 005b lsls r3, r3, #1
- 8005622: 68fa ldr r2, [r7, #12]
- 8005624: 4413 add r3, r2
- 8005626: 881b ldrh r3, [r3, #0]
- 8005628: 84bb strh r3, [r7, #36] ; 0x24
- if (w != ' ' && w != '.') break;
- 800562a: 8cbb ldrh r3, [r7, #36] ; 0x24
- 800562c: 2b20 cmp r3, #32
- 800562e: d002 beq.n 8005636 <create_name+0xf2>
- 8005630: 8cbb ldrh r3, [r7, #36] ; 0x24
- 8005632: 2b2e cmp r3, #46 ; 0x2e
- 8005634: d106 bne.n 8005644 <create_name+0x100>
- di--;
- 8005636: 697b ldr r3, [r7, #20]
- 8005638: 3b01 subs r3, #1
- 800563a: 617b str r3, [r7, #20]
- while (di) { /* Snip off trailing spaces and dots if exist */
- 800563c: 697b ldr r3, [r7, #20]
- 800563e: 2b00 cmp r3, #0
- 8005640: d1ea bne.n 8005618 <create_name+0xd4>
- 8005642: e000 b.n 8005646 <create_name+0x102>
- if (w != ' ' && w != '.') break;
- 8005644: bf00 nop
- }
- lfn[di] = 0; /* LFN is created */
- 8005646: 697b ldr r3, [r7, #20]
- 8005648: 005b lsls r3, r3, #1
- 800564a: 68fa ldr r2, [r7, #12]
- 800564c: 4413 add r3, r2
- 800564e: 2200 movs r2, #0
- 8005650: 801a strh r2, [r3, #0]
- if (di == 0) return FR_INVALID_NAME; /* Reject nul name */
- 8005652: 697b ldr r3, [r7, #20]
- 8005654: 2b00 cmp r3, #0
- 8005656: d101 bne.n 800565c <create_name+0x118>
- 8005658: 2306 movs r3, #6
- 800565a: e121 b.n 80058a0 <create_name+0x35c>
-
- /* Create SFN in directory form */
- mem_set(dp->fn, ' ', 11);
- 800565c: 687b ldr r3, [r7, #4]
- 800565e: 3324 adds r3, #36 ; 0x24
- 8005660: 220b movs r2, #11
- 8005662: 2120 movs r1, #32
- 8005664: 4618 mov r0, r3
- 8005666: f7fe fc6f bl 8003f48 <mem_set>
- for (si = 0; lfn[si] == ' ' || lfn[si] == '.'; si++) ; /* Strip leading spaces and dots */
- 800566a: 2300 movs r3, #0
- 800566c: 61bb str r3, [r7, #24]
- 800566e: e002 b.n 8005676 <create_name+0x132>
- 8005670: 69bb ldr r3, [r7, #24]
- 8005672: 3301 adds r3, #1
- 8005674: 61bb str r3, [r7, #24]
- 8005676: 69bb ldr r3, [r7, #24]
- 8005678: 005b lsls r3, r3, #1
- 800567a: 68fa ldr r2, [r7, #12]
- 800567c: 4413 add r3, r2
- 800567e: 881b ldrh r3, [r3, #0]
- 8005680: 2b20 cmp r3, #32
- 8005682: d0f5 beq.n 8005670 <create_name+0x12c>
- 8005684: 69bb ldr r3, [r7, #24]
- 8005686: 005b lsls r3, r3, #1
- 8005688: 68fa ldr r2, [r7, #12]
- 800568a: 4413 add r3, r2
- 800568c: 881b ldrh r3, [r3, #0]
- 800568e: 2b2e cmp r3, #46 ; 0x2e
- 8005690: d0ee beq.n 8005670 <create_name+0x12c>
- if (si) cf |= NS_LOSS | NS_LFN;
- 8005692: 69bb ldr r3, [r7, #24]
- 8005694: 2b00 cmp r3, #0
- 8005696: d009 beq.n 80056ac <create_name+0x168>
- 8005698: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 800569c: f043 0303 orr.w r3, r3, #3
- 80056a0: f887 3027 strb.w r3, [r7, #39] ; 0x27
- while (di && lfn[di - 1] != '.') di--; /* Find extension (di<=si: no extension) */
- 80056a4: e002 b.n 80056ac <create_name+0x168>
- 80056a6: 697b ldr r3, [r7, #20]
- 80056a8: 3b01 subs r3, #1
- 80056aa: 617b str r3, [r7, #20]
- 80056ac: 697b ldr r3, [r7, #20]
- 80056ae: 2b00 cmp r3, #0
- 80056b0: d009 beq.n 80056c6 <create_name+0x182>
- 80056b2: 697b ldr r3, [r7, #20]
- 80056b4: f103 4300 add.w r3, r3, #2147483648 ; 0x80000000
- 80056b8: 3b01 subs r3, #1
- 80056ba: 005b lsls r3, r3, #1
- 80056bc: 68fa ldr r2, [r7, #12]
- 80056be: 4413 add r3, r2
- 80056c0: 881b ldrh r3, [r3, #0]
- 80056c2: 2b2e cmp r3, #46 ; 0x2e
- 80056c4: d1ef bne.n 80056a6 <create_name+0x162>
-
- i = b = 0; ni = 8;
- 80056c6: 2300 movs r3, #0
- 80056c8: f887 3026 strb.w r3, [r7, #38] ; 0x26
- 80056cc: 2300 movs r3, #0
- 80056ce: 623b str r3, [r7, #32]
- 80056d0: 2308 movs r3, #8
- 80056d2: 61fb str r3, [r7, #28]
- for (;;) {
- w = lfn[si++]; /* Get an LFN character */
- 80056d4: 69bb ldr r3, [r7, #24]
- 80056d6: 1c5a adds r2, r3, #1
- 80056d8: 61ba str r2, [r7, #24]
- 80056da: 005b lsls r3, r3, #1
- 80056dc: 68fa ldr r2, [r7, #12]
- 80056de: 4413 add r3, r2
- 80056e0: 881b ldrh r3, [r3, #0]
- 80056e2: 84bb strh r3, [r7, #36] ; 0x24
- if (!w) break; /* Break on end of the LFN */
- 80056e4: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80056e6: 2b00 cmp r3, #0
- 80056e8: f000 8090 beq.w 800580c <create_name+0x2c8>
- if (w == ' ' || (w == '.' && si != di)) { /* Remove spaces and dots */
- 80056ec: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80056ee: 2b20 cmp r3, #32
- 80056f0: d006 beq.n 8005700 <create_name+0x1bc>
- 80056f2: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80056f4: 2b2e cmp r3, #46 ; 0x2e
- 80056f6: d10a bne.n 800570e <create_name+0x1ca>
- 80056f8: 69ba ldr r2, [r7, #24]
- 80056fa: 697b ldr r3, [r7, #20]
- 80056fc: 429a cmp r2, r3
- 80056fe: d006 beq.n 800570e <create_name+0x1ca>
- cf |= NS_LOSS | NS_LFN; continue;
- 8005700: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 8005704: f043 0303 orr.w r3, r3, #3
- 8005708: f887 3027 strb.w r3, [r7, #39] ; 0x27
- 800570c: e07d b.n 800580a <create_name+0x2c6>
- }
-
- if (i >= ni || si == di) { /* Extension or end of SFN */
- 800570e: 6a3a ldr r2, [r7, #32]
- 8005710: 69fb ldr r3, [r7, #28]
- 8005712: 429a cmp r2, r3
- 8005714: d203 bcs.n 800571e <create_name+0x1da>
- 8005716: 69ba ldr r2, [r7, #24]
- 8005718: 697b ldr r3, [r7, #20]
- 800571a: 429a cmp r2, r3
- 800571c: d123 bne.n 8005766 <create_name+0x222>
- if (ni == 11) { /* Long extension */
- 800571e: 69fb ldr r3, [r7, #28]
- 8005720: 2b0b cmp r3, #11
- 8005722: d106 bne.n 8005732 <create_name+0x1ee>
- cf |= NS_LOSS | NS_LFN; break;
- 8005724: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 8005728: f043 0303 orr.w r3, r3, #3
- 800572c: f887 3027 strb.w r3, [r7, #39] ; 0x27
- 8005730: e06f b.n 8005812 <create_name+0x2ce>
- }
- if (si != di) cf |= NS_LOSS | NS_LFN; /* Out of 8.3 format */
- 8005732: 69ba ldr r2, [r7, #24]
- 8005734: 697b ldr r3, [r7, #20]
- 8005736: 429a cmp r2, r3
- 8005738: d005 beq.n 8005746 <create_name+0x202>
- 800573a: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 800573e: f043 0303 orr.w r3, r3, #3
- 8005742: f887 3027 strb.w r3, [r7, #39] ; 0x27
- if (si > di) break; /* No extension */
- 8005746: 69ba ldr r2, [r7, #24]
- 8005748: 697b ldr r3, [r7, #20]
- 800574a: 429a cmp r2, r3
- 800574c: d860 bhi.n 8005810 <create_name+0x2cc>
- si = di; i = 8; ni = 11; /* Enter extension section */
- 800574e: 697b ldr r3, [r7, #20]
- 8005750: 61bb str r3, [r7, #24]
- 8005752: 2308 movs r3, #8
- 8005754: 623b str r3, [r7, #32]
- 8005756: 230b movs r3, #11
- 8005758: 61fb str r3, [r7, #28]
- b <<= 2; continue;
- 800575a: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 800575e: 009b lsls r3, r3, #2
- 8005760: f887 3026 strb.w r3, [r7, #38] ; 0x26
- 8005764: e051 b.n 800580a <create_name+0x2c6>
- }
-
- if (w >= 0x80) { /* Non ASCII character */
- 8005766: 8cbb ldrh r3, [r7, #36] ; 0x24
- 8005768: 2b7f cmp r3, #127 ; 0x7f
- 800576a: d914 bls.n 8005796 <create_name+0x252>
- #ifdef _EXCVT
- w = ff_convert(w, 0); /* Unicode -> OEM code */
- 800576c: 8cbb ldrh r3, [r7, #36] ; 0x24
- 800576e: 2100 movs r1, #0
- 8005770: 4618 mov r0, r3
- 8005772: f001 fc01 bl 8006f78 <ff_convert>
- 8005776: 4603 mov r3, r0
- 8005778: 84bb strh r3, [r7, #36] ; 0x24
- if (w) w = ExCvt[w - 0x80]; /* Convert extended character to upper (SBCS) */
- 800577a: 8cbb ldrh r3, [r7, #36] ; 0x24
- 800577c: 2b00 cmp r3, #0
- 800577e: d004 beq.n 800578a <create_name+0x246>
- 8005780: 8cbb ldrh r3, [r7, #36] ; 0x24
- 8005782: 3b80 subs r3, #128 ; 0x80
- 8005784: 4a49 ldr r2, [pc, #292] ; (80058ac <create_name+0x368>)
- 8005786: 5cd3 ldrb r3, [r2, r3]
- 8005788: 84bb strh r3, [r7, #36] ; 0x24
- #else
- w = ff_convert(ff_wtoupper(w), 0); /* Upper converted Unicode -> OEM code */
- #endif
- cf |= NS_LFN; /* Force create LFN entry */
- 800578a: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 800578e: f043 0302 orr.w r3, r3, #2
- 8005792: f887 3027 strb.w r3, [r7, #39] ; 0x27
- if (i >= ni - 1) {
- cf |= NS_LOSS | NS_LFN; i = ni; continue;
- }
- dp->fn[i++] = (BYTE)(w >> 8);
- } else { /* SBC */
- if (!w || chk_chr("+,;=[]", w)) { /* Replace illegal characters for SFN */
- 8005796: 8cbb ldrh r3, [r7, #36] ; 0x24
- 8005798: 2b00 cmp r3, #0
- 800579a: d007 beq.n 80057ac <create_name+0x268>
- 800579c: 8cbb ldrh r3, [r7, #36] ; 0x24
- 800579e: 4619 mov r1, r3
- 80057a0: 4843 ldr r0, [pc, #268] ; (80058b0 <create_name+0x36c>)
- 80057a2: f7fe fc10 bl 8003fc6 <chk_chr>
- 80057a6: 4603 mov r3, r0
- 80057a8: 2b00 cmp r3, #0
- 80057aa: d008 beq.n 80057be <create_name+0x27a>
- w = '_'; cf |= NS_LOSS | NS_LFN;/* Lossy conversion */
- 80057ac: 235f movs r3, #95 ; 0x5f
- 80057ae: 84bb strh r3, [r7, #36] ; 0x24
- 80057b0: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 80057b4: f043 0303 orr.w r3, r3, #3
- 80057b8: f887 3027 strb.w r3, [r7, #39] ; 0x27
- 80057bc: e01b b.n 80057f6 <create_name+0x2b2>
- } else {
- if (IsUpper(w)) { /* ASCII large capital */
- 80057be: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80057c0: 2b40 cmp r3, #64 ; 0x40
- 80057c2: d909 bls.n 80057d8 <create_name+0x294>
- 80057c4: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80057c6: 2b5a cmp r3, #90 ; 0x5a
- 80057c8: d806 bhi.n 80057d8 <create_name+0x294>
- b |= 2;
- 80057ca: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 80057ce: f043 0302 orr.w r3, r3, #2
- 80057d2: f887 3026 strb.w r3, [r7, #38] ; 0x26
- 80057d6: e00e b.n 80057f6 <create_name+0x2b2>
- } else {
- if (IsLower(w)) { /* ASCII small capital */
- 80057d8: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80057da: 2b60 cmp r3, #96 ; 0x60
- 80057dc: d90b bls.n 80057f6 <create_name+0x2b2>
- 80057de: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80057e0: 2b7a cmp r3, #122 ; 0x7a
- 80057e2: d808 bhi.n 80057f6 <create_name+0x2b2>
- b |= 1; w -= 0x20;
- 80057e4: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 80057e8: f043 0301 orr.w r3, r3, #1
- 80057ec: f887 3026 strb.w r3, [r7, #38] ; 0x26
- 80057f0: 8cbb ldrh r3, [r7, #36] ; 0x24
- 80057f2: 3b20 subs r3, #32
- 80057f4: 84bb strh r3, [r7, #36] ; 0x24
- }
- }
- }
- }
- dp->fn[i++] = (BYTE)w;
- 80057f6: 6a3b ldr r3, [r7, #32]
- 80057f8: 1c5a adds r2, r3, #1
- 80057fa: 623a str r2, [r7, #32]
- 80057fc: 8cba ldrh r2, [r7, #36] ; 0x24
- 80057fe: b2d1 uxtb r1, r2
- 8005800: 687a ldr r2, [r7, #4]
- 8005802: 4413 add r3, r2
- 8005804: 460a mov r2, r1
- 8005806: f883 2024 strb.w r2, [r3, #36] ; 0x24
- w = lfn[si++]; /* Get an LFN character */
- 800580a: e763 b.n 80056d4 <create_name+0x190>
- if (!w) break; /* Break on end of the LFN */
- 800580c: bf00 nop
- 800580e: e000 b.n 8005812 <create_name+0x2ce>
- if (si > di) break; /* No extension */
- 8005810: bf00 nop
- }
-
- if (dp->fn[0] == DDEM) dp->fn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */
- 8005812: 687b ldr r3, [r7, #4]
- 8005814: f893 3024 ldrb.w r3, [r3, #36] ; 0x24
- 8005818: 2be5 cmp r3, #229 ; 0xe5
- 800581a: d103 bne.n 8005824 <create_name+0x2e0>
- 800581c: 687b ldr r3, [r7, #4]
- 800581e: 2205 movs r2, #5
- 8005820: f883 2024 strb.w r2, [r3, #36] ; 0x24
-
- if (ni == 8) b <<= 2;
- 8005824: 69fb ldr r3, [r7, #28]
- 8005826: 2b08 cmp r3, #8
- 8005828: d104 bne.n 8005834 <create_name+0x2f0>
- 800582a: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 800582e: 009b lsls r3, r3, #2
- 8005830: f887 3026 strb.w r3, [r7, #38] ; 0x26
- if ((b & 0x0C) == 0x0C || (b & 0x03) == 0x03) cf |= NS_LFN; /* Create LFN entry when there are composite capitals */
- 8005834: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 8005838: f003 030c and.w r3, r3, #12
- 800583c: 2b0c cmp r3, #12
- 800583e: d005 beq.n 800584c <create_name+0x308>
- 8005840: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 8005844: f003 0303 and.w r3, r3, #3
- 8005848: 2b03 cmp r3, #3
- 800584a: d105 bne.n 8005858 <create_name+0x314>
- 800584c: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 8005850: f043 0302 orr.w r3, r3, #2
- 8005854: f887 3027 strb.w r3, [r7, #39] ; 0x27
- if (!(cf & NS_LFN)) { /* When LFN is in 8.3 format without extended character, NT flags are created */
- 8005858: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 800585c: f003 0302 and.w r3, r3, #2
- 8005860: 2b00 cmp r3, #0
- 8005862: d117 bne.n 8005894 <create_name+0x350>
- if ((b & 0x03) == 0x01) cf |= NS_EXT; /* NT flag (Extension has only small capital) */
- 8005864: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 8005868: f003 0303 and.w r3, r3, #3
- 800586c: 2b01 cmp r3, #1
- 800586e: d105 bne.n 800587c <create_name+0x338>
- 8005870: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 8005874: f043 0310 orr.w r3, r3, #16
- 8005878: f887 3027 strb.w r3, [r7, #39] ; 0x27
- if ((b & 0x0C) == 0x04) cf |= NS_BODY; /* NT flag (Filename has only small capital) */
- 800587c: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
- 8005880: f003 030c and.w r3, r3, #12
- 8005884: 2b04 cmp r3, #4
- 8005886: d105 bne.n 8005894 <create_name+0x350>
- 8005888: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
- 800588c: f043 0308 orr.w r3, r3, #8
- 8005890: f887 3027 strb.w r3, [r7, #39] ; 0x27
- }
-
- dp->fn[NSFLAG] = cf; /* SFN is created */
- 8005894: 687b ldr r3, [r7, #4]
- 8005896: f897 2027 ldrb.w r2, [r7, #39] ; 0x27
- 800589a: f883 202f strb.w r2, [r3, #47] ; 0x2f
-
- return FR_OK;
- 800589e: 2300 movs r3, #0
- if (sfn[0] == DDEM) sfn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */
- sfn[NSFLAG] = (c <= ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */
-
- return FR_OK;
- #endif /* _USE_LFN != 0 */
- }
- 80058a0: 4618 mov r0, r3
- 80058a2: 3728 adds r7, #40 ; 0x28
- 80058a4: 46bd mov sp, r7
- 80058a6: bd80 pop {r7, pc}
- 80058a8: 08007adc .word 0x08007adc
- 80058ac: 08007b48 .word 0x08007b48
- 80058b0: 08007ae8 .word 0x08007ae8
-
- 080058b4 <follow_path>:
- static
- FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
- DIR* dp, /* Directory object to return last directory and found object */
- const TCHAR* path /* Full-path string to find a file or directory */
- )
- {
- 80058b4: b580 push {r7, lr}
- 80058b6: b086 sub sp, #24
- 80058b8: af00 add r7, sp, #0
- 80058ba: 6078 str r0, [r7, #4]
- 80058bc: 6039 str r1, [r7, #0]
- FRESULT res;
- BYTE ns;
- _FDID *obj = &dp->obj;
- 80058be: 687b ldr r3, [r7, #4]
- 80058c0: 613b str r3, [r7, #16]
- FATFS *fs = obj->fs;
- 80058c2: 693b ldr r3, [r7, #16]
- 80058c4: 681b ldr r3, [r3, #0]
- 80058c6: 60fb str r3, [r7, #12]
- if (*path != '/' && *path != '\\') { /* Without heading separator */
- obj->sclust = fs->cdir; /* Start from current directory */
- } else
- #endif
- { /* With heading separator */
- while (*path == '/' || *path == '\\') path++; /* Strip heading separator */
- 80058c8: e002 b.n 80058d0 <follow_path+0x1c>
- 80058ca: 683b ldr r3, [r7, #0]
- 80058cc: 3301 adds r3, #1
- 80058ce: 603b str r3, [r7, #0]
- 80058d0: 683b ldr r3, [r7, #0]
- 80058d2: 781b ldrb r3, [r3, #0]
- 80058d4: 2b2f cmp r3, #47 ; 0x2f
- 80058d6: d0f8 beq.n 80058ca <follow_path+0x16>
- 80058d8: 683b ldr r3, [r7, #0]
- 80058da: 781b ldrb r3, [r3, #0]
- 80058dc: 2b5c cmp r3, #92 ; 0x5c
- 80058de: d0f4 beq.n 80058ca <follow_path+0x16>
- obj->sclust = 0; /* Start from root directory */
- 80058e0: 693b ldr r3, [r7, #16]
- 80058e2: 2200 movs r2, #0
- 80058e4: 609a str r2, [r3, #8]
- obj->stat = fs->dirbuf[XDIR_GenFlags] & 2;
- }
- #endif
- #endif
-
- if ((UINT)*path < ' ') { /* Null path name is the origin directory itself */
- 80058e6: 683b ldr r3, [r7, #0]
- 80058e8: 781b ldrb r3, [r3, #0]
- 80058ea: 2b1f cmp r3, #31
- 80058ec: d80a bhi.n 8005904 <follow_path+0x50>
- dp->fn[NSFLAG] = NS_NONAME;
- 80058ee: 687b ldr r3, [r7, #4]
- 80058f0: 2280 movs r2, #128 ; 0x80
- 80058f2: f883 202f strb.w r2, [r3, #47] ; 0x2f
- res = dir_sdi(dp, 0);
- 80058f6: 2100 movs r1, #0
- 80058f8: 6878 ldr r0, [r7, #4]
- 80058fa: f7ff f8fe bl 8004afa <dir_sdi>
- 80058fe: 4603 mov r3, r0
- 8005900: 75fb strb r3, [r7, #23]
- 8005902: e048 b.n 8005996 <follow_path+0xe2>
-
- } else { /* Follow path */
- for (;;) {
- res = create_name(dp, &path); /* Get a segment name of the path */
- 8005904: 463b mov r3, r7
- 8005906: 4619 mov r1, r3
- 8005908: 6878 ldr r0, [r7, #4]
- 800590a: f7ff fe1b bl 8005544 <create_name>
- 800590e: 4603 mov r3, r0
- 8005910: 75fb strb r3, [r7, #23]
- if (res != FR_OK) break;
- 8005912: 7dfb ldrb r3, [r7, #23]
- 8005914: 2b00 cmp r3, #0
- 8005916: d139 bne.n 800598c <follow_path+0xd8>
- res = dir_find(dp); /* Find an object with the segment name */
- 8005918: 6878 ldr r0, [r7, #4]
- 800591a: f7ff fc5a bl 80051d2 <dir_find>
- 800591e: 4603 mov r3, r0
- 8005920: 75fb strb r3, [r7, #23]
- ns = dp->fn[NSFLAG];
- 8005922: 687b ldr r3, [r7, #4]
- 8005924: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
- 8005928: 72fb strb r3, [r7, #11]
- if (res != FR_OK) { /* Failed to find the object */
- 800592a: 7dfb ldrb r3, [r7, #23]
- 800592c: 2b00 cmp r3, #0
- 800592e: d00a beq.n 8005946 <follow_path+0x92>
- if (res == FR_NO_FILE) { /* Object is not found */
- 8005930: 7dfb ldrb r3, [r7, #23]
- 8005932: 2b04 cmp r3, #4
- 8005934: d12c bne.n 8005990 <follow_path+0xdc>
- if (_FS_RPATH && (ns & NS_DOT)) { /* If dot entry is not exist, stay there */
- if (!(ns & NS_LAST)) continue; /* Continue to follow if not last segment */
- dp->fn[NSFLAG] = NS_NONAME;
- res = FR_OK;
- } else { /* Could not find the object */
- if (!(ns & NS_LAST)) res = FR_NO_PATH; /* Adjust error code if not last segment */
- 8005936: 7afb ldrb r3, [r7, #11]
- 8005938: f003 0304 and.w r3, r3, #4
- 800593c: 2b00 cmp r3, #0
- 800593e: d127 bne.n 8005990 <follow_path+0xdc>
- 8005940: 2305 movs r3, #5
- 8005942: 75fb strb r3, [r7, #23]
- }
- }
- break;
- 8005944: e024 b.n 8005990 <follow_path+0xdc>
- }
- if (ns & NS_LAST) break; /* Last segment matched. Function completed. */
- 8005946: 7afb ldrb r3, [r7, #11]
- 8005948: f003 0304 and.w r3, r3, #4
- 800594c: 2b00 cmp r3, #0
- 800594e: d121 bne.n 8005994 <follow_path+0xe0>
- /* Get into the sub-directory */
- if (!(obj->attr & AM_DIR)) { /* It is not a sub-directory and cannot follow */
- 8005950: 693b ldr r3, [r7, #16]
- 8005952: 799b ldrb r3, [r3, #6]
- 8005954: f003 0310 and.w r3, r3, #16
- 8005958: 2b00 cmp r3, #0
- 800595a: d102 bne.n 8005962 <follow_path+0xae>
- res = FR_NO_PATH; break;
- 800595c: 2305 movs r3, #5
- 800595e: 75fb strb r3, [r7, #23]
- 8005960: e019 b.n 8005996 <follow_path+0xe2>
- obj->stat = fs->dirbuf[XDIR_GenFlags] & 2;
- obj->objsize = ld_qword(fs->dirbuf + XDIR_FileSize);
- } else
- #endif
- {
- obj->sclust = ld_clust(fs, fs->win + dp->dptr % SS(fs)); /* Open next directory */
- 8005962: 68fb ldr r3, [r7, #12]
- 8005964: f103 0138 add.w r1, r3, #56 ; 0x38
- 8005968: 687b ldr r3, [r7, #4]
- 800596a: 695b ldr r3, [r3, #20]
- 800596c: 68fa ldr r2, [r7, #12]
- 800596e: 8992 ldrh r2, [r2, #12]
- 8005970: fbb3 f0f2 udiv r0, r3, r2
- 8005974: fb02 f200 mul.w r2, r2, r0
- 8005978: 1a9b subs r3, r3, r2
- 800597a: 440b add r3, r1
- 800597c: 4619 mov r1, r3
- 800597e: 68f8 ldr r0, [r7, #12]
- 8005980: f7ff fa61 bl 8004e46 <ld_clust>
- 8005984: 4602 mov r2, r0
- 8005986: 693b ldr r3, [r7, #16]
- 8005988: 609a str r2, [r3, #8]
- res = create_name(dp, &path); /* Get a segment name of the path */
- 800598a: e7bb b.n 8005904 <follow_path+0x50>
- if (res != FR_OK) break;
- 800598c: bf00 nop
- 800598e: e002 b.n 8005996 <follow_path+0xe2>
- break;
- 8005990: bf00 nop
- 8005992: e000 b.n 8005996 <follow_path+0xe2>
- if (ns & NS_LAST) break; /* Last segment matched. Function completed. */
- 8005994: bf00 nop
- }
- }
- }
-
- return res;
- 8005996: 7dfb ldrb r3, [r7, #23]
- }
- 8005998: 4618 mov r0, r3
- 800599a: 3718 adds r7, #24
- 800599c: 46bd mov sp, r7
- 800599e: bd80 pop {r7, pc}
-
- 080059a0 <get_ldnumber>:
-
- static
- int get_ldnumber ( /* Returns logical drive number (-1:invalid drive) */
- const TCHAR** path /* Pointer to pointer to the path name */
- )
- {
- 80059a0: b480 push {r7}
- 80059a2: b087 sub sp, #28
- 80059a4: af00 add r7, sp, #0
- 80059a6: 6078 str r0, [r7, #4]
- const TCHAR *tp, *tt;
- UINT i;
- int vol = -1;
- 80059a8: f04f 33ff mov.w r3, #4294967295
- 80059ac: 613b str r3, [r7, #16]
- char c;
- TCHAR tc;
- #endif
-
-
- if (*path) { /* If the pointer is not a null */
- 80059ae: 687b ldr r3, [r7, #4]
- 80059b0: 681b ldr r3, [r3, #0]
- 80059b2: 2b00 cmp r3, #0
- 80059b4: d031 beq.n 8005a1a <get_ldnumber+0x7a>
- for (tt = *path; (UINT)*tt >= (_USE_LFN ? ' ' : '!') && *tt != ':'; tt++) ; /* Find ':' in the path */
- 80059b6: 687b ldr r3, [r7, #4]
- 80059b8: 681b ldr r3, [r3, #0]
- 80059ba: 617b str r3, [r7, #20]
- 80059bc: e002 b.n 80059c4 <get_ldnumber+0x24>
- 80059be: 697b ldr r3, [r7, #20]
- 80059c0: 3301 adds r3, #1
- 80059c2: 617b str r3, [r7, #20]
- 80059c4: 697b ldr r3, [r7, #20]
- 80059c6: 781b ldrb r3, [r3, #0]
- 80059c8: 2b1f cmp r3, #31
- 80059ca: d903 bls.n 80059d4 <get_ldnumber+0x34>
- 80059cc: 697b ldr r3, [r7, #20]
- 80059ce: 781b ldrb r3, [r3, #0]
- 80059d0: 2b3a cmp r3, #58 ; 0x3a
- 80059d2: d1f4 bne.n 80059be <get_ldnumber+0x1e>
- if (*tt == ':') { /* If a ':' is exist in the path name */
- 80059d4: 697b ldr r3, [r7, #20]
- 80059d6: 781b ldrb r3, [r3, #0]
- 80059d8: 2b3a cmp r3, #58 ; 0x3a
- 80059da: d11c bne.n 8005a16 <get_ldnumber+0x76>
- tp = *path;
- 80059dc: 687b ldr r3, [r7, #4]
- 80059de: 681b ldr r3, [r3, #0]
- 80059e0: 60fb str r3, [r7, #12]
- i = *tp++ - '0';
- 80059e2: 68fb ldr r3, [r7, #12]
- 80059e4: 1c5a adds r2, r3, #1
- 80059e6: 60fa str r2, [r7, #12]
- 80059e8: 781b ldrb r3, [r3, #0]
- 80059ea: 3b30 subs r3, #48 ; 0x30
- 80059ec: 60bb str r3, [r7, #8]
- if (i < 10 && tp == tt) { /* Is there a numeric drive id? */
- 80059ee: 68bb ldr r3, [r7, #8]
- 80059f0: 2b09 cmp r3, #9
- 80059f2: d80e bhi.n 8005a12 <get_ldnumber+0x72>
- 80059f4: 68fa ldr r2, [r7, #12]
- 80059f6: 697b ldr r3, [r7, #20]
- 80059f8: 429a cmp r2, r3
- 80059fa: d10a bne.n 8005a12 <get_ldnumber+0x72>
- if (i < _VOLUMES) { /* If a drive id is found, get the value and strip it */
- 80059fc: 68bb ldr r3, [r7, #8]
- 80059fe: 2b00 cmp r3, #0
- 8005a00: d107 bne.n 8005a12 <get_ldnumber+0x72>
- vol = (int)i;
- 8005a02: 68bb ldr r3, [r7, #8]
- 8005a04: 613b str r3, [r7, #16]
- *path = ++tt;
- 8005a06: 697b ldr r3, [r7, #20]
- 8005a08: 3301 adds r3, #1
- 8005a0a: 617b str r3, [r7, #20]
- 8005a0c: 687b ldr r3, [r7, #4]
- 8005a0e: 697a ldr r2, [r7, #20]
- 8005a10: 601a str r2, [r3, #0]
- vol = (int)i;
- *path = tt;
- }
- }
- #endif
- return vol;
- 8005a12: 693b ldr r3, [r7, #16]
- 8005a14: e002 b.n 8005a1c <get_ldnumber+0x7c>
- }
- #if _FS_RPATH != 0 && _VOLUMES >= 2
- vol = CurrVol; /* Current drive */
- #else
- vol = 0; /* Drive 0 */
- 8005a16: 2300 movs r3, #0
- 8005a18: 613b str r3, [r7, #16]
- #endif
- }
- return vol;
- 8005a1a: 693b ldr r3, [r7, #16]
- }
- 8005a1c: 4618 mov r0, r3
- 8005a1e: 371c adds r7, #28
- 8005a20: 46bd mov sp, r7
- 8005a22: bc80 pop {r7}
- 8005a24: 4770 bx lr
- ...
-
- 08005a28 <check_fs>:
- static
- BYTE check_fs ( /* 0:FAT, 1:exFAT, 2:Valid BS but not FAT, 3:Not a BS, 4:Disk error */
- FATFS* fs, /* File system object */
- DWORD sect /* Sector# (lba) to load and check if it is an FAT-VBR or not */
- )
- {
- 8005a28: b580 push {r7, lr}
- 8005a2a: b082 sub sp, #8
- 8005a2c: af00 add r7, sp, #0
- 8005a2e: 6078 str r0, [r7, #4]
- 8005a30: 6039 str r1, [r7, #0]
- fs->wflag = 0; fs->winsect = 0xFFFFFFFF; /* Invaidate window */
- 8005a32: 687b ldr r3, [r7, #4]
- 8005a34: 2200 movs r2, #0
- 8005a36: 70da strb r2, [r3, #3]
- 8005a38: 687b ldr r3, [r7, #4]
- 8005a3a: f04f 32ff mov.w r2, #4294967295
- 8005a3e: 635a str r2, [r3, #52] ; 0x34
- if (move_window(fs, sect) != FR_OK) return 4; /* Load boot record */
- 8005a40: 6839 ldr r1, [r7, #0]
- 8005a42: 6878 ldr r0, [r7, #4]
- 8005a44: f7fe fc82 bl 800434c <move_window>
- 8005a48: 4603 mov r3, r0
- 8005a4a: 2b00 cmp r3, #0
- 8005a4c: d001 beq.n 8005a52 <check_fs+0x2a>
- 8005a4e: 2304 movs r3, #4
- 8005a50: e038 b.n 8005ac4 <check_fs+0x9c>
-
- if (ld_word(fs->win + BS_55AA) != 0xAA55) return 3; /* Check boot record signature (always placed here even if the sector size is >512) */
- 8005a52: 687b ldr r3, [r7, #4]
- 8005a54: 3338 adds r3, #56 ; 0x38
- 8005a56: f503 73ff add.w r3, r3, #510 ; 0x1fe
- 8005a5a: 4618 mov r0, r3
- 8005a5c: f7fe f9d6 bl 8003e0c <ld_word>
- 8005a60: 4603 mov r3, r0
- 8005a62: 461a mov r2, r3
- 8005a64: f64a 2355 movw r3, #43605 ; 0xaa55
- 8005a68: 429a cmp r2, r3
- 8005a6a: d001 beq.n 8005a70 <check_fs+0x48>
- 8005a6c: 2303 movs r3, #3
- 8005a6e: e029 b.n 8005ac4 <check_fs+0x9c>
-
- if (fs->win[BS_JmpBoot] == 0xE9 || (fs->win[BS_JmpBoot] == 0xEB && fs->win[BS_JmpBoot + 2] == 0x90)) {
- 8005a70: 687b ldr r3, [r7, #4]
- 8005a72: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
- 8005a76: 2be9 cmp r3, #233 ; 0xe9
- 8005a78: d009 beq.n 8005a8e <check_fs+0x66>
- 8005a7a: 687b ldr r3, [r7, #4]
- 8005a7c: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
- 8005a80: 2beb cmp r3, #235 ; 0xeb
- 8005a82: d11e bne.n 8005ac2 <check_fs+0x9a>
- 8005a84: 687b ldr r3, [r7, #4]
- 8005a86: f893 303a ldrb.w r3, [r3, #58] ; 0x3a
- 8005a8a: 2b90 cmp r3, #144 ; 0x90
- 8005a8c: d119 bne.n 8005ac2 <check_fs+0x9a>
- if ((ld_dword(fs->win + BS_FilSysType) & 0xFFFFFF) == 0x544146) return 0; /* Check "FAT" string */
- 8005a8e: 687b ldr r3, [r7, #4]
- 8005a90: 3338 adds r3, #56 ; 0x38
- 8005a92: 3336 adds r3, #54 ; 0x36
- 8005a94: 4618 mov r0, r3
- 8005a96: f7fe f9d0 bl 8003e3a <ld_dword>
- 8005a9a: 4603 mov r3, r0
- 8005a9c: f023 437f bic.w r3, r3, #4278190080 ; 0xff000000
- 8005aa0: 4a0a ldr r2, [pc, #40] ; (8005acc <check_fs+0xa4>)
- 8005aa2: 4293 cmp r3, r2
- 8005aa4: d101 bne.n 8005aaa <check_fs+0x82>
- 8005aa6: 2300 movs r3, #0
- 8005aa8: e00c b.n 8005ac4 <check_fs+0x9c>
- if (ld_dword(fs->win + BS_FilSysType32) == 0x33544146) return 0; /* Check "FAT3" string */
- 8005aaa: 687b ldr r3, [r7, #4]
- 8005aac: 3338 adds r3, #56 ; 0x38
- 8005aae: 3352 adds r3, #82 ; 0x52
- 8005ab0: 4618 mov r0, r3
- 8005ab2: f7fe f9c2 bl 8003e3a <ld_dword>
- 8005ab6: 4602 mov r2, r0
- 8005ab8: 4b05 ldr r3, [pc, #20] ; (8005ad0 <check_fs+0xa8>)
- 8005aba: 429a cmp r2, r3
- 8005abc: d101 bne.n 8005ac2 <check_fs+0x9a>
- 8005abe: 2300 movs r3, #0
- 8005ac0: e000 b.n 8005ac4 <check_fs+0x9c>
- }
- #if _FS_EXFAT
- if (!mem_cmp(fs->win + BS_JmpBoot, "\xEB\x76\x90" "EXFAT ", 11)) return 1;
- #endif
- return 2;
- 8005ac2: 2302 movs r3, #2
- }
- 8005ac4: 4618 mov r0, r3
- 8005ac6: 3708 adds r7, #8
- 8005ac8: 46bd mov sp, r7
- 8005aca: bd80 pop {r7, pc}
- 8005acc: 00544146 .word 0x00544146
- 8005ad0: 33544146 .word 0x33544146
-
- 08005ad4 <find_volume>:
- FRESULT find_volume ( /* FR_OK(0): successful, !=0: any error occurred */
- const TCHAR** path, /* Pointer to pointer to the path name (drive number) */
- FATFS** rfs, /* Pointer to pointer to the found file system object */
- BYTE mode /* !=0: Check write protection for write access */
- )
- {
- 8005ad4: b580 push {r7, lr}
- 8005ad6: b096 sub sp, #88 ; 0x58
- 8005ad8: af00 add r7, sp, #0
- 8005ada: 60f8 str r0, [r7, #12]
- 8005adc: 60b9 str r1, [r7, #8]
- 8005ade: 4613 mov r3, r2
- 8005ae0: 71fb strb r3, [r7, #7]
- FATFS *fs;
- UINT i;
-
-
- /* Get logical drive number */
- *rfs = 0;
- 8005ae2: 68bb ldr r3, [r7, #8]
- 8005ae4: 2200 movs r2, #0
- 8005ae6: 601a str r2, [r3, #0]
- vol = get_ldnumber(path);
- 8005ae8: 68f8 ldr r0, [r7, #12]
- 8005aea: f7ff ff59 bl 80059a0 <get_ldnumber>
- 8005aee: 63f8 str r0, [r7, #60] ; 0x3c
- if (vol < 0) return FR_INVALID_DRIVE;
- 8005af0: 6bfb ldr r3, [r7, #60] ; 0x3c
- 8005af2: 2b00 cmp r3, #0
- 8005af4: da01 bge.n 8005afa <find_volume+0x26>
- 8005af6: 230b movs r3, #11
- 8005af8: e268 b.n 8005fcc <find_volume+0x4f8>
-
- /* Check if the file system object is valid or not */
- fs = FatFs[vol]; /* Get pointer to the file system object */
- 8005afa: 4ab0 ldr r2, [pc, #704] ; (8005dbc <find_volume+0x2e8>)
- 8005afc: 6bfb ldr r3, [r7, #60] ; 0x3c
- 8005afe: f852 3023 ldr.w r3, [r2, r3, lsl #2]
- 8005b02: 63bb str r3, [r7, #56] ; 0x38
- if (!fs) return FR_NOT_ENABLED; /* Is the file system object available? */
- 8005b04: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005b06: 2b00 cmp r3, #0
- 8005b08: d101 bne.n 8005b0e <find_volume+0x3a>
- 8005b0a: 230c movs r3, #12
- 8005b0c: e25e b.n 8005fcc <find_volume+0x4f8>
-
- ENTER_FF(fs); /* Lock the volume */
- *rfs = fs; /* Return pointer to the file system object */
- 8005b0e: 68bb ldr r3, [r7, #8]
- 8005b10: 6bba ldr r2, [r7, #56] ; 0x38
- 8005b12: 601a str r2, [r3, #0]
-
- mode &= (BYTE)~FA_READ; /* Desired access mode, write access or not */
- 8005b14: 79fb ldrb r3, [r7, #7]
- 8005b16: f023 0301 bic.w r3, r3, #1
- 8005b1a: 71fb strb r3, [r7, #7]
- if (fs->fs_type) { /* If the volume has been mounted */
- 8005b1c: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005b1e: 781b ldrb r3, [r3, #0]
- 8005b20: 2b00 cmp r3, #0
- 8005b22: d01a beq.n 8005b5a <find_volume+0x86>
- stat = disk_status(fs->drv);
- 8005b24: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005b26: 785b ldrb r3, [r3, #1]
- 8005b28: 4618 mov r0, r3
- 8005b2a: f7fe f8d1 bl 8003cd0 <disk_status>
- 8005b2e: 4603 mov r3, r0
- 8005b30: f887 3037 strb.w r3, [r7, #55] ; 0x37
- if (!(stat & STA_NOINIT)) { /* and the physical drive is kept initialized */
- 8005b34: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
- 8005b38: f003 0301 and.w r3, r3, #1
- 8005b3c: 2b00 cmp r3, #0
- 8005b3e: d10c bne.n 8005b5a <find_volume+0x86>
- if (!_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check write protection if needed */
- 8005b40: 79fb ldrb r3, [r7, #7]
- 8005b42: 2b00 cmp r3, #0
- 8005b44: d007 beq.n 8005b56 <find_volume+0x82>
- 8005b46: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
- 8005b4a: f003 0304 and.w r3, r3, #4
- 8005b4e: 2b00 cmp r3, #0
- 8005b50: d001 beq.n 8005b56 <find_volume+0x82>
- return FR_WRITE_PROTECTED;
- 8005b52: 230a movs r3, #10
- 8005b54: e23a b.n 8005fcc <find_volume+0x4f8>
- }
- return FR_OK; /* The file system object is valid */
- 8005b56: 2300 movs r3, #0
- 8005b58: e238 b.n 8005fcc <find_volume+0x4f8>
- }
-
- /* The file system object is not valid. */
- /* Following code attempts to mount the volume. (analyze BPB and initialize the fs object) */
-
- fs->fs_type = 0; /* Clear the file system object */
- 8005b5a: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005b5c: 2200 movs r2, #0
- 8005b5e: 701a strb r2, [r3, #0]
- fs->drv = LD2PD(vol); /* Bind the logical drive and a physical drive */
- 8005b60: 6bfb ldr r3, [r7, #60] ; 0x3c
- 8005b62: b2da uxtb r2, r3
- 8005b64: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005b66: 705a strb r2, [r3, #1]
- stat = disk_initialize(fs->drv); /* Initialize the physical drive */
- 8005b68: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005b6a: 785b ldrb r3, [r3, #1]
- 8005b6c: 4618 mov r0, r3
- 8005b6e: f7fe f8c9 bl 8003d04 <disk_initialize>
- 8005b72: 4603 mov r3, r0
- 8005b74: f887 3037 strb.w r3, [r7, #55] ; 0x37
- if (stat & STA_NOINIT) { /* Check if the initialization succeeded */
- 8005b78: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
- 8005b7c: f003 0301 and.w r3, r3, #1
- 8005b80: 2b00 cmp r3, #0
- 8005b82: d001 beq.n 8005b88 <find_volume+0xb4>
- return FR_NOT_READY; /* Failed to initialize due to no medium or hard error */
- 8005b84: 2303 movs r3, #3
- 8005b86: e221 b.n 8005fcc <find_volume+0x4f8>
- }
- if (!_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check disk write protection if needed */
- 8005b88: 79fb ldrb r3, [r7, #7]
- 8005b8a: 2b00 cmp r3, #0
- 8005b8c: d007 beq.n 8005b9e <find_volume+0xca>
- 8005b8e: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
- 8005b92: f003 0304 and.w r3, r3, #4
- 8005b96: 2b00 cmp r3, #0
- 8005b98: d001 beq.n 8005b9e <find_volume+0xca>
- return FR_WRITE_PROTECTED;
- 8005b9a: 230a movs r3, #10
- 8005b9c: e216 b.n 8005fcc <find_volume+0x4f8>
- }
- #if _MAX_SS != _MIN_SS /* Get sector size (multiple sector size cfg only) */
- if (disk_ioctl(fs->drv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK) return FR_DISK_ERR;
- 8005b9e: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ba0: 7858 ldrb r0, [r3, #1]
- 8005ba2: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ba4: 330c adds r3, #12
- 8005ba6: 461a mov r2, r3
- 8005ba8: 2102 movs r1, #2
- 8005baa: f7fe f911 bl 8003dd0 <disk_ioctl>
- 8005bae: 4603 mov r3, r0
- 8005bb0: 2b00 cmp r3, #0
- 8005bb2: d001 beq.n 8005bb8 <find_volume+0xe4>
- 8005bb4: 2301 movs r3, #1
- 8005bb6: e209 b.n 8005fcc <find_volume+0x4f8>
- if (SS(fs) > _MAX_SS || SS(fs) < _MIN_SS || (SS(fs) & (SS(fs) - 1))) return FR_DISK_ERR;
- 8005bb8: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005bba: 899b ldrh r3, [r3, #12]
- 8005bbc: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
- 8005bc0: d80d bhi.n 8005bde <find_volume+0x10a>
- 8005bc2: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005bc4: 899b ldrh r3, [r3, #12]
- 8005bc6: f5b3 7f00 cmp.w r3, #512 ; 0x200
- 8005bca: d308 bcc.n 8005bde <find_volume+0x10a>
- 8005bcc: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005bce: 899b ldrh r3, [r3, #12]
- 8005bd0: 461a mov r2, r3
- 8005bd2: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005bd4: 899b ldrh r3, [r3, #12]
- 8005bd6: 3b01 subs r3, #1
- 8005bd8: 4013 ands r3, r2
- 8005bda: 2b00 cmp r3, #0
- 8005bdc: d001 beq.n 8005be2 <find_volume+0x10e>
- 8005bde: 2301 movs r3, #1
- 8005be0: e1f4 b.n 8005fcc <find_volume+0x4f8>
- #endif
-
- /* Find an FAT partition on the drive. Supports only generic partitioning rules, FDISK and SFD. */
- bsect = 0;
- 8005be2: 2300 movs r3, #0
- 8005be4: 653b str r3, [r7, #80] ; 0x50
- fmt = check_fs(fs, bsect); /* Load sector 0 and check if it is an FAT-VBR as SFD */
- 8005be6: 6d39 ldr r1, [r7, #80] ; 0x50
- 8005be8: 6bb8 ldr r0, [r7, #56] ; 0x38
- 8005bea: f7ff ff1d bl 8005a28 <check_fs>
- 8005bee: 4603 mov r3, r0
- 8005bf0: f887 3057 strb.w r3, [r7, #87] ; 0x57
- if (fmt == 2 || (fmt < 2 && LD2PT(vol) != 0)) { /* Not an FAT-VBR or forced partition number */
- 8005bf4: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
- 8005bf8: 2b02 cmp r3, #2
- 8005bfa: d14b bne.n 8005c94 <find_volume+0x1c0>
- for (i = 0; i < 4; i++) { /* Get partition offset */
- 8005bfc: 2300 movs r3, #0
- 8005bfe: 643b str r3, [r7, #64] ; 0x40
- 8005c00: e01f b.n 8005c42 <find_volume+0x16e>
- pt = fs->win + (MBR_Table + i * SZ_PTE);
- 8005c02: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005c04: f103 0238 add.w r2, r3, #56 ; 0x38
- 8005c08: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c0a: 011b lsls r3, r3, #4
- 8005c0c: f503 73df add.w r3, r3, #446 ; 0x1be
- 8005c10: 4413 add r3, r2
- 8005c12: 633b str r3, [r7, #48] ; 0x30
- br[i] = pt[PTE_System] ? ld_dword(pt + PTE_StLba) : 0;
- 8005c14: 6b3b ldr r3, [r7, #48] ; 0x30
- 8005c16: 3304 adds r3, #4
- 8005c18: 781b ldrb r3, [r3, #0]
- 8005c1a: 2b00 cmp r3, #0
- 8005c1c: d006 beq.n 8005c2c <find_volume+0x158>
- 8005c1e: 6b3b ldr r3, [r7, #48] ; 0x30
- 8005c20: 3308 adds r3, #8
- 8005c22: 4618 mov r0, r3
- 8005c24: f7fe f909 bl 8003e3a <ld_dword>
- 8005c28: 4602 mov r2, r0
- 8005c2a: e000 b.n 8005c2e <find_volume+0x15a>
- 8005c2c: 2200 movs r2, #0
- 8005c2e: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c30: 009b lsls r3, r3, #2
- 8005c32: f107 0158 add.w r1, r7, #88 ; 0x58
- 8005c36: 440b add r3, r1
- 8005c38: f843 2c44 str.w r2, [r3, #-68]
- for (i = 0; i < 4; i++) { /* Get partition offset */
- 8005c3c: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c3e: 3301 adds r3, #1
- 8005c40: 643b str r3, [r7, #64] ; 0x40
- 8005c42: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c44: 2b03 cmp r3, #3
- 8005c46: d9dc bls.n 8005c02 <find_volume+0x12e>
- }
- i = LD2PT(vol); /* Partition number: 0:auto, 1-4:forced */
- 8005c48: 2300 movs r3, #0
- 8005c4a: 643b str r3, [r7, #64] ; 0x40
- if (i) i--;
- 8005c4c: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c4e: 2b00 cmp r3, #0
- 8005c50: d002 beq.n 8005c58 <find_volume+0x184>
- 8005c52: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c54: 3b01 subs r3, #1
- 8005c56: 643b str r3, [r7, #64] ; 0x40
- do { /* Find an FAT volume */
- bsect = br[i];
- 8005c58: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c5a: 009b lsls r3, r3, #2
- 8005c5c: f107 0258 add.w r2, r7, #88 ; 0x58
- 8005c60: 4413 add r3, r2
- 8005c62: f853 3c44 ldr.w r3, [r3, #-68]
- 8005c66: 653b str r3, [r7, #80] ; 0x50
- fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */
- 8005c68: 6d3b ldr r3, [r7, #80] ; 0x50
- 8005c6a: 2b00 cmp r3, #0
- 8005c6c: d005 beq.n 8005c7a <find_volume+0x1a6>
- 8005c6e: 6d39 ldr r1, [r7, #80] ; 0x50
- 8005c70: 6bb8 ldr r0, [r7, #56] ; 0x38
- 8005c72: f7ff fed9 bl 8005a28 <check_fs>
- 8005c76: 4603 mov r3, r0
- 8005c78: e000 b.n 8005c7c <find_volume+0x1a8>
- 8005c7a: 2303 movs r3, #3
- 8005c7c: f887 3057 strb.w r3, [r7, #87] ; 0x57
- } while (LD2PT(vol) == 0 && fmt >= 2 && ++i < 4);
- 8005c80: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
- 8005c84: 2b01 cmp r3, #1
- 8005c86: d905 bls.n 8005c94 <find_volume+0x1c0>
- 8005c88: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c8a: 3301 adds r3, #1
- 8005c8c: 643b str r3, [r7, #64] ; 0x40
- 8005c8e: 6c3b ldr r3, [r7, #64] ; 0x40
- 8005c90: 2b03 cmp r3, #3
- 8005c92: d9e1 bls.n 8005c58 <find_volume+0x184>
- }
- if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */
- 8005c94: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
- 8005c98: 2b04 cmp r3, #4
- 8005c9a: d101 bne.n 8005ca0 <find_volume+0x1cc>
- 8005c9c: 2301 movs r3, #1
- 8005c9e: e195 b.n 8005fcc <find_volume+0x4f8>
- if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */
- 8005ca0: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
- 8005ca4: 2b01 cmp r3, #1
- 8005ca6: d901 bls.n 8005cac <find_volume+0x1d8>
- 8005ca8: 230d movs r3, #13
- 8005caa: e18f b.n 8005fcc <find_volume+0x4f8>
- #endif
- fmt = FS_EXFAT; /* FAT sub-type */
- } else
- #endif /* _FS_EXFAT */
- {
- if (ld_word(fs->win + BPB_BytsPerSec) != SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_BytsPerSec must be equal to the physical sector size) */
- 8005cac: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005cae: 3338 adds r3, #56 ; 0x38
- 8005cb0: 330b adds r3, #11
- 8005cb2: 4618 mov r0, r3
- 8005cb4: f7fe f8aa bl 8003e0c <ld_word>
- 8005cb8: 4603 mov r3, r0
- 8005cba: 461a mov r2, r3
- 8005cbc: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005cbe: 899b ldrh r3, [r3, #12]
- 8005cc0: 429a cmp r2, r3
- 8005cc2: d001 beq.n 8005cc8 <find_volume+0x1f4>
- 8005cc4: 230d movs r3, #13
- 8005cc6: e181 b.n 8005fcc <find_volume+0x4f8>
-
- fasize = ld_word(fs->win + BPB_FATSz16); /* Number of sectors per FAT */
- 8005cc8: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005cca: 3338 adds r3, #56 ; 0x38
- 8005ccc: 3316 adds r3, #22
- 8005cce: 4618 mov r0, r3
- 8005cd0: f7fe f89c bl 8003e0c <ld_word>
- 8005cd4: 4603 mov r3, r0
- 8005cd6: 64fb str r3, [r7, #76] ; 0x4c
- if (fasize == 0) fasize = ld_dword(fs->win + BPB_FATSz32);
- 8005cd8: 6cfb ldr r3, [r7, #76] ; 0x4c
- 8005cda: 2b00 cmp r3, #0
- 8005cdc: d106 bne.n 8005cec <find_volume+0x218>
- 8005cde: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ce0: 3338 adds r3, #56 ; 0x38
- 8005ce2: 3324 adds r3, #36 ; 0x24
- 8005ce4: 4618 mov r0, r3
- 8005ce6: f7fe f8a8 bl 8003e3a <ld_dword>
- 8005cea: 64f8 str r0, [r7, #76] ; 0x4c
- fs->fsize = fasize;
- 8005cec: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005cee: 6cfa ldr r2, [r7, #76] ; 0x4c
- 8005cf0: 621a str r2, [r3, #32]
-
- fs->n_fats = fs->win[BPB_NumFATs]; /* Number of FATs */
- 8005cf2: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005cf4: f893 2048 ldrb.w r2, [r3, #72] ; 0x48
- 8005cf8: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005cfa: 709a strb r2, [r3, #2]
- if (fs->n_fats != 1 && fs->n_fats != 2) return FR_NO_FILESYSTEM; /* (Must be 1 or 2) */
- 8005cfc: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005cfe: 789b ldrb r3, [r3, #2]
- 8005d00: 2b01 cmp r3, #1
- 8005d02: d005 beq.n 8005d10 <find_volume+0x23c>
- 8005d04: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d06: 789b ldrb r3, [r3, #2]
- 8005d08: 2b02 cmp r3, #2
- 8005d0a: d001 beq.n 8005d10 <find_volume+0x23c>
- 8005d0c: 230d movs r3, #13
- 8005d0e: e15d b.n 8005fcc <find_volume+0x4f8>
- fasize *= fs->n_fats; /* Number of sectors for FAT area */
- 8005d10: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d12: 789b ldrb r3, [r3, #2]
- 8005d14: 461a mov r2, r3
- 8005d16: 6cfb ldr r3, [r7, #76] ; 0x4c
- 8005d18: fb02 f303 mul.w r3, r2, r3
- 8005d1c: 64fb str r3, [r7, #76] ; 0x4c
-
- fs->csize = fs->win[BPB_SecPerClus]; /* Cluster size */
- 8005d1e: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d20: f893 3045 ldrb.w r3, [r3, #69] ; 0x45
- 8005d24: b29a uxth r2, r3
- 8005d26: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d28: 815a strh r2, [r3, #10]
- if (fs->csize == 0 || (fs->csize & (fs->csize - 1))) return FR_NO_FILESYSTEM; /* (Must be power of 2) */
- 8005d2a: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d2c: 895b ldrh r3, [r3, #10]
- 8005d2e: 2b00 cmp r3, #0
- 8005d30: d008 beq.n 8005d44 <find_volume+0x270>
- 8005d32: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d34: 895b ldrh r3, [r3, #10]
- 8005d36: 461a mov r2, r3
- 8005d38: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d3a: 895b ldrh r3, [r3, #10]
- 8005d3c: 3b01 subs r3, #1
- 8005d3e: 4013 ands r3, r2
- 8005d40: 2b00 cmp r3, #0
- 8005d42: d001 beq.n 8005d48 <find_volume+0x274>
- 8005d44: 230d movs r3, #13
- 8005d46: e141 b.n 8005fcc <find_volume+0x4f8>
-
- fs->n_rootdir = ld_word(fs->win + BPB_RootEntCnt); /* Number of root directory entries */
- 8005d48: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d4a: 3338 adds r3, #56 ; 0x38
- 8005d4c: 3311 adds r3, #17
- 8005d4e: 4618 mov r0, r3
- 8005d50: f7fe f85c bl 8003e0c <ld_word>
- 8005d54: 4603 mov r3, r0
- 8005d56: 461a mov r2, r3
- 8005d58: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d5a: 811a strh r2, [r3, #8]
- if (fs->n_rootdir % (SS(fs) / SZDIRE)) return FR_NO_FILESYSTEM; /* (Must be sector aligned) */
- 8005d5c: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d5e: 891b ldrh r3, [r3, #8]
- 8005d60: 6bba ldr r2, [r7, #56] ; 0x38
- 8005d62: 8992 ldrh r2, [r2, #12]
- 8005d64: 0952 lsrs r2, r2, #5
- 8005d66: b292 uxth r2, r2
- 8005d68: fbb3 f1f2 udiv r1, r3, r2
- 8005d6c: fb02 f201 mul.w r2, r2, r1
- 8005d70: 1a9b subs r3, r3, r2
- 8005d72: b29b uxth r3, r3
- 8005d74: 2b00 cmp r3, #0
- 8005d76: d001 beq.n 8005d7c <find_volume+0x2a8>
- 8005d78: 230d movs r3, #13
- 8005d7a: e127 b.n 8005fcc <find_volume+0x4f8>
-
- tsect = ld_word(fs->win + BPB_TotSec16); /* Number of sectors on the volume */
- 8005d7c: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d7e: 3338 adds r3, #56 ; 0x38
- 8005d80: 3313 adds r3, #19
- 8005d82: 4618 mov r0, r3
- 8005d84: f7fe f842 bl 8003e0c <ld_word>
- 8005d88: 4603 mov r3, r0
- 8005d8a: 64bb str r3, [r7, #72] ; 0x48
- if (tsect == 0) tsect = ld_dword(fs->win + BPB_TotSec32);
- 8005d8c: 6cbb ldr r3, [r7, #72] ; 0x48
- 8005d8e: 2b00 cmp r3, #0
- 8005d90: d106 bne.n 8005da0 <find_volume+0x2cc>
- 8005d92: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005d94: 3338 adds r3, #56 ; 0x38
- 8005d96: 3320 adds r3, #32
- 8005d98: 4618 mov r0, r3
- 8005d9a: f7fe f84e bl 8003e3a <ld_dword>
- 8005d9e: 64b8 str r0, [r7, #72] ; 0x48
-
- nrsv = ld_word(fs->win + BPB_RsvdSecCnt); /* Number of reserved sectors */
- 8005da0: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005da2: 3338 adds r3, #56 ; 0x38
- 8005da4: 330e adds r3, #14
- 8005da6: 4618 mov r0, r3
- 8005da8: f7fe f830 bl 8003e0c <ld_word>
- 8005dac: 4603 mov r3, r0
- 8005dae: 85fb strh r3, [r7, #46] ; 0x2e
- if (nrsv == 0) return FR_NO_FILESYSTEM; /* (Must not be 0) */
- 8005db0: 8dfb ldrh r3, [r7, #46] ; 0x2e
- 8005db2: 2b00 cmp r3, #0
- 8005db4: d104 bne.n 8005dc0 <find_volume+0x2ec>
- 8005db6: 230d movs r3, #13
- 8005db8: e108 b.n 8005fcc <find_volume+0x4f8>
- 8005dba: bf00 nop
- 8005dbc: 200000ac .word 0x200000ac
-
- /* Determine the FAT sub type */
- sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZDIRE); /* RSV + FAT + DIR */
- 8005dc0: 8dfa ldrh r2, [r7, #46] ; 0x2e
- 8005dc2: 6cfb ldr r3, [r7, #76] ; 0x4c
- 8005dc4: 4413 add r3, r2
- 8005dc6: 6bba ldr r2, [r7, #56] ; 0x38
- 8005dc8: 8911 ldrh r1, [r2, #8]
- 8005dca: 6bba ldr r2, [r7, #56] ; 0x38
- 8005dcc: 8992 ldrh r2, [r2, #12]
- 8005dce: 0952 lsrs r2, r2, #5
- 8005dd0: b292 uxth r2, r2
- 8005dd2: fbb1 f2f2 udiv r2, r1, r2
- 8005dd6: b292 uxth r2, r2
- 8005dd8: 4413 add r3, r2
- 8005dda: 62bb str r3, [r7, #40] ; 0x28
- if (tsect < sysect) return FR_NO_FILESYSTEM; /* (Invalid volume size) */
- 8005ddc: 6cba ldr r2, [r7, #72] ; 0x48
- 8005dde: 6abb ldr r3, [r7, #40] ; 0x28
- 8005de0: 429a cmp r2, r3
- 8005de2: d201 bcs.n 8005de8 <find_volume+0x314>
- 8005de4: 230d movs r3, #13
- 8005de6: e0f1 b.n 8005fcc <find_volume+0x4f8>
- nclst = (tsect - sysect) / fs->csize; /* Number of clusters */
- 8005de8: 6cba ldr r2, [r7, #72] ; 0x48
- 8005dea: 6abb ldr r3, [r7, #40] ; 0x28
- 8005dec: 1ad3 subs r3, r2, r3
- 8005dee: 6bba ldr r2, [r7, #56] ; 0x38
- 8005df0: 8952 ldrh r2, [r2, #10]
- 8005df2: fbb3 f3f2 udiv r3, r3, r2
- 8005df6: 627b str r3, [r7, #36] ; 0x24
- if (nclst == 0) return FR_NO_FILESYSTEM; /* (Invalid volume size) */
- 8005df8: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005dfa: 2b00 cmp r3, #0
- 8005dfc: d101 bne.n 8005e02 <find_volume+0x32e>
- 8005dfe: 230d movs r3, #13
- 8005e00: e0e4 b.n 8005fcc <find_volume+0x4f8>
- fmt = FS_FAT32;
- 8005e02: 2303 movs r3, #3
- 8005e04: f887 3057 strb.w r3, [r7, #87] ; 0x57
- if (nclst <= MAX_FAT16) fmt = FS_FAT16;
- 8005e08: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005e0a: f64f 72f5 movw r2, #65525 ; 0xfff5
- 8005e0e: 4293 cmp r3, r2
- 8005e10: d802 bhi.n 8005e18 <find_volume+0x344>
- 8005e12: 2302 movs r3, #2
- 8005e14: f887 3057 strb.w r3, [r7, #87] ; 0x57
- if (nclst <= MAX_FAT12) fmt = FS_FAT12;
- 8005e18: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005e1a: f640 72f5 movw r2, #4085 ; 0xff5
- 8005e1e: 4293 cmp r3, r2
- 8005e20: d802 bhi.n 8005e28 <find_volume+0x354>
- 8005e22: 2301 movs r3, #1
- 8005e24: f887 3057 strb.w r3, [r7, #87] ; 0x57
-
- /* Boundaries and Limits */
- fs->n_fatent = nclst + 2; /* Number of FAT entries */
- 8005e28: 6a7b ldr r3, [r7, #36] ; 0x24
- 8005e2a: 1c9a adds r2, r3, #2
- 8005e2c: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e2e: 61da str r2, [r3, #28]
- fs->volbase = bsect; /* Volume start sector */
- 8005e30: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e32: 6d3a ldr r2, [r7, #80] ; 0x50
- 8005e34: 625a str r2, [r3, #36] ; 0x24
- fs->fatbase = bsect + nrsv; /* FAT start sector */
- 8005e36: 8dfa ldrh r2, [r7, #46] ; 0x2e
- 8005e38: 6d3b ldr r3, [r7, #80] ; 0x50
- 8005e3a: 441a add r2, r3
- 8005e3c: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e3e: 629a str r2, [r3, #40] ; 0x28
- fs->database = bsect + sysect; /* Data start sector */
- 8005e40: 6d3a ldr r2, [r7, #80] ; 0x50
- 8005e42: 6abb ldr r3, [r7, #40] ; 0x28
- 8005e44: 441a add r2, r3
- 8005e46: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e48: 631a str r2, [r3, #48] ; 0x30
- if (fmt == FS_FAT32) {
- 8005e4a: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
- 8005e4e: 2b03 cmp r3, #3
- 8005e50: d11e bne.n 8005e90 <find_volume+0x3bc>
- if (ld_word(fs->win + BPB_FSVer32) != 0) return FR_NO_FILESYSTEM; /* (Must be FAT32 revision 0.0) */
- 8005e52: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e54: 3338 adds r3, #56 ; 0x38
- 8005e56: 332a adds r3, #42 ; 0x2a
- 8005e58: 4618 mov r0, r3
- 8005e5a: f7fd ffd7 bl 8003e0c <ld_word>
- 8005e5e: 4603 mov r3, r0
- 8005e60: 2b00 cmp r3, #0
- 8005e62: d001 beq.n 8005e68 <find_volume+0x394>
- 8005e64: 230d movs r3, #13
- 8005e66: e0b1 b.n 8005fcc <find_volume+0x4f8>
- if (fs->n_rootdir) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must be 0) */
- 8005e68: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e6a: 891b ldrh r3, [r3, #8]
- 8005e6c: 2b00 cmp r3, #0
- 8005e6e: d001 beq.n 8005e74 <find_volume+0x3a0>
- 8005e70: 230d movs r3, #13
- 8005e72: e0ab b.n 8005fcc <find_volume+0x4f8>
- fs->dirbase = ld_dword(fs->win + BPB_RootClus32); /* Root directory start cluster */
- 8005e74: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e76: 3338 adds r3, #56 ; 0x38
- 8005e78: 332c adds r3, #44 ; 0x2c
- 8005e7a: 4618 mov r0, r3
- 8005e7c: f7fd ffdd bl 8003e3a <ld_dword>
- 8005e80: 4602 mov r2, r0
- 8005e82: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e84: 62da str r2, [r3, #44] ; 0x2c
- szbfat = fs->n_fatent * 4; /* (Needed FAT size) */
- 8005e86: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e88: 69db ldr r3, [r3, #28]
- 8005e8a: 009b lsls r3, r3, #2
- 8005e8c: 647b str r3, [r7, #68] ; 0x44
- 8005e8e: e01f b.n 8005ed0 <find_volume+0x3fc>
- } else {
- if (fs->n_rootdir == 0) return FR_NO_FILESYSTEM;/* (BPB_RootEntCnt must not be 0) */
- 8005e90: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e92: 891b ldrh r3, [r3, #8]
- 8005e94: 2b00 cmp r3, #0
- 8005e96: d101 bne.n 8005e9c <find_volume+0x3c8>
- 8005e98: 230d movs r3, #13
- 8005e9a: e097 b.n 8005fcc <find_volume+0x4f8>
- fs->dirbase = fs->fatbase + fasize; /* Root directory start sector */
- 8005e9c: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005e9e: 6a9a ldr r2, [r3, #40] ; 0x28
- 8005ea0: 6cfb ldr r3, [r7, #76] ; 0x4c
- 8005ea2: 441a add r2, r3
- 8005ea4: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ea6: 62da str r2, [r3, #44] ; 0x2c
- szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */
- fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1);
- 8005ea8: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
- 8005eac: 2b02 cmp r3, #2
- 8005eae: d103 bne.n 8005eb8 <find_volume+0x3e4>
- 8005eb0: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005eb2: 69db ldr r3, [r3, #28]
- 8005eb4: 005b lsls r3, r3, #1
- 8005eb6: e00a b.n 8005ece <find_volume+0x3fa>
- 8005eb8: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005eba: 69da ldr r2, [r3, #28]
- 8005ebc: 4613 mov r3, r2
- 8005ebe: 005b lsls r3, r3, #1
- 8005ec0: 4413 add r3, r2
- 8005ec2: 085a lsrs r2, r3, #1
- 8005ec4: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ec6: 69db ldr r3, [r3, #28]
- 8005ec8: f003 0301 and.w r3, r3, #1
- 8005ecc: 4413 add r3, r2
- szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */
- 8005ece: 647b str r3, [r7, #68] ; 0x44
- }
- if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_FATSz must not be less than the size needed) */
- 8005ed0: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ed2: 6a1a ldr r2, [r3, #32]
- 8005ed4: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ed6: 899b ldrh r3, [r3, #12]
- 8005ed8: 4619 mov r1, r3
- 8005eda: 6c7b ldr r3, [r7, #68] ; 0x44
- 8005edc: 440b add r3, r1
- 8005ede: 3b01 subs r3, #1
- 8005ee0: 6bb9 ldr r1, [r7, #56] ; 0x38
- 8005ee2: 8989 ldrh r1, [r1, #12]
- 8005ee4: fbb3 f3f1 udiv r3, r3, r1
- 8005ee8: 429a cmp r2, r3
- 8005eea: d201 bcs.n 8005ef0 <find_volume+0x41c>
- 8005eec: 230d movs r3, #13
- 8005eee: e06d b.n 8005fcc <find_volume+0x4f8>
-
- #if !_FS_READONLY
- /* Get FSINFO if available */
- fs->last_clst = fs->free_clst = 0xFFFFFFFF; /* Initialize cluster allocation information */
- 8005ef0: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005ef2: f04f 32ff mov.w r2, #4294967295
- 8005ef6: 619a str r2, [r3, #24]
- 8005ef8: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005efa: 699a ldr r2, [r3, #24]
- 8005efc: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005efe: 615a str r2, [r3, #20]
- fs->fsi_flag = 0x80;
- 8005f00: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f02: 2280 movs r2, #128 ; 0x80
- 8005f04: 711a strb r2, [r3, #4]
- #if (_FS_NOFSINFO & 3) != 3
- if (fmt == FS_FAT32 /* Enable FSINFO only if FAT32 and BPB_FSInfo32 == 1 */
- 8005f06: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
- 8005f0a: 2b03 cmp r3, #3
- 8005f0c: d149 bne.n 8005fa2 <find_volume+0x4ce>
- && ld_word(fs->win + BPB_FSInfo32) == 1
- 8005f0e: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f10: 3338 adds r3, #56 ; 0x38
- 8005f12: 3330 adds r3, #48 ; 0x30
- 8005f14: 4618 mov r0, r3
- 8005f16: f7fd ff79 bl 8003e0c <ld_word>
- 8005f1a: 4603 mov r3, r0
- 8005f1c: 2b01 cmp r3, #1
- 8005f1e: d140 bne.n 8005fa2 <find_volume+0x4ce>
- && move_window(fs, bsect + 1) == FR_OK)
- 8005f20: 6d3b ldr r3, [r7, #80] ; 0x50
- 8005f22: 3301 adds r3, #1
- 8005f24: 4619 mov r1, r3
- 8005f26: 6bb8 ldr r0, [r7, #56] ; 0x38
- 8005f28: f7fe fa10 bl 800434c <move_window>
- 8005f2c: 4603 mov r3, r0
- 8005f2e: 2b00 cmp r3, #0
- 8005f30: d137 bne.n 8005fa2 <find_volume+0x4ce>
- {
- fs->fsi_flag = 0;
- 8005f32: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f34: 2200 movs r2, #0
- 8005f36: 711a strb r2, [r3, #4]
- if (ld_word(fs->win + BS_55AA) == 0xAA55 /* Load FSINFO data if available */
- 8005f38: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f3a: 3338 adds r3, #56 ; 0x38
- 8005f3c: f503 73ff add.w r3, r3, #510 ; 0x1fe
- 8005f40: 4618 mov r0, r3
- 8005f42: f7fd ff63 bl 8003e0c <ld_word>
- 8005f46: 4603 mov r3, r0
- 8005f48: 461a mov r2, r3
- 8005f4a: f64a 2355 movw r3, #43605 ; 0xaa55
- 8005f4e: 429a cmp r2, r3
- 8005f50: d127 bne.n 8005fa2 <find_volume+0x4ce>
- && ld_dword(fs->win + FSI_LeadSig) == 0x41615252
- 8005f52: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f54: 3338 adds r3, #56 ; 0x38
- 8005f56: 4618 mov r0, r3
- 8005f58: f7fd ff6f bl 8003e3a <ld_dword>
- 8005f5c: 4602 mov r2, r0
- 8005f5e: 4b1d ldr r3, [pc, #116] ; (8005fd4 <find_volume+0x500>)
- 8005f60: 429a cmp r2, r3
- 8005f62: d11e bne.n 8005fa2 <find_volume+0x4ce>
- && ld_dword(fs->win + FSI_StrucSig) == 0x61417272)
- 8005f64: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f66: 3338 adds r3, #56 ; 0x38
- 8005f68: f503 73f2 add.w r3, r3, #484 ; 0x1e4
- 8005f6c: 4618 mov r0, r3
- 8005f6e: f7fd ff64 bl 8003e3a <ld_dword>
- 8005f72: 4602 mov r2, r0
- 8005f74: 4b18 ldr r3, [pc, #96] ; (8005fd8 <find_volume+0x504>)
- 8005f76: 429a cmp r2, r3
- 8005f78: d113 bne.n 8005fa2 <find_volume+0x4ce>
- {
- #if (_FS_NOFSINFO & 1) == 0
- fs->free_clst = ld_dword(fs->win + FSI_Free_Count);
- 8005f7a: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f7c: 3338 adds r3, #56 ; 0x38
- 8005f7e: f503 73f4 add.w r3, r3, #488 ; 0x1e8
- 8005f82: 4618 mov r0, r3
- 8005f84: f7fd ff59 bl 8003e3a <ld_dword>
- 8005f88: 4602 mov r2, r0
- 8005f8a: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f8c: 619a str r2, [r3, #24]
- #endif
- #if (_FS_NOFSINFO & 2) == 0
- fs->last_clst = ld_dword(fs->win + FSI_Nxt_Free);
- 8005f8e: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005f90: 3338 adds r3, #56 ; 0x38
- 8005f92: f503 73f6 add.w r3, r3, #492 ; 0x1ec
- 8005f96: 4618 mov r0, r3
- 8005f98: f7fd ff4f bl 8003e3a <ld_dword>
- 8005f9c: 4602 mov r2, r0
- 8005f9e: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005fa0: 615a str r2, [r3, #20]
- }
- #endif /* (_FS_NOFSINFO & 3) != 3 */
- #endif /* !_FS_READONLY */
- }
-
- fs->fs_type = fmt; /* FAT sub-type */
- 8005fa2: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005fa4: f897 2057 ldrb.w r2, [r7, #87] ; 0x57
- 8005fa8: 701a strb r2, [r3, #0]
- fs->id = ++Fsid; /* File system mount ID */
- 8005faa: 4b0c ldr r3, [pc, #48] ; (8005fdc <find_volume+0x508>)
- 8005fac: 881b ldrh r3, [r3, #0]
- 8005fae: 3301 adds r3, #1
- 8005fb0: b29a uxth r2, r3
- 8005fb2: 4b0a ldr r3, [pc, #40] ; (8005fdc <find_volume+0x508>)
- 8005fb4: 801a strh r2, [r3, #0]
- 8005fb6: 4b09 ldr r3, [pc, #36] ; (8005fdc <find_volume+0x508>)
- 8005fb8: 881a ldrh r2, [r3, #0]
- 8005fba: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005fbc: 80da strh r2, [r3, #6]
- #if _USE_LFN == 1
- fs->lfnbuf = LfnBuf; /* Static LFN working buffer */
- 8005fbe: 6bbb ldr r3, [r7, #56] ; 0x38
- 8005fc0: 4a07 ldr r2, [pc, #28] ; (8005fe0 <find_volume+0x50c>)
- 8005fc2: 611a str r2, [r3, #16]
- #endif
- #if _FS_RPATH != 0
- fs->cdir = 0; /* Initialize current directory */
- #endif
- #if _FS_LOCK != 0 /* Clear file lock semaphores */
- clear_lock(fs);
- 8005fc4: 6bb8 ldr r0, [r7, #56] ; 0x38
- 8005fc6: f7fe f95b bl 8004280 <clear_lock>
- #endif
- return FR_OK;
- 8005fca: 2300 movs r3, #0
- }
- 8005fcc: 4618 mov r0, r3
- 8005fce: 3758 adds r7, #88 ; 0x58
- 8005fd0: 46bd mov sp, r7
- 8005fd2: bd80 pop {r7, pc}
- 8005fd4: 41615252 .word 0x41615252
- 8005fd8: 61417272 .word 0x61417272
- 8005fdc: 200000b0 .word 0x200000b0
- 8005fe0: 200000d4 .word 0x200000d4
-
- 08005fe4 <validate>:
- static
- FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */
- _FDID* obj, /* Pointer to the _OBJ, the 1st member in the FIL/DIR object, to check validity */
- FATFS** fs /* Pointer to pointer to the owner file system object to return */
- )
- {
- 8005fe4: b580 push {r7, lr}
- 8005fe6: b084 sub sp, #16
- 8005fe8: af00 add r7, sp, #0
- 8005fea: 6078 str r0, [r7, #4]
- 8005fec: 6039 str r1, [r7, #0]
- FRESULT res = FR_INVALID_OBJECT;
- 8005fee: 2309 movs r3, #9
- 8005ff0: 73fb strb r3, [r7, #15]
-
-
- if (obj && obj->fs && obj->fs->fs_type && obj->id == obj->fs->id) { /* Test if the object is valid */
- 8005ff2: 687b ldr r3, [r7, #4]
- 8005ff4: 2b00 cmp r3, #0
- 8005ff6: d01c beq.n 8006032 <validate+0x4e>
- 8005ff8: 687b ldr r3, [r7, #4]
- 8005ffa: 681b ldr r3, [r3, #0]
- 8005ffc: 2b00 cmp r3, #0
- 8005ffe: d018 beq.n 8006032 <validate+0x4e>
- 8006000: 687b ldr r3, [r7, #4]
- 8006002: 681b ldr r3, [r3, #0]
- 8006004: 781b ldrb r3, [r3, #0]
- 8006006: 2b00 cmp r3, #0
- 8006008: d013 beq.n 8006032 <validate+0x4e>
- 800600a: 687b ldr r3, [r7, #4]
- 800600c: 889a ldrh r2, [r3, #4]
- 800600e: 687b ldr r3, [r7, #4]
- 8006010: 681b ldr r3, [r3, #0]
- 8006012: 88db ldrh r3, [r3, #6]
- 8006014: 429a cmp r2, r3
- 8006016: d10c bne.n 8006032 <validate+0x4e>
- }
- } else {
- res = FR_TIMEOUT;
- }
- #else
- if (!(disk_status(obj->fs->drv) & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */
- 8006018: 687b ldr r3, [r7, #4]
- 800601a: 681b ldr r3, [r3, #0]
- 800601c: 785b ldrb r3, [r3, #1]
- 800601e: 4618 mov r0, r3
- 8006020: f7fd fe56 bl 8003cd0 <disk_status>
- 8006024: 4603 mov r3, r0
- 8006026: f003 0301 and.w r3, r3, #1
- 800602a: 2b00 cmp r3, #0
- 800602c: d101 bne.n 8006032 <validate+0x4e>
- res = FR_OK;
- 800602e: 2300 movs r3, #0
- 8006030: 73fb strb r3, [r7, #15]
- }
- #endif
- }
- *fs = (res == FR_OK) ? obj->fs : 0; /* Corresponding filesystem object */
- 8006032: 7bfb ldrb r3, [r7, #15]
- 8006034: 2b00 cmp r3, #0
- 8006036: d102 bne.n 800603e <validate+0x5a>
- 8006038: 687b ldr r3, [r7, #4]
- 800603a: 681b ldr r3, [r3, #0]
- 800603c: e000 b.n 8006040 <validate+0x5c>
- 800603e: 2300 movs r3, #0
- 8006040: 683a ldr r2, [r7, #0]
- 8006042: 6013 str r3, [r2, #0]
- return res;
- 8006044: 7bfb ldrb r3, [r7, #15]
- }
- 8006046: 4618 mov r0, r3
- 8006048: 3710 adds r7, #16
- 800604a: 46bd mov sp, r7
- 800604c: bd80 pop {r7, pc}
- ...
-
- 08006050 <f_mount>:
- FRESULT f_mount (
- FATFS* fs, /* Pointer to the file system object (NULL:unmount)*/
- const TCHAR* path, /* Logical drive number to be mounted/unmounted */
- BYTE opt /* Mode option 0:Do not mount (delayed mount), 1:Mount immediately */
- )
- {
- 8006050: b580 push {r7, lr}
- 8006052: b088 sub sp, #32
- 8006054: af00 add r7, sp, #0
- 8006056: 60f8 str r0, [r7, #12]
- 8006058: 60b9 str r1, [r7, #8]
- 800605a: 4613 mov r3, r2
- 800605c: 71fb strb r3, [r7, #7]
- FATFS *cfs;
- int vol;
- FRESULT res;
- const TCHAR *rp = path;
- 800605e: 68bb ldr r3, [r7, #8]
- 8006060: 613b str r3, [r7, #16]
-
-
- /* Get logical drive number */
- vol = get_ldnumber(&rp);
- 8006062: f107 0310 add.w r3, r7, #16
- 8006066: 4618 mov r0, r3
- 8006068: f7ff fc9a bl 80059a0 <get_ldnumber>
- 800606c: 61f8 str r0, [r7, #28]
- if (vol < 0) return FR_INVALID_DRIVE;
- 800606e: 69fb ldr r3, [r7, #28]
- 8006070: 2b00 cmp r3, #0
- 8006072: da01 bge.n 8006078 <f_mount+0x28>
- 8006074: 230b movs r3, #11
- 8006076: e02b b.n 80060d0 <f_mount+0x80>
- cfs = FatFs[vol]; /* Pointer to fs object */
- 8006078: 4a17 ldr r2, [pc, #92] ; (80060d8 <f_mount+0x88>)
- 800607a: 69fb ldr r3, [r7, #28]
- 800607c: f852 3023 ldr.w r3, [r2, r3, lsl #2]
- 8006080: 61bb str r3, [r7, #24]
-
- if (cfs) {
- 8006082: 69bb ldr r3, [r7, #24]
- 8006084: 2b00 cmp r3, #0
- 8006086: d005 beq.n 8006094 <f_mount+0x44>
- #if _FS_LOCK != 0
- clear_lock(cfs);
- 8006088: 69b8 ldr r0, [r7, #24]
- 800608a: f7fe f8f9 bl 8004280 <clear_lock>
- #endif
- #if _FS_REENTRANT /* Discard sync object of the current volume */
- if (!ff_del_syncobj(cfs->sobj)) return FR_INT_ERR;
- #endif
- cfs->fs_type = 0; /* Clear old fs object */
- 800608e: 69bb ldr r3, [r7, #24]
- 8006090: 2200 movs r2, #0
- 8006092: 701a strb r2, [r3, #0]
- }
-
- if (fs) {
- 8006094: 68fb ldr r3, [r7, #12]
- 8006096: 2b00 cmp r3, #0
- 8006098: d002 beq.n 80060a0 <f_mount+0x50>
- fs->fs_type = 0; /* Clear new fs object */
- 800609a: 68fb ldr r3, [r7, #12]
- 800609c: 2200 movs r2, #0
- 800609e: 701a strb r2, [r3, #0]
- #if _FS_REENTRANT /* Create sync object for the new volume */
- if (!ff_cre_syncobj((BYTE)vol, &fs->sobj)) return FR_INT_ERR;
- #endif
- }
- FatFs[vol] = fs; /* Register new fs object */
- 80060a0: 68fa ldr r2, [r7, #12]
- 80060a2: 490d ldr r1, [pc, #52] ; (80060d8 <f_mount+0x88>)
- 80060a4: 69fb ldr r3, [r7, #28]
- 80060a6: f841 2023 str.w r2, [r1, r3, lsl #2]
-
- if (!fs || opt != 1) return FR_OK; /* Do not mount now, it will be mounted later */
- 80060aa: 68fb ldr r3, [r7, #12]
- 80060ac: 2b00 cmp r3, #0
- 80060ae: d002 beq.n 80060b6 <f_mount+0x66>
- 80060b0: 79fb ldrb r3, [r7, #7]
- 80060b2: 2b01 cmp r3, #1
- 80060b4: d001 beq.n 80060ba <f_mount+0x6a>
- 80060b6: 2300 movs r3, #0
- 80060b8: e00a b.n 80060d0 <f_mount+0x80>
-
- res = find_volume(&path, &fs, 0); /* Force mounted the volume */
- 80060ba: f107 010c add.w r1, r7, #12
- 80060be: f107 0308 add.w r3, r7, #8
- 80060c2: 2200 movs r2, #0
- 80060c4: 4618 mov r0, r3
- 80060c6: f7ff fd05 bl 8005ad4 <find_volume>
- 80060ca: 4603 mov r3, r0
- 80060cc: 75fb strb r3, [r7, #23]
- LEAVE_FF(fs, res);
- 80060ce: 7dfb ldrb r3, [r7, #23]
- }
- 80060d0: 4618 mov r0, r3
- 80060d2: 3720 adds r7, #32
- 80060d4: 46bd mov sp, r7
- 80060d6: bd80 pop {r7, pc}
- 80060d8: 200000ac .word 0x200000ac
-
- 080060dc <f_open>:
- FRESULT f_open (
- FIL* fp, /* Pointer to the blank file object */
- const TCHAR* path, /* Pointer to the file name */
- BYTE mode /* Access mode and file open mode flags */
- )
- {
- 80060dc: b580 push {r7, lr}
- 80060de: b09a sub sp, #104 ; 0x68
- 80060e0: af00 add r7, sp, #0
- 80060e2: 60f8 str r0, [r7, #12]
- 80060e4: 60b9 str r1, [r7, #8]
- 80060e6: 4613 mov r3, r2
- 80060e8: 71fb strb r3, [r7, #7]
- FSIZE_t ofs;
- #endif
- DEF_NAMBUF
-
-
- if (!fp) return FR_INVALID_OBJECT;
- 80060ea: 68fb ldr r3, [r7, #12]
- 80060ec: 2b00 cmp r3, #0
- 80060ee: d101 bne.n 80060f4 <f_open+0x18>
- 80060f0: 2309 movs r3, #9
- 80060f2: e1bb b.n 800646c <f_open+0x390>
-
- /* Get logical drive */
- mode &= _FS_READONLY ? FA_READ : FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_CREATE_NEW | FA_OPEN_ALWAYS | FA_OPEN_APPEND | FA_SEEKEND;
- 80060f4: 79fb ldrb r3, [r7, #7]
- 80060f6: f003 033f and.w r3, r3, #63 ; 0x3f
- 80060fa: 71fb strb r3, [r7, #7]
- res = find_volume(&path, &fs, mode);
- 80060fc: 79fa ldrb r2, [r7, #7]
- 80060fe: f107 0114 add.w r1, r7, #20
- 8006102: f107 0308 add.w r3, r7, #8
- 8006106: 4618 mov r0, r3
- 8006108: f7ff fce4 bl 8005ad4 <find_volume>
- 800610c: 4603 mov r3, r0
- 800610e: f887 3067 strb.w r3, [r7, #103] ; 0x67
- if (res == FR_OK) {
- 8006112: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 8006116: 2b00 cmp r3, #0
- 8006118: f040 819f bne.w 800645a <f_open+0x37e>
- dj.obj.fs = fs;
- 800611c: 697b ldr r3, [r7, #20]
- 800611e: 61bb str r3, [r7, #24]
- INIT_NAMBUF(fs);
- res = follow_path(&dj, path); /* Follow the file path */
- 8006120: 68ba ldr r2, [r7, #8]
- 8006122: f107 0318 add.w r3, r7, #24
- 8006126: 4611 mov r1, r2
- 8006128: 4618 mov r0, r3
- 800612a: f7ff fbc3 bl 80058b4 <follow_path>
- 800612e: 4603 mov r3, r0
- 8006130: f887 3067 strb.w r3, [r7, #103] ; 0x67
- #if !_FS_READONLY /* R/W configuration */
- if (res == FR_OK) {
- 8006134: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 8006138: 2b00 cmp r3, #0
- 800613a: d11a bne.n 8006172 <f_open+0x96>
- if (dj.fn[NSFLAG] & NS_NONAME) { /* Origin directory itself? */
- 800613c: f897 3047 ldrb.w r3, [r7, #71] ; 0x47
- 8006140: b25b sxtb r3, r3
- 8006142: 2b00 cmp r3, #0
- 8006144: da03 bge.n 800614e <f_open+0x72>
- res = FR_INVALID_NAME;
- 8006146: 2306 movs r3, #6
- 8006148: f887 3067 strb.w r3, [r7, #103] ; 0x67
- 800614c: e011 b.n 8006172 <f_open+0x96>
- }
- #if _FS_LOCK != 0
- else {
- res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
- 800614e: 79fb ldrb r3, [r7, #7]
- 8006150: f023 0301 bic.w r3, r3, #1
- 8006154: 2b00 cmp r3, #0
- 8006156: bf14 ite ne
- 8006158: 2301 movne r3, #1
- 800615a: 2300 moveq r3, #0
- 800615c: b2db uxtb r3, r3
- 800615e: 461a mov r2, r3
- 8006160: f107 0318 add.w r3, r7, #24
- 8006164: 4611 mov r1, r2
- 8006166: 4618 mov r0, r3
- 8006168: f7fd ff48 bl 8003ffc <chk_lock>
- 800616c: 4603 mov r3, r0
- 800616e: f887 3067 strb.w r3, [r7, #103] ; 0x67
- }
- #endif
- }
- /* Create or Open a file */
- if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) {
- 8006172: 79fb ldrb r3, [r7, #7]
- 8006174: f003 031c and.w r3, r3, #28
- 8006178: 2b00 cmp r3, #0
- 800617a: d07f beq.n 800627c <f_open+0x1a0>
- if (res != FR_OK) { /* No file, create new */
- 800617c: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 8006180: 2b00 cmp r3, #0
- 8006182: d017 beq.n 80061b4 <f_open+0xd8>
- if (res == FR_NO_FILE) { /* There is no file to open, create a new entry */
- 8006184: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 8006188: 2b04 cmp r3, #4
- 800618a: d10e bne.n 80061aa <f_open+0xce>
- #if _FS_LOCK != 0
- res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES;
- 800618c: f7fd ff90 bl 80040b0 <enq_lock>
- 8006190: 4603 mov r3, r0
- 8006192: 2b00 cmp r3, #0
- 8006194: d006 beq.n 80061a4 <f_open+0xc8>
- 8006196: f107 0318 add.w r3, r7, #24
- 800619a: 4618 mov r0, r3
- 800619c: f7ff f8da bl 8005354 <dir_register>
- 80061a0: 4603 mov r3, r0
- 80061a2: e000 b.n 80061a6 <f_open+0xca>
- 80061a4: 2312 movs r3, #18
- 80061a6: f887 3067 strb.w r3, [r7, #103] ; 0x67
- #else
- res = dir_register(&dj);
- #endif
- }
- mode |= FA_CREATE_ALWAYS; /* File is created */
- 80061aa: 79fb ldrb r3, [r7, #7]
- 80061ac: f043 0308 orr.w r3, r3, #8
- 80061b0: 71fb strb r3, [r7, #7]
- 80061b2: e010 b.n 80061d6 <f_open+0xfa>
- }
- else { /* Any object is already existing */
- if (dj.obj.attr & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */
- 80061b4: 7fbb ldrb r3, [r7, #30]
- 80061b6: f003 0311 and.w r3, r3, #17
- 80061ba: 2b00 cmp r3, #0
- 80061bc: d003 beq.n 80061c6 <f_open+0xea>
- res = FR_DENIED;
- 80061be: 2307 movs r3, #7
- 80061c0: f887 3067 strb.w r3, [r7, #103] ; 0x67
- 80061c4: e007 b.n 80061d6 <f_open+0xfa>
- } else {
- if (mode & FA_CREATE_NEW) res = FR_EXIST; /* Cannot create as new file */
- 80061c6: 79fb ldrb r3, [r7, #7]
- 80061c8: f003 0304 and.w r3, r3, #4
- 80061cc: 2b00 cmp r3, #0
- 80061ce: d002 beq.n 80061d6 <f_open+0xfa>
- 80061d0: 2308 movs r3, #8
- 80061d2: f887 3067 strb.w r3, [r7, #103] ; 0x67
- }
- }
- if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */
- 80061d6: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 80061da: 2b00 cmp r3, #0
- 80061dc: d168 bne.n 80062b0 <f_open+0x1d4>
- 80061de: 79fb ldrb r3, [r7, #7]
- 80061e0: f003 0308 and.w r3, r3, #8
- 80061e4: 2b00 cmp r3, #0
- 80061e6: d063 beq.n 80062b0 <f_open+0x1d4>
- dw = GET_FATTIME();
- 80061e8: f7fd fd16 bl 8003c18 <get_fattime>
- 80061ec: 65b8 str r0, [r7, #88] ; 0x58
- }
- } else
- #endif
- {
- /* Clean directory info */
- st_dword(dj.dir + DIR_CrtTime, dw); /* Set created time */
- 80061ee: 6bbb ldr r3, [r7, #56] ; 0x38
- 80061f0: 330e adds r3, #14
- 80061f2: 6db9 ldr r1, [r7, #88] ; 0x58
- 80061f4: 4618 mov r0, r3
- 80061f6: f7fd fe5c bl 8003eb2 <st_dword>
- st_dword(dj.dir + DIR_ModTime, dw); /* Set modified time */
- 80061fa: 6bbb ldr r3, [r7, #56] ; 0x38
- 80061fc: 3316 adds r3, #22
- 80061fe: 6db9 ldr r1, [r7, #88] ; 0x58
- 8006200: 4618 mov r0, r3
- 8006202: f7fd fe56 bl 8003eb2 <st_dword>
- dj.dir[DIR_Attr] = AM_ARC; /* Reset attribute */
- 8006206: 6bbb ldr r3, [r7, #56] ; 0x38
- 8006208: 330b adds r3, #11
- 800620a: 2220 movs r2, #32
- 800620c: 701a strb r2, [r3, #0]
- cl = ld_clust(fs, dj.dir); /* Get cluster chain */
- 800620e: 697b ldr r3, [r7, #20]
- 8006210: 6bba ldr r2, [r7, #56] ; 0x38
- 8006212: 4611 mov r1, r2
- 8006214: 4618 mov r0, r3
- 8006216: f7fe fe16 bl 8004e46 <ld_clust>
- 800621a: 6578 str r0, [r7, #84] ; 0x54
- st_clust(fs, dj.dir, 0); /* Reset file allocation info */
- 800621c: 697b ldr r3, [r7, #20]
- 800621e: 6bb9 ldr r1, [r7, #56] ; 0x38
- 8006220: 2200 movs r2, #0
- 8006222: 4618 mov r0, r3
- 8006224: f7fe fe2e bl 8004e84 <st_clust>
- st_dword(dj.dir + DIR_FileSize, 0);
- 8006228: 6bbb ldr r3, [r7, #56] ; 0x38
- 800622a: 331c adds r3, #28
- 800622c: 2100 movs r1, #0
- 800622e: 4618 mov r0, r3
- 8006230: f7fd fe3f bl 8003eb2 <st_dword>
- fs->wflag = 1;
- 8006234: 697b ldr r3, [r7, #20]
- 8006236: 2201 movs r2, #1
- 8006238: 70da strb r2, [r3, #3]
-
- if (cl) { /* Remove the cluster chain if exist */
- 800623a: 6d7b ldr r3, [r7, #84] ; 0x54
- 800623c: 2b00 cmp r3, #0
- 800623e: d037 beq.n 80062b0 <f_open+0x1d4>
- dw = fs->winsect;
- 8006240: 697b ldr r3, [r7, #20]
- 8006242: 6b5b ldr r3, [r3, #52] ; 0x34
- 8006244: 65bb str r3, [r7, #88] ; 0x58
- res = remove_chain(&dj.obj, cl, 0);
- 8006246: f107 0318 add.w r3, r7, #24
- 800624a: 2200 movs r2, #0
- 800624c: 6d79 ldr r1, [r7, #84] ; 0x54
- 800624e: 4618 mov r0, r3
- 8006250: f7fe fb1f bl 8004892 <remove_chain>
- 8006254: 4603 mov r3, r0
- 8006256: f887 3067 strb.w r3, [r7, #103] ; 0x67
- if (res == FR_OK) {
- 800625a: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 800625e: 2b00 cmp r3, #0
- 8006260: d126 bne.n 80062b0 <f_open+0x1d4>
- res = move_window(fs, dw);
- 8006262: 697b ldr r3, [r7, #20]
- 8006264: 6db9 ldr r1, [r7, #88] ; 0x58
- 8006266: 4618 mov r0, r3
- 8006268: f7fe f870 bl 800434c <move_window>
- 800626c: 4603 mov r3, r0
- 800626e: f887 3067 strb.w r3, [r7, #103] ; 0x67
- fs->last_clst = cl - 1; /* Reuse the cluster hole */
- 8006272: 697b ldr r3, [r7, #20]
- 8006274: 6d7a ldr r2, [r7, #84] ; 0x54
- 8006276: 3a01 subs r2, #1
- 8006278: 615a str r2, [r3, #20]
- 800627a: e019 b.n 80062b0 <f_open+0x1d4>
- }
- }
- }
- }
- else { /* Open an existing file */
- if (res == FR_OK) { /* Following succeeded */
- 800627c: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 8006280: 2b00 cmp r3, #0
- 8006282: d115 bne.n 80062b0 <f_open+0x1d4>
- if (dj.obj.attr & AM_DIR) { /* It is a directory */
- 8006284: 7fbb ldrb r3, [r7, #30]
- 8006286: f003 0310 and.w r3, r3, #16
- 800628a: 2b00 cmp r3, #0
- 800628c: d003 beq.n 8006296 <f_open+0x1ba>
- res = FR_NO_FILE;
- 800628e: 2304 movs r3, #4
- 8006290: f887 3067 strb.w r3, [r7, #103] ; 0x67
- 8006294: e00c b.n 80062b0 <f_open+0x1d4>
- } else {
- if ((mode & FA_WRITE) && (dj.obj.attr & AM_RDO)) { /* R/O violation */
- 8006296: 79fb ldrb r3, [r7, #7]
- 8006298: f003 0302 and.w r3, r3, #2
- 800629c: 2b00 cmp r3, #0
- 800629e: d007 beq.n 80062b0 <f_open+0x1d4>
- 80062a0: 7fbb ldrb r3, [r7, #30]
- 80062a2: f003 0301 and.w r3, r3, #1
- 80062a6: 2b00 cmp r3, #0
- 80062a8: d002 beq.n 80062b0 <f_open+0x1d4>
- res = FR_DENIED;
- 80062aa: 2307 movs r3, #7
- 80062ac: f887 3067 strb.w r3, [r7, #103] ; 0x67
- }
- }
- }
- }
- if (res == FR_OK) {
- 80062b0: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 80062b4: 2b00 cmp r3, #0
- 80062b6: d128 bne.n 800630a <f_open+0x22e>
- if (mode & FA_CREATE_ALWAYS) /* Set file change flag if created or overwritten */
- 80062b8: 79fb ldrb r3, [r7, #7]
- 80062ba: f003 0308 and.w r3, r3, #8
- 80062be: 2b00 cmp r3, #0
- 80062c0: d003 beq.n 80062ca <f_open+0x1ee>
- mode |= FA_MODIFIED;
- 80062c2: 79fb ldrb r3, [r7, #7]
- 80062c4: f043 0340 orr.w r3, r3, #64 ; 0x40
- 80062c8: 71fb strb r3, [r7, #7]
- fp->dir_sect = fs->winsect; /* Pointer to the directory entry */
- 80062ca: 697b ldr r3, [r7, #20]
- 80062cc: 6b5a ldr r2, [r3, #52] ; 0x34
- 80062ce: 68fb ldr r3, [r7, #12]
- 80062d0: 625a str r2, [r3, #36] ; 0x24
- fp->dir_ptr = dj.dir;
- 80062d2: 6bba ldr r2, [r7, #56] ; 0x38
- 80062d4: 68fb ldr r3, [r7, #12]
- 80062d6: 629a str r2, [r3, #40] ; 0x28
- #if _FS_LOCK != 0
- fp->obj.lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
- 80062d8: 79fb ldrb r3, [r7, #7]
- 80062da: f023 0301 bic.w r3, r3, #1
- 80062de: 2b00 cmp r3, #0
- 80062e0: bf14 ite ne
- 80062e2: 2301 movne r3, #1
- 80062e4: 2300 moveq r3, #0
- 80062e6: b2db uxtb r3, r3
- 80062e8: 461a mov r2, r3
- 80062ea: f107 0318 add.w r3, r7, #24
- 80062ee: 4611 mov r1, r2
- 80062f0: 4618 mov r0, r3
- 80062f2: f7fd fefd bl 80040f0 <inc_lock>
- 80062f6: 4602 mov r2, r0
- 80062f8: 68fb ldr r3, [r7, #12]
- 80062fa: 611a str r2, [r3, #16]
- if (!fp->obj.lockid) res = FR_INT_ERR;
- 80062fc: 68fb ldr r3, [r7, #12]
- 80062fe: 691b ldr r3, [r3, #16]
- 8006300: 2b00 cmp r3, #0
- 8006302: d102 bne.n 800630a <f_open+0x22e>
- 8006304: 2302 movs r3, #2
- 8006306: f887 3067 strb.w r3, [r7, #103] ; 0x67
- }
- }
- }
- #endif
-
- if (res == FR_OK) {
- 800630a: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 800630e: 2b00 cmp r3, #0
- 8006310: f040 80a3 bne.w 800645a <f_open+0x37e>
- fp->obj.objsize = ld_qword(fs->dirbuf + XDIR_FileSize);
- fp->obj.stat = fs->dirbuf[XDIR_GenFlags] & 2;
- } else
- #endif
- {
- fp->obj.sclust = ld_clust(fs, dj.dir); /* Get object allocation info */
- 8006314: 697b ldr r3, [r7, #20]
- 8006316: 6bba ldr r2, [r7, #56] ; 0x38
- 8006318: 4611 mov r1, r2
- 800631a: 4618 mov r0, r3
- 800631c: f7fe fd93 bl 8004e46 <ld_clust>
- 8006320: 4602 mov r2, r0
- 8006322: 68fb ldr r3, [r7, #12]
- 8006324: 609a str r2, [r3, #8]
- fp->obj.objsize = ld_dword(dj.dir + DIR_FileSize);
- 8006326: 6bbb ldr r3, [r7, #56] ; 0x38
- 8006328: 331c adds r3, #28
- 800632a: 4618 mov r0, r3
- 800632c: f7fd fd85 bl 8003e3a <ld_dword>
- 8006330: 4602 mov r2, r0
- 8006332: 68fb ldr r3, [r7, #12]
- 8006334: 60da str r2, [r3, #12]
- }
- #if _USE_FASTSEEK
- fp->cltbl = 0; /* Disable fast seek mode */
- 8006336: 68fb ldr r3, [r7, #12]
- 8006338: 2200 movs r2, #0
- 800633a: 62da str r2, [r3, #44] ; 0x2c
- #endif
- fp->obj.fs = fs; /* Validate the file object */
- 800633c: 697a ldr r2, [r7, #20]
- 800633e: 68fb ldr r3, [r7, #12]
- 8006340: 601a str r2, [r3, #0]
- fp->obj.id = fs->id;
- 8006342: 697b ldr r3, [r7, #20]
- 8006344: 88da ldrh r2, [r3, #6]
- 8006346: 68fb ldr r3, [r7, #12]
- 8006348: 809a strh r2, [r3, #4]
- fp->flag = mode; /* Set file access mode */
- 800634a: 68fb ldr r3, [r7, #12]
- 800634c: 79fa ldrb r2, [r7, #7]
- 800634e: 751a strb r2, [r3, #20]
- fp->err = 0; /* Clear error flag */
- 8006350: 68fb ldr r3, [r7, #12]
- 8006352: 2200 movs r2, #0
- 8006354: 755a strb r2, [r3, #21]
- fp->sect = 0; /* Invalidate current data sector */
- 8006356: 68fb ldr r3, [r7, #12]
- 8006358: 2200 movs r2, #0
- 800635a: 621a str r2, [r3, #32]
- fp->fptr = 0; /* Set file pointer top of the file */
- 800635c: 68fb ldr r3, [r7, #12]
- 800635e: 2200 movs r2, #0
- 8006360: 619a str r2, [r3, #24]
- #if !_FS_READONLY
- #if !_FS_TINY
- mem_set(fp->buf, 0, _MAX_SS); /* Clear sector buffer */
- 8006362: 68fb ldr r3, [r7, #12]
- 8006364: 3330 adds r3, #48 ; 0x30
- 8006366: f44f 5280 mov.w r2, #4096 ; 0x1000
- 800636a: 2100 movs r1, #0
- 800636c: 4618 mov r0, r3
- 800636e: f7fd fdeb bl 8003f48 <mem_set>
- #endif
- if ((mode & FA_SEEKEND) && fp->obj.objsize > 0) { /* Seek to end of file if FA_OPEN_APPEND is specified */
- 8006372: 79fb ldrb r3, [r7, #7]
- 8006374: f003 0320 and.w r3, r3, #32
- 8006378: 2b00 cmp r3, #0
- 800637a: d06e beq.n 800645a <f_open+0x37e>
- 800637c: 68fb ldr r3, [r7, #12]
- 800637e: 68db ldr r3, [r3, #12]
- 8006380: 2b00 cmp r3, #0
- 8006382: d06a beq.n 800645a <f_open+0x37e>
- fp->fptr = fp->obj.objsize; /* Offset to seek */
- 8006384: 68fb ldr r3, [r7, #12]
- 8006386: 68da ldr r2, [r3, #12]
- 8006388: 68fb ldr r3, [r7, #12]
- 800638a: 619a str r2, [r3, #24]
- bcs = (DWORD)fs->csize * SS(fs); /* Cluster size in byte */
- 800638c: 697b ldr r3, [r7, #20]
- 800638e: 895b ldrh r3, [r3, #10]
- 8006390: 461a mov r2, r3
- 8006392: 697b ldr r3, [r7, #20]
- 8006394: 899b ldrh r3, [r3, #12]
- 8006396: fb03 f302 mul.w r3, r3, r2
- 800639a: 653b str r3, [r7, #80] ; 0x50
- clst = fp->obj.sclust; /* Follow the cluster chain */
- 800639c: 68fb ldr r3, [r7, #12]
- 800639e: 689b ldr r3, [r3, #8]
- 80063a0: 663b str r3, [r7, #96] ; 0x60
- for (ofs = fp->obj.objsize; res == FR_OK && ofs > bcs; ofs -= bcs) {
- 80063a2: 68fb ldr r3, [r7, #12]
- 80063a4: 68db ldr r3, [r3, #12]
- 80063a6: 65fb str r3, [r7, #92] ; 0x5c
- 80063a8: e016 b.n 80063d8 <f_open+0x2fc>
- clst = get_fat(&fp->obj, clst);
- 80063aa: 68fb ldr r3, [r7, #12]
- 80063ac: 6e39 ldr r1, [r7, #96] ; 0x60
- 80063ae: 4618 mov r0, r3
- 80063b0: f7fe f888 bl 80044c4 <get_fat>
- 80063b4: 6638 str r0, [r7, #96] ; 0x60
- if (clst <= 1) res = FR_INT_ERR;
- 80063b6: 6e3b ldr r3, [r7, #96] ; 0x60
- 80063b8: 2b01 cmp r3, #1
- 80063ba: d802 bhi.n 80063c2 <f_open+0x2e6>
- 80063bc: 2302 movs r3, #2
- 80063be: f887 3067 strb.w r3, [r7, #103] ; 0x67
- if (clst == 0xFFFFFFFF) res = FR_DISK_ERR;
- 80063c2: 6e3b ldr r3, [r7, #96] ; 0x60
- 80063c4: f1b3 3fff cmp.w r3, #4294967295
- 80063c8: d102 bne.n 80063d0 <f_open+0x2f4>
- 80063ca: 2301 movs r3, #1
- 80063cc: f887 3067 strb.w r3, [r7, #103] ; 0x67
- for (ofs = fp->obj.objsize; res == FR_OK && ofs > bcs; ofs -= bcs) {
- 80063d0: 6dfa ldr r2, [r7, #92] ; 0x5c
- 80063d2: 6d3b ldr r3, [r7, #80] ; 0x50
- 80063d4: 1ad3 subs r3, r2, r3
- 80063d6: 65fb str r3, [r7, #92] ; 0x5c
- 80063d8: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 80063dc: 2b00 cmp r3, #0
- 80063de: d103 bne.n 80063e8 <f_open+0x30c>
- 80063e0: 6dfa ldr r2, [r7, #92] ; 0x5c
- 80063e2: 6d3b ldr r3, [r7, #80] ; 0x50
- 80063e4: 429a cmp r2, r3
- 80063e6: d8e0 bhi.n 80063aa <f_open+0x2ce>
- }
- fp->clust = clst;
- 80063e8: 68fb ldr r3, [r7, #12]
- 80063ea: 6e3a ldr r2, [r7, #96] ; 0x60
- 80063ec: 61da str r2, [r3, #28]
- if (res == FR_OK && ofs % SS(fs)) { /* Fill sector buffer if not on the sector boundary */
- 80063ee: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 80063f2: 2b00 cmp r3, #0
- 80063f4: d131 bne.n 800645a <f_open+0x37e>
- 80063f6: 697b ldr r3, [r7, #20]
- 80063f8: 899b ldrh r3, [r3, #12]
- 80063fa: 461a mov r2, r3
- 80063fc: 6dfb ldr r3, [r7, #92] ; 0x5c
- 80063fe: fbb3 f1f2 udiv r1, r3, r2
- 8006402: fb02 f201 mul.w r2, r2, r1
- 8006406: 1a9b subs r3, r3, r2
- 8006408: 2b00 cmp r3, #0
- 800640a: d026 beq.n 800645a <f_open+0x37e>
- if ((sc = clust2sect(fs, clst)) == 0) {
- 800640c: 697b ldr r3, [r7, #20]
- 800640e: 6e39 ldr r1, [r7, #96] ; 0x60
- 8006410: 4618 mov r0, r3
- 8006412: f7fe f839 bl 8004488 <clust2sect>
- 8006416: 64f8 str r0, [r7, #76] ; 0x4c
- 8006418: 6cfb ldr r3, [r7, #76] ; 0x4c
- 800641a: 2b00 cmp r3, #0
- 800641c: d103 bne.n 8006426 <f_open+0x34a>
- res = FR_INT_ERR;
- 800641e: 2302 movs r3, #2
- 8006420: f887 3067 strb.w r3, [r7, #103] ; 0x67
- 8006424: e019 b.n 800645a <f_open+0x37e>
- } else {
- fp->sect = sc + (DWORD)(ofs / SS(fs));
- 8006426: 697b ldr r3, [r7, #20]
- 8006428: 899b ldrh r3, [r3, #12]
- 800642a: 461a mov r2, r3
- 800642c: 6dfb ldr r3, [r7, #92] ; 0x5c
- 800642e: fbb3 f2f2 udiv r2, r3, r2
- 8006432: 6cfb ldr r3, [r7, #76] ; 0x4c
- 8006434: 441a add r2, r3
- 8006436: 68fb ldr r3, [r7, #12]
- 8006438: 621a str r2, [r3, #32]
- #if !_FS_TINY
- if (disk_read(fs->drv, fp->buf, fp->sect, 1) != RES_OK) res = FR_DISK_ERR;
- 800643a: 697b ldr r3, [r7, #20]
- 800643c: 7858 ldrb r0, [r3, #1]
- 800643e: 68fb ldr r3, [r7, #12]
- 8006440: f103 0130 add.w r1, r3, #48 ; 0x30
- 8006444: 68fb ldr r3, [r7, #12]
- 8006446: 6a1a ldr r2, [r3, #32]
- 8006448: 2301 movs r3, #1
- 800644a: f7fd fc81 bl 8003d50 <disk_read>
- 800644e: 4603 mov r3, r0
- 8006450: 2b00 cmp r3, #0
- 8006452: d002 beq.n 800645a <f_open+0x37e>
- 8006454: 2301 movs r3, #1
- 8006456: f887 3067 strb.w r3, [r7, #103] ; 0x67
- }
-
- FREE_NAMBUF();
- }
-
- if (res != FR_OK) fp->obj.fs = 0; /* Invalidate file object on error */
- 800645a: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- 800645e: 2b00 cmp r3, #0
- 8006460: d002 beq.n 8006468 <f_open+0x38c>
- 8006462: 68fb ldr r3, [r7, #12]
- 8006464: 2200 movs r2, #0
- 8006466: 601a str r2, [r3, #0]
-
- LEAVE_FF(fs, res);
- 8006468: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
- }
- 800646c: 4618 mov r0, r3
- 800646e: 3768 adds r7, #104 ; 0x68
- 8006470: 46bd mov sp, r7
- 8006472: bd80 pop {r7, pc}
-
- 08006474 <f_read>:
- FIL* fp, /* Pointer to the file object */
- void* buff, /* Pointer to data buffer */
- UINT btr, /* Number of bytes to read */
- UINT* br /* Pointer to number of bytes read */
- )
- {
- 8006474: b580 push {r7, lr}
- 8006476: b08e sub sp, #56 ; 0x38
- 8006478: af00 add r7, sp, #0
- 800647a: 60f8 str r0, [r7, #12]
- 800647c: 60b9 str r1, [r7, #8]
- 800647e: 607a str r2, [r7, #4]
- 8006480: 603b str r3, [r7, #0]
- FRESULT res;
- FATFS *fs;
- DWORD clst, sect;
- FSIZE_t remain;
- UINT rcnt, cc, csect;
- BYTE *rbuff = (BYTE*)buff;
- 8006482: 68bb ldr r3, [r7, #8]
- 8006484: 627b str r3, [r7, #36] ; 0x24
-
-
- *br = 0; /* Clear read byte counter */
- 8006486: 683b ldr r3, [r7, #0]
- 8006488: 2200 movs r2, #0
- 800648a: 601a str r2, [r3, #0]
- res = validate(&fp->obj, &fs); /* Check validity of the file object */
- 800648c: 68fb ldr r3, [r7, #12]
- 800648e: f107 0214 add.w r2, r7, #20
- 8006492: 4611 mov r1, r2
- 8006494: 4618 mov r0, r3
- 8006496: f7ff fda5 bl 8005fe4 <validate>
- 800649a: 4603 mov r3, r0
- 800649c: f887 3037 strb.w r3, [r7, #55] ; 0x37
- if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); /* Check validity */
- 80064a0: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
- 80064a4: 2b00 cmp r3, #0
- 80064a6: d107 bne.n 80064b8 <f_read+0x44>
- 80064a8: 68fb ldr r3, [r7, #12]
- 80064aa: 7d5b ldrb r3, [r3, #21]
- 80064ac: f887 3037 strb.w r3, [r7, #55] ; 0x37
- 80064b0: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
- 80064b4: 2b00 cmp r3, #0
- 80064b6: d002 beq.n 80064be <f_read+0x4a>
- 80064b8: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
- 80064bc: e135 b.n 800672a <f_read+0x2b6>
- if (!(fp->flag & FA_READ)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */
- 80064be: 68fb ldr r3, [r7, #12]
- 80064c0: 7d1b ldrb r3, [r3, #20]
- 80064c2: f003 0301 and.w r3, r3, #1
- 80064c6: 2b00 cmp r3, #0
- 80064c8: d101 bne.n 80064ce <f_read+0x5a>
- 80064ca: 2307 movs r3, #7
- 80064cc: e12d b.n 800672a <f_read+0x2b6>
- remain = fp->obj.objsize - fp->fptr;
- 80064ce: 68fb ldr r3, [r7, #12]
- 80064d0: 68da ldr r2, [r3, #12]
- 80064d2: 68fb ldr r3, [r7, #12]
- 80064d4: 699b ldr r3, [r3, #24]
- 80064d6: 1ad3 subs r3, r2, r3
- 80064d8: 623b str r3, [r7, #32]
- if (btr > remain) btr = (UINT)remain; /* Truncate btr by remaining bytes */
- 80064da: 687a ldr r2, [r7, #4]
- 80064dc: 6a3b ldr r3, [r7, #32]
- 80064de: 429a cmp r2, r3
- 80064e0: f240 811e bls.w 8006720 <f_read+0x2ac>
- 80064e4: 6a3b ldr r3, [r7, #32]
- 80064e6: 607b str r3, [r7, #4]
-
- for ( ; btr; /* Repeat until all data read */
- 80064e8: e11a b.n 8006720 <f_read+0x2ac>
- rbuff += rcnt, fp->fptr += rcnt, *br += rcnt, btr -= rcnt) {
- if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */
- 80064ea: 68fb ldr r3, [r7, #12]
- 80064ec: 699b ldr r3, [r3, #24]
- 80064ee: 697a ldr r2, [r7, #20]
- 80064f0: 8992 ldrh r2, [r2, #12]
- 80064f2: fbb3 f1f2 udiv r1, r3, r2
- 80064f6: fb02 f201 mul.w r2, r2, r1
- 80064fa: 1a9b subs r3, r3, r2
- 80064fc: 2b00 cmp r3, #0
- 80064fe: f040 80d5 bne.w 80066ac <f_read+0x238>
- csect = (UINT)(fp->fptr / SS(fs) & (fs->csize - 1)); /* Sector offset in the cluster */
- 8006502: 68fb ldr r3, [r7, #12]
- 8006504: 699b ldr r3, [r3, #24]
- 8006506: 697a ldr r2, [r7, #20]
- 8006508: 8992 ldrh r2, [r2, #12]
- 800650a: fbb3 f3f2 udiv r3, r3, r2
- 800650e: 697a ldr r2, [r7, #20]
- 8006510: 8952 ldrh r2, [r2, #10]
- 8006512: 3a01 subs r2, #1
- 8006514: 4013 ands r3, r2
- 8006516: 61fb str r3, [r7, #28]
- if (csect == 0) { /* On the cluster boundary? */
- 8006518: 69fb ldr r3, [r7, #28]
- 800651a: 2b00 cmp r3, #0
- 800651c: d12f bne.n 800657e <f_read+0x10a>
- if (fp->fptr == 0) { /* On the top of the file? */
- 800651e: 68fb ldr r3, [r7, #12]
- 8006520: 699b ldr r3, [r3, #24]
- 8006522: 2b00 cmp r3, #0
- 8006524: d103 bne.n 800652e <f_read+0xba>
- clst = fp->obj.sclust; /* Follow cluster chain from the origin */
- 8006526: 68fb ldr r3, [r7, #12]
- 8006528: 689b ldr r3, [r3, #8]
- 800652a: 633b str r3, [r7, #48] ; 0x30
- 800652c: e013 b.n 8006556 <f_read+0xe2>
- } else { /* Middle or end of the file */
- #if _USE_FASTSEEK
- if (fp->cltbl) {
- 800652e: 68fb ldr r3, [r7, #12]
- 8006530: 6adb ldr r3, [r3, #44] ; 0x2c
- 8006532: 2b00 cmp r3, #0
- 8006534: d007 beq.n 8006546 <f_read+0xd2>
- clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */
- 8006536: 68fb ldr r3, [r7, #12]
- 8006538: 699b ldr r3, [r3, #24]
- 800653a: 4619 mov r1, r3
- 800653c: 68f8 ldr r0, [r7, #12]
- 800653e: f7fe faa5 bl 8004a8c <clmt_clust>
- 8006542: 6338 str r0, [r7, #48] ; 0x30
- 8006544: e007 b.n 8006556 <f_read+0xe2>
- } else
- #endif
- {
- clst = get_fat(&fp->obj, fp->clust); /* Follow cluster chain on the FAT */
- 8006546: 68fa ldr r2, [r7, #12]
- 8006548: 68fb ldr r3, [r7, #12]
- 800654a: 69db ldr r3, [r3, #28]
- 800654c: 4619 mov r1, r3
- 800654e: 4610 mov r0, r2
- 8006550: f7fd ffb8 bl 80044c4 <get_fat>
- 8006554: 6338 str r0, [r7, #48] ; 0x30
- }
- }
- if (clst < 2) ABORT(fs, FR_INT_ERR);
- 8006556: 6b3b ldr r3, [r7, #48] ; 0x30
- 8006558: 2b01 cmp r3, #1
- 800655a: d804 bhi.n 8006566 <f_read+0xf2>
- 800655c: 68fb ldr r3, [r7, #12]
- 800655e: 2202 movs r2, #2
- 8006560: 755a strb r2, [r3, #21]
- 8006562: 2302 movs r3, #2
- 8006564: e0e1 b.n 800672a <f_read+0x2b6>
- if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR);
- 8006566: 6b3b ldr r3, [r7, #48] ; 0x30
- 8006568: f1b3 3fff cmp.w r3, #4294967295
- 800656c: d104 bne.n 8006578 <f_read+0x104>
- 800656e: 68fb ldr r3, [r7, #12]
- 8006570: 2201 movs r2, #1
- 8006572: 755a strb r2, [r3, #21]
- 8006574: 2301 movs r3, #1
- 8006576: e0d8 b.n 800672a <f_read+0x2b6>
- fp->clust = clst; /* Update current cluster */
- 8006578: 68fb ldr r3, [r7, #12]
- 800657a: 6b3a ldr r2, [r7, #48] ; 0x30
- 800657c: 61da str r2, [r3, #28]
- }
- sect = clust2sect(fs, fp->clust); /* Get current sector */
- 800657e: 697a ldr r2, [r7, #20]
- 8006580: 68fb ldr r3, [r7, #12]
- 8006582: 69db ldr r3, [r3, #28]
- 8006584: 4619 mov r1, r3
- 8006586: 4610 mov r0, r2
- 8006588: f7fd ff7e bl 8004488 <clust2sect>
- 800658c: 61b8 str r0, [r7, #24]
- if (!sect) ABORT(fs, FR_INT_ERR);
- 800658e: 69bb ldr r3, [r7, #24]
- 8006590: 2b00 cmp r3, #0
- 8006592: d104 bne.n 800659e <f_read+0x12a>
- 8006594: 68fb ldr r3, [r7, #12]
- 8006596: 2202 movs r2, #2
- 8006598: 755a strb r2, [r3, #21]
- 800659a: 2302 movs r3, #2
- 800659c: e0c5 b.n 800672a <f_read+0x2b6>
- sect += csect;
- 800659e: 69ba ldr r2, [r7, #24]
- 80065a0: 69fb ldr r3, [r7, #28]
- 80065a2: 4413 add r3, r2
- 80065a4: 61bb str r3, [r7, #24]
- cc = btr / SS(fs); /* When remaining bytes >= sector size, */
- 80065a6: 697b ldr r3, [r7, #20]
- 80065a8: 899b ldrh r3, [r3, #12]
- 80065aa: 461a mov r2, r3
- 80065ac: 687b ldr r3, [r7, #4]
- 80065ae: fbb3 f3f2 udiv r3, r3, r2
- 80065b2: 62bb str r3, [r7, #40] ; 0x28
- if (cc) { /* Read maximum contiguous sectors directly */
- 80065b4: 6abb ldr r3, [r7, #40] ; 0x28
- 80065b6: 2b00 cmp r3, #0
- 80065b8: d041 beq.n 800663e <f_read+0x1ca>
- if (csect + cc > fs->csize) { /* Clip at cluster boundary */
- 80065ba: 69fa ldr r2, [r7, #28]
- 80065bc: 6abb ldr r3, [r7, #40] ; 0x28
- 80065be: 4413 add r3, r2
- 80065c0: 697a ldr r2, [r7, #20]
- 80065c2: 8952 ldrh r2, [r2, #10]
- 80065c4: 4293 cmp r3, r2
- 80065c6: d905 bls.n 80065d4 <f_read+0x160>
- cc = fs->csize - csect;
- 80065c8: 697b ldr r3, [r7, #20]
- 80065ca: 895b ldrh r3, [r3, #10]
- 80065cc: 461a mov r2, r3
- 80065ce: 69fb ldr r3, [r7, #28]
- 80065d0: 1ad3 subs r3, r2, r3
- 80065d2: 62bb str r3, [r7, #40] ; 0x28
- }
- if (disk_read(fs->drv, rbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR);
- 80065d4: 697b ldr r3, [r7, #20]
- 80065d6: 7858 ldrb r0, [r3, #1]
- 80065d8: 6abb ldr r3, [r7, #40] ; 0x28
- 80065da: 69ba ldr r2, [r7, #24]
- 80065dc: 6a79 ldr r1, [r7, #36] ; 0x24
- 80065de: f7fd fbb7 bl 8003d50 <disk_read>
- 80065e2: 4603 mov r3, r0
- 80065e4: 2b00 cmp r3, #0
- 80065e6: d004 beq.n 80065f2 <f_read+0x17e>
- 80065e8: 68fb ldr r3, [r7, #12]
- 80065ea: 2201 movs r2, #1
- 80065ec: 755a strb r2, [r3, #21]
- 80065ee: 2301 movs r3, #1
- 80065f0: e09b b.n 800672a <f_read+0x2b6>
- #if _FS_TINY
- if (fs->wflag && fs->winsect - sect < cc) {
- mem_cpy(rbuff + ((fs->winsect - sect) * SS(fs)), fs->win, SS(fs));
- }
- #else
- if ((fp->flag & FA_DIRTY) && fp->sect - sect < cc) {
- 80065f2: 68fb ldr r3, [r7, #12]
- 80065f4: 7d1b ldrb r3, [r3, #20]
- 80065f6: b25b sxtb r3, r3
- 80065f8: 2b00 cmp r3, #0
- 80065fa: da18 bge.n 800662e <f_read+0x1ba>
- 80065fc: 68fb ldr r3, [r7, #12]
- 80065fe: 6a1a ldr r2, [r3, #32]
- 8006600: 69bb ldr r3, [r7, #24]
- 8006602: 1ad3 subs r3, r2, r3
- 8006604: 6aba ldr r2, [r7, #40] ; 0x28
- 8006606: 429a cmp r2, r3
- 8006608: d911 bls.n 800662e <f_read+0x1ba>
- mem_cpy(rbuff + ((fp->sect - sect) * SS(fs)), fp->buf, SS(fs));
- 800660a: 68fb ldr r3, [r7, #12]
- 800660c: 6a1a ldr r2, [r3, #32]
- 800660e: 69bb ldr r3, [r7, #24]
- 8006610: 1ad3 subs r3, r2, r3
- 8006612: 697a ldr r2, [r7, #20]
- 8006614: 8992 ldrh r2, [r2, #12]
- 8006616: fb02 f303 mul.w r3, r2, r3
- 800661a: 6a7a ldr r2, [r7, #36] ; 0x24
- 800661c: 18d0 adds r0, r2, r3
- 800661e: 68fb ldr r3, [r7, #12]
- 8006620: f103 0130 add.w r1, r3, #48 ; 0x30
- 8006624: 697b ldr r3, [r7, #20]
- 8006626: 899b ldrh r3, [r3, #12]
- 8006628: 461a mov r2, r3
- 800662a: f7fd fc6d bl 8003f08 <mem_cpy>
- }
- #endif
- #endif
- rcnt = SS(fs) * cc; /* Number of bytes transferred */
- 800662e: 697b ldr r3, [r7, #20]
- 8006630: 899b ldrh r3, [r3, #12]
- 8006632: 461a mov r2, r3
- 8006634: 6abb ldr r3, [r7, #40] ; 0x28
- 8006636: fb02 f303 mul.w r3, r2, r3
- 800663a: 62fb str r3, [r7, #44] ; 0x2c
- continue;
- 800663c: e05c b.n 80066f8 <f_read+0x284>
- }
- #if !_FS_TINY
- if (fp->sect != sect) { /* Load data sector if not in cache */
- 800663e: 68fb ldr r3, [r7, #12]
- 8006640: 6a1b ldr r3, [r3, #32]
- 8006642: 69ba ldr r2, [r7, #24]
- 8006644: 429a cmp r2, r3
- 8006646: d02e beq.n 80066a6 <f_read+0x232>
- #if !_FS_READONLY
- if (fp->flag & FA_DIRTY) { /* Write-back dirty sector cache */
- 8006648: 68fb ldr r3, [r7, #12]
- 800664a: 7d1b ldrb r3, [r3, #20]
- 800664c: b25b sxtb r3, r3
- 800664e: 2b00 cmp r3, #0
- 8006650: da18 bge.n 8006684 <f_read+0x210>
- if (disk_write(fs->drv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
- 8006652: 697b ldr r3, [r7, #20]
- 8006654: 7858 ldrb r0, [r3, #1]
- 8006656: 68fb ldr r3, [r7, #12]
- 8006658: f103 0130 add.w r1, r3, #48 ; 0x30
- 800665c: 68fb ldr r3, [r7, #12]
- 800665e: 6a1a ldr r2, [r3, #32]
- 8006660: 2301 movs r3, #1
- 8006662: f7fd fb95 bl 8003d90 <disk_write>
- 8006666: 4603 mov r3, r0
- 8006668: 2b00 cmp r3, #0
- 800666a: d004 beq.n 8006676 <f_read+0x202>
- 800666c: 68fb ldr r3, [r7, #12]
- 800666e: 2201 movs r2, #1
- 8006670: 755a strb r2, [r3, #21]
- 8006672: 2301 movs r3, #1
- 8006674: e059 b.n 800672a <f_read+0x2b6>
- fp->flag &= (BYTE)~FA_DIRTY;
- 8006676: 68fb ldr r3, [r7, #12]
- 8006678: 7d1b ldrb r3, [r3, #20]
- 800667a: f003 037f and.w r3, r3, #127 ; 0x7f
- 800667e: b2da uxtb r2, r3
- 8006680: 68fb ldr r3, [r7, #12]
- 8006682: 751a strb r2, [r3, #20]
- }
- #endif
- if (disk_read(fs->drv, fp->buf, sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); /* Fill sector cache */
- 8006684: 697b ldr r3, [r7, #20]
- 8006686: 7858 ldrb r0, [r3, #1]
- 8006688: 68fb ldr r3, [r7, #12]
- 800668a: f103 0130 add.w r1, r3, #48 ; 0x30
- 800668e: 2301 movs r3, #1
- 8006690: 69ba ldr r2, [r7, #24]
- 8006692: f7fd fb5d bl 8003d50 <disk_read>
- 8006696: 4603 mov r3, r0
- 8006698: 2b00 cmp r3, #0
- 800669a: d004 beq.n 80066a6 <f_read+0x232>
- 800669c: 68fb ldr r3, [r7, #12]
- 800669e: 2201 movs r2, #1
- 80066a0: 755a strb r2, [r3, #21]
- 80066a2: 2301 movs r3, #1
- 80066a4: e041 b.n 800672a <f_read+0x2b6>
- }
- #endif
- fp->sect = sect;
- 80066a6: 68fb ldr r3, [r7, #12]
- 80066a8: 69ba ldr r2, [r7, #24]
- 80066aa: 621a str r2, [r3, #32]
- }
- rcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes left in the sector */
- 80066ac: 697b ldr r3, [r7, #20]
- 80066ae: 899b ldrh r3, [r3, #12]
- 80066b0: 4618 mov r0, r3
- 80066b2: 68fb ldr r3, [r7, #12]
- 80066b4: 699b ldr r3, [r3, #24]
- 80066b6: 697a ldr r2, [r7, #20]
- 80066b8: 8992 ldrh r2, [r2, #12]
- 80066ba: fbb3 f1f2 udiv r1, r3, r2
- 80066be: fb02 f201 mul.w r2, r2, r1
- 80066c2: 1a9b subs r3, r3, r2
- 80066c4: 1ac3 subs r3, r0, r3
- 80066c6: 62fb str r3, [r7, #44] ; 0x2c
- if (rcnt > btr) rcnt = btr; /* Clip it by btr if needed */
- 80066c8: 6afa ldr r2, [r7, #44] ; 0x2c
- 80066ca: 687b ldr r3, [r7, #4]
- 80066cc: 429a cmp r2, r3
- 80066ce: d901 bls.n 80066d4 <f_read+0x260>
- 80066d0: 687b ldr r3, [r7, #4]
- 80066d2: 62fb str r3, [r7, #44] ; 0x2c
- #if _FS_TINY
- if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */
- mem_cpy(rbuff, fs->win + fp->fptr % SS(fs), rcnt); /* Extract partial sector */
- #else
- mem_cpy(rbuff, fp->buf + fp->fptr % SS(fs), rcnt); /* Extract partial sector */
- 80066d4: 68fb ldr r3, [r7, #12]
- 80066d6: f103 0130 add.w r1, r3, #48 ; 0x30
- 80066da: 68fb ldr r3, [r7, #12]
- 80066dc: 699b ldr r3, [r3, #24]
- 80066de: 697a ldr r2, [r7, #20]
- 80066e0: 8992 ldrh r2, [r2, #12]
- 80066e2: fbb3 f0f2 udiv r0, r3, r2
- 80066e6: fb02 f200 mul.w r2, r2, r0
- 80066ea: 1a9b subs r3, r3, r2
- 80066ec: 440b add r3, r1
- 80066ee: 6afa ldr r2, [r7, #44] ; 0x2c
- 80066f0: 4619 mov r1, r3
- 80066f2: 6a78 ldr r0, [r7, #36] ; 0x24
- 80066f4: f7fd fc08 bl 8003f08 <mem_cpy>
- rbuff += rcnt, fp->fptr += rcnt, *br += rcnt, btr -= rcnt) {
- 80066f8: 6a7a ldr r2, [r7, #36] ; 0x24
- 80066fa: 6afb ldr r3, [r7, #44] ; 0x2c
- 80066fc: 4413 add r3, r2
- 80066fe: 627b str r3, [r7, #36] ; 0x24
- 8006700: 68fb ldr r3, [r7, #12]
- 8006702: 699a ldr r2, [r3, #24]
- 8006704: 6afb ldr r3, [r7, #44] ; 0x2c
- 8006706: 441a add r2, r3
- 8006708: 68fb ldr r3, [r7, #12]
- 800670a: 619a str r2, [r3, #24]
- 800670c: 683b ldr r3, [r7, #0]
- 800670e: 681a ldr r2, [r3, #0]
- 8006710: 6afb ldr r3, [r7, #44] ; 0x2c
- 8006712: 441a add r2, r3
- 8006714: 683b ldr r3, [r7, #0]
- 8006716: 601a str r2, [r3, #0]
- 8006718: 687a ldr r2, [r7, #4]
- 800671a: 6afb ldr r3, [r7, #44] ; 0x2c
- 800671c: 1ad3 subs r3, r2, r3
- 800671e: 607b str r3, [r7, #4]
- for ( ; btr; /* Repeat until all data read */
- 8006720: 687b ldr r3, [r7, #4]
- 8006722: 2b00 cmp r3, #0
- 8006724: f47f aee1 bne.w 80064ea <f_read+0x76>
- #endif
- }
-
- LEAVE_FF(fs, FR_OK);
- 8006728: 2300 movs r3, #0
- }
- 800672a: 4618 mov r0, r3
- 800672c: 3738 adds r7, #56 ; 0x38
- 800672e: 46bd mov sp, r7
- 8006730: bd80 pop {r7, pc}
-
- 08006732 <f_write>:
- FIL* fp, /* Pointer to the file object */
- const void* buff, /* Pointer to the data to be written */
- UINT btw, /* Number of bytes to write */
- UINT* bw /* Pointer to number of bytes written */
- )
- {
- 8006732: b580 push {r7, lr}
- 8006734: b08c sub sp, #48 ; 0x30
- 8006736: af00 add r7, sp, #0
- 8006738: 60f8 str r0, [r7, #12]
- 800673a: 60b9 str r1, [r7, #8]
- 800673c: 607a str r2, [r7, #4]
- 800673e: 603b str r3, [r7, #0]
- FRESULT res;
- FATFS *fs;
- DWORD clst, sect;
- UINT wcnt, cc, csect;
- const BYTE *wbuff = (const BYTE*)buff;
- 8006740: 68bb ldr r3, [r7, #8]
- 8006742: 61fb str r3, [r7, #28]
-
-
- *bw = 0; /* Clear write byte counter */
- 8006744: 683b ldr r3, [r7, #0]
- 8006746: 2200 movs r2, #0
- 8006748: 601a str r2, [r3, #0]
- res = validate(&fp->obj, &fs); /* Check validity of the file object */
- 800674a: 68fb ldr r3, [r7, #12]
- 800674c: f107 0210 add.w r2, r7, #16
- 8006750: 4611 mov r1, r2
- 8006752: 4618 mov r0, r3
- 8006754: f7ff fc46 bl 8005fe4 <validate>
- 8006758: 4603 mov r3, r0
- 800675a: f887 302f strb.w r3, [r7, #47] ; 0x2f
- if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); /* Check validity */
- 800675e: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 8006762: 2b00 cmp r3, #0
- 8006764: d107 bne.n 8006776 <f_write+0x44>
- 8006766: 68fb ldr r3, [r7, #12]
- 8006768: 7d5b ldrb r3, [r3, #21]
- 800676a: f887 302f strb.w r3, [r7, #47] ; 0x2f
- 800676e: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 8006772: 2b00 cmp r3, #0
- 8006774: d002 beq.n 800677c <f_write+0x4a>
- 8006776: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
- 800677a: e16a b.n 8006a52 <f_write+0x320>
- if (!(fp->flag & FA_WRITE)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */
- 800677c: 68fb ldr r3, [r7, #12]
- 800677e: 7d1b ldrb r3, [r3, #20]
- 8006780: f003 0302 and.w r3, r3, #2
- 8006784: 2b00 cmp r3, #0
- 8006786: d101 bne.n 800678c <f_write+0x5a>
- 8006788: 2307 movs r3, #7
- 800678a: e162 b.n 8006a52 <f_write+0x320>
-
- /* Check fptr wrap-around (file size cannot reach 4GiB on FATxx) */
- if ((!_FS_EXFAT || fs->fs_type != FS_EXFAT) && (DWORD)(fp->fptr + btw) < (DWORD)fp->fptr) {
- 800678c: 68fb ldr r3, [r7, #12]
- 800678e: 699a ldr r2, [r3, #24]
- 8006790: 687b ldr r3, [r7, #4]
- 8006792: 441a add r2, r3
- 8006794: 68fb ldr r3, [r7, #12]
- 8006796: 699b ldr r3, [r3, #24]
- 8006798: 429a cmp r2, r3
- 800679a: f080 814c bcs.w 8006a36 <f_write+0x304>
- btw = (UINT)(0xFFFFFFFF - (DWORD)fp->fptr);
- 800679e: 68fb ldr r3, [r7, #12]
- 80067a0: 699b ldr r3, [r3, #24]
- 80067a2: 43db mvns r3, r3
- 80067a4: 607b str r3, [r7, #4]
- }
-
- for ( ; btw; /* Repeat until all data written */
- 80067a6: e146 b.n 8006a36 <f_write+0x304>
- wbuff += wcnt, fp->fptr += wcnt, fp->obj.objsize = (fp->fptr > fp->obj.objsize) ? fp->fptr : fp->obj.objsize, *bw += wcnt, btw -= wcnt) {
- if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */
- 80067a8: 68fb ldr r3, [r7, #12]
- 80067aa: 699b ldr r3, [r3, #24]
- 80067ac: 693a ldr r2, [r7, #16]
- 80067ae: 8992 ldrh r2, [r2, #12]
- 80067b0: fbb3 f1f2 udiv r1, r3, r2
- 80067b4: fb02 f201 mul.w r2, r2, r1
- 80067b8: 1a9b subs r3, r3, r2
- 80067ba: 2b00 cmp r3, #0
- 80067bc: f040 80f1 bne.w 80069a2 <f_write+0x270>
- csect = (UINT)(fp->fptr / SS(fs)) & (fs->csize - 1); /* Sector offset in the cluster */
- 80067c0: 68fb ldr r3, [r7, #12]
- 80067c2: 699b ldr r3, [r3, #24]
- 80067c4: 693a ldr r2, [r7, #16]
- 80067c6: 8992 ldrh r2, [r2, #12]
- 80067c8: fbb3 f3f2 udiv r3, r3, r2
- 80067cc: 693a ldr r2, [r7, #16]
- 80067ce: 8952 ldrh r2, [r2, #10]
- 80067d0: 3a01 subs r2, #1
- 80067d2: 4013 ands r3, r2
- 80067d4: 61bb str r3, [r7, #24]
- if (csect == 0) { /* On the cluster boundary? */
- 80067d6: 69bb ldr r3, [r7, #24]
- 80067d8: 2b00 cmp r3, #0
- 80067da: d143 bne.n 8006864 <f_write+0x132>
- if (fp->fptr == 0) { /* On the top of the file? */
- 80067dc: 68fb ldr r3, [r7, #12]
- 80067de: 699b ldr r3, [r3, #24]
- 80067e0: 2b00 cmp r3, #0
- 80067e2: d10c bne.n 80067fe <f_write+0xcc>
- clst = fp->obj.sclust; /* Follow from the origin */
- 80067e4: 68fb ldr r3, [r7, #12]
- 80067e6: 689b ldr r3, [r3, #8]
- 80067e8: 62bb str r3, [r7, #40] ; 0x28
- if (clst == 0) { /* If no cluster is allocated, */
- 80067ea: 6abb ldr r3, [r7, #40] ; 0x28
- 80067ec: 2b00 cmp r3, #0
- 80067ee: d11a bne.n 8006826 <f_write+0xf4>
- clst = create_chain(&fp->obj, 0); /* create a new cluster chain */
- 80067f0: 68fb ldr r3, [r7, #12]
- 80067f2: 2100 movs r1, #0
- 80067f4: 4618 mov r0, r3
- 80067f6: f7fe f8b1 bl 800495c <create_chain>
- 80067fa: 62b8 str r0, [r7, #40] ; 0x28
- 80067fc: e013 b.n 8006826 <f_write+0xf4>
- }
- } else { /* On the middle or end of the file */
- #if _USE_FASTSEEK
- if (fp->cltbl) {
- 80067fe: 68fb ldr r3, [r7, #12]
- 8006800: 6adb ldr r3, [r3, #44] ; 0x2c
- 8006802: 2b00 cmp r3, #0
- 8006804: d007 beq.n 8006816 <f_write+0xe4>
- clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */
- 8006806: 68fb ldr r3, [r7, #12]
- 8006808: 699b ldr r3, [r3, #24]
- 800680a: 4619 mov r1, r3
- 800680c: 68f8 ldr r0, [r7, #12]
- 800680e: f7fe f93d bl 8004a8c <clmt_clust>
- 8006812: 62b8 str r0, [r7, #40] ; 0x28
- 8006814: e007 b.n 8006826 <f_write+0xf4>
- } else
- #endif
- {
- clst = create_chain(&fp->obj, fp->clust); /* Follow or stretch cluster chain on the FAT */
- 8006816: 68fa ldr r2, [r7, #12]
- 8006818: 68fb ldr r3, [r7, #12]
- 800681a: 69db ldr r3, [r3, #28]
- 800681c: 4619 mov r1, r3
- 800681e: 4610 mov r0, r2
- 8006820: f7fe f89c bl 800495c <create_chain>
- 8006824: 62b8 str r0, [r7, #40] ; 0x28
- }
- }
- if (clst == 0) break; /* Could not allocate a new cluster (disk full) */
- 8006826: 6abb ldr r3, [r7, #40] ; 0x28
- 8006828: 2b00 cmp r3, #0
- 800682a: f000 8109 beq.w 8006a40 <f_write+0x30e>
- if (clst == 1) ABORT(fs, FR_INT_ERR);
- 800682e: 6abb ldr r3, [r7, #40] ; 0x28
- 8006830: 2b01 cmp r3, #1
- 8006832: d104 bne.n 800683e <f_write+0x10c>
- 8006834: 68fb ldr r3, [r7, #12]
- 8006836: 2202 movs r2, #2
- 8006838: 755a strb r2, [r3, #21]
- 800683a: 2302 movs r3, #2
- 800683c: e109 b.n 8006a52 <f_write+0x320>
- if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR);
- 800683e: 6abb ldr r3, [r7, #40] ; 0x28
- 8006840: f1b3 3fff cmp.w r3, #4294967295
- 8006844: d104 bne.n 8006850 <f_write+0x11e>
- 8006846: 68fb ldr r3, [r7, #12]
- 8006848: 2201 movs r2, #1
- 800684a: 755a strb r2, [r3, #21]
- 800684c: 2301 movs r3, #1
- 800684e: e100 b.n 8006a52 <f_write+0x320>
- fp->clust = clst; /* Update current cluster */
- 8006850: 68fb ldr r3, [r7, #12]
- 8006852: 6aba ldr r2, [r7, #40] ; 0x28
- 8006854: 61da str r2, [r3, #28]
- if (fp->obj.sclust == 0) fp->obj.sclust = clst; /* Set start cluster if the first write */
- 8006856: 68fb ldr r3, [r7, #12]
- 8006858: 689b ldr r3, [r3, #8]
- 800685a: 2b00 cmp r3, #0
- 800685c: d102 bne.n 8006864 <f_write+0x132>
- 800685e: 68fb ldr r3, [r7, #12]
- 8006860: 6aba ldr r2, [r7, #40] ; 0x28
- 8006862: 609a str r2, [r3, #8]
- }
- #if _FS_TINY
- if (fs->winsect == fp->sect && sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Write-back sector cache */
- #else
- if (fp->flag & FA_DIRTY) { /* Write-back sector cache */
- 8006864: 68fb ldr r3, [r7, #12]
- 8006866: 7d1b ldrb r3, [r3, #20]
- 8006868: b25b sxtb r3, r3
- 800686a: 2b00 cmp r3, #0
- 800686c: da18 bge.n 80068a0 <f_write+0x16e>
- if (disk_write(fs->drv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
- 800686e: 693b ldr r3, [r7, #16]
- 8006870: 7858 ldrb r0, [r3, #1]
- 8006872: 68fb ldr r3, [r7, #12]
- 8006874: f103 0130 add.w r1, r3, #48 ; 0x30
- 8006878: 68fb ldr r3, [r7, #12]
- 800687a: 6a1a ldr r2, [r3, #32]
- 800687c: 2301 movs r3, #1
- 800687e: f7fd fa87 bl 8003d90 <disk_write>
- 8006882: 4603 mov r3, r0
- 8006884: 2b00 cmp r3, #0
- 8006886: d004 beq.n 8006892 <f_write+0x160>
- 8006888: 68fb ldr r3, [r7, #12]
- 800688a: 2201 movs r2, #1
- 800688c: 755a strb r2, [r3, #21]
- 800688e: 2301 movs r3, #1
- 8006890: e0df b.n 8006a52 <f_write+0x320>
- fp->flag &= (BYTE)~FA_DIRTY;
- 8006892: 68fb ldr r3, [r7, #12]
- 8006894: 7d1b ldrb r3, [r3, #20]
- 8006896: f003 037f and.w r3, r3, #127 ; 0x7f
- 800689a: b2da uxtb r2, r3
- 800689c: 68fb ldr r3, [r7, #12]
- 800689e: 751a strb r2, [r3, #20]
- }
- #endif
- sect = clust2sect(fs, fp->clust); /* Get current sector */
- 80068a0: 693a ldr r2, [r7, #16]
- 80068a2: 68fb ldr r3, [r7, #12]
- 80068a4: 69db ldr r3, [r3, #28]
- 80068a6: 4619 mov r1, r3
- 80068a8: 4610 mov r0, r2
- 80068aa: f7fd fded bl 8004488 <clust2sect>
- 80068ae: 6178 str r0, [r7, #20]
- if (!sect) ABORT(fs, FR_INT_ERR);
- 80068b0: 697b ldr r3, [r7, #20]
- 80068b2: 2b00 cmp r3, #0
- 80068b4: d104 bne.n 80068c0 <f_write+0x18e>
- 80068b6: 68fb ldr r3, [r7, #12]
- 80068b8: 2202 movs r2, #2
- 80068ba: 755a strb r2, [r3, #21]
- 80068bc: 2302 movs r3, #2
- 80068be: e0c8 b.n 8006a52 <f_write+0x320>
- sect += csect;
- 80068c0: 697a ldr r2, [r7, #20]
- 80068c2: 69bb ldr r3, [r7, #24]
- 80068c4: 4413 add r3, r2
- 80068c6: 617b str r3, [r7, #20]
- cc = btw / SS(fs); /* When remaining bytes >= sector size, */
- 80068c8: 693b ldr r3, [r7, #16]
- 80068ca: 899b ldrh r3, [r3, #12]
- 80068cc: 461a mov r2, r3
- 80068ce: 687b ldr r3, [r7, #4]
- 80068d0: fbb3 f3f2 udiv r3, r3, r2
- 80068d4: 623b str r3, [r7, #32]
- if (cc) { /* Write maximum contiguous sectors directly */
- 80068d6: 6a3b ldr r3, [r7, #32]
- 80068d8: 2b00 cmp r3, #0
- 80068da: d043 beq.n 8006964 <f_write+0x232>
- if (csect + cc > fs->csize) { /* Clip at cluster boundary */
- 80068dc: 69ba ldr r2, [r7, #24]
- 80068de: 6a3b ldr r3, [r7, #32]
- 80068e0: 4413 add r3, r2
- 80068e2: 693a ldr r2, [r7, #16]
- 80068e4: 8952 ldrh r2, [r2, #10]
- 80068e6: 4293 cmp r3, r2
- 80068e8: d905 bls.n 80068f6 <f_write+0x1c4>
- cc = fs->csize - csect;
- 80068ea: 693b ldr r3, [r7, #16]
- 80068ec: 895b ldrh r3, [r3, #10]
- 80068ee: 461a mov r2, r3
- 80068f0: 69bb ldr r3, [r7, #24]
- 80068f2: 1ad3 subs r3, r2, r3
- 80068f4: 623b str r3, [r7, #32]
- }
- if (disk_write(fs->drv, wbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR);
- 80068f6: 693b ldr r3, [r7, #16]
- 80068f8: 7858 ldrb r0, [r3, #1]
- 80068fa: 6a3b ldr r3, [r7, #32]
- 80068fc: 697a ldr r2, [r7, #20]
- 80068fe: 69f9 ldr r1, [r7, #28]
- 8006900: f7fd fa46 bl 8003d90 <disk_write>
- 8006904: 4603 mov r3, r0
- 8006906: 2b00 cmp r3, #0
- 8006908: d004 beq.n 8006914 <f_write+0x1e2>
- 800690a: 68fb ldr r3, [r7, #12]
- 800690c: 2201 movs r2, #1
- 800690e: 755a strb r2, [r3, #21]
- 8006910: 2301 movs r3, #1
- 8006912: e09e b.n 8006a52 <f_write+0x320>
- if (fs->winsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
- mem_cpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs));
- fs->wflag = 0;
- }
- #else
- if (fp->sect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
- 8006914: 68fb ldr r3, [r7, #12]
- 8006916: 6a1a ldr r2, [r3, #32]
- 8006918: 697b ldr r3, [r7, #20]
- 800691a: 1ad3 subs r3, r2, r3
- 800691c: 6a3a ldr r2, [r7, #32]
- 800691e: 429a cmp r2, r3
- 8006920: d918 bls.n 8006954 <f_write+0x222>
- mem_cpy(fp->buf, wbuff + ((fp->sect - sect) * SS(fs)), SS(fs));
- 8006922: 68fb ldr r3, [r7, #12]
- 8006924: f103 0030 add.w r0, r3, #48 ; 0x30
- 8006928: 68fb ldr r3, [r7, #12]
- 800692a: 6a1a ldr r2, [r3, #32]
- 800692c: 697b ldr r3, [r7, #20]
- 800692e: 1ad3 subs r3, r2, r3
- 8006930: 693a ldr r2, [r7, #16]
- 8006932: 8992 ldrh r2, [r2, #12]
- 8006934: fb02 f303 mul.w r3, r2, r3
- 8006938: 69fa ldr r2, [r7, #28]
- 800693a: 18d1 adds r1, r2, r3
- 800693c: 693b ldr r3, [r7, #16]
- 800693e: 899b ldrh r3, [r3, #12]
- 8006940: 461a mov r2, r3
- 8006942: f7fd fae1 bl 8003f08 <mem_cpy>
- fp->flag &= (BYTE)~FA_DIRTY;
- 8006946: 68fb ldr r3, [r7, #12]
- 8006948: 7d1b ldrb r3, [r3, #20]
- 800694a: f003 037f and.w r3, r3, #127 ; 0x7f
- 800694e: b2da uxtb r2, r3
- 8006950: 68fb ldr r3, [r7, #12]
- 8006952: 751a strb r2, [r3, #20]
- }
- #endif
- #endif
- wcnt = SS(fs) * cc; /* Number of bytes transferred */
- 8006954: 693b ldr r3, [r7, #16]
- 8006956: 899b ldrh r3, [r3, #12]
- 8006958: 461a mov r2, r3
- 800695a: 6a3b ldr r3, [r7, #32]
- 800695c: fb02 f303 mul.w r3, r2, r3
- 8006960: 627b str r3, [r7, #36] ; 0x24
- continue;
- 8006962: e04b b.n 80069fc <f_write+0x2ca>
- if (fp->fptr >= fp->obj.objsize) { /* Avoid silly cache filling on the growing edge */
- if (sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR);
- fs->winsect = sect;
- }
- #else
- if (fp->sect != sect && /* Fill sector cache with file data */
- 8006964: 68fb ldr r3, [r7, #12]
- 8006966: 6a1b ldr r3, [r3, #32]
- 8006968: 697a ldr r2, [r7, #20]
- 800696a: 429a cmp r2, r3
- 800696c: d016 beq.n 800699c <f_write+0x26a>
- fp->fptr < fp->obj.objsize &&
- 800696e: 68fb ldr r3, [r7, #12]
- 8006970: 699a ldr r2, [r3, #24]
- 8006972: 68fb ldr r3, [r7, #12]
- 8006974: 68db ldr r3, [r3, #12]
- if (fp->sect != sect && /* Fill sector cache with file data */
- 8006976: 429a cmp r2, r3
- 8006978: d210 bcs.n 800699c <f_write+0x26a>
- disk_read(fs->drv, fp->buf, sect, 1) != RES_OK) {
- 800697a: 693b ldr r3, [r7, #16]
- 800697c: 7858 ldrb r0, [r3, #1]
- 800697e: 68fb ldr r3, [r7, #12]
- 8006980: f103 0130 add.w r1, r3, #48 ; 0x30
- 8006984: 2301 movs r3, #1
- 8006986: 697a ldr r2, [r7, #20]
- 8006988: f7fd f9e2 bl 8003d50 <disk_read>
- 800698c: 4603 mov r3, r0
- fp->fptr < fp->obj.objsize &&
- 800698e: 2b00 cmp r3, #0
- 8006990: d004 beq.n 800699c <f_write+0x26a>
- ABORT(fs, FR_DISK_ERR);
- 8006992: 68fb ldr r3, [r7, #12]
- 8006994: 2201 movs r2, #1
- 8006996: 755a strb r2, [r3, #21]
- 8006998: 2301 movs r3, #1
- 800699a: e05a b.n 8006a52 <f_write+0x320>
- }
- #endif
- fp->sect = sect;
- 800699c: 68fb ldr r3, [r7, #12]
- 800699e: 697a ldr r2, [r7, #20]
- 80069a0: 621a str r2, [r3, #32]
- }
- wcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes left in the sector */
- 80069a2: 693b ldr r3, [r7, #16]
- 80069a4: 899b ldrh r3, [r3, #12]
- 80069a6: 4618 mov r0, r3
- 80069a8: 68fb ldr r3, [r7, #12]
- 80069aa: 699b ldr r3, [r3, #24]
- 80069ac: 693a ldr r2, [r7, #16]
- 80069ae: 8992 ldrh r2, [r2, #12]
- 80069b0: fbb3 f1f2 udiv r1, r3, r2
- 80069b4: fb02 f201 mul.w r2, r2, r1
- 80069b8: 1a9b subs r3, r3, r2
- 80069ba: 1ac3 subs r3, r0, r3
- 80069bc: 627b str r3, [r7, #36] ; 0x24
- if (wcnt > btw) wcnt = btw; /* Clip it by btw if needed */
- 80069be: 6a7a ldr r2, [r7, #36] ; 0x24
- 80069c0: 687b ldr r3, [r7, #4]
- 80069c2: 429a cmp r2, r3
- 80069c4: d901 bls.n 80069ca <f_write+0x298>
- 80069c6: 687b ldr r3, [r7, #4]
- 80069c8: 627b str r3, [r7, #36] ; 0x24
- #if _FS_TINY
- if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */
- mem_cpy(fs->win + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */
- fs->wflag = 1;
- #else
- mem_cpy(fp->buf + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */
- 80069ca: 68fb ldr r3, [r7, #12]
- 80069cc: f103 0130 add.w r1, r3, #48 ; 0x30
- 80069d0: 68fb ldr r3, [r7, #12]
- 80069d2: 699b ldr r3, [r3, #24]
- 80069d4: 693a ldr r2, [r7, #16]
- 80069d6: 8992 ldrh r2, [r2, #12]
- 80069d8: fbb3 f0f2 udiv r0, r3, r2
- 80069dc: fb02 f200 mul.w r2, r2, r0
- 80069e0: 1a9b subs r3, r3, r2
- 80069e2: 440b add r3, r1
- 80069e4: 6a7a ldr r2, [r7, #36] ; 0x24
- 80069e6: 69f9 ldr r1, [r7, #28]
- 80069e8: 4618 mov r0, r3
- 80069ea: f7fd fa8d bl 8003f08 <mem_cpy>
- fp->flag |= FA_DIRTY;
- 80069ee: 68fb ldr r3, [r7, #12]
- 80069f0: 7d1b ldrb r3, [r3, #20]
- 80069f2: f063 037f orn r3, r3, #127 ; 0x7f
- 80069f6: b2da uxtb r2, r3
- 80069f8: 68fb ldr r3, [r7, #12]
- 80069fa: 751a strb r2, [r3, #20]
- wbuff += wcnt, fp->fptr += wcnt, fp->obj.objsize = (fp->fptr > fp->obj.objsize) ? fp->fptr : fp->obj.objsize, *bw += wcnt, btw -= wcnt) {
- 80069fc: 69fa ldr r2, [r7, #28]
- 80069fe: 6a7b ldr r3, [r7, #36] ; 0x24
- 8006a00: 4413 add r3, r2
- 8006a02: 61fb str r3, [r7, #28]
- 8006a04: 68fb ldr r3, [r7, #12]
- 8006a06: 699a ldr r2, [r3, #24]
- 8006a08: 6a7b ldr r3, [r7, #36] ; 0x24
- 8006a0a: 441a add r2, r3
- 8006a0c: 68fb ldr r3, [r7, #12]
- 8006a0e: 619a str r2, [r3, #24]
- 8006a10: 68fb ldr r3, [r7, #12]
- 8006a12: 68da ldr r2, [r3, #12]
- 8006a14: 68fb ldr r3, [r7, #12]
- 8006a16: 699b ldr r3, [r3, #24]
- 8006a18: 429a cmp r2, r3
- 8006a1a: bf38 it cc
- 8006a1c: 461a movcc r2, r3
- 8006a1e: 68fb ldr r3, [r7, #12]
- 8006a20: 60da str r2, [r3, #12]
- 8006a22: 683b ldr r3, [r7, #0]
- 8006a24: 681a ldr r2, [r3, #0]
- 8006a26: 6a7b ldr r3, [r7, #36] ; 0x24
- 8006a28: 441a add r2, r3
- 8006a2a: 683b ldr r3, [r7, #0]
- 8006a2c: 601a str r2, [r3, #0]
- 8006a2e: 687a ldr r2, [r7, #4]
- 8006a30: 6a7b ldr r3, [r7, #36] ; 0x24
- 8006a32: 1ad3 subs r3, r2, r3
- 8006a34: 607b str r3, [r7, #4]
- for ( ; btw; /* Repeat until all data written */
- 8006a36: 687b ldr r3, [r7, #4]
- 8006a38: 2b00 cmp r3, #0
- 8006a3a: f47f aeb5 bne.w 80067a8 <f_write+0x76>
- 8006a3e: e000 b.n 8006a42 <f_write+0x310>
- if (clst == 0) break; /* Could not allocate a new cluster (disk full) */
- 8006a40: bf00 nop
- #endif
- }
-
- fp->flag |= FA_MODIFIED; /* Set file change flag */
- 8006a42: 68fb ldr r3, [r7, #12]
- 8006a44: 7d1b ldrb r3, [r3, #20]
- 8006a46: f043 0340 orr.w r3, r3, #64 ; 0x40
- 8006a4a: b2da uxtb r2, r3
- 8006a4c: 68fb ldr r3, [r7, #12]
- 8006a4e: 751a strb r2, [r3, #20]
-
- LEAVE_FF(fs, FR_OK);
- 8006a50: 2300 movs r3, #0
- }
- 8006a52: 4618 mov r0, r3
- 8006a54: 3730 adds r7, #48 ; 0x30
- 8006a56: 46bd mov sp, r7
- 8006a58: bd80 pop {r7, pc}
-
- 08006a5a <f_sync>:
- /*-----------------------------------------------------------------------*/
-
- FRESULT f_sync (
- FIL* fp /* Pointer to the file object */
- )
- {
- 8006a5a: b580 push {r7, lr}
- 8006a5c: b086 sub sp, #24
- 8006a5e: af00 add r7, sp, #0
- 8006a60: 6078 str r0, [r7, #4]
- #if _FS_EXFAT
- DIR dj;
- DEF_NAMBUF
- #endif
-
- res = validate(&fp->obj, &fs); /* Check validity of the file object */
- 8006a62: 687b ldr r3, [r7, #4]
- 8006a64: f107 0208 add.w r2, r7, #8
- 8006a68: 4611 mov r1, r2
- 8006a6a: 4618 mov r0, r3
- 8006a6c: f7ff faba bl 8005fe4 <validate>
- 8006a70: 4603 mov r3, r0
- 8006a72: 75fb strb r3, [r7, #23]
- if (res == FR_OK) {
- 8006a74: 7dfb ldrb r3, [r7, #23]
- 8006a76: 2b00 cmp r3, #0
- 8006a78: d168 bne.n 8006b4c <f_sync+0xf2>
- if (fp->flag & FA_MODIFIED) { /* Is there any change to the file? */
- 8006a7a: 687b ldr r3, [r7, #4]
- 8006a7c: 7d1b ldrb r3, [r3, #20]
- 8006a7e: f003 0340 and.w r3, r3, #64 ; 0x40
- 8006a82: 2b00 cmp r3, #0
- 8006a84: d062 beq.n 8006b4c <f_sync+0xf2>
- #if !_FS_TINY
- if (fp->flag & FA_DIRTY) { /* Write-back cached data if needed */
- 8006a86: 687b ldr r3, [r7, #4]
- 8006a88: 7d1b ldrb r3, [r3, #20]
- 8006a8a: b25b sxtb r3, r3
- 8006a8c: 2b00 cmp r3, #0
- 8006a8e: da15 bge.n 8006abc <f_sync+0x62>
- if (disk_write(fs->drv, fp->buf, fp->sect, 1) != RES_OK) LEAVE_FF(fs, FR_DISK_ERR);
- 8006a90: 68bb ldr r3, [r7, #8]
- 8006a92: 7858 ldrb r0, [r3, #1]
- 8006a94: 687b ldr r3, [r7, #4]
- 8006a96: f103 0130 add.w r1, r3, #48 ; 0x30
- 8006a9a: 687b ldr r3, [r7, #4]
- 8006a9c: 6a1a ldr r2, [r3, #32]
- 8006a9e: 2301 movs r3, #1
- 8006aa0: f7fd f976 bl 8003d90 <disk_write>
- 8006aa4: 4603 mov r3, r0
- 8006aa6: 2b00 cmp r3, #0
- 8006aa8: d001 beq.n 8006aae <f_sync+0x54>
- 8006aaa: 2301 movs r3, #1
- 8006aac: e04f b.n 8006b4e <f_sync+0xf4>
- fp->flag &= (BYTE)~FA_DIRTY;
- 8006aae: 687b ldr r3, [r7, #4]
- 8006ab0: 7d1b ldrb r3, [r3, #20]
- 8006ab2: f003 037f and.w r3, r3, #127 ; 0x7f
- 8006ab6: b2da uxtb r2, r3
- 8006ab8: 687b ldr r3, [r7, #4]
- 8006aba: 751a strb r2, [r3, #20]
- }
- #endif
- /* Update the directory entry */
- tm = GET_FATTIME(); /* Modified time */
- 8006abc: f7fd f8ac bl 8003c18 <get_fattime>
- 8006ac0: 6138 str r0, [r7, #16]
- FREE_NAMBUF();
- }
- } else
- #endif
- {
- res = move_window(fs, fp->dir_sect);
- 8006ac2: 68ba ldr r2, [r7, #8]
- 8006ac4: 687b ldr r3, [r7, #4]
- 8006ac6: 6a5b ldr r3, [r3, #36] ; 0x24
- 8006ac8: 4619 mov r1, r3
- 8006aca: 4610 mov r0, r2
- 8006acc: f7fd fc3e bl 800434c <move_window>
- 8006ad0: 4603 mov r3, r0
- 8006ad2: 75fb strb r3, [r7, #23]
- if (res == FR_OK) {
- 8006ad4: 7dfb ldrb r3, [r7, #23]
- 8006ad6: 2b00 cmp r3, #0
- 8006ad8: d138 bne.n 8006b4c <f_sync+0xf2>
- dir = fp->dir_ptr;
- 8006ada: 687b ldr r3, [r7, #4]
- 8006adc: 6a9b ldr r3, [r3, #40] ; 0x28
- 8006ade: 60fb str r3, [r7, #12]
- dir[DIR_Attr] |= AM_ARC; /* Set archive bit */
- 8006ae0: 68fb ldr r3, [r7, #12]
- 8006ae2: 330b adds r3, #11
- 8006ae4: 781a ldrb r2, [r3, #0]
- 8006ae6: 68fb ldr r3, [r7, #12]
- 8006ae8: 330b adds r3, #11
- 8006aea: f042 0220 orr.w r2, r2, #32
- 8006aee: b2d2 uxtb r2, r2
- 8006af0: 701a strb r2, [r3, #0]
- st_clust(fp->obj.fs, dir, fp->obj.sclust); /* Update file allocation info */
- 8006af2: 687b ldr r3, [r7, #4]
- 8006af4: 6818 ldr r0, [r3, #0]
- 8006af6: 687b ldr r3, [r7, #4]
- 8006af8: 689b ldr r3, [r3, #8]
- 8006afa: 461a mov r2, r3
- 8006afc: 68f9 ldr r1, [r7, #12]
- 8006afe: f7fe f9c1 bl 8004e84 <st_clust>
- st_dword(dir + DIR_FileSize, (DWORD)fp->obj.objsize); /* Update file size */
- 8006b02: 68fb ldr r3, [r7, #12]
- 8006b04: f103 021c add.w r2, r3, #28
- 8006b08: 687b ldr r3, [r7, #4]
- 8006b0a: 68db ldr r3, [r3, #12]
- 8006b0c: 4619 mov r1, r3
- 8006b0e: 4610 mov r0, r2
- 8006b10: f7fd f9cf bl 8003eb2 <st_dword>
- st_dword(dir + DIR_ModTime, tm); /* Update modified time */
- 8006b14: 68fb ldr r3, [r7, #12]
- 8006b16: 3316 adds r3, #22
- 8006b18: 6939 ldr r1, [r7, #16]
- 8006b1a: 4618 mov r0, r3
- 8006b1c: f7fd f9c9 bl 8003eb2 <st_dword>
- st_word(dir + DIR_LstAccDate, 0);
- 8006b20: 68fb ldr r3, [r7, #12]
- 8006b22: 3312 adds r3, #18
- 8006b24: 2100 movs r1, #0
- 8006b26: 4618 mov r0, r3
- 8006b28: f7fd f9a9 bl 8003e7e <st_word>
- fs->wflag = 1;
- 8006b2c: 68bb ldr r3, [r7, #8]
- 8006b2e: 2201 movs r2, #1
- 8006b30: 70da strb r2, [r3, #3]
- res = sync_fs(fs); /* Restore it to the directory */
- 8006b32: 68bb ldr r3, [r7, #8]
- 8006b34: 4618 mov r0, r3
- 8006b36: f7fd fc37 bl 80043a8 <sync_fs>
- 8006b3a: 4603 mov r3, r0
- 8006b3c: 75fb strb r3, [r7, #23]
- fp->flag &= (BYTE)~FA_MODIFIED;
- 8006b3e: 687b ldr r3, [r7, #4]
- 8006b40: 7d1b ldrb r3, [r3, #20]
- 8006b42: f023 0340 bic.w r3, r3, #64 ; 0x40
- 8006b46: b2da uxtb r2, r3
- 8006b48: 687b ldr r3, [r7, #4]
- 8006b4a: 751a strb r2, [r3, #20]
- }
- }
- }
- }
-
- LEAVE_FF(fs, res);
- 8006b4c: 7dfb ldrb r3, [r7, #23]
- }
- 8006b4e: 4618 mov r0, r3
- 8006b50: 3718 adds r7, #24
- 8006b52: 46bd mov sp, r7
- 8006b54: bd80 pop {r7, pc}
-
- 08006b56 <f_close>:
- /*-----------------------------------------------------------------------*/
-
- FRESULT f_close (
- FIL* fp /* Pointer to the file object to be closed */
- )
- {
- 8006b56: b580 push {r7, lr}
- 8006b58: b084 sub sp, #16
- 8006b5a: af00 add r7, sp, #0
- 8006b5c: 6078 str r0, [r7, #4]
- FRESULT res;
- FATFS *fs;
-
- #if !_FS_READONLY
- res = f_sync(fp); /* Flush cached data */
- 8006b5e: 6878 ldr r0, [r7, #4]
- 8006b60: f7ff ff7b bl 8006a5a <f_sync>
- 8006b64: 4603 mov r3, r0
- 8006b66: 73fb strb r3, [r7, #15]
- if (res == FR_OK)
- 8006b68: 7bfb ldrb r3, [r7, #15]
- 8006b6a: 2b00 cmp r3, #0
- 8006b6c: d118 bne.n 8006ba0 <f_close+0x4a>
- #endif
- {
- res = validate(&fp->obj, &fs); /* Lock volume */
- 8006b6e: 687b ldr r3, [r7, #4]
- 8006b70: f107 0208 add.w r2, r7, #8
- 8006b74: 4611 mov r1, r2
- 8006b76: 4618 mov r0, r3
- 8006b78: f7ff fa34 bl 8005fe4 <validate>
- 8006b7c: 4603 mov r3, r0
- 8006b7e: 73fb strb r3, [r7, #15]
- if (res == FR_OK) {
- 8006b80: 7bfb ldrb r3, [r7, #15]
- 8006b82: 2b00 cmp r3, #0
- 8006b84: d10c bne.n 8006ba0 <f_close+0x4a>
- #if _FS_LOCK != 0
- res = dec_lock(fp->obj.lockid); /* Decrement file open counter */
- 8006b86: 687b ldr r3, [r7, #4]
- 8006b88: 691b ldr r3, [r3, #16]
- 8006b8a: 4618 mov r0, r3
- 8006b8c: f7fd fb3e bl 800420c <dec_lock>
- 8006b90: 4603 mov r3, r0
- 8006b92: 73fb strb r3, [r7, #15]
- if (res == FR_OK)
- 8006b94: 7bfb ldrb r3, [r7, #15]
- 8006b96: 2b00 cmp r3, #0
- 8006b98: d102 bne.n 8006ba0 <f_close+0x4a>
- #endif
- {
- fp->obj.fs = 0; /* Invalidate file object */
- 8006b9a: 687b ldr r3, [r7, #4]
- 8006b9c: 2200 movs r2, #0
- 8006b9e: 601a str r2, [r3, #0]
- #if _FS_REENTRANT
- unlock_fs(fs, FR_OK); /* Unlock volume */
- #endif
- }
- }
- return res;
- 8006ba0: 7bfb ldrb r3, [r7, #15]
- }
- 8006ba2: 4618 mov r0, r3
- 8006ba4: 3710 adds r7, #16
- 8006ba6: 46bd mov sp, r7
- 8006ba8: bd80 pop {r7, pc}
-
- 08006baa <f_getfree>:
- FRESULT f_getfree (
- const TCHAR* path, /* Path name of the logical drive number */
- DWORD* nclst, /* Pointer to a variable to return number of free clusters */
- FATFS** fatfs /* Pointer to return pointer to corresponding file system object */
- )
- {
- 8006baa: b580 push {r7, lr}
- 8006bac: b092 sub sp, #72 ; 0x48
- 8006bae: af00 add r7, sp, #0
- 8006bb0: 60f8 str r0, [r7, #12]
- 8006bb2: 60b9 str r1, [r7, #8]
- 8006bb4: 607a str r2, [r7, #4]
- BYTE *p;
- _FDID obj;
-
-
- /* Get logical drive */
- res = find_volume(&path, &fs, 0);
- 8006bb6: f107 0128 add.w r1, r7, #40 ; 0x28
- 8006bba: f107 030c add.w r3, r7, #12
- 8006bbe: 2200 movs r2, #0
- 8006bc0: 4618 mov r0, r3
- 8006bc2: f7fe ff87 bl 8005ad4 <find_volume>
- 8006bc6: 4603 mov r3, r0
- 8006bc8: f887 3047 strb.w r3, [r7, #71] ; 0x47
- if (res == FR_OK) {
- 8006bcc: f897 3047 ldrb.w r3, [r7, #71] ; 0x47
- 8006bd0: 2b00 cmp r3, #0
- 8006bd2: f040 8099 bne.w 8006d08 <f_getfree+0x15e>
- *fatfs = fs; /* Return ptr to the fs object */
- 8006bd6: 6aba ldr r2, [r7, #40] ; 0x28
- 8006bd8: 687b ldr r3, [r7, #4]
- 8006bda: 601a str r2, [r3, #0]
- /* If free_clst is valid, return it without full cluster scan */
- if (fs->free_clst <= fs->n_fatent - 2) {
- 8006bdc: 6abb ldr r3, [r7, #40] ; 0x28
- 8006bde: 699a ldr r2, [r3, #24]
- 8006be0: 6abb ldr r3, [r7, #40] ; 0x28
- 8006be2: 69db ldr r3, [r3, #28]
- 8006be4: 3b02 subs r3, #2
- 8006be6: 429a cmp r2, r3
- 8006be8: d804 bhi.n 8006bf4 <f_getfree+0x4a>
- *nclst = fs->free_clst;
- 8006bea: 6abb ldr r3, [r7, #40] ; 0x28
- 8006bec: 699a ldr r2, [r3, #24]
- 8006bee: 68bb ldr r3, [r7, #8]
- 8006bf0: 601a str r2, [r3, #0]
- 8006bf2: e089 b.n 8006d08 <f_getfree+0x15e>
- } else {
- /* Get number of free clusters */
- nfree = 0;
- 8006bf4: 2300 movs r3, #0
- 8006bf6: 643b str r3, [r7, #64] ; 0x40
- if (fs->fs_type == FS_FAT12) { /* FAT12: Sector unalighed FAT entries */
- 8006bf8: 6abb ldr r3, [r7, #40] ; 0x28
- 8006bfa: 781b ldrb r3, [r3, #0]
- 8006bfc: 2b01 cmp r3, #1
- 8006bfe: d128 bne.n 8006c52 <f_getfree+0xa8>
- clst = 2; obj.fs = fs;
- 8006c00: 2302 movs r3, #2
- 8006c02: 63fb str r3, [r7, #60] ; 0x3c
- 8006c04: 6abb ldr r3, [r7, #40] ; 0x28
- 8006c06: 617b str r3, [r7, #20]
- do {
- stat = get_fat(&obj, clst);
- 8006c08: f107 0314 add.w r3, r7, #20
- 8006c0c: 6bf9 ldr r1, [r7, #60] ; 0x3c
- 8006c0e: 4618 mov r0, r3
- 8006c10: f7fd fc58 bl 80044c4 <get_fat>
- 8006c14: 62f8 str r0, [r7, #44] ; 0x2c
- if (stat == 0xFFFFFFFF) { res = FR_DISK_ERR; break; }
- 8006c16: 6afb ldr r3, [r7, #44] ; 0x2c
- 8006c18: f1b3 3fff cmp.w r3, #4294967295
- 8006c1c: d103 bne.n 8006c26 <f_getfree+0x7c>
- 8006c1e: 2301 movs r3, #1
- 8006c20: f887 3047 strb.w r3, [r7, #71] ; 0x47
- 8006c24: e063 b.n 8006cee <f_getfree+0x144>
- if (stat == 1) { res = FR_INT_ERR; break; }
- 8006c26: 6afb ldr r3, [r7, #44] ; 0x2c
- 8006c28: 2b01 cmp r3, #1
- 8006c2a: d103 bne.n 8006c34 <f_getfree+0x8a>
- 8006c2c: 2302 movs r3, #2
- 8006c2e: f887 3047 strb.w r3, [r7, #71] ; 0x47
- 8006c32: e05c b.n 8006cee <f_getfree+0x144>
- if (stat == 0) nfree++;
- 8006c34: 6afb ldr r3, [r7, #44] ; 0x2c
- 8006c36: 2b00 cmp r3, #0
- 8006c38: d102 bne.n 8006c40 <f_getfree+0x96>
- 8006c3a: 6c3b ldr r3, [r7, #64] ; 0x40
- 8006c3c: 3301 adds r3, #1
- 8006c3e: 643b str r3, [r7, #64] ; 0x40
- } while (++clst < fs->n_fatent);
- 8006c40: 6bfb ldr r3, [r7, #60] ; 0x3c
- 8006c42: 3301 adds r3, #1
- 8006c44: 63fb str r3, [r7, #60] ; 0x3c
- 8006c46: 6abb ldr r3, [r7, #40] ; 0x28
- 8006c48: 69db ldr r3, [r3, #28]
- 8006c4a: 6bfa ldr r2, [r7, #60] ; 0x3c
- 8006c4c: 429a cmp r2, r3
- 8006c4e: d3db bcc.n 8006c08 <f_getfree+0x5e>
- 8006c50: e04d b.n 8006cee <f_getfree+0x144>
- i = (i + 1) % SS(fs);
- } while (clst);
- } else
- #endif
- { /* FAT16/32: Sector alighed FAT entries */
- clst = fs->n_fatent; sect = fs->fatbase;
- 8006c52: 6abb ldr r3, [r7, #40] ; 0x28
- 8006c54: 69db ldr r3, [r3, #28]
- 8006c56: 63fb str r3, [r7, #60] ; 0x3c
- 8006c58: 6abb ldr r3, [r7, #40] ; 0x28
- 8006c5a: 6a9b ldr r3, [r3, #40] ; 0x28
- 8006c5c: 63bb str r3, [r7, #56] ; 0x38
- i = 0; p = 0;
- 8006c5e: 2300 movs r3, #0
- 8006c60: 637b str r3, [r7, #52] ; 0x34
- 8006c62: 2300 movs r3, #0
- 8006c64: 633b str r3, [r7, #48] ; 0x30
- do {
- if (i == 0) {
- 8006c66: 6b7b ldr r3, [r7, #52] ; 0x34
- 8006c68: 2b00 cmp r3, #0
- 8006c6a: d113 bne.n 8006c94 <f_getfree+0xea>
- res = move_window(fs, sect++);
- 8006c6c: 6ab8 ldr r0, [r7, #40] ; 0x28
- 8006c6e: 6bbb ldr r3, [r7, #56] ; 0x38
- 8006c70: 1c5a adds r2, r3, #1
- 8006c72: 63ba str r2, [r7, #56] ; 0x38
- 8006c74: 4619 mov r1, r3
- 8006c76: f7fd fb69 bl 800434c <move_window>
- 8006c7a: 4603 mov r3, r0
- 8006c7c: f887 3047 strb.w r3, [r7, #71] ; 0x47
- if (res != FR_OK) break;
- 8006c80: f897 3047 ldrb.w r3, [r7, #71] ; 0x47
- 8006c84: 2b00 cmp r3, #0
- 8006c86: d131 bne.n 8006cec <f_getfree+0x142>
- p = fs->win;
- 8006c88: 6abb ldr r3, [r7, #40] ; 0x28
- 8006c8a: 3338 adds r3, #56 ; 0x38
- 8006c8c: 633b str r3, [r7, #48] ; 0x30
- i = SS(fs);
- 8006c8e: 6abb ldr r3, [r7, #40] ; 0x28
- 8006c90: 899b ldrh r3, [r3, #12]
- 8006c92: 637b str r3, [r7, #52] ; 0x34
- }
- if (fs->fs_type == FS_FAT16) {
- 8006c94: 6abb ldr r3, [r7, #40] ; 0x28
- 8006c96: 781b ldrb r3, [r3, #0]
- 8006c98: 2b02 cmp r3, #2
- 8006c9a: d10f bne.n 8006cbc <f_getfree+0x112>
- if (ld_word(p) == 0) nfree++;
- 8006c9c: 6b38 ldr r0, [r7, #48] ; 0x30
- 8006c9e: f7fd f8b5 bl 8003e0c <ld_word>
- 8006ca2: 4603 mov r3, r0
- 8006ca4: 2b00 cmp r3, #0
- 8006ca6: d102 bne.n 8006cae <f_getfree+0x104>
- 8006ca8: 6c3b ldr r3, [r7, #64] ; 0x40
- 8006caa: 3301 adds r3, #1
- 8006cac: 643b str r3, [r7, #64] ; 0x40
- p += 2; i -= 2;
- 8006cae: 6b3b ldr r3, [r7, #48] ; 0x30
- 8006cb0: 3302 adds r3, #2
- 8006cb2: 633b str r3, [r7, #48] ; 0x30
- 8006cb4: 6b7b ldr r3, [r7, #52] ; 0x34
- 8006cb6: 3b02 subs r3, #2
- 8006cb8: 637b str r3, [r7, #52] ; 0x34
- 8006cba: e010 b.n 8006cde <f_getfree+0x134>
- } else {
- if ((ld_dword(p) & 0x0FFFFFFF) == 0) nfree++;
- 8006cbc: 6b38 ldr r0, [r7, #48] ; 0x30
- 8006cbe: f7fd f8bc bl 8003e3a <ld_dword>
- 8006cc2: 4603 mov r3, r0
- 8006cc4: f023 4370 bic.w r3, r3, #4026531840 ; 0xf0000000
- 8006cc8: 2b00 cmp r3, #0
- 8006cca: d102 bne.n 8006cd2 <f_getfree+0x128>
- 8006ccc: 6c3b ldr r3, [r7, #64] ; 0x40
- 8006cce: 3301 adds r3, #1
- 8006cd0: 643b str r3, [r7, #64] ; 0x40
- p += 4; i -= 4;
- 8006cd2: 6b3b ldr r3, [r7, #48] ; 0x30
- 8006cd4: 3304 adds r3, #4
- 8006cd6: 633b str r3, [r7, #48] ; 0x30
- 8006cd8: 6b7b ldr r3, [r7, #52] ; 0x34
- 8006cda: 3b04 subs r3, #4
- 8006cdc: 637b str r3, [r7, #52] ; 0x34
- }
- } while (--clst);
- 8006cde: 6bfb ldr r3, [r7, #60] ; 0x3c
- 8006ce0: 3b01 subs r3, #1
- 8006ce2: 63fb str r3, [r7, #60] ; 0x3c
- 8006ce4: 6bfb ldr r3, [r7, #60] ; 0x3c
- 8006ce6: 2b00 cmp r3, #0
- 8006ce8: d1bd bne.n 8006c66 <f_getfree+0xbc>
- 8006cea: e000 b.n 8006cee <f_getfree+0x144>
- if (res != FR_OK) break;
- 8006cec: bf00 nop
- }
- }
- *nclst = nfree; /* Return the free clusters */
- 8006cee: 68bb ldr r3, [r7, #8]
- 8006cf0: 6c3a ldr r2, [r7, #64] ; 0x40
- 8006cf2: 601a str r2, [r3, #0]
- fs->free_clst = nfree; /* Now free_clst is valid */
- 8006cf4: 6abb ldr r3, [r7, #40] ; 0x28
- 8006cf6: 6c3a ldr r2, [r7, #64] ; 0x40
- 8006cf8: 619a str r2, [r3, #24]
- fs->fsi_flag |= 1; /* FSInfo is to be updated */
- 8006cfa: 6abb ldr r3, [r7, #40] ; 0x28
- 8006cfc: 791a ldrb r2, [r3, #4]
- 8006cfe: 6abb ldr r3, [r7, #40] ; 0x28
- 8006d00: f042 0201 orr.w r2, r2, #1
- 8006d04: b2d2 uxtb r2, r2
- 8006d06: 711a strb r2, [r3, #4]
- }
- }
-
- LEAVE_FF(fs, res);
- 8006d08: f897 3047 ldrb.w r3, [r7, #71] ; 0x47
- }
- 8006d0c: 4618 mov r0, r3
- 8006d0e: 3748 adds r7, #72 ; 0x48
- 8006d10: 46bd mov sp, r7
- 8006d12: bd80 pop {r7, pc}
-
- 08006d14 <f_gets>:
- TCHAR* f_gets (
- TCHAR* buff, /* Pointer to the string buffer to read */
- int len, /* Size of string buffer (characters) */
- FIL* fp /* Pointer to the file object */
- )
- {
- 8006d14: b580 push {r7, lr}
- 8006d16: b088 sub sp, #32
- 8006d18: af00 add r7, sp, #0
- 8006d1a: 60f8 str r0, [r7, #12]
- 8006d1c: 60b9 str r1, [r7, #8]
- 8006d1e: 607a str r2, [r7, #4]
- int n = 0;
- 8006d20: 2300 movs r3, #0
- 8006d22: 61fb str r3, [r7, #28]
- TCHAR c, *p = buff;
- 8006d24: 68fb ldr r3, [r7, #12]
- 8006d26: 61bb str r3, [r7, #24]
- BYTE s[2];
- UINT rc;
-
-
- while (n < len - 1) { /* Read characters until buffer gets filled */
- 8006d28: e01b b.n 8006d62 <f_gets+0x4e>
- }
- c = ff_convert(c, 1); /* OEM -> Unicode */
- if (!c) c = '?';
- #endif
- #else /* Read a character without conversion */
- f_read(fp, s, 1, &rc);
- 8006d2a: f107 0310 add.w r3, r7, #16
- 8006d2e: f107 0114 add.w r1, r7, #20
- 8006d32: 2201 movs r2, #1
- 8006d34: 6878 ldr r0, [r7, #4]
- 8006d36: f7ff fb9d bl 8006474 <f_read>
- if (rc != 1) break;
- 8006d3a: 693b ldr r3, [r7, #16]
- 8006d3c: 2b01 cmp r3, #1
- 8006d3e: d116 bne.n 8006d6e <f_gets+0x5a>
- c = s[0];
- 8006d40: 7d3b ldrb r3, [r7, #20]
- 8006d42: 75fb strb r3, [r7, #23]
- #endif
- if (_USE_STRFUNC == 2 && c == '\r') continue; /* Strip '\r' */
- 8006d44: 7dfb ldrb r3, [r7, #23]
- 8006d46: 2b0d cmp r3, #13
- 8006d48: d100 bne.n 8006d4c <f_gets+0x38>
- 8006d4a: e00a b.n 8006d62 <f_gets+0x4e>
- *p++ = c;
- 8006d4c: 69bb ldr r3, [r7, #24]
- 8006d4e: 1c5a adds r2, r3, #1
- 8006d50: 61ba str r2, [r7, #24]
- 8006d52: 7dfa ldrb r2, [r7, #23]
- 8006d54: 701a strb r2, [r3, #0]
- n++;
- 8006d56: 69fb ldr r3, [r7, #28]
- 8006d58: 3301 adds r3, #1
- 8006d5a: 61fb str r3, [r7, #28]
- if (c == '\n') break; /* Break on EOL */
- 8006d5c: 7dfb ldrb r3, [r7, #23]
- 8006d5e: 2b0a cmp r3, #10
- 8006d60: d007 beq.n 8006d72 <f_gets+0x5e>
- while (n < len - 1) { /* Read characters until buffer gets filled */
- 8006d62: 68bb ldr r3, [r7, #8]
- 8006d64: 3b01 subs r3, #1
- 8006d66: 69fa ldr r2, [r7, #28]
- 8006d68: 429a cmp r2, r3
- 8006d6a: dbde blt.n 8006d2a <f_gets+0x16>
- 8006d6c: e002 b.n 8006d74 <f_gets+0x60>
- if (rc != 1) break;
- 8006d6e: bf00 nop
- 8006d70: e000 b.n 8006d74 <f_gets+0x60>
- if (c == '\n') break; /* Break on EOL */
- 8006d72: bf00 nop
- }
- *p = 0;
- 8006d74: 69bb ldr r3, [r7, #24]
- 8006d76: 2200 movs r2, #0
- 8006d78: 701a strb r2, [r3, #0]
- return n ? buff : 0; /* When no data read (eof or error), return with error. */
- 8006d7a: 69fb ldr r3, [r7, #28]
- 8006d7c: 2b00 cmp r3, #0
- 8006d7e: d001 beq.n 8006d84 <f_gets+0x70>
- 8006d80: 68fb ldr r3, [r7, #12]
- 8006d82: e000 b.n 8006d86 <f_gets+0x72>
- 8006d84: 2300 movs r3, #0
- }
- 8006d86: 4618 mov r0, r3
- 8006d88: 3720 adds r7, #32
- 8006d8a: 46bd mov sp, r7
- 8006d8c: bd80 pop {r7, pc}
-
- 08006d8e <putc_bfd>:
- static
- void putc_bfd ( /* Buffered write with code conversion */
- putbuff* pb,
- TCHAR c
- )
- {
- 8006d8e: b580 push {r7, lr}
- 8006d90: b084 sub sp, #16
- 8006d92: af00 add r7, sp, #0
- 8006d94: 6078 str r0, [r7, #4]
- 8006d96: 460b mov r3, r1
- 8006d98: 70fb strb r3, [r7, #3]
- UINT bw;
- int i;
-
-
- if (_USE_STRFUNC == 2 && c == '\n') { /* LF -> CRLF conversion */
- 8006d9a: 78fb ldrb r3, [r7, #3]
- 8006d9c: 2b0a cmp r3, #10
- 8006d9e: d103 bne.n 8006da8 <putc_bfd+0x1a>
- putc_bfd(pb, '\r');
- 8006da0: 210d movs r1, #13
- 8006da2: 6878 ldr r0, [r7, #4]
- 8006da4: f7ff fff3 bl 8006d8e <putc_bfd>
- }
-
- i = pb->idx; /* Write index of pb->buf[] */
- 8006da8: 687b ldr r3, [r7, #4]
- 8006daa: 685b ldr r3, [r3, #4]
- 8006dac: 60fb str r3, [r7, #12]
- if (i < 0) return;
- 8006dae: 68fb ldr r3, [r7, #12]
- 8006db0: 2b00 cmp r3, #0
- 8006db2: db25 blt.n 8006e00 <putc_bfd+0x72>
- if (c >= 0x100)
- pb->buf[i++] = (BYTE)(c >> 8);
- pb->buf[i++] = (BYTE)c;
- #endif
- #else /* Write a character without conversion */
- pb->buf[i++] = (BYTE)c;
- 8006db4: 68fb ldr r3, [r7, #12]
- 8006db6: 1c5a adds r2, r3, #1
- 8006db8: 60fa str r2, [r7, #12]
- 8006dba: 687a ldr r2, [r7, #4]
- 8006dbc: 4413 add r3, r2
- 8006dbe: 78fa ldrb r2, [r7, #3]
- 8006dc0: 731a strb r2, [r3, #12]
- #endif
-
- if (i >= (int)(sizeof pb->buf) - 3) { /* Write buffered characters to the file */
- 8006dc2: 68fb ldr r3, [r7, #12]
- 8006dc4: 2b3c cmp r3, #60 ; 0x3c
- 8006dc6: dd12 ble.n 8006dee <putc_bfd+0x60>
- f_write(pb->fp, pb->buf, (UINT)i, &bw);
- 8006dc8: 687b ldr r3, [r7, #4]
- 8006dca: 6818 ldr r0, [r3, #0]
- 8006dcc: 687b ldr r3, [r7, #4]
- 8006dce: f103 010c add.w r1, r3, #12
- 8006dd2: 68fa ldr r2, [r7, #12]
- 8006dd4: f107 0308 add.w r3, r7, #8
- 8006dd8: f7ff fcab bl 8006732 <f_write>
- i = (bw == (UINT)i) ? 0 : -1;
- 8006ddc: 68ba ldr r2, [r7, #8]
- 8006dde: 68fb ldr r3, [r7, #12]
- 8006de0: 429a cmp r2, r3
- 8006de2: d101 bne.n 8006de8 <putc_bfd+0x5a>
- 8006de4: 2300 movs r3, #0
- 8006de6: e001 b.n 8006dec <putc_bfd+0x5e>
- 8006de8: f04f 33ff mov.w r3, #4294967295
- 8006dec: 60fb str r3, [r7, #12]
- }
- pb->idx = i;
- 8006dee: 687b ldr r3, [r7, #4]
- 8006df0: 68fa ldr r2, [r7, #12]
- 8006df2: 605a str r2, [r3, #4]
- pb->nchr++;
- 8006df4: 687b ldr r3, [r7, #4]
- 8006df6: 689b ldr r3, [r3, #8]
- 8006df8: 1c5a adds r2, r3, #1
- 8006dfa: 687b ldr r3, [r7, #4]
- 8006dfc: 609a str r2, [r3, #8]
- 8006dfe: e000 b.n 8006e02 <putc_bfd+0x74>
- if (i < 0) return;
- 8006e00: bf00 nop
- }
- 8006e02: 3710 adds r7, #16
- 8006e04: 46bd mov sp, r7
- 8006e06: bd80 pop {r7, pc}
-
- 08006e08 <putc_flush>:
-
- static
- int putc_flush ( /* Flush left characters in the buffer */
- putbuff* pb
- )
- {
- 8006e08: b580 push {r7, lr}
- 8006e0a: b084 sub sp, #16
- 8006e0c: af00 add r7, sp, #0
- 8006e0e: 6078 str r0, [r7, #4]
- UINT nw;
-
- if ( pb->idx >= 0 /* Flush buffered characters to the file */
- 8006e10: 687b ldr r3, [r7, #4]
- 8006e12: 685b ldr r3, [r3, #4]
- 8006e14: 2b00 cmp r3, #0
- 8006e16: db17 blt.n 8006e48 <putc_flush+0x40>
- && f_write(pb->fp, pb->buf, (UINT)pb->idx, &nw) == FR_OK
- 8006e18: 687b ldr r3, [r7, #4]
- 8006e1a: 6818 ldr r0, [r3, #0]
- 8006e1c: 687b ldr r3, [r7, #4]
- 8006e1e: f103 010c add.w r1, r3, #12
- 8006e22: 687b ldr r3, [r7, #4]
- 8006e24: 685b ldr r3, [r3, #4]
- 8006e26: 461a mov r2, r3
- 8006e28: f107 030c add.w r3, r7, #12
- 8006e2c: f7ff fc81 bl 8006732 <f_write>
- 8006e30: 4603 mov r3, r0
- 8006e32: 2b00 cmp r3, #0
- 8006e34: d108 bne.n 8006e48 <putc_flush+0x40>
- && (UINT)pb->idx == nw) return pb->nchr;
- 8006e36: 687b ldr r3, [r7, #4]
- 8006e38: 685b ldr r3, [r3, #4]
- 8006e3a: 461a mov r2, r3
- 8006e3c: 68fb ldr r3, [r7, #12]
- 8006e3e: 429a cmp r2, r3
- 8006e40: d102 bne.n 8006e48 <putc_flush+0x40>
- 8006e42: 687b ldr r3, [r7, #4]
- 8006e44: 689b ldr r3, [r3, #8]
- 8006e46: e001 b.n 8006e4c <putc_flush+0x44>
- return EOF;
- 8006e48: f04f 33ff mov.w r3, #4294967295
- }
- 8006e4c: 4618 mov r0, r3
- 8006e4e: 3710 adds r7, #16
- 8006e50: 46bd mov sp, r7
- 8006e52: bd80 pop {r7, pc}
-
- 08006e54 <putc_init>:
- static
- void putc_init ( /* Initialize write buffer */
- putbuff* pb,
- FIL* fp
- )
- {
- 8006e54: b480 push {r7}
- 8006e56: b083 sub sp, #12
- 8006e58: af00 add r7, sp, #0
- 8006e5a: 6078 str r0, [r7, #4]
- 8006e5c: 6039 str r1, [r7, #0]
- pb->fp = fp;
- 8006e5e: 687b ldr r3, [r7, #4]
- 8006e60: 683a ldr r2, [r7, #0]
- 8006e62: 601a str r2, [r3, #0]
- pb->nchr = pb->idx = 0;
- 8006e64: 687b ldr r3, [r7, #4]
- 8006e66: 2200 movs r2, #0
- 8006e68: 605a str r2, [r3, #4]
- 8006e6a: 687b ldr r3, [r7, #4]
- 8006e6c: 685a ldr r2, [r3, #4]
- 8006e6e: 687b ldr r3, [r7, #4]
- 8006e70: 609a str r2, [r3, #8]
- }
- 8006e72: bf00 nop
- 8006e74: 370c adds r7, #12
- 8006e76: 46bd mov sp, r7
- 8006e78: bc80 pop {r7}
- 8006e7a: 4770 bx lr
-
- 08006e7c <f_puts>:
-
- int f_puts (
- const TCHAR* str, /* Pointer to the string to be output */
- FIL* fp /* Pointer to the file object */
- )
- {
- 8006e7c: b580 push {r7, lr}
- 8006e7e: b096 sub sp, #88 ; 0x58
- 8006e80: af00 add r7, sp, #0
- 8006e82: 6078 str r0, [r7, #4]
- 8006e84: 6039 str r1, [r7, #0]
- putbuff pb;
-
-
- putc_init(&pb, fp);
- 8006e86: f107 030c add.w r3, r7, #12
- 8006e8a: 6839 ldr r1, [r7, #0]
- 8006e8c: 4618 mov r0, r3
- 8006e8e: f7ff ffe1 bl 8006e54 <putc_init>
- while (*str) putc_bfd(&pb, *str++); /* Put the string */
- 8006e92: e009 b.n 8006ea8 <f_puts+0x2c>
- 8006e94: 687b ldr r3, [r7, #4]
- 8006e96: 1c5a adds r2, r3, #1
- 8006e98: 607a str r2, [r7, #4]
- 8006e9a: 781a ldrb r2, [r3, #0]
- 8006e9c: f107 030c add.w r3, r7, #12
- 8006ea0: 4611 mov r1, r2
- 8006ea2: 4618 mov r0, r3
- 8006ea4: f7ff ff73 bl 8006d8e <putc_bfd>
- 8006ea8: 687b ldr r3, [r7, #4]
- 8006eaa: 781b ldrb r3, [r3, #0]
- 8006eac: 2b00 cmp r3, #0
- 8006eae: d1f1 bne.n 8006e94 <f_puts+0x18>
- return putc_flush(&pb);
- 8006eb0: f107 030c add.w r3, r7, #12
- 8006eb4: 4618 mov r0, r3
- 8006eb6: f7ff ffa7 bl 8006e08 <putc_flush>
- 8006eba: 4603 mov r3, r0
- }
- 8006ebc: 4618 mov r0, r3
- 8006ebe: 3758 adds r7, #88 ; 0x58
- 8006ec0: 46bd mov sp, r7
- 8006ec2: bd80 pop {r7, pc}
-
- 08006ec4 <FATFS_LinkDriverEx>:
- * @param lun : only used for USB Key Disk to add multi-lun management
- else the parameter must be equal to 0
- * @retval Returns 0 in case of success, otherwise 1.
- */
- uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, uint8_t lun)
- {
- 8006ec4: b480 push {r7}
- 8006ec6: b087 sub sp, #28
- 8006ec8: af00 add r7, sp, #0
- 8006eca: 60f8 str r0, [r7, #12]
- 8006ecc: 60b9 str r1, [r7, #8]
- 8006ece: 4613 mov r3, r2
- 8006ed0: 71fb strb r3, [r7, #7]
- uint8_t ret = 1;
- 8006ed2: 2301 movs r3, #1
- 8006ed4: 75fb strb r3, [r7, #23]
- uint8_t DiskNum = 0;
- 8006ed6: 2300 movs r3, #0
- 8006ed8: 75bb strb r3, [r7, #22]
-
- if(disk.nbr < _VOLUMES)
- 8006eda: 4b1e ldr r3, [pc, #120] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006edc: 7a5b ldrb r3, [r3, #9]
- 8006ede: b2db uxtb r3, r3
- 8006ee0: 2b00 cmp r3, #0
- 8006ee2: d131 bne.n 8006f48 <FATFS_LinkDriverEx+0x84>
- {
- disk.is_initialized[disk.nbr] = 0;
- 8006ee4: 4b1b ldr r3, [pc, #108] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006ee6: 7a5b ldrb r3, [r3, #9]
- 8006ee8: b2db uxtb r3, r3
- 8006eea: 461a mov r2, r3
- 8006eec: 4b19 ldr r3, [pc, #100] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006eee: 2100 movs r1, #0
- 8006ef0: 5499 strb r1, [r3, r2]
- disk.drv[disk.nbr] = drv;
- 8006ef2: 4b18 ldr r3, [pc, #96] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006ef4: 7a5b ldrb r3, [r3, #9]
- 8006ef6: b2db uxtb r3, r3
- 8006ef8: 4a16 ldr r2, [pc, #88] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006efa: 009b lsls r3, r3, #2
- 8006efc: 4413 add r3, r2
- 8006efe: 68fa ldr r2, [r7, #12]
- 8006f00: 605a str r2, [r3, #4]
- disk.lun[disk.nbr] = lun;
- 8006f02: 4b14 ldr r3, [pc, #80] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006f04: 7a5b ldrb r3, [r3, #9]
- 8006f06: b2db uxtb r3, r3
- 8006f08: 461a mov r2, r3
- 8006f0a: 4b12 ldr r3, [pc, #72] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006f0c: 4413 add r3, r2
- 8006f0e: 79fa ldrb r2, [r7, #7]
- 8006f10: 721a strb r2, [r3, #8]
- DiskNum = disk.nbr++;
- 8006f12: 4b10 ldr r3, [pc, #64] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006f14: 7a5b ldrb r3, [r3, #9]
- 8006f16: b2db uxtb r3, r3
- 8006f18: 1c5a adds r2, r3, #1
- 8006f1a: b2d1 uxtb r1, r2
- 8006f1c: 4a0d ldr r2, [pc, #52] ; (8006f54 <FATFS_LinkDriverEx+0x90>)
- 8006f1e: 7251 strb r1, [r2, #9]
- 8006f20: 75bb strb r3, [r7, #22]
- path[0] = DiskNum + '0';
- 8006f22: 7dbb ldrb r3, [r7, #22]
- 8006f24: 3330 adds r3, #48 ; 0x30
- 8006f26: b2da uxtb r2, r3
- 8006f28: 68bb ldr r3, [r7, #8]
- 8006f2a: 701a strb r2, [r3, #0]
- path[1] = ':';
- 8006f2c: 68bb ldr r3, [r7, #8]
- 8006f2e: 3301 adds r3, #1
- 8006f30: 223a movs r2, #58 ; 0x3a
- 8006f32: 701a strb r2, [r3, #0]
- path[2] = '/';
- 8006f34: 68bb ldr r3, [r7, #8]
- 8006f36: 3302 adds r3, #2
- 8006f38: 222f movs r2, #47 ; 0x2f
- 8006f3a: 701a strb r2, [r3, #0]
- path[3] = 0;
- 8006f3c: 68bb ldr r3, [r7, #8]
- 8006f3e: 3303 adds r3, #3
- 8006f40: 2200 movs r2, #0
- 8006f42: 701a strb r2, [r3, #0]
- ret = 0;
- 8006f44: 2300 movs r3, #0
- 8006f46: 75fb strb r3, [r7, #23]
- }
-
- return ret;
- 8006f48: 7dfb ldrb r3, [r7, #23]
- }
- 8006f4a: 4618 mov r0, r3
- 8006f4c: 371c adds r7, #28
- 8006f4e: 46bd mov sp, r7
- 8006f50: bc80 pop {r7}
- 8006f52: 4770 bx lr
- 8006f54: 200002d4 .word 0x200002d4
-
- 08006f58 <FATFS_LinkDriver>:
- * @param drv: pointer to the disk IO Driver structure
- * @param path: pointer to the logical drive path
- * @retval Returns 0 in case of success, otherwise 1.
- */
- uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path)
- {
- 8006f58: b580 push {r7, lr}
- 8006f5a: b082 sub sp, #8
- 8006f5c: af00 add r7, sp, #0
- 8006f5e: 6078 str r0, [r7, #4]
- 8006f60: 6039 str r1, [r7, #0]
- return FATFS_LinkDriverEx(drv, path, 0);
- 8006f62: 2200 movs r2, #0
- 8006f64: 6839 ldr r1, [r7, #0]
- 8006f66: 6878 ldr r0, [r7, #4]
- 8006f68: f7ff ffac bl 8006ec4 <FATFS_LinkDriverEx>
- 8006f6c: 4603 mov r3, r0
- }
- 8006f6e: 4618 mov r0, r3
- 8006f70: 3708 adds r7, #8
- 8006f72: 46bd mov sp, r7
- 8006f74: bd80 pop {r7, pc}
- ...
-
- 08006f78 <ff_convert>:
-
- WCHAR ff_convert ( /* Converted character, Returns zero on error */
- WCHAR chr, /* Character code to be converted */
- UINT dir /* 0: Unicode to OEM code, 1: OEM code to Unicode */
- )
- {
- 8006f78: b480 push {r7}
- 8006f7a: b085 sub sp, #20
- 8006f7c: af00 add r7, sp, #0
- 8006f7e: 4603 mov r3, r0
- 8006f80: 6039 str r1, [r7, #0]
- 8006f82: 80fb strh r3, [r7, #6]
- WCHAR c;
-
-
- if (chr < 0x80) { /* ASCII */
- 8006f84: 88fb ldrh r3, [r7, #6]
- 8006f86: 2b7f cmp r3, #127 ; 0x7f
- 8006f88: d802 bhi.n 8006f90 <ff_convert+0x18>
- c = chr;
- 8006f8a: 88fb ldrh r3, [r7, #6]
- 8006f8c: 81fb strh r3, [r7, #14]
- 8006f8e: e025 b.n 8006fdc <ff_convert+0x64>
-
- } else {
- if (dir) { /* OEM code to Unicode */
- 8006f90: 683b ldr r3, [r7, #0]
- 8006f92: 2b00 cmp r3, #0
- 8006f94: d00b beq.n 8006fae <ff_convert+0x36>
- c = (chr >= 0x100) ? 0 : Tbl[chr - 0x80];
- 8006f96: 88fb ldrh r3, [r7, #6]
- 8006f98: 2bff cmp r3, #255 ; 0xff
- 8006f9a: d805 bhi.n 8006fa8 <ff_convert+0x30>
- 8006f9c: 88fb ldrh r3, [r7, #6]
- 8006f9e: 3b80 subs r3, #128 ; 0x80
- 8006fa0: 4a11 ldr r2, [pc, #68] ; (8006fe8 <ff_convert+0x70>)
- 8006fa2: f832 3013 ldrh.w r3, [r2, r3, lsl #1]
- 8006fa6: e000 b.n 8006faa <ff_convert+0x32>
- 8006fa8: 2300 movs r3, #0
- 8006faa: 81fb strh r3, [r7, #14]
- 8006fac: e016 b.n 8006fdc <ff_convert+0x64>
-
- } else { /* Unicode to OEM code */
- for (c = 0; c < 0x80; c++) {
- 8006fae: 2300 movs r3, #0
- 8006fb0: 81fb strh r3, [r7, #14]
- 8006fb2: e009 b.n 8006fc8 <ff_convert+0x50>
- if (chr == Tbl[c]) break;
- 8006fb4: 89fb ldrh r3, [r7, #14]
- 8006fb6: 4a0c ldr r2, [pc, #48] ; (8006fe8 <ff_convert+0x70>)
- 8006fb8: f832 3013 ldrh.w r3, [r2, r3, lsl #1]
- 8006fbc: 88fa ldrh r2, [r7, #6]
- 8006fbe: 429a cmp r2, r3
- 8006fc0: d006 beq.n 8006fd0 <ff_convert+0x58>
- for (c = 0; c < 0x80; c++) {
- 8006fc2: 89fb ldrh r3, [r7, #14]
- 8006fc4: 3301 adds r3, #1
- 8006fc6: 81fb strh r3, [r7, #14]
- 8006fc8: 89fb ldrh r3, [r7, #14]
- 8006fca: 2b7f cmp r3, #127 ; 0x7f
- 8006fcc: d9f2 bls.n 8006fb4 <ff_convert+0x3c>
- 8006fce: e000 b.n 8006fd2 <ff_convert+0x5a>
- if (chr == Tbl[c]) break;
- 8006fd0: bf00 nop
- }
- c = (c + 0x80) & 0xFF;
- 8006fd2: 89fb ldrh r3, [r7, #14]
- 8006fd4: 3380 adds r3, #128 ; 0x80
- 8006fd6: b29b uxth r3, r3
- 8006fd8: b2db uxtb r3, r3
- 8006fda: 81fb strh r3, [r7, #14]
- }
- }
-
- return c;
- 8006fdc: 89fb ldrh r3, [r7, #14]
- }
- 8006fde: 4618 mov r0, r3
- 8006fe0: 3714 adds r7, #20
- 8006fe2: 46bd mov sp, r7
- 8006fe4: bc80 pop {r7}
- 8006fe6: 4770 bx lr
- 8006fe8: 08007bd8 .word 0x08007bd8
-
- 08006fec <ff_wtoupper>:
-
-
- WCHAR ff_wtoupper ( /* Returns upper converted character */
- WCHAR chr /* Unicode character to be upper converted (BMP only) */
- )
- {
- 8006fec: b480 push {r7}
- 8006fee: b087 sub sp, #28
- 8006ff0: af00 add r7, sp, #0
- 8006ff2: 4603 mov r3, r0
- 8006ff4: 80fb strh r3, [r7, #6]
- };
- const WCHAR *p;
- WCHAR bc, nc, cmd;
-
-
- p = chr < 0x1000 ? cvt1 : cvt2;
- 8006ff6: 88fb ldrh r3, [r7, #6]
- 8006ff8: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
- 8006ffc: d201 bcs.n 8007002 <ff_wtoupper+0x16>
- 8006ffe: 4b3d ldr r3, [pc, #244] ; (80070f4 <ff_wtoupper+0x108>)
- 8007000: e000 b.n 8007004 <ff_wtoupper+0x18>
- 8007002: 4b3d ldr r3, [pc, #244] ; (80070f8 <ff_wtoupper+0x10c>)
- 8007004: 617b str r3, [r7, #20]
- for (;;) {
- bc = *p++; /* Get block base */
- 8007006: 697b ldr r3, [r7, #20]
- 8007008: 1c9a adds r2, r3, #2
- 800700a: 617a str r2, [r7, #20]
- 800700c: 881b ldrh r3, [r3, #0]
- 800700e: 827b strh r3, [r7, #18]
- if (!bc || chr < bc) break;
- 8007010: 8a7b ldrh r3, [r7, #18]
- 8007012: 2b00 cmp r3, #0
- 8007014: d068 beq.n 80070e8 <ff_wtoupper+0xfc>
- 8007016: 88fa ldrh r2, [r7, #6]
- 8007018: 8a7b ldrh r3, [r7, #18]
- 800701a: 429a cmp r2, r3
- 800701c: d364 bcc.n 80070e8 <ff_wtoupper+0xfc>
- nc = *p++; cmd = nc >> 8; nc &= 0xFF; /* Get processing command and block size */
- 800701e: 697b ldr r3, [r7, #20]
- 8007020: 1c9a adds r2, r3, #2
- 8007022: 617a str r2, [r7, #20]
- 8007024: 881b ldrh r3, [r3, #0]
- 8007026: 823b strh r3, [r7, #16]
- 8007028: 8a3b ldrh r3, [r7, #16]
- 800702a: 0a1b lsrs r3, r3, #8
- 800702c: 81fb strh r3, [r7, #14]
- 800702e: 8a3b ldrh r3, [r7, #16]
- 8007030: b2db uxtb r3, r3
- 8007032: 823b strh r3, [r7, #16]
- if (chr < bc + nc) { /* In the block? */
- 8007034: 88fa ldrh r2, [r7, #6]
- 8007036: 8a79 ldrh r1, [r7, #18]
- 8007038: 8a3b ldrh r3, [r7, #16]
- 800703a: 440b add r3, r1
- 800703c: 429a cmp r2, r3
- 800703e: da49 bge.n 80070d4 <ff_wtoupper+0xe8>
- switch (cmd) {
- 8007040: 89fb ldrh r3, [r7, #14]
- 8007042: 2b08 cmp r3, #8
- 8007044: d84f bhi.n 80070e6 <ff_wtoupper+0xfa>
- 8007046: a201 add r2, pc, #4 ; (adr r2, 800704c <ff_wtoupper+0x60>)
- 8007048: f852 f023 ldr.w pc, [r2, r3, lsl #2]
- 800704c: 08007071 .word 0x08007071
- 8007050: 08007083 .word 0x08007083
- 8007054: 08007099 .word 0x08007099
- 8007058: 080070a1 .word 0x080070a1
- 800705c: 080070a9 .word 0x080070a9
- 8007060: 080070b1 .word 0x080070b1
- 8007064: 080070b9 .word 0x080070b9
- 8007068: 080070c1 .word 0x080070c1
- 800706c: 080070c9 .word 0x080070c9
- case 0: chr = p[chr - bc]; break; /* Table conversion */
- 8007070: 88fa ldrh r2, [r7, #6]
- 8007072: 8a7b ldrh r3, [r7, #18]
- 8007074: 1ad3 subs r3, r2, r3
- 8007076: 005b lsls r3, r3, #1
- 8007078: 697a ldr r2, [r7, #20]
- 800707a: 4413 add r3, r2
- 800707c: 881b ldrh r3, [r3, #0]
- 800707e: 80fb strh r3, [r7, #6]
- 8007080: e027 b.n 80070d2 <ff_wtoupper+0xe6>
- case 1: chr -= (chr - bc) & 1; break; /* Case pairs */
- 8007082: 88fa ldrh r2, [r7, #6]
- 8007084: 8a7b ldrh r3, [r7, #18]
- 8007086: 1ad3 subs r3, r2, r3
- 8007088: b29b uxth r3, r3
- 800708a: f003 0301 and.w r3, r3, #1
- 800708e: b29b uxth r3, r3
- 8007090: 88fa ldrh r2, [r7, #6]
- 8007092: 1ad3 subs r3, r2, r3
- 8007094: 80fb strh r3, [r7, #6]
- 8007096: e01c b.n 80070d2 <ff_wtoupper+0xe6>
- case 2: chr -= 16; break; /* Shift -16 */
- 8007098: 88fb ldrh r3, [r7, #6]
- 800709a: 3b10 subs r3, #16
- 800709c: 80fb strh r3, [r7, #6]
- 800709e: e018 b.n 80070d2 <ff_wtoupper+0xe6>
- case 3: chr -= 32; break; /* Shift -32 */
- 80070a0: 88fb ldrh r3, [r7, #6]
- 80070a2: 3b20 subs r3, #32
- 80070a4: 80fb strh r3, [r7, #6]
- 80070a6: e014 b.n 80070d2 <ff_wtoupper+0xe6>
- case 4: chr -= 48; break; /* Shift -48 */
- 80070a8: 88fb ldrh r3, [r7, #6]
- 80070aa: 3b30 subs r3, #48 ; 0x30
- 80070ac: 80fb strh r3, [r7, #6]
- 80070ae: e010 b.n 80070d2 <ff_wtoupper+0xe6>
- case 5: chr -= 26; break; /* Shift -26 */
- 80070b0: 88fb ldrh r3, [r7, #6]
- 80070b2: 3b1a subs r3, #26
- 80070b4: 80fb strh r3, [r7, #6]
- 80070b6: e00c b.n 80070d2 <ff_wtoupper+0xe6>
- case 6: chr += 8; break; /* Shift +8 */
- 80070b8: 88fb ldrh r3, [r7, #6]
- 80070ba: 3308 adds r3, #8
- 80070bc: 80fb strh r3, [r7, #6]
- 80070be: e008 b.n 80070d2 <ff_wtoupper+0xe6>
- case 7: chr -= 80; break; /* Shift -80 */
- 80070c0: 88fb ldrh r3, [r7, #6]
- 80070c2: 3b50 subs r3, #80 ; 0x50
- 80070c4: 80fb strh r3, [r7, #6]
- 80070c6: e004 b.n 80070d2 <ff_wtoupper+0xe6>
- case 8: chr -= 0x1C60; break; /* Shift -0x1C60 */
- 80070c8: 88fb ldrh r3, [r7, #6]
- 80070ca: f5a3 53e3 sub.w r3, r3, #7264 ; 0x1c60
- 80070ce: 80fb strh r3, [r7, #6]
- 80070d0: bf00 nop
- }
- break;
- 80070d2: e008 b.n 80070e6 <ff_wtoupper+0xfa>
- }
- if (!cmd) p += nc;
- 80070d4: 89fb ldrh r3, [r7, #14]
- 80070d6: 2b00 cmp r3, #0
- 80070d8: d195 bne.n 8007006 <ff_wtoupper+0x1a>
- 80070da: 8a3b ldrh r3, [r7, #16]
- 80070dc: 005b lsls r3, r3, #1
- 80070de: 697a ldr r2, [r7, #20]
- 80070e0: 4413 add r3, r2
- 80070e2: 617b str r3, [r7, #20]
- bc = *p++; /* Get block base */
- 80070e4: e78f b.n 8007006 <ff_wtoupper+0x1a>
- break;
- 80070e6: bf00 nop
- }
-
- return chr;
- 80070e8: 88fb ldrh r3, [r7, #6]
- }
- 80070ea: 4618 mov r0, r3
- 80070ec: 371c adds r7, #28
- 80070ee: 46bd mov sp, r7
- 80070f0: bc80 pop {r7}
- 80070f2: 4770 bx lr
- 80070f4: 08007cd8 .word 0x08007cd8
- 80070f8: 08007ecc .word 0x08007ecc
-
- 080070fc <__errno>:
- 80070fc: 4b01 ldr r3, [pc, #4] ; (8007104 <__errno+0x8>)
- 80070fe: 6818 ldr r0, [r3, #0]
- 8007100: 4770 bx lr
- 8007102: bf00 nop
- 8007104: 20000024 .word 0x20000024
-
- 08007108 <__libc_init_array>:
- 8007108: b570 push {r4, r5, r6, lr}
- 800710a: 2500 movs r5, #0
- 800710c: 4e0c ldr r6, [pc, #48] ; (8007140 <__libc_init_array+0x38>)
- 800710e: 4c0d ldr r4, [pc, #52] ; (8007144 <__libc_init_array+0x3c>)
- 8007110: 1ba4 subs r4, r4, r6
- 8007112: 10a4 asrs r4, r4, #2
- 8007114: 42a5 cmp r5, r4
- 8007116: d109 bne.n 800712c <__libc_init_array+0x24>
- 8007118: f000 fc3c bl 8007994 <_init>
- 800711c: 2500 movs r5, #0
- 800711e: 4e0a ldr r6, [pc, #40] ; (8007148 <__libc_init_array+0x40>)
- 8007120: 4c0a ldr r4, [pc, #40] ; (800714c <__libc_init_array+0x44>)
- 8007122: 1ba4 subs r4, r4, r6
- 8007124: 10a4 asrs r4, r4, #2
- 8007126: 42a5 cmp r5, r4
- 8007128: d105 bne.n 8007136 <__libc_init_array+0x2e>
- 800712a: bd70 pop {r4, r5, r6, pc}
- 800712c: f856 3025 ldr.w r3, [r6, r5, lsl #2]
- 8007130: 4798 blx r3
- 8007132: 3501 adds r5, #1
- 8007134: e7ee b.n 8007114 <__libc_init_array+0xc>
- 8007136: f856 3025 ldr.w r3, [r6, r5, lsl #2]
- 800713a: 4798 blx r3
- 800713c: 3501 adds r5, #1
- 800713e: e7f2 b.n 8007126 <__libc_init_array+0x1e>
- 8007140: 08007fc4 .word 0x08007fc4
- 8007144: 08007fc4 .word 0x08007fc4
- 8007148: 08007fc4 .word 0x08007fc4
- 800714c: 08007fc8 .word 0x08007fc8
-
- 08007150 <memset>:
- 8007150: 4603 mov r3, r0
- 8007152: 4402 add r2, r0
- 8007154: 4293 cmp r3, r2
- 8007156: d100 bne.n 800715a <memset+0xa>
- 8007158: 4770 bx lr
- 800715a: f803 1b01 strb.w r1, [r3], #1
- 800715e: e7f9 b.n 8007154 <memset+0x4>
-
- 08007160 <siprintf>:
- 8007160: b40e push {r1, r2, r3}
- 8007162: f06f 4100 mvn.w r1, #2147483648 ; 0x80000000
- 8007166: b500 push {lr}
- 8007168: b09c sub sp, #112 ; 0x70
- 800716a: ab1d add r3, sp, #116 ; 0x74
- 800716c: 9002 str r0, [sp, #8]
- 800716e: 9006 str r0, [sp, #24]
- 8007170: 9107 str r1, [sp, #28]
- 8007172: 9104 str r1, [sp, #16]
- 8007174: 4808 ldr r0, [pc, #32] ; (8007198 <siprintf+0x38>)
- 8007176: 4909 ldr r1, [pc, #36] ; (800719c <siprintf+0x3c>)
- 8007178: f853 2b04 ldr.w r2, [r3], #4
- 800717c: 9105 str r1, [sp, #20]
- 800717e: 6800 ldr r0, [r0, #0]
- 8007180: a902 add r1, sp, #8
- 8007182: 9301 str r3, [sp, #4]
- 8007184: f000 f86e bl 8007264 <_svfiprintf_r>
- 8007188: 2200 movs r2, #0
- 800718a: 9b02 ldr r3, [sp, #8]
- 800718c: 701a strb r2, [r3, #0]
- 800718e: b01c add sp, #112 ; 0x70
- 8007190: f85d eb04 ldr.w lr, [sp], #4
- 8007194: b003 add sp, #12
- 8007196: 4770 bx lr
- 8007198: 20000024 .word 0x20000024
- 800719c: ffff0208 .word 0xffff0208
-
- 080071a0 <strcpy>:
- 80071a0: 4603 mov r3, r0
- 80071a2: f811 2b01 ldrb.w r2, [r1], #1
- 80071a6: f803 2b01 strb.w r2, [r3], #1
- 80071aa: 2a00 cmp r2, #0
- 80071ac: d1f9 bne.n 80071a2 <strcpy+0x2>
- 80071ae: 4770 bx lr
-
- 080071b0 <__ssputs_r>:
- 80071b0: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- 80071b4: 688e ldr r6, [r1, #8]
- 80071b6: 4682 mov sl, r0
- 80071b8: 429e cmp r6, r3
- 80071ba: 460c mov r4, r1
- 80071bc: 4690 mov r8, r2
- 80071be: 4699 mov r9, r3
- 80071c0: d837 bhi.n 8007232 <__ssputs_r+0x82>
- 80071c2: 898a ldrh r2, [r1, #12]
- 80071c4: f412 6f90 tst.w r2, #1152 ; 0x480
- 80071c8: d031 beq.n 800722e <__ssputs_r+0x7e>
- 80071ca: 2302 movs r3, #2
- 80071cc: 6825 ldr r5, [r4, #0]
- 80071ce: 6909 ldr r1, [r1, #16]
- 80071d0: 1a6f subs r7, r5, r1
- 80071d2: 6965 ldr r5, [r4, #20]
- 80071d4: eb05 0545 add.w r5, r5, r5, lsl #1
- 80071d8: fb95 f5f3 sdiv r5, r5, r3
- 80071dc: f109 0301 add.w r3, r9, #1
- 80071e0: 443b add r3, r7
- 80071e2: 429d cmp r5, r3
- 80071e4: bf38 it cc
- 80071e6: 461d movcc r5, r3
- 80071e8: 0553 lsls r3, r2, #21
- 80071ea: d530 bpl.n 800724e <__ssputs_r+0x9e>
- 80071ec: 4629 mov r1, r5
- 80071ee: f000 fb37 bl 8007860 <_malloc_r>
- 80071f2: 4606 mov r6, r0
- 80071f4: b950 cbnz r0, 800720c <__ssputs_r+0x5c>
- 80071f6: 230c movs r3, #12
- 80071f8: f04f 30ff mov.w r0, #4294967295
- 80071fc: f8ca 3000 str.w r3, [sl]
- 8007200: 89a3 ldrh r3, [r4, #12]
- 8007202: f043 0340 orr.w r3, r3, #64 ; 0x40
- 8007206: 81a3 strh r3, [r4, #12]
- 8007208: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 800720c: 463a mov r2, r7
- 800720e: 6921 ldr r1, [r4, #16]
- 8007210: f000 fab6 bl 8007780 <memcpy>
- 8007214: 89a3 ldrh r3, [r4, #12]
- 8007216: f423 6390 bic.w r3, r3, #1152 ; 0x480
- 800721a: f043 0380 orr.w r3, r3, #128 ; 0x80
- 800721e: 81a3 strh r3, [r4, #12]
- 8007220: 6126 str r6, [r4, #16]
- 8007222: 443e add r6, r7
- 8007224: 6026 str r6, [r4, #0]
- 8007226: 464e mov r6, r9
- 8007228: 6165 str r5, [r4, #20]
- 800722a: 1bed subs r5, r5, r7
- 800722c: 60a5 str r5, [r4, #8]
- 800722e: 454e cmp r6, r9
- 8007230: d900 bls.n 8007234 <__ssputs_r+0x84>
- 8007232: 464e mov r6, r9
- 8007234: 4632 mov r2, r6
- 8007236: 4641 mov r1, r8
- 8007238: 6820 ldr r0, [r4, #0]
- 800723a: f000 faac bl 8007796 <memmove>
- 800723e: 68a3 ldr r3, [r4, #8]
- 8007240: 2000 movs r0, #0
- 8007242: 1b9b subs r3, r3, r6
- 8007244: 60a3 str r3, [r4, #8]
- 8007246: 6823 ldr r3, [r4, #0]
- 8007248: 441e add r6, r3
- 800724a: 6026 str r6, [r4, #0]
- 800724c: e7dc b.n 8007208 <__ssputs_r+0x58>
- 800724e: 462a mov r2, r5
- 8007250: f000 fb60 bl 8007914 <_realloc_r>
- 8007254: 4606 mov r6, r0
- 8007256: 2800 cmp r0, #0
- 8007258: d1e2 bne.n 8007220 <__ssputs_r+0x70>
- 800725a: 6921 ldr r1, [r4, #16]
- 800725c: 4650 mov r0, sl
- 800725e: f000 fab3 bl 80077c8 <_free_r>
- 8007262: e7c8 b.n 80071f6 <__ssputs_r+0x46>
-
- 08007264 <_svfiprintf_r>:
- 8007264: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 8007268: 461d mov r5, r3
- 800726a: 898b ldrh r3, [r1, #12]
- 800726c: b09d sub sp, #116 ; 0x74
- 800726e: 061f lsls r7, r3, #24
- 8007270: 4680 mov r8, r0
- 8007272: 460c mov r4, r1
- 8007274: 4616 mov r6, r2
- 8007276: d50f bpl.n 8007298 <_svfiprintf_r+0x34>
- 8007278: 690b ldr r3, [r1, #16]
- 800727a: b96b cbnz r3, 8007298 <_svfiprintf_r+0x34>
- 800727c: 2140 movs r1, #64 ; 0x40
- 800727e: f000 faef bl 8007860 <_malloc_r>
- 8007282: 6020 str r0, [r4, #0]
- 8007284: 6120 str r0, [r4, #16]
- 8007286: b928 cbnz r0, 8007294 <_svfiprintf_r+0x30>
- 8007288: 230c movs r3, #12
- 800728a: f8c8 3000 str.w r3, [r8]
- 800728e: f04f 30ff mov.w r0, #4294967295
- 8007292: e0c8 b.n 8007426 <_svfiprintf_r+0x1c2>
- 8007294: 2340 movs r3, #64 ; 0x40
- 8007296: 6163 str r3, [r4, #20]
- 8007298: 2300 movs r3, #0
- 800729a: 9309 str r3, [sp, #36] ; 0x24
- 800729c: 2320 movs r3, #32
- 800729e: f88d 3029 strb.w r3, [sp, #41] ; 0x29
- 80072a2: 2330 movs r3, #48 ; 0x30
- 80072a4: f04f 0b01 mov.w fp, #1
- 80072a8: f88d 302a strb.w r3, [sp, #42] ; 0x2a
- 80072ac: 9503 str r5, [sp, #12]
- 80072ae: 4637 mov r7, r6
- 80072b0: 463d mov r5, r7
- 80072b2: f815 3b01 ldrb.w r3, [r5], #1
- 80072b6: b10b cbz r3, 80072bc <_svfiprintf_r+0x58>
- 80072b8: 2b25 cmp r3, #37 ; 0x25
- 80072ba: d13e bne.n 800733a <_svfiprintf_r+0xd6>
- 80072bc: ebb7 0a06 subs.w sl, r7, r6
- 80072c0: d00b beq.n 80072da <_svfiprintf_r+0x76>
- 80072c2: 4653 mov r3, sl
- 80072c4: 4632 mov r2, r6
- 80072c6: 4621 mov r1, r4
- 80072c8: 4640 mov r0, r8
- 80072ca: f7ff ff71 bl 80071b0 <__ssputs_r>
- 80072ce: 3001 adds r0, #1
- 80072d0: f000 80a4 beq.w 800741c <_svfiprintf_r+0x1b8>
- 80072d4: 9b09 ldr r3, [sp, #36] ; 0x24
- 80072d6: 4453 add r3, sl
- 80072d8: 9309 str r3, [sp, #36] ; 0x24
- 80072da: 783b ldrb r3, [r7, #0]
- 80072dc: 2b00 cmp r3, #0
- 80072de: f000 809d beq.w 800741c <_svfiprintf_r+0x1b8>
- 80072e2: 2300 movs r3, #0
- 80072e4: f04f 32ff mov.w r2, #4294967295
- 80072e8: e9cd 2305 strd r2, r3, [sp, #20]
- 80072ec: 9304 str r3, [sp, #16]
- 80072ee: 9307 str r3, [sp, #28]
- 80072f0: f88d 3053 strb.w r3, [sp, #83] ; 0x53
- 80072f4: 931a str r3, [sp, #104] ; 0x68
- 80072f6: 462f mov r7, r5
- 80072f8: 2205 movs r2, #5
- 80072fa: f817 1b01 ldrb.w r1, [r7], #1
- 80072fe: 4850 ldr r0, [pc, #320] ; (8007440 <_svfiprintf_r+0x1dc>)
- 8007300: f000 fa30 bl 8007764 <memchr>
- 8007304: 9b04 ldr r3, [sp, #16]
- 8007306: b9d0 cbnz r0, 800733e <_svfiprintf_r+0xda>
- 8007308: 06d9 lsls r1, r3, #27
- 800730a: bf44 itt mi
- 800730c: 2220 movmi r2, #32
- 800730e: f88d 2053 strbmi.w r2, [sp, #83] ; 0x53
- 8007312: 071a lsls r2, r3, #28
- 8007314: bf44 itt mi
- 8007316: 222b movmi r2, #43 ; 0x2b
- 8007318: f88d 2053 strbmi.w r2, [sp, #83] ; 0x53
- 800731c: 782a ldrb r2, [r5, #0]
- 800731e: 2a2a cmp r2, #42 ; 0x2a
- 8007320: d015 beq.n 800734e <_svfiprintf_r+0xea>
- 8007322: 462f mov r7, r5
- 8007324: 2000 movs r0, #0
- 8007326: 250a movs r5, #10
- 8007328: 9a07 ldr r2, [sp, #28]
- 800732a: 4639 mov r1, r7
- 800732c: f811 3b01 ldrb.w r3, [r1], #1
- 8007330: 3b30 subs r3, #48 ; 0x30
- 8007332: 2b09 cmp r3, #9
- 8007334: d94d bls.n 80073d2 <_svfiprintf_r+0x16e>
- 8007336: b1b8 cbz r0, 8007368 <_svfiprintf_r+0x104>
- 8007338: e00f b.n 800735a <_svfiprintf_r+0xf6>
- 800733a: 462f mov r7, r5
- 800733c: e7b8 b.n 80072b0 <_svfiprintf_r+0x4c>
- 800733e: 4a40 ldr r2, [pc, #256] ; (8007440 <_svfiprintf_r+0x1dc>)
- 8007340: 463d mov r5, r7
- 8007342: 1a80 subs r0, r0, r2
- 8007344: fa0b f000 lsl.w r0, fp, r0
- 8007348: 4318 orrs r0, r3
- 800734a: 9004 str r0, [sp, #16]
- 800734c: e7d3 b.n 80072f6 <_svfiprintf_r+0x92>
- 800734e: 9a03 ldr r2, [sp, #12]
- 8007350: 1d11 adds r1, r2, #4
- 8007352: 6812 ldr r2, [r2, #0]
- 8007354: 9103 str r1, [sp, #12]
- 8007356: 2a00 cmp r2, #0
- 8007358: db01 blt.n 800735e <_svfiprintf_r+0xfa>
- 800735a: 9207 str r2, [sp, #28]
- 800735c: e004 b.n 8007368 <_svfiprintf_r+0x104>
- 800735e: 4252 negs r2, r2
- 8007360: f043 0302 orr.w r3, r3, #2
- 8007364: 9207 str r2, [sp, #28]
- 8007366: 9304 str r3, [sp, #16]
- 8007368: 783b ldrb r3, [r7, #0]
- 800736a: 2b2e cmp r3, #46 ; 0x2e
- 800736c: d10c bne.n 8007388 <_svfiprintf_r+0x124>
- 800736e: 787b ldrb r3, [r7, #1]
- 8007370: 2b2a cmp r3, #42 ; 0x2a
- 8007372: d133 bne.n 80073dc <_svfiprintf_r+0x178>
- 8007374: 9b03 ldr r3, [sp, #12]
- 8007376: 3702 adds r7, #2
- 8007378: 1d1a adds r2, r3, #4
- 800737a: 681b ldr r3, [r3, #0]
- 800737c: 9203 str r2, [sp, #12]
- 800737e: 2b00 cmp r3, #0
- 8007380: bfb8 it lt
- 8007382: f04f 33ff movlt.w r3, #4294967295
- 8007386: 9305 str r3, [sp, #20]
- 8007388: 4d2e ldr r5, [pc, #184] ; (8007444 <_svfiprintf_r+0x1e0>)
- 800738a: 2203 movs r2, #3
- 800738c: 7839 ldrb r1, [r7, #0]
- 800738e: 4628 mov r0, r5
- 8007390: f000 f9e8 bl 8007764 <memchr>
- 8007394: b138 cbz r0, 80073a6 <_svfiprintf_r+0x142>
- 8007396: 2340 movs r3, #64 ; 0x40
- 8007398: 1b40 subs r0, r0, r5
- 800739a: fa03 f000 lsl.w r0, r3, r0
- 800739e: 9b04 ldr r3, [sp, #16]
- 80073a0: 3701 adds r7, #1
- 80073a2: 4303 orrs r3, r0
- 80073a4: 9304 str r3, [sp, #16]
- 80073a6: 7839 ldrb r1, [r7, #0]
- 80073a8: 2206 movs r2, #6
- 80073aa: 4827 ldr r0, [pc, #156] ; (8007448 <_svfiprintf_r+0x1e4>)
- 80073ac: 1c7e adds r6, r7, #1
- 80073ae: f88d 1028 strb.w r1, [sp, #40] ; 0x28
- 80073b2: f000 f9d7 bl 8007764 <memchr>
- 80073b6: 2800 cmp r0, #0
- 80073b8: d038 beq.n 800742c <_svfiprintf_r+0x1c8>
- 80073ba: 4b24 ldr r3, [pc, #144] ; (800744c <_svfiprintf_r+0x1e8>)
- 80073bc: bb13 cbnz r3, 8007404 <_svfiprintf_r+0x1a0>
- 80073be: 9b03 ldr r3, [sp, #12]
- 80073c0: 3307 adds r3, #7
- 80073c2: f023 0307 bic.w r3, r3, #7
- 80073c6: 3308 adds r3, #8
- 80073c8: 9303 str r3, [sp, #12]
- 80073ca: 9b09 ldr r3, [sp, #36] ; 0x24
- 80073cc: 444b add r3, r9
- 80073ce: 9309 str r3, [sp, #36] ; 0x24
- 80073d0: e76d b.n 80072ae <_svfiprintf_r+0x4a>
- 80073d2: fb05 3202 mla r2, r5, r2, r3
- 80073d6: 2001 movs r0, #1
- 80073d8: 460f mov r7, r1
- 80073da: e7a6 b.n 800732a <_svfiprintf_r+0xc6>
- 80073dc: 2300 movs r3, #0
- 80073de: 250a movs r5, #10
- 80073e0: 4619 mov r1, r3
- 80073e2: 3701 adds r7, #1
- 80073e4: 9305 str r3, [sp, #20]
- 80073e6: 4638 mov r0, r7
- 80073e8: f810 2b01 ldrb.w r2, [r0], #1
- 80073ec: 3a30 subs r2, #48 ; 0x30
- 80073ee: 2a09 cmp r2, #9
- 80073f0: d903 bls.n 80073fa <_svfiprintf_r+0x196>
- 80073f2: 2b00 cmp r3, #0
- 80073f4: d0c8 beq.n 8007388 <_svfiprintf_r+0x124>
- 80073f6: 9105 str r1, [sp, #20]
- 80073f8: e7c6 b.n 8007388 <_svfiprintf_r+0x124>
- 80073fa: fb05 2101 mla r1, r5, r1, r2
- 80073fe: 2301 movs r3, #1
- 8007400: 4607 mov r7, r0
- 8007402: e7f0 b.n 80073e6 <_svfiprintf_r+0x182>
- 8007404: ab03 add r3, sp, #12
- 8007406: 9300 str r3, [sp, #0]
- 8007408: 4622 mov r2, r4
- 800740a: 4b11 ldr r3, [pc, #68] ; (8007450 <_svfiprintf_r+0x1ec>)
- 800740c: a904 add r1, sp, #16
- 800740e: 4640 mov r0, r8
- 8007410: f3af 8000 nop.w
- 8007414: f1b0 3fff cmp.w r0, #4294967295
- 8007418: 4681 mov r9, r0
- 800741a: d1d6 bne.n 80073ca <_svfiprintf_r+0x166>
- 800741c: 89a3 ldrh r3, [r4, #12]
- 800741e: 065b lsls r3, r3, #25
- 8007420: f53f af35 bmi.w 800728e <_svfiprintf_r+0x2a>
- 8007424: 9809 ldr r0, [sp, #36] ; 0x24
- 8007426: b01d add sp, #116 ; 0x74
- 8007428: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800742c: ab03 add r3, sp, #12
- 800742e: 9300 str r3, [sp, #0]
- 8007430: 4622 mov r2, r4
- 8007432: 4b07 ldr r3, [pc, #28] ; (8007450 <_svfiprintf_r+0x1ec>)
- 8007434: a904 add r1, sp, #16
- 8007436: 4640 mov r0, r8
- 8007438: f000 f882 bl 8007540 <_printf_i>
- 800743c: e7ea b.n 8007414 <_svfiprintf_r+0x1b0>
- 800743e: bf00 nop
- 8007440: 08007f88 .word 0x08007f88
- 8007444: 08007f8e .word 0x08007f8e
- 8007448: 08007f92 .word 0x08007f92
- 800744c: 00000000 .word 0x00000000
- 8007450: 080071b1 .word 0x080071b1
-
- 08007454 <_printf_common>:
- 8007454: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- 8007458: 4691 mov r9, r2
- 800745a: 461f mov r7, r3
- 800745c: 688a ldr r2, [r1, #8]
- 800745e: 690b ldr r3, [r1, #16]
- 8007460: 4606 mov r6, r0
- 8007462: 4293 cmp r3, r2
- 8007464: bfb8 it lt
- 8007466: 4613 movlt r3, r2
- 8007468: f8c9 3000 str.w r3, [r9]
- 800746c: f891 2043 ldrb.w r2, [r1, #67] ; 0x43
- 8007470: 460c mov r4, r1
- 8007472: f8dd 8020 ldr.w r8, [sp, #32]
- 8007476: b112 cbz r2, 800747e <_printf_common+0x2a>
- 8007478: 3301 adds r3, #1
- 800747a: f8c9 3000 str.w r3, [r9]
- 800747e: 6823 ldr r3, [r4, #0]
- 8007480: 0699 lsls r1, r3, #26
- 8007482: bf42 ittt mi
- 8007484: f8d9 3000 ldrmi.w r3, [r9]
- 8007488: 3302 addmi r3, #2
- 800748a: f8c9 3000 strmi.w r3, [r9]
- 800748e: 6825 ldr r5, [r4, #0]
- 8007490: f015 0506 ands.w r5, r5, #6
- 8007494: d107 bne.n 80074a6 <_printf_common+0x52>
- 8007496: f104 0a19 add.w sl, r4, #25
- 800749a: 68e3 ldr r3, [r4, #12]
- 800749c: f8d9 2000 ldr.w r2, [r9]
- 80074a0: 1a9b subs r3, r3, r2
- 80074a2: 42ab cmp r3, r5
- 80074a4: dc29 bgt.n 80074fa <_printf_common+0xa6>
- 80074a6: f894 3043 ldrb.w r3, [r4, #67] ; 0x43
- 80074aa: 6822 ldr r2, [r4, #0]
- 80074ac: 3300 adds r3, #0
- 80074ae: bf18 it ne
- 80074b0: 2301 movne r3, #1
- 80074b2: 0692 lsls r2, r2, #26
- 80074b4: d42e bmi.n 8007514 <_printf_common+0xc0>
- 80074b6: f104 0243 add.w r2, r4, #67 ; 0x43
- 80074ba: 4639 mov r1, r7
- 80074bc: 4630 mov r0, r6
- 80074be: 47c0 blx r8
- 80074c0: 3001 adds r0, #1
- 80074c2: d021 beq.n 8007508 <_printf_common+0xb4>
- 80074c4: 6823 ldr r3, [r4, #0]
- 80074c6: 68e5 ldr r5, [r4, #12]
- 80074c8: f003 0306 and.w r3, r3, #6
- 80074cc: 2b04 cmp r3, #4
- 80074ce: bf18 it ne
- 80074d0: 2500 movne r5, #0
- 80074d2: f8d9 2000 ldr.w r2, [r9]
- 80074d6: f04f 0900 mov.w r9, #0
- 80074da: bf08 it eq
- 80074dc: 1aad subeq r5, r5, r2
- 80074de: 68a3 ldr r3, [r4, #8]
- 80074e0: 6922 ldr r2, [r4, #16]
- 80074e2: bf08 it eq
- 80074e4: ea25 75e5 biceq.w r5, r5, r5, asr #31
- 80074e8: 4293 cmp r3, r2
- 80074ea: bfc4 itt gt
- 80074ec: 1a9b subgt r3, r3, r2
- 80074ee: 18ed addgt r5, r5, r3
- 80074f0: 341a adds r4, #26
- 80074f2: 454d cmp r5, r9
- 80074f4: d11a bne.n 800752c <_printf_common+0xd8>
- 80074f6: 2000 movs r0, #0
- 80074f8: e008 b.n 800750c <_printf_common+0xb8>
- 80074fa: 2301 movs r3, #1
- 80074fc: 4652 mov r2, sl
- 80074fe: 4639 mov r1, r7
- 8007500: 4630 mov r0, r6
- 8007502: 47c0 blx r8
- 8007504: 3001 adds r0, #1
- 8007506: d103 bne.n 8007510 <_printf_common+0xbc>
- 8007508: f04f 30ff mov.w r0, #4294967295
- 800750c: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 8007510: 3501 adds r5, #1
- 8007512: e7c2 b.n 800749a <_printf_common+0x46>
- 8007514: 2030 movs r0, #48 ; 0x30
- 8007516: 18e1 adds r1, r4, r3
- 8007518: f881 0043 strb.w r0, [r1, #67] ; 0x43
- 800751c: 1c5a adds r2, r3, #1
- 800751e: f894 1045 ldrb.w r1, [r4, #69] ; 0x45
- 8007522: 4422 add r2, r4
- 8007524: 3302 adds r3, #2
- 8007526: f882 1043 strb.w r1, [r2, #67] ; 0x43
- 800752a: e7c4 b.n 80074b6 <_printf_common+0x62>
- 800752c: 2301 movs r3, #1
- 800752e: 4622 mov r2, r4
- 8007530: 4639 mov r1, r7
- 8007532: 4630 mov r0, r6
- 8007534: 47c0 blx r8
- 8007536: 3001 adds r0, #1
- 8007538: d0e6 beq.n 8007508 <_printf_common+0xb4>
- 800753a: f109 0901 add.w r9, r9, #1
- 800753e: e7d8 b.n 80074f2 <_printf_common+0x9e>
-
- 08007540 <_printf_i>:
- 8007540: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
- 8007544: f101 0c43 add.w ip, r1, #67 ; 0x43
- 8007548: 460c mov r4, r1
- 800754a: 7e09 ldrb r1, [r1, #24]
- 800754c: b085 sub sp, #20
- 800754e: 296e cmp r1, #110 ; 0x6e
- 8007550: 4617 mov r7, r2
- 8007552: 4606 mov r6, r0
- 8007554: 4698 mov r8, r3
- 8007556: 9a0c ldr r2, [sp, #48] ; 0x30
- 8007558: f000 80b3 beq.w 80076c2 <_printf_i+0x182>
- 800755c: d822 bhi.n 80075a4 <_printf_i+0x64>
- 800755e: 2963 cmp r1, #99 ; 0x63
- 8007560: d036 beq.n 80075d0 <_printf_i+0x90>
- 8007562: d80a bhi.n 800757a <_printf_i+0x3a>
- 8007564: 2900 cmp r1, #0
- 8007566: f000 80b9 beq.w 80076dc <_printf_i+0x19c>
- 800756a: 2958 cmp r1, #88 ; 0x58
- 800756c: f000 8083 beq.w 8007676 <_printf_i+0x136>
- 8007570: f104 0542 add.w r5, r4, #66 ; 0x42
- 8007574: f884 1042 strb.w r1, [r4, #66] ; 0x42
- 8007578: e032 b.n 80075e0 <_printf_i+0xa0>
- 800757a: 2964 cmp r1, #100 ; 0x64
- 800757c: d001 beq.n 8007582 <_printf_i+0x42>
- 800757e: 2969 cmp r1, #105 ; 0x69
- 8007580: d1f6 bne.n 8007570 <_printf_i+0x30>
- 8007582: 6820 ldr r0, [r4, #0]
- 8007584: 6813 ldr r3, [r2, #0]
- 8007586: 0605 lsls r5, r0, #24
- 8007588: f103 0104 add.w r1, r3, #4
- 800758c: d52a bpl.n 80075e4 <_printf_i+0xa4>
- 800758e: 681b ldr r3, [r3, #0]
- 8007590: 6011 str r1, [r2, #0]
- 8007592: 2b00 cmp r3, #0
- 8007594: da03 bge.n 800759e <_printf_i+0x5e>
- 8007596: 222d movs r2, #45 ; 0x2d
- 8007598: 425b negs r3, r3
- 800759a: f884 2043 strb.w r2, [r4, #67] ; 0x43
- 800759e: 486f ldr r0, [pc, #444] ; (800775c <_printf_i+0x21c>)
- 80075a0: 220a movs r2, #10
- 80075a2: e039 b.n 8007618 <_printf_i+0xd8>
- 80075a4: 2973 cmp r1, #115 ; 0x73
- 80075a6: f000 809d beq.w 80076e4 <_printf_i+0x1a4>
- 80075aa: d808 bhi.n 80075be <_printf_i+0x7e>
- 80075ac: 296f cmp r1, #111 ; 0x6f
- 80075ae: d020 beq.n 80075f2 <_printf_i+0xb2>
- 80075b0: 2970 cmp r1, #112 ; 0x70
- 80075b2: d1dd bne.n 8007570 <_printf_i+0x30>
- 80075b4: 6823 ldr r3, [r4, #0]
- 80075b6: f043 0320 orr.w r3, r3, #32
- 80075ba: 6023 str r3, [r4, #0]
- 80075bc: e003 b.n 80075c6 <_printf_i+0x86>
- 80075be: 2975 cmp r1, #117 ; 0x75
- 80075c0: d017 beq.n 80075f2 <_printf_i+0xb2>
- 80075c2: 2978 cmp r1, #120 ; 0x78
- 80075c4: d1d4 bne.n 8007570 <_printf_i+0x30>
- 80075c6: 2378 movs r3, #120 ; 0x78
- 80075c8: 4865 ldr r0, [pc, #404] ; (8007760 <_printf_i+0x220>)
- 80075ca: f884 3045 strb.w r3, [r4, #69] ; 0x45
- 80075ce: e055 b.n 800767c <_printf_i+0x13c>
- 80075d0: 6813 ldr r3, [r2, #0]
- 80075d2: f104 0542 add.w r5, r4, #66 ; 0x42
- 80075d6: 1d19 adds r1, r3, #4
- 80075d8: 681b ldr r3, [r3, #0]
- 80075da: 6011 str r1, [r2, #0]
- 80075dc: f884 3042 strb.w r3, [r4, #66] ; 0x42
- 80075e0: 2301 movs r3, #1
- 80075e2: e08c b.n 80076fe <_printf_i+0x1be>
- 80075e4: 681b ldr r3, [r3, #0]
- 80075e6: f010 0f40 tst.w r0, #64 ; 0x40
- 80075ea: 6011 str r1, [r2, #0]
- 80075ec: bf18 it ne
- 80075ee: b21b sxthne r3, r3
- 80075f0: e7cf b.n 8007592 <_printf_i+0x52>
- 80075f2: 6813 ldr r3, [r2, #0]
- 80075f4: 6825 ldr r5, [r4, #0]
- 80075f6: 1d18 adds r0, r3, #4
- 80075f8: 6010 str r0, [r2, #0]
- 80075fa: 0628 lsls r0, r5, #24
- 80075fc: d501 bpl.n 8007602 <_printf_i+0xc2>
- 80075fe: 681b ldr r3, [r3, #0]
- 8007600: e002 b.n 8007608 <_printf_i+0xc8>
- 8007602: 0668 lsls r0, r5, #25
- 8007604: d5fb bpl.n 80075fe <_printf_i+0xbe>
- 8007606: 881b ldrh r3, [r3, #0]
- 8007608: 296f cmp r1, #111 ; 0x6f
- 800760a: bf14 ite ne
- 800760c: 220a movne r2, #10
- 800760e: 2208 moveq r2, #8
- 8007610: 4852 ldr r0, [pc, #328] ; (800775c <_printf_i+0x21c>)
- 8007612: 2100 movs r1, #0
- 8007614: f884 1043 strb.w r1, [r4, #67] ; 0x43
- 8007618: 6865 ldr r5, [r4, #4]
- 800761a: 2d00 cmp r5, #0
- 800761c: 60a5 str r5, [r4, #8]
- 800761e: f2c0 8095 blt.w 800774c <_printf_i+0x20c>
- 8007622: 6821 ldr r1, [r4, #0]
- 8007624: f021 0104 bic.w r1, r1, #4
- 8007628: 6021 str r1, [r4, #0]
- 800762a: 2b00 cmp r3, #0
- 800762c: d13d bne.n 80076aa <_printf_i+0x16a>
- 800762e: 2d00 cmp r5, #0
- 8007630: f040 808e bne.w 8007750 <_printf_i+0x210>
- 8007634: 4665 mov r5, ip
- 8007636: 2a08 cmp r2, #8
- 8007638: d10b bne.n 8007652 <_printf_i+0x112>
- 800763a: 6823 ldr r3, [r4, #0]
- 800763c: 07db lsls r3, r3, #31
- 800763e: d508 bpl.n 8007652 <_printf_i+0x112>
- 8007640: 6923 ldr r3, [r4, #16]
- 8007642: 6862 ldr r2, [r4, #4]
- 8007644: 429a cmp r2, r3
- 8007646: bfde ittt le
- 8007648: 2330 movle r3, #48 ; 0x30
- 800764a: f805 3c01 strble.w r3, [r5, #-1]
- 800764e: f105 35ff addle.w r5, r5, #4294967295
- 8007652: ebac 0305 sub.w r3, ip, r5
- 8007656: 6123 str r3, [r4, #16]
- 8007658: f8cd 8000 str.w r8, [sp]
- 800765c: 463b mov r3, r7
- 800765e: aa03 add r2, sp, #12
- 8007660: 4621 mov r1, r4
- 8007662: 4630 mov r0, r6
- 8007664: f7ff fef6 bl 8007454 <_printf_common>
- 8007668: 3001 adds r0, #1
- 800766a: d14d bne.n 8007708 <_printf_i+0x1c8>
- 800766c: f04f 30ff mov.w r0, #4294967295
- 8007670: b005 add sp, #20
- 8007672: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
- 8007676: 4839 ldr r0, [pc, #228] ; (800775c <_printf_i+0x21c>)
- 8007678: f884 1045 strb.w r1, [r4, #69] ; 0x45
- 800767c: 6813 ldr r3, [r2, #0]
- 800767e: 6821 ldr r1, [r4, #0]
- 8007680: 1d1d adds r5, r3, #4
- 8007682: 681b ldr r3, [r3, #0]
- 8007684: 6015 str r5, [r2, #0]
- 8007686: 060a lsls r2, r1, #24
- 8007688: d50b bpl.n 80076a2 <_printf_i+0x162>
- 800768a: 07ca lsls r2, r1, #31
- 800768c: bf44 itt mi
- 800768e: f041 0120 orrmi.w r1, r1, #32
- 8007692: 6021 strmi r1, [r4, #0]
- 8007694: b91b cbnz r3, 800769e <_printf_i+0x15e>
- 8007696: 6822 ldr r2, [r4, #0]
- 8007698: f022 0220 bic.w r2, r2, #32
- 800769c: 6022 str r2, [r4, #0]
- 800769e: 2210 movs r2, #16
- 80076a0: e7b7 b.n 8007612 <_printf_i+0xd2>
- 80076a2: 064d lsls r5, r1, #25
- 80076a4: bf48 it mi
- 80076a6: b29b uxthmi r3, r3
- 80076a8: e7ef b.n 800768a <_printf_i+0x14a>
- 80076aa: 4665 mov r5, ip
- 80076ac: fbb3 f1f2 udiv r1, r3, r2
- 80076b0: fb02 3311 mls r3, r2, r1, r3
- 80076b4: 5cc3 ldrb r3, [r0, r3]
- 80076b6: f805 3d01 strb.w r3, [r5, #-1]!
- 80076ba: 460b mov r3, r1
- 80076bc: 2900 cmp r1, #0
- 80076be: d1f5 bne.n 80076ac <_printf_i+0x16c>
- 80076c0: e7b9 b.n 8007636 <_printf_i+0xf6>
- 80076c2: 6813 ldr r3, [r2, #0]
- 80076c4: 6825 ldr r5, [r4, #0]
- 80076c6: 1d18 adds r0, r3, #4
- 80076c8: 6961 ldr r1, [r4, #20]
- 80076ca: 6010 str r0, [r2, #0]
- 80076cc: 0628 lsls r0, r5, #24
- 80076ce: 681b ldr r3, [r3, #0]
- 80076d0: d501 bpl.n 80076d6 <_printf_i+0x196>
- 80076d2: 6019 str r1, [r3, #0]
- 80076d4: e002 b.n 80076dc <_printf_i+0x19c>
- 80076d6: 066a lsls r2, r5, #25
- 80076d8: d5fb bpl.n 80076d2 <_printf_i+0x192>
- 80076da: 8019 strh r1, [r3, #0]
- 80076dc: 2300 movs r3, #0
- 80076de: 4665 mov r5, ip
- 80076e0: 6123 str r3, [r4, #16]
- 80076e2: e7b9 b.n 8007658 <_printf_i+0x118>
- 80076e4: 6813 ldr r3, [r2, #0]
- 80076e6: 1d19 adds r1, r3, #4
- 80076e8: 6011 str r1, [r2, #0]
- 80076ea: 681d ldr r5, [r3, #0]
- 80076ec: 6862 ldr r2, [r4, #4]
- 80076ee: 2100 movs r1, #0
- 80076f0: 4628 mov r0, r5
- 80076f2: f000 f837 bl 8007764 <memchr>
- 80076f6: b108 cbz r0, 80076fc <_printf_i+0x1bc>
- 80076f8: 1b40 subs r0, r0, r5
- 80076fa: 6060 str r0, [r4, #4]
- 80076fc: 6863 ldr r3, [r4, #4]
- 80076fe: 6123 str r3, [r4, #16]
- 8007700: 2300 movs r3, #0
- 8007702: f884 3043 strb.w r3, [r4, #67] ; 0x43
- 8007706: e7a7 b.n 8007658 <_printf_i+0x118>
- 8007708: 6923 ldr r3, [r4, #16]
- 800770a: 462a mov r2, r5
- 800770c: 4639 mov r1, r7
- 800770e: 4630 mov r0, r6
- 8007710: 47c0 blx r8
- 8007712: 3001 adds r0, #1
- 8007714: d0aa beq.n 800766c <_printf_i+0x12c>
- 8007716: 6823 ldr r3, [r4, #0]
- 8007718: 079b lsls r3, r3, #30
- 800771a: d413 bmi.n 8007744 <_printf_i+0x204>
- 800771c: 68e0 ldr r0, [r4, #12]
- 800771e: 9b03 ldr r3, [sp, #12]
- 8007720: 4298 cmp r0, r3
- 8007722: bfb8 it lt
- 8007724: 4618 movlt r0, r3
- 8007726: e7a3 b.n 8007670 <_printf_i+0x130>
- 8007728: 2301 movs r3, #1
- 800772a: 464a mov r2, r9
- 800772c: 4639 mov r1, r7
- 800772e: 4630 mov r0, r6
- 8007730: 47c0 blx r8
- 8007732: 3001 adds r0, #1
- 8007734: d09a beq.n 800766c <_printf_i+0x12c>
- 8007736: 3501 adds r5, #1
- 8007738: 68e3 ldr r3, [r4, #12]
- 800773a: 9a03 ldr r2, [sp, #12]
- 800773c: 1a9b subs r3, r3, r2
- 800773e: 42ab cmp r3, r5
- 8007740: dcf2 bgt.n 8007728 <_printf_i+0x1e8>
- 8007742: e7eb b.n 800771c <_printf_i+0x1dc>
- 8007744: 2500 movs r5, #0
- 8007746: f104 0919 add.w r9, r4, #25
- 800774a: e7f5 b.n 8007738 <_printf_i+0x1f8>
- 800774c: 2b00 cmp r3, #0
- 800774e: d1ac bne.n 80076aa <_printf_i+0x16a>
- 8007750: 7803 ldrb r3, [r0, #0]
- 8007752: f104 0542 add.w r5, r4, #66 ; 0x42
- 8007756: f884 3042 strb.w r3, [r4, #66] ; 0x42
- 800775a: e76c b.n 8007636 <_printf_i+0xf6>
- 800775c: 08007f99 .word 0x08007f99
- 8007760: 08007faa .word 0x08007faa
-
- 08007764 <memchr>:
- 8007764: b510 push {r4, lr}
- 8007766: b2c9 uxtb r1, r1
- 8007768: 4402 add r2, r0
- 800776a: 4290 cmp r0, r2
- 800776c: 4603 mov r3, r0
- 800776e: d101 bne.n 8007774 <memchr+0x10>
- 8007770: 2300 movs r3, #0
- 8007772: e003 b.n 800777c <memchr+0x18>
- 8007774: 781c ldrb r4, [r3, #0]
- 8007776: 3001 adds r0, #1
- 8007778: 428c cmp r4, r1
- 800777a: d1f6 bne.n 800776a <memchr+0x6>
- 800777c: 4618 mov r0, r3
- 800777e: bd10 pop {r4, pc}
-
- 08007780 <memcpy>:
- 8007780: b510 push {r4, lr}
- 8007782: 1e43 subs r3, r0, #1
- 8007784: 440a add r2, r1
- 8007786: 4291 cmp r1, r2
- 8007788: d100 bne.n 800778c <memcpy+0xc>
- 800778a: bd10 pop {r4, pc}
- 800778c: f811 4b01 ldrb.w r4, [r1], #1
- 8007790: f803 4f01 strb.w r4, [r3, #1]!
- 8007794: e7f7 b.n 8007786 <memcpy+0x6>
-
- 08007796 <memmove>:
- 8007796: 4288 cmp r0, r1
- 8007798: b510 push {r4, lr}
- 800779a: eb01 0302 add.w r3, r1, r2
- 800779e: d807 bhi.n 80077b0 <memmove+0x1a>
- 80077a0: 1e42 subs r2, r0, #1
- 80077a2: 4299 cmp r1, r3
- 80077a4: d00a beq.n 80077bc <memmove+0x26>
- 80077a6: f811 4b01 ldrb.w r4, [r1], #1
- 80077aa: f802 4f01 strb.w r4, [r2, #1]!
- 80077ae: e7f8 b.n 80077a2 <memmove+0xc>
- 80077b0: 4283 cmp r3, r0
- 80077b2: d9f5 bls.n 80077a0 <memmove+0xa>
- 80077b4: 1881 adds r1, r0, r2
- 80077b6: 1ad2 subs r2, r2, r3
- 80077b8: 42d3 cmn r3, r2
- 80077ba: d100 bne.n 80077be <memmove+0x28>
- 80077bc: bd10 pop {r4, pc}
- 80077be: f813 4d01 ldrb.w r4, [r3, #-1]!
- 80077c2: f801 4d01 strb.w r4, [r1, #-1]!
- 80077c6: e7f7 b.n 80077b8 <memmove+0x22>
-
- 080077c8 <_free_r>:
- 80077c8: b538 push {r3, r4, r5, lr}
- 80077ca: 4605 mov r5, r0
- 80077cc: 2900 cmp r1, #0
- 80077ce: d043 beq.n 8007858 <_free_r+0x90>
- 80077d0: f851 3c04 ldr.w r3, [r1, #-4]
- 80077d4: 1f0c subs r4, r1, #4
- 80077d6: 2b00 cmp r3, #0
- 80077d8: bfb8 it lt
- 80077da: 18e4 addlt r4, r4, r3
- 80077dc: f000 f8d0 bl 8007980 <__malloc_lock>
- 80077e0: 4a1e ldr r2, [pc, #120] ; (800785c <_free_r+0x94>)
- 80077e2: 6813 ldr r3, [r2, #0]
- 80077e4: 4610 mov r0, r2
- 80077e6: b933 cbnz r3, 80077f6 <_free_r+0x2e>
- 80077e8: 6063 str r3, [r4, #4]
- 80077ea: 6014 str r4, [r2, #0]
- 80077ec: 4628 mov r0, r5
- 80077ee: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr}
- 80077f2: f000 b8c6 b.w 8007982 <__malloc_unlock>
- 80077f6: 42a3 cmp r3, r4
- 80077f8: d90b bls.n 8007812 <_free_r+0x4a>
- 80077fa: 6821 ldr r1, [r4, #0]
- 80077fc: 1862 adds r2, r4, r1
- 80077fe: 4293 cmp r3, r2
- 8007800: bf01 itttt eq
- 8007802: 681a ldreq r2, [r3, #0]
- 8007804: 685b ldreq r3, [r3, #4]
- 8007806: 1852 addeq r2, r2, r1
- 8007808: 6022 streq r2, [r4, #0]
- 800780a: 6063 str r3, [r4, #4]
- 800780c: 6004 str r4, [r0, #0]
- 800780e: e7ed b.n 80077ec <_free_r+0x24>
- 8007810: 4613 mov r3, r2
- 8007812: 685a ldr r2, [r3, #4]
- 8007814: b10a cbz r2, 800781a <_free_r+0x52>
- 8007816: 42a2 cmp r2, r4
- 8007818: d9fa bls.n 8007810 <_free_r+0x48>
- 800781a: 6819 ldr r1, [r3, #0]
- 800781c: 1858 adds r0, r3, r1
- 800781e: 42a0 cmp r0, r4
- 8007820: d10b bne.n 800783a <_free_r+0x72>
- 8007822: 6820 ldr r0, [r4, #0]
- 8007824: 4401 add r1, r0
- 8007826: 1858 adds r0, r3, r1
- 8007828: 4282 cmp r2, r0
- 800782a: 6019 str r1, [r3, #0]
- 800782c: d1de bne.n 80077ec <_free_r+0x24>
- 800782e: 6810 ldr r0, [r2, #0]
- 8007830: 6852 ldr r2, [r2, #4]
- 8007832: 4401 add r1, r0
- 8007834: 6019 str r1, [r3, #0]
- 8007836: 605a str r2, [r3, #4]
- 8007838: e7d8 b.n 80077ec <_free_r+0x24>
- 800783a: d902 bls.n 8007842 <_free_r+0x7a>
- 800783c: 230c movs r3, #12
- 800783e: 602b str r3, [r5, #0]
- 8007840: e7d4 b.n 80077ec <_free_r+0x24>
- 8007842: 6820 ldr r0, [r4, #0]
- 8007844: 1821 adds r1, r4, r0
- 8007846: 428a cmp r2, r1
- 8007848: bf01 itttt eq
- 800784a: 6811 ldreq r1, [r2, #0]
- 800784c: 6852 ldreq r2, [r2, #4]
- 800784e: 1809 addeq r1, r1, r0
- 8007850: 6021 streq r1, [r4, #0]
- 8007852: 6062 str r2, [r4, #4]
- 8007854: 605c str r4, [r3, #4]
- 8007856: e7c9 b.n 80077ec <_free_r+0x24>
- 8007858: bd38 pop {r3, r4, r5, pc}
- 800785a: bf00 nop
- 800785c: 200002e0 .word 0x200002e0
-
- 08007860 <_malloc_r>:
- 8007860: b570 push {r4, r5, r6, lr}
- 8007862: 1ccd adds r5, r1, #3
- 8007864: f025 0503 bic.w r5, r5, #3
- 8007868: 3508 adds r5, #8
- 800786a: 2d0c cmp r5, #12
- 800786c: bf38 it cc
- 800786e: 250c movcc r5, #12
- 8007870: 2d00 cmp r5, #0
- 8007872: 4606 mov r6, r0
- 8007874: db01 blt.n 800787a <_malloc_r+0x1a>
- 8007876: 42a9 cmp r1, r5
- 8007878: d903 bls.n 8007882 <_malloc_r+0x22>
- 800787a: 230c movs r3, #12
- 800787c: 6033 str r3, [r6, #0]
- 800787e: 2000 movs r0, #0
- 8007880: bd70 pop {r4, r5, r6, pc}
- 8007882: f000 f87d bl 8007980 <__malloc_lock>
- 8007886: 4a21 ldr r2, [pc, #132] ; (800790c <_malloc_r+0xac>)
- 8007888: 6814 ldr r4, [r2, #0]
- 800788a: 4621 mov r1, r4
- 800788c: b991 cbnz r1, 80078b4 <_malloc_r+0x54>
- 800788e: 4c20 ldr r4, [pc, #128] ; (8007910 <_malloc_r+0xb0>)
- 8007890: 6823 ldr r3, [r4, #0]
- 8007892: b91b cbnz r3, 800789c <_malloc_r+0x3c>
- 8007894: 4630 mov r0, r6
- 8007896: f000 f863 bl 8007960 <_sbrk_r>
- 800789a: 6020 str r0, [r4, #0]
- 800789c: 4629 mov r1, r5
- 800789e: 4630 mov r0, r6
- 80078a0: f000 f85e bl 8007960 <_sbrk_r>
- 80078a4: 1c43 adds r3, r0, #1
- 80078a6: d124 bne.n 80078f2 <_malloc_r+0x92>
- 80078a8: 230c movs r3, #12
- 80078aa: 4630 mov r0, r6
- 80078ac: 6033 str r3, [r6, #0]
- 80078ae: f000 f868 bl 8007982 <__malloc_unlock>
- 80078b2: e7e4 b.n 800787e <_malloc_r+0x1e>
- 80078b4: 680b ldr r3, [r1, #0]
- 80078b6: 1b5b subs r3, r3, r5
- 80078b8: d418 bmi.n 80078ec <_malloc_r+0x8c>
- 80078ba: 2b0b cmp r3, #11
- 80078bc: d90f bls.n 80078de <_malloc_r+0x7e>
- 80078be: 600b str r3, [r1, #0]
- 80078c0: 18cc adds r4, r1, r3
- 80078c2: 50cd str r5, [r1, r3]
- 80078c4: 4630 mov r0, r6
- 80078c6: f000 f85c bl 8007982 <__malloc_unlock>
- 80078ca: f104 000b add.w r0, r4, #11
- 80078ce: 1d23 adds r3, r4, #4
- 80078d0: f020 0007 bic.w r0, r0, #7
- 80078d4: 1ac3 subs r3, r0, r3
- 80078d6: d0d3 beq.n 8007880 <_malloc_r+0x20>
- 80078d8: 425a negs r2, r3
- 80078da: 50e2 str r2, [r4, r3]
- 80078dc: e7d0 b.n 8007880 <_malloc_r+0x20>
- 80078de: 684b ldr r3, [r1, #4]
- 80078e0: 428c cmp r4, r1
- 80078e2: bf16 itet ne
- 80078e4: 6063 strne r3, [r4, #4]
- 80078e6: 6013 streq r3, [r2, #0]
- 80078e8: 460c movne r4, r1
- 80078ea: e7eb b.n 80078c4 <_malloc_r+0x64>
- 80078ec: 460c mov r4, r1
- 80078ee: 6849 ldr r1, [r1, #4]
- 80078f0: e7cc b.n 800788c <_malloc_r+0x2c>
- 80078f2: 1cc4 adds r4, r0, #3
- 80078f4: f024 0403 bic.w r4, r4, #3
- 80078f8: 42a0 cmp r0, r4
- 80078fa: d005 beq.n 8007908 <_malloc_r+0xa8>
- 80078fc: 1a21 subs r1, r4, r0
- 80078fe: 4630 mov r0, r6
- 8007900: f000 f82e bl 8007960 <_sbrk_r>
- 8007904: 3001 adds r0, #1
- 8007906: d0cf beq.n 80078a8 <_malloc_r+0x48>
- 8007908: 6025 str r5, [r4, #0]
- 800790a: e7db b.n 80078c4 <_malloc_r+0x64>
- 800790c: 200002e0 .word 0x200002e0
- 8007910: 200002e4 .word 0x200002e4
-
- 08007914 <_realloc_r>:
- 8007914: b5f8 push {r3, r4, r5, r6, r7, lr}
- 8007916: 4607 mov r7, r0
- 8007918: 4614 mov r4, r2
- 800791a: 460e mov r6, r1
- 800791c: b921 cbnz r1, 8007928 <_realloc_r+0x14>
- 800791e: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr}
- 8007922: 4611 mov r1, r2
- 8007924: f7ff bf9c b.w 8007860 <_malloc_r>
- 8007928: b922 cbnz r2, 8007934 <_realloc_r+0x20>
- 800792a: f7ff ff4d bl 80077c8 <_free_r>
- 800792e: 4625 mov r5, r4
- 8007930: 4628 mov r0, r5
- 8007932: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 8007934: f000 f826 bl 8007984 <_malloc_usable_size_r>
- 8007938: 42a0 cmp r0, r4
- 800793a: d20f bcs.n 800795c <_realloc_r+0x48>
- 800793c: 4621 mov r1, r4
- 800793e: 4638 mov r0, r7
- 8007940: f7ff ff8e bl 8007860 <_malloc_r>
- 8007944: 4605 mov r5, r0
- 8007946: 2800 cmp r0, #0
- 8007948: d0f2 beq.n 8007930 <_realloc_r+0x1c>
- 800794a: 4631 mov r1, r6
- 800794c: 4622 mov r2, r4
- 800794e: f7ff ff17 bl 8007780 <memcpy>
- 8007952: 4631 mov r1, r6
- 8007954: 4638 mov r0, r7
- 8007956: f7ff ff37 bl 80077c8 <_free_r>
- 800795a: e7e9 b.n 8007930 <_realloc_r+0x1c>
- 800795c: 4635 mov r5, r6
- 800795e: e7e7 b.n 8007930 <_realloc_r+0x1c>
-
- 08007960 <_sbrk_r>:
- 8007960: b538 push {r3, r4, r5, lr}
- 8007962: 2300 movs r3, #0
- 8007964: 4c05 ldr r4, [pc, #20] ; (800797c <_sbrk_r+0x1c>)
- 8007966: 4605 mov r5, r0
- 8007968: 4608 mov r0, r1
- 800796a: 6023 str r3, [r4, #0]
- 800796c: f7fa f9ae bl 8001ccc <_sbrk>
- 8007970: 1c43 adds r3, r0, #1
- 8007972: d102 bne.n 800797a <_sbrk_r+0x1a>
- 8007974: 6823 ldr r3, [r4, #0]
- 8007976: b103 cbz r3, 800797a <_sbrk_r+0x1a>
- 8007978: 602b str r3, [r5, #0]
- 800797a: bd38 pop {r3, r4, r5, pc}
- 800797c: 200044d8 .word 0x200044d8
-
- 08007980 <__malloc_lock>:
- 8007980: 4770 bx lr
-
- 08007982 <__malloc_unlock>:
- 8007982: 4770 bx lr
-
- 08007984 <_malloc_usable_size_r>:
- 8007984: f851 3c04 ldr.w r3, [r1, #-4]
- 8007988: 1f18 subs r0, r3, #4
- 800798a: 2b00 cmp r3, #0
- 800798c: bfbc itt lt
- 800798e: 580b ldrlt r3, [r1, r0]
- 8007990: 18c0 addlt r0, r0, r3
- 8007992: 4770 bx lr
-
- 08007994 <_init>:
- 8007994: b5f8 push {r3, r4, r5, r6, r7, lr}
- 8007996: bf00 nop
- 8007998: bcf8 pop {r3, r4, r5, r6, r7}
- 800799a: bc08 pop {r3}
- 800799c: 469e mov lr, r3
- 800799e: 4770 bx lr
-
- 080079a0 <_fini>:
- 80079a0: b5f8 push {r3, r4, r5, r6, r7, lr}
- 80079a2: bf00 nop
- 80079a4: bcf8 pop {r3, r4, r5, r6, r7}
- 80079a6: bc08 pop {r3}
- 80079a8: 469e mov lr, r3
- 80079aa: 4770 bx lr
|