Introduction to uCOS-II V2.6... Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6Course References • MicroC/OS-II The Real-Time Kernel, 2nd Edition, by Jean J... OSSemCreate OSSemDel
Trang 1Introduction to uCOS-II V2.6
Trang 2About SwiftACT
• A Technology services startup company
o Under establishment
• Areas of specialties:
o Mobile telecommunication services development
o Embedded systems development
• Types of services:
o Consultation
o Managed services
o Sourcing
o Training
Trang 3Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
About Me
• Graduated 2004
o ECE, ASU: 5 yrs distinction
• 5+ years in embedded systems development
o SDLC, Apps, MW, DD, Porting,
• 3+ years in SW engineering
o PSP, CMMI, Systematic reuse,
• 3+ years in SW testing
o IBM certified, ISTQB certified,
Trang 4• Materials in this course is the property of Amr Ali Abdel-Naby
• Reproduction or transmission of the materials in any manner without the copyright owner permission is a law violation
Trang 5Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Course References
• MicroC/OS-II The Real-Time Kernel, 2nd Edition, by Jean J Labrosse
Trang 6• Introduction to µC/OS-II
• Kernel Structure
• Task Management
• Time Management
• Semaphore Management
• Mutual Exclusion Semaphores
• Event Flag Management
• Message Mailbox Management
• Message Queue Management
• Memory Management
Trang 7Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Outline
• Introduction to µC/OS-II
• Kernel Structure
• Task Management
• Time Management
• Semaphore Management
• Mutual Exclusion Semaphores
• Event Flag Management
• Message Mailbox Management
• Message Queue Management
• Memory Management
Trang 8• Semaphores are 16 bit unsigned integers used for resource sharing or to signal the occurrence of an event
OSSemCreate() OSSemDel() OSSemPost()
OSSemAccept() OSSemPend() OSSemQuery()
OSSemPost()
N N
OSSemAccept()
ISR
ISR Task
Task
Trang 9Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Creating a Semaphore, OSSemCreate
OS_EVENT *OSSemCreate (INT16U cnt)
• cnt: The initial value for the semaphore
• Return value:
Trang 10Deleting a Semaphore, OSSemDel
OS_EVENT *OSSemDel (OS_EVENT *pevent, INT8U opt, INT8U
*err)
• pevent: A pointer to the semaphore to be deleted
• opt: Delete options
• err:
Trang 11Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Deleting a Semaphore, OSSemDel cont’d
OS_EVENT *OSSemDel (OS_EVENT *pevent, INT8U opt, INT8U
*err)
• Return value: Null if successful
Trang 12Waiting on a Semaphore (Blocking), OSSemPend
void OSSemPend (OS_EVENT *pevent, INT16U timeout, INT8U
*err)
• pevent: A pointer to the semaphore to pend to
• timeout:
• err:
Trang 13Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Signaling a Semaphore, OSSemPost
INT8U OSSemPost (OS_EVENT *pevent)
• pevent: A pointer to the semaphore to post to
• Return value:
Trang 14Getting a Semaphore without Waiting, OSSemAccept
INT16U OSSemAccept (OS_EVENT *pevent)
• pevent: A pointer to the semaphore to pend to
• Return value:
Trang 15Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Obtaining the Status of a Semaphore, OSSemQuery
INT8U OSSemQuery (OS_EVENT *pevent, OS_SEM_DATA *pdata)
• pevent: A pointer to the desired semaphore
• pdata: A pointer to the returned semaphore information
• Return value: