File tree 1 file changed +3
-10
lines changed
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -69,16 +69,9 @@ void arduino::MbedI2C::beginTransmission(uint8_t address) {
69
69
}
70
70
71
71
uint8_t arduino::MbedI2C::endTransmission (bool stopBit) {
72
- #ifndef TARGET_PORTENTA_H7
73
- if (usedTxBuffer == 0 ) {
74
- // we are scanning, return 0 if the addresed device responds with an ACK
75
- char buf[1 ];
76
- int ret = master->read (_address, buf, 1 , !stopBit);
77
- return ret;
78
- }
79
- #endif
80
72
if (master->write (_address, (const char *) txBuffer, usedTxBuffer, !stopBit) == 0 ) return 0 ;
81
- return 2 ;
73
+ if (usedTxBuffer == 0 ) return 2 ; // received NAK on transmit of address (without data)
74
+ return 3 ; // received NAK on transmit of data
82
75
}
83
76
84
77
uint8_t arduino::MbedI2C::endTransmission (void ) {
@@ -188,4 +181,4 @@ arduino::MbedI2C Wire(I2C_SDA, I2C_SCL);
188
181
#endif
189
182
#if WIRE_HOWMANY > 1
190
183
arduino::MbedI2C Wire1 (I2C_SDA1, I2C_SCL1);
191
- #endif
184
+ #endif
You can’t perform that action at this time.
0 commit comments