Set Wire to use the pins defined in pins_arduino.h

thanks @ladyada
This commit is contained in:
me-no-dev 2016-11-13 16:57:25 +02:00
parent 2cc1a6a1da
commit b5e0ebfc89
2 changed files with 2 additions and 4 deletions

View File

@ -47,7 +47,7 @@ void TwoWire::begin(int sdaPin, int sclPin, uint32_t frequency)
{ {
if(sdaPin < 0) { if(sdaPin < 0) {
if(num == 0) { if(num == 0) {
sdaPin = I2C0_DEFAULT_SDA_PIN; sdaPin = SDA;
} else { } else {
return; return;
} }
@ -55,7 +55,7 @@ void TwoWire::begin(int sdaPin, int sclPin, uint32_t frequency)
if(sclPin < 0) { if(sclPin < 0) {
if(num == 0) { if(num == 0) {
sclPin = I2C0_DEFAULT_SCL_PIN; sclPin = SCL;
} else { } else {
return; return;
} }

View File

@ -29,8 +29,6 @@
#include "freertos/queue.h" #include "freertos/queue.h"
#define I2C_BUFFER_LENGTH 128 #define I2C_BUFFER_LENGTH 128
#define I2C0_DEFAULT_SDA_PIN 21
#define I2C0_DEFAULT_SCL_PIN 22
class TwoWire class TwoWire
{ {