Step 5: Include Application-specific Source Files, Add Required Code, and Build the Project
The app_button_press_task.c and app_button_press_task.h files are no longer needed as their functionality will be replaced by the radio buttons on the display. Right-click on these files and select Remove From Project.
Copy source files into your project's Source Files folder:
app_display_task.c
app_display_task.h
Copy them from this folder:
apps/training/solutions/audio_player/audio_player_lab5/dev_files
to this one:
apps/training/solutions/dev/audio_player/audio_player_lab5/firmware/src.
Add the copied source files to your project.
- Add 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…
- Add app_display_task.h to the Header Files/app folder by right-clicking and selecting Add Existing Item…
The files under the project should look like this:
As you did in the previous labs, modify the app.c and app.h files from audio_player_lab4 to replace the Button task-related API with the Display task-related API in APP_Initialize and APP_Tasks functions.
Also, modify app.h to include app_sdcard_audio_task.h and app_display_task.h.
Now that you have added graphics to this lab, the SD card audio task needs to notify the display task whenever the tracks list is updated. Open the app_sdcard_audio_task.c file and add the following function call under the APP_SDCARD_AUDIO_CARD_STATE_INIT state.