Ultra-compact high-performance eCompass module: ultra-low power 3D accelerometer and 3D magnetometer.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: HelloWorld_ST_Sensors MOTENV_Mbed mbed-os-mqtt-client LSM303AGR_JS ... more
Revision 4:6c7e83ae885e, committed 2019-03-04
- Comitter:
- cparata
- Date:
- Mon Mar 04 13:08:21 2019 +0000
- Parent:
- 3:652f8f67d991
- Commit message:
- Fix issue in SPI write
Changed in this revision
LSM303AGRAccSensor.h | Show annotated file Show diff for this revision Revisions of this file |
LSM303AGRMagSensor.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 652f8f67d991 -r 6c7e83ae885e LSM303AGRAccSensor.h --- a/LSM303AGRAccSensor.h Tue Oct 03 13:58:21 2017 +0200 +++ b/LSM303AGRAccSensor.h Mon Mar 04 13:08:21 2019 +0000 @@ -124,11 +124,11 @@ if (_dev_spi) { _dev_spi->lock(); _cs_pin = 0; - int data = _dev_spi->write(RegisterAddr); + _dev_spi->write(RegisterAddr); _dev_spi->write((char *)pBuffer, (int) NumByteToWrite, NULL, 0); _cs_pin = 1; _dev_spi->unlock(); - return data; + return 0; } if (_dev_i2c) return (uint8_t)_dev_i2c->i2c_write(pBuffer, _address, RegisterAddr, NumByteToWrite); return 1;
diff -r 652f8f67d991 -r 6c7e83ae885e LSM303AGRMagSensor.h --- a/LSM303AGRMagSensor.h Tue Oct 03 13:58:21 2017 +0200 +++ b/LSM303AGRMagSensor.h Mon Mar 04 13:08:21 2019 +0000 @@ -111,11 +111,11 @@ if (_dev_spi) { _dev_spi->lock(); _cs_pin = 0; - int data = _dev_spi->write(RegisterAddr); + _dev_spi->write(RegisterAddr); _dev_spi->write((char *)pBuffer, (int) NumByteToWrite, NULL, 0); _cs_pin = 1; _dev_spi->unlock(); - return data; + return 0; } if (_dev_i2c) return (uint8_t) _dev_i2c->i2c_write(pBuffer, _address, RegisterAddr, NumByteToWrite); return 1;