diff options
author | Glen D'souza <gdsouza@linuxmail.org> | 2021-01-19 07:53:54 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 13:23:54 +1100 |
commit | d24fe4f1ca49b2143b3f3d260a0a63088b521673 (patch) | |
tree | be1471322ea411ad5f7ee3e443d4d19774e10c5c | |
parent | 677789df773479dcedd0c3d71885ff5e89b7b5b6 (diff) | |
download | qmk_firmware-d24fe4f1ca49b2143b3f3d260a0a63088b521673.tar.gz qmk_firmware-d24fe4f1ca49b2143b3f3d260a0a63088b521673.zip |
GCC 10 compatibility for Ploopy optical encoder (#11586)
-rw-r--r-- | keyboards/ploopyco/opt_encoder.c | 28 | ||||
-rw-r--r-- | keyboards/ploopyco/opt_encoder.h | 50 |
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 | ||
19 | enum State state; | ||
20 | |||
21 | /* Variables used for scroll wheel functionality. */ | ||
22 | bool lohif; | ||
23 | bool hilof; | ||
24 | int lowA; | ||
25 | int highA; | ||
26 | bool cLowA; | ||
27 | bool cHighA; | ||
28 | int lowIndexA; | ||
29 | int highIndexA; | ||
30 | bool lowOverflowA; | ||
31 | bool highOverflowA; | ||
32 | int lowB; | ||
33 | int highB; | ||
34 | bool cLowB; | ||
35 | bool cHighB; | ||
36 | int lowIndexB; | ||
37 | int highIndexB; | ||
38 | bool lowOverflowB; | ||
39 | bool highOverflowB; | ||
40 | int scrollThresholdA; | ||
41 | int scrollThresholdB; | ||
42 | int arLowA[SCROLLER_AR_SIZE]; | ||
43 | int arHighA[SCROLLER_AR_SIZE]; | ||
44 | int arLowB[SCROLLER_AR_SIZE]; | ||
45 | int 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. */ |
21 | void opt_encoder_init(void) { | 49 | void 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 | ||
29 | enum State { HIHI, HILO, LOLO, LOHI }; | 29 | enum State { HIHI, HILO, LOLO, LOHI }; |
30 | 30 | ||
31 | enum State state; | 31 | extern enum State state; |
32 | 32 | ||
33 | /* Variables used for scroll wheel functionality. */ | 33 | /* Variables used for scroll wheel functionality. */ |
34 | bool lohif; | 34 | extern bool lohif; |
35 | bool hilof; | 35 | extern bool hilof; |
36 | int lowA; | 36 | extern int lowA; |
37 | int highA; | 37 | extern int highA; |
38 | bool cLowA; | 38 | extern bool cLowA; |
39 | bool cHighA; | 39 | extern bool cHighA; |
40 | int lowIndexA; | 40 | extern int lowIndexA; |
41 | int highIndexA; | 41 | extern int highIndexA; |
42 | bool lowOverflowA; | 42 | extern bool lowOverflowA; |
43 | bool highOverflowA; | 43 | extern bool highOverflowA; |
44 | int lowB; | 44 | extern int lowB; |
45 | int highB; | 45 | extern int highB; |
46 | bool cLowB; | 46 | extern bool cLowB; |
47 | bool cHighB; | 47 | extern bool cHighB; |
48 | int lowIndexB; | 48 | extern int lowIndexB; |
49 | int highIndexB; | 49 | extern int highIndexB; |
50 | bool lowOverflowB; | 50 | extern bool lowOverflowB; |
51 | bool highOverflowB; | 51 | extern bool highOverflowB; |
52 | int scrollThresholdA; | 52 | extern int scrollThresholdA; |
53 | int scrollThresholdB; | 53 | extern int scrollThresholdB; |
54 | int arLowA[SCROLLER_AR_SIZE]; | 54 | extern int arLowA[SCROLLER_AR_SIZE]; |
55 | int arHighA[SCROLLER_AR_SIZE]; | 55 | extern int arHighA[SCROLLER_AR_SIZE]; |
56 | int arLowB[SCROLLER_AR_SIZE]; | 56 | extern int arLowB[SCROLLER_AR_SIZE]; |
57 | int arHighB[SCROLLER_AR_SIZE]; | 57 | extern int arHighB[SCROLLER_AR_SIZE]; |
58 | 58 | ||
59 | void calculateThresholdA(int curA); | 59 | void calculateThresholdA(int curA); |
60 | void calculateThresholdB(int curB); | 60 | void calculateThresholdB(int curB); |