Skip to content

Commit a749c5e

Browse files
author
Richard Unger
committed
fix setting ABZ resolution in MT6835
1 parent 0476f73 commit a749c5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/encoders/mt6835/MT6835.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ uint16_t MT6835::getABZResolution(){
120120
return (hi << 6) | lo.abz_res_low;
121121
};
122122
void MT6835::setABZResolution(uint16_t res){
123-
uint8_t hi = (res >> 2);
123+
uint8_t hi = (res >> 6);
124124
MT6835ABZRes lo = {
125125
.reg = readRegister(MT6835_REG_ABZ_RES2)
126126
};
127-
lo.abz_res_low = res & 0x3F;
127+
lo.abz_res_low = (res & 0x3F);
128128
writeRegister(MT6835_REG_ABZ_RES1, hi);
129129
writeRegister(MT6835_REG_ABZ_RES2, lo.reg);
130130
};

0 commit comments

Comments
 (0)