Merge remote-tracking branch 'upstream/develop' into xap
This commit is contained in:
		
						commit
						c9ec8a1309
					
				
					 1525 changed files with 26368 additions and 6063 deletions
				
			
		| 
						 | 
				
			
			@ -342,7 +342,8 @@ static void Console_Task(void) {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    // fill empty bank
 | 
			
		||||
    while (Endpoint_IsReadWriteAllowed()) Endpoint_Write_8(0);
 | 
			
		||||
    while (Endpoint_IsReadWriteAllowed())
 | 
			
		||||
        Endpoint_Write_8(0);
 | 
			
		||||
 | 
			
		||||
    // flush sendchar packet
 | 
			
		||||
    if (Endpoint_IsINReady()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -382,7 +383,7 @@ void send_joystick_packet(joystick_t *joystick) {
 | 
			
		|||
          joystick->axes[5],
 | 
			
		||||
#        endif
 | 
			
		||||
        },
 | 
			
		||||
#    endif  // JOYSTICK_AXES_COUNT>0
 | 
			
		||||
#    endif // JOYSTICK_AXES_COUNT>0
 | 
			
		||||
 | 
			
		||||
#    if JOYSTICK_BUTTON_COUNT > 0
 | 
			
		||||
        .buttons = {
 | 
			
		||||
| 
						 | 
				
			
			@ -398,14 +399,15 @@ void send_joystick_packet(joystick_t *joystick) {
 | 
			
		|||
            joystick->buttons[3],
 | 
			
		||||
#        endif
 | 
			
		||||
        }
 | 
			
		||||
#    endif  // JOYSTICK_BUTTON_COUNT>0
 | 
			
		||||
#    endif // JOYSTICK_BUTTON_COUNT>0
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /* Select the Joystick Report Endpoint */
 | 
			
		||||
    Endpoint_SelectEndpoint(JOYSTICK_IN_EPNUM);
 | 
			
		||||
 | 
			
		||||
    /* Check if write ready for a polling interval around 10ms */
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40);
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed())
 | 
			
		||||
        _delay_us(40);
 | 
			
		||||
    if (!Endpoint_IsReadWriteAllowed()) return;
 | 
			
		||||
 | 
			
		||||
    /* Write Joystick Report Data */
 | 
			
		||||
| 
						 | 
				
			
			@ -500,9 +502,11 @@ void EVENT_USB_Device_WakeUp() {
 | 
			
		|||
 | 
			
		||||
#ifdef CONSOLE_ENABLE
 | 
			
		||||
static bool console_flush = false;
 | 
			
		||||
#    define CONSOLE_FLUSH_SET(b)                                     \
 | 
			
		||||
        do {                                                         \
 | 
			
		||||
            ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { console_flush = b; } \
 | 
			
		||||
#    define CONSOLE_FLUSH_SET(b)                \
 | 
			
		||||
        do {                                    \
 | 
			
		||||
            ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { \
 | 
			
		||||
                console_flush = b;              \
 | 
			
		||||
            }                                   \
 | 
			
		||||
        } while (0)
 | 
			
		||||
 | 
			
		||||
/** \brief Event USB Device Start Of Frame
 | 
			
		||||
| 
						 | 
				
			
			@ -726,7 +730,9 @@ void EVENT_USB_Device_ControlRequest(void) {
 | 
			
		|||
 *
 | 
			
		||||
 * FIXME: Needs doc
 | 
			
		||||
 */
 | 
			
		||||
static uint8_t keyboard_leds(void) { return keyboard_led_state; }
 | 
			
		||||
static uint8_t keyboard_leds(void) {
 | 
			
		||||
    return keyboard_led_state;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** \brief Send Keyboard
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			@ -757,7 +763,8 @@ static void send_keyboard(report_keyboard_t *report) {
 | 
			
		|||
#endif
 | 
			
		||||
    Endpoint_SelectEndpoint(ep);
 | 
			
		||||
    /* Check if write ready for a polling interval around 10ms */
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40);
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed())
 | 
			
		||||
        _delay_us(40);
 | 
			
		||||
    if (!Endpoint_IsReadWriteAllowed()) return;
 | 
			
		||||
 | 
			
		||||
    /* If we're in Boot Protocol, don't send any report ID or other funky fields */
 | 
			
		||||
| 
						 | 
				
			
			@ -797,7 +804,8 @@ static void send_mouse(report_mouse_t *report) {
 | 
			
		|||
    Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);
 | 
			
		||||
 | 
			
		||||
    /* Check if write ready for a polling interval around 10ms */
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40);
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed())
 | 
			
		||||
        _delay_us(40);
 | 
			
		||||
    if (!Endpoint_IsReadWriteAllowed()) return;
 | 
			
		||||
 | 
			
		||||
    /* Write Mouse Report Data */
 | 
			
		||||
| 
						 | 
				
			
			@ -817,7 +825,8 @@ static void send_report(void *report, size_t size) {
 | 
			
		|||
    Endpoint_SelectEndpoint(SHARED_IN_EPNUM);
 | 
			
		||||
 | 
			
		||||
    /* Check if write ready for a polling interval around 10ms */
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40);
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed())
 | 
			
		||||
        _delay_us(40);
 | 
			
		||||
    if (!Endpoint_IsReadWriteAllowed()) return;
 | 
			
		||||
 | 
			
		||||
    Endpoint_Write_Stream_LE(report, size, NULL);
 | 
			
		||||
