Skip to content

Commit da8c325

Browse files
committed
minor-ish fixes
1 parent 0de765b commit da8c325

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/F_AK09918.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void AK09918::update() {
9292
}
9393
else
9494
{
95-
if(!readByteI2C(wire, AK09918_ADDRESS, AK09918_CNTL2) & 0x01){
95+
if(!(readByteI2C(wire, AK09918_ADDRESS, AK09918_CNTL2) & 0x01)){
9696
writeByteI2C(wire, AK09918_ADDRESS, AK09918_CNTL2, 0x01); // Set magnetometer to single measure mode.
9797
}
9898
}

src/F_AK8975.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void AK8975::update() {
106106
}
107107
else
108108
{
109-
if(!readByteI2C(wire, AK8975_ADDRESS, AK8975_CNTL) & 0x01){
109+
if(!(readByteI2C(wire, AK8975_ADDRESS, AK8975_CNTL) & 0x01)){
110110
writeByteI2C(wire, AK8975_ADDRESS, AK8975_CNTL, 0x01); // Set magnetometer to single measure mode.
111111
}
112112
}

src/F_BMI160.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ int BMI160::setGyroRange(int range) {
168168
c = 0x03;
169169
}
170170
else if (range == 125){
171-
gRes = 125.f / 32768.f; //ares value for range (250dps) readings
171+
gRes = 125.f / 32768.f; //ares value for range (125dps) readings
172172
c = 0x04;
173173
}
174174
else {

src/F_HMC5883L.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int HMC5883L::init(calData cal, uint8_t address)
3333

3434
void HMC5883L::update()
3535
{
36-
if (!(readByteI2C(wire, IMUAddress, HMC5883L_STATUS) & 0x01) && (readByteI2C(wire, IMUAddress, HMC5883L_STATUS) & 0x02)) {
36+
if (!(readByteI2C(wire, IMUAddress, HMC5883L_STATUS) & 0x01) || (readByteI2C(wire, IMUAddress, HMC5883L_STATUS) & 0x02)) {
3737
mag.magX = 0.f;
3838
mag.magY = 0.f;
3939
mag.magZ = 0.f;

src/F_MPU6886.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ void MPU6886::calibrateAccelGyro(calData* cal)
255255
delay(40); // accumulate 40 samples in 40 milliseconds = 480 bytes
256256

257257
// At end of sample accumulation, turn off FIFO sensor read
258-
readBytesI2C(wire, IMUAddress, MPU6886_FIFO_COUNTH, 2, &data[0]); // read FIFO sample count
259258
writeByteI2C(wire, IMUAddress, MPU6886_FIFO_EN, 0x00); // Disable gyro and accelerometer sensors for FIFO
259+
readBytesI2C(wire, IMUAddress, MPU6886_FIFO_COUNTH, 2, &data[0]); // read FIFO sample count
260260
fifo_count = ((uint16_t)data[0] << 8) | data[1];
261261
packet_count = fifo_count / 12;// How many sets of full gyro and accelerometer data for averaging
262262

src/F_QMI8658.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int QMI8658::init(calData cal, uint8_t address)
3535
delay(100); // wait until they're done starting up...
3636

3737
aRes = 16.f / 32768.f; //ares value for full range (16g) readings
38-
gRes = 2048.f / 32768.f; //gres value for full range (2000dps) readings
38+
gRes = 2048.f / 32768.f; //gres value for full range (2048dps) readings
3939

4040
return 0;
4141
}

0 commit comments

Comments
 (0)