drivers: i2c: nrfx_twim_rtio: cast buf to non-const
RTIO correctly declares tx buffers as const, however, the existing I2C API and NRFX (SDK) drivers don't. Therefor cast the const buf to non-const when passing the tx buf to the twim driver from the RTIO call to avoid the const warning. The tx buffer is being treated as const data naturally in the NRFX driver, its just not declared as such since we reuse the buffer for both RX and TX data. Alternatively the SDK and "shim" drivers built on top of it need to be updated, which is quite a bit of work :) Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
This commit is contained in:
parent
ee22f5ed63
commit
2e0092356f
1 changed files with 2 additions and 1 deletions
|
@ -74,7 +74,8 @@ static bool i2c_nrfx_twim_rtio_start(const struct device *dev)
|
|||
sqe->tx.buf = config->common.msg_buf;
|
||||
}
|
||||
return i2c_nrfx_twim_rtio_msg_start(dev, I2C_MSG_WRITE | sqe->iodev_flags,
|
||||
sqe->tx.buf, sqe->tx.buf_len, dt_spec->addr);
|
||||
(uint8_t *)sqe->tx.buf, sqe->tx.buf_len,
|
||||
dt_spec->addr);
|
||||
case RTIO_OP_I2C_CONFIGURE:
|
||||
(void)i2c_nrfx_twim_configure(dev, sqe->i2c_config);
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue