28.12.2014 Views

uC/OS-II (Structure) - 경희대학교

uC/OS-II (Structure) - 경희대학교

uC/OS-II (Structure) - 경희대학교

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MicroC/<strong>OS</strong><br />

/<strong>OS</strong>-<strong>II</strong> Porting (Cont’d)<br />

• <strong>OS</strong>CtxSw()<br />

Task <br />

TRAP . ISR, TRAP <br />

<strong>OS</strong>CtxSw() .<br />

<strong>OS</strong>CtxSw() TaskTask <br />

MicroC/<strong>OS</strong>-<strong>II</strong> .<br />

Void <strong>OS</strong>CtxSw(void)<br />

{<br />

(1) ;<br />

(2) Task Task TCB <br />

<strong>OS</strong>TCBCur-><strong>OS</strong>TCBStkPtr = ;<br />

(3) <strong>OS</strong>TaskSwHook();<br />

(4) <strong>OS</strong>TCBCur = <strong>OS</strong>TCBHighRdy;<br />

(5) <strong>OS</strong>PrioCur = <strong>OS</strong>PrioHighRdy;<br />

(6) Task :<br />

= <strong>OS</strong>TCBHighRdy-><strong>OS</strong>TCBStkPtr;<br />

(7) Task ;<br />

(8) ;<br />

}<br />

Embedded System Lab. <strong>II</strong> 127

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!