Step 4: Include Application-Specific Source Files and Add Required Code
Copy the following source files into your project's source files folder:
- app_tone_textfile_sdcard.c
- app_tone_textfile_sdcard.h
Copy them from apps/training/solutions/audio_player/audio_player_lab2/dev_files to apps/training/solutions/dev/audio_player/audio_player_lab2/firmware/src.
Add the copied source files to your project.
Add app_tone_textfile_sdcard.c to the Source Files/app folder (in the MPLAB X IDE Projects pane) by right-clicking and selecting Add Existing Item…
Add app_tone_textfile_sdcard.h to the Header Files/app folder by right-clicking and selecting Add Existing Item…
Remove the following application files from audio_player_lab1:
- app_tone_lookup_table.c
- app_tone_lookup_table.h
Right-click on these file names in the Projects pane, and select Remove From Project.
Since you are retaining the app.c and app.h files from audio_player_lab1, you need to change some of the function names to correspond with the newly included app_tone_textfile_sdcard.c file.
Open the file app.c and change the name of the function prototypes.
Then change the name of this function from APP_TONE_LOOKUP_TABLE_Initialize() to "APP_TONE_TEXTFILE_SDCARD_Initialize()" in function APP_Tasks as shown in the accompanying image.
Similarly, change the name of this function from APP_TONE_LOOKUP_TABLE_Tasks() to "APP_TONE_TEXTFILE_SDCARD_Tasks()" in function APP_Tasks as shown in the accompanying image.