Skip to content

Commit aee5f37

Browse files
committed
Remove steps to disable pull ups as they are not needed
The Due has external pull-ups on the SDA0 and SCL0, and PIO_Configure in Wire*_Init does not enable then.
1 parent a44bbbf commit aee5f37

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

libraries/Wire/Wire.cpp

+6-12
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,9 @@ static void Wire_Deinit(void) {
398398

399399
pmc_disable_periph_clk(WIRE_INTERFACE_ID);
400400

401-
// disable pull ups
402-
pinMode(PIN_WIRE_SDA, OUTPUT);
403-
pinMode(PIN_WIRE_SCL, OUTPUT);
404-
405-
digitalWrite(PIN_WIRE_SDA, LOW);
406-
digitalWrite(PIN_WIRE_SCL, LOW);
401+
// no need to undo PIO_Configure,
402+
// as Peripheral A was enable by default before,
403+
// and pullups were not enabled
407404
}
408405

409406
TwoWire Wire = TwoWire(WIRE_INTERFACE, Wire_Init, Wire_Deinit);
@@ -439,12 +436,9 @@ static void Wire1_Deinit(void) {
439436

440437
pmc_disable_periph_clk(WIRE1_INTERFACE_ID);
441438

442-
// disable pull ups
443-
pinMode(PIN_WIRE1_SDA, OUTPUT);
444-
pinMode(PIN_WIRE1_SCL, OUTPUT);
445-
446-
digitalWrite(PIN_WIRE1_SDA, LOW);
447-
digitalWrite(PIN_WIRE1_SCL, LOW);
439+
// no need to undo PIO_Configure,
440+
// as Peripheral A was enable by default before,
441+
// and pullups were not enabled
448442
}
449443

450444
TwoWire Wire1 = TwoWire(WIRE1_INTERFACE, Wire1_Init, Wire1_Deinit);

0 commit comments

Comments
 (0)