Skip to Content
Hands-On RTOS with Microcontrollers
book

Hands-On RTOS with Microcontrollers

by Brian Amos
May 2020
Intermediate to advanced
496 pages
13h 54m
English
Packt Publishing
Content preview from Hands-On RTOS with Microcontrollers

Time-bound semaphores

Earlier, we mentioned that one of the critical aspects of RTOSes was their ability to provide a way to time-bound operations; that is, they can guarantee a call doesn't stop a task from executing any longer than is desirable. An RTOS does not guarantee the successful timeliness of an operation. It only promises that the call will be returned in an amount of time. Let's have another look at the call for taking a semaphore:

BaseType_t xSemaphoreTake( SemaphoreHandle_t xSemaphore,                            TickType_t xTicksToWait );

From the preceding code, we can see the following:

  • semPtr is just a pointer to the semaphore.   
  • maxDelay is the interesting part of this call it specifies the maximum amount of time to wait for the semaphore (in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers - Second Edition

Hands-On RTOS with Microcontrollers - Second Edition

Jim Yuill, Penn Linder

Publisher Resources

ISBN: 9781838826734Supplemental Content