Creating Loose Coupling with Queues
In this chapter, we’ll explore how queues can provide natural interface definitions for data exchange between tasks.
We’ll create a system that uses the dev-board and development computer, connected by USB. An app on the development computer sends commands to our firmware on the dev-board. The commands specify how to set the brightness for the user LEDs. The app on the development computer is a GUI, and it allows the user to set the brightness for each LED.
In the prior chapter, we created a driver for sending data over USB, to the development computer. In this chapter we’ll use the driver to receive data over USB, from the development computer. The driver puts the received data in a stream-buffer. The received data is a series of commands for setting the brightness of the dev-board’s user LEDs. A task is implemented to parse the stream-buffer to extract the commands. Each extracted command is sent to a queue...