| 
						 | 
				
			
			@ -968,9 +977,13 @@ USB_ClassInfo_MIDI_Device_t USB_MIDI_Interface = {
 | 
			
		|||
 | 
			
		||||
// clang-format on
 | 
			
		||||
 | 
			
		||||
void send_midi_packet(MIDI_EventPacket_t *event) { MIDI_Device_SendEventPacket(&USB_MIDI_Interface, event); }
 | 
			
		||||
void send_midi_packet(MIDI_EventPacket_t *event) {
 | 
			
		||||
    MIDI_Device_SendEventPacket(&USB_MIDI_Interface, event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool recv_midi_packet(MIDI_EventPacket_t *const event) { return MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, event); }
 | 
			
		||||
bool recv_midi_packet(MIDI_EventPacket_t *const event) {
 | 
			
		||||
    return MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1026,7 +1039,8 @@ void virtser_send(const uint8_t byte) {
 | 
			
		|||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40);
 | 
			
		||||
        while (timeout-- && !Endpoint_IsReadWriteAllowed())
 | 
			
		||||
            _delay_us(40);
 | 
			
		||||
 | 
			
		||||
        Endpoint_Write_8(byte);
 | 
			
		||||
        CDC_Device_Flush(&cdc_device);
 | 
			
		||||
| 
						 | 
				
			
			@ -1049,7 +1063,8 @@ void send_digitizer(report_digitizer_t *report) {
 | 
			
		|||
    Endpoint_SelectEndpoint(DIGITIZER_IN_EPNUM);
 | 
			
		||||
 | 
			
		||||
    /* Check if write ready for a polling interval around 10ms */
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40);
 | 
			
		||||
    while (timeout-- && !Endpoint_IsReadWriteAllowed())
 | 
			
		||||
        _delay_us(40);
 | 
			
		||||
    if (!Endpoint_IsReadWriteAllowed()) return;
 | 
			
		||||
 | 
			
		||||
    Endpoint_Write_Stream_LE(report, sizeof(report_digitizer_t), NULL);
 | 
			
		||||
| 
						 | 
				
			
			@ -1125,7 +1140,9 @@ void protocol_pre_init(void) {
 | 
			
		|||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void protocol_post_init(void) { host_set_driver(&lufa_driver); }
 | 
			
		||||
void protocol_post_init(void) {
 | 
			
		||||
    host_set_driver(&lufa_driver);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void protocol_pre_task(void) {
 | 
			
		||||
#if !defined(NO_USB_STARTUP_CHECK)
 | 
			
		||||
| 
						 | 
				
			
			@ -1180,4 +1197,6 @@ void protocol_post_task(void) {
 | 
			
		|||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint16_t wIndex, const void **const DescriptorAddress) { return get_usb_descriptor(wValue, wIndex, DescriptorAddress); }
 | 
			
		||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint16_t wIndex, const void **const DescriptorAddress) {
 | 
			
		||||
    return get_usb_descriptor(wValue, wIndex, DescriptorAddress);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,13 +22,15 @@ void usb_disconnect(void) {
 | 
			
		|||
    USB_DeviceState = DEVICE_STATE_Unattached;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool usb_connected_state(void) { return USB_Device_IsAddressSet(); }
 | 
			
		||||
bool usb_connected_state(void) {
 | 
			
		||||
    return USB_Device_IsAddressSet();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(OTGPADE)
 | 
			
		||||
bool usb_vbus_state(void) {
 | 
			
		||||
    USB_OTGPAD_On();  // enables VBUS pad
 | 
			
		||||
    USB_OTGPAD_On(); // enables VBUS pad
 | 
			
		||||
    wait_us(5);
 | 
			
		||||
 | 
			
		||||
    return USB_VBUS_GetStatus();  // checks state of VBUS
 | 
			
		||||
    return USB_VBUS_GetStatus(); // checks state of VBUS
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue