Skip to content

Commit

Permalink
Merge pull request #25 from cparata/main
Browse files Browse the repository at this point in the history
Fix compilation issue on ESP32 platforms
  • Loading branch information
cparata authored Sep 21, 2023
2 parents 5f1500b + f9b9fea commit 071790a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=STM32duino LSM6DSOX
version=2.3.3
version=2.3.4
author=SRA
maintainer=stm32duino
sentence=Ultra Low Power inertial measurement unit.
Expand Down
6 changes: 6 additions & 0 deletions src/LSM6DSOXSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
#include "lsm6dsox_reg.h"

/* Defines -------------------------------------------------------------------*/
/* For compatibility with ESP32 platforms */
#ifdef ESP32
#ifndef MSBFIRST
#define MSBFIRST SPI_MSBFIRST
#endif
#endif

#define LSM6DSOX_ACC_SENSITIVITY_FS_2G 0.061f
#define LSM6DSOX_ACC_SENSITIVITY_FS_4G 0.122f
Expand Down
1 change: 1 addition & 0 deletions src/lsm6dsox_reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -10504,6 +10504,7 @@ int32_t lsm6dsox_mode_set(lsm6dsox_ctx_t *ctx, lsm6dsox_ctx_t *aux_ctx,
/* FIXME: Remove warnings with STM32CubeIDE */
ctrl3_c.not_used_01 = 0;
ctrl4_c.not_used_01 = 0;
spi2_ctrl2_ois.not_used_01 = 0;

/* reading input configuration */
xl_hm_mode = ( (uint8_t)val->ui.xl.odr & 0x10U ) >> 4;
Expand Down

0 comments on commit 071790a

Please sign in to comment.