Closed Telemattic closed 3 years ago
@Telemattic Thanks for the PR. Looks like the CI checks are failing on formatting (cosmetic). Here's how to run clang-format to fix: https://learn.adafruit.com/the-well-automated-arduino-library/formatting-with-clang-format
Thanks! That fixed it.
Initialize Adafruit_BMP280::_config and _ctrlMeas members to power-on-reset state in their constructors. Note that Adafruit_BMP280::begin() calls Adafruit_BMP280::setSampling() which will mostly initialize these structs as well. The defect in issue #60 is that _config.spi3w_en is never initialized and consequently the sensor can end up configured for spi 3-wire mode, which is not supported by the code. Fix is to initialize all members of these configuration structs to the power-on-reset values defined in the datasheet.
Testing: ran my local code that demonstrated the defect
Risk: minimal -- setSampling() already initializes all of the struct members save spi3w_en, and if that member is ever non-zero the sensor is put into a mode not supported by this library!