Fix AT24MAC driver builds on targets that device SDA/SCL names

Some targets have SDA and SCL defined in public headers, breaking the
build of AT24MAC driver.
pull/7814/head
Seppo Takalo 2018-08-31 18:24:45 +03:00 committed by Cruz Monrreal II
parent f81b728575
commit 50376154b4
1 changed files with 7 additions and 7 deletions

View File

@ -31,21 +31,21 @@
AT24Mac::I2CReset::I2CReset(PinName sda, PinName scl)
{
mbed::DigitalInOut SDA(sda, PIN_OUTPUT, PullUp, 1);
mbed::DigitalInOut SCL(scl, PIN_OUTPUT, PullUp, 0);
mbed::DigitalInOut pin_sda(sda, PIN_OUTPUT, PullUp, 1);
mbed::DigitalInOut pin_scl(scl, PIN_OUTPUT, PullUp, 0);
//generate 9 clocks for worst-case scenario
for (int i = 0; i < 10; ++i) {
SCL = 1;
pin_scl = 1;
wait_us(5);
SCL = 0;
pin_scl = 0;
wait_us(5);
}
//generate a STOP condition
SDA = 0;
pin_sda = 0;
wait_us(5);
SCL = 1;
pin_scl = 1;
wait_us(5);
SDA = 1;
pin_sda = 1;
wait_us(5);
}