Selaa lähdekoodia

Fix the way of sending out IN packet.

This fixes problem that it losts keycode when send keycodes in row in layer.c.
Undef CONSOLE_ENABLE build option makes this problem clear.
tags/v1.9
tmk 11 vuotta sitten
vanhempi
commit
7350b7c6aa
1 muutettua tiedostoa jossa 19 lisäystä ja 22 poistoa
  1. 19
    22
      protocol/lufa/lufa.c

+ 19
- 22
protocol/lufa/lufa.c Näytä tiedosto

Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM);


/* Check if Keyboard Endpoint Ready for Read/Write */ /* Check if Keyboard Endpoint Ready for Read/Write */
if (Endpoint_IsReadWriteAllowed())
{
/* Write Keyboard Report Data */
Endpoint_Write_Stream_LE(report, sizeof(report_keyboard_t), NULL);
while (!Endpoint_IsReadWriteAllowed()) ;

/* Write Keyboard Report Data */
Endpoint_Write_Stream_LE(report, sizeof(report_keyboard_t), NULL);

/* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN();


/* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN();
}
keyboard_report_sent = *report; keyboard_report_sent = *report;
} }


Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);


/* Check if Mouse Endpoint Ready for Read/Write */ /* Check if Mouse Endpoint Ready for Read/Write */
if (Endpoint_IsReadWriteAllowed())
{
/* Write Mouse Report Data */
Endpoint_Write_Stream_LE(report, sizeof(report_mouse_t), NULL);
while (!Endpoint_IsReadWriteAllowed()) ;


/* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN();
}
/* Write Mouse Report Data */
Endpoint_Write_Stream_LE(report, sizeof(report_mouse_t), NULL);

/* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN();
#endif #endif
} }


.usage = data .usage = data
}; };
Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM); Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM);
if (Endpoint_IsReadWriteAllowed()) {
Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL);
Endpoint_ClearIN();
}
while (!Endpoint_IsReadWriteAllowed()) ;
Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL);
Endpoint_ClearIN();
} }


static void send_consumer(uint16_t data) static void send_consumer(uint16_t data)
.usage = data .usage = data
}; };
Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM); Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM);
if (Endpoint_IsReadWriteAllowed()) {
Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL);
Endpoint_ClearIN();
}
while (!Endpoint_IsReadWriteAllowed()) ;
Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL);
Endpoint_ClearIN();
} }





Loading…
Peruuta
Tallenna