The files that must be included into a project has changed from v2.5 to v2.6.
Version v2.5 of the MCHPFSUSB stack required multiple include files in order to work properly in device mode. The usb_device.h, usb.h, usb_config.h, and class specific files (i.e. - “./usb/usb_function_msd.h”) had to be included in all of the application files that accessed the USB stack as well as other common include files like the GenericTypeDefs.h and Compiler.h files.
In MHCPFSUSB v2.6, only the usb.h file and the class specific files (i.e. - “./usb/usb_function_msd.h”) must be included in the project. The usb_device.h and usb_config.h files should no longer be included in the application specific files.
Include Search Paths and Build Directory Policy
The preferred include path list has changed since the initial v2.x release. MPLAB now support compiling projects with respect to the project file instead of the source file. This is now the preferred method. With this modification the required include paths are the following:
.
../Microchip/Include
If your project file located in a different format than the example projects, please add or remove the appropriate path modifiers such that the include path indirectly points to the /Microchip/Include folder.
To change the build directory policy and set the include paths, go to the “Project->Build Options->Project” menu. On the directories tab, select the include directories from the show directories drop down box.
Disabling Interrupt Handlers
In MCHPFSUSB v2.6, the interrupt handler routines are disabled through the usb_config.h file using the following definitions:
USB_DISABLE_SET_CONFIGURATION_HANDLER
USB_DISABLE_SUSPEND_HANDLER
USB_DISABLE_WAKEUP_FROM_SUSPEND_HANDLER
USB_DISABLE_SOF_HANDLER
USB_DISABLE_ERROR_HANDLER
USB_DISABLE_NONSTANDARD_EP0_REQUEST_HANDLER
USB_DISABLE_SET_DESCRIPTOR_HANDLER
USB_DISABLE_TRANSFER_COMPLETE_HANDLER
Defining any of these definitions in the usb_config.h file will disable the callback from the stack during these events. Please note that some of these events are required to be USB compliant. For example all USB devices must go into suspend mode when requested. The suspend handler is how the stack notifies the user that the bus has requested the device to go into suspend mode.
Also note that some device classes or demos may require certain handlers to be available in order to operate properly. For example, the audio class demo uses the start of frames provided by the SOF handler to properly synchronize the audio data playback.