Step 2: Overload the state machine by adding a time-consuming application to the project
There could be real-time situations that entail adding additional functionality to an existing application. In the case of a USB speaker, one of the desired capabilities to be added is the ability to provide a graphics equalizer display support. To add the graphics equalizer support in a cooperative multitasking implementation, you may need to ensure the bandwidth of CPU usage is appropriate for every task (System Tasks, USB Speaker Application Task and Display Task). Otherwise, the functionality of the application won't provide the desired performance. For example, if the display task consumes more than a few milliseconds for rendering complex graphics display, a listener to the USB speaker would experience noise artifacts. This is because the application would now be sending delayed streaming of the audio data to the codec. The delay caused by the display task would cause no data to be written into the codec within the acceptable time for the listener to experience quality audio. This causes listeners to experience noise artifacts.
For the scope of this application, we are not integrating the graphics library. Instead, we are introducing a delay task, which creates the situation explained above.
Step 2.1: Configure MHC to add new application task
Step 2.2: Generate Harmony code
Step 2.3: Review generated source files
Step 2.4: Add time-consuming application code to the project
Step 2.5: Build and program the modified “USB Audio Speaker” application
Step 2.6: Detect and Set up the “USB Audio Speaker” on your PC
Step 2.7: Verify the performance
Next Step >
Table of Contents
|