From 24a12908ca7eca0d9a6500db97473b6259a95983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Fri, 13 Jan 2017 22:34:11 +0100 Subject: [PATCH] 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. --- right/src/main.c | 4 ++-- right/src/usb_interface_keyboard.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/right/src/main.c b/right/src/main.c index 8eac0a6..5fc73e9 100644 --- a/right/src/main.c +++ b/right/src/main.c @@ -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"); } } diff --git a/right/src/usb_interface_keyboard.c b/right/src/usb_interface_keyboard.c index 98923f2..4bb9373 100644 --- a/right/src/usb_interface_keyboard.c +++ b/right/src/usb_interface_keyboard.c @@ -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); }