Skip to content

Commit 3c1051f

Browse files
committed
[Wire] rename variables
1 parent d20a551 commit 3c1051f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

libraries/buildin/Wire/Wire.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ uint8_t TwoWire::twi_readFrom(unsigned char address, unsigned char * buf, unsign
6666
flag |= RT_I2C_NO_STOP;
6767
}
6868

69-
return rt_i2c_master_recv(_i2c_bus_dev, address, flag, buf, len);
69+
return rt_i2c_master_recv(_bus_dev, address, flag, buf, len);
7070
}
7171

7272
/*
@@ -92,7 +92,7 @@ uint8_t TwoWire::twi_writeTo(unsigned char address, unsigned char * buf, unsigne
9292
flag |= RT_I2C_NO_STOP;
9393
}
9494

95-
if(rt_i2c_master_send(_i2c_bus_dev, address, flag, buf, len) != 0)
95+
if(rt_i2c_master_send(_bus_dev, address, flag, buf, len) != 0)
9696
{
9797
return 0; //success
9898
}
@@ -114,7 +114,7 @@ uint8_t TwoWire::twi_writeTo(unsigned char address, unsigned char * buf, unsigne
114114
*/
115115
uint8_t TwoWire::twi_transmit(const uint8_t * buf, uint8_t len)
116116
{
117-
int8_t ret = rt_i2c_master_send(_i2c_bus_dev, txAddress, RT_NULL, buf, len);
117+
int8_t ret = rt_i2c_master_send(_bus_dev, txAddress, RT_NULL, buf, len);
118118

119119
if(ret > 0)
120120
{
@@ -140,8 +140,8 @@ void twi_disable(void)
140140

141141
TwoWire::TwoWire()
142142
{
143-
_i2c_bus_dev = RT_NULL;
144-
_i2c_bus_dev_initialized = false;
143+
_bus_dev = RT_NULL;
144+
_bus_dev_initialized = false;
145145
rt_memset(rxBuffer, 0, RTDUINO_WIRE_BUFFER_LENGTH);
146146
rt_memset(txBuffer, 0, RTDUINO_WIRE_BUFFER_LENGTH);
147147
rxBufferIndex = 0;
@@ -158,7 +158,7 @@ TwoWire::TwoWire()
158158

159159
void TwoWire::begin(const char *i2c_dev_name)
160160
{
161-
if (_i2c_bus_dev_initialized)
161+
if (_bus_dev_initialized)
162162
{
163163
return;
164164
}
@@ -178,8 +178,8 @@ void TwoWire::begin(const char *i2c_dev_name)
178178
txBufferIndex = 0;
179179
txBufferLength = 0;
180180

181-
_i2c_bus_dev = dev;
182-
_i2c_bus_dev_initialized = true;
181+
_bus_dev = dev;
182+
_bus_dev_initialized = true;
183183
}
184184

185185
//void TwoWire::begin(uint8_t address)
@@ -495,12 +495,12 @@ void TwoWire::flush(void)
495495

496496
bool TwoWire::isBusDeviceInited(void)
497497
{
498-
return _i2c_bus_dev_initialized;
498+
return _bus_dev_initialized;
499499
}
500500

501501
struct rt_i2c_bus_device* TwoWire::getBusDevice(void)
502502
{
503-
return _i2c_bus_dev;
503+
return _bus_dev;
504504
}
505505

506506
// Preinstantiate Objects //////////////////////////////////////////////////////

libraries/buildin/Wire/Wire.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
class TwoWire : public Stream
5454
{
5555
private:
56-
bool _i2c_bus_dev_initialized;
57-
struct rt_i2c_bus_device *_i2c_bus_dev;
56+
bool _bus_dev_initialized;
57+
struct rt_i2c_bus_device *_bus_dev;
5858

5959
uint8_t rxBuffer[RTDUINO_WIRE_BUFFER_LENGTH];
6060
size_t rxBufferIndex;

0 commit comments

Comments
 (0)