From 7c290ed37295e4c61283e929fe211bd68b9d7d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 9 Jul 2017 01:54:17 +0200 Subject: [PATCH] Extract getActiveLayer() and remove the static activeLayer variable. --- right/src/usb_report_updater.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 7eb7014..8a7bb06 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -10,7 +10,6 @@ #include "slave_drivers/slave_driver_uhk_module.h" #include "led_pwm.h" -static uint8_t activeLayer = LAYER_ID_BASE; static uint8_t mouseWheelDivisorCounter = 0; static uint8_t mouseSpeedAccelDivisorCounter = 0; static uint8_t mouseSpeed = 3; @@ -108,15 +107,9 @@ void processTestAction(key_action_t testAction) } } -void UpdateActiveUsbReports() +uint8_t getActiveLayer() { - bzero(&UsbMouseReport, sizeof(usb_mouse_report_t)); - - uint8_t basicScancodeIndex = 0; - uint8_t mediaScancodeIndex = 0; - uint8_t systemScancodeIndex = 0; - - activeLayer = LAYER_ID_BASE; + uint8_t activeLayer = LAYER_ID_BASE; for (uint8_t slotId=0; slotId