hal_i2c_slave_receive_it问题?
我使用此api hal_i2c_slave_receive_it(& hi2c1,buff,100)遇到了问题不会以接下来的100个字节传输的方式将它们与20个字节混合在一起,而我的回调(20 +(100-20))会损坏的框架!
有没有办法避免使用此用例,然后更新HAL_I2C_SLAVE_RECEIVE_IT API中的第三个参数为1而不是100?
提前致谢!
I had a problem using this API HAL_I2C_Slave_Receive_IT(&hi2c1, buff, 100) in case I send 20 bytes for example which is a corrupted frame for me (I am waiting for 100 bytes) then i2c driver will stack this 20 bytes and it does not free them in a manner that the next 100 bytes transmitted will be mixed with that 20 bytes and I will got a corrupted frame in my callback (20 + (100-20))!
Is there a way to avoid this use case other then updating the third parameter in HAL_I2C_Slave_Receive_IT API to 1 instead of 100?
thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此功能不知道您的意图是什么。您告诉它要接收100比较,它将这样做,直到实际收到100个字节或发生错误为止。您可以将其发送到一块或许多人中。它不会丢弃任何数据。
您需要自己实施此逻辑。
This function does not know what your intentions are. You told it to receive 100bytes and it will do it until 100 bytes are actually received or an error occurs. You can send it in one chunk or in many. It will not discard any data.
You need to implement this logic yourself.