mostly compiling

This commit is contained in:
Jack Humbert 2018-06-01 11:31:29 -04:00
parent 161c68b48a
commit 874f5a5c07
20 changed files with 2955 additions and 7 deletions

View file

@ -96,6 +96,9 @@ bool last_dip_switch[4] = {0};
#define ENCODER_RESOLUTION 4
#endif
#define COUNTRECLOCKWISE 0
#define CLOCKWISE 1
uint8_t matrix_scan(void) {
// dip switch
dip_switch[0] = !palReadPad(GPIOB, 14);
@ -113,10 +116,10 @@ uint8_t matrix_scan(void) {
encoder_state |= (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1);
encoder_value += encoder_LUT[encoder_state & 0xF];
if (encoder_value >= ENCODER_RESOLUTION) {
encoder_update(0);
encoder_update(COUNTRECLOCKWISE);
}
if (encoder_value <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise
encoder_update(1);
encoder_update(CLOCKWISE);
}
encoder_value %= ENCODER_RESOLUTION;