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

Passing one byte by value

In this example, a single uint8_t is set up to pass individual enumerations, (LED_CMDS), defining the state of one LED at a time or all of the LEDs (on/off).  Here's a summary of what is covered in this example:

  • ledCmdQueue: A queue of one-byte values (uint8_t) representing an enumeration defining LED states.
  • recvTask: This task receives a byte from the queue, executes the desired action, and immediately attempts to receive the next byte from the queue.
  • sendingTask: This task sends enumerated values to the queue using a simple loop, with a 200 ms delay between each send (so the LEDs turning on/off are visible).

So, let's begin:

  1. Set up an enum to help us describe the values that are being passed into the queue: ...
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