2323#include " Wire.h"
2424#include " pinDefinitions.h"
2525
26- arduino::MbedI2C::MbedI2C (int sda, int scl) : _sda(digitalPinToPinName(sda)), _scl(digitalPinToPinName(scl)), usedTxBuffer(0 ) {}
26+ arduino::MbedI2C::MbedI2C (int sda, int scl) : _sda(digitalPinToPinName(sda)), _scl(digitalPinToPinName(scl)), usedTxBuffer(0 ), slave_th(osPriorityNormal, 2048 , nullptr , " I2CSlave " ) {}
2727
28- arduino::MbedI2C::MbedI2C (PinName sda, PinName scl) : _sda(sda), _scl(scl), usedTxBuffer(0 ) {}
28+ arduino::MbedI2C::MbedI2C (PinName sda, PinName scl) : _sda(sda), _scl(scl), usedTxBuffer(0 ), slave_th(osPriorityNormal, 2048 , nullptr , " I2CSlave " ) {}
2929
3030void arduino::MbedI2C::begin () {
3131 master = new mbed::I2C (_sda, _scl);
@@ -150,7 +150,7 @@ void arduino::MbedI2C::receiveThd() {
150150 case mbed::I2CSlave::WriteGeneral:
151151 case mbed::I2CSlave::WriteAddressed:
152152 rxBuffer.clear ();
153- char buf[72 ];
153+ char buf[240 ];
154154 c = slave->read (buf, sizeof (buf));
155155 for (buf_idx = 0 ; buf_idx < c; buf_idx++) {
156156 if (rxBuffer.availableForStore ()) {
@@ -185,5 +185,5 @@ void arduino::MbedI2C::onRequest(voidFuncPtr cb) {
185185arduino::MbedI2C Wire (I2C_SDA, I2C_SCL);
186186#endif
187187#if WIRE_HOWMANY > 1
188- arduino::MbedI2C Wire1 (I2C_SDA1, I2C_SCL1);;
188+ arduino::MbedI2C Wire1 (I2C_SDA1, I2C_SCL1);
189189#endif
0 commit comments