Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library
version=1.2.10
version=1.2.11
author=SparkFun Electronics <techsupport@sparkfun.com>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Use the low-power high-resolution ICM 20948 9 DoF IMU from Invensense with I2C or SPI. Version 1.2 of the library includes support for the InvenSense Digital Motion Processor (DMP™).
Expand Down
6 changes: 3 additions & 3 deletions src/util/ICM_20948_C.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ ICM_20948_Status_e ICM_20948_set_sample_rate(ICM_20948_Device_t *pdev, ICM_20948
if (sensors & ICM_20948_Internal_Acc)
{
retval |= ICM_20948_set_bank(pdev, 2); // Must be in the right bank
uint8_t div1 = (smplrt.a << 8);
uint8_t div1 = (smplrt.a >> 8); // Thank you @yanivamichy #109
uint8_t div2 = (smplrt.a & 0xFF);
retval |= ICM_20948_execute_w(pdev, AGB2_REG_ACCEL_SMPLRT_DIV_1, &div1, 1);
retval |= ICM_20948_execute_w(pdev, AGB2_REG_ACCEL_SMPLRT_DIV_2, &div2, 1);
Expand Down Expand Up @@ -1977,7 +1977,7 @@ ICM_20948_Status_e inv_icm20948_read_dmp_data(ICM_20948_Device_t *pdev, icm_2094
return result;
for (int i = 0; i < icm_20948_DMP_Header_Bytes; i++)
{
aShort |= ((uint16_t)fifoBytes[i]) << (8 - (i * 8));
aShort |= ((uint16_t)fifoBytes[i]) << (8 - (i * 8)); // MSB first
}
data->header = aShort; // Store the header in data->header
fifo_count -= icm_20948_DMP_Header_Bytes; // Decrement the count
Expand Down Expand Up @@ -2248,7 +2248,7 @@ ICM_20948_Status_e inv_icm20948_read_dmp_data(ICM_20948_Device_t *pdev, icm_2094
uint32_t aWord = 0;
for (int i = 0; i < icm_20948_DMP_Step_Detector_Bytes; i++)
{
aWord |= ((uint32_t)fifoBytes[i]) << (24 - (i * 8));
aWord |= ((uint32_t)fifoBytes[i]) << (24 - (i * 8)); // MSB first
}
data->Pedometer_Timestamp = aWord;
fifo_count -= icm_20948_DMP_Step_Detector_Bytes; // Decrement the count
Expand Down