summaryrefslogtreecommitdiff
path: root/keyboards/ploopyco
diff options
context:
space:
mode:
authorGlen D'souza <gdsouza@linuxmail.org>2021-01-19 07:53:54 +0530
committerGitHub <noreply@github.com>2021-01-19 13:23:54 +1100
commitd24fe4f1ca49b2143b3f3d260a0a63088b521673 (patch)
treebe1471322ea411ad5f7ee3e443d4d19774e10c5c /keyboards/ploopyco
parent677789df773479dcedd0c3d71885ff5e89b7b5b6 (diff)
GCC 10 compatibility for Ploopy optical encoder (#11586)
Diffstat (limited to 'keyboards/ploopyco')
-rw-r--r--keyboards/ploopyco/opt_encoder.c28
-rw-r--r--keyboards/ploopyco/opt_encoder.h50
2 files changed, 53 insertions, 25 deletions
diff --git a/keyboards/ploopyco/opt_encoder.c b/keyboards/ploopyco/opt_encoder.c
index 44bcd5eb88..8698351c26 100644
--- a/keyboards/ploopyco/opt_encoder.c
+++ b/keyboards/ploopyco/opt_encoder.c
@@ -16,6 +16,34 @@
*/
#include "opt_encoder.h"
+enum State state;
+
+/* Variables used for scroll wheel functionality. */
+bool lohif;
+bool hilof;
+int lowA;
+int highA;
+bool cLowA;
+bool cHighA;
+int lowIndexA;
+int highIndexA;
+bool lowOverflowA;
+bool highOverflowA;
+int lowB;
+int highB;
+bool cLowB;
+bool cHighB;
+int lowIndexB;
+int highIndexB;
+bool lowOverflowB;
+bool highOverflowB;
+int scrollThresholdA;
+int scrollThresholdB;
+int arLowA[SCROLLER_AR_SIZE];
+int arHighA[SCROLLER_AR_SIZE];
+int arLowB[SCROLLER_AR_SIZE];
+int arHighB[SCROLLER_AR_SIZE];
+
/* Setup function for the scroll wheel. Initializes
the relevant variables. */
void opt_encoder_init(void) {
diff --git a/keyboards/ploopyco/opt_encoder.h b/keyboards/ploopyco/opt_encoder.h
index 23a170d59f..17c25bc86f 100644
--- a/keyboards/ploopyco/opt_encoder.h
+++ b/keyboards/ploopyco/opt_encoder.h
@@ -28,33 +28,33 @@
enum State { HIHI, HILO, LOLO, LOHI };
-enum State state;
+extern enum State state;
/* Variables used for scroll wheel functionality. */
-bool lohif;
-bool hilof;
-int lowA;
-int highA;
-bool cLowA;
-bool cHighA;
-int lowIndexA;
-int highIndexA;
-bool lowOverflowA;
-bool highOverflowA;
-int lowB;
-int highB;
-bool cLowB;
-bool cHighB;
-int lowIndexB;
-int highIndexB;
-bool lowOverflowB;
-bool highOverflowB;
-int scrollThresholdA;
-int scrollThresholdB;
-int arLowA[SCROLLER_AR_SIZE];
-int arHighA[SCROLLER_AR_SIZE];
-int arLowB[SCROLLER_AR_SIZE];
-int arHighB[SCROLLER_AR_SIZE];
+extern bool lohif;
+extern bool hilof;
+extern int lowA;
+extern int highA;
+extern bool cLowA;
+extern bool cHighA;
+extern int lowIndexA;
+extern int highIndexA;
+extern bool lowOverflowA;
+extern bool highOverflowA;
+extern int lowB;
+extern int highB;
+extern bool cLowB;
+extern bool cHighB;
+extern int lowIndexB;
+extern int highIndexB;
+extern bool lowOverflowB;
+extern bool highOverflowB;
+extern int scrollThresholdA;
+extern int scrollThresholdB;
+extern int arLowA[SCROLLER_AR_SIZE];
+extern int arHighA[SCROLLER_AR_SIZE];
+extern int arLowB[SCROLLER_AR_SIZE];
+extern int arHighB[SCROLLER_AR_SIZE];
void calculateThresholdA(int curA);
void calculateThresholdB(int curB);