Build text base interface
This commit is contained in:
@@ -31,6 +31,9 @@ void GobotRPC_TI_Hardware_RP2040_I2C::i2cRxTask() {
|
||||
bool read_res = readI2C(&pkg, addr);
|
||||
xSemaphoreGive(i2cMutex);
|
||||
|
||||
if(!read_res)
|
||||
continue;
|
||||
|
||||
pkg.addr |= (i) << 8;
|
||||
|
||||
if(pushPackageCB != NULL)
|
||||
@@ -54,6 +57,10 @@ bool GobotRPC_TI_Hardware_RP2040_I2C::readI2C(GoRPCPackage_Transport * pkg, uint
|
||||
|
||||
size_t len = pkg->data[CI_RX_PACKAGE_DATA_OFFSET + 1];
|
||||
|
||||
if(len > 64) {
|
||||
return false;
|
||||
}
|
||||
|
||||
res = i2c_read_blocking(i2c, addr, ((uint8_t *)pkg->data) + CI_RX_PACKAGE_DATA_OFFSET, len, false);
|
||||
pkg->len = len;
|
||||
pkg->addr = addr;
|
||||
|
||||
Reference in New Issue
Block a user