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

Addapp_usb_audio_task.c andapp_display_task.c to theSource Files/app folder (in the MPLAB® X IDE Projects pane) by right clicking and selectingAdd Existing Item….

image_82.png
image_83.png

3

Addapp_usb_audio_task.h andapp_display_task.h to theHeader Files/app folder by right clicking and selectingAdd Existing Item…

image_84.png
image_85.png

The files under the project should look like this:

image_86.png

4

Open the fileapp.c (in the MPLAB X IDE Projects pane under theSource Files/app folder) to add the initialization routines APP_DISPLAY_Initialize and APP_USB_AUDIO_Initialize toAPP_Initialize.

image_87.png

5

Add the audio and display task functions APP_USB_AUDIO_Tasks and APP_DISPLAY_Tasks toAPP_Tasks.

image_88.png

6

Save all the files before closing.

7

Now, you are ready to build the code. Click theClean and BuildMain_Rebuild_Project.png icon and verify that the project builds successfully.


Next Step >