Call UpdateUsbReports() from the interrupt handler of the keyboard interface because otherwise the I2C calls of UpdateUsbReports run in the main loop and interfere with the I2C calls of interrupt handlers. This is a temporary solution.

This commit is contained in:
László Monda
2017-01-13 22:34:11 +01:00
parent 9ef9e5f734
commit 24a12908ca
2 changed files with 3 additions and 2 deletions

View File

@@ -82,13 +82,13 @@ void main() {
InitClock();
LedDriver_InitAllLeds(1);
KeyMatrix_Init(&KeyMatrix);
UpdateUsbReports();
//UpdateUsbReports();
InitUsb();
// deserialize_Layer(testData, 0);
while (1) {
UpdateUsbReports();
//UpdateUsbReports();
asm("wfi");
}
}

View File

@@ -60,6 +60,7 @@ void ResetActiveUsbKeyboardReport()
static usb_status_t UsbKeyboardAction(void)
{
UpdateUsbReports();
return USB_DeviceHidSend(UsbCompositeDevice.keyboardHandle, USB_KEYBOARD_ENDPOINT_INDEX,
(uint8_t*)getInactiveUsbKeyboardReport(), USB_KEYBOARD_REPORT_LENGTH);
}