USB Audio Speaker Tutorial: Step 6

Step 6: Include application specific source code and files

1

Copy the following application source files into the folder containing the project's source files:
app_usb_audio_task.c
app_usb_audio_task.h
app_display_task.c
app_display_task.h
Copy them from this folder:
apps/training/middleware/usb_speaker/usb_speaker_lab/dev_files
to this one:
apps/training/middleware/dev/usb_speaker/usb_speaker_lab/firmware/src

image_81.png

2

Add app_usb_audio_task.c and app_display_task.c to the Source Files/app folder (in the MPLAB X IDE "Projects" pane) by right clicking and selecting Add Existing Item….

image_82.png


image_83.png

3

Add app_usb_audio_task.h and app_display_task.h to the Header Files/app folder by right clicking and selecting Add Existing Item…

image_84.png


image_85.png


The files under the project should look like this:

image_86.png

4

Open the file app.c (in the MPLAB X IDE "Projects" pane under the Source Files/app folder) to add the initialization routines APP_DISPLAY_Initialize and APP_USB_AUDIO_Initialize in APP_Initialize.

image_87.png

5

Add the audio and display task functions APP_USB_AUDIO_Tasks and APP_DISPLAY_Tasks in APP_Tasks.

image_88.png

6

Save all the files before closing.

7

Now, you are ready to build the code. Click the "Clean and Build" Main_Rebuild_Project.png icon and verify that the project builds successfully.



Next Step >

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.