有关ucosii中OSTCBY、OSTCBBitY、OSTCBX、OSTCBBitX的意义(我是菜鸟)
? INT8U OSTCBX; /* Bit position in group corresponding to task priority (0..7) */
? INT8U OSTCBY; /* Index into ready table corresponding to task priority */
? INT8U OSTCBBitX; /* Bit mask to access bit position in ready table */
? INT8U OSTCBBitY; /* Bit mask to access bit position in ready group */
最初是感覺很不理解,后來看了源碼后才知曉一點(diǎn)。
假設(shè)我們要?jiǎng)?chuàng)建一個(gè)優(yōu)先級(jí)別為prio的任務(wù),注意prio要在有效范圍內(nèi)。
? OSTCBY = prio>>3;
? OSTCBBitY = OSMapTbl[OSTCBY];
? OSTCBX = prio & 0x07;
? OSTCBBitX = OSMapTbl[OSTCBX];
在ucosii中,prio只用低六位來表示,在這低六位中,高三位用來設(shè)置OSRdyGrp,低三位用來設(shè)置OSRdyTbl[],
OSTCBY 表示的就是這里的高三位,OSTCBX表示的就是這里的低三位
總結(jié)
以上是生活随笔為你收集整理的有关ucosii中OSTCBY、OSTCBBitY、OSTCBX、OSTCBBitX的意义(我是菜鸟)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP系统管理mongodb,Mongo
- 下一篇: ucosii定时器