Skip to content

Commit 2b1640a

Browse files
authored
Merge pull request #41 from quicksketch/26--followup-fix-uint8_t-size
Issue #26: Follow-up to size delay amount within uint8_t.
2 parents 65af2fd + ed23b32 commit 2b1640a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/F_LSM6DS3.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ int LSM6DS3::init(calData cal, uint8_t address)
77
//initialize address variable and calibration data.
88
IMUAddress = address;
99

10-
if (cal.valid == false)
10+
if (cal.valid == false)
1111
{
1212
calibration = { 0 };
1313
}
1414
else
1515
{
1616
calibration = cal;
1717
}
18-
19-
uint8_t IMUWhoAmI = checkReady(IMUAddress, 500);
18+
19+
uint8_t IMUWhoAmI = checkReady(IMUAddress, 100);
2020
if (!(IMUWhoAmI == LSM6DS3_WHOAMI_DEFAULT_VALUE)) {
2121
if (!(IMUWhoAmI == LSM6DS3TR_C_WHOAMI_DEFAULT_VALUE)) {
2222
return -1;
@@ -26,7 +26,7 @@ int LSM6DS3::init(calData cal, uint8_t address)
2626
// reset device
2727
writeByteI2C(wire, IMUAddress, LSM6DS3_CTRL3_C, 0x01); // Toggle softreset
2828
while (!checkReady(IMUAddress, 100)); // wait for reset
29-
29+
3030
writeByteI2C(wire, IMUAddress, LSM6DS3_CTRL1_XL, 0x47); // Start up accelerometer, set range to +-16g, set output data rate to 104hz, BW_XL bits to 11.
3131
writeByteI2C(wire, IMUAddress, LSM6DS3_CTRL2_G, 0x4C); // Start up gyroscope, set range to -+2000dps, output data rate to 104hz.
3232
writeByteI2C(wire, IMUAddress, LSM6DS3_CTRL4_C, 0x80); // Set XL_BW_SCAL_ODR;
@@ -260,4 +260,4 @@ void LSM6DS3::calibrateAccelGyro(calData* cal)
260260
cal->gyroBias[1] = (float)gyro_bias[1];
261261
cal->gyroBias[2] = (float)gyro_bias[2];
262262
cal->valid = true;
263-
}
263+
}

0 commit comments

Comments
 (0)