Skip to content

Commit

Permalink
Merge pull request #110 from sparkfun/release_candidate
Browse files Browse the repository at this point in the history
v1.2.11 - fix #109
  • Loading branch information
PaulZC authored Jan 12, 2023
2 parents fd948fb + 49959e8 commit f0b90f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit f0b90f4

Please sign in to comment.