Step 4: Generate MPLAB® Harmony Code

Last modified by Microchip on 2024/02/06 12:28

Expand the source file folders in the Projects pane. Notice that these are the files from Lab 4 that you copied to this directory.

Files from Lab 4

Back to Top


Click on the Generate Code button as shown in the accompanying figure. Notice the Merging Strategy option.

Generate code

Back to Top


Note the new decoder folders added to the lab.

Files after creation

Back to Top


Check for MPLAB® Harmony 3 issues in earlier versions.

In previously released versions of the MPLAB Harmony 3 graphics code (gfx 3.4.0 and earlier), there were two issues that needed to be resolved in drv_maxtouch.c and drv_gfx_lcc.c. The directory structure shown in the accompanying image shows the location of these two files generated by MHC.

Verify files

In the drv_gfx_lcc.c source file, make sure the parameter in the call to DMAC_ChannelCallbackRegister (line 306) is DRV_GFX_LCC_DMA_CHANNEL_INDEX.

Make sure the parameter in the call to DMAC_ChannelCallbackRegister (line 306) is DRV_GFX_LCC_DMA_CHANNEL_INDEX

Also, In the drv_maxtouch.c source file, make sure the parameter in the call to pDrvInstance->drvOpen (line 875) is DRV_MAXTOUCH_I2C_MODULE_INDEX.

Make sure the parameter in the call to pDrvInstance->drvOpen (line 875) is DRV_MAXTOUCH_I2C_MODULE_INDEX

If you do need to modify these lines, the next time you generate code, you will see the following merge screens displayed. Just press the Close button.

Press the close button

Press the close button

If you were to build the project now, the build would fail. The custom display routines added in the Graphics Composer have not yet been defined in the source code. You will add the application display code to implement this API in the next step.

Back to Top