1
0
Fork 0
forked from nuttx/nuttx-update

bmi160: fix Parameter passing error when use spi

nuttx/drivers/sensors/bmi160_uorb.c:596:18: warning: passing argument 1 of ‘bmi160_getreg8’ from incompatible pointer type [-Wincompatible-pointer-types]
  596 |   bmi160_getreg8(priv, 0x7f);
      |                  ^~~~
      |                  |
      |                  struct bmi160_dev_uorb_s *
In file included from nuttx/drivers/sensors/bmi160_uorb.c:25:
nuttx/drivers/sensors/bmi160_base.h:235:49: note: expected ‘struct bmi160_dev_s *’ but argument is of type ‘struct bmi160_dev_uorb_s *’
  235 | uint8_t bmi160_getreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr);
      |                            ~~~~~~~~~~~~~~~~~~~~~^~~~
nuttx/drivers/sensors/bmi160_uorb.c:597:18: warning: passing argument 1 of ‘bmi160_getreg8’ from incompatible pointer type [-Wincompatible-pointer-types]
  597 |   bmi160_getreg8(priv, 0x7f); /* workaround: fail to switch SPI, run twice */
      |                  ^~~~
      |                  |
      |                  struct bmi160_dev_uorb_s *

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
This commit is contained in:
zhangshoukui 2024-10-18 15:34:36 +08:00 committed by Xiang Xiao
parent 50f16c840c
commit a7f7afe019

View file

@ -593,8 +593,8 @@ static int bmi160_register_accel(int devno,
/* BMI160 detects communication bus is SPI by rising edge of CS. */
bmi160_getreg8(priv, 0x7f);
bmi160_getreg8(priv, 0x7f); /* workaround: fail to switch SPI, run twice */
bmi160_getreg8(&priv->dev, 0x7f);
bmi160_getreg8(&priv->dev, 0x7f); /* workaround: fail to switch SPI, run twice */
nxsig_usleep(200);
#endif