




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
V2.86
(2007/09/12)
Thisisamajorreleaseasitcontainsanewfeaturecalled‘Multi-Pend’(implementedinOSEventPendMulti())whichallowsatasktopendonmultipleobjects(semaphores,mailboxesorqueues).Ifanyoneofthoseobjectsispostedto,thefunctionreturnsandindicateswhich(orall)eventsposted.
Multi-pendistheonlyfeatureaddedinthisversionandanumberofchangesthroughoutthecodehasbeenimplementedinordertosupportthisnewfeature.
DetailsonhowtouseOSEventPendMulti()canbefoundintheμC/OS-IIreferencemanual.
UPGRADINGTOV2.86
YoushouldfollowthesestepsinordertoupgradefromapreviousversiontoV2.86.EventhoughonlyMulti-PendwasaddedinV2.86,someoftheitemsbelowarerepeatedfrompreviousversionsbecausetheyareimportanttofollow.
1)
TimerManager:
TimersMUSTnowbecreatedbyOSTmrCreate()beforetheycanbeused.InV2.82,atimerwascreatedandstartedwhenyoucalledOSTmrStart().NowyouMUSTcallOSTmrCreate()andthenOSTmrStart()tocreateandstartthetimer,respectively.
Itisnowyourresponsibilitytodeleteatimerwhenitisnolongerbeingused.
TheTimerManageruser-availablefunctionsarenow:
OSTmrCreate()OSTmrDel()OSTmrNameGet()OSTmrRemainGet()OSTmrStart()OSTmrStop()
Tocreateandstartatimer,youneedtocallOSTmrCreate()
andthen
OSTmrStart().Whenyouaredoneusingatimer,youcandeleteitbycalling
OSTmrDel().
2of84
2)
TRUEandFALSEchangedtoOS_TRUEandOS_FALSE:
μC/OS-IInowusesandreturnsOS_TRUEandOS_FALSEinsteadofTRUEandFALSE.IfyouwereusingTRUEandFALSEinyourapplicationyouwilleitherneedtodefineTRUEandFALSEyourselforchangethosetoOS_TRUEandOS_FALSE.
3)
CreateAPP_CFG.H:
AsofV2.81,youneedtocreateafilecalledAPP_CFG.Hwhichwouldresideinyourproject.APP_CFG.Hisusedtoholdconfigurationinformationaboutyourproject.Specifically,weexpectthatyouplacetaskpriorities,taskstacksizesandotherapplicationrelatedconfigurationinformation.ThefollowingpageshowsanexampleofthecontentsofAPP_CFG.H.
4)
IncludeOS_TMR.Cinyourproject:
AsofV2.81,youneedtoincludeOS_TMR.CinyourbuildsinordertoobtainthenewservicesprovidedinOS_TMR.Candavoidcompilerwarnings/errors.
5)
New#definesareneededinOS_CFG.H:
Youwillneedtoincludethefollowing#defines(theyarefoundinOS_CFG_R.H,thereferencefileforOS_CFG.H).Seealsotheconfigurationmanual:
OS_APP_HOOKS_EN
OS_EVENT_MULTI_EN
OS_TMR_ENOS_TMR_CFG_MAXOS_TMR_CFG_NAME_SIZEOS_TMR_CFG_WHEEL_SIZEOS_TMR_CFG_WHEEL_SIZE
OS_MBOX_PEND_ABORT_ENOS_Q_PEND_ABORT_ENOS_SEM_PEND_ABORT_EN
6)
AddOS_TASK_TMR_STK_SIZE:
Ifyouusethetimermanager,youwillneedtodefinethesizeofthetimertask
stack,i.e.OS_TASK_TMR_STK_SIZE.OS_CFG.H.
Thisisdeclaredinyourproject’s
7)
AddOS_TASK_TMR_PRIO:
Ifyouusethetimermanager,youwillneedtodefinethepriorityofthetimermanagertask,i.e.OS_TASK_TMR_PRIO.Thisisdeclaredinyourproject’sAPP_CFG.H.
3of84
8)
PlaceprototypesinOS_CPU.H:
AsofV2.81,it’sIMPORTANTthatyouplacetheprototypesforOSCtxSw(),OSIntCtxSw()andOSStartHighRdy()inOS_CPU.H.Typically,thesefunctionswouldbeprototypedasfollowsbut,dependingonthecompiler,theymayneedtobedifferent:
voidvoidvoid
OSStartHighRdy(void);OSIntCtxSw(void);OSCtxSw(void);
9)
StartusingOS_ERR_???aserrorreturnvalues:
Werecommendthatyoustartusingthenew#defineconstantsforerrorreturnvalues.AllerrorreturnvaluesstartwithOS_ERR_forconsistency.
10)
OS????NameGet()andOS????NameSet()notcallablefromISRs:
SinceOS????NameGet()andOS????NameSet()cannolongerbecalledfromISRs,makesureyourcodedidn’tmakeuseofthoseinISRs.
11)
OSMutexAccept()returnsaBOOLEAN:
now
returns
a
make
sure
you
change
SinceOSMutexAccept()
yourcodeaccordingly.
BOOLEAN
4of84
CHANGESINV2.86
os_core.c
OSEventPendMulti()wasadded.
OptimizedOS_EventTaskRdy()andaddedsupportformulti-pend.
OptimizedOS_EventTaskWait().
RemovedOS_EventTOAbort()andaddedOS_EventTaskWaitMulti(),OS_EventTaskRemove()andOS_EventTaskRemoveMulti().
OptimizedOS_TaskStat().
os_mbox.c
RearrangedOSMboxPend()tosupportmulti-pend.
os_mutex.c
RearrangedOSMutexPend()forconsistency.
os_q.c
RearrangedOSQPend()tosupportmulti-pend.
os_sem.c
RearrangedOSSemPend()tosupportmulti-pend.
os_task.c
MadecosmeticchangestoOSTaskChangePrio()
multi-pend.
andaddedsupport
for
Addedsupportformulti-pendinOSTaskDel().
ucos_ii.h
Addedsupportformulti-pend.
5of84
V2.85
(2007/06/15)
Inthisrelease,wemadesomeminorchangesandaresummarizedbelow:
AddedOS_APP_HOOKS_ENinOS_CFG.HtoallowμC/OS-IItocallapplicationdefinehookfunctions.
msgwaschangedtopmsg.
errwaschangedtoperr.
OS????NameGet()andOS????NameSet()cannolongerbecalledfromISRs
OSTimeDly()andOSTimeDlyHMSM()nowcontaincheckstopreventthemfrombeingcalledfromanISR.
OSMutexAccept()nowreturnsaBOOLEANinsteadofanINT8U.
Hookfunctionsinportfilesnowshouldcallapplicationspecifichooks.
Addednewerrorcodes.
6of84
CHANGESINV2.85
ALL
WeremovedallchecksforOS_VERSIONinthecode.ThereasonisthatyoushouldactuallyupgradeyourapplicationwhenyouupgradeyourversionofμC/OS-
II.TheextrachecksforOS_VERSIONcreated‘pollution’inthecodewhichwasnotdeemednecessary.
Replacedthe‘magicnumber’(OS_TCB*)1toOS_TCB_RESERVEDwhenreservingaTCB.
msgwaschangedtopmsg.errwaschangedtoperrtoreflectthatthesearepointers.
os_core.c
OSEventNameGet()andOSEventNameSet()cannolongerbecalledfromanISR.ThereasonistokeepISRsasshortaspossible.GettingandsettingASCIInamesisperformedthroughloopsandcouldincreaseISRtimes.ThischangeshouldnotcausebackwardscompatibilityissuessincenamesforOS
objectsaretypicallysetoncewhentheobjectiscreated.
Ifyoucall
OSEventNameGet()fromanISR,thefunctionwillnotbeperformedandyou
will
get
an
OS_ERR_NAME_GET_ISR
error
code.
If
you
call
OSEventNameSet()fromanISR,thefunctionwillnotbeperformedandyouwillgetanOS_ERR_NAME_SET_ISRerrorcode.
os_flag.c
OSFlagNameGet()andOSFlagNameSet()cannolongerbecalledfromanISR.ThereasonistokeepISRsasshortaspossible.GettingandsettingASCIInamesisperformedthroughloopsandcouldincreaseISRtimes.ThischangeshouldnotcausebackwardscompatibilityissuessincenamesforOSobjectsaretypicallysetoncewhentheobjectiscreated.IfyoucallOSFlagNameGet()fromanISR,thefunctionwillnotbeperformedandyouwillgetanOS_ERR_NAME_GET_ISRerrorcode.IfyoucallOSFlagNameSet()fromanISR,thefunctionwillnotbeperformedandyouwillgetanOS_ERR_NAME_SET_ISRerrorcode.
os_mem.c
InOSMemCreate()wenolongerrequirethatamemoryblockbeamultipleofapointersize.However,westillrequirethatamemoryblockcontainsstorageforatleastonepointer.
OSMemNameGet()andOSMemNameSet()cannolongerbecalledfromanISR.ThereasonistokeepISRsasshortaspossible.GettingandsettingASCIInamesisperformedthroughloopsandcouldincreaseISRtimes.Thischange
7of84
shouldnotcausebackwardscompatibilityissuessincenamesforOSobjectsaretypicallysetoncewhentheobjectiscreated.IfyoucallOSMemNameGet()fromanISR,thefunctionwillnotbeperformedandyouwillgetanOS_ERR_NAME_GET_ISRerrorcode.IfyoucallOSMemNameSet()froman
ISR,
the
function
will
not
be performed
and
you
will
get
an
OS_ERR_NAME_SET_ISRerrorcode.
os_mutex.c
WenowcastOS_MUTEX_KEEP_LOWER_8,OS_MUTEX_KEEP_UPPER_8and
OS_MUTEX_MUTEX_AVAILABLEto(INT16U)topreventcompilerwarnings.
OSMutexAccept()nowreturnsOS_TRUEorOS_FALSEbasedonwhethertheresourcewasavailableornot,respectively.
OSMutexQuery()nowsetsthe.OSValuefieldtoOS_TRUEorOS_FALSE
basedonwhethertheresourcewasavailableornot,respectively.
os_task.c
OSTaskNameGet()andOSTaskNameSet()cannolongerbecalledfromanISR.ThereasonistokeepISRsasshortaspossible.GettingandsettingASCIInamesisperformedthroughloopsandcouldincreaseISRtimes.ThischangeshouldnotcausebackwardscompatibilityissuessincenamesforOSobjectsaretypicallysetoncewhentheobjectiscreated.IfyoucallOSTaskNameGet()fromanISR,thefunctionwillnotbeperformedandyouwillgetanOS_ERR_NAME_GET_ISRerrorcode.IfyoucallOSTaskNameSet()fromanISR,thefunctionwillnotbeperformedandyouwillgetanOS_ERR_NAME_SET_ISRerrorcode.
os_time.c
EventhoughOSTimeDly()andOSTimeDlyHMSM()shouldneverhavebeencalledfromISRs,therewerenocheckstothateffect.ThishasbeencorrectedandwenowcheckthatOSIntNestingis0inordertoallowthisfunctiontoexecute.IfcalledfromanISR,OSTimeDlyHMSM()willreturnanerrorcodeofOS_ERR_TIME_DLY_ISR.
os_tmr.c
OSTmrNameGet()cannolongerbecalledfromanISR.ThereasonistokeepISRsasshortaspossible.GettingandsettingASCIInamesisperformedthroughloopsandcouldincreaseISRtimes.ThischangeshouldnotcausebackwardscompatibilityissuessincenamesforOSobjectsaretypicallysetoncewhentheobjectiscreated.IfyoucallOSTaskNameGet()fromanISR,thefunctionwillnotbeperformedandyouwillgetanOS_ERR_NAME_GET_ISRerrorcode.
8of84
OSTmrStop()nowreturnsOS_TRUEwhenthetimerisstoppedevenifyoupassedaninvalid‘opt’argumentorweusedthecallbackargumentspecifiedinthecall.Inotherwords,ifwestopthetimer,wereturnOS_TRUE.
ucos_ii.h
AddedOS_ERR_???#defineconstantsforconsistency.
Use…
OS_ERR_NONEOS_ERR_TIMEOUTOS_ERR_TASK_NOT_EXISTOS_ERR_NAME_GET_ISROS_ERR_NAME_SET_ISROS_ERR_MBOX_FULLOS_ERR_Q_FULLOS_ERR_Q_EMPTYOS_ERR_PRIO_EXISTOS_ERR_PRIOOS_ERR_PRIO_INVALIDOS_ERR_SEM_OVFOS_ERR_TASK_DELOS_ERR_TASK_DEL_IDLEOS_ERR_TASK_DEL_REQOS_ERR_TASK_DEL_ISROS_ERR_NO_MORE_TCBOS_ERR_TIME_NOT_DLY
OS_ERR_TIME_INVALID_MINUTESOS_ERR_TIME_INVALID_SECONDSOS_ERR_TIME_INVALID_MSOS_ERR_TIME_ZERO_DLYOS_ERR_TIME_DLY_ISROS_ERR_TASK_SUSPEND_PRIOOS_ERR_TASK_SUSPEND_IDLEOS_ERR_TASK_RESUME_PRIOOS_ERR_TASK_NOT_SUSPENDEDOS_ERR_MEM_INVALID_PARTOS_ERR_MEM_INVALID_BLKSOS_ERR_MEM_INVALID_SIZEOS_ERR_MEM_NO_FREE_BLKSOS_ERR_MEM_FULLOS_ERR_MEM_INVALID_PBLKOS_ERR_MEM_INVALID_PMEMOS_ERR_MEM_INVALID_PDATAOS_ERR_MEM_INVALID_ADDROS_ERR_MEM_NAME_TOO_LONGOS_ERR_TASK_OPTOS_ERR_FLAG_INVALID_PGRPOS_ERR_FLAG_WAIT_TYPEOS_ERR_FLAG_NOT_RDYOS_ERR_FLAG_INVALID_OPTOS_ERR_FLAG_GRP_DEPLETED
Insteadof…
OS_NO_ERROS_TIMEOUTOS_TASK_NOT_EXIST
Value
0
10
11
17
18
20
30
31
40
41
42
50
60
61
62
63
70
80
81
82
83
84
85
90
91
100
101
110
111
112
113
114
115
116
117
118
119
130
150
151
152
153
154
OS_MBOX_FULLOS_Q_FULLOS_Q_EMPTYOS_PRIO_EXISTOS_PRIO_ERROS_PRIO_INVALIDOS_SEM_OVFOS_TASK_DEL_ERROS_TASK_DEL_IDLEOS_TASK_DEL_REQOS_TASK_DEL_ISROS_NO_MORE_TCBOS_TIME_NOT_DLY
OS_TIME_INVALID_MINUTESOS_TIME_INVALID_SECONDSOS_ERR_TIME_INVALID_MSOS_ERR_TIME_ZERO_DLY
OS_ERR_TASK_SUSPEND_PRIOOS_ERR_TASK_SUSPEND_IDLEOS_ERR_TASK_RESUME_PRIOOS_ERR_TASK_NOT_SUSPENDEDOS_ERR_MEM_INVALID_PARTOS_ERR_MEM_INVALID_BLKSOS_ERR_MEM_INVALID_SIZEOS_ERR_MEM_NO_FREE_BLKSOS_ERR_MEM_FULLOS_ERR_MEM_INVALID_PBLKOS_ERR_MEM_INVALID_PMEMOS_ERR_MEM_INVALID_PDATAOS_ERR_MEM_INVALID_ADDROS_ERR_MEM_NAME_TOO_LONGOS_ERR_TASK_OPTOS_ERR_FLAG_INVALID_PGRPOS_ERR_FLAG_WAIT_TYPEOS_ERR_FLAG_NOT_RDYOS_ERR_FLAG_INVALID_OPTOS_ERR_FLAG_GRP_DEPLETED
The.OSValuefieldofOS_MUTEX_DATAisnowaBOOLEANINT8U.
insteadofan
OSMutexAccept()nowreturnsaBOOLEAN.
9of84
Hookfunctionshavebeenchangedintheportsasfollows.Inotherwords,wenowassumethathookfunctionsaredeclaredinapplicationcodeINSTEADofportcode.
HooksarethusenabledwhenOS_APP_HOOKS_EN
>0inOS_CFG.H.
Addeda‘SAFETYCRITICALUSE’sectionto
detectconfigurationissues
whenperformingsafetycriticaltests.isthusharmless.
Thissectiondoesnotgenerateanycodeand
10of84
InHook…
ChangedFrom…
To…
OSTaskCreateHook()
OSView_TaskCreateHook()
App_TaskCreateHook()
OSTaskDelHook()
App_TaskDelHook()
OSTaskIdleHook()
App_TaskIdleHook()
OSTaskStatHook()
App_TaskStatHook()
OSTaskSwHook()
OSView_TaskSwHook()
App_TaskSwHook()
OSTCBInitHook()
App_TCBInitHook()
OSTimeTickHook()
OSView_TickHook()
App_TimeTickHook()
V2.84
(2007/01/31)
Inthisrelease,weaddednewfunctionalitytoMailbox,QueueandSemaphoremanagement.
Wealsoaddednew#defineconstantsforerrorreturnvalues.Forexample,youcannowuseOS_ERR_TIMEOUTinsteadofOS_TIMEOUT.Infact,weaddedOS_ERR_???forconsistencyandyoushouldnowalwaysuseOS_ERR_???whencheckingforerror
codes.
Notethatyoucanstillusetheprevious#definevaluessincethosewerekeptfor
backwardscompatibility.However,wemightremovethoseisafutureversion.
FIXEDBUGSINV2.83
os_task.c
CorrectedasubtlebuginOSTaskChangePrio().Wenowcheckifaneventcontrolblockexistafterreadyingataskatthenewpriority.
os_tmr.c
OSTmr_Unlock()wasmissinginacoupleofplacesinOSTmrStop().
11of84
CHANGESINV2.84
os_core.c
WearenowlockingtheschedulerwheninOSTimeTick()insteadofdisablinginterrupts.Thisreducesinterruptlatencywhenthisfunctioniscalled.
ucos_ii.h
AddedOS_ERR_???#defineconstantsforconsistency.ItturnsoutthatnotallerrorreturnvaluesstartedwiththeprefixOS_ERR_.Tocorrectthis,new#defineconstantshavebeenadded.It’shighlyrecommendedthatyoustartusingthenewOS_ERR_???errorcodesinsteadoftheirpreviouscounterparts,seetablebelow.
Use…
OS_ERR_NONEOS_ERR_TIMEOUTOS_ERR_TASK_NOT_EXISTOS_ERR_MBOX_FULLOS_ERR_Q_FULLOS_ERR_Q_EMPTYOS_ERR_PRIO_EXISTOS_ERR_PRIOOS_ERR_PRIO_INVALIDOS_ERR_SEM_OVFOS_ERR_TASK_DELOS_ERR_TASK_DEL_IDLEOS_ERR_TASK_DEL_REQOS_ERR_TASK_DEL_ISROS_ERR_NO_MORE_TCBOS_ERR_TIME_NOT_DLY
OS_ERR_TIME_INVALID_MINUTESOS_ERR_TIME_INVALID_SECONDSOS_ERR_TIME_INVALID_MSOS_ERR_TIME_ZERO_DLYOS_ERR_TASK_SUSPEND_PRIOOS_ERR_TASK_SUSPEND_IDLEOS_ERR_TASK_RESUME_PRIOOS_ERR_TASK_NOT_SUSPENDEDOS_ERR_MEM_INVALID_PARTOS_ERR_MEM_INVALID_BLKSOS_ERR_MEM_INVALID_SIZEOS_ERR_MEM_NO_FREE_BLKSOS_ERR_MEM_FULLOS_ERR_MEM_INVALID_PBLKOS_ERR_MEM_INVALID_PMEMOS_ERR_MEM_INVALID_PDATAOS_ERR_MEM_INVALID_ADDROS_ERR_MEM_NAME_TOO_LONGOS_ERR_TASK_OPTOS_ERR_FLAG_INVALID_PGRPOS_ERR_FLAG_WAIT_TYPEOS_ERR_FLAG_NOT_RDYOS_ERR_FLAG_INVALID_OPTOS_ERR_FLAG_GRP_DEPLETED
Insteadof…
OS_NO_ERROS_TIMEOUTOS_TASK_NOT_EXISTOS_MBOX_FULLOS_Q_FULLOS_Q_EMPTYOS_PRIO_EXISTOS_PRIO_ERROS_PRIO_INVALIDOS_SEM_OVFOS_TASK_DEL_ERROS_TASK_DEL_IDLEOS_TASK_DEL_REQOS_TASK_DEL_ISROS_NO_MORE_TCBOS_TIME_NOT_DLY
OS_TIME_INVALID_MINUTESOS_TIME_INVALID_SECONDSOS_ERR_TIME_INVALID_MSOS_ERR_TIME_ZERO_DLYOS_ERR_TASK_SUSPEND_PRIOOS_ERR_TASK_SUSPEND_IDLEOS_ERR_TASK_RESUME_PRIOOS_ERR_TASK_NOT_SUSPENDEDOS_ERR_MEM_INVALID_PARTOS_ERR_MEM_INVALID_BLKSOS_ERR_MEM_INVALID_SIZEOS_ERR_MEM_NO_FREE_BLKSOS_ERR_MEM_FULLOS_ERR_MEM_INVALID_PBLKOS_ERR_MEM_INVALID_PMEMOS_ERR_MEM_INVALID_PDATAOS_ERR_MEM_INVALID_ADDROS_ERR_MEM_NAME_TOO_LONGOS_ERR_TASK_OPTOS_ERR_FLAG_INVALID_PGRPOS_ERR_FLAG_WAIT_TYPEOS_ERR_FLAG_NOT_RDYOS_ERR_FLAG_INVALID_OPTOS_ERR_FLAG_GRP_DEPLETED
Value
0
10
11
20
30
31
40
41
42
50
60
61
62
63
70
80
81
82
83
84
90
91
100
101
110
111
112
113
114
115
116
117
118
119
130
150
151
152
153
154
12of84
V2.83
(2006/06/02)
Inthisrelease,wemadesignificantchangestothetimermanagermodule.PleaseconsulttheReferenceManualforthenewAPIsoffunctionsOSTmrCreate(),OSTmrDel(),OSTmrStop()andOSTmrStart().
FIXEDBUGSINV2.82
os_tmr.c
YoucouldnotcallOSTmrNameGet()andOSTmrRemainGet()whenatimerwasinone-shotmodeandthetimerexpiredbecausethetimerwasautomaticallydeleted.Thishasnowbeenfixedbecausetimersarecreatedanddeletedbytheuser.
CHANGESINV2.83
os_tmr.c
Whenatimertimesout,itwillnolongerbedeleted.Inotherwords,itisnowyourresponsibilitytodeleteunusedtimers.
OSTmrStop()nolongerdeletesthetimer.
YoucannowsafelycallOSTmrRemainGet()
andOSTmrNameGet()
wheneveratimeriscreateduntilitgetsdeleted.InV2.81andV2.82,youcouldnotusethesefunctionswhenatimerwasconfiguredinone-shotmode.
WeaddedanentryintheOS_TMRdatastructuretoallowustoverifythatyouarepassingapointertoanOS_TMRstructurewhenyoucalltimermanagerservices.
OSTmrStart()nowONLYstarts(orrestarts)atimeranddoesNOTcreateatimer.Atimermustnowbecreatedbeforeitcanbestarted.
YoumustcallOSTmrDel()todeleteanyunusedtimers.
AddedOSTmrStateGet()whichreturnsthestateofatimer.
13of84
V2.82
(2006/03/24)
Thisisaminorrelease.
However,wechangethenameoftwo(2)APIcalls:
OSTmrGetName(),OSTmrStart().
OSTmrGetRemain()
and,
we added
an argument
to
FIXEDBUGSINV2.81
FixedanerrorinOSMutexDel()(seeOS_MUTEX.Cbelow).
CHANGESINV2.82
Miscellaneous:
ChangedTRUEandFALSEtoOS_TRUEandOS_FALSE.μC/OS-IIshouldnotbedictatingthevalueofTRUEandFALSE.
os_dbg_r.c
Addednewconstantstomonitorthesizeofsomevariablesanddatastructures,specificallyrelatedtothenewTimermanagementmoduleintroducedinV2.81.
os_flag.c
AddedacheckinOSFlagPend()toensurethatthisfunctionisnotcalledfromanISR.Notethatthedocumentationclearlywarnedaboutthisbut,weaddedthecodejusttobesure.
os_mbox.c
AddedacheckinOSMboxPend()toensurethatthisfunctionisnotcalledfromanISR.Notethatthedocumentationclearlywarnedaboutthisbut,weaddedthecodejusttobesure.
In
OSMboxPostOpt() we
added
a
new option
called
OS_POST_OPT_NO_SCHEDwhich,whenset,indicatesthatyoudonotwant
OSMboxPostOpt()tocalltheschedulerwhenyouhavecompletedthepost.
os_mutex.c
AddedacheckinOSMutexDel()andtheOS_DEL_ALWAYScasetomaketheownerofthemutexready-to-run(iftherewasanowner).BecauseofsomecodesimilaritiesfoundinOSMutexPost(),wecreatedthelocalfunctioncalled
14of84
OSMutex_RdyAtPrio()toperformthisoperationandthusnotincreasethecodebytoomuch.
AddedacheckinOSMutexPend()toensurethatthisfunctionisnotcalledfromanISR.Notethatthedocumentationclearlywarnedaboutthisbut,weaddedthecodejusttobesure.
os_q.c
AddedacheckinOSQPend()toensurethatthisfunctionisnotcalledfromanISR.Notethatthedocumentationclearlywarnedaboutthisbut,weaddedthecodejusttobesure.
InOSQPostOpt()weaddedanewoptioncalledOS_POST_OPT_NO_SCHEDwhich,whenset,indicatesthatyoudonotwantOSQPostOpt()tocalltheschedulerwhenyouhavecompletedthepost.
os_sem.c
AddedacheckinOSSemPend()toensurethatthisfunctionisnotcalledfromanISR.Notethatthedocumentationclearlywarnedaboutthisbut,weaddedthecodejusttobesure.
os_tmr.c
ChangedthenameofOSTmrGetName()toOSTmrNameGet()tobeconsistentwithothersimilarservices.
ChangedthenameofOSTmrGetRemain()toOSTmrRemainGet()tobeconsistentwithothersimilarservices.
Addedanargument(dly)toOSTmrStart().This,ofcourse,willmakethecompilerissueanerrorifyoupreviouslyusedthetimermanagerinV2.81.Theargumentspecifiesaninitialdelaybeforethetimerentersperiodicmode(seedrawingbelow).IfyousetthedlytothesamevalueastheperiodthenyouwillobtainthesameresultasinV2.81.Ifyouspecifyadlyof0,periodwillbeusedastheinitialdelay:
dly
period
Time
OSTmrStart()
Called
15of84
ucos_ii.h
AddedOS_POST_OPT_NO_SCHEDanditsvalueis0x04.
Added.OSTmrDlyintheOS_TMRdatastructure
16of84
V2.81
(2005/09/06)
μC/OS-IInowprovidessupportforperiodicaswellasone-shottimers.
This
functionalityisfoundinOS_TMR.C. Formoreinformationaboutthisnewfeature,consultthe“NewFeaturesandServicessinceV2.00”document.
FIXEDBUGSINV2.80
Fixedanumberoferrorsintroducedwhenweincreasedthenumberoftaskto255.
CHANGESINV2.81
os_cfg.h(seetemplateinos_cfg_r.h)
Re-arrangedtheorderof#definesinthisfile.
Addedanumberof#defineconstantstosupporttimermanagement:
OS_ISR_PROTO_EXT
OS_TMR_ENOS_TMR_CFG_MAXOS_TMR_CFG_WHEEL_SIZEOS_TMR_CFG_NAME_SIZE
OS_TMR_CFG_TICKS_PER_SECOS_TASK_TMR_STK_SIZE
os_core.c
AddedcalltoOSTmr_Init().
ucos_ii.h
AddedOS_TASK_TMR_IDanditsvalueis65533.
ChangedOS_IDLE_PRIOtoOS_TASK_IDLE_PRIO
ChangedOS_STAT_PRIOtoOS_TASK_STAT_PRIO
AddedOS_ERR_TMR_???andOS_TMR_OPT_???.
17of84
AddedtheOS_TMR,OS_TMR_WHEELandneededtosupporttimermanagement.
OS_TMR_CALLBACK
data
types
18of84
V2.80
(2005/03/21)
ThisisabigreleasebecauseμC/OS-IInowsupportsupto255tasks.
WealsomadeanumberofminorchangesrelatedtoMISRACrules.
Tosupportupto255tasks,wesimplyincreasedthereadylistandeventwaitliststoamatrixof16x16insteadof8x8.Infact,theactualsizeofthematrixdependsonthevalueofOS_LOWEST_PRIOinOS_CFG.H.IfOS_LOWEST_PRIOislessthanorequalto63,weusean8x8matrixandthusμC/OS-IIbehavesexactlythesameasitusedto.Ifyou
specifyavalueforOS_LOWEST_PRIO
showbelow.
tobegreaterthan63,weusethe16x16matrixas
HPT(0)
15
0
0
HPT(0)
7
0
0
7
OSRdyGrp
OSRdyTbl[]8x8Max.
15
OSRdyGrp
LPT(63)
OSRdyTbl[]16x16Max.
LPT(254)
NEVERused,OS_PRIO_SELF
OS_LOWEST_PRIO<=63
OS_LOWEST_PRIO>63
YoushouldnotethattheactualsizeofthematrixdependsonOS_LOWEST_PRIO.Forexample,ifOS_LOWEST_PRIOis10thenthematrixisactually2x8(twobytesof8bits).Similarly,ifOS_LOWEST_PRIOissetto47,thematrixwillbe6x8.WhenOS_LOWEST_PRIOisabove63,weuse16-bitwideentries.Forexample,ifyouspecifyOS_LOWEST_PRIOtobe100thenthematrixwillbe7x16(7entriesof16bitseach).YouCANNOThaveOS_LOWEST_PRIOat255becausethatvalueisreservedforOS_PRIO_SELF.
19of84
FIXEDBUGSINV2.77
NobugswerereportedinV2.77.
CHANGESINV2.80
OS_CFG.H(seetemplateinOS_CFG_R.H)
OS_LOWEST_PRIOinOS_CFG.Hcannowbeupto254thussupportingupto
255tasks(includingtheidletask).
Younowneedtoaddthe#defineOS_FLAGS_NBITSwhichMUSTbeeither8,16or32.This#definedefinesthenumberofbitsusedforeventflags.
WeREMOVEDthetypedefinitionofOS_FLAGSandthus,youwillalsohavetoremoveitinyourOS_CFG.Hfile.
OS_CORE.C
WeremovedtheOSMapTbl[]andreplaceditsuseinthecodewitha1<<n
operation.
AddedanewfunctioncalledOS_SchedNew()tofindthenewhighestpriority
taskready-to-run.
Inother
words,thisfunctiondeterminesthevalueofthe
OS_SchedNew()iscalledbyOS_Sched(),
variableOSPrioHighRdy.
OSIntExit()andOSStart().
ucos_ii.h
Movedthe#defineOS_VERSIONbeforethe#includestatementsofOS_CFG.HandOS_CPU.HtoallowthesefilestohavedefinitionsbasedonwhichversionofμC/OS-II.
Added
to
allow
this
to
be used
in
OS_TASK_OPT_NONE
OSTaskCreateExt()insteadof0.
GENERAL
FunctionsthatusedcharnowuseINT8UtosatisfyoneoftheMISRACrules.
20of84
V2.77
(2004/11/29)
ThisreleasecorrectsanumberofveryminorissueswithV2.76.
FIXEDBUGSINV2.76
BugV2.76-001:
Therewereanumberoftyposandincorrectcommentsthatwerefixed.
CHANGESINV2.77
V2.77addsafewminorenhancementstoV2.76.werecritical.
However,noneoftheseenhancements
21of84
IMPORTANT
TheprototypesforOSStartHighRdy(),OSCtxSw()andOSIntCtxSw()areNOWassumedtobeplacedinOS_CPU.Hsincetheyhavebeenremovedfromucos_ii.h.Thereasonthiswasdonewastoallowdifferentdeclarationsforthesefunctions.Forexample,withtheIARARMcompiler,thesefunctionsaredeclaredasfollows:
armvoidOSStartHighRdy(void);
armvoidOSCtxSw(void);
armvoidOSIntCtxSw(void);
The‘standard’declarationsshouldbe:
voidOSStartHighRdy(void);voidOSCtxSw(void);
voidOSIntCtxSw(void);
PleaseaddtheseprototypesinYOURos_cpu.hfile.
OS_CFG.H
WenowexpectthepresenceofOS_VIEW_MODULEinyourOSconfigurationfile.This
issuchthatyoucanmoreeasilyaddμC/OS-Viewtoyourproduct.
Defining
OS_VIEW_MODULEto1indicatesthatyouwillincludeμC/OS-Viewinyourproduct’s
build.
SettingOS_VIEW_MODULEto0indicatesthatyouwillnotbeusing
μC/OS-View.
IfyouDONOTaddthis#define,thecompilerwillcomplainviaa#errordirectivethatweaddedinucos_ii.h.
OS_CORE.C
WenowassignanametotheμC/OS-IIidletaskandstatisticstaskifOS_TASK_NAME_SIZEisdefinedasbeinggreaterthan14inOS_CFG.H.Thisisusedfordebuggingpurposes.Theidletaskiscalled:“uC/OS-IIIdle”andthestatisticstaskiscalled“uC/OS-IIStat”.
GENERAL
InALLthefunctionsthatpass*errsothananerrorcodeisreturnedtothecaller,err
ischeckedtomakesureit’snotaNULLpointer.
Thefunctionreturnsifitis.
Unfortunately,youarenottoldwhybecausewehavenowaytogiveyouanerrorcode.
InALLthefunctionsthatpassapointer,wenowchecktomakesurethatthepointeris
notaNULLpointer.
Thiswaspreviouslydoneforsomeofthepointersbutnotall.
22of84
V2.76
(2004/02/06)
ThisreleasecorrectsanumberofminorissueswithV2.75andalsoaddanewSemaphoreinterfacefunction(OSSemSet()).
FIXEDBUGSINV2.75
BugV2.75-001:
OSTaskDlyResume()makesthesametestasthenewOSTimeTick()inthatifataskwasdelayedandwaspendingonaneventthen,.OSTCBPendTOwillbesettoTRUEindicatingthatthetasktimedout.
BugV2.75-002:
Thefollowingfunctions:
OSTaskChangePrio()OSTaskDel()OSTaskDelReq()OSTaskNameSet()OSTaskNameGet()OSTaskResume()OSTaskSuspend()
Allneededtocheckfor‘ptcb’pointingto(void*)1incasethetaskwasassignedtoaMutexPIP.
BugV2.75-003:
OSTaskDelReq()hadalocalvariable‘stat’whichwasdeclaredasaBOOLEANbutwasinfactusedasan8bitinteger.ThislocalvariableisnowanINT8U.
NEWFEATURE
V2.76addsanewsemaphorefunction(OSSemSet())thatallowsyoutosetthevalue(i.e.count)ofthesemaphore.Thisnewfeatureisusefulwhenyouusesemaphoresasasignalingmechanism.YouenablethisfunctionbysettingOS_SEM_SET_ENto1inOS_CFG.Hofyourproduct.Seedetailsaboutthisfunctioninthereferencemanual.
23of84
V2.75
(2003/12/15)
ThisreleasecorrectsanumberofissuesthatwerereportedbyusersofV2.70.Thisreleasealsocontainssomechanges.ProbablythemostsignificantimprovementisthatwemadesurethatμC/OS-IIpassesLINTwithoutwarningsanderrors.PCLintV8byGimpelSoftwarewasusedtoLINTμC/OS-II:
/html/contact.htm.
FIXEDBUGSINV2.70
BugV2.70-001:
OSTaskSuspend()andOSTaskResume()bughasbeencorrected.Theproblemandcorrectionaredescribedlater.
BugV2.70-002:
InOSMemNameSet(),areturnstatementwasmissingforthecasewhenpmemis
NULL.Thisbughasbeencorrected.
BugV2.70-003:
InOSQPos
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度物業(yè)費(fèi)繳費(fèi)與社區(qū)文化活動(dòng)組織服務(wù)協(xié)議
- 2025年度電影演員聘用合同模板:電影配音演員長(zhǎng)期聘用合同
- 二零二五年度商場(chǎng)時(shí)尚飾品柜臺(tái)租賃管理合同
- 浙江國(guó)企招聘2024嘉興市卓越交通建設(shè)檢測(cè)有限公司招聘3人筆試參考題庫(kù)附帶答案詳解
- 二零二五年度股份轉(zhuǎn)讓與知識(shí)產(chǎn)權(quán)交易管理協(xié)議
- 消防知識(shí)培訓(xùn)課件
- 2025福建漳州市經(jīng)濟(jì)發(fā)展集團(tuán)有限公司招聘勞務(wù)派遣人員10人筆試參考題庫(kù)附帶答案詳解
- 2025河南鄭州煤炭工業(yè)(集團(tuán))招聘485人筆試參考題庫(kù)附帶答案詳解
- 匠心筑夢(mèng)成就出彩人生-大學(xué)生就業(yè)指導(dǎo)知到智慧樹(shù)章節(jié)測(cè)試課后答案2024年秋深圳職業(yè)技術(shù)大學(xué)
- 第八單元++20+世紀(jì)下半葉世界的新變化++教材思考探究題高一統(tǒng)編版(2019)必修中外歷史綱要下冊(cè)
- 2025年臨床醫(yī)師定期考核必考復(fù)習(xí)題庫(kù)及答案(900題)
- 河南省信陽(yáng)市固始縣2023-2024學(xué)年四年級(jí)下學(xué)期期末數(shù)學(xué)試題
- Q∕GDW 10799.7-2020 國(guó)家電網(wǎng)有限公司電力安全工作規(guī)程 第7部分:調(diào)相機(jī)部分
- 熱工學(xué)后題答案
- 南陽(yáng)理工學(xué)院畢業(yè)論文格式規(guī)范
- 不吸煙不喝酒課件
- 奧數(shù)知識(shí)點(diǎn) 間隔問(wèn)題
- 簡(jiǎn)易旋轉(zhuǎn)倒立擺及控制裝置
- 深圳大學(xué)《數(shù)字信號(hào)處理》2009年期末考試試卷A卷
- 2019寧波地產(chǎn)品牌半程馬拉松 (海景風(fēng)情 健康寧波主題)活動(dòng)策劃方案-41P
- BMC缺陷以及原因
評(píng)論
0/150
提交評(píng)論