Skip to content

Commit ad26ec4

Browse files
committed
исправлена ошибка
Ошибка - некорректная запись значений в методе setOutputResolutionABZ(word _resolution) Спасибо пользователю dRon
1 parent 1cfeae5 commit ad26ec4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/MT6701_I2C.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ word MT6701I2C::getOutputResolutionABZ(void) {
376376
void MT6701I2C::setOutputResolutionABZ(word _resolution) {
377377
uint8_t reg_l = (_resolution - 1) & 0xFF;
378378
uint8_t reg_h = MT_RequestSingleRegister(MT6701_I2C_EEPROM_ABZ_RES_REG_H);
379+
reg_h &= ~0x03; // исправление от dRon
379380
reg_h |= ((_resolution - 1) >> 8) & 0x03;
380381
MT_WriteOneByte(MT6701_I2C_EEPROM_ABZ_RES_REG_H, reg_h);
381382
MT_WriteOneByte(MT6701_I2C_EEPROM_ABZ_RES_REG_L, reg_l);

0 commit comments

Comments
 (0)