Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
caiodasilva2005 committed Oct 27, 2024
1 parent e2436cf commit bccd354
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions Core/Src/msb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@ extern device_loc_t device_loc;
osMutexId_t i2c_mutex;

// reads imu reg
static inline int imu_read_reg(uint8_t *data,
uint8_t reg,
uint8_t length) {

return HAL_I2C_Mem_Read(&hi2c3, LSM6DSO_I2C_ADDRESS, reg,
I2C_MEMADD_SIZE_8BIT, data, length, HAL_MAX_DELAY);
static inline int imu_read_reg(uint8_t *data, uint8_t reg, uint8_t length)
{
return HAL_I2C_Mem_Read(&hi2c3, LSM6DSO_I2C_ADDRESS, reg,
I2C_MEMADD_SIZE_8BIT, data, length,
HAL_MAX_DELAY);
}

// read imu write
static inline int imu_write_reg(uint8_t *data,
uint8_t reg,
uint8_t length) {

return HAL_I2C_Mem_Write(&hi2c3, LSM6DSO_I2C_ADDRESS, reg,
I2C_MEMADD_SIZE_8BIT, data, length, HAL_MAX_DELAY);
// read imu write
static inline int imu_write_reg(uint8_t *data, uint8_t reg, uint8_t length)
{
return HAL_I2C_Mem_Write(&hi2c3, LSM6DSO_I2C_ADDRESS, reg,
I2C_MEMADD_SIZE_8BIT, data, length,
HAL_MAX_DELAY);
}

#ifdef SENSOR_TEMP
Expand Down Expand Up @@ -59,9 +57,9 @@ int8_t msb_init()
#endif

#ifdef SENSOR_IMU

/* Initialize the IMU */
assert(!lsm6dso_init(&imu, imu_read_reg, imu_write_reg)); /* This is always connected */
assert(!lsm6dso_init(&imu, imu_read_reg,
imu_write_reg)); /* This is always connected */
#endif

#ifdef SENSOR_TOF
Expand Down

0 comments on commit bccd354

Please sign in to comment.