summary refs log tree commit diff
diff options
context:
space:
mode:
authorzvecr <git@zvecr.com>2020-05-02 22:44:36 +0100
committerzvecr <git@zvecr.com>2020-05-02 22:44:36 +0100
commit406dc2fb2d1e657db2d7235885722dd86d07ea08 (patch)
tree3f58907a434ef2cb5ce129489a6212d936eae75d
parente182a38e7c63179f11c94cd7d59f9bac829b85a8 (diff)
Move encoder_read to common location
-rw-r--r--quantum/quantum.c11
-rw-r--r--quantum/split_common/matrix.c8
-rw-r--r--tmk_core/common/keyboard.c10
3 files changed, 11 insertions, 18 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 2053a1a5f4..a780ed43d0 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -46,10 +46,6 @@ extern backlight_config_t backlight_config;
 #    include "haptic.h"
 #endif
 
-#ifdef ENCODER_ENABLE
-#    include "encoder.h"
-#endif
-
 #ifdef AUDIO_ENABLE
 #    ifndef GOODBYE_SONG
 #        define GOODBYE_SONG SONG(GOODBYE_SOUND)
@@ -618,9 +614,6 @@ void matrix_init_quantum() {
 #ifdef RGB_MATRIX_ENABLE
     rgb_matrix_init();
 #endif
-#ifdef ENCODER_ENABLE
-    encoder_init();
-#endif
 #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)
     unicode_input_mode_init();
 #endif
@@ -658,10 +651,6 @@ void matrix_scan_quantum() {
     rgb_matrix_task();
 #endif
 
-#ifdef ENCODER_ENABLE
-    encoder_read();
-#endif
-
 #ifdef WPM_ENABLE
     decay_wpm();
 #endif
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index 8b91f8ca83..95ee2433ad 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -24,10 +24,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "config.h"
 #include "transport.h"
 
-#ifdef ENCODER_ENABLE
-#    include "encoder.h"
-#endif
-
 #define ERROR_DISCONNECT_COUNT 5
 
 #define ROWS_PER_HAND (MATRIX_ROWS / 2)
@@ -255,9 +251,7 @@ void matrix_post_scan(void) {
         matrix_scan_quantum();
     } else {
         transport_slave(matrix + thisHand);
-#ifdef ENCODER_ENABLE
-        encoder_read();
-#endif
+
         matrix_slave_scan_user();
     }
 }
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index a767d9c877..200b1e8722 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -53,6 +53,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifdef RGBLIGHT_ENABLE
 #    include "rgblight.h"
 #endif
+#ifdef ENCODER_ENABLE
+#    include "encoder.h"
+#endif
 #ifdef STENO_ENABLE
 #    include "process_steno.h"
 #endif
@@ -249,6 +252,9 @@ void keyboard_init(void) {
 #ifdef RGBLIGHT_ENABLE
     rgblight_init();
 #endif
+#ifdef ENCODER_ENABLE
+    encoder_init();
+#endif
 #ifdef STENO_ENABLE
     steno_init();
 #endif
@@ -345,6 +351,10 @@ MATRIX_LOOP_END:
 #    endif
 #endif
 
+#ifdef ENCODER_ENABLE
+    encoder_read();
+#endif
+
 #ifdef QWIIC_ENABLE
     qwiic_task();
 #endif