Skip to content

Commit

Permalink
Fix SPI usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mhaack committed Jan 31, 2017
1 parent 6e99f10 commit 6728398
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Version History
---------------
* [V_1.0.0](https://github.com/mhaack/Adafruit_BME280_Library/releases/tag/1.0.0) - September 2015 Initial Release
* [V_1.0.4](https://github.com/mhaack/Adafruit_BME280_Library/releases/tag/1.0.4.particle) - October 2015 pull from Adafruit repo to support multiple sensors with different calibration values
* [V_1.1.0](https://github.com/mhaack/Adafruit_BME280_Library/releases/tag/1.1.0.particle) - January 2017 migrated to V2 library, pulled minor changes
* [V_1.1.2](https://github.com/mhaack/Adafruit_BME280_Library/releases/tag/1.1.2.particle) - January 2017 migrated to V2 library, pulled minor changes

License Information
-------------------
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit_BME280
version=1.1.1
version=1.1.2
license=BSD license
author=Adafruit <[email protected]>, Markus Haack (https://github.com/mhaack)
sentence=Adafruit BME280 Library
Expand Down
8 changes: 4 additions & 4 deletions src/Adafruit_BME280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ uint32_t Adafruit_BME280::read24(byte reg)

Wire.endTransmission();
} else {
if (_sck == -1)
SPI.beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
// if (_sck == -1)
// SPI.beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
digitalWrite(_cs, LOW);
spixfer(reg | 0x80); // read, bit 7 high

Expand All @@ -255,8 +255,8 @@ uint32_t Adafruit_BME280::read24(byte reg)
value |= spixfer(0);

digitalWrite(_cs, HIGH);
if (_sck == -1)
SPI.endTransaction(); // release the SPI bus
// if (_sck == -1)
// SPI.endTransaction(); // release the SPI bus
}

return value;
Expand Down

0 comments on commit 6728398

Please sign in to comment.