void MonitorVBUS( void )
{
    #if defined( __PIC24FJ256GB110__)
        if (AD1CON1bits.DONE)
        {
            if (ADC_READING_VBUS < OVERCURRENT_TRIP_READING)
            {
                USBHostVbusEvent( EVENT_VBUS_OVERCURRENT, USB_ROOT_HUB, 0 );
                if (!status.overcurrentStateUSB)
                {
                    UART2PrintString( "\r\n***** USB Error - overcurrent detected *****\r\n" );
                    status.overcurrentStateUSB = TRUE;
                }
            }
            else if (ADC_READING_VBUS > OVERCURRENT_RESET_READING)
            {
                if (status.overcurrentStateUSB)
                {
                    USBHostVbusEvent( EVENT_VBUS_POWER_AVAILABLE, USB_ROOT_HUB, 0 );
                    UART2PrintString( "\r\n***** USB overcurrent condition removed *****\r\n" );
                }
                status.overcurrentStateUSB = FALSE;
            }
            AD1CON1     = 0x80E4;       // Start the next conversion.
        }
    #endif
}
uint8_t ChipKITUSBHost::VbusEvent(USB_EVENT vbusEvent, uint8_t hubAddress, uint8_t portNumber)
{
    return(USBHostVbusEvent(vbusEvent, hubAddress, portNumber));
}