#IFNDEF __PIC18_USB_H__
#DEFINE __PIC18_USB_H__
#DEFINE __USB_HARDWARE__
//let the USB Stack know that we are using a PIC with internal USB peripheral
#DEFINE __PIC__ 1
#ifndef USB_USE_FULL_SPEED
#define USB_USE_FULL_SPEED 1
#endif
#ifndef USB_MAX_EP0_PACKET_LENGTH
#if ((getenv("DEVICE")=="PIC18F2450") || (getenv("DEVICE")=="PIC18F4450") || (getenv("DEVICE")=="PIC18F13K50") || (getenv("DEVICE")=="PIC18F14K50") || (getenv("DEVICE")=="PIC18LF13K50") || (getenv("DEVICE")=="PIC18LF14K50"))
//due to limited ram, force max packet length to 8 for this chip
#define USB_MAX_EP0_PACKET_LENGTH 8
#else
#if USB_USE_FULL_SPEED==0
//slow speed requires 8byte max packet size for endpoint 0
#DEFINE USB_MAX_EP0_PACKET_LENGTH 8
#else
//for full speed you can still use 8bytes, but 64 will be faster
#DEFINE USB_MAX_EP0_PACKET_LENGTH 64
#endif
#endif
#endif
#if (!USB_USE_FULL_SPEED && (USB_MAX_EP0_PACKET_LENGTH!=8))
#error Slow speed devices must use a max packet size of 8 for endpoint 0!
#endif
#if USB_MAX_EP0_PACKET_LENGTH < 8
#error Max Endpoint 0 length can't be less than 8!
#endif
#if USB_MAX_EP0_PACKET_LENGTH > 64
#error Max Endpoint 0 length can't be greater than 64!
#endif