資源描述:
《ucos-ii移植for 8051》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、ucos-ii移植for8051也可以跟我索要全部移植代碼,我將給你一個(gè)keil工程,你只需電擊一下編譯按扭,在軟件仿真運(yùn)行即可在串口1窗口里看到uCOS-II的風(fēng)采!(不需任何編程,當(dāng)然除了你以后要添加應(yīng)用任務(wù))注意不要將本移植代碼應(yīng)用于商業(yè)!!!如果那位大蝦,能更有好的建議,請(qǐng)跟我聯(lián)系,不勝感激!//--我們的技術(shù)是你的!www.icwin.netQQ:75011221呢稱:電子牛EMAIL:niuyimail@126.comOS_CPU_C.C/****************************************************
2、*******************************************************INITIALIZEATASK'SSTACK**Description:ThisfunctioniscalledbyeitherOSTaskCreate()orOSTaskCreateExt()toinitializethe*stackframeofthetaskbeingcreated.Thisfunctionishighlyprocessorspecific.**Arguments:taskisapointertothetaskcode**o
3、s_pdataisapointertoausersupplieddataareathatwillbepassedtothetask*whenthetaskfirstexecutes.**ptosisapointertothetopofstack.Itisassumedthat'ptos'pointsto*a'free'entryonthetaskstack.IfOS_STK_GROWTHissetto1then*'ptos'willcontaintheHIGHESTvalidaddressofthestack.Similarly,if*OS_STK_GR
4、OWTHissetto0,the'ptos'willcontainstheLOWESTvalidaddress*ofthestack.**optspecifiesoptionsthatcanbeusedtoalterthebehaviorofOSTaskStkInit().*(seeuCOS_II.HforOS_TASK_OPT_???).**Returns:Alwaysreturnsthelocationofthenewtop-of-stack'oncetheprocessorregistershave*beenplacedonthestackinth
5、eproperorder.**Note(s):Interruptsareenabledwhenyourtaskstartsexecuting.Youcanchangethisbysettingthe*PSWto0x0002instead.Inthiscase,interruptswouldbedisabledupontaskstartup.The*applicationcodewouldberesponsibleforenablinginterruptsatthebeginningofthetask*code.YouwillneedtomodifyOST
6、askIdle()andOSTaskStat()sothattheyenable*interrupts.Failuretodothiswillmakeyoursystemcrash!**********************************************************************************************************//*at89c55wdPDL(spformLOWtoHIGH):(堆棧指針?biāo)傅臈m敂?shù)據(jù)為有效數(shù)據(jù))裝入堆棧指針ptos到stkstk-->入棧:task底高(高
7、內(nèi)存)入
8、
9、入棧:ACC棧
10、
11、入棧:B順
12、
13、入棧:DPH//暫時(shí)忽略第二指針序
14、
15、入棧:DPL
16、/
17、入棧:PSW
18、
19、入棧:R7-R4
20、______
21、入棧:os_pdata(R3,R2,R1)用寄存器傳遞os_pdata入棧:R0(底內(nèi)存)//入棧:DPS??//雙數(shù)據(jù)指針選擇寄存器??//入棧:PC自己應(yīng)該參照編譯器定義入棧/出棧順序,寫出來備以后查閱*/OS_STK*OSTaskStkInit(void(*task)(void*pd)LG_REENTRANT,void*os_pdata,OS_STK*ptos,INT16Uopt)LG_REENTRA
22、NT{//INT16U*stk;OS_STK*stk;opt=opt;/*'op