aboutsummaryrefslogtreecommitdiff
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
parent677789df773479dcedd0c3d71885ff5e89b7b5b6 (diff)
downloadqmk_firmware-d24fe4f1ca49b2143b3f3d260a0a63088b521673.tar.gz
qmk_firmware-d24fe4f1ca49b2143b3f3d260a0a63088b521673.zip
GCC 10 compatibility for Ploopy optical encoder (#11586)
-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 44bcd5eb8..8698351c2 100644
--- a/keyboards/ploopyco/opt_encoder.c
+++ b/keyboards/ploopyco/opt_encoder.c
@@ -16,6 +16,34 @@
16 */ 16 */
17#include "opt_encoder.h" 17#include "opt_encoder.h"
18 18
19enum State state;
20
21/* Variables used for scroll wheel functionality. */
22bool lohif;
23bool hilof;
24int lowA;
25int highA;
26bool cLowA;
27bool cHighA;
28int lowIndexA;
29int highIndexA;
30bool lowOverflowA;
31bool highOverflowA;
32int lowB;
33int highB;
34bool cLowB;
35bool cHighB;
36int lowIndexB;
37int highIndexB;
38bool lowOverflowB;
39bool highOverflowB;
40int scrollThresholdA;
41int scrollThresholdB;
42int arLowA[SCROLLER_AR_SIZE];
43int arHighA[SCROLLER_AR_SIZE];
44int arLowB[SCROLLER_AR_SIZE];
45int arHighB[SCROLLER_AR_SIZE];
46
19/* Setup function for the scroll wheel. Initializes 47/* Setup function for the scroll wheel. Initializes
20 the relevant variables. */ 48 the relevant variables. */
21void opt_encoder_init(void) { 49void opt_encoder_init(void) {
diff --git a/keyboards/ploopyco/opt_encoder.h b/keyboards/ploopyco/opt_encoder.h
index 23a170d59..17c25bc86 100644
--- a/keyboards/ploopyco/opt_encoder.h
+++ b/keyboards/ploopyco/opt_encoder.h
@@ -28,33 +28,33 @@
28 28
29enum State { HIHI, HILO, LOLO, LOHI }; 29enum State { HIHI, HILO, LOLO, LOHI };
30 30
31enum State state; 31extern enum State state;
32 32
33/* Variables used for scroll wheel functionality. */ 33/* Variables used for scroll wheel functionality. */
34bool lohif; 34extern bool lohif;
35bool hilof; 35extern bool hilof;
36int lowA; 36extern int lowA;
37int highA; 37extern int highA;
38bool cLowA; 38extern bool cLowA;
39bool cHighA; 39extern bool cHighA;
40int lowIndexA; 40extern int lowIndexA;
41int highIndexA; 41extern int highIndexA;
42bool lowOverflowA; 42extern bool lowOverflowA;
43bool highOverflowA; 43extern bool highOverflowA;
44int lowB; 44extern int lowB;
45int highB; 45extern int highB;
46bool cLowB; 46extern bool cLowB;
47bool cHighB; 47extern bool cHighB;
48int lowIndexB; 48extern int lowIndexB;
49int highIndexB; 49extern int highIndexB;
50bool lowOverflowB; 50extern bool lowOverflowB;
51bool highOverflowB; 51extern bool highOverflowB;
52int scrollThresholdA; 52extern int scrollThresholdA;
53int scrollThresholdB; 53extern int scrollThresholdB;
54int arLowA[SCROLLER_AR_SIZE]; 54extern int arLowA[SCROLLER_AR_SIZE];
55int arHighA[SCROLLER_AR_SIZE]; 55extern int arHighA[SCROLLER_AR_SIZE];
56int arLowB[SCROLLER_AR_SIZE]; 56extern int arLowB[SCROLLER_AR_SIZE];
57int arHighB[SCROLLER_AR_SIZE]; 57extern int arHighB[SCROLLER_AR_SIZE];
58 58
59void calculateThresholdA(int curA); 59void calculateThresholdA(int curA);
60void calculateThresholdB(int curB); 60void calculateThresholdB(int curB);