Ejemplo n.º 1
0
void EVENT_USB_Device_ConfigurationChanged(void) {
  bool ConfigSuccess = true;
  
  SerialDebug_printf("EVENT_USB_Device_ConfigurationChanged\r\n");
  ConfigSuccess &= HID_Device_ConfigureEndpoints(&Joystick_HID_Interface);
  
  USB_Device_EnableSOFEvents();
}
Ejemplo n.º 2
0
Archivo: keyboard.c Proyecto: mxkl/gh60
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
  bool ConfigSuccess = true;

  ConfigSuccess &= HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface);

  USB_Device_EnableSOFEvents();
}
Ejemplo n.º 3
0
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged ( void ) {
    bool ConfigSuccess = true;

    ConfigSuccess &= HID_Device_ConfigureEndpoints ( &Keyboard_HID_Interface );

    USB_Device_EnableSOFEvents();

    //LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
}
Ejemplo n.º 4
0
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
	LEDs_SetAllLEDs(LEDMASK_USB_READY);

	if (!(HID_Device_ConfigureEndpoints(&Mouse_HID_Device_Interface)))
	  LEDs_SetAllLEDs(LEDMASK_USB_ERROR);

	USB_Device_EnableSOFEvents();
}
void
EVENT_USB_Device_ConfigurationChanged(void)
{
	HID_Device_ConfigureEndpoints(&keyboardHIDIface);
	HID_Device_ConfigureEndpoints(&genericHIDIface);
	HID_Device_ConfigureEndpoints(&nkroHIDIface);
	HID_Device_ConfigureEndpoints(&extrakeyHIDIface);
	USB_Device_EnableSOFEvents();
}
Ejemplo n.º 6
0
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
	bool ConfigSuccess = true;

	ConfigSuccess &= HID_Device_ConfigureEndpoints(&Mouse_HID_Interface);
	ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);

	USB_Device_EnableSOFEvents();

	LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
}
Ejemplo n.º 7
0
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void) {
  bool success = HID_Device_ConfigureEndpoints(&kbd_device);
  // TODO: Possibly signal this failure better.
  // I don't think it can happen in practice.
  if (!success) {
    abort();
  }

  // Need this to call HID_Device_MillisecondElapsed.
  USB_Device_EnableSOFEvents();
}
Ejemplo n.º 8
0
Archivo: usb.c Proyecto: JohnOH/phatio
void EVENT_USB_Device_ConfigurationChanged(void)
{
     bool success = true;
     success &= MS_Device_ConfigureEndpoints(&ms_device);
     success &= HID_Device_ConfigureEndpoints(&keyboard_device);
//     success &= CDC_Device_ConfigureEndpoints(&serial_device);

     USB_Device_EnableSOFEvents();

     if (!success) {
          led_error(USB_ERROR);
     }
}
Ejemplo n.º 9
0
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
	bool ConfigSuccess = true;

#if defined(USB_CDC_CLASS) || defined(USB_COMP_MOUSE_CDC_CLASS)
	ConfigSuccess &= CDC_Device_ConfigureEndpoints(CDC_IF_PTR);
#endif // #if defined(USB_CDC_CLASS) || defined(USB_COMP_MOUSE_CDC_CLASS)

#if defined(USB_MOUSE_CLASS) || defined(USB_COMP_MOUSE_CDC_CLASS)
	ConfigSuccess &= HID_Device_ConfigureEndpoints(HID_Mouse_PTR);
	USB_Device_EnableSOFEvents(); // USB Mouse Only??
#endif // #if defined(USB_MOUSE_CLASS) || defined(USB_COMP_MOUSE_CDC_CLASS)

	USB_DEBUG_MSG("EVENT_USB_Device_ConfigurationChanged\r\n");
}
Ejemplo n.º 10
0
Archivo: main.c Proyecto: doopai/gh60
static void setup_usb(void)
{
    // Leonardo needs. Without this USB device is not recognized.
    USB_Disable();

    USB_Init();

    // for Console_Task
    USB_Device_EnableSOFEvents();
    print_set_sendchar(sendchar);
    /* wait for USB startup & debug output */
    uint8_t timeout = 255;  // timeout when USB is not available
    while (timeout-- &&USB_DeviceState != DEVICE_STATE_Configured) {
        wait_ms(4);
#if defined(INTERRUPT_CONTROL_ENDPOINT)
        ;
#else
        USB_USBTask();
#endif
    }
    print("USB configured.\n");
}
Ejemplo n.º 11
0
static void SetupHardware(void)
{
    /* Disable watchdog if enabled by bootloader/fuses */
    MCUSR &= ~(1 << WDRF);
    wdt_disable();

    /* Disable clock division */
    clock_prescale_set(clock_div_1);

    // Leonardo needs. Without this USB device is not recognized.
    USB_Disable();

    USB_Init();

    // for Console_Task
    USB_Device_EnableSOFEvents();
    print_set_sendchar(sendchar_func);

    // SUART PD0:output, PD1:input
    DDRD |= (1<<0);
    PORTD |= (1<<0);
    DDRD &= ~(1<<1);
    PORTD |= (1<<1);
}
Ejemplo n.º 12
0
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
	HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface);

	USB_Device_EnableSOFEvents();
}
Ejemplo n.º 13
0
void
EVENT_USB_Device_ConfigurationChanged(void) {
    bool ok;
    ok = HID_Device_ConfigureEndpoints(&stateMachine);
    USB_Device_EnableSOFEvents();
}