From 06e34fdcbca32cc827a7a4d2bd5213aa1a52ec40 Mon Sep 17 00:00:00 2001 From: Eric Tang Date: Sat, 6 Oct 2018 09:47:45 -0500 Subject: [PATCH] Convert the layer cache to an action cache --- right/src/usb_report_updater.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 3971c35..d344ec2 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -25,7 +25,7 @@ static uint16_t DoubleTapSwitchLayerReleaseTimeout = 200; static bool activeMouseStates[ACTIVE_MOUSE_STATES_COUNT]; bool TestUsbStack = false; -static uint8_t layerCache[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE]; +static key_action_t actionCache[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE]; volatile uint8_t UsbReportUpdateSemaphore = 0; @@ -380,11 +380,11 @@ static void updateActiveUsbReports(void) secondaryRoleState = SecondaryRoleState_Triggered; keyState->current = false; } else { - layerCache[slotId][keyId] = activeLayer; + actionCache[slotId][keyId] = CurrentKeymap[activeLayer][slotId][keyId]; } } - action = &CurrentKeymap[layerCache[slotId][keyId]][slotId][keyId]; + action = &actionCache[slotId][keyId]; if (keyState->current) { if (action->type == KeyActionType_Keystroke && action->keystroke.secondaryRole) {