Skip to content

Commit

Permalink
Remove Wire.begin() from begin()
Browse files Browse the repository at this point in the history
  • Loading branch information
nseidle committed Dec 30, 2020
1 parent ab32ea0 commit d2eda03
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/SparkFunBME280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,18 @@ uint8_t BME280::begin()

case I2C_MODE:

switch(_wireType)
{
case(HARD_WIRE):
_hardPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug.
break;
case(SOFT_WIRE):
#ifdef SoftwareWire_h
_softPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug.
#endif
break;
}
//Removing port begin from library. This should be done by user otherwise this library will overwrite Wire settings such as clock speed.
// switch(_wireType)
// {
// case(HARD_WIRE):
// _hardPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug.
// break;
// case(SOFT_WIRE):
// #ifdef SoftwareWire_h
// _softPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug.
// #endif
// break;
// }
break;

case SPI_MODE:
Expand Down

0 comments on commit d2eda03

Please sign in to comment.