Skip to content

Commit 70c2a85

Browse files
committed
Fix compiler warning in Wire library
Fix stm32duino#44 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 2fbfed0 commit 70c2a85

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

libraries/Wire/Wire.cpp

+14-11
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,24 @@ void TwoWire::setClock(uint32_t frequency)
107107

108108
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint32_t iaddress, uint8_t isize, uint8_t sendStop)
109109
{
110+
UNUSED(sendStop);
110111
if (master == true) {
111112
if (isize > 0) {
112-
// send internal address; this mode allows sending a repeated start to access
113-
// some devices' internal registers. This function is executed by the hardware
114-
// TWI module on other processors (for example Due's TWI_IADR and TWI_MMR registers)
113+
// send internal address; this mode allows sending a repeated start to access
114+
// some devices' internal registers. This function is executed by the hardware
115+
// TWI module on other processors (for example Due's TWI_IADR and TWI_MMR registers)
115116

116-
beginTransmission(address);
117+
beginTransmission(address);
117118

118-
// the maximum size of internal address is 3 bytes
119-
if (isize > 3){
120-
isize = 3;
121-
}
119+
// the maximum size of internal address is 3 bytes
120+
if (isize > 3){
121+
isize = 3;
122+
}
122123

123-
// write internal register address - most significant byte first
124-
while (isize-- > 0)
125-
write((uint8_t)(iaddress >> (isize*8)));
124+
// write internal register address - most significant byte first
125+
while (isize-- > 0) {
126+
write((uint8_t)(iaddress >> (isize*8)));
127+
}
126128
endTransmission(false);
127129
}
128130

@@ -196,6 +198,7 @@ void TwoWire::beginTransmission(int address)
196198
//
197199
uint8_t TwoWire::endTransmission(uint8_t sendStop)
198200
{
201+
UNUSED(sendStop);
199202
int8_t ret = 4;
200203

201204
if (master == true) {

0 commit comments

Comments
 (0)