mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
f81b728575
commit
50376154b4
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue