Skip to content

Commit 30f0d8b

Browse files
committed
rename '_txAddress' to '_transmissionAddress'
This is to clarify that the ```_transmissionAddress``` is only valid (stored) between begin and end transissions. It is needed to remember where the user wants the data to go.
1 parent bc41fb6 commit 30f0d8b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libraries/Wire/src/Wire.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ uint8_t TwoWire::requestFrom(uint8_t address, size_t quantity)
144144

145145
void TwoWire::beginTransmission(uint8_t address) {
146146
// save address of target and clear buffer
147-
_txAddress = address;
147+
_transmissionAddress = address;
148148
_txBuffer.clear();
149149

150150
_transmissionBegun = true;
@@ -161,7 +161,7 @@ uint8_t TwoWire::endTransmission(bool stopBit)
161161
_transmissionBegun = false ;
162162

163163
am_hal_iom_transfer_t iomTransfer = {0};
164-
iomTransfer.uPeerInfo.ui32I2CDevAddr = _txAddress;
164+
iomTransfer.uPeerInfo.ui32I2CDevAddr = _transmissionAddress;
165165
iomTransfer.ui32InstrLen = 0; // Use only data phase
166166
iomTransfer.ui32Instr = 0; //
167167
// iomTransfer.ui32NumBytes = ; //

libraries/Wire/src/Wire.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class TwoWire : public Stream, public IOMaster {
7373
ap3_gpio_pin_t _padSCL;
7474

7575
bool _transmissionBegun;
76-
uint8_t _txAddress;
76+
uint8_t _transmissionAddress;
7777

7878

7979
RingBufferN<AP3_WIRE_RX_BUFFER_LEN> _rxBuffer;// RX Buffer

0 commit comments

Comments
 (0)