UCOS实验(第二版)(S3C2410)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

µC/OS-II.........................................................................................................................1.............................................................................................................................11.1µC/OS-II........................................................................................................................11.21.....................................................................................................................................21.32.....................................................................................................................................71.43...................................................................................................................................13µC/OS-II...............................................................................................................202.1µC/OS-II...............................................................................................................202.2µC/OS-II...................................................................................21µC/GUI.........................................................................................................................26µC/GUI....................................................................................................................261.1µC/GUI........................................................................................................................271.2µC/GUI.....................................................................................................281.3µC/GUI.................................................................................................................31µC/GUI.................................................................................................................352.1..................................................................................................................36.......................................................................................................................41µC/OS-II.......................................................................................................41µC/OS-II...........................................................................................43µC/OS-II...................................................................................................47µC/OS-II+µC/GUI...............................................................................................50-----1-----µC/OS-IIµC/OS-IIBorlandC/C++V3.1Intel/AMD80186IntelPentiumIIPC300MHzIntelPentiumIIPC80186PCPCEPROMEPROMBorlandC/C++80186IntelAMDCyrix80x86CPU1.1µC/OS-II80x86PentiumPentium-IIPCDOSWindows955MbµC/OS-IIµC/OS-IIµC/OSCDEREADME\SOFTWARE\SOFTWARE\BLOCKSµC/OS-IIPC\SOFTWARE\HPLISTCHPLISTHPLIST.C\SOFTWARE\HPLISTC\SOURCEDOSHPLIST.EXE\SOFTWARE\TO\EXE\SOFTWARE\TOTOTO.C\SOFTWARE\TO\SOURCEDOSTO.EXE\SOFTWARE\TO\EXETOTO.TBL\SOFTWARE\TO\EXETO.TBL-----2-----TO.EXETO.TBL\SOFTWARE\uCOS-IIµC/OS-II\SOFTWARE\uCOS-II\EX1_x86L1DOSWindows95DOS\SOFTWARE\uCOS-II\EX2_x86L2DOSWindows95DOS\SOFTWARE\uCOS-II\EX3_x86L3DOSWindows95DOS\SOFTWARE\uCOS-II\Ix86L80x86uC/OS-II\SOFTWARE\uCOS-II\SOURCE1.21\SOFTWARE\uCOS_II\EX1_x86L13(µC/OS-II)µC/OS-IICPU111TaskStart()main()CPUµC/OS-IITaskStart()ESCDOS10Task()0~901.EXEDOS1sDOS0~91.1-----3-----1.111.2.1main()1µC/OSUBYTE,UWORDµC/OS-IImain()DOS[1.1(1)]DOSµC/OS-IIOSInit()[1.1(2)]CPU1.1mainvoidmain(void){PC_DispClrScr(DISP_FGND_WHITE+DISP_BGND_BLACK);(1)OSInit();(2)PC_DOSSaveReturn();(3)PC_VectSet(uCOS,OSCtxSw);(4)RandomSem=OSSemCreate(1);(5)OSTaskCreate(TaskStart,(6)(void*)0,(void*)&TaskStartStk[TASK_STK_SIZE-1],0);OSStart();(7)}-----4-----DOSPC_DOSSaveReturn()[1.1(3)]µC/OS-IIDOS1.2PC_DOSSaveReturn()PC_DOSSaveReturn()PC_ExitFlagFALSE[1.2(1)]DOSOSTickDOSCtr1[1.2(2)]OSTickISR()0OSTickISR()1255PC_DOSSaveReturn()DOStickhandler[1.2(3)-(4)]µC/OS-IIPC_DOSSaveReturn()jmp[1.2(5)]PC_JumpBufPC_DOSSaveReturn()setjmpPC_ExitFlagFALSE[1.2(1)]PC_DOSSaveReturn()if[1.2(6)–(9)]mainDOSPC_DOSReturn()[1.3]PC_ExitFlagTRUElongjmp[1.3(2)]PC_DOSSaveReturn()[setjmp()][1.2(5)]PC_ExitFlagTRUEifPC_DOSSaveReturn()18.2Hz[1.2(6)]PC[1.2(7)][1.2(8)]exit(0)DOS[1.2(9)]1.2DOSvoidPC_DOSSaveReturn(void){PC_ExitFlag=FALSE;(1)OSTickDOSCtr=8;(2)PC_TickISR=PC_VectGet(VECT_TICK);(3)OS_ENTER_CRITICAL();PC_VectSet(VECT_DOS_CHAIN,PC_TickISR);(4)OS_EXIT_CRITICAL();Setjmp(PC_JumpBuf);(5)if(PC_ExitFlag==TRUE){OS_ENTER_CRITICAL();PC_SetTickRate(18);(6)PC_VectSet(VECT_TICK,PC_TickISR);(7)OS_EXIT_CRITICAL();PC_DispClrScr(DISP_FGND_WHITE+DISP_BGND_BLACK);(8)exit(0);(9)}}1.3DOSvoidPC_DOSReturn(void){PC_ExitFlag=TRUE;(1)longjmp(PC_JumpBuf,1);(2)-----5-----}main1.1mainPC_VectSet()µCOS-IICPUCPU80x86INT0x80128DOSBIOSBorlandC/C++[1.1(5)]1TaskStart()[1.1(6)]OSStart(),[1.1(7)]CPUµCOS-IIOSStatRdy[OSTimeDly()]TRUEµC/OS-IICPU1.2.2TaskStart()1TaskStart()TaskStart()1.4TaskStart()1µC/OS-IIDOS18.2Hz200Hz!main[1.1]µC/OS-II1.4voidTaskStart(void*data){Prevent

1 / 53
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功