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... OSMutexCreate OSMutex
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• They are used to gain exclusive access to resources
• They reduce priority inversion problem (priority ceiling protocol is supported)
OSMutexCreate() OSMutexDel() OSMutexPost()
OSMutexPend() OSMutexAccept() OSMutexQuery()
Trang 9Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Creating a Mutex, OSMutexCreate
OS_EVENT *OSMutexCreate (INT8U prio, INT8U *err)
• prio: Ceiling priroity
• err:
• Return value:
Trang 10Deleting a Mutex, OSMutexDel
OS_EVENT *OSMutexDel (OS_EVENT *pevent, INT8U opt, INT8U
*err)
• pevent: A pointer to the mutex to be deleted
• opt: Delete options
• err:
Trang 11Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Deleting a Mutex, OSMutexDel cont’d
OS_EVENT *OSMutexDel (OS_EVENT *pevent, INT8U opt, INT8U
*err)
• Return value: Null if successful
Trang 12Waiting on a Mutex (Blocking), OSMutexPend
void OSMutexPend (OS_EVENT *pevent, INT16U timeout, INT8U
*err)
• pevent: A pointer to the mutex to acquire
• timeout:
• err:
Trang 13Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Signaling a Mutex, OSMutexPost
INT8U OSMutexPost (OS_EVENT *pevent)
• pevent: A pointer to the mutex to release
• Return value:
Trang 14Getting a Mutex without Waiting, OSMutexAccept
INT8U OSMutexAccept (OS_EVENT *pevent, INT8U *err)
• pevent: A pointer to the mutex to acquire
• err:
• Return value:
Trang 15Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6
Obtaining the Status of a Mutex, OSMutexQuery
INT8U OSMutexQuery (OS_EVENT *pevent, OS_MUTEX_DATA
*pdata)
• pevent: A pointer to the desired mutex
• pdata: A pointer to the returned mutex information
• Return value: