Skip to content

Commit 8b79109

Browse files
committed
Modifying the constructor and begin()
The default bus identifier is read from the database. Removing setBus() from begin()
1 parent 3935929 commit 8b79109

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/piduino/arduino/Wire.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
class TwoWire : public Piduino::I2cDev {
3535

3636
public:
37-
TwoWire(int id = 0) : Piduino::I2cDev(id) {}
37+
TwoWire(int id = Info::defaultBus().id()) : Piduino::I2cDev(id) {}
3838
virtual ~TwoWire() {}
3939
void begin() {
40-
setBus (Info::defaultBus());
4140
if (!open ()) {
4241
throw std::system_error (errno, std::system_category(),
4342
"Error when opening the I2C bus " +

0 commit comments

Comments
 (0)