From 851efaefd77989c535c5b060b54ad24e6d3419eb Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Tue, 29 Sep 2015 17:12:33 -0400 Subject: [PATCH] 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. --- hardware/arduino/sam/libraries/Wire/Wire.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hardware/arduino/sam/libraries/Wire/Wire.cpp b/hardware/arduino/sam/libraries/Wire/Wire.cpp index 12c225316..ce16cc1eb 100644 --- a/hardware/arduino/sam/libraries/Wire/Wire.cpp +++ b/hardware/arduino/sam/libraries/Wire/Wire.cpp @@ -398,12 +398,9 @@ static void Wire_Deinit(void) { pmc_disable_periph_clk(WIRE_INTERFACE_ID); - // disable pull ups - pinMode(PIN_WIRE_SDA, OUTPUT); - pinMode(PIN_WIRE_SCL, OUTPUT); - - digitalWrite(PIN_WIRE_SDA, LOW); - digitalWrite(PIN_WIRE_SCL, LOW); + // no need to undo PIO_Configure, + // as Peripheral A was enable by default before, + // and pullups were not enabled } TwoWire Wire = TwoWire(WIRE_INTERFACE, Wire_Init, Wire_Deinit); @@ -439,12 +436,9 @@ static void Wire1_Deinit(void) { pmc_disable_periph_clk(WIRE1_INTERFACE_ID); - // disable pull ups - pinMode(PIN_WIRE1_SDA, OUTPUT); - pinMode(PIN_WIRE1_SCL, OUTPUT); - - digitalWrite(PIN_WIRE1_SDA, LOW); - digitalWrite(PIN_WIRE1_SCL, LOW); + // no need to undo PIO_Configure, + // as Peripheral A was enable by default before, + // and pullups were not enabled } TwoWire Wire1 = TwoWire(WIRE1_INTERFACE, Wire1_Init, Wire1_Deinit);