From da7312635bdc4a9ca3f00b5abc39ed8fcb1d3f43 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 26 Jan 2016 22:17:16 -0800 Subject: [PATCH] Move code that's not actually part of the matrix scanner out of the matrix scanning function --- KeyboardioFirmware.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/KeyboardioFirmware.ino b/KeyboardioFirmware.ino index d0bd5c45..7262714b 100644 --- a/KeyboardioFirmware.ino +++ b/KeyboardioFirmware.ino @@ -12,8 +12,6 @@ LEDControl BlinkyLights; void scan_matrix() { - x = 0; - y = 0; //scan the Keyboard matrix looking for connections for (byte row = 0; row < LEFT_ROWS; row++) { implementation_scan_row(row); @@ -30,9 +28,6 @@ void scan_matrix() { } implementation_finish_scanning_row(row); } - Keyboard.sendReport(); - Keyboard.releaseAll(); - handle_mouse_movement(x, y); } void setup() { @@ -48,8 +43,13 @@ void setup() { void loop() { + x = 0; + y = 0; scan_matrix(); BlinkyLights.update_leds(temporary_keymap == NUMPAD_KEYMAP); + Keyboard.sendReport(); + Keyboard.releaseAll(); + handle_mouse_movement(x, y); }