Browse Source

🐛 Fix TWIBus Wire.begin call (#23183)

Stuart Pittaway 2 years ago
parent
commit
6580e655fb
No account linked to committer's email address
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      Marlin/src/feature/twibus.cpp

+ 3
- 4
Marlin/src/feature/twibus.cpp View File

@@ -40,11 +40,11 @@ TWIBus::TWIBus() {
40 40
       Wire.setSCL(pin_t(I2C_SCL_PIN));
41 41
     #endif
42 42
 
43
-    Wire.begin();                    // No address joins the BUS as the master
43
+    Wire.begin();                   // No address joins the BUS as the master
44 44
 
45 45
   #else
46 46
 
47
-    Wire.begin(I2C_SLAVE_ADDRESS); // Join the bus as a slave
47
+    Wire.begin(I2C_SLAVE_ADDRESS);  // Join the bus as a slave
48 48
 
49 49
   #endif
50 50
   reset();
@@ -56,9 +56,8 @@ void TWIBus::reset() {
56 56
 }
57 57
 
58 58
 void TWIBus::address(const uint8_t adr) {
59
-  if (!WITHIN(adr, 8, 127)) {
59
+  if (!WITHIN(adr, 8, 127))
60 60
     SERIAL_ECHO_MSG("Bad I2C address (8-127)");
61
-  }
62 61
 
63 62
   addr = adr;
64 63
 

Loading…
Cancel
Save