forked from mirrors/qmk_firmware
GCC 10 compatibility for Ploopy optical encoder (#11586)
This commit is contained in:
parent
677789df77
commit
d24fe4f1ca
2 changed files with 53 additions and 25 deletions
|
@ -16,6 +16,34 @@
|
||||||
*/
|
*/
|
||||||
#include "opt_encoder.h"
|
#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
|
/* Setup function for the scroll wheel. Initializes
|
||||||
the relevant variables. */
|
the relevant variables. */
|
||||||
void opt_encoder_init(void) {
|
void opt_encoder_init(void) {
|
||||||
|
|
|
@ -28,33 +28,33 @@
|
||||||
|
|
||||||
enum State { HIHI, HILO, LOLO, LOHI };
|
enum State { HIHI, HILO, LOLO, LOHI };
|
||||||
|
|
||||||
enum State state;
|
extern enum State state;
|
||||||
|
|
||||||
/* Variables used for scroll wheel functionality. */
|
/* Variables used for scroll wheel functionality. */
|
||||||
bool lohif;
|
extern bool lohif;
|
||||||
bool hilof;
|
extern bool hilof;
|
||||||
int lowA;
|
extern int lowA;
|
||||||
int highA;
|
extern int highA;
|
||||||
bool cLowA;
|
extern bool cLowA;
|
||||||
bool cHighA;
|
extern bool cHighA;
|
||||||
int lowIndexA;
|
extern int lowIndexA;
|
||||||
int highIndexA;
|
extern int highIndexA;
|
||||||
bool lowOverflowA;
|
extern bool lowOverflowA;
|
||||||
bool highOverflowA;
|
extern bool highOverflowA;
|
||||||
int lowB;
|
extern int lowB;
|
||||||
int highB;
|
extern int highB;
|
||||||
bool cLowB;
|
extern bool cLowB;
|
||||||
bool cHighB;
|
extern bool cHighB;
|
||||||
int lowIndexB;
|
extern int lowIndexB;
|
||||||
int highIndexB;
|
extern int highIndexB;
|
||||||
bool lowOverflowB;
|
extern bool lowOverflowB;
|
||||||
bool highOverflowB;
|
extern bool highOverflowB;
|
||||||
int scrollThresholdA;
|
extern int scrollThresholdA;
|
||||||
int scrollThresholdB;
|
extern int scrollThresholdB;
|
||||||
int arLowA[SCROLLER_AR_SIZE];
|
extern int arLowA[SCROLLER_AR_SIZE];
|
||||||
int arHighA[SCROLLER_AR_SIZE];
|
extern int arHighA[SCROLLER_AR_SIZE];
|
||||||
int arLowB[SCROLLER_AR_SIZE];
|
extern int arLowB[SCROLLER_AR_SIZE];
|
||||||
int arHighB[SCROLLER_AR_SIZE];
|
extern int arHighB[SCROLLER_AR_SIZE];
|
||||||
|
|
||||||
void calculateThresholdA(int curA);
|
void calculateThresholdA(int curA);
|
||||||
void calculateThresholdB(int curB);
|
void calculateThresholdB(int curB);
|
||||||
|
|
Loading…
Reference in a new issue