avsa242 / p2-spin-standard-library

A curated collection of essential Spin2 objects
MIT License
3 stars 3 forks source link

LIS3DH: Interface selection must be #defined in both the app and the driver #4

Closed avsa242 closed 4 years ago

avsa242 commented 4 years ago

To select the I2C or SPI interface for the driver, the #define must be set in both the application and the driver, due to the way the preprocessor works in FastSpin

avsa242 commented 4 years ago

Resolved in 08404401bd05f1efd15f4038f6c177d4b7683bf3 Add two intermediate files (one specific to i2c and one to spi), one of which you'd declare as the accelerometer object in your app. The files just contain the same #define, as well as simply #include the existing dual-interface driver